Kadena Wallet Signing API API Reference

This API facilitates communication between dapps and wallets. This frees dapp developers from the complexity of managing private keys, allowing them to focus on the functionality and business logic of the application. Whenever the dapp needs to send a signed transaction, all you have to do is make an AJAX request to this API on localhost port 9467 and the user's wallet app will handle all the details of transaction signing for you.

API Endpoint
http://localhost:9467
Contact: info@kadena.io
Version: 1.0

Paths

POST /v1/sign

undefined

Request Content-Types: application/json;charset=utf-8
Request Example
{
  "code": "string",
  "data": "object",
  "caps": [
    {
      "role": "string",
      "description": "string",
      "cap": {
        "args": [
          "arg1",
          "arg2"
        ],
        "name": "foo.bar"
      }
    }
  ],
  "nonce": "string",
  "chainId": "string",
  "gasLimit": "number",
  "ttl": "number",
  "sender": "string",
  "extraSigners": [
    "string"
  ]
}
400 Bad Request

Invalid body

Response Content-Types: application/json;charset=utf-8
Response Example (200 OK)
{
  "body": {
    "cmd": "string",
    "sigs": [
      {
        "sig": "string"
      }
    ],
    "hash": "string (base64url)"
  },
  "chainId": "string"
}

POST /v1/quicksign

undefined

Request Content-Types: application/json;charset=utf-8
Request Example
{
  "reqs": [
    {
      "sigs": [
        [
          "ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033",
          "a8b9ea0fbe6b8f59917908bbd2ec473af4ba30c62e2cbab9981f7f5f62941cbb79aee832efc38675fac42a658192ba7387bbbc61017b2ca9b2f2115bc1f4c503"
        ],
        [
          "fa781bdd858cd2380b5e2b654e58035f7189a6e8158686a1bb7eabb585a56e7f",
          null
        ]
      ],
      "cmd": "{\"networkId\":\"testnet04\",\"payload\":{\"exec\":{\"data\":null,\"code\":\"(+ 1 2)\"}},\"signers\":[{\"pubKey\":\"ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033\",\"clist\":[{\"args\":[],\"name\":\"coin.GAS\"}]},{\"pubKey\":\"fa781bdd858cd2380b5e2b654e58035f7189a6e8158686a1bb7eabb585a56e7f\"}],\"meta\":{\"creationTime\":1663085494,\"ttl\":1800,\"gasLimit\":20,\"chainId\":\"0\",\"gasPrice\":1.0e-6,\"sender\":\"ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033\"},\"nonce\":\"2022-09-13 16:11:34.678231 UTC\"}"
    }
  ]
}
400 Bad Request

Invalid body

Response Content-Types: application/json;charset=utf-8
Response Example (200 OK)
{
  "results": [
    {
      "sigs": [
        [
          "acbe76b30ccaf57e269a0cd5eeeb7293e7e84c7d68e6244a64c4adf4d2df6ea1",
          "e103338c324190c0e86f06e2fdcc886df42562c5d74a2216c8b2cc729d255686ec5488693569da6afc57a02af5e4ec5bd013c24b4fcddd94cc94eb412e88a20d"
        ]
      ],
      "cmd": "<cmd here>"
    }
  ]
}

Schema Definitions

SigningResponse: object

wallet response that includes the signed transaction

body: Command
chainId: ChainId
Example
{
  "body": {
    "cmd": "string",
    "sigs": [
      {
        "sig": "string"
      }
    ],
    "hash": "string (base64url)"
  },
  "chainId": "string"
}

Command: object

transaction command with stringified JSON payload (cmd)

cmd: string
sigs: UserSig
UserSig
hash: TypedHash
Example
{
  "cmd": "string",
  "sigs": [
    {
      "sig": "string"
    }
  ],
  "hash": "string (base64url)"
}

UserSig: object

crypto signature by secret key of command payload

sig: string
Example
{
  "sig": "string"
}

TypedHash: string

blake2 hash in base64 of command payload

ChainId: string

chainweb chain ID where the transaction will be executed

SigningRequest: object

transaction information sent to the wallet for signing

code: string
data: Object
caps: DappCap
DappCap
nonce: string
chainId: ChainId
gasLimit: GasLimit
ttl: TTLSeconds
sender: AccountName
extraSigners: PublicKey
PublicKey
Example
{
  "code": "string",
  "data": "object",
  "caps": [
    {
      "role": "string",
      "description": "string",
      "cap": {
        "args": [
          "arg1",
          "arg2"
        ],
        "name": "foo.bar"
      }
    }
  ],
  "nonce": "string",
  "chainId": "string",
  "gasLimit": "number",
  "ttl": "number",
  "sender": "string",
  "extraSigners": [
    "string"
  ]
}

