To open communication channel between wallet and web application Spika injects JavaScript object in to the browser's window.

Below example shows how to establish connection with wallet:

const connect = await window.spika.connect();

Request example:

    "method": "connect",
    "args": {},
    "id": 4 // each request has a new id

Response example:

    "responseMethod": "connect", // same as request method
    "id": 4, // same as request id
    "response": {
        "account": "0x07313c786ae592e2b134ef11a26721e4bf9f46e44139ce3bee35a011a9dea062",
        "publicKey": "0x246149be5064eb9913690c7b2eca963fede52fcbd072d2fbba22f7383e66c0c8"

Last updated