Skip to content

Commit 000337f

Browse files
kev1n-peterskcsongor
authored andcommitted
solana/ts/sdk: Added set inbound/outbound limits
1 parent 1d7954a commit 000337f

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
@@ -591,6 +591,39 @@ export class NTT {
591591
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.payer, args.owner]);
592592
}
593593

594+
async setOutboundLimit(args: {
595+
owner: Keypair
596+
chain: ChainName
597+
limit: BN
598+
}) {
599+
const ix = await this.program.methods.setOutboundLimit({
600+
limit: args.limit
601+
})
602+
.accounts({
603+
owner: args.owner.publicKey,
604+
config: this.configAccountAddress(),
605+
rateLimit: this.outboxRateLimitAccountAddress(),
606+
}).instruction();
607+
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.owner]);
608+
}
609+
610+
async setInboundLimit(args: {
611+
owner: Keypair
612+
chain: ChainName
613+
limit: BN
614+
}) {
615+
const ix = await this.program.methods.setInboundLimit({
616+
chainId: { id: toChainId(args.chain) },
617+
limit: args.limit
618+
})
619+
.accounts({
620+
owner: args.owner.publicKey,
621+
config: this.configAccountAddress(),
622+
rateLimit: this.inboxRateLimitAccountAddress(args.chain),
623+
}).instruction();
624+
return sendAndConfirmTransaction(this.program.provider.connection, new Transaction().add(ix), [args.owner]);
625+
}
626+
594627
async createReceiveWormholeMessageInstruction(args: {
595628
payer: PublicKey
596629
vaa: SignedVaa

0 commit comments

Comments
 (0)