Skip to content

Commit 7a756df

Browse files
committed
solana/ts/sdk: Added set inbound/outbound limits
1 parent 93350ab commit 7a756df

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

solana/ts/sdk/ntt.ts

+33
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,39 @@ export class NTT {
643643
this.program.provider.connection, new Transaction().add(ix, broadcastIx), [args.payer, args.owner, wormholeMessage])
644644
}
645645

646+
async setOutboundLimit(args: {
647+
owner: Keypair
648+
chain: ChainName
649+
limit: BN
650+
}) {
651+
const ix = await this.program.methods.setOutboundLimit({
652+
limit: args.limit
653+
})
654+
.accounts({
655+
owner: args.owner.publicKey,
656+
config: this.configAccountAddress(),
657+
rateLimit: this.outboxRateLimitAccountAddress(),
658+
}).instruction();
659+
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.owner]);
660+
}
661+
662+
async setInboundLimit(args: {
663+
owner: Keypair
664+
chain: ChainName
665+
limit: BN
666+
}) {
667+
const ix = await this.program.methods.setInboundLimit({
668+
chainId: { id: toChainId(args.chain) },
669+
limit: args.limit
670+
})
671+
.accounts({
672+
owner: args.owner.publicKey,
673+
config: this.configAccountAddress(),
674+
rateLimit: this.inboxRateLimitAccountAddress(args.chain),
675+
}).instruction();
676+
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.owner]);
677+
}
678+
646679
async createReceiveWormholeMessageInstruction(args: {
647680
payer: PublicKey
648681
vaa: SignedVaa

0 commit comments

Comments
 (0)