Skip to content

Commit

Permalink
Merge pull request #11973 from gabrielbazan7/feat/shib
Browse files Browse the repository at this point in the history
[FEAT] shib
  • Loading branch information
cmgustavo authored Dec 6, 2021
2 parents 856f3ae + 872f397 commit 4d968cf
Show file tree
Hide file tree
Showing 10 changed files with 85 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"apple-wallet-ng": "1.1.1",
"base64-js": "1.3.0",
"bitauth": "git+https://github.com/bitpay/bitauth.git#68cf0353bf517a7e5293478608839fa904351eb6",
"bitcore-wallet-client": "8.25.24",
"bitcore-wallet-client": "8.25.25",
"buffer-compare": "1.1.1",
"chart.js": "2.9.4",
"cordova": "10.0.0",
Expand Down
17 changes: 17 additions & 0 deletions src/assets/img/currencies/shib.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/components/coin-icon/coin-icon.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ coin-icon {
&_ltc {
background-color: #a6a9aa;
}
&_shib {
background-color: #f00500;
}
&_default {
background-color: #e6f8e9;
}
Expand Down
3 changes: 3 additions & 0 deletions src/pages/settings/alt-currency/alt-currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ export class AltCurrencyPage {
},
{
isoCode: 'WBTC'
},
{
isoCode: 'SHIB'
}
];
}
Expand Down
38 changes: 38 additions & 0 deletions src/providers/currency/coin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,5 +489,43 @@ export const availableCoins: CoinsMap<CoinOpts> = {
backgroundColor: '#f7921a',
gradientBackgroundColor: '#f7921a'
}
},
shib: {
name: 'SHIBA INU',
chain: 'ETH',
coin: 'shib',
unitInfo: {
unitName: 'SHIB',
unitToSatoshi: 1e18,
unitDecimals: 18,
unitCode: 'shib'
},
properties: {
hasMultiSig: false,
hasMultiSend: false,
isUtxo: false,
isERCToken: true,
isStableCoin: false,
singleAddress: true,
isCustom: false
},
paymentInfo: {
paymentCode: 'EIP681b',
protocolPrefix: { livenet: 'ethereum', testnet: 'ethereum' },
ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/shib',
blockExplorerUrls: 'etherscan.io/',
blockExplorerUrlsTestnet: 'kovan.etherscan.io/'
},
feeInfo: {
feeUnit: 'Gwei',
feeUnitAmount: 1000000000,
blockTime: 0.2,
maxMerchantFee: 'urgent'
},
theme: {
coinColor: '#2775ca',
backgroundColor: '#2775c9',
gradientBackgroundColor: '#2775c9'
}
}
};
9 changes: 7 additions & 2 deletions src/providers/currency/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export class CurrencyProvider {
DAI: 'dai',
WBTC: 'wbtc',
DOGE: 'doge',
LTC: 'ltc'
LTC: 'ltc',
SHIB: 'shib'
};

public popularERC20TokensSymbols: string[] = [
Expand Down Expand Up @@ -140,7 +141,7 @@ export class CurrencyProvider {
hasMultiSend: false,
isUtxo: false,
isERCToken: true,
isStableCoin: true,
isStableCoin: false,
singleAddress: true,
isCustom: true
},
Expand Down Expand Up @@ -215,6 +216,10 @@ export class CurrencyProvider {
return !!this.coinOpts[coin].properties.isERCToken;
}

isStableCoin(coin: string): boolean {
return !!this.coinOpts[coin].properties.isStableCoin;
}

isCustomERCToken(coin: string) {
let isBitpaySupportedToken: boolean =
this.getBitpaySupportedTokens().filter(token => {
Expand Down
6 changes: 6 additions & 0 deletions src/providers/currency/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ export const TokenOpts = {
symbol: 'WBTC',
decimal: 9,
address: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599'
},
'0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce': {
name: 'SHIBA INU',
symbol: 'SHIB',
decimal: 18,
address: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce'
}
};
6 changes: 5 additions & 1 deletion src/providers/rate/rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export class RateProvider {
this.alternatives[r.code] = { name: r.name };
}
});
this.rates[coin] = !_.isEmpty(coinRates) ? coinRates : { USD: 1 };
this.rates[coin] = !_.isEmpty(coinRates)
? coinRates
: this.currencyProvider.isStableCoin(coin)
? { USD: 1 }
: null;
this.ratesAvailable[coin] = true;
});
return Promise.resolve();
Expand Down
3 changes: 2 additions & 1 deletion src/providers/tx-format/tx-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export enum Coin {
BUSD = 'busd',
DAI = 'dai',
WBTC = 'wbtc',
DOGE = 'doge'
DOGE = 'doge',
SHIB = 'shib'
}
@Injectable()
export class TxFormatProvider {
Expand Down
3 changes: 3 additions & 0 deletions src/theme/lists.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
&_ltc {
background-color: #a6a9aa;
}
&_shib {
background-color: #f00500;
}
}
}
}
Expand Down

0 comments on commit 4d968cf

Please sign in to comment.