5.2 Generating Transactions
To generate a transaction, you'll use the sov-cli
tool. Let's go through the process of creating a transfer transaction:
Create a JSON file named
transfer.json
with the following content:
{
"transfer": {
"to": "sov1zgfpyysjzgfpyysjzgfpyysjzgfpyysjzgfpyysjzgfpyysjzgfqve8h6h",
"coins": {
"amount": 200,
"token_id": "token_1rwrh8gn2py0dl4vv65twgctmlwck6esm2as9dftumcw89kqqn3nqrduss6"
}
}
}
This JSON represents a transfer of 200 tokens to the specified address.
Use
sov-cli
to import the transaction:
./target/debug/sov-cli transactions import from-file bank --max-fee 100000000 --path ./transfer.json
This command imports the transaction into the local transaction pool. The --max-fee
parameter sets the maximum gas fee you're willing to pay for this transaction.
Last updated
Was this helpful?