Skip to content

Commit

Permalink
Make submitTransaction return { hash: string, output?: any }
Browse files Browse the repository at this point in the history
Make submitTransaction return { hash: string, output?: any }
  • Loading branch information
xbtmatt committed Oct 31, 2023
1 parent c88fc84 commit 68ff598
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/wallet-adapter-core/src/WalletCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,15 @@ export class WalletCore extends EventEmitter<WalletCoreEvents> {
async submitTransaction(
transactionInput: InputGenerateTransactionData,
options?: TransactionOptions,
): Promise<any> {
): 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(
Expand Down

0 comments on commit 68ff598

Please sign in to comment.