title |
---|
OpenRPC Wallet API |
- client.connect_wallet: Initiates a connection between a wallet and a third-party application.
- client.disconnect_wallet: Ends the connection between the third-party application and the wallet.
- client.get_permissions: Returns the permissions set on the wallet for the third-party application.
- client.request_permissions: Requests permissions update for the third-party application.
- client.list_keys: Returns the keys the user has allowed the third-party application to have access to.
- client.sign_transaction: Sign a transaction without sending it.
- client.send_transaction: Send a transaction to the network.
- client.get_chain_id: Returns the chain ID of the network in use.
- admin.create_wallet: Creates a wallet with its first key-pair.
- admin.import_wallet: Import a wallet with its first key-pair with a recovery phrase and a key derivation version.
- admin.describe_wallet: Returns the wallet base information.
- admin.list_wallets: Returns the list of the wallets present on the computer.
- admin.rename_wallet: Renames a wallet
- admin.remove_wallet: Removes a wallet from the computer.
- admin.list_networks: Returns the list of all registered networks.
- admin.describe_network: Returns the network information.
- admin.update_network: Update an existing network.
- admin.remove_network: Removes a network from the computer.
- admin.import_network: Import a network configuration from a file or an URL.
- admin.generate_key: Generates a key on the specified wallet.
- admin.describe_key: Returns key's information.
- admin.list_keys: Returns all generated key of the specified wallet.
- admin.annotate_key: Attaches metadata to a key.
- admin.isolate_key: Isolate a key to a specific wallet.
- admin.rotate_key: Builds a transaction to rotate key on the network.
- admin.taint_key: Marks the specified public key as tainted.
- admin.untaint_key: Remove the taint from the specified public key.
- admin.describe_permissions: Returns the permissions set for the specified wallet and hostname.
- admin.list_permissions: Returns the permissions summary for all set hostnames.
- admin.update_permissions: Updates the permissions for the specified wallet and hostname.
- admin.revoke_permissions: Revokes the permissions set in the specified hostname.
- admin.purge_permissions: Purges all the permissions set for all hostname.
- admin.sign_transaction: Sign a command using the specified wallet and public key.
- admin.sign_message: Sign any arbitrary message
- admin.verify_message: Verify any arbitrary signature
- admin.send_transaction: Sign & send a transaction to a network
- admin.send_raw_transaction: Send a signed transaction to a network
- admin.start_service: Start a wallet service.
- admin.stop_service: Stop a wallet service.
- admin.list_connections: List all the connections of a service.
- admin.close_connection: Close the connection between a third-party application and a wallet.
- admin.close_connections_to_hostname: Close the connection from the specified third-party application to any wallet.
- admin.close_connections_to_wallet: Close the connection from any third-party application to the specified wallet.
This method initiates a connection between a wallet and a third-party application.
The user has to review the request, and, if they accept it, select the wallet they want to use for this connection.
A connection token is generated and returned to the third-party application. This token is meant to be used in protected methods.
Supported connections:
- Multiple wallets connected for the same hostname. Each connection will have a different token.
- A single wallet connected to multiple hostnames. Each connection will have a different token.
- Combination of the above setups.
However, 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.
This method should be the entry point of every third-party application. Once connected, see the method get_permissions
.
None required
Result key | Type | Description | Example |
---|---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
- Client error (3000): the user closed the connection
- Client error (3001): the user rejected the request
- Server error (-32001): the request has been interrupted
The third-party application "vega.xyz" requests a connection to a wallet and the user accepts.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.connect_wallet",
"params": {
"hostname": "vega.xyz"
}
}
{
"name": "Success",
"value": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
}
This method ends the connection between the third-party application and the wallet. The token is, then, no longer valid.
Calling this method with an invalid token doesn't fail.
Parameter name | Type | Description |
---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
The third-party application "vega.xyz" requests a disconnection to a wallet using a valid token.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.disconnect_wallet",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
}
{
"name": "Success",
"value": null
}
This method returns the permissions set on the wallet for the third-party application.
This 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
.
Parameter name | Type | Description |
---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
Result key | Type | Description | Example |
---|---|---|---|
permissions | object | The description of the permissions a third-party application has. | The description of the permissions a third-party application has. |
The third-party application "vega.xyz" wants to know the permissions that have been set on the wallet in use.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.get_permissions",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
}
{
"name": "Success",
"value": {
"publicKeys": "read"
}
}
This method allows a third-party application to request new permissions to access the methods it requires.
All 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.
The user has to review the permissions.
Parameter name | Type | Description |
---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
requestedPermissions | object | The description of the permissions a third-party application has.{ "public_keys": "read" } { "public_keys": "none" } |
Result key | Type | Description | Example |
---|---|---|---|
permissions | object | The description of the permissions a third-party application has. | The description of the permissions a third-party application has. |
- Client error (3000): the user closed the connection
- Client error (3001): the user rejected the request
- Server error (-32001): the request has been interrupted
The third-party application "vega.xyz" requests an update of its permissions and the user accepts.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.request_permissions",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG",
"requestedPermissions": {
"publicKeys": "read"
}
}
}
{
"name": "Success",
"value": {
"permissions": {
"publicKeys": "read"
}
}
}
The third-party application "vega.xyz" omits a permission during the update and the user accepts. This automatically marks the omitted permission as revoked.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.request_permissions",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG",
"requestedPermissions": {}
}
}
{
"name": "Success",
"value": {
"permissions": {
"publicKeys": "none"
}
}
}
This method returns the keys the user has allowed the third-party application to have access to.
It requires a read
access on public_keys
.
Parameter name | Type | Description |
---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
Result key | Type | Description | Example |
---|---|---|---|
keys | array | - | - |
- Application error (2000): a "read" access on public keys is required
The third-party application "vega.xyz" wants to list the public keys it has access to.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.list_keys",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG"
}
}
{
"name": "Success",
"value": {
"keys": [
{
"name": "Key 1",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
},
{
"name": "Key 2",
"publicKey": "988eae323a07f12363c17025c23ee58ea32ac3912398e16bb0b56969f57adc52"
}
]
}
}
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.
The user has to review the transaction.
Parameter name | Type | Description |
---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
publicKey | string | The Vega public key to use. |
transaction | object | The transaction as a JSON object |
Result key | Type | Description | Example |
---|---|---|---|
transaction | object | A transaction that has been signed by the wallet. | A transaction that has been signed by the wallet. |
- Network error (1000): no healthy node available
- Network error (1000): could not get information about the last block on the network
- Application error (2000): the public key is not allowed to be used
- Client error (3000): the user closed the connection
- Client error (3001): the user rejected the request
- Server error (-32001): the request has been interrupted
The third-party application "vega.xyz" requests to sign a transaction and the user accepts.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.sign_transaction",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG",
"publicKey": "3fd42fd5ceb22d99ac45086f1d82d516118a5cb7ad9a2e096cd78ca2c8960c80",
"sendingMode": "TYPE_SYNC",
"encodedTransaction": "ewogICAgInZvdGVTdWJtaXNzaW9uIjogewogICAgICAgICJwcm9wb3NhbElkIjogImViMmQzOTAyZmRkYTljM2ViNmUzNjlmMjIzNTY4OWI4NzFjNzMyMmNmM2FiMjg0ZGRlM2U5ZGZjMTM4NjNhMTciLAogICAgICAgICJ2YWx1ZSI6ICJWQUxVRV9ZRVMiCiAgICB9Cn0K"
}
}
{
"name": "Success",
"value": {
"receivedAt": "2021-02-18T21:54:42.123Z",
"sentAt": "2021-02-18T21:54:42.123Z",
"txHash": "E8C167126D1FC8D92898AB9C07C318161DF68753A1316A69ABDC9ADC557723B3"
}
}
This method sends a transaction to the network.
The user has to review the transaction.
Parameter name | Type | Description |
---|---|---|
token | string | A unique connection token randomly generated for each new connection. It's used to access the protected methods. |
publicKey | string | The Vega public key to use. |
sendingMode | string | The chosen mode to send the transaction: - TYPE_SYNC returns the result of running the transaction.- TYPE_ASYNC returns right away without waiting to hear if the transaction is even valid.- TYPE_COMMIT waits until the transaction is committed in a block or until some timeout is reached or returns return right away if the transaction is not valid. |
transaction | object | The transaction as a JSON object |
Result key | Type | Description | Example |
---|---|---|---|
receivedAt | string | The date when the API received the request to send the transaction. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
The date when the API received the request to send the transaction. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
sentAt | string | The date when the transaction has been sent to the network. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
The date when the transaction has been sent to the network. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
transactionHash | string | The hash of the transaction. It's used to uniquely identify the transaction and can be used in the block explorer to retrieve it. | 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 | object | A transaction that has been signed by the wallet. | A transaction that has been signed by the wallet. |
- Network error (1000): no healthy node available
- Network error (1000): could not get information about the last block on the network
- Network error (1000): the transaction failed
- Application error (2000): the public key is not allowed to be used
- Client error (3000): the user closed the connection
- Client error (3001): the user rejected the request
- Server error (-32001): the request has been interrupted
The third-party application "vega.xyz" requests to send a transaction and the user accepts.
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.send_transaction",
"params": {
"token": "hZKSx0snBvikp2NGMJdKPHU5qvloSeqpqbJg6BsMwCcqX4iZvvy99BV2l13oeyEG",
"publicKey": "3fd42fd5ceb22d99ac45086f1d82d516118a5cb7ad9a2e096cd78ca2c8960c80",
"sendingMode": "TYPE_SYNC",
"encodedTransaction": "ewogICAgInZvdGVTdWJtaXNzaW9uIjogewogICAgICAgICJwcm9wb3NhbElkIjogImViMmQzOTAyZmRkYTljM2ViNmUzNjlmMjIzNTY4OWI4NzFjNzMyMmNmM2FiMjg0ZGRlM2U5ZGZjMTM4NjNhMTciLAogICAgICAgICJ2YWx1ZSI6ICJWQUxVRV9ZRVMiCiAgICB9Cn0K"
}
}
{
"name": "Success",
"value": {
"receivedAt": "2021-02-18T21:54:42.123Z",
"sentAt": "2021-02-18T21:54:42.123Z",
"txHash": "E8C167126D1FC8D92898AB9C07C318161DF68753A1316A69ABDC9ADC557723B3"
}
}
This method returns the chain ID of the network in use.
It should be called by every third-party application to know from which network it should fetch data.
None required
Result key | Type | Description | Example |
---|---|---|---|
chainID | string | The chain identifier | The chain identifier |
- Network error (1000): no healthy node available
- Network error (1000): could not get information about the last block on the network
An example of requesting the chain's ID
{
"id": 1,
"jsonrpc": "2.0",
"method": "client.get_chain_id",
"params": []
}
{
"name": "Success",
"value": {
"chainID": "test-chain-Thz9c6"
}
}
This method creates a HD wallet (with version 2 of the key derivation) and generates its first key-pair the cryptographic algorithm ed25519.
The passphrase will be used to encrypt the wallet and its keys.
If successful, the wallet is ready to use for sending transaction.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
Result key | Type | Description | Example |
---|---|---|---|
wallet | object | the newly generated wallet | the newly generated wallet |
key | object | the first public key generated | the first public key generated |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.create_wallet",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase"
}
}
{
"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"
}
]
}
}
}
This method imports a wallet using the specified recovery phrase and a key derivation version, and generates its first key-pair.
The passphrase will be used to encrypt the wallet and its keys.
If successful, the wallet is ready to use for sending transaction.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
recoveryPhrase | string | - |
keyDerivationVersion | number | - |
Result key | Type | Description | Example |
---|---|---|---|
wallet | object | the imported wallet | the imported wallet |
key | object | the first public key generated | the first public key generated |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.import_wallet",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"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",
"keyDerivationVersion": "2"
}
}
{
"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"
}
]
}
}
}
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.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
Result key | Type | Description | Example |
---|---|---|---|
name | string | - | - |
keyDerivationVersion | number | - | - |
id | string | - | - |
type | string | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.describe_wallet",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase"
}
}
{
"name": "Success",
"value": {
"name": "my-wallet",
"keyDerivationVersion": 2,
"type": "HD Wallet",
"id": "7ffa36b2fb99d8404e9448f0d2ce944055e64c36d895d1fde044c867bfdf779f"
}
}
This method returns the list of the wallets present on the computer. It is alphabetically sorted.
None required
Result key | Type | Description | Example |
---|---|---|---|
wallets | array | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.list_wallets",
"params": []
}
{
"name": "Success",
"value": {
"wallets": [
"wallet-1",
"wallet-2"
]
}
}
This method renames a wallet in-place.
If the new name matches an existing wallet, it fails.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
newName | string | - |
passphrase | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.rename_wallet",
"params": {
"wallet": "my-wallet",
"newWallet": "my-new-wallet-name",
"passphrase": "this-is-not-a-good-passphrase"
}
}
{
"name": "Success",
"value": null
}
This method removes a wallet from the computer.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.remove_wallet",
"params": {
"wallet": "my-wallet"
}
}
{
"name": "Success",
"value": null
}
This method returns the list of the registered networks.
None required
Result key | Type | Description | Example |
---|---|---|---|
networks | array | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.list_networks",
"params": []
}
{
"name": "Success",
"value": {
"networks": [
"mainnet",
"fairground",
"local-network"
]
}
}
This method returns the network information.
Parameter name | Type | Description |
---|---|---|
name | string | - |
Result key | Type | Description | Example |
---|---|---|---|
name | string | - | - |
logLevel | string | - | - |
tokenExpiry | string | - | - |
port | integer | - | - |
host | string | - | - |
api | object | The API configuration for the network. | The API configuration for the network. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.describe_network",
"params": {
"name": "local-network"
}
}
{
"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"
]
}
}
}
}
This method updates the network configuration.
Parameter name | Type | Description |
---|---|---|
name | string | - |
logLevel | string | - |
tokenExpiry | string | - |
port | integer | - |
host | string | - |
api | object | The API configuration for the network. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.update_network",
"params": {
"name": "local-network",
"level": "info",
"tokenExpiry": "168h0m0s",
"port": "1789",
"host": "localhost",
"api": {
"grpcConfig": {
"hosts": [
"localhost:3028"
],
"retries": 5
},
"graphQLConfig": {
"hosts": [
"localhost:3028"
]
},
"restConfig": {
"hosts": [
"localhost:3029"
]
}
}
}
}
{
"name": "Success",
"value": null
}
This method removes a network from the computer.
Parameter name | Type | Description |
---|---|---|
name | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.remove_network",
"params": {
"network": "fairground"
}
}
{
"name": "Success",
"value": null
}
Import a network configuration from a file or an URL.
Parameter name | Type | Description |
---|---|---|
name (Optional) | string | - |
filePath | string | - |
url | string | - |
overwrite | boolean | - |
Result key | Type | Description | Example |
---|---|---|---|
name | string | - | - |
filePath | string | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.import_network",
"params": {
"name": "local-network",
"filePath": "/Users/username/local-network.toml"
}
}
{
"name": "Success",
"value": {
"name": "local-network",
"filePath": "/Users/username/vega-home/wallet-service/networks/local-network.toml"
}
}
This method generates a key on the specified wallet.
Metadata can be attached to this key.
A special metadata name
can be provided to name the key. If no name
is provided, a default name is generated.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
metadata | array | - |
Result key | Type | Description | Example |
---|---|---|---|
publicKey | string | The Vega public key to use. | The Vega public key to use. |
algorithm | object | The algorithm used to generate the key. | The algorithm used to generate the key. |
metadata | array | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.generate_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"metadata": [
{
"name": "portfolio",
"value": "btc"
}
]
}
}
{
"name": "Success",
"value": {
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"algorithm": {
"name": "vega/ed25519",
"version": 1
},
"metadata": [
{
"key": "portfolio",
"value": "btc"
},
{
"key": "name",
"value": "Key 1"
}
]
}
}
This method returns the information of the specified key.
It 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.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
publicKey | string | The Vega public key to use. |
Result key | Type | Description | Example |
---|---|---|---|
publicKey | string | The Vega public key to use. | The Vega public key to use. |
algorithm | object | The algorithm used to generate the key. | The algorithm used to generate the key. |
metadata | array | - | - |
isTainted | boolean | Tells if the key is tainted or not. A tainted key cannot be used for signing and sending transaction, for example. | Tells if the key is tainted or not. A tainted key cannot be used for signing and sending transaction, for example. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.describe_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
}
{
"name": "Success",
"value": {
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"algorithm": {
"name": "vega/ed25519",
"version": 1
},
"metadata": [
{
"key": "portfolio",
"value": "btc"
},
{
"key": "name",
"value": "Key 1"
}
],
"isTainted": false
}
}
This method returns all generated key of the specified wallet with their respective name.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
Result key | Type | Description | Example |
---|---|---|---|
keys | array | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.list_keys",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase"
}
}
{
"name": "Success",
"value": {
"keys": [
{
"name": "Key 1",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
]
}
}
This method attaches metadata to the specified key.
A special metadata name
can be provided to name the key. If no name
is provided, a default name is generated.
This method replaces the existing metadata by the specified ones. It does not update in place.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
publicKey | string | The Vega public key to use. |
metadata | array | - |
Result key | Type | Description | Example |
---|---|---|---|
metadata | array | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.annotate_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"metadata": [
{
"name": "portfolio",
"value": "btc"
}
]
}
}
{
"name": "Success",
"value": {
"metadata": [
{
"key": "portfolio",
"value": "btc"
},
{
"key": "name",
"value": "Key 1"
}
]
}
}
This method isolates a key in a specific wallet called an "isolated wallet". This isolated wallet contains a single key. It can't generate keys, and is stripped of the master key. Generally, it can only sign transactions.
This is a security feature that lowers the impact of having a wallet stolen. If a wallet is stolen and the attacker breaks into it, he has access to all keys. On an isolated wallet, it can only retrieve the isolated key.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
isolatedWalletPassphrase | string | - |
publicKey | string | The Vega public key to use. |
Result key | Type | Description | Example |
---|---|---|---|
wallet | Name of the generated isolated wallet | Name of the generated isolated wallet | |
filePath | Path to the isolated wallet file | Path to the isolated wallet file |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.isolate_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"isolatedWalletPassphrase": "this-is-also-not-a-good-passphrase",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
}
{
"name": "Success",
"value": {
"wallet": "my-wallet.b5fd9d3c.isolated",
"filePath": "some/path/to/my-wallet.b5fd9d3c.isolated"
}
}
This method builds a transaction to rotate key on the network.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
fromPublicKey | string | The current public key |
toPublicKey | string | The next public key to rotate to |
chainID | string | The chain identifier |
submissionBlockHeight | string | The block height (approximation) at which the transaction will be submitted |
enactmentBlockHeight | string | The block height at which the rotation should happen |
Result key | Type | Description | Example |
---|---|---|---|
masterPublicKey | The master public key of the wallet used to sign the transaction | The master public key of the wallet used to sign the transaction | |
encodedTransaction | The base64-encoded key rotation transaction | The base64-encoded key rotation transaction |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.rotate_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"fromPublicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0",
"toPublicKey": "988eae323a07f12363c17025c23ee58ea32ac3912398e16bb0b56969f57adc52",
"chainID": "test-chain-Thz9c6",
"submissionBlockHeight": 10,
"enactmentBlockHeight": 15
}
}
{
"name": "Success",
"value": {
"masterPublicKey": "9df682a3c87d90567f260566a9c223ccbbb7529c38340cf163b8fe199dbf0f2e",
"encodedTransaction": "CqsBdGVzdC1jaGFpbi1UaHo5YzYACPfdurmpppHlogEQCqp9iAEIAhAPGkA5ODhlYWUzMjNhMDdmMTIzNjNjMTcwMjVjMjNlZTU4ZWEzMmFjMzkxMjM5OGUxNmJiMGI1Njk2OWY1N2FkYzUyIkA4MWFhZjk2NmU4ZjUxNDIzZjBiZDFkOTMzYWQ0NmY5NjJlMjNiY2Q3MTg4ZWQzZmUwZjUzZjRkYThhMzJhOWVlEpMBCoABYzg3NDVkODhlMWQ1YTBhOGE3NGI5YzRmN2QyMzQ3ZmQ5ZDY1NzIwYTQ3ZmYwNWU3YTZmZmYyOTA0NzhmOTU0M2NjM2E4MzJkNjBmYTJiNmY3ZTQ3YWJlMjE0MGIwOTEyNzBlNTAxZTA5MjVjNDg3NzEwMjViOTkyYTg1ZTAxMDQSDHZlZ2EvZWQyNTUxORgBgH0D0j5AOWRmNjgyYTNjODdkOTA1NjdmMjYwNTY2YTljMjIzY2NiYmI3NTI5YzM4MzQwY2YxNjNiOGZlMTk5ZGJmMGYyZQ=="
}
}
This method marks the specified public key as tainted. It makes it unusable for transaction signing.
When a key is tainted, it is automatically removed from the restricted keys if specified. If the key is the only one to be set, the permission to access the public keys is revoked. If no restricted key is specified, but all keys in the wallet are tainted, the permission of the public keys is revoked as well.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
publicKey | string | The Vega public key to use. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.taint_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
}
{
"name": "Success",
"value": null
}
This method removes the taint from the specified public key.
If you tainted a key for security reasons, you should not use it.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
publicKey | string | The Vega public key to use. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.untaint_key",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"publicKey": "b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
}
}
{
"name": "Success",
"value": null
}
This method returns the permissions set for the specified wallet and hostname.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
hostname | string | - |
Result key | Type | Description | Example |
---|---|---|---|
permissions | object | The full description of the permissions a third-party application has. | The full description of the permissions a third-party application has. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.describe_permissions",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"hostname": "vega.xyz"
}
}
{
"name": "Success",
"value": {
"permissions": {
"publicKeys": {
"access": "read",
"restrictedKeys": [
"b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
]
}
}
}
}
This method returns the permissions summary for all set hostnames.
For a detailed description of the permissions on a given hostname, see admin.describe_permissions
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
Result key | Type | Description | Example |
---|---|---|---|
permissions | object | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.list_permissions",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase"
}
}
{
"name": "Success",
"value": {
"permissions": {
"vega.xyz": {
"public_keys": "read"
},
"token.vega.xyz": {
"public_keys": "none"
}
}
}
}
This method updates the permissions for the specified wallet and hostname.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
hostname | string | - |
permissions | object | The full description of the permissions a third-party application has. |
Result key | Type | Description | Example |
---|---|---|---|
permissions | object | The full description of the permissions a third-party application has. | The full description of the permissions a third-party application has. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.update_permissions",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"hostname": "vega.xyz",
"permissions": {
"publicKeys": {
"access": "read",
"restrictedKeys": [
"b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
]
}
}
}
}
{
"name": "Success",
"value": {
"permissions": {
"publicKeys": {
"access": "read",
"restrictedKeys": [
"b5fd9d3c4ad553cb3196303b6e6df7f484cf7f5331a572a45031239fd71ad8a0"
]
}
}
}
}
This method revokes the permissions set in the specified hostname.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
hostname | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.revoke_permissions",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"hostname": "vega.xyz"
}
}
{
"name": "Success",
"value": null
}
This method purges all the permissions set for all hostname.
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.purge_permissions",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase"
}
}
{
"name": "Success",
"value": null
}
This method signs a transaction returning a base64-encoded transaction that can be sent using the method admin.send_transaction
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
pubKey | string | - |
chainId | string | - |
blockHeight | integer | - |
network (Optional) | integer | - |
transaction | object | The transaction as a JSON object |
Result key | Type | Description | Example |
---|---|---|---|
encodedTransaction | string | - | - |
This method signs any given message with a Vega public-key
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
pubKey | string | - |
encodedMessage | string | The message to sign encoded using base-64. |
Result key | Type | Description | Example |
---|---|---|---|
encodedSignature | string | - | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.sign_message",
"params": {
"wallet": "my-wallet",
"passphrase": "this-is-not-a-good-passphrase",
"pubKey": "0101010101010101010101010101010101010101010101010101010101010101",
"encodedMessage": "U3VwZXIgc2VjcmV0IG1lc3NhZ2U="
}
}
{
"name": "Success",
"value": {
"encodedSignature": "6a2Ud6yuNcnOaO8jaiTJJi8dZBQzvNySV2Tt2hD+YhVnz1dNxHGUavU2a1W1z0/1uX0n91x2jWXONMRpiiNODg=="
}
}
This method verifies any given signature with a Vega public-key
Parameter name | Type | Description |
---|---|---|
pubKey | string | - |
encodedMessage | string | The message use to create the signature, encoded using base-64. |
encodedSignature | string | The signature to verify, encoded using base-64. |
Result key | Type | Description | Example |
---|---|---|---|
isValid | string | - | - |
This method signs a transaction returning a base64-encoded transaction that can be sent using the method admin.send_transaction
Parameter name | Type | Description |
---|---|---|
wallet | string | - |
passphrase | string | - |
pubKey | string | - |
network (Optional) | integer | - |
sendingMode | string | The chosen mode to send the transaction: - TYPE_SYNC returns the result of running the transaction.- TYPE_ASYNC returns right away without waiting to hear if the transaction is even valid.- TYPE_COMMIT waits until the transaction is committed in a block or until some timeout is reached or returns return right away if the transaction is not valid. |
transaction | object | The transaction as a JSON object |
Result key | Type | Description | Example |
---|---|---|---|
receivedAt | string | The date when the API received the request to send the transaction. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
The date when the API received the request to send the transaction. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
sentAt | string | The date when the transaction has been sent to the network. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
The date when the transaction has been sent to the network. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
transactionHash | string | The hash of the transaction. It's used to uniquely identify the transaction and can be used in the block explorer to retrieve it. | 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 | object | A transaction that has been signed by the wallet. | A transaction that has been signed by the wallet. |
This method sends a transaction that was signed using admin.sign_transaction into a network
Parameter name | Type | Description |
---|---|---|
encodedTransaction | string | The signed transaction to be sent, encoded using base-64. |
network | string | The network to send the transaction to. |
nodeAddress | string | The node address to send the transaction to. |
retries | integer | the number of times sending the transaction should be attempted if it fails |
sendingMode | string | The chosen mode to send the transaction: - TYPE_SYNC returns the result of running the transaction.- TYPE_ASYNC returns right away without waiting to hear if the transaction is even valid.- TYPE_COMMIT waits until the transaction is committed in a block or until some timeout is reached or returns return right away if the transaction is not valid. |
Result key | Type | Description | Example |
---|---|---|---|
receivedAt | string | The date when the API received the request to send the transaction. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
The date when the API received the request to send the transaction. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
sentAt | string | The date when the transaction has been sent to the network. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
The date when the transaction has been sent to the network. The time is a quoted string in RFC 3339 format, with sub-second precision added if present. |
transactionHash | string | The hash of the transaction. It's used to uniquely identify the transaction and can be used in the block explorer to retrieve it. | 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 | object | A transaction that has been signed by the wallet. | A transaction that has been signed by the wallet. |
This method starts a wallet service targeting the specified network.
Parameter name | Type | Description |
---|---|---|
network | string | - |
noVersionCheck | boolean | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.start_service",
"params": {
"network": "mainnet1",
"noVersionCheck": false
}
}
{
"name": "Success",
"value": null
}
This method stops the wallet service targeting the specified network. This automatically disconnects all the wallets used in the service.
It does not fail if there is no service running for this network.
Parameter name | Type | Description |
---|---|---|
network | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.stop_service",
"params": {
"network": "mainnet1"
}
}
{
"name": "Success",
"value": null
}
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.stop_service",
"params": {
"network": "network-without-running-service"
}
}
{
"name": "Success",
"value": null
}
This method lists all the connections of a service.
Parameter name | Type | Description |
---|---|---|
network | string | - |
Result key | Type | Description | Example |
---|---|---|---|
activeConnections | array | The list is sorted by hostname, then by wallet name. | The list is sorted by hostname, then by wallet name. |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.list_connections",
"params": {
"network": "mainnet1"
}
}
{
"name": "Success",
"value": {
"activeConnections": [
{
"hostname": "console.vega.xyz",
"wallet": "my-btc-wallet"
},
{
"hostname": "vega.xyz",
"wallet": "my-btc-wallet"
},
{
"hostname": "vega.xyz",
"wallet": "my-eth-wallet"
}
]
}
}
This method closes the connection between a third-party application and a wallet opened in the service that run against the specified network.
Parameter name | Type | Description |
---|---|---|
network | string | - |
hostname | string | - |
wallet | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.close_connection",
"params": {
"network": "mainnet1",
"hostname": "vega.xyz",
"wallet": "my-btc-wallet"
}
}
{
"name": "Success",
"value": null
}
This method closes all the connections from the specified hostname to any wallet opened in the service that run against the specified network.
Parameter name | Type | Description |
---|---|---|
network | string | - |
hostname | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.close_connections_to_hostname",
"params": {
"network": "mainnet1",
"hostname": "vega.xyz"
}
}
{
"name": "Success",
"value": null
}
This method closes all the connections from any hostname to the specified wallet opened in the service that run against the specified network.
Parameter name | Type | Description |
---|---|---|
network | string | - |
wallet | string | - |
{
"id": 1,
"jsonrpc": "2.0",
"method": "admin.close_connections_to_wallet",
"params": {
"network": "mainnet1",
"wallet": "my-btc-wallet"
}
}
{
"name": "Success",
"value": null
}