On this page

latest contributor to this doc

Last Edit:

@gcharang

Initialise MetaMask Connection Task

API-v2task::connect_metamask::init

Use this method to begin a task-managed process that establishes a MetaMask context. The method returns a task_id that can be polled using task::connect_metamask::status.

Parameter* = requiredTypeDescription
project*
string
A short, human-readable identifier for the DApp or integration requesting the context.

Parameter* = requiredTypeDescription
task_id*
integer
An identifying number that is used to query task status or to cancel it

connect_metamask::init

POST
task::connect_metamask::init
{
  "mmrpc": "2.0",
  "method": "task::connect_metamask::init",
  "params": {
    "project": "my_kdf_app"
  },
  "id": 1,
  "userpass": "RPC_UserP@SSW0RD"
}

{
  "mmrpc": "2.0",
  "result": {
    "task_id": 42
  },
  "id": 1
}

Parameter* = requiredTypeDescription
EthProviderNotFound
string
Optional. No MetaMask provider detected in the browser / environment.
InternalError
string
Optional. The request failed due to a Komodo DeFi Framework API internal error.
MetamaskInitializingAlready
string
Optional. A MetaMask initialisation task is already in progress.
Timeout
string
Optional. MetaMask did not respond within the expected time-out window.
UnexpectedAccountSelected
string
Optional. A different ETH account is currently selected in MetaMask.
UserCancelled
string
Optional. The user rejected the signature/request in MetaMask.