@@ -757,32 +757,64 @@ export class NTT {
757
757
chain : ChainName
758
758
limit : BN
759
759
} ) {
760
- const ix = await this . program . methods . setOutboundLimit ( {
760
+ const ix = await this . createOutboundLimitInstruction ( {
761
+ owner : args . owner . publicKey ,
761
762
limit : args . limit
762
- } )
763
+ } ) ;
764
+ return this . sendAndConfirmTransaction (
765
+ new Transaction ( ) . add ( ix ) ,
766
+ [ args . owner ]
767
+ ) ;
768
+ }
769
+
770
+ async createOutboundLimitInstruction ( args : {
771
+ owner : PublicKey
772
+ limit : BN
773
+ } ) {
774
+ return this . program . methods
775
+ . setOutboundLimit ( {
776
+ limit : args . limit
777
+ } )
763
778
. accounts ( {
764
- owner : args . owner . publicKey ,
779
+ owner : args . owner ,
765
780
config : this . configAccountAddress ( ) ,
766
781
rateLimit : this . outboxRateLimitAccountAddress ( ) ,
767
- } ) . instruction ( ) ;
768
- return sendAndConfirmTransaction ( this . program . provider . connection , new Transaction ( ) . add ( ix ) , [ args . owner ] ) ;
782
+ } )
783
+ . instruction ( ) ;
769
784
}
770
785
771
786
async setInboundLimit ( args : {
772
787
owner : Keypair
773
788
chain : ChainName
774
789
limit : BN
775
790
} ) {
776
- const ix = await this . program . methods . setInboundLimit ( {
777
- chainId : { id : toChainId ( args . chain ) } ,
791
+ const ix = await this . createInboundLimitInstruction ( {
792
+ owner : args . owner . publicKey ,
793
+ chain : args . chain ,
778
794
limit : args . limit
779
- } )
795
+ } ) ;
796
+ return this . sendAndConfirmTransaction (
797
+ new Transaction ( ) . add ( ix ) ,
798
+ [ args . owner ]
799
+ ) ;
800
+ }
801
+
802
+ async createInboundLimitInstruction ( args : {
803
+ owner : PublicKey
804
+ chain : ChainName
805
+ limit : BN
806
+ } ) {
807
+ return this . program . methods
808
+ . setInboundLimit ( {
809
+ chainId : { id : toChainId ( args . chain ) } ,
810
+ limit : args . limit
811
+ } )
780
812
. accounts ( {
781
- owner : args . owner . publicKey ,
813
+ owner : args . owner ,
782
814
config : this . configAccountAddress ( ) ,
783
815
rateLimit : this . inboxRateLimitAccountAddress ( args . chain ) ,
784
- } ) . instruction ( ) ;
785
- return sendAndConfirmTransaction ( this . program . provider . connection , new Transaction ( ) . add ( ix ) , [ args . owner ] ) ;
816
+ } )
817
+ . instruction ( ) ;
786
818
}
787
819
788
820
async createReceiveWormholeMessageInstruction ( args : {
0 commit comments