From b224623ad9ad8bb531cf0d7cd124d48ec1e2c4e1 Mon Sep 17 00:00:00 2001 From: Morley Zhi Date: Thu, 16 Jul 2020 17:47:17 -0400 Subject: [PATCH] don't check for errors with AnchorUSD --- package.json | 2 +- src/transfers/DepositProvider.ts | 5 ++++- src/transfers/WithdrawProvider.ts | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bce60592..c0c80d1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stellar/wallet-sdk", - "version": "0.1.0-rc.5", + "version": "0.1.0-rc.6", "description": "Libraries to help you write Stellar-enabled wallets in Javascript", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/transfers/DepositProvider.ts b/src/transfers/DepositProvider.ts index fe845b88..8b9d435d 100644 --- a/src/transfers/DepositProvider.ts +++ b/src/transfers/DepositProvider.ts @@ -141,7 +141,10 @@ export class DepositProvider extends TransferProvider { }); } - if (!response.ok) { + const isAnchorUSDSep6 = + !shouldUseNewEndpoints && this.transferServer.includes("anchorusd.com"); + + if (!response.ok && !isAnchorUSDSep6) { const responseText = await response.text(); try { const { error } = JSON.parse(responseText); diff --git a/src/transfers/WithdrawProvider.ts b/src/transfers/WithdrawProvider.ts index f4bbd7bf..727d192f 100644 --- a/src/transfers/WithdrawProvider.ts +++ b/src/transfers/WithdrawProvider.ts @@ -134,7 +134,10 @@ export class WithdrawProvider extends TransferProvider { }); } - if (!response.ok) { + const isAnchorUSDSep6 = + !shouldUseNewEndpoints && this.transferServer.includes("anchorusd.com"); + + if (!response.ok && !isAnchorUSDSep6) { const responseText = await response.text(); try { const { error } = JSON.parse(responseText);