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://www.okx.com/vi/oktc/docs/dev/api/oktc-api/json-rpc-api
Implementation
Future<dynamic> rawRequest(String method, {Object? params}) {
// No, this can't be simplified. Okx 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!);
});
}