Switcheo / zilswap-sdk

Zilswap Typescript SDK
https://docs.zilswap.org
MIT License
18 stars 14 forks source link

Remove GetPendingTxn in favor of GetTransactionStatus #16

Closed melvinbeemer closed 3 years ago

melvinbeemer commented 3 years ago

This PR replaces GetPendingTxn with GetTransactionStatus because the former got removed from the Zilliqa RPC API causing a UI issue showing the transaction notification as confirming indefinitely.

Because GetTransactionStatus was added in V2 of the Zilliqa JS SDK I've updated that library to the latest version.

Instead of checking for confirmation on the pending txn this PR changes to check the modificationState on the transaction status. With the modificationState at 2 the transaction is processed as either confirmed or rejected. See details here: https://dev.zilliqa.com/docs/apis/api-transaction-get-transaction-status/