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.offlineSingingTest
.
To start, we will create two RESTClient
instances. One that is connected to the network, and one that is offline. We will be using 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 we then retrieve the transaction hash from the online REST client and compare it to the transaction hash we computed earlier, we should see that they match.