Update getNFTokenID to properly handle binary blob (#2247)

* Update NFTokenMint test

* Ensure the binary version works as well

* Remove meta being undefined in txResponse

* Remove error test

* Re-add test, error, and lint

* Add meta to test, and add string to allowed type

* Re-add meta being undefined with proper docs
This commit is contained in:
Jackson Mills
2023-06-23 16:17:29 -07:00
committed by GitHub
parent 6228f91c00
commit dc51e3a704
5 changed files with 98 additions and 59 deletions

View File

@@ -19,10 +19,11 @@ async function getTransaction(): Promise<void> {
})
console.log(tx)
// The meta field would be a string(hex) when the `binary` parameter is `true` for the `tx` request.
// The meta field can be undefined if the transaction has not been validated yet (and so has not changed the ledger).
if (tx.result.meta == null) {
throw new Error('meta not included in the response')
}
/*
* delivered_amount is the amount actually received by the destination account.
* Use this field to determine how much was delivered, regardless of whether the transaction is a partial payment.