@vegaprotocol/openrpc-md
Version:
Generate a single markdown from a simplistic openrpc doc
1,849 lines (1,848 loc) • 100 kB
JSON
{
"openrpc": "1.2.6",
"info": {
"version": "1.0.0",
"title": "Wallet API"
},
"methods": [
{
"name": "client.connect_wallet",
"summary": "Initiates a connection between a wallet and a third-party application.",
"description": "This method initiates a connection between a wallet and a third-party application.\n\nThe user has to review the request, and, if they accept it, select the wallet they want to use for this connection.\n\nA connection token is generated and returned to the third-party application. This token is meant to be used in protected methods.\n\n**Supported connections:**\n- Multiple wallets connected for the same hostname. Each connection will have a different token.\n- A single wallet connected to multiple hostnames. Each connection will have a different token.\n- Combination of the above setups.\n\nHowever, it's not possible to have multiple connections on the same wallet for the same hostname. The previous connection will be terminated and a new token will be generated.\n\nThis method should be the entry point of every third-party application. Once connected, see the method `get_permissions`.",
"tags": [
{
"name": "client"
},
{
"name": "connection"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"token"
],
"properties": {
"token": {
"$ref": "#/components/schemas/token"
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/connection_closed"
},
{
"$ref": "#/components/errors/request_rejected"
},
{
"$ref": "#/components/errors/request_interrupted"
}
],
"examples": [
{
"name": "Accepting a connection from \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" requests a connection to a wallet and the user accepts.",
"params": [
{
"name": "hostname",
"value": "vega.xyz"
}
],
"result": {
"name": "Success",
"value": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
}
}
]
},
{
"name": "client.disconnect_wallet",
"summary": "Ends the connection between the third-party application and the wallet.",
"description": "This method ends the connection between the third-party application and the wallet. The token is, then, no longer valid.\n\nCalling this method with an invalid token doesn't fail.",
"tags": [
{
"name": "client"
},
{
"name": "connection"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "token",
"required": true,
"schema": {
"$ref": "#/components/schemas/token"
}
}
],
"result": {
"name": "No result",
"schema": false
},
"examples": [
{
"name": "Disconnection from \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" requests a disconnection to a wallet using a valid token.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
],
"result": {
"name": "Success",
"value": null
}
}
]
},
{
"name": "client.get_permissions",
"summary": "Returns the permissions set on the wallet for the third-party application.",
"description": "This method returns the permissions set on the wallet for the third-party application.\n\nThis method should be called, by the third-party application, right after it successfully connected to a wallet, to ensure it has sufficient permissions to call the method it relies on. If the third-party application doesn't have enough permissions, see the method `request_permissions`.",
"tags": [
{
"name": "client"
},
{
"name": "permissions"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "token",
"required": true,
"schema": {
"$ref": "#/components/schemas/token"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"permissions"
],
"properties": {
"permissions": {
"$ref": "#/components/schemas/permissions_summary"
}
}
}
},
"examples": [
{
"name": "Get permissions set for \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" wants to know the permissions that have been set on the wallet in use.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
],
"result": {
"name": "Success",
"value": {
"publicKeys": "read"
}
}
}
]
},
{
"name": "client.request_permissions",
"summary": "Requests permissions update for the third-party application.",
"description": "This method allows a third-party application to request new permissions to access the methods it requires.\n\nAll permissions the third-party relies on have to be specified. If a permission is omitted, it will be considered as no longer required and, as a result, be automatically revoked.\n\nThe user has to review the permissions.",
"tags": [
{
"name": "client"
},
{
"name": "permissions"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "token",
"required": true,
"schema": {
"$ref": "#/components/schemas/token"
}
},
{
"name": "requestedPermissions",
"required": true,
"schema": {
"$ref": "#/components/schemas/permissions_summary"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"permissions"
],
"properties": {
"permissions": {
"$ref": "#/components/schemas/permissions_summary"
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/connection_closed"
},
{
"$ref": "#/components/errors/request_rejected"
},
{
"$ref": "#/components/errors/request_interrupted"
}
],
"examples": [
{
"name": "Updating permissions for \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" requests an update of its permissions and the user accepts.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
},
{
"name": "requestedPermissions",
"value": {
"publicKeys": "read"
}
}
],
"result": {
"name": "Success",
"value": {
"permissions": {
"publicKeys": "read"
}
}
}
},
{
"name": "Updating permissions for \"vega.xyz\" with omitted permission",
"description": "The third-party application \"vega.xyz\" omits a permission during the update and the user accepts. This automatically marks the omitted permission as revoked.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
},
{
"name": "requestedPermissions",
"value": {}
}
],
"result": {
"name": "Success",
"value": {
"permissions": {
"publicKeys": "none"
}
}
}
}
]
},
{
"name": "client.list_keys",
"summary": "Returns the keys the user has allowed the third-party application to have access to.",
"description": "This method returns the keys the user has allowed the third-party application to have access to.\n\nIt requires a `read` access on `public_keys`.",
"tags": [
{
"name": "client"
},
{
"name": "key"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "token",
"required": true,
"schema": {
"$ref": "#/components/schemas/token"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"keys"
],
"properties": {
"keys": {
"type": "array",
"items": {
"$ref": "#/components/schemas/named_public_key"
}
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/read_access_public_keys"
}
],
"examples": [
{
"name": "List keys allowed on \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" wants to list the public keys it has access to.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
],
"result": {
"name": "Success",
"value": {
"keys": [
{
"name": "Key 1",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
},
{
"name": "Key 2",
"publicKey": "988eae323a07f12363c17025c23ee58ea32ac3912398e16bb0b56969f57adc52"
}
]
}
}
}
]
},
{
"name": "client.sign_transaction",
"summary": "Sign a transaction without sending it.",
"description": "This method signs a transaction and returns it to the third-party application, without sending it to the network. What happens with the transaction is up to the third-party application.\n\nThe user has to review the transaction.",
"tags": [
{
"name": "client"
},
{
"name": "transaction"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "token",
"required": true,
"schema": {
"$ref": "#/components/schemas/token"
}
},
{
"name": "publicKey",
"required": true,
"schema": {
"$ref": "#/components/schemas/public_key"
}
},
{
"name": "transaction",
"required": true,
"schema": {
"$ref": "#/components/schemas/transaction"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"transaction"
],
"properties": {
"transaction": {
"$ref": "#/components/schemas/signed_transaction"
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/no_healthy_node"
},
{
"$ref": "#/components/errors/could_not_get_last_block"
},
{
"$ref": "#/components/errors/public_key_not_allowed"
},
{
"$ref": "#/components/errors/connection_closed"
},
{
"$ref": "#/components/errors/request_rejected"
},
{
"$ref": "#/components/errors/request_interrupted"
}
],
"examples": [
{
"name": "Signing a transaction for \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" requests to sign a transaction and the user accepts.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
},
{
"name": "publicKey",
"value": "3fd42fd5ceb22d99ac45086f1d82d516118a5cb7ad9a2e096cd78ca2c8960c80"
},
{
"name": "sendingMode",
"value": "TYPE_SYNC"
},
{
"name": "encodedTransaction",
"value": "ewogICAgInZvdGVTdWJtaXNzaW9uIjogewogICAgICAgICJwcm9wb3NhbElkIjogImViMmQzOTAyZmRkYTljM2ViNmUzNjlmMjIzNTY4OWI4NzFjNzMyMmNmM2FiMjg0ZGRlM2U5ZGZjMTM4NjNhMTciLAogICAgICAgICJ2YWx1ZSI6ICJWQUxVRV9ZRVMiCiAgICB9Cn0K"
}
],
"result": {
"name": "Success",
"value": {
"receivedAt": "2021-02-18T21:54:42.123Z",
"sentAt": "2021-02-18T21:54:42.123Z",
"txHash": "E8C167126D1FC8D92898AB9C07C318161DF68753A1316A69ABDC9ADC557723B3"
}
}
}
]
},
{
"name": "client.send_transaction",
"summary": "Send a transaction to the network.",
"description": "This method sends a transaction to the network.\n\nThe user has to review the transaction.",
"tags": [
{
"name": "client"
},
{
"name": "transaction"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "token",
"required": true,
"schema": {
"$ref": "#/components/schemas/token"
}
},
{
"name": "publicKey",
"required": true,
"schema": {
"$ref": "#/components/schemas/public_key"
}
},
{
"name": "sendingMode",
"required": true,
"schema": {
"$ref": "#/components/schemas/sending_mode"
}
},
{
"name": "transaction",
"required": true,
"schema": {
"$ref": "#/components/schemas/transaction"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"receivedAt",
"sentAt",
"transactionHash",
"transaction"
],
"properties": {
"receivedAt": {
"type": "string",
"description": "The date when the API received the request to send the transaction.\n\nThe time is a quoted string in RFC 3339 format, with sub-second precision added if present.",
"examples": [
"2021-02-18T21:54:42.123Z"
]
},
"sentAt": {
"type": "string",
"description": "The date when the transaction has been sent to the network.\n\nThe time is a quoted string in RFC 3339 format, with sub-second precision added if present.",
"examples": [
"2021-02-18T21:54:42.123Z"
]
},
"transactionHash": {
"type": "string",
"description": "The hash of the transaction. It's used to uniquely identify the transaction and can be used in the block explorer to retrieve it."
},
"transaction": {
"$ref": "#/components/schemas/signed_transaction"
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/no_healthy_node"
},
{
"$ref": "#/components/errors/could_not_get_last_block"
},
{
"$ref": "#/components/errors/transaction_failed"
},
{
"$ref": "#/components/errors/public_key_not_allowed"
},
{
"$ref": "#/components/errors/connection_closed"
},
{
"$ref": "#/components/errors/request_rejected"
},
{
"$ref": "#/components/errors/request_interrupted"
}
],
"examples": [
{
"name": "Sending a transaction for \"vega.xyz\"",
"description": "The third-party application \"vega.xyz\" requests to send a transaction and the user accepts.",
"params": [
{
"name": "token",
"value": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
},
{
"name": "publicKey",
"value": "3fd42fd5ceb22d99ac45086f1d82d516118a5cb7ad9a2e096cd78ca2c8960c80"
},
{
"name": "sendingMode",
"value": "TYPE_SYNC"
},
{
"name": "encodedTransaction",
"value": "ewogICAgInZvdGVTdWJtaXNzaW9uIjogewogICAgICAgICJwcm9wb3NhbElkIjogImViMmQzOTAyZmRkYTljM2ViNmUzNjlmMjIzNTY4OWI4NzFjNzMyMmNmM2FiMjg0ZGRlM2U5ZGZjMTM4NjNhMTciLAogICAgICAgICJ2YWx1ZSI6ICJWQUxVRV9ZRVMiCiAgICB9Cn0K"
}
],
"result": {
"name": "Success",
"value": {
"receivedAt": "2021-02-18T21:54:42.123Z",
"sentAt": "2021-02-18T21:54:42.123Z",
"txHash": "E8C167126D1FC8D92898AB9C07C318161DF68753A1316A69ABDC9ADC557723B3"
}
}
}
]
},
{
"name": "client.get_chain_id",
"summary": "Returns the chain ID of the network in use.",
"description": "This method returns the chain ID of the network in use.\n\nIt should be called by every third-party application to know from which network it should fetch data.",
"tags": [
{
"name": "client"
}
],
"paramStructure": "by-name",
"params": [],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"chainID"
],
"properties": {
"chainID": {
"type": "string",
"description": "The chain identifier",
"examples": [
"test-chain-Thz9c6"
]
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/no_healthy_node"
},
{
"$ref": "#/components/errors/could_not_get_last_block"
}
],
"examples": [
{
"name": "Fetching the chain ID",
"description": "An example of requesting the chain's ID",
"params": [],
"result": {
"name": "Success",
"value": {
"chainID": "test-chain-Thz9c6"
}
}
}
]
},
{
"name": "admin.create_wallet",
"summary": "Creates a wallet with its first key-pair.",
"description": "This method creates a HD wallet (with version 2 of the key derivation) and generates its first key-pair the cryptographic algorithm ed25519.\n\nThe passphrase will be used to encrypt the wallet and its keys.\n\nIf successful, the wallet is ready to use for sending transaction.",
"tags": [
{
"name": "admin"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"wallet",
"key"
],
"properties": {
"wallet": {
"type": "object",
"description": "the newly generated wallet",
"required": [
"name",
"keyDerivationVersion",
"recoveryPhrase",
"filePath"
],
"properties": {
"name": {
"type": "string"
},
"keyDerivationVersion": {
"type": "number"
},
"recoveryPhrase": {
"type": "string"
},
"filePath": {
"type": "string"
}
}
},
"key": {
"type": "object",
"description": "the first public key generated",
"required": [
"publicKey",
"algorithm",
"metadata"
],
"properties": {
"publicKey": {
"$ref": "#/components/schemas/public_key"
},
"algorithm": {
"$ref": "#/components/schemas/algorithm"
},
"metadata": {
"type": "array",
"items": {
"$ref": "#/components/schemas/metadata"
}
}
}
}
}
}
},
"examples": [
{
"name": "Creating a wallet",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
}
],
"result": {
"name": "Success",
"value": {
"wallet": {
"name": "my-wallet",
"keyDerivationVersion": 2,
"recoveryPhrase": "swing ceiling chaos green put insane ripple desk match tip melt usual shrug turkey renew icon parade veteran lens govern path rough page render",
"filePath": "some/path/to/my-wallet"
},
"key": {
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"algorithm": {
"name": "vega/ed25519",
"version": 1
},
"metadata": [
{
"key": "name",
"value": "my-wallet key 1"
}
]
}
}
}
}
]
},
{
"name": "admin.import_wallet",
"summary": "Import a wallet with its first key-pair with a recovery phrase and a key derivation version.",
"description": "This method imports a wallet using the specified recovery phrase and a key derivation version, and generates its first key-pair.\n\nThe passphrase will be used to encrypt the wallet and its keys.\n\nIf successful, the wallet is ready to use for sending transaction.",
"tags": [
{
"name": "admin"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "recoveryPhrase",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "keyDerivationVersion",
"required": true,
"schema": {
"type": "number"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"wallet",
"key"
],
"properties": {
"wallet": {
"type": "object",
"description": "the imported wallet",
"required": [
"name",
"keyDerivationVersion",
"filePath"
],
"properties": {
"name": {
"type": "string"
},
"keyDerivationVersion": {
"type": "number"
},
"filePath": {
"type": "string"
}
}
},
"key": {
"type": "object",
"description": "the first public key generated",
"required": [
"publicKey",
"algorithm",
"metadata"
],
"properties": {
"publicKey": {
"$ref": "#/components/schemas/public_key"
},
"algorithm": {
"$ref": "#/components/schemas/algorithm"
},
"metadata": {
"type": "array",
"items": {
"$ref": "#/components/schemas/metadata"
}
}
}
}
}
}
},
"examples": [
{
"name": "Importing a wallet",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
},
{
"name": "recoveryPhrase",
"value": "swing ceiling chaos green put insane ripple desk match tip melt usual shrug turkey renew icon parade veteran lens govern path rough page render"
},
{
"name": "keyDerivationVersion",
"value": "2"
}
],
"result": {
"name": "Success",
"value": {
"wallet": {
"name": "my-wallet",
"keyDerivationVersion": 2,
"filePath": "some/path/to/my-wallet"
},
"key": {
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"algorithm": {
"name": "vega/ed25519",
"version": 1
},
"metadata": [
{
"key": "name",
"value": "my-wallet key 1"
}
]
}
}
}
}
]
},
{
"name": "admin.describe_wallet",
"summary": "Returns the wallet base information.",
"description": "This method returns the wallet base information such as its name, ID, type and key derivation version. It doesn't return the keys nor the permissions.",
"tags": [
{
"name": "admin"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"name",
"keyDerivationVersion",
"id",
"type"
],
"properties": {
"name": {
"type": "string"
},
"keyDerivationVersion": {
"type": "number"
},
"id": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
},
"examples": [
{
"name": "Getting wallet base information",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
}
],
"result": {
"name": "Success",
"value": {
"name": "my-wallet",
"keyDerivationVersion": 2,
"type": "HD Wallet",
"id": "7ffa36b2fb99d8404e9448f0d2ce944055e64c36d895d1fde044c867bfdf779f"
}
}
}
]
},
{
"name": "admin.list_wallets",
"summary": "Returns the list of the wallets present on the computer.",
"description": "This method returns the list of the wallets present on the computer. It is alphabetically sorted.",
"tags": [
{
"name": "admin"
},
{
"name": "wallet"
}
],
"params": [],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"wallets"
],
"properties": {
"wallets": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": [
{
"name": "Getting the list of wallets",
"params": [],
"result": {
"name": "Success",
"value": {
"wallets": [
"wallet-1",
"wallet-2"
]
}
}
}
]
},
{
"name": "admin.rename_wallet",
"summary": "Renames a wallet",
"description": "This method renames a wallet in-place.\n\nIf the new name matches an existing wallet, it fails.",
"tags": [
{
"name": "admin"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "newName",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Rename a wallet",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "newWallet",
"value": "my-new-wallet-name"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
}
],
"result": {
"name": "Success",
"value": null
}
}
]
},
{
"name": "admin.remove_wallet",
"summary": "Removes a wallet from the computer.",
"description": "This method removes a wallet from the computer.",
"tags": [
{
"name": "admin"
},
{
"name": "wallet"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Remove a wallet",
"params": [
{
"name": "wallet",
"value": "my-wallet"
}
],
"result": {
"name": "Success",
"value": null
}
}
]
},
{
"name": "admin.list_networks",
"summary": "Returns the list of all registered networks.",
"description": "This method returns the list of the registered networks.",
"tags": [
{
"name": "admin"
},
{
"name": "network"
}
],
"params": [],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"networks"
],
"properties": {
"networks": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"examples": [
{
"name": "Getting the list of networks",
"params": [],
"result": {
"name": "Success",
"value": {
"networks": [
"mainnet",
"fairground",
"local-network"
]
}
}
}
]
},
{
"name": "admin.describe_network",
"summary": "Returns the network information.",
"description": "This method returns the network information.",
"tags": [
{
"name": "admin"
},
{
"name": "network"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "name",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"name",
"logLevel",
"tokenExpiry",
"port",
"host",
"api"
],
"properties": {
"name": {
"type": "string"
},
"logLevel": {
"type": "string"
},
"tokenExpiry": {
"type": "string"
},
"port": {
"type": "integer"
},
"host": {
"type": "string"
},
"api": {
"$ref": "#/components/schemas/network_api_config"
}
}
}
},
"examples": [
{
"name": "Describing a network",
"params": [
{
"name": "name",
"value": "local-network"
}
],
"result": {
"name": "Success",
"value": {
"name": "local-network",
"logLevel": "info",
"tokenExpiry": "168h0m0s",
"port": 1789,
"host": "localhost",
"api": {
"grpcConfig": {
"hosts": [
"localhost:3028"
],
"retries": 5
},
"graphQLConfig": {
"hosts": [
"localhost:3028"
]
},
"restConfig": {
"hosts": [
"localhost:3029"
]
}
}
}
}
}
]
},
{
"name": "admin.update_network",
"summary": "Update an existing network.",
"description": "This method updates the network configuration.",
"tags": [
{
"name": "admin"
},
{
"name": "network"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "name",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "logLevel",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "tokenExpiry",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "port",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "host",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "api",
"required": true,
"schema": {
"$ref": "#/components/schemas/network_api_config"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Update a network",
"params": [
{
"name": "name",
"value": "local-network"
},
{
"name": "level",
"value": "info"
},
{
"name": "tokenExpiry",
"value": "168h0m0s"
},
{
"name": "port",
"value": "1789"
},
{
"name": "host",
"value": "localhost"
},
{
"name": "api",
"value": {
"grpcConfig": {
"hosts": [
"localhost:3028"
],
"retries": 5
},
"graphQLConfig": {
"hosts": [
"localhost:3028"
]
},
"restConfig": {
"hosts": [
"localhost:3029"
]
}
}
}
],
"result": {
"name": "Success",
"value": null
}
}
]
},
{
"name": "admin.remove_network",
"summary": "Removes a network from the computer.",
"description": "This method removes a network from the computer.",
"tags": [
{
"name": "admin"
},
{
"name": "network"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "name",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "null"
}
},
"examples": [
{
"name": "Remove a network",
"params": [
{
"name": "network",
"value": "fairground"
}
],
"result": {
"name": "Success",
"value": null
}
}
]
},
{
"name": "admin.import_network",
"summary": "Import a network configuration from a file or an URL.",
"description": "Import a network configuration from a file or an URL.",
"tags": [
{
"name": "admin"
},
{
"name": "network"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "name",
"schema": {
"type": "string"
}
},
{
"name": "filePath",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "url",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "overwrite",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"name",
"filePath"
],
"properties": {
"name": {
"type": "string"
},
"filePath": {
"type": "string"
}
}
}
},
"examples": [
{
"name": "Importing a network",
"params": [
{
"name": "name",
"value": "local-network"
},
{
"name": "filePath",
"value": "/Users/username/local-network.toml"
}
],
"result": {
"name": "Success",
"value": {
"name": "local-network",
"filePath": "/Users/username/vega-home/wallet-service/networks/local-network.toml"
}
}
}
]
},
{
"name": "admin.generate_key",
"summary": "Generates a key on the specified wallet.",
"description": "This method generates a key on the specified wallet.\n\nMetadata can be attached to this key.\n\nA special metadata `name` can be provided to name the key. If no `name` is provided, a default name is generated.",
"tags": [
{
"name": "admin"
},
{
"name": "key"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "metadata",
"required": true,
"schema": {
"type": "array",
"items": {
"schema": {
"$ref": "#/components/schemas/metadata"
}
}
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"publicKey",
"algorithm",
"metadata"
],
"properties": {
"publicKey": {
"$ref": "#/components/schemas/public_key"
},
"algorithm": {
"$ref": "#/components/schemas/algorithm"
},
"metadata": {
"type": "array",
"items": {
"$ref": "#/components/schemas/metadata"
}
}
}
}
},
"examples": [
{
"name": "Generating a key",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
},
{
"name": "metadata",
"value": [
{
"name": "portfolio",
"value": "btc"
}
]
}
],
"result": {
"name": "Success",
"value": {
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"algorithm": {
"name": "vega/ed25519",
"version": 1
},
"metadata": [
{
"key": "portfolio",
"value": "btc"
},
{
"key": "name",
"value": "Key 1"
}
]
}
}
}
]
},
{
"name": "admin.describe_key",
"summary": "Returns key's information.",
"description": "This method returns the information of the specified key.\n\nIt doesn't return the private key for security reasons. If you need something that requires a private key, you should use the available endpoints and let them handle the private key for you.",
"tags": [
{
"name": "admin"
},
{
"name": "key"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "publicKey",
"required": true,
"schema": {
"$ref": "#/components/schemas/public_key"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"publicKey",
"algorithm",
"metadata",
"isTainted"
],
"properties": {
"publicKey": {
"$ref": "#/components/schemas/public_key"
},
"algorithm": {
"$ref": "#/components/schemas/algorithm"
},
"metadata": {
"type": "array",
"items": {
"$ref": "#/components/schemas/metadata"
}
},
"isTainted": {
"type": "boolean",
"description": "Tells if the key is tainted or not. A tainted key cannot be used for signing and sending transaction, for example."
}
}
}
},
"examples": [
{
"name": "Getting key base information",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
},
{
"name": "publicKey",
"value": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
],
"result": {
"name": "Success",
"value": {
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"algorithm": {
"name": "vega/ed25519",
"version": 1
},
"metadata": [
{
"key": "portfolio",
"value": "btc"
},
{
"key": "name",
"value": "Key 1"
}
],
"isTainted": false
}
}
}
]
},
{
"name": "admin.list_keys",
"summary": "Returns all generated key of the specified wallet.",
"description": "This method returns all generated key of the specified wallet with their respective name.",
"tags": [
{
"name": "admin"
},
{
"name": "key"
}
],
"paramStructure": "by-name",
"params": [
{
"name": "wallet",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "passphrase",
"required": true,
"schema": {
"type": "string"
}
}
],
"result": {
"name": "Success",
"required": true,
"schema": {
"type": "object",
"required": [
"keys"
],
"properties": {
"keys": {
"type": "array",
"items": {
"$ref": "#/components/schemas/named_public_key"
}
}
}
}
},
"examples": [
{
"name": "Listing the keys",
"params": [
{
"name": "wallet",
"value": "my-wallet"
},
{
"name": "passphrase",
"value": "this-is-not-a-good-passphrase"
}
],
"result": {
"name": "Success",
"value": {
"keys": [
{
"name": "Key 1",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
]
}
}
}
]
},
{
"name": "admin.annotate_key",
"summary": "Attaches metadata to a key.",
"description": "This method attaches metadata to the specified key.\n\nA special metadata `name` can be provided to name the key. If no `name` is provided, a default name is generated.\n\nThis method **replaces** the existing metadata by the specified ones. It does **not** update in place.",
"tags": [
{
"name": "admin"
},
{