curl --request POST \
--url https://api.anchorage-staging.com/v2/atlas/requests/{requestId}/approve \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"approval": {
"agreementId": "<string>",
"exchangeAccountId": "<string>",
"pledgorParticipantId": "<string>",
"exchangeProfileId": "<string>"
}
}
'import requests
url = "https://api.anchorage-staging.com/v2/atlas/requests/{requestId}/approve"
payload = { "approval": {
"agreementId": "<string>",
"exchangeAccountId": "<string>",
"pledgorParticipantId": "<string>",
"exchangeProfileId": "<string>"
} }
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
approval: {
agreementId: '<string>',
exchangeAccountId: '<string>',
pledgorParticipantId: '<string>',
exchangeProfileId: '<string>'
}
})
};
fetch('https://api.anchorage-staging.com/v2/atlas/requests/{requestId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request": {
"agreementId": "<string>",
"approvalRequired": true,
"createdAt": "2023-11-07T05:31:56Z",
"initiatedBy": "pledgor",
"pledgorParticipantId": "<string>",
"requestId": "<string>",
"securedPartyParticipantId": "<string>",
"status": "proposed",
"type": "createOESAgreement",
"updatedAt": "2023-11-07T05:31:56Z",
"delegationChange": {
"delegationId": "<string>",
"items": [
{
"amount": {
"amount": "10.45234733",
"assetType": "ETH",
"tokenId": "123"
},
"currentAmount": {
"amount": "10.45234733",
"assetType": "ETH",
"tokenId": "123"
},
"resultingAmount": {
"amount": "10.45234733",
"assetType": "ETH",
"tokenId": "123"
},
"walletId": "<string>"
}
],
"vaultId": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z",
"oesAgreement": {
"exchangeAccountId": "<string>",
"exchangeProfileId": "<string>"
}
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Approve a request
Permissions required: Authorize Agreement Operations or Propose and Accept settlements
The authorize permission must be granted with any vault allowed.
Approve a request that is waiting on you. The signed request body is recorded as your approval, so the body restates the terms you are approving.
Only a party the request is waiting on may approve it; approvalRequired on the request says whether that is you. Approving a createOESAgreement request is your ratification of the control agreement, which then becomes active. Approving an increaseDelegation or decreaseDelegation request is your approval of the pledge or unpledge, which is then carried out. A change you proposed yourself cannot be decided here yet; it is refused.
The decision is carried out asynchronously. Poll GET /atlas/requests/{requestId} to follow the request to completed.
curl --request POST \
--url https://api.anchorage-staging.com/v2/atlas/requests/{requestId}/approve \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"approval": {
"agreementId": "<string>",
"exchangeAccountId": "<string>",
"pledgorParticipantId": "<string>",
"exchangeProfileId": "<string>"
}
}
'import requests
url = "https://api.anchorage-staging.com/v2/atlas/requests/{requestId}/approve"
payload = { "approval": {
"agreementId": "<string>",
"exchangeAccountId": "<string>",
"pledgorParticipantId": "<string>",
"exchangeProfileId": "<string>"
} }
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
approval: {
agreementId: '<string>',
exchangeAccountId: '<string>',
pledgorParticipantId: '<string>',
exchangeProfileId: '<string>'
}
})
};
fetch('https://api.anchorage-staging.com/v2/atlas/requests/{requestId}/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request": {
"agreementId": "<string>",
"approvalRequired": true,
"createdAt": "2023-11-07T05:31:56Z",
"initiatedBy": "pledgor",
"pledgorParticipantId": "<string>",
"requestId": "<string>",
"securedPartyParticipantId": "<string>",
"status": "proposed",
"type": "createOESAgreement",
"updatedAt": "2023-11-07T05:31:56Z",
"delegationChange": {
"delegationId": "<string>",
"items": [
{
"amount": {
"amount": "10.45234733",
"assetType": "ETH",
"tokenId": "123"
},
"currentAmount": {
"amount": "10.45234733",
"assetType": "ETH",
"tokenId": "123"
},
"resultingAmount": {
"amount": "10.45234733",
"assetType": "ETH",
"tokenId": "123"
},
"walletId": "<string>"
}
],
"vaultId": "<string>"
},
"expiresAt": "2023-11-07T05:31:56Z",
"oesAgreement": {
"exchangeAccountId": "<string>",
"exchangeProfileId": "<string>"
}
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Headers
Body
The terms you are approving the request on. Every field in approval must match the request; if one does not, nothing is recorded and the call fails with 409.
The kind of change a request represents. More types will be added; ignore requests of a type you do not recognize.
createOESAgreement- The creation of a new Off-Exchange Settlement control agreement between the pledgor (the trader) and the secured party (the exchange).increaseDelegation- A pledge: more collateral placed under the agreement's delegation.decreaseDelegation- An unpledge: collateral released from the agreement's delegation.
Either party may propose a pledge or unpledge, and the proposer's quorum endorses it first. When the pledgor proposes it, the secured party then approves it. When the secured party proposes it, the pledgor then chooses the wallets it applies to and approves it; until then its items carry no walletId.
createOESAgreement, increaseDelegation, decreaseDelegation Was this page helpful?