From 68ff598489cf751e37cc361ab11c156b2a27e05e Mon Sep 17 00:00:00 2001 From: xbtmatt Date: Tue, 31 Oct 2023 12:23:09 -0700 Subject: [PATCH] Make submitTransaction return { hash: string, output?: any } Make submitTransaction return { hash: string, output?: any } --- packages/wallet-adapter-core/src/WalletCore.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/wallet-adapter-core/src/WalletCore.ts b/packages/wallet-adapter-core/src/WalletCore.ts index 7e73424a..a1813b84 100644 --- a/packages/wallet-adapter-core/src/WalletCore.ts +++ b/packages/wallet-adapter-core/src/WalletCore.ts @@ -386,15 +386,15 @@ export class WalletCore extends EventEmitter { async submitTransaction( transactionInput: InputGenerateTransactionData, options?: TransactionOptions, - ): Promise { + ): Promise<{ hash: string, output?: any }> { const payloadData = transactionInput.data; const aptosConfig = new AptosConfig({network: convertNetwork(this._network)}); // TODO: Refactor this any, and remove the need for it by fixing the if ("bytecode" in data) stuff in `generateTransaction` in the v2 SDK const newPayload = await generateTransactionPayload({ ...payloadData as any, aptosConfig: aptosConfig }); - console.log(newPayload); const oldTransactionPayload = convertToBCSPayload(newPayload); const response = await this.signAndSubmitBCSTransaction(oldTransactionPayload, options); - return response; + const { hash, ...output } = response; + return { hash, output }; } async signMultiAgentTransaction(