Skip to content

Commit f05a70e

Browse files
committed
feat: add signing in broadcast transaction
1 parent 0eea7b3 commit f05a70e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/sdk/src/providers/gno-wallet/gno-wallet.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@gnolang/tm2-js-client';
99

1010
import { BroadcastType, NetworkInfo, WalletResponseFailureType, WalletResponseSuccessType } from '../../core';
11+
import { DEFAULT_RPC_URL, GNO_ADDRESS_PREFIX } from '../../core/constants/chains.constant';
1112
import { TM2WalletProvider } from '../../core/providers/tm2-wallet';
1213
import {
1314
AddEstablishResponse,
@@ -28,7 +29,6 @@ import {
2829
} from '../../core/types/methods';
2930
import { encodeTransaction } from '../../core/utils/encode.utils';
3031
import { makeResponseMessage } from '../../core/utils/message.utils';
31-
import { DEFAULT_RPC_URL, GNO_ADDRESS_PREFIX } from '../../core/constants/chains.constant';
3232
import { normalizeRpcUrl, validateNetworkInput } from '../../core/utils/network.utils';
3333

3434
export class GnoWalletProvider implements TM2WalletProvider {
@@ -187,12 +187,14 @@ export class GnoWalletProvider implements TM2WalletProvider {
187187
return makeResponseMessage(WalletResponseFailureType.NOT_CONNECTED);
188188
}
189189

190+
const signedTransaction = await this.wallet!.signTransaction(options.tx, decodeTxMessages);
191+
190192
const transactionEndpoint =
191193
options.broadcastType === BroadcastType.COMMIT
192194
? TransactionEndpoint.BROADCAST_TX_COMMIT
193195
: TransactionEndpoint.BROADCAST_TX_SYNC;
194196

195-
const transactionResult = await this.wallet!.sendTransaction(options.tx, transactionEndpoint);
197+
const transactionResult = await this.wallet!.sendTransaction(signedTransaction, transactionEndpoint);
196198
return makeResponseMessage(WalletResponseSuccessType.TRANSACTION_SUCCESS, transactionResult);
197199
}
198200

0 commit comments

Comments
 (0)