From c65204d4f0a4d7e93652136dbab5cc0d5372b022 Mon Sep 17 00:00:00 2001 From: Giannis Chatziveroglou Date: Wed, 15 Jun 2022 21:50:29 -0400 Subject: [PATCH] Expose payer in init instructions + bump version --- package.json | 2 +- src/programs/timeInvalidator/instruction.ts | 5 +++-- src/programs/tokenManager/instruction.ts | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7700b1dcc..86f2d58a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cardinal/token-manager", - "version": "1.4.7", + "version": "1.4.8", "description": "Cardinal token manager SDK", "keywords": [ "solana", diff --git a/src/programs/timeInvalidator/instruction.ts b/src/programs/timeInvalidator/instruction.ts index c3030e0cf..43a932dad 100644 --- a/src/programs/timeInvalidator/instruction.ts +++ b/src/programs/timeInvalidator/instruction.ts @@ -39,7 +39,8 @@ export const init = async ( connection: Connection, wallet: Wallet, tokenManagerId: PublicKey, - timeInvalidation: TimeInvalidationParams + timeInvalidation: TimeInvalidationParams, + payer?: PublicKey ): Promise<[TransactionInstruction, PublicKey]> => { const provider = new AnchorProvider(connection, wallet, {}); @@ -91,7 +92,7 @@ export const init = async ( tokenManager: tokenManagerId, timeInvalidator: timeInvalidatorId, issuer: wallet.publicKey, - payer: wallet.publicKey, + payer: payer || wallet.publicKey, systemProgram: SystemProgram.programId, }, } diff --git a/src/programs/tokenManager/instruction.ts b/src/programs/tokenManager/instruction.ts index 874996991..6387c6aca 100644 --- a/src/programs/tokenManager/instruction.ts +++ b/src/programs/tokenManager/instruction.ts @@ -63,7 +63,8 @@ export const init = async ( amount: BN, kind: TokenManagerKind, invalidationType: InvalidationType, - numInvalidators = 1 + numInvalidators = 1, + payer?: PublicKey ): Promise<[TransactionInstruction, PublicKey]> => { const provider = new AnchorProvider(connection, wallet, {}); const tokenManagerProgram = new Program( @@ -91,7 +92,7 @@ export const init = async ( mintCounter: mintCounterId, mint: mint, issuer: wallet.publicKey, - payer: wallet.publicKey, + payer: payer || wallet.publicKey, issuerTokenAccount: issuerTokenAccountId, systemProgram: SystemProgram.programId, },