On this page

latest contributor to this doc

Last Edit:

@gcharang

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* = requiredTypeDescription
task_id*
integer
The task_id returned by the *init* call.
forget_if_finished
boolean
default: true
Optional. If false, the final (completed) response is returned on every call.

Parameter* = requiredTypeDescription
details*
object
Extra data whose structure depends on the current status. See examples below. In the successful case it contains eth_address.
status*
string
A short indication of how the connection process is progressing (Initializing, SigningLoginMetadata, Ok, or Error).

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"
}

{
  "mmrpc": "2.0",
  "result": {
    "status": "InProgress",
    "details": "Initializing"
  },
  "id": 1
}

{
  "mmrpc": "2.0",
  "result": {
    "status": "Ok",
    "details": {
      "eth_address": "0x7b6E7C4555c5F6f5Fc4d0fAA940bAe50cC3C7d29"
    }
  },
  "id": 1
}

Parameter* = requiredTypeDescription
EthProviderNotFound
string
Optional. No MetaMask provider detected.
InternalError
string
Optional. The request failed due to an internal error in the Komodo DeFi Framework API.
MetamaskCtxNotInitialized
string
Optional. The MetaMask context was not yet created (call *init* first).
Timeout
string
Optional. MetaMask did not respond within the expected time-out window.
UserCancelled
string
Optional. The user rejected the MetaMask signature / request.