rawRequest method
Sends a raw rpc request using the injected Ethereum client.
If possible, prefer using asRpcService to construct a high-level client instead.
See also:
- the rpc documentation under https://binance-wallet.gitbook.io/binance-chain-wallet/dev/get-started
Implementation
Future<dynamic> rawRequest(String method, {Object? params}) {
// No, this can't be simplified. Binance Wallet wants `params` to be undefined.
final args = params == null
? RequestArguments(method: method)
: RequestArguments(method: method, params: params);
return promiseToFuture(request(args)).onError((error, stackTrace) {
ExceptionUtils.analyzeException(error!);
});
}