From 7a2416d07b1a4f7d1f57d24df62762e3c72fe595 Mon Sep 17 00:00:00 2001 From: Vadim Macagon Date: Wed, 13 Nov 2019 17:44:05 +0700 Subject: [PATCH] Version 1.60.2 Fix TransferGateway.withdrawalReceiptAsync() to only unmarshal the token contract address when it's available. When withdrawing LOOM via the Binance Gateway the token contract address is not set on the withdrawal receipt. --- package.json | 2 +- src/contracts/transfer-gateway.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index daa21033..cc9864a1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "name": "Loom Network", "url": "https://loomx.io" }, - "version": "1.60.1", + "version": "1.60.2", "keywords": [ "blockchain", "dappchain" diff --git a/src/contracts/transfer-gateway.ts b/src/contracts/transfer-gateway.ts index 0ab25bbd..c539f029 100644 --- a/src/contracts/transfer-gateway.ts +++ b/src/contracts/transfer-gateway.ts @@ -31,8 +31,8 @@ export interface IUnclaimedToken { export interface IWithdrawalReceipt { tokenOwner: Address - // Mainnet address of token contract - tokenContract: Address + // Mainnet address of token contract (NOTE: not set when withdrawing LOOM via Binance Gateway) + tokenContract?: Address tokenKind: TransferGatewayTokenKind // ERC721/X token ID tokenId?: BN @@ -402,9 +402,12 @@ export class TransferGateway extends Contract { value = tokenAmount break } + return { tokenOwner: Address.UnmarshalPB(receipt.getTokenOwner()!), - tokenContract: Address.UnmarshalPB(receipt.getTokenContract()!), + tokenContract: receipt.getTokenContract() + ? Address.UnmarshalPB(receipt.getTokenContract()!) + : undefined, tokenKind, tokenId, tokenAmount,