Closed yknl closed 4 years ago
Is there a use case in which a consumer would want to manage the nonce themselves, for some reason, and thus circumvent the request, thus needing something like makeSTXTokenTransferSync
?
Is there a use case in which a consumer would want to manage the nonce themselves, for some reason, and thus circumvent the request, thus needing something like makeSTXTokenTransferSync?
Yes I think that's a valid use case. We should be able to add that option.
Yeah - I find this change unnecessary for my use case. If we do add support for automatic fetching of nonce
, then we should do so in a separate function. I don't want this library to handle nonce
fetching (for the authenticator's use case), because that can run into issues when you have multiple unconfirmed TXs.
Sounds like we'd prefer to keep the transaction builder functions synchronous and have separate async nonce and fee estimation functions. Going to close this PR for now.
This PR makes the transaction builder functions async. This is to enable automatic handling of nonce values in the future. The nonce value will be retrieved from a core node API and requires a network request.
Builder functions affected:
makeSTXTokenTransfer
makeSmartContractDeploy
makeContractCall
New usage example:
or
Type of Change
Does this introduce a breaking change?
Yes
makeSTXTokenTransfer
makeSmartContractDeploy
makeContractCall
Are documentation updates required?
Yes.
Testing information
npm run test
Checklist
npm run test
passes