Skip to content

Commit 3a44412

Browse files
committed
solana/ts/sdk: Added set inbound/outbound limits
1 parent da60e2c commit 3a44412

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

solana/ts/sdk/index.ts

+33
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,39 @@ export class NTT {
627627
this.program.provider.connection, new Transaction().add(ix, broadcastIx), [args.payer, args.owner, wormholeMessage]);
628628
}
629629

630+
async setOutboundLimit(args: {
631+
owner: Keypair
632+
chain: ChainName
633+
limit: BN
634+
}) {
635+
const ix = await this.program.methods.setOutboundLimit({
636+
limit: args.limit
637+
})
638+
.accounts({
639+
owner: args.owner.publicKey,
640+
config: this.configAccountAddress(),
641+
rateLimit: this.outboxRateLimitAccountAddress(),
642+
}).instruction();
643+
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.owner]);
644+
}
645+
646+
async setInboundLimit(args: {
647+
owner: Keypair
648+
chain: ChainName
649+
limit: BN
650+
}) {
651+
const ix = await this.program.methods.setInboundLimit({
652+
chainId: { id: toChainId(args.chain) },
653+
limit: args.limit
654+
})
655+
.accounts({
656+
owner: args.owner.publicKey,
657+
config: this.configAccountAddress(),
658+
rateLimit: this.inboxRateLimitAccountAddress(args.chain),
659+
}).instruction();
660+
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.owner]);
661+
}
662+
630663
async createReceiveWormholeMessageInstruction(args: {
631664
payer: PublicKey
632665
vaa: SignedVaa

0 commit comments

Comments
 (0)