diff --git a/ecosystem/typescript/sdk/src/providers/aptos_client.ts b/ecosystem/typescript/sdk/src/providers/aptos_client.ts index 3571b3382a1f47..d0ff36733be489 100644 --- a/ecosystem/typescript/sdk/src/providers/aptos_client.ts +++ b/ecosystem/typescript/sdk/src/providers/aptos_client.ts @@ -322,27 +322,23 @@ export class AptosClient { * @param sender the sender's account address * @param payload the transaction payload * @param fee_payer the fee payer account - * @param secondary_signer_accounts an optional array of the secondary signers accounts + * @param secondarySignerAccounts an optional array of the secondary signers accounts * @returns a fee payer raw transaction that can be signed and submitted to chain */ async generateFeePayerTransaction( sender: MaybeHexString, payload: Gen.EntryFunctionPayload, - fee_payer: AptosAccount, - secondary_signer_accounts: Array = [], + feePayer: MaybeHexString, + secondarySignerAccounts: Array = [], options?: Partial, ): Promise { const rawTxn = await this.generateTransaction(sender, payload, options); - const signers: Array = secondary_signer_accounts.map((account) => - AccountAddress.fromHex(account.address()), - ); + const signers: Array = secondarySignerAccounts.map((signer) => { + return AccountAddress.fromHex(signer); + }); - const feePayerTxn = new TxnBuilderTypes.FeePayerRawTransaction( - rawTxn, - signers, - AccountAddress.fromHex(fee_payer.address()), - ); + const feePayerTxn = new TxnBuilderTypes.FeePayerRawTransaction(rawTxn, signers, AccountAddress.fromHex(feePayer)); return feePayerTxn; } @@ -359,12 +355,12 @@ export class AptosClient { feePayerTransaction: TxnBuilderTypes.FeePayerRawTransaction, senderAuthenticator: TxnBuilderTypes.AccountAuthenticatorEd25519, feePayerAuthenticator: TxnBuilderTypes.AccountAuthenticatorEd25519, - signersAuthenticators: Array = [], + additionalSignersAuthenticators: Array = [], ): Promise { const txAuthenticatorFeePayer = new TxnBuilderTypes.TransactionAuthenticatorFeePayer( senderAuthenticator, feePayerTransaction.secondary_signer_addresses, - signersAuthenticators, + additionalSignersAuthenticators, { address: feePayerTransaction.fee_payer_address, authenticator: feePayerAuthenticator }, ); diff --git a/ecosystem/typescript/sdk/src/tests/e2e/aptos_client.test.ts b/ecosystem/typescript/sdk/src/tests/e2e/aptos_client.test.ts index e66d4f394ab812..e8a41d1cd7b30c 100644 --- a/ecosystem/typescript/sdk/src/tests/e2e/aptos_client.test.ts +++ b/ecosystem/typescript/sdk/src/tests/e2e/aptos_client.test.ts @@ -522,7 +522,7 @@ test( }; // Create a fee payer transaction with the sender, transaction payload, and fee payer account - const feePayerTxn = await client.generateFeePayerTransaction(alice.address().hex(), payload, feePayer); + const feePayerTxn = await client.generateFeePayerTransaction(alice.address().hex(), payload, feePayer.address()); // sender and fee payer need to sign the transaction const senderAuthenticator = await client.signMultiTransaction(alice, feePayerTxn); @@ -622,8 +622,10 @@ test( arguments: [alice.address(), collectionName, tokenName, propertyVersion, 1], }; - // Create a fee payer transaction with the sender, transaction payload, and fee payer account - const feePayerTxn = await client.generateFeePayerTransaction(alice.address().hex(), payload, feePayer, [bob]); + // Create a fee payer transaction with the sender, transaction payload, fee payer account and secondary signers + const feePayerTxn = await client.generateFeePayerTransaction(alice.address().hex(), payload, feePayer.address(), [ + bob.address(), + ]); // sender and fee payer need to sign the transaction const senderAuthenticator = await client.signMultiTransaction(alice, feePayerTxn);