Closed yourheropaul closed 6 years ago
I feel like the implementation of this is a bit ugly, but I don't think there's a better way.
Not sure why it's ugly, you mean from solution or code style?
I feel like there's a more canonical way of unpacking the data hashes. But it works, so I guess it's fine.
Building on #664, the improves the console minting process.
API
The basic calls are the same as before: one governance key submits a transaction, resulting in a minting ID, and another governance key confirms the transaction by referencing the minting ID.
Transaction submission
Syntax
mtoken.mint(governance_key_address, recipient_address, amount_of_tokens)
Example usage in the console
This would submit a transaction of 10 mtokens to the address ending
b09b
. The transaction will not be actioned until it's confirmed by another governance key.Listing pending and complete transactions
Syntax
mtoken.mintList()
Example usage in the console
For which the output might be something like:
The
id
field is the minting ID, which will be needed in the confirmation step. Once a transaction is submitted, it will appear at the end of this list for verification. Theconfirmed
field indicated whether or not another governance key has confirmed the transaction (and thus actioned it).Confirming
Syntax
mtoken.confirm(governance_key_address, minting_id)
Example usage
This would confirm the transaction with minting ID
1
, and action it. In the example output above, it would issue 42 tokens to the address endingb09b
.