walletconnect-dart-sdk icon indicating copy to clipboard operation
walletconnect-dart-sdk copied to clipboard

Changes type of chainId to String

Open josh-burton opened this issue 3 years ago • 7 comments

Fixes #15

josh-burton avatar Jan 10 '22 03:01 josh-burton

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;

RootSoft avatar Jan 28 '22 12:01 RootSoft

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

josh-burton avatar Jan 28 '22 18:01 josh-burton

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

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

ChikinDeveloper avatar Feb 14 '22 13:02 ChikinDeveloper

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

RootSoft avatar Feb 14 '22 14:02 RootSoft

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

RootSoft avatar Feb 14 '22 14:02 RootSoft

@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.

josh-burton avatar Feb 14 '22 18:02 josh-burton

@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.

RootSoft avatar Mar 08 '22 14:03 RootSoft