diff --git a/src/api/transactionSubmission/simulate.ts b/src/api/transactionSubmission/simulate.ts index 7cf9d4c90..c061585b6 100644 --- a/src/api/transactionSubmission/simulate.ts +++ b/src/api/transactionSubmission/simulate.ts @@ -1,7 +1,7 @@ // Copyright © Aptos Foundation // SPDX-License-Identifier: Apache-2.0 -import { PublicKey } from "../../core"; +import type { PublicKeyInput } from "../../core"; import { simulateTransaction } from "../../internal/transactionSubmission"; import { AnyRawTransaction, InputSimulateTransactionOptions } from "../../transactions"; import { UserTransactionResponse } from "../../types"; @@ -30,9 +30,9 @@ export class Simulate { */ @ValidateFeePayerDataOnSimulation async simple(args: { - signerPublicKey: PublicKey; + signerPublicKey: PublicKeyInput; transaction: AnyRawTransaction; - feePayerPublicKey?: PublicKey; + feePayerPublicKey?: PublicKeyInput; options?: InputSimulateTransactionOptions; }): Promise> { return simulateTransaction({ aptosConfig: this.config, ...args }); @@ -51,10 +51,10 @@ export class Simulate { */ @ValidateFeePayerDataOnSimulation async multiAgent(args: { - signerPublicKey: PublicKey; + signerPublicKey: PublicKeyInput; transaction: AnyRawTransaction; - secondarySignersPublicKeys: Array; - feePayerPublicKey?: PublicKey; + secondarySignersPublicKeys: PublicKeyInput[]; + feePayerPublicKey?: PublicKeyInput; options?: InputSimulateTransactionOptions; }): Promise> { return simulateTransaction({ aptosConfig: this.config, ...args }); diff --git a/src/api/transactionSubmission/submit.ts b/src/api/transactionSubmission/submit.ts index 5be79f5a5..82b863d93 100644 --- a/src/api/transactionSubmission/submit.ts +++ b/src/api/transactionSubmission/submit.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { submitTransaction } from "../../internal/transactionSubmission"; -import { AccountAuthenticator, AnyRawTransaction } from "../../transactions"; +import { AccountAuthenticator, MultiAgentTransaction, SimpleTransaction } from "../../transactions"; import { PendingTransactionResponse } from "../../types"; import { AptosConfig } from "../aptosConfig"; import { ValidateFeePayerDataOnSubmission } from "./helpers"; @@ -28,7 +28,7 @@ export class Submit { */ @ValidateFeePayerDataOnSubmission async simple(args: { - transaction: AnyRawTransaction; + transaction: SimpleTransaction; senderAuthenticator: AccountAuthenticator; feePayerAuthenticator?: AccountAuthenticator; }): Promise { @@ -47,7 +47,7 @@ export class Submit { */ @ValidateFeePayerDataOnSubmission async multiAgent(args: { - transaction: AnyRawTransaction; + transaction: MultiAgentTransaction; senderAuthenticator: AccountAuthenticator; additionalSignersAuthenticators: Array; feePayerAuthenticator?: AccountAuthenticator; diff --git a/src/transactions/types.ts b/src/transactions/types.ts index d2f6ca64c..27a762c57 100644 --- a/src/transactions/types.ts +++ b/src/transactions/types.ts @@ -274,12 +274,21 @@ export type InputGenerateTransactionData = | InputGenerateSingleSignerRawTransactionData | InputGenerateMultiAgentRawTransactionData; -/** - * Interface that holds the user data input when submitting a transaction - */ -export interface InputSubmitTransactionData { - transaction: AnyRawTransaction; +export interface SubmitSimpleTransactionArgs { + transaction: SimpleTransaction; + senderAuthenticator: AccountAuthenticator; + additionalSignersAuthenticators?: undefined; + feePayerAuthenticator?: AccountAuthenticator; +} + +export interface SubmitMultiSignerTransactionArgs { + transaction: MultiAgentTransaction; senderAuthenticator: AccountAuthenticator; + additionalSignersAuthenticators: AccountAuthenticator[]; feePayerAuthenticator?: AccountAuthenticator; - additionalSignersAuthenticators?: Array; } + +/** + * Interface that holds the user data input when submitting a transaction + */ +export type InputSubmitTransactionData = SubmitSimpleTransactionArgs | SubmitMultiSignerTransactionArgs;