From cf9c847e4144989b5bc1936149d171e90204777b Mon Sep 17 00:00:00 2001 From: Armani Ferrante Date: Sun, 14 Feb 2021 21:12:23 +0800 Subject: [PATCH] ts: Pass instructions to state rpcs --- ts/src/rpc.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ts/src/rpc.ts b/ts/src/rpc.ts index a259916b94..948ae32c41 100644 --- a/ts/src/rpc.ts +++ b/ts/src/rpc.ts @@ -246,6 +246,9 @@ export class RpcFactory { rpc[m.name] = async (...args: any[]): Promise => { const [_, ctx] = splitArgsAndCtx(m, [...args]); const tx = new Transaction(); + if (ctx.instructions !== undefined) { + tx.add(...ctx.instructions); + } tx.add(await ix[m.name](...args)); try { const txSig = await provider.send(tx, ctx.signers, ctx.options);