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

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

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.