Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Misc fixes
Browse files Browse the repository at this point in the history
- Fix some error messages in transfers
- Fix an error where fetchTransaction was expecting the wrong shape to be returned by /transaction
  • Loading branch information
Morley Zhi committed Jan 7, 2020
1 parent 6287570 commit 13265af
Show file tree
Hide file tree
Showing 4 changed files with 1,772 additions and 53 deletions.
2 changes: 1 addition & 1 deletion src/transfers/DepositProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class DepositProvider extends TransferProvider {
*/
public getKycUrl(callback_url?: string) {
if (!this.response || !this.request) {
throw new Error(`Run startDeposit before calling fetchKycInBrowser!`);
throw new Error(`Run startDeposit before calling getKycUrl!`);
}

if (
Expand Down
4 changes: 2 additions & 2 deletions src/transfers/TransferProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export abstract class TransferProvider {
*/
public async fetchTransaction(
params: TransactionParams,
isWatching: boolean,
isWatching: boolean = false,
): Promise<Transaction> {
const {
asset_code,
Expand Down Expand Up @@ -228,7 +228,7 @@ export abstract class TransferProvider {
},
);

const transaction: Transaction = await response.json();
const { transaction }: { transaction: Transaction } = await response.json();

return _normalizeTransaction(transaction);
}
Expand Down
4 changes: 2 additions & 2 deletions src/transfers/WithdrawProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class WithdrawProvider extends TransferProvider {
*/
public async fetchKycInBrowser(windowContext: Window): Promise<KycStatus> {
if (!this.response || !this.request) {
throw new Error(`Run startDeposit before calling fetchKycInBrowser!`);
throw new Error(`Run startWithdraw before calling fetchKycInBrowser!`);
}

if (
Expand Down Expand Up @@ -261,7 +261,7 @@ export class WithdrawProvider extends TransferProvider {
*/
public getKycUrl(callback_url?: string) {
if (!this.response || !this.request) {
throw new Error(`Run startDeposit before calling fetchKycInBrowser!`);
throw new Error(`Run startWithdraw before calling getKycUrl!`);
}

if (
Expand Down
Loading

0 comments on commit 13265af

Please sign in to comment.