Object: object

Arbitrary JSON object.

object
Example
"object"

DappCap: object

a capability required by the transaction with amplifying information to help the user

role: string
description: string
cap: SigCapability
Example
{
  "role": "string",
  "description": "string",
  "cap": {
    "args": [
      "arg1",
      "arg2"
    ],
    "name": "foo.bar"
  }
}

SigCapability: object

a capability and any arguments it requires

args: string[]
string
name: string
Example
{
  "args": [
    "arg1",
    "arg2"
  ],
  "name": "foo.bar"
}

GasLimit: number

max number of gas units you want to spend on this transaction

Example
"number"

TTLSeconds: number

number of seconds the transaction can wait in the mempool before expiring

Example
"number"

AccountName: string

The name of an account in the coin contract. In the SigningRequest sender field, this will be the account used to pay the transaction's gas price.

PublicKey: string

QuickSignResponse: object

list of SigData

results: object[]
object
sigs: string[][]
string[]
string
cmd: string
Example
{
  "results": [
    {
      "sigs": [
        [
          "acbe76b30ccaf57e269a0cd5eeeb7293e7e84c7d68e6244a64c4adf4d2df6ea1",
          "e103338c324190c0e86f06e2fdcc886df42562c5d74a2216c8b2cc729d255686ec5488693569da6afc57a02af5e4ec5bd013c24b4fcddd94cc94eb412e88a20d"
        ]
      ],
      "cmd": "<cmd here>"
    }
  ]
}

QuickSignRequest: object

completed transaction bytes to be signed

reqs: CommandSigData
CommandSigData
Example
{
  "reqs": [
    {
      "sigs": [
        [
          "ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033",
          "a8b9ea0fbe6b8f59917908bbd2ec473af4ba30c62e2cbab9981f7f5f62941cbb79aee832efc38675fac42a658192ba7387bbbc61017b2ca9b2f2115bc1f4c503"
        ],
        [
          "fa781bdd858cd2380b5e2b654e58035f7189a6e8158686a1bb7eabb585a56e7f",
          null
        ]
      ],
      "cmd": "{\"networkId\":\"testnet04\",\"payload\":{\"exec\":{\"data\":null,\"code\":\"(+ 1 2)\"}},\"signers\":[{\"pubKey\":\"ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033\",\"clist\":[{\"args\":[],\"name\":\"coin.GAS\"}]},{\"pubKey\":\"fa781bdd858cd2380b5e2b654e58035f7189a6e8158686a1bb7eabb585a56e7f\"}],\"meta\":{\"creationTime\":1663085494,\"ttl\":1800,\"gasLimit\":20,\"chainId\":\"0\",\"gasPrice\":1.0e-6,\"sender\":\"ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033\"},\"nonce\":\"2022-09-13 16:11:34.678231 UTC\"}"
    }
  ]
}

CommandSigData: object

the signature data for a command

sigs: object[]
object
cmd: string
Example
{
  "sigs": [
    [
      "ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033",
      "a8b9ea0fbe6b8f59917908bbd2ec473af4ba30c62e2cbab9981f7f5f62941cbb79aee832efc38675fac42a658192ba7387bbbc61017b2ca9b2f2115bc1f4c503"
    ],
    [
      "fa781bdd858cd2380b5e2b654e58035f7189a6e8158686a1bb7eabb585a56e7f",
      null
    ]
  ],
  "cmd": "{\"networkId\":\"testnet04\",\"payload\":{\"exec\":{\"data\":null,\"code\":\"(+ 1 2)\"}},\"signers\":[{\"pubKey\":\"ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033\",\"clist\":[{\"args\":[],\"name\":\"coin.GAS\"}]},{\"pubKey\":\"fa781bdd858cd2380b5e2b654e58035f7189a6e8158686a1bb7eabb585a56e7f\"}],\"meta\":{\"creationTime\":1663085494,\"ttl\":1800,\"gasLimit\":20,\"chainId\":\"0\",\"gasPrice\":1.0e-6,\"sender\":\"ae18efd16cbd49e9a92552a2589ac01491b486fbcbb1e3f07980f945597e2033\"},\"nonce\":\"2022-09-13 16:11:34.678231 UTC\"}"
}