MetaMask Connection Task: Status
API-v2task::connect_metamask::status
After calling task::connect_metamask::init
, use this method to poll for progress, gather additional details, or fetch the final result once the MetaMask context is ready.
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
task_id | integer | ✓ | - | The task_id returned by the init call. |
forget_if_finished | boolean | ✗ | true | If false , the final (completed) response is returned on every call. |
Parameter | Type | Description |
---|---|---|
status | string | A short indication of how the connection process is progressing (Initializing , SigningLoginMetadata , Ok , or Error ). |
details | object | Extra data whose structure depends on the current status . See examples below. In the successful case it contains eth_address . |
Possible in-progress status
values:
Initializing
– Preparing the MetaMask context.SigningLoginMetadata
– Waiting for the user to sign the login metadata inside MetaMask.
When the task completes successfully, status
will be Ok
and details
will hold the resulting Ethereum address.
connect_metamask::status (in progress)
POST
task::connect_metamask::status{
"mmrpc": "2.0",
"method": "task::connect_metamask::status",
"params": {
"task_id": 42,
"forget_if_finished": false
},
"id": 1,
"userpass": "RPC_UserP@SSW0RD"
}
Parameter | Type | Description |
---|---|---|
MetamaskCtxNotInitialized | string | The MetaMask context was not yet created (call init first). |
EthProviderNotFound | string | No MetaMask provider detected. |
UserCancelled | string | The user rejected the MetaMask signature / request. |
Timeout | string | MetaMask did not respond within the expected time-out window. |
InternalError | string | The request failed due to an internal error in the Komodo DeFi Framework API. |