MultichainRoutingService Actions
4 actions registered.
| Name | Deprecated |
|---|---|
getSupportedAccounts | |
getSupportedMethods | |
handleRequest | |
isSupportedScope |
MultichainRoutingService:getSupportedAccounts
Package: @metamask/snaps-controllers
Get a list of supported accounts for a given scope.
Parameters:
| Name | Description |
|---|---|
scope | The CAIP-2 scope. |
Returns: A list of CAIP-10 addresses.
Handler signature:
(scope: CaipChainId) => string[]
MultichainRoutingService:getSupportedMethods
Package: @metamask/snaps-controllers
Get a list of supported methods for a given scope. This combines both protocol and account Snaps supported methods.
Parameters:
| Name | Description |
|---|---|
scope | The CAIP-2 scope. |
Returns: A list of supported methods.
Handler signature:
(scope: CaipChainId) => string[]
MultichainRoutingService:handleRequest
Package: @metamask/snaps-controllers
Handle an incoming JSON-RPC request tied to a specific scope by routing to either a protocol Snap or an account Snap.
Note: Addresses are considered case-sensitive by the MultichainRoutingService as not all non-EVM chains are case-insensitive.
Parameters:
| Name | Description |
|---|---|
options | An options bag. |
options.connectedAddresses | Addresses currently connected to the origin for the requested scope. |
options.origin | The origin of the RPC request. |
options.originMetadata | Optional additional origin metadata. |
options.request | The JSON-RPC request. |
options.scope | The CAIP-2 scope for the request. |
Returns: The response from the chosen Snap.
Handler signature:
({ connectedAddresses, origin, originMetadata, scope, request: rawRequest, }: {
connectedAddresses: CaipAccountId[];
origin: string;
originMetadata?: OriginMetadata | null;
scope: CaipChainId;
request: JsonRpcRequest;
}) => Promise<Json>
MultichainRoutingService:isSupportedScope
Package: @metamask/snaps-controllers
Determine whether a given CAIP-2 scope is supported by the router.
Parameters:
| Name | Description |
|---|---|
scope | The CAIP-2 scope. |
Returns: True if the router can service the scope, otherwise false.
Handler signature:
(scope: CaipChainId) => boolean