register method
void
register({
- required String method,
- required dynamic function(]),
- required ProtocolType type,
override
Implementation
@override
void register({
required String method,
required Function(String, JsonRpcRequest, [TransportType]) function,
required ProtocolType type,
}) {
if (routerMapRequest.containsKey(method)) {
final registered = routerMapRequest[method];
if (registered!.type == type) {
throw const ReownCoreError(
code: -1,
message: 'Method already exists',
);
}
}
routerMapRequest[method] = RegisteredFunction(
method: method,
function: function,
type: type,
);
}