Skip to content

Commit fe932e8

Browse files
committed
solana/ts/sdk: Added set inbound/outbound limits
1 parent bdc8a23 commit fe932e8

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

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

0 commit comments

Comments
 (0)