Skip to content

Changes type of chainId to String #16

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

josh-burton
Copy link
Contributor

Fixes #15

@RootSoft
Copy link
Owner

Thanks for the PR @josh-burton
Do you have an idea which blockchain uses a string as chainId?
The official monorepo uses a number: private _chainId = 0;

@josh-burton
Copy link
Contributor Author

@RootSoft this was the Elrond chain using the Maiar wallet.

@ChikinDeveloper
Copy link

ChikinDeveloper commented Feb 14, 2022

Hi! Please add this, we want to add Solana provider but it' a String chaindId:

  • Solana Mainnet = 'solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ',
  • Solana Devnet = 'solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K',

@RootSoft
Copy link
Owner

@ChikinDeveloper @josh-burton would dynamic be preferred over String?

@RootSoft
Copy link
Owner

Can you guys try out this branch:
https://github.com/RootSoft/walletconnect-dart-sdk/tree/feature/dynamic-chainid

walletconnect_dart:
  git:
    url: git://github.com/RootSoft/walletconnect-dart-sdk.git
    ref: feature/dynamic-chainid

A solana integration provider would be helpful as well:
https://github.com/RootSoft/walletconnect-dart-sdk/blob/master/lib/src/providers/ethereum_walletconnect_provider.dart

@josh-burton
Copy link
Contributor Author

@ChikinDeveloper @josh-burton would dynamic be preferred over String?

I don't think we need dynamic. It won't be a bool or a list or a complex object, it will really only be either a string or an int.

In that case casting the int to a string is the best option.

@RootSoft
Copy link
Owner

RootSoft commented Mar 8, 2022

@josh-burton Can you try out the following branch:
https://github.com/RootSoft/walletconnect-dart-sdk/tree/feature/string-chainid

walletconnect_dart:
  git:
    url: git://github.com/RootSoft/walletconnect-dart-sdk.git
    ref: feature/string-chainid

This branch contains the chain id as a string. Some wallets sends the chainId as int, others as a String. So I had to do some extra checks to cast the chainId to a String.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chainId can be String
3 participants