From c79f0d4d4692ab02bdef511b9e78778e018943cf Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 25 Mar 2022 10:43:16 -0300 Subject: [PATCH] [FEAT] File import custom token --- src/providers/profile/profile.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/providers/profile/profile.ts b/src/providers/profile/profile.ts index ef52b7a2914..aa224e9361a 100644 --- a/src/providers/profile/profile.ts +++ b/src/providers/profile/profile.ts @@ -1096,7 +1096,7 @@ export class ProfileProvider { } private _importFile(str: string, opts): Promise { - return new Promise((resolve, reject) => { + return new Promise(async (resolve, reject) => { opts = opts ? opts : {}; opts['bp_partner'] = this.appProvider.info.name; opts['bp_partner_version'] = this.appProvider.info.version; @@ -1172,6 +1172,16 @@ export class ProfileProvider { ); } + // check if custom token + if (!this.coinSupported(credentials.coin) && credentials.token) { + const customTokens = []; + customTokens.push({ + ...credentials.token, + ...{ symbol: credentials.token.symbol.toLowerCase() } + }); + await this.currencyProvider.addCustomToken(customTokens); + } + client.fromString(JSON.stringify(credentials)); if (key) {