Skip to content

Commit 51e4325

Browse files
committed
feat: rsk integration
1 parent 405f774 commit 51e4325

File tree

21 files changed

+281
-10
lines changed

21 files changed

+281
-10
lines changed

assets/img/currencies/png/RBTC.png

29.8 KB
Loading

assets/img/currencies/png/xusd.png

12.2 KB
Loading

assets/img/currencies/rbtc.svg

Lines changed: 1 addition & 0 deletions
Loading

assets/img/currencies/xusd.svg

Lines changed: 1 addition & 0 deletions
Loading

src/constants/SupportedCurrencyOptions.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, {ReactElement} from 'react';
22
import BtcIcon from '../../assets/img/currencies/btc.svg';
33
import BchIcon from '../../assets/img/currencies/bch.svg';
44
import EthIcon from '../../assets/img/currencies/eth.svg';
5+
import RbtcIcon from '../../assets/img/currencies/rbtc.svg';
6+
import XUSDIcon from '../../assets/img/currencies/xusd.svg';
57
import DogeIcon from '../../assets/img/currencies/doge.svg';
68
import LtcIcon from '../../assets/img/currencies/ltc.svg';
79
import XrpIcon from '../../assets/img/currencies/xrp.svg';
@@ -32,6 +34,8 @@ export const CurrencyListIcons: {
3234
btc: props => <BtcIcon {...props} />,
3335
bch: props => <BchIcon {...props} />,
3436
eth: props => <EthIcon {...props} />,
37+
rbtc: props => <RbtcIcon {...props} />,
38+
xusd: props => <XUSDIcon {...props} />,
3539
doge: props => <DogeIcon {...props} />,
3640
ltc: props => <LtcIcon {...props} />,
3741
xrp: props => <XrpIcon {...props} />,
@@ -71,6 +75,14 @@ export const SupportedCurrencyOptions: Array<SupportedCurrencyOption> = [
7175
hasMultisig: false, // TODO
7276
imgSrc: require('../../assets/img/currencies/png/ETH.png'),
7377
},
78+
{
79+
id: 'rbtc',
80+
img: CurrencyListIcons.rbtc,
81+
currencyName: 'RSK',
82+
currencyAbbreviation: 'RBTC',
83+
hasMultisig: false, // TODO
84+
imgSrc: require('../../assets/img/currencies/png/RBTC.png'),
85+
},
7486
{
7587
id: 'doge',
7688
img: CurrencyListIcons.doge,
@@ -142,6 +154,14 @@ export const SupportedCurrencyOptions: Array<SupportedCurrencyOption> = [
142154
isToken: true,
143155
imgSrc: require('../../assets/img/currencies/png/BUSD.png'),
144156
},
157+
{
158+
id: 'xusd',
159+
img: CurrencyListIcons.xusd,
160+
currencyName: 'Sovryn XUSD',
161+
currencyAbbreviation: 'XUSD',
162+
isToken: true,
163+
imgSrc: require('../../assets/img/currencies/png/xusd.png'),
164+
},
145165
{
146166
id: 'dai',
147167
img: CurrencyListIcons.dai,

src/constants/config.card.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import BUSDShape from '../navigation/card/assets/currency-shapes/BUSD-shape.svg'
88
import DAIShape from '../navigation/card/assets/currency-shapes/DAI-shape.svg';
99
import DOGEShape from '../navigation/card/assets/currency-shapes/DOGE-shape.svg';
1010
import ETHShape from '../navigation/card/assets/currency-shapes/ETH-shape.svg';
11+
import RBTCShape from '../navigation/card/assets/currency-shapes/RBTC-shape.svg';
1112
import GUSDShape from '../navigation/card/assets/currency-shapes/GUSD-shape.svg';
1213
import USDPShape from '../navigation/card/assets/currency-shapes/USDP-shape.svg';
1314
import USDCShape from '../navigation/card/assets/currency-shapes/USDC-shape.svg';
@@ -192,6 +193,18 @@ export const SUPPORTED_DESIGN_CURRENCIES: SupportedDesignCurrenciesConfig = {
192193
pillCircleBackground: '#FFF',
193194
},
194195
},
196+
RBTC: {
197+
currency: 'RBTC',
198+
enabled: true,
199+
palette: {
200+
BackgroundShape: RBTCShape,
201+
stopColor1: '#9A9FF1',
202+
stopColor2: '#575DC2',
203+
pillColor: '#FFF',
204+
pillBackground: '#595FC6',
205+
pillCircleBackground: '#FFF',
206+
},
207+
},
195208
GUSD: {
196209
currency: 'GUSD',
197210
enabled: true,

src/constants/currencies.ts

Lines changed: 115 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export type SupportedCoins = 'btc' | 'bch' | 'ltc' | 'doge' | 'eth';
1+
export type SupportedCoins = 'btc' | 'bch' | 'ltc' | 'doge' | 'eth' | 'rbtc';
22
export type SupportedTokens =
33
| 'usdc'
44
| 'gusd'
@@ -8,7 +8,8 @@ export type SupportedTokens =
88
| 'wbtc'
99
| 'shib'
1010
| 'ape'
11-
| 'euroc';
11+
| 'euroc'
12+
| 'xusd';
1213
export type SupportedCurrencies = SupportedCoins | SupportedTokens;
1314

1415
export interface CurrencyOpts {
@@ -168,6 +169,117 @@ export const Currencies: {[key in string]: CurrencyOpts} = {
168169
gradientBackgroundColor: '#6b71d6',
169170
},
170171
},
172+
rbtc: {
173+
name: 'Smart Bitcoin',
174+
chain: 'RSK',
175+
coin: 'rbtc',
176+
unitInfo: {
177+
unitName: 'RBTC',
178+
unitToSatoshi: 1e18,
179+
unitDecimals: 18,
180+
unitCode: 'rbtc'
181+
},
182+
properties: {
183+
hasMultiSig: false,
184+
hasMultiSend: false,
185+
isUtxo: false,
186+
isERCToken: false,
187+
isStableCoin: false,
188+
singleAddress: true
189+
},
190+
paymentInfo: {
191+
paymentCode: 'EIP681',
192+
protocolPrefix: { livenet: 'rsk', testnet: 'rsk' },
193+
ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/rbtc',
194+
blockExplorerUrls: 'explorer.rsk.co/',
195+
blockExplorerUrlsTestnet: 'explorer.testet.rsk.co/'
196+
},
197+
feeInfo: {
198+
feeUnit: 'Gwei',
199+
feeUnitAmount: 1e9,
200+
blockTime: 0.53,
201+
maxMerchantFee: 'urgent'
202+
},
203+
theme: {
204+
coinColor: '#41d434',
205+
backgroundColor: '#1e90ff',
206+
gradientBackgroundColor: '#1e90ff'
207+
}
208+
},
209+
rsk: { // This entry is because exchange-rates assumes that chain and coin are the same and asks for theme to 'rsk'
210+
name: 'Smart Bitcoin',
211+
chain: 'RSK',
212+
coin: 'rbtc',
213+
unitInfo: {
214+
unitName: 'RBTC',
215+
unitToSatoshi: 1e18,
216+
unitDecimals: 18,
217+
unitCode: 'rbtc'
218+
},
219+
properties: {
220+
hasMultiSig: false,
221+
hasMultiSend: false,
222+
isUtxo: false,
223+
isERCToken: false,
224+
isStableCoin: false,
225+
singleAddress: true
226+
},
227+
paymentInfo: {
228+
paymentCode: 'EIP681',
229+
protocolPrefix: { livenet: 'rsk', testnet: 'rsk' },
230+
ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/btc',
231+
blockExplorerUrls: 'explorer.rsk.co/',
232+
blockExplorerUrlsTestnet: 'explorer.testet.rsk.co/'
233+
},
234+
feeInfo: {
235+
feeUnit: 'Gwei',
236+
feeUnitAmount: 1e9,
237+
blockTime: 0.53,
238+
maxMerchantFee: 'urgent'
239+
},
240+
theme: {
241+
coinColor: '#41d434',
242+
backgroundColor: '#1e90ff',
243+
gradientBackgroundColor: '#1e90ff'
244+
},
245+
},
246+
xusd: {
247+
name: 'Sovryn XUSD',
248+
chain: 'RSK',
249+
coin: 'xusd',
250+
unitInfo: {
251+
unitName: 'XUSD',
252+
unitToSatoshi: 1e18,
253+
unitDecimals: 18,
254+
unitCode: 'xusd',
255+
},
256+
properties: {
257+
hasMultiSig: false,
258+
hasMultiSend: false,
259+
isUtxo: false,
260+
isERCToken: true,
261+
isStableCoin: true,
262+
singleAddress: true,
263+
},
264+
paymentInfo: {
265+
paymentCode: 'EIP681',
266+
protocolPrefix: { livenet: 'rsk', testnet: 'rsk' },
267+
ratesApi: 'https://bws.bitpay.com/bws/api/v3/fiatrates/xusd',
268+
blockExplorerUrls: 'explorer.rsk.co/',
269+
blockExplorerUrlsTestnet: 'explorer.testet.rsk.co/'
270+
},
271+
feeInfo: {
272+
feeUnit: 'Gwei',
273+
feeUnitAmount: 1e9,
274+
blockTime: 0.2,
275+
maxMerchantFee: 'urgent',
276+
},
277+
theme: {
278+
coinColor: '#f3ba2d',
279+
backgroundColor: 'rgba(135,206,250,1)',
280+
gradientBackgroundColor: 'rgba(30,144,255, 0.2)',
281+
},
282+
},
171283
xrp: {
172284
name: 'XRP',
173285
chain: 'XRP',
@@ -628,7 +740,7 @@ export const SUPPORTED_TOKENS = [
628740
'ape',
629741
'euroc',
630742
];
631-
export const SUPPORTED_COINS = ['btc', 'bch', 'eth', 'doge', 'ltc', 'xrp'];
743+
export const SUPPORTED_COINS = ['btc', 'bch', 'eth', 'rbtc', 'doge', 'ltc', 'xrp'];
632744
export const SUPPORTED_CURRENCIES = [...SUPPORTED_COINS, ...SUPPORTED_TOKENS];
633745
export const POPULAR_TOKENS = [
634746
'UNI',

src/constants/defaultDerivationPath.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export enum DefaultDerivationPath {
22
defaultBTC = "m/44'/0'/0'",
33
defaultBCH = "m/44'/145'/0'",
44
defaultETH = "m/44'/60'/0'",
5+
defaultRBTC = "m/44'/137'/0'",
56
defaultXRP = "m/44'/144'/0'",
67
defaultDOGE = "m/44'/3'/0'",
78
defaultLTC = "m/44'/2'/0'",

src/constants/tokens.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ export const BitpaySupportedTokenOpts: TokenOptsType = {
3232
decimals: 18,
3333
address: '0x4fabb145d64652a948d72533023f6e7a623c7c53',
3434
},
35+
xusd: {
36+
name: 'Sovryn XUSD',
37+
symbol: 'XUSD',
38+
decimals: 18,
39+
address: '0xb5999795BE0EbB5bAb23144AA5FD6A02D080299F',
40+
},
3541
dai: {
3642
name: 'Dai',
3743
symbol: 'DAI',
@@ -89,6 +95,12 @@ export const BitpaySupportedTokenOptsByAddress: TokenOptsType = {
8995
decimals: 18,
9096
address: '0x4fabb145d64652a948d72533023f6e7a623c7c53',
9197
},
98+
'0xb5999795BE0EbB5bAb23144AA5FD6A02D080299F': {
99+
name: 'Sovryn XUSD',
100+
symbol: 'XUSD',
101+
decimals: 18,
102+
address: '0xb5999795BE0EbB5bAb23144AA5FD6A02D080299F',
103+
},
92104
'0x6b175474e89094c44da98b954eedeac495271d0f': {
93105
name: 'Dai',
94106
symbol: 'DAI',

src/navigation/card/assets/currency-shapes/RBTC-shape.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)