-
Notifications
You must be signed in to change notification settings - Fork 18
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
Cant get an address of ETC #39
Comments
Hello @danilkharlan! Do you mind sharing steps to reproduce? |
1)Connect trust wallet How i can specify network when call get address |
But have you added Ethereum Classic network in your dapp in the list of supported networks? Have you switched to it? See docs https://docs.reown.com/appkit/flutter/core/custom-chains From your steps it feels to me that you connect with Ethereum by default and you just then call getAddress(), therefor you get Ethereum address.
|
selectedChain value is 61 that equal to Etherium clasic network,but I get BEP20 address( |
Can you share your code? |
showLoader();
final network = SupportedNetwork.getNetworkFor(
assetCode: state.assetNetworkModel!.assetCode,
networkCode: state.assetNetworkModel!.networkCode,
);
if (network != null) {
final res = await getIt<IReownService>().changeNetwork(network);
}
final address = getIt<IReownService>().getWalletAddress();
emitAction(CryptoWithdrawalAction.updateAddress(address, walletType));
@override
Future<void> changeNetwork(SupportedNetwork network) async {
if (!isConnected) return;
try {
if (_appKitModal.selectedChain?.chainId == network.chainID) return;
final chain = ReownAppKitModalNetworks.getNetworkById(
NetworkUtils.eip155, network.chainID ?? '');
await _appKitModal.selectChain(chain, switchChain: true);
_appKitModal.launchConnectedWallet();
final chainId = int.tryParse(network.chainID ?? '0');
final result = await _appKitModal.request(
topic: _appKitModal.session!.topic,
chainId: _appKitModal.selectedChain!.chainId,
request: SessionRequestParams(
method: MethodsConstants.walletSwitchEthChain,
params: [
{'chainId': '0x${chainId?.toRadixString(16)}'}
],
),
);
} catch (e) {
_streamController.addError(e);
}
}
@override
String getWalletAddress() =>
_appKitModal.session?.getAddress(NetworkUtils.eip155) ?? '';
|
But are you adding Ethereum Classic to |
Here is my init method.Is it correct?
|
Thanks! Can you explain again the issue? Cause as far as I know Ethereum Classica and Ethereum Mainnet uses the same address format. Furthermore, the addresses depending on the network are given by the connected wallet (Trust in this case) and not by AppKit. I'm a bit lost, sorry... |
Yes,you are right! |
Have you tried a different wallet? Maybe it's just a Trust issue? |
In metamask the same addresses,but in trust different |
Sorry, seems to be an issue on Trust side. We, as AppKit don't mange neither keys nor addresses. Essentially we just allow secure communication between dapp and wallet but keys (therefor addresses) are always on wallet side. You can try opening an issue to them https://github.com/trustwallet maybe? |
ill investigate it and will back soon |
Hello!
We encountered an issue when attempting to retrieve an Ethereum Classic (ETC) address on the Ethereum Classic network in Trust Wallet. The address returned is identical to the one for the BEP20 network, which is incorrect since these networks operate on different protocols and should generate distinct addresses.
The text was updated successfully, but these errors were encountered: