MetaMask / metamask-docs

Developer documentation for MetaMask
https://docs.metamask.io
Apache License 2.0
660 stars 954 forks source link

Dart support for Metamask #294

Closed user2745 closed 1 year ago

user2745 commented 2 years ago

I'm working with the AthleteX team to implement an 'Add AX token' button to metamask, and we're running into trouble.

Here is the code we've written:

  eth.rawRequest('wallet_watchAsset', {
        params: {
  type: 'ERC20', 
  options: {
    address: tokenAddress, 
    symbol: tokenSymbol, 
    decimals: tokenDecimals, 
    image: tokenImage, 
  },
},
  });

Need - looking for dart support with metamask to make this process easier.

BboyAkers commented 2 years ago

Hey! Sorry 😅 , i'm not familiar with DART. Does using ethereum.request instead of eth.raw? What does the base ethereum object look like in DART?

user2745 commented 2 years ago

gotcha @BboyAkers we use this library - https://pub.dev/packages/web3dart

The base Ethereum object looks like normal ethereum - ref here https://pub.dev/documentation/web3dart/latest/browser/Ethereum-class.html

P.S. please @user2745 me so I can remember to check this in a timely manner. Thank you :)

BboyAkers commented 2 years ago

@user2745 is there a test repo you have I can look at? I've been digging into it and looking at https://github.com/simolus3/web3dart/tree/master/example/metamask but no avail 😅. Is there an error message you're receiving?

user2745 commented 2 years ago

Yessir! Please checkout SportsToken page on GitHub, I will send a link

user2745 commented 2 years ago

@BboyAkers https://github.com/SportsToken/ax_dapp

BboyAkers commented 2 years ago

Will be digging into this!

httpJunkie commented 2 years ago

@BboyAkers did you get anywhere with this? LMK...

BboyAkers commented 1 year ago

@httpJunkie I wasn't able to figure it out unfortunately 🙁, sorry @user2745

user2745 commented 1 year ago

hey @BboyAkers we were able to build a solution that works. details are in the dapp but if you're unfamiliar with BLoC architecture may be confusing. I can include a direct link

BboyAkers commented 1 year ago

Please do!! @user2745