Open chrisli30 opened 4 years ago
@bguiz Please see if this issue is as described in your message.
The config file should store the category for each "coin", specifically whether it is a native currency of the crypto network (e.g. R-BTC
on RSK
), or if it is a token (e.g. RIF
on RSK`).
Once that is done, instead of deciding how to construct the transaction based on a hard coded value, can use this category value to decide instead. The intent behind this is:
From Brendan,
The coin type determination should be achieved using object-oriented method as other property, instead of using a separate configuration array variable.
Example 1: https://github.com/rsksmart/rwallet/commit/955c072e7cec8d1c5adcf4bfa960083027a7fa19#diff-91fb241661b3998d5c42b6029dd03123R45-R49 if (symbol === 'RBTC') { rawTransaction.to = to; rawTransaction.data = memo; } else { const assetContract = ASSETS_CONTRACT[symbol][type];
if (symbol === 'RBTC')
should be implemented in coin.createRawTransaction(to, memo) since each coin has the property symbol.Example 2, in src/pages/wallet/wallet.connect/index.js line 235,
all lines with _.filter() should be replaced by the actual logic such as
coin.getPrivateKey()