Transactions
Explanation of transaction handling
Last updated
Was this helpful?
Explanation of transaction handling
Last updated
Was this helpful?
Amity offers on-chain token transactions between either discord users or outside public addresses.
After fetching account information and preferred network, a transaction is built using the following command fields:
The transaction building and signing looks like this:
If a contract is specified in the "*contract" field, the code looks slightly different as a transaction has to instead be built through a web3 contract object instead of a default tx dictionary.
First, the contract object has to be initialized through a Checksum address and ABI:
Web3 requires that contracts are called in a Checksum format, so the toChecksum of the contract provided is plugged into the contract object. The ABI used is a generic ERC20 file pulled from a separate file. After this, the transaction can begin to be built in a similar fashion to a normal coin (non-token) transaction:
Due to Amity utilizing contracts dynamically and by using generic ABI's, you can access and send any token just by referencing the contract address.