Skip to content

创建文章

We are looking for publications that demonstrate building dApps or smart contracts!
See the full list of Gitcoin bounties that are eligible for rewards.

kmd


Paths

GET /swagger.json

Gets the current swagger spec.

GET /swagger.json

Description Returns the entire swagger spec in json.

Responses

HTTP Code Description Schema
200 The current swagger spec string
default Unknown Error No Content

Produces

  • application/json

POST /v1/key

Generate a key

POST /v1/key

Description Generates the next key in the deterministic key sequence (as determined by the master derivation key) and adds it to the wallet, returning the public key.

Parameters

Type Name Schema
Body Generate Key Request
required
GenerateKeyRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/key APIV1POSTKeyResponse

Produces

  • application/json

DELETE /v1/key

Delete a key

DELETE /v1/key

Description Deletes the key with the passed public key from the wallet.

Parameters

Type Name Schema
Body Delete Key Request
required
DeleteKeyRequest

Responses

HTTP Code Description Schema
200 Response to DELETE /v1/key APIV1DELETEKeyResponse

Produces

  • application/json

POST /v1/key/export

Export a key

POST /v1/key/export

Description Export the secret key associated with the passed public key.

Parameters

Type Name Schema
Body Export Key Request
required
ExportKeyRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/key/export APIV1POSTKeyExportResponse

Produces

  • application/json

POST /v1/key/import

Import a key

POST /v1/key/import

Description Import an externally generated key into the wallet. Note that if you wish to back up the imported key, you must do so by backing up the entire wallet database, because imported keys were not derived from the wallet's master derivation key.

Parameters

Type Name Schema
Body Import Key Request
required
ImportKeyRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/key/import APIV1POSTKeyImportResponse

Produces

  • application/json

POST /v1/key/list

List keys in wallet

POST /v1/key/list

Description Lists all of the public keys in this wallet. All of them have a stored private key.

Parameters

Type Name Schema
Body List Keys Request
required
ListKeysRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/key/list APIV1POSTKeyListResponse

Produces

  • application/json

POST /v1/master-key/export

Export the master derivation key from a wallet

POST /v1/master-key/export

Description Export the master derivation key from the wallet. This key is a master "backup" key for the underlying wallet. With it, you can regenerate all of the wallets that have been generated with this wallet's POST /v1/key endpoint. This key will not allow you to recover keys imported from other wallets, however.

Parameters

Type Name Schema
Body Export Master Key Request
required
ExportMasterKeyRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/master-key/export APIV1POSTMasterKeyExportResponse

Produces

  • application/json

DELETE /v1/multisig

Delete a multisig

DELETE /v1/multisig

Description Deletes multisig preimage information for the passed address from the wallet.

Parameters

Type Name Schema
Body Delete Multisig Request
required
DeleteMultisigRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/multisig/delete APIV1DELETEMultisigResponse

Produces

  • application/json

POST /v1/multisig/export

Export multisig address metadata

POST /v1/multisig/export

Description Given a multisig address whose preimage this wallet stores, returns the information used to generate the address, including public keys, threshold, and multisig version.

Parameters

Type Name Schema
Body Export Multisig Request
required
ExportMultisigRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/multisig/export APIV1POSTMultisigExportResponse

Produces

  • application/json

POST /v1/multisig/import

Import a multisig account

POST /v1/multisig/import

Description Generates a multisig account from the passed public keys array and multisig metadata, and stores all of this in the wallet.

Parameters

Type Name Schema
Body Import Multisig Request
required
ImportMultisigRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/multisig/import APIV1POSTMultisigImportResponse

Produces

  • application/json

POST /v1/multisig/list

List multisig accounts

POST /v1/multisig/list

Description Lists all of the multisig accounts whose preimages this wallet stores

Parameters

Type Name Schema
Body List Multisig Request
required
ListMultisigRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/multisig/list APIV1POSTMultisigListResponse

Produces

  • application/json

