Coins: A class that represents a list of Cosmos SDK coins.Fee: A class that’s used to define the fee for a transaction.RESTClient: A class that represents a REST client.MnemonicKey: A class that’s used to create a key from a mnemonic.MsgSend: A class that represents a message to send.Wallet: A class that represents a wallet.
mnemonic: The mnemonic of the account that will be signing the transaction.chainId: The chain ID of the network you are working on.restUrl: The URL of the Initia REST.gasPrices: The gas prices for the transaction.
offlineSigningTest.
To start, create two RESTClient instances. One that is connected to the
network, and one that is offline. You will use the offline REST client to sign
the transaction, and the online REST client to broadcast the transaction to
later compare.
wallet.createAndSignTx. This function takes
msgs: The message to send.accountNumber: The account number of the account that will be signing the transaction.sequence: The sequence number of the account that will be signing the transaction.fee: The fee for the transaction.
onlineRestClient client. If you then retrieve the
transaction hash from the online REST client and compare it to the transaction
hash you computed earlier, you should see that they match.
Full example
src/signing-transaction.ts