-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gaba assets controllers integration #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Some minor concerns about rn-nodeify and the changes to the package.json
Other than that 💯
app/util/number.js
Outdated
* @returns {number} - Number | ||
*/ | ||
export function toNumber(value, decimals) { | ||
return value.toNumber() / Math.pow(10, decimals); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can do value.toFormat(decimals)
scripts/postinstall.sh
Outdated
@@ -3,6 +3,7 @@ echo "PostInstall script:" | |||
|
|||
echo "1. React Native nodeify..." | |||
node_modules/.bin/rn-nodeify --install 'crypto,buffer,react-native-randombytes,vm,stream' --hack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tried adding gaba in this line instead?
node_modules/.bin/rn-nodeify --install 'crypto,buffer,react-native-randombytes,vm,stream,gaba' --hack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I tried, is super strange to be honest. I'll reach out on slack when I start making this changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM!
* GABA AssetsDetectionController integration * Fix CollectibleImage address * GABA with web3 integration and collectible image bugfix * integrate AssetsContractController * integration of GABA TokenBalancesController * update snapshots * fix empty collectible image URI * add new controllers to engine tests * update gaba to last version * fix some gaba dependencies * update calculate token value
Description
This PR acts together with MetaMask/core#19, providing assets auto detection and token balances.
Specifically it adds three controllers from GABA:
AssetsDetectionController
: In charge of auto detect assets when, network changes to mainnet or current account changes, while mainnet.AssetsContractController
: In charge ofweb3
interaction with assets controller. Important in this PR because it modifies the way GABA is used withrn-nodeify
https://github.com/MetaMask/MetaMask/blob/d5ad3653a2f8bad28e19bcfdd38c3ad04140524e/scripts/postinstall.sh#L6TokenBalancesController
: In charge of balances update from current token list.And use of
TokenRatesController
, to get fiat value of tokens together with token balances.Checklist
Issue
Related MetaMask/website#61
BLOCKER: Correct GABA version.
https://github.com/MetaMask/MetaMask/blob/d5ad3653a2f8bad28e19bcfdd38c3ad04140524e/package.json#L60
Resolves #63
Comments: Address in GIF was hard coded.