POST /v1/multisig/sign

Sign a multisig transaction

POST /v1/multisig/sign

Description Start a multisig signature, or add a signature to a partially completed multisig signature object.

Parameters

Type Name Schema
Body Sign Multisig Transaction Request
required
SignMultisigRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/multisig/sign APIV1POSTMultisigTransactionSignResponse

Produces

  • application/json

POST /v1/multisig/signprogram

Sign a program for a multisig account

POST /v1/multisig/signprogram

Description Start a multisig signature, or add a signature to a partially completed multisig signature object.

Parameters

Type Name Schema
Body Sign Multisig Program Request
required
SignProgramMultisigRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/multisig/signdata APIV1POSTMultisigProgramSignResponse

Produces

  • application/json

POST /v1/program/sign

Sign program

POST /v1/program/sign

Description Signs the passed program with a key from the wallet, determined by the account named in the request.

Parameters

Type Name Schema
Body Sign Program Request
required
SignProgramRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/data/sign APIV1POSTProgramSignResponse

Produces

  • application/json

POST /v1/transaction/sign

Sign a transaction

POST /v1/transaction/sign

Description Signs the passed transaction with a key from the wallet, determined by the sender encoded in the transaction.

Parameters

Type Name Schema
Body Sign Transaction Request
required
SignTransactionRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/transaction/sign APIV1POSTTransactionSignResponse

Produces

  • application/json

POST /v1/wallet

Create a wallet

POST /v1/wallet

Description Create a new wallet (collection of keys) with the given parameters.

Parameters

Type Name Schema
Body Create Wallet Request
required
CreateWalletRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/wallet APIV1POSTWalletResponse

Produces

  • application/json

POST /v1/wallet/info

Get wallet info

POST /v1/wallet/info

Description Returns information about the wallet associated with the passed wallet handle token. Additionally returns expiration information about the token itself.

Parameters

Type Name Schema
Body Get Wallet Info Request
required
WalletInfoRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/wallet/info APIV1POSTWalletInfoResponse

Produces

  • application/json

POST /v1/wallet/init

Initialize a wallet handle token

POST /v1/wallet/init

Description Unlock the wallet and return a wallet handle token that can be used for subsequent operations. These tokens expire periodically and must be renewed. You can POST the token to /v1/wallet/info to see how much time remains until expiration, and renew it with /v1/wallet/renew. When you're done, you can invalidate the token with /v1/wallet/release.

Parameters

Type Name Schema
Body Initialize Wallet Handle Token Request
required
InitWalletHandleTokenRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/wallet/init APIV1POSTWalletInitResponse

Produces

  • application/json

POST /v1/wallet/release

Release a wallet handle token

POST /v1/wallet/release

Description Invalidate the passed wallet handle token, making it invalid for use in subsequent requests.

Parameters

Type Name Schema
Body Release Wallet Handle Token Request
required
ReleaseWalletHandleTokenRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/wallet/release APIV1POSTWalletReleaseResponse

Produces

  • application/json

POST /v1/wallet/rename

Rename a wallet

POST /v1/wallet/rename

Description Rename the underlying wallet to something else

Parameters

Type Name Schema
Body Rename Wallet Request
required
RenameWalletRequest

Responses

HTTP Code Description Schema
200 Response to POST /v1/wallet/rename APIV1POSTWalletRenameResponse

Produces

  • application/json

POST /v1/wallet/renew

Renew a wallet handle token

POST /v1/wallet/renew

Description Renew a wallet handle token, increasing its expiration duration to its initial value

Parameters

Type Name Schema
Body Renew Wallet Handle Token Request
required
RenewWalletHandleTokenRequest

Responses

HTTP Code Description Schema
200 Response POST /v1/wallet/renew APIV1POSTWalletRenewResponse

Produces

  • application/json

GET /v1/wallets

List wallets

GET /v1/wallets

Description Lists all of the wallets that kmd is aware of.

Parameters

