simolus3 / web3dart

Ethereum library, written in Dart.
MIT License
441 stars 270 forks source link

client.dispose() Error JSON-RPC error -32000: subscription not found #206

Open ag-0214 opened 2 years ago

ag-0214 commented 2 years ago

I am interacting with my deployed smart contract on rinkeby. When I try to dispose the client I got the error message below is the code and the output. ..... Part of Code _transactionId = await client.sendTransaction( credentials, Transaction.callContract( contract: contract, function: _approveFunction(), parameters: [receiver, amount], ), chainId: networkId, ); log('token approval started : $_transactionId'); await _subscription.asFuture(); log('done approving. cancel subscription'); await _subscription.cancel(); log('done cancelling subscription. disposing'); await client.dispose(); log('done disposing');

The output [log] token approval started : 0x189ae3779b6b3e9603b021906adc03fc159c962ed96bfe12039dc4edf34fd5bb [log] done approving. cancel subscription [log] done cancelling subscription. disposing E/flutter ( 9809): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: JSON-RPC error -32000: subscription not found