From 91333a6d84680e3689f5733b022f18df96d51cb7 Mon Sep 17 00:00:00 2001 From: Wei Su Date: Mon, 30 Oct 2023 15:25:35 +0800 Subject: [PATCH] fix: add `from` fallback using CyberAccount address --- src/CyberWallet.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/CyberWallet.ts b/src/CyberWallet.ts index 54216a9..f5501c8 100644 --- a/src/CyberWallet.ts +++ b/src/CyberWallet.ts @@ -92,18 +92,16 @@ class CyberWallet { } } - public sendTransaction( - transaction: WalletTransaction, - option?: { - description?: string; - }, - ) { + public sendTransaction(transaction: WalletTransaction) { this.messenger.sendMessage({ name: "action", data: { type: EventType.Request, method: "sendTransaction", - data: { transaction, option }, + data: { + ...transaction, + from: transaction.from || this.cyberAccount?.address, + }, }, });