Unbound Crypto Asset Security Platform ("CASP") Management API v1.0.2106
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Unbound`s Crypto Asset Security Platform ("CASP") provides the advanced technology and the architecture to secure crypto asset transactions. The crypto asset solution contains the CASP service and different end points (humans or BOTs).
CASP provides the framework to create Accounts, which hold multiple Vaults where secrets are stored. Access control is managed by the Quorum Policy for all of the Participants.
For information about using these APIs, see the Unbound CASP Developers Guide, or the API references:
For more information about CASP, see:
- Unbound CASP Release Notes - information about CASP APIs.
- Unbound CASP FAQ - Frequently asked questions.
- Unbound CASP User Guide - contains system requirements, installation instructions, and more.
For more information about the BIP standards, see:
- BIP32 - HD wallets - information about the BIP32 standard for hierarchical deterministic wallets.
- BIP44 - multi-account wallets - information about the BIP44 standard for multi-account hierarchy for deterministic wallets.
- SLIP44 - coin types - defines the index values for the coin types.
Base URLs:
Email: Unbound Security Support Web: Unbound Security Support
System
Get configuration
Code samples
fetch('/api/v1.0/config',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v1.0/config
GET /config
Returns the configuration including supported blockchain providers and adaptors
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | Returns configuration | None |
Get system status
Code samples
fetch('/api/v1.0/status',
{
method: 'GET'
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v1.0/status
GET /status
Used for checking the system operational status
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Current system status | None |
Ledger Operations
Get ledger address balance
Code samples
const headers = {
'Accept':'application/json'
};
fetch('/api/v1.0/ledgers/{ledgerId}/addresses/{address}/balance',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v1.0/ledgers/{ledgerId}/addresses/{address}/balance \
-H 'Accept: application/json'
GET /ledgers/{ledgerId}/addresses/{address}/balance
Request balance for one or more assets per ledger address.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
ledgerId | path | string | true | none |
address | path | string | true | The target address the balance is required for |
assets | query | array[string] | false | A list of asset symbols the balance is requested for. If this parameter is not provided, then the default asset defined for the ledger is used. |
Example responses
200 Response
{
"address": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"balances": [
{
"asset": "YEENUS",
"amount": 885.82
},
{
"asset": "ETH",
"amount": 8.2221820926
},
{
"asset": "BOKKY",
"amount": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Requested balances | AddressBalanceResponse |
422 | Unprocessable Entity | One or more the provided arguments is invalid | AppError |
Validate ledger address
Code samples
const headers = {
'Accept':'application/json'
};
fetch('/api/v1.0/ledgers/{ledgerId}/addresses/{address}/valid',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v1.0/ledgers/{ledgerId}/addresses/{address}/valid \
-H 'Accept: application/json'
GET /ledgers/{ledgerId}/addresses/{address}/valid
Check the validity of a ledger address.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
ledgerId | path | string | true | none |
address | path | string | true | The address to check |
Example responses
200 Response
{
"address": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"valid": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Validity test result | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» address | string | false | none | Target address that was checked |
» valid | boolean | false | none | True if the address is valid or false otherwise |
Convert public key to ledger address
Code samples
const inputBody = '{
"keys": [
"3056301006072A8648CE3D020106052B8104000A03420004A17D64FCFCE5FE10943FCC7E6BBDE1BD49EBC596297813C4FE3CCB0343B44236DD189B32B0C88D6F12067F1237A95286C82162B078D686A79C986E1204A6E162"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v1.0/ledgers/{ledgerId}/address-from-publickey',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v1.0/ledgers/{ledgerId}/address-from-publickey \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST /ledgers/{ledgerId}/address-from-publickey
Convert a public key to ledger address
Body parameter
{
"keys": [
"3056301006072A8648CE3D020106052B8104000A03420004A17D64FCFCE5FE10943FCC7E6BBDE1BD49EBC596297813C4FE3CCB0343B44236DD189B32B0C88D6F12067F1237A95286C82162B078D686A79C986E1204A6E162"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
ledgerId | path | string | true | none |
body | body | object | false | none |
» keys | body | [string] | false | none |
Example responses
200 Response
{
"items": [
{
"address": "0x63e4a30a5ce88660BBf99D7B0547E718558bC662"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Keys converted successfully | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» items | [Address] | false | none | none |
»» address | string | false | none | none |
Vault Operations
Refer to the Vault Operations section in the Unbound CASP Developers Guide.
For some functionality, you may need to refer to the BYOW Vault Operation APIs. For example, the endpoint to create a new vault is described there.
Get wallet balance
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1.0/vaults/{vaultId}/balance',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v1.0/vaults/{vaultId}/balance \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
GET /vaults/{vaultId}/balance
Get vault wallet balance
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
vaultId | path | string | true | none |
assets | query | array[string] | false | A list of asset symbols the balance is requested for. If this parameter is not provided, then the default asset defined for the ledger is used. |
coin | query | string | false | none |
account | query | string | false | none |
Example responses
200 Response
{
"address": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"balances": [
{
"asset": "YEENUS",
"amount": 885.82
},
{
"asset": "ETH",
"amount": 8.2221820926
},
{
"asset": "BOKKY",
"amount": 0
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Requested vault balance | VaultBalanceResponse |
Create withdrawal request
Code samples
const inputBody = '{
"amount": "1.3",
"asset": "YEENUS",
"recipientAddress": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"description": "Payment 3332",
"fee": "HIGH"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('/api/v1.0/vaults/{vaultId}/withdrawals',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v1.0/vaults/{vaultId}/withdrawals \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
POST /vaults/{vaultId}/withdrawals
Create a new withdrawal request.
The request is sent to CASP and starts the quorum approval process, which can take some time. Once the request is approved, CASP calls the POST /sign_complete_callback
and the required signed transactions are sent to the ledger.
Body parameter
{
"amount": "1.3",
"asset": "YEENUS",
"recipientAddress": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"description": "Payment 3332",
"fee": "HIGH"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
vaultId | path | string | true | none |
body | body | WithdrawalRequest | true | none |
Example responses
200 Response
{
"id": "9767714e-4a32-4264-af91-0c48d437e698",
"status": "EXECUTING",
"isComplete": false,
"appData": {
"txs": [
{
"serialized": "f868808477359400828ccd94f6ff95d53e08c9660dc7820fd5a775484f77183a80b844a9059cbb0000000000000000000000007827d7fdb2b161a27ffed3cc25c560d7aefe2bd50000000000000000000000000000000000000000000000000000000007bfa480808080"
}
]
},
"description": "dasdfa dfasdf "
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Withdrawal request created successfully | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» operationID | string | false | none | The operation ID from CASP |
» status | string | false | none | The request status. Normally this is EXECUTING . |
» isComplete | boolean | false | none | The request completion status. Normally this is false as the request has just been submitted. |
» description | string | false | none | The request description |
» recipientVault | string | false | none | Optionally the recipient vault |
» appData | WithdrawalProviderData | false | none | none |
»» request | WithdrawalRequest | false | none | none |
»»» recipientAddress | string | true | none | The ledger address to recieve the assets |
»»» recipientVault | string | false | none | The target vault ID for internal transfers (originally for staking-pools) |
»»» asset | string | false | none | (Optional) The asset to send. If not provided, the default ledger asset is used. |
»»» amount | any | true | none | The asset amount to send |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»» anonymous | number(double) | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»»» anonymous | string | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» description | string | true | none | A short text that describes the puprpose of this withdrawal. |
»»» fee | string | false | none | A fee constant. Usually specificied as 'HIGH', 'MEDIUM' or 'LOW', but some ledgers use custom fee constants. If not provided, the ledger's default fee is used. |
»» txs | [object] | false | none | A list of ledger tranasactions created for the withdrawal |
»»» serialized | string | false | none | The HEX encoded serialized transaction |
Update vault info
Code samples
const inputBody = '{
"name": "string",
"description": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'*/*',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{id}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PUT https://casp-server/casp/api/v1.0/mng/vaults/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: */*' \
-H 'Authorization: Bearer API_KEY'
PUT /casp/api/v1.0/mng/vaults/{id}
Updates the details of an existing vault. The vault name and description can be updated.
Body parameter
{
"name": "string",
"description": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | Vault ID |
body | body | UpdateVaultRequest | true | Update vault Request |
Example responses
404 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
202 | Accepted | Vault update accepted and needs to be approved by admin quorum. | None |
404 | Not Found | Vault not found | CASPErrorResponse |
500 | Internal Server Error | Update vault failed | CASPErrorResponse |
Delete an existing vault
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X DELETE https://casp-server/casp/api/v1.0/mng/vaults/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
DELETE /casp/api/v1.0/mng/vaults/{id}
Deletes an existing vault. Only vaults which are not activated yet can be deleted.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | string | true | Vault ID |
Example responses
403 Response
{
"type": "string",
"title": "string",
"details": "string",
"status": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
403 | Forbidden | Vault deletion is not allowed | CASPErrorResponse |
404 | Not Found | Vault not found | CASPErrorResponse |
500 | Internal Server Error | Delete vault failed | CASPErrorResponse |
Resend sign transaction operation
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/operations/sign/{operationid}/resend',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST https://casp-server/casp/api/v1.0/mng/operations/sign/{operationid}/resend \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
POST /casp/api/v1.0/mng/operations/sign/{operationid}/resend
Resend the sign operation metadata. This tries to resend the results of the sign operation and complete the coin transaction
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
operationid | path | string | true | Operation ID |
Example responses
400 Response
{
"type": "string",
"title": "string",
"details": "string",
"status": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
400 | Bad Request | Cannot resend the sign operation | CASPErrorResponse |
404 | Not Found | Operation not found | CASPErrorResponse |
500 | Internal Server Error | Resend Operation failed | CASPErrorResponse |
List UKC vault keys
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/ukcKeys',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/ukcKeys \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
GET /casp/api/v1.0/mng/vaults/{vaultId}/ukcKeys
List UKC vault keys
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
vaultId | path | string | true | Vault ID |
Example responses
200 Response
[
{
"ukcKeyId": "string"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | Inline |
404 | Not Found | Vault not found | CASPErrorResponse |
500 | Internal Server Error | List UKC keys failed | CASPErrorResponse |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [UkcVaultKey] | false | none | none |
» ukcKeyId | string | true | none | The key UKC key ID |
Public key calculation status
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/operations/calculatePublicKey/{operationid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET https://casp-server/casp/api/v1.0/mng/operations/calculatePublicKey/{operationid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
GET /casp/api/v1.0/mng/operations/calculatePublicKey/{operationid}
For some keys, calculating public keys requires approval of the admin group. This request queries the operation status.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
operationid | path | string | true | Operation ID |
Example responses
200 Response
{
"operationID": "string",
"kind": "JOIN_VAULT",
"status": "PENDING",
"statusText": "Pending",
"createdAt": "string",
"vaultID": "string",
"description": "string",
"isApproved": true,
"accountID": "string",
"groups": [
{
"name": "string",
"members": [
{
"approvedAt": "string",
"id": "string",
"isApproved": true,
"name": "string",
"status": "STARTED",
"approvalGroupAccount": {
"id": "string",
"name": "string"
},
"label": "string",
"isGlobal": true,
"isActive": true,
"globalStatus": "ACTIVATED",
"isOffline": true
}
],
"requiredApprovals": 0,
"order": 0,
"deactivateAllowed": true,
"isOffline": true
}
],
"policyDetails": {
"id": "string",
"name": "string"
},
"vaultName": "string",
"totsParams": [
{
"index": 0,
"numberOfFragments": 0
}
],
"publicKeys": [
"string"
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | CalculatePublicKeyOperationDetails |
404 | Not Found | Operation not found | CASPErrorResponse |
500 | Internal Server Error | Get Operation status failed | CASPErrorResponse |
Policy Management
Refer to the Policy Management section in the Unbound CASP Developers Guide.
Add member to vault
Code samples
const inputBody = '{
"participantID": "string",
"description": "string",
"policyId": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/approval_groups/{approvalGroupId}/members',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/approval_groups/{approvalGroupId}/members \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
POST /casp/api/v1.0/mng/vaults/{vaultId}/approval_groups/{approvalGroupId}/members
This API is used if a participant becomes unavailable or leaves an account and needs to be replaced with a new participant. A new participant may be added to an existing vault, but requires the approval of the existing vault quorum.
Body parameter
{
"participantID": "string",
"description": "string",
"policyId": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
vaultId | path | string | true | Vault ID |
approvalGroupId | path | string | true | Approval Group Id |
body | body | AddVaultParticipantRequest | true | Add vault group participant request |
Example responses
200 Response
{
"operation": {
"operationID": "string",
"kind": "JOIN_VAULT",
"status": "PENDING",
"statusText": "Pending",
"createdAt": "string",
"vaultID": "string",
"description": "string",
"isApproved": true,
"accountID": "string",
"groups": [
{
"name": "string",
"members": [
{
"approvedAt": "string",
"id": "string",
"isApproved": true,
"name": "string",
"status": "STARTED",
"approvalGroupAccount": {
"id": "string",
"name": "string"
},
"label": "string",
"isGlobal": true,
"isActive": true,
"globalStatus": "ACTIVATED",
"isOffline": true
}
],
"requiredApprovals": 0,
"order": 0,
"deactivateAllowed": true,
"isOffline": true
}
],
"policyDetails": {
"id": "string",
"name": "string"
},
"vaultName": "string"
},
"participant": {
"id": "string",
"accountID": "string",
"name": "string",
"email": "string",
"status": "NOT_ACTIVATED",
"isActive": true,
"accountName": "string",
"role": "string",
"pushEnabled": true,
"offline": true,
"activeOperations": 0,
"deviceType": "IOS",
"creationTime": "string",
"modificationTime": "string"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | AddMemberResponse |
404 | Not Found | Item not found | CASPErrorResponse |
500 | Internal Server Error | Add participant failed | CASPErrorResponse |
Set vault member status
Code samples
const inputBody = '{
"status": "DEACTIVATED"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}/status',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PUT https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}/status \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
PUT /casp/api/v1.0/mng/vaults/{vaultId}/members/{participantId}/status
The suspended participant no longer takes part in the vault approval processes. Note that you can only suspend or revoke a user if the remaining number of participants is sufficient for the quorum, unless 'force' flag is provided.
Body parameter
{
"status": "DEACTIVATED"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
participantId | path | string | true | Participant ID |
vaultId | path | string | true | vault ID |
force | query | boolean | false | Force update of participant status. Warning: Using this flag can result in an unusable vault! |
body | body | UpdateParticipantStatusRequest | true | Participant status update request |
Example responses
200 Response
{
"id": "string",
"name": "string",
"status": "ACTIVATED",
"approvalGroupAccount": {
"id": "string",
"name": "string"
},
"label": "string",
"isGlobal": true,
"isActive": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ParticipantStatusChangeResponse |
202 | Accepted | Accepted | OperationDetails |
403 | Forbidden | Suspending or revoking this participant would make the vault not operational (too few active participants left) | CASPErrorResponse |
404 | Not Found | Participant not found | CASPErrorResponse |
500 | Internal Server Error | Set vault member status failed | CASPErrorResponse |
Set vault member status (deprecated)
Code samples
const inputBody = '{
"status": "DEACTIVATED",
"policyId": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{id}/members/{participantId}',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PUT https://casp-server/casp/api/v1.0/mng/vaults/{id}/members/{participantId} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
PUT /casp/api/v1.0/mng/vaults/{id}/members/{participantId}
The suspended participant no longer takes part in the vault transaction approval processes. Note that you can only suspend or revoke a user, if the remaining number of participants is sufficient for the quorum policy, unless 'force' flag is provided.
Body parameter
{
"status": "DEACTIVATED",
"policyId": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
participantId | path | string | true | Participant ID |
id | path | string | true | vault ID |
body | body | UpdateParticipantStatusWithPolicyRequest | true | Participant status update request |
Example responses
404 Response
{
"type": "string",
"title": "string",
"details": "string",
"status": 0
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | None |
404 | Not Found | Participant not found | CASPErrorResponse |
500 | Internal Server Error | Set vault member status failed | CASPErrorResponse |
Set policy member status
Code samples
const inputBody = '{
"status": "DEACTIVATED"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/policies/{policyId}/members/{participantId}/status',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X PUT https://casp-server/casp/api/v1.0/mng/vaults/{vaultId}/policies/{policyId}/members/{participantId}/status \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
PUT /casp/api/v1.0/mng/vaults/{vaultId}/policies/{policyId}/members/{participantId}/status
The suspended participant no longer takes part in the vault transaction approval processes. Note that you can only suspend or revoke a user, if the remaining number of participants is sufficient for the quorum policy, unless 'force' flag is provided.
Body parameter
{
"status": "DEACTIVATED"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
participantId | path | string | true | Participant ID |
vaultId | path | string | true | vault ID |
policyId | path | string | true | policy ID |
force | query | boolean | false | Force update of participant status |
body | body | UpdateParticipantStatusRequest | true | Participant status update request |
Example responses
200 Response
{
"id": "string",
"name": "string",
"status": "ACTIVATED",
"approvalGroupAccount": {
"id": "string",
"name": "string"
},
"label": "string",
"isGlobal": true,
"isActive": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | ParticipantStatusChangeResponse |
202 | Accepted | Accepted | OperationDetails |
403 | Forbidden | Suspending or revoking this participant would make the vault not operational (too few active participants left) | CASPErrorResponse |
404 | Not Found | Item not found | CASPErrorResponse |
500 | Internal Server Error | Set vault member status participant failed | CASPErrorResponse |
Status of add member operation
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/operations/addmember/{operationid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET https://casp-server/casp/api/v1.0/mng/operations/addmember/{operationid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
GET /casp/api/v1.0/mng/operations/addmember/{operationid}
Adding a new participant to a vault requires approval of the quorum. This request queries the status of such an asynchronous operation. The Operation ID parameter must be from an 'ADD_MEMBER' operation.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
operationid | path | string | true | Operation ID |
Example responses
200 Response
{
"operationID": "string",
"kind": "JOIN_VAULT",
"status": "PENDING",
"statusText": "Pending",
"createdAt": "string",
"vaultID": "string",
"description": "string",
"isApproved": true,
"accountID": "string",
"groups": [
{
"name": "string",
"members": [
{
"approvedAt": "string",
"id": "string",
"isApproved": true,
"name": "string",
"status": "STARTED",
"approvalGroupAccount": {
"id": "string",
"name": "string"
},
"label": "string",
"isGlobal": true,
"isActive": true,
"globalStatus": "ACTIVATED",
"isOffline": true
}
],
"requiredApprovals": 0,
"order": 0,
"deactivateAllowed": true,
"isOffline": true
}
],
"policyDetails": {
"id": "string",
"name": "string"
},
"vaultName": "string",
"groupName": "string",
"participantName": "string",
"participantID": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | AddMemberDetails |
404 | Not Found | Operation not found | CASPErrorResponse |
500 | Internal Server Error | Get Operation status failed | CASPErrorResponse |
Status of join policy vault operation
Code samples
const headers = {
'Accept':'application/json',
'Authorization':'API_KEY'
};
fetch('https://casp-server/casp/api/v1.0/mng/operations/joinpolicyvault/{operationid}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET https://casp-server/casp/api/v1.0/mng/operations/joinpolicyvault/{operationid} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer API_KEY'
GET /casp/api/v1.0/mng/operations/joinpolicyvault/{operationid}
Returns join policy vault operation details. The Operation ID parameter must be from a 'JOIN_POLICY_VAULT' operation.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
operationid | path | string | true | Operation ID |
Example responses
200 Response
{
"operationID": "string",
"kind": "JOIN_VAULT",
"status": "PENDING",
"statusText": "Pending",
"createdAt": "string",
"vaultID": "string",
"description": "string",
"isApproved": true,
"accountID": "string",
"policies": [
{
"name": "string",
"id": "string",
"description": "string",
"enabled": true,
"timeZone": "string",
"groups": [
{
"name": "string",
"members": [
{
"approvedAt": "string",
"id": "string",
"isApproved": true,
"name": "string",
"status": "STARTED",
"approvalGroupAccount": {
"id": "string",
"name": "string"
},
"label": "string",
"isGlobal": true,
"isActive": true,
"globalStatus": "ACTIVATED",
"isOffline": true
}
],
"requiredApprovals": 0,
"order": 0,
"deactivateAllowed": true,
"isOffline": true
}
],
"rules": {
"weeklyTimeSlots": [
{
"days": "string",
"timeStart": "string",
"timeEnd": "string"
}
],
"amountRange": {
"property1": {
"minimum": 0,
"maximum": 0
},
"property2": {
"minimum": 0,
"maximum": 0
}
},
"whiteList": [
"string"
],
"derivedWhiteList": [
{
"chainCode": "string",
"publicKey": "string",
"level": 0,
"parentFingerprint": "string",
"childNumber": 0
}
],
"attributes": [
{
"id": "string",
"op": "string",
"value": "string"
}
]
}
}
],
"vaultName": "string",
"groupNameToJoin": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | JoinPolicyVaultOperationDetails |
404 | Not Found | Operation not found | CASPErrorResponse |
500 | Internal Server Error | Get Operation status failed | CASPErrorResponse |
Callbacks
Sign callback URL
Code samples
const inputBody = '{
"publicKeys": [
"string"
],
"providerData": "string",
"dataToSign": [
"string"
],
"signatures": [
"string"
],
"v": [
0
],
"originalEntryIds": [
0
]
}';
const headers = {
'Content-Type':'application/json'
};
fetch('/api/v1.0/sign_complete_callback?ledgerId=string',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v1.0/sign_complete_callback?ledgerId=string \
-H 'Content-Type: application/json'
POST /sign_complete_callback
Sign callback url from CASP
Body parameter
{
"publicKeys": [
"string"
],
"providerData": "string",
"dataToSign": [
"string"
],
"signatures": [
"string"
],
"v": [
0
],
"originalEntryIds": [
0
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
ledgerId | query | string | true | The id of the ledger on which the transaction should take place |
body | body | object | true | Signed Operation Request |
» publicKeys | body | [string] | true | Vault public key |
» providerData | body | string | true | Used to store information in the CASP database. The information can subsequently be read back as needed for the coin specific coin type usage. |
» dataToSign | body | [string] | true | List of data to sign |
» signatures | body | [string] | true | Signatures |
» v | body | [integer] | true | recovery codes |
» originalEntryIds | body | [integer] | false | List of indices matching the original dataForSignature list in case the server sends a partial list of signatures (when used with policies) |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
default | Default | returns data to store in CASP | None |
Schemas
Address
{
"items": [
{
"address": "mkoTSoVG1pdKqycgbVyXpLmmaNK7ELbRXn"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
address | string | false | none | none |
AssetBalance
{
"asset": "string",
"amount": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
asset | string | false | none | Asset symbol |
amount | string | false | none | Amount to send |
BalanceResponse
{
"balances": [
{
"asset": "string",
"amount": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
balances | [AssetBalance] | false | none | none |
AddressBalanceResponse
{
"address": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"balances": [
{
"asset": "YEENUS",
"amount": 885.82
},
{
"asset": "ETH",
"amount": 8.2221820926
},
{
"asset": "BOKKY",
"amount": 0
}
]
}
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | BalanceResponse | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» address | string | false | none | none |
VaultBalanceResponse
{
"address": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"balances": [
{
"asset": "YEENUS",
"amount": 885.82
},
{
"asset": "ETH",
"amount": 8.2221820926
},
{
"asset": "BOKKY",
"amount": 0
}
]
}
Properties
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | BalanceResponse | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | object | false | none | none |
» address | string | false | none | If the vault has only one address this attribute is returned. Otherwise, this attribute is ommited. |
» vaultId | string | false | none | The vault ID |
» coin | string | false | none | For BIP44 vaults - the coin type of the BIP44 account that was used to get the balance, otherwise ommited. |
» account | string | false | none | For BIP44 vaults - indicates the BIP44 account index that was used to get the balance, otherwise ommited. |
AppError
{
"title": "Invalid argument",
"details": "Unknown asset 'yeenussd'. Valid assets are: ETH,BOKKY,YEENUS,PAX",
"errCode": "ERR_INVALID_ARGUMENTS",
"type": "/errors/ERR_INVALID_ARGUMENTS"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | false | none | The error title that can be used for user display |
details | string | false | none | Detailed information about the error and resolution |
errCode | string | false | none | A textual code that can be used to classify the error |
type | string | false | none | Path for more information about the error |
WithdrawalRequest
{
"amount": "1.3",
"asset": "YEENUS",
"recipientAddress": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"description": "Payment 3332",
"fee": "HIGH"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
recipientAddress | string | true | none | The ledger address to recieve the assets |
recipientVault | string | false | none | The target vault ID for internal transfers (originally for staking-pools) |
asset | string | false | none | (Optional) The asset to send. If not provided, the default ledger asset is used. |
amount | any | true | none | The asset amount to send |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | number(double) | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» anonymous | string | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
description | string | true | none | A short text that describes the puprpose of this withdrawal. |
fee | string | false | none | A fee constant. Usually specificied as 'HIGH', 'MEDIUM' or 'LOW', but some ledgers use custom fee constants. If not provided, the ledger's default fee is used. |
WithdrawalProviderData
{
"request": {
"amount": "1.3",
"asset": "YEENUS",
"recipientAddress": "0x7827D7fDb2B161a27fFeD3cC25C560D7aEFE2BD5",
"description": "Payment 3332",
"fee": "HIGH"
},
"txs": [
{
"serialized": "string"
}
]
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
request | WithdrawalRequest | false | none | none |
txs | [object] | false | none | A list of ledger tranasactions created for the withdrawal |
» serialized | string | false | none | The HEX encoded serialized transaction |