Orange-Wallet / wallet-connect-dart

Wallet Connect client in Dart.
https://pub.dev/packages/wallet_connect
BSD 3-Clause "New" or "Revised" License
115 stars 78 forks source link

Update Session never updates. #16

Closed erginersoy closed 2 years ago

erginersoy commented 2 years ago

Future<void> updateSession({ List<String>? accounts, int? chainId, bool approved = true, }) async { final param = WCSessionUpdate( approved: approved, chainId: _chainId ?? chainId, accounts: accounts, ); final request = JsonRpcRequest( id: DateTime.now().millisecondsSinceEpoch, method: WCMethod.SESSION_UPDATE, params: [param.toJson()], ); return _encryptAndSend(jsonEncode(request.toJson())); }

In this block chainId is never updated. It always uses current _chainId.

to Update Session we need to call approveSession method first then call updateSession method

Abhimanyu121 commented 2 years ago

Thanks a lot for pointing it out and raising the PR.