Skip to content

Commit 3bb0c4c

Browse files
kev1n-petersjohnsaigle
authored andcommitted
solana/ts/sdk: Added set inbound/outbound limits
1 parent 885b3d4 commit 3bb0c4c

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
@@ -648,6 +648,39 @@ export class NTT {
648648
this.program.provider.connection, new Transaction().add(ix, broadcastIx), [args.payer, args.owner, wormholeMessage])
649649
}
650650

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

0 commit comments

Comments
 (0)