Type Name Schema
Body List Wallet Request
optional
ListWalletsRequest

Responses

HTTP Code Description Schema
200 Response to GET /v1/wallets APIV1GETWalletsResponse

Produces

  • application/json

GET /versions

Retrieves the current version

GET /versions

Parameters

Type Name Schema
Body Versions Request
optional
VersionsRequest

Responses

HTTP Code Description Schema
200 Response to GET /versions VersionsResponse

Produces

  • application/json

Definitions

APIV1DELETEKeyResponse

APIV1DELETEKeyResponse is the response to DELETE /v1/key friendly:DeleteKeyResponse

Name Schema
error
optional
boolean
message
optional
string

APIV1DELETEMultisigResponse

APIV1DELETEMultisigResponse is the response to POST /v1/multisig/delete` friendly:DeleteMultisigResponse

Name Schema
error
optional
boolean
message
optional
string

APIV1GETWalletsResponse

APIV1GETWalletsResponse is the response to GET /v1/wallets friendly:ListWalletsResponse

Name Schema
error
optional
boolean
message
optional
string
wallets
optional
< APIV1Wallet > array

APIV1POSTKeyExportResponse

APIV1POSTKeyExportResponse is the response to POST /v1/key/export friendly:ExportKeyResponse

Name Schema
error
optional
boolean
message
optional
string
private_key
optional
PrivateKey

APIV1POSTKeyImportResponse

APIV1POSTKeyImportResponse is the response to POST /v1/key/import friendly:ImportKeyResponse

Name Schema
address
optional
string
error
optional
boolean
message
optional
string

APIV1POSTKeyListResponse

APIV1POSTKeyListResponse is the response to POST /v1/key/list friendly:ListKeysResponse

Name Schema
addresses
optional
< string > array
error
optional
boolean
message
optional
string

APIV1POSTKeyResponse

APIV1POSTKeyResponse is the response to POST /v1/key friendly:GenerateKeyResponse

Name Schema
address
optional
string
error
optional
boolean
message
optional
string

APIV1POSTMasterKeyExportResponse

APIV1POSTMasterKeyExportResponse is the response to POST /v1/master-key/export friendly:ExportMasterKeyResponse

Name Schema
error
optional
boolean
master_derivation_key
optional
MasterDerivationKey
message
optional
string

APIV1POSTMultisigExportResponse

APIV1POSTMultisigExportResponse is the response to POST /v1/multisig/export friendly:ExportMultisigResponse

Name Schema
error
optional
boolean
message
optional
string
multisig_version
optional
integer (uint8)
pks
optional
< PublicKey > array
threshold
optional
integer (uint8)

APIV1POSTMultisigImportResponse

APIV1POSTMultisigImportResponse is the response to POST /v1/multisig/import friendly:ImportMultisigResponse

Name Schema
address
optional
string
error
optional
boolean
message
optional
string

APIV1POSTMultisigListResponse

APIV1POSTMultisigListResponse is the response to POST /v1/multisig/list friendly:ListMultisigResponse

Name Schema
addresses
optional
< string > array
error
optional
boolean
message
optional
string

APIV1POSTMultisigProgramSignResponse

APIV1POSTMultisigProgramSignResponse is the response to POST /v1/multisig/signdata friendly:SignProgramMultisigResponse

Name Description Schema
error
optional
boolean
message
optional
string
multisig
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)

APIV1POSTMultisigTransactionSignResponse

APIV1POSTMultisigTransactionSignResponse is the response to POST /v1/multisig/sign friendly:SignMultisigResponse

Name Description Schema
error
optional
boolean
message
optional
string
multisig
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)

APIV1POSTProgramSignResponse

APIV1POSTProgramSignResponse is the response to POST /v1/data/sign friendly:SignProgramResponse

Name Description Schema
error
optional
boolean
message
optional
string
sig
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)

APIV1POSTTransactionSignResponse

APIV1POSTTransactionSignResponse is the response to POST /v1/transaction/sign friendly:SignTransactionResponse

Name Description Schema
error
optional
boolean
message
optional
string
signed_transaction
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)

APIV1POSTWalletInfoResponse

APIV1POSTWalletInfoResponse is the response to POST /v1/wallet/info friendly:WalletInfoResponse

Name Schema
error
optional
boolean
message
optional
string
wallet_handle
optional
APIV1WalletHandle

APIV1POSTWalletInitResponse

APIV1POSTWalletInitResponse is the response to POST /v1/wallet/init friendly:InitWalletHandleTokenResponse

Name Schema
error
optional
boolean
message
optional
string
wallet_handle_token
optional
string

APIV1POSTWalletReleaseResponse

APIV1POSTWalletReleaseResponse is the response to POST /v1/wallet/release friendly:ReleaseWalletHandleTokenResponse

Name Schema
error
optional
boolean
message
optional
string

APIV1POSTWalletRenameResponse

APIV1POSTWalletRenameResponse is the response to POST /v1/wallet/rename friendly:RenameWalletResponse

Name Schema
error
optional
boolean
message
optional
string
wallet
optional
APIV1Wallet

APIV1POSTWalletRenewResponse

APIV1POSTWalletRenewResponse is the response to POST /v1/wallet/renew friendly:RenewWalletHandleTokenResponse

Name Schema
error
optional
boolean
message
optional
string
wallet_handle
optional
APIV1WalletHandle

APIV1POSTWalletResponse

APIV1POSTWalletResponse is the response to POST /v1/wallet friendly:CreateWalletResponse

Name Schema
error
optional
boolean
message
optional
string
wallet
optional
APIV1Wallet

APIV1Wallet

APIV1Wallet is the API's representation of a wallet

Name Schema
driver_name
optional
string
driver_version
optional
integer (uint32)
id
optional
string
mnemonic_ux
optional
boolean
name
optional
string
supported_txs
optional
< TxType > array

APIV1WalletHandle

APIV1WalletHandle includes the wallet the handle corresponds to and the number of number of seconds to expiration

Name Schema
expires_seconds
optional
integer (int64)
wallet
optional
APIV1Wallet

CreateWalletRequest

APIV1POSTWalletRequest is the request for POST /v1/wallet

Name Schema
master_derivation_key
optional
MasterDerivationKey
wallet_driver_name
optional
string
wallet_name
optional
string
wallet_password
optional
string

DeleteKeyRequest

APIV1DELETEKeyRequest is the request for DELETE /v1/key

Name Schema
address
optional
string
wallet_handle_token
optional
string
wallet_password
optional
string

DeleteMultisigRequest

APIV1DELETEMultisigRequest is the request for DELETE /v1/multisig

Name Schema
address
optional
string
wallet_handle_token
optional
string
wallet_password
optional
string

Digest

Type : < integer (uint8) > array

ExportKeyRequest

APIV1POSTKeyExportRequest is the request for POST /v1/key/export

Name Schema
address
optional
string
wallet_handle_token
optional
string
wallet_password
optional
string

ExportMasterKeyRequest

APIV1POSTMasterKeyExportRequest is the request for POST /v1/master-key/export

Name Schema
wallet_handle_token
optional
string
wallet_password
optional
string

ExportMultisigRequest

APIV1POSTMultisigExportRequest is the request for POST /v1/multisig/export

Name Schema
address
optional
string
wallet_handle_token
optional
string

GenerateKeyRequest

APIV1POSTKeyRequest is the request for POST /v1/key

Name Schema
display_mnemonic
optional
boolean
wallet_handle_token
optional
string

ImportKeyRequest

APIV1POSTKeyImportRequest is the request for POST /v1/key/import

Name Schema
private_key
optional
PrivateKey
wallet_handle_token
optional
string

ImportMultisigRequest

APIV1POSTMultisigImportRequest is the request for POST /v1/multisig/import

Name Schema
multisig_version
optional
integer (uint8)
pks
optional
< PublicKey > array
threshold
optional
integer (uint8)
wallet_handle_token
optional
string

InitWalletHandleTokenRequest

APIV1POSTWalletInitRequest is the request for POST /v1/wallet/init

Name Schema
wallet_id
optional
string
wallet_password
optional
string

ListKeysRequest

APIV1POSTKeyListRequest is the request for POST /v1/key/list

Name Schema
wallet_handle_token
optional
string

ListMultisigRequest

APIV1POSTMultisigListRequest is the request for POST /v1/multisig/list

Name Schema
wallet_handle_token
optional
string

ListWalletsRequest

APIV1GETWalletsRequest is the request for GET /v1/wallets

Type : object

MasterDerivationKey

MasterDerivationKey is used to derive ed25519 keys for use in wallets

Type : < integer (uint8) > array

MultisigSig

MultisigSig is the structure that holds multiple Subsigs

Name Schema
Subsigs
optional
< MultisigSubsig > array
Threshold
optional
integer (uint8)
Version
optional
integer (uint8)

MultisigSubsig

MultisigSubsig is a struct that holds a pair of public key and signatures signatures may be empty

Name Schema
Key
optional
PublicKey
Sig
optional
Signature

PrivateKey

Type : < integer (uint8) > array

PublicKey

Type : < integer (uint8) > array

ReleaseWalletHandleTokenRequest

APIV1POSTWalletReleaseRequest is the request for POST /v1/wallet/release

Name Schema
wallet_handle_token
optional
string

RenameWalletRequest

APIV1POSTWalletRenameRequest is the request for POST /v1/wallet/rename

Name Schema
wallet_id
optional
string
wallet_name
optional
string
wallet_password
optional
string

RenewWalletHandleTokenRequest

APIV1POSTWalletRenewRequest is the request for POST /v1/wallet/renew

Name Schema
wallet_handle_token
optional
string

SignMultisigRequest

APIV1POSTMultisigTransactionSignRequest is the request for POST /v1/multisig/sign

Name Description Schema
partial_multisig
optional
MultisigSig
public_key
optional
PublicKey
signer
optional
Digest
transaction
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)
wallet_handle_token
optional
string
wallet_password
optional
string

SignProgramMultisigRequest

APIV1POSTMultisigProgramSignRequest is the request for POST /v1/multisig/signprogram

Name Description Schema
address
optional
string
data
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)
partial_multisig
optional
MultisigSig
public_key
optional
PublicKey
wallet_handle_token
optional
string
wallet_password
optional
string

SignProgramRequest

APIV1POSTProgramSignRequest is the request for POST /v1/program/sign

Name Description Schema
address
optional
string
data
optional
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$" string (byte)
wallet_handle_token
optional
string
wallet_password
optional
string

SignTransactionRequest

APIV1POSTTransactionSignRequest is the request for POST /v1/transaction/sign

Name Description Schema
public_key
optional
PublicKey
transaction
optional
Base64 encoding of msgpack encoding of a Transaction object
Note: SDK and goal usually generate SignedTxn objects
in that case, the field txn / Transaction of the
generated SignedTxn object needs to be used
Pattern : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"
string (byte)
wallet_handle_token
optional
string
wallet_password
optional
string

Signature

Type : < integer (uint8) > array

TxType

TxType is the type of the transaction written to the ledger

Type : string

VersionsRequest

VersionsRequest is the request for GET /versions

Type : object

VersionsResponse

VersionsResponse is the response to GET /versions friendly:VersionsResponse

Name Schema
versions
optional
< string > array

WalletInfoRequest

APIV1POSTWalletInfoRequest is the request for POST /v1/wallet/info

Name Schema
wallet_handle_token
optional
string

ed25519PrivateKey

Type : < integer (uint8) > array

ed25519PublicKey

Type : < integer (uint8) > array

ed25519Signature

Type : < integer (uint8) > array