const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schemaVersion: 'bitgo-repo-demo.v1',
templateId: '<string>',
idempotencyKey: '<string>'
})
};
fetch('https://api-staging.keystoneos.xyz/v1/demo/repos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-staging.keystoneos.xyz/v1/demo/repos"
payload = {
"schemaVersion": "bitgo-repo-demo.v1",
"templateId": "<string>",
"idempotencyKey": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api-staging.keystoneos.xyz/v1/demo/repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schemaVersion": "bitgo-repo-demo.v1",
"templateId": "<string>",
"idempotencyKey": "<string>"
}
'{
"schemaVersion": "bitgo-repo-demo.v1",
"repoId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": "<string>",
"templateId": "<string>",
"templateDigest": "<string>",
"termsDigest": "<string>",
"view": "source",
"createdAt": "2023-11-07T05:31:56Z",
"terms": {
"borrower": "client_a",
"lender": "client_b",
"collateral": {
"network": "canton-testnet",
"assetId": "tcanton",
"symbol": "testCC",
"decimals": 127,
"amountBaseUnits": "<string>"
},
"cash": {
"network": "sepolia",
"chainId": "11155111",
"tokenAddress": "<string>",
"symbol": "<string>",
"decimals": 127,
"principalBaseUnits": "<string>",
"repaymentBaseUnits": "<string>"
},
"maturityAt": "2023-11-07T05:31:56Z"
},
"opening": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"closing": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "closing",
"openingPhaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"movements": [
{
"movementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening_collateral",
"fromActor": "client_a",
"toActor": "client_a",
"assetId": "<string>",
"amountBaseUnits": "<string>",
"executionStatus": "not_started",
"signingStatus": "not_started",
"acceptanceStatus": "not_observed",
"ledgerStatus": "not_observed",
"bookStatus": "not_observed",
"evidence": [
"<unknown>"
],
"observedAt": null
}
],
"nextActions": [
"<unknown>"
],
"blockers": [
{
"code": "provider_execution_unqualified",
"message": "<string>"
}
],
"trust": {
"provider": "bitgo_test",
"custodyModel": "self_custody_mpc",
"reservation": "simulated",
"crossNetworkAtomicity": false
},
"authority": {
"state": "not_observed",
"observedAt": null
},
"decision": {
"state": "not_started",
"observedAt": null
},
"reservation": {
"mode": "simulated",
"state": "not_observed",
"observedAt": null
},
"asOf": {
"sequence": "<string>",
"observedAt": null
}
}{
"schemaVersion": "bitgo-repo-demo.v1",
"repoId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": "<string>",
"templateId": "<string>",
"templateDigest": "<string>",
"termsDigest": "<string>",
"view": "source",
"createdAt": "2023-11-07T05:31:56Z",
"terms": {
"borrower": "client_a",
"lender": "client_b",
"collateral": {
"network": "canton-testnet",
"assetId": "tcanton",
"symbol": "testCC",
"decimals": 127,
"amountBaseUnits": "<string>"
},
"cash": {
"network": "sepolia",
"chainId": "11155111",
"tokenAddress": "<string>",
"symbol": "<string>",
"decimals": 127,
"principalBaseUnits": "<string>",
"repaymentBaseUnits": "<string>"
},
"maturityAt": "2023-11-07T05:31:56Z"
},
"opening": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"closing": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "closing",
"openingPhaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"movements": [
{
"movementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening_collateral",
"fromActor": "client_a",
"toActor": "client_a",
"assetId": "<string>",
"amountBaseUnits": "<string>",
"executionStatus": "not_started",
"signingStatus": "not_started",
"acceptanceStatus": "not_observed",
"ledgerStatus": "not_observed",
"bookStatus": "not_observed",
"evidence": [
"<unknown>"
],
"observedAt": null
}
],
"nextActions": [
"<unknown>"
],
"blockers": [
{
"code": "provider_execution_unqualified",
"message": "<string>"
}
],
"trust": {
"provider": "bitgo_test",
"custodyModel": "self_custody_mpc",
"reservation": "simulated",
"crossNetworkAtomicity": false
},
"authority": {
"state": "not_observed",
"observedAt": null
},
"decision": {
"state": "not_started",
"observedAt": null
},
"reservation": {
"mode": "simulated",
"state": "not_observed",
"observedAt": null
},
"asOf": {
"sequence": "<string>",
"observedAt": null
}
}{
"detail": "<string>",
"code": "INVALID_TOKEN",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#http-error"
}{
"detail": "<string>",
"code": "INVALID_TOKEN",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#http-error"
}{
"detail": "<string>",
"code": "INVALID_TOKEN",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#http-error"
}Create demo repo
Requires the settlements:write scope (as an M2M scope or a user permission).
Create a BitGo demo repo from a configured template. The terms, the roles, the wallets and the initial state come from the operator’s trusted configuration; the body names the template and a retry key and nothing else. Only the configured source actor may create. The request is idempotent on idempotencyKey: the same key with the same body answers 200 with the record as it was created, under the terms of that day, with Idempotency-Replayed: true; the same key with a different body is refused. The snapshot describes the initial state only: no movement has started, no evidence exists and no action is offered until provider execution is qualified.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schemaVersion: 'bitgo-repo-demo.v1',
templateId: '<string>',
idempotencyKey: '<string>'
})
};
fetch('https://api-staging.keystoneos.xyz/v1/demo/repos', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api-staging.keystoneos.xyz/v1/demo/repos"
payload = {
"schemaVersion": "bitgo-repo-demo.v1",
"templateId": "<string>",
"idempotencyKey": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api-staging.keystoneos.xyz/v1/demo/repos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schemaVersion": "bitgo-repo-demo.v1",
"templateId": "<string>",
"idempotencyKey": "<string>"
}
'{
"schemaVersion": "bitgo-repo-demo.v1",
"repoId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": "<string>",
"templateId": "<string>",
"templateDigest": "<string>",
"termsDigest": "<string>",
"view": "source",
"createdAt": "2023-11-07T05:31:56Z",
"terms": {
"borrower": "client_a",
"lender": "client_b",
"collateral": {
"network": "canton-testnet",
"assetId": "tcanton",
"symbol": "testCC",
"decimals": 127,
"amountBaseUnits": "<string>"
},
"cash": {
"network": "sepolia",
"chainId": "11155111",
"tokenAddress": "<string>",
"symbol": "<string>",
"decimals": 127,
"principalBaseUnits": "<string>",
"repaymentBaseUnits": "<string>"
},
"maturityAt": "2023-11-07T05:31:56Z"
},
"opening": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"closing": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "closing",
"openingPhaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"movements": [
{
"movementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening_collateral",
"fromActor": "client_a",
"toActor": "client_a",
"assetId": "<string>",
"amountBaseUnits": "<string>",
"executionStatus": "not_started",
"signingStatus": "not_started",
"acceptanceStatus": "not_observed",
"ledgerStatus": "not_observed",
"bookStatus": "not_observed",
"evidence": [
"<unknown>"
],
"observedAt": null
}
],
"nextActions": [
"<unknown>"
],
"blockers": [
{
"code": "provider_execution_unqualified",
"message": "<string>"
}
],
"trust": {
"provider": "bitgo_test",
"custodyModel": "self_custody_mpc",
"reservation": "simulated",
"crossNetworkAtomicity": false
},
"authority": {
"state": "not_observed",
"observedAt": null
},
"decision": {
"state": "not_started",
"observedAt": null
},
"reservation": {
"mode": "simulated",
"state": "not_observed",
"observedAt": null
},
"asOf": {
"sequence": "<string>",
"observedAt": null
}
}{
"schemaVersion": "bitgo-repo-demo.v1",
"repoId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision": "<string>",
"templateId": "<string>",
"templateDigest": "<string>",
"termsDigest": "<string>",
"view": "source",
"createdAt": "2023-11-07T05:31:56Z",
"terms": {
"borrower": "client_a",
"lender": "client_b",
"collateral": {
"network": "canton-testnet",
"assetId": "tcanton",
"symbol": "testCC",
"decimals": 127,
"amountBaseUnits": "<string>"
},
"cash": {
"network": "sepolia",
"chainId": "11155111",
"tokenAddress": "<string>",
"symbol": "<string>",
"decimals": 127,
"principalBaseUnits": "<string>",
"repaymentBaseUnits": "<string>"
},
"maturityAt": "2023-11-07T05:31:56Z"
},
"opening": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"closing": {
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "closing",
"openingPhaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"complete": false,
"movementIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"movements": [
{
"movementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"phaseId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kind": "opening_collateral",
"fromActor": "client_a",
"toActor": "client_a",
"assetId": "<string>",
"amountBaseUnits": "<string>",
"executionStatus": "not_started",
"signingStatus": "not_started",
"acceptanceStatus": "not_observed",
"ledgerStatus": "not_observed",
"bookStatus": "not_observed",
"evidence": [
"<unknown>"
],
"observedAt": null
}
],
"nextActions": [
"<unknown>"
],
"blockers": [
{
"code": "provider_execution_unqualified",
"message": "<string>"
}
],
"trust": {
"provider": "bitgo_test",
"custodyModel": "self_custody_mpc",
"reservation": "simulated",
"crossNetworkAtomicity": false
},
"authority": {
"state": "not_observed",
"observedAt": null
},
"decision": {
"state": "not_started",
"observedAt": null
},
"reservation": {
"mode": "simulated",
"state": "not_observed",
"observedAt": null
},
"asOf": {
"sequence": "<string>",
"observedAt": null
}
}{
"detail": "<string>",
"code": "INVALID_TOKEN",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#http-error"
}{
"detail": "<string>",
"code": "INVALID_TOKEN",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#http-error"
}{
"detail": "<string>",
"code": "INVALID_TOKEN",
"docs_url": "https://docs.keystoneos.xyz/guides/error-codes#http-error"
}Authorizations
Auth0 JWT access token. See Authentication for details.
Body
A request to create a repo from a template. The terms, the roles, the wallets and the initial state all come from the operator's template configuration; a caller can name the template and nothing else.
"bitgo-repo-demo.v1"^[\x21-\x7E]{1,255}$Your key for safe retries, unique within the environment. A retry with the same key and the same request body returns the existing resource with Idempotency-Replayed: true; the same key with a different body answers 409 IDEMPOTENCY_CONFLICT, and a key whose resource recorded no request digest answers 409 IDEMPOTENCY_REPLAY_UNVERIFIABLE. Keys starting with 'match-' are reserved for keys KeyStone derives and are refused.
1 - 255Response
Replay: the record an earlier request with this key created.
One view of a repo at one revision. The movements are the schedule the terms prescribe, in order, and the phases list exactly their own movements, so a snapshot cannot describe a transfer the terms do not.
"bitgo-repo-demo.v1"20^(0|[1-9][0-9]*)$^[\x21-\x7E]{1,255}$^[0-9a-f]{64}$^[0-9a-f]{64}$source, custodian_a, custodian_b Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
4 elementsShow child attributes
Show child attributes
1 elementShow child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes