Create a collect request
curl --request POST \
--url https://api.anchorage-staging.com/v2/transactions/collect \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"assetType": "ETH",
"source": {
"id": "1c920f4241b78a1d483a29f3c24b6c4c",
"type": "WALLET"
},
"stakingPositionId": "9bc4c2ccba8192b64d41b46d1770abe9ddbb430b85de3fe73e1b4f21336bc48a",
"amount": "32",
"description": "Internal ID: #12838927347",
"idempotentId": "12838927347",
"isFullAmount": false
}
'import requests
url = "https://api.anchorage-staging.com/v2/transactions/collect"
payload = {
"assetType": "ETH",
"source": {
"id": "1c920f4241b78a1d483a29f3c24b6c4c",
"type": "WALLET"
},
"stakingPositionId": "9bc4c2ccba8192b64d41b46d1770abe9ddbb430b85de3fe73e1b4f21336bc48a",
"amount": "32",
"description": "Internal ID: #12838927347",
"idempotentId": "12838927347",
"isFullAmount": False
}
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({
assetType: 'ETH',
source: {id: '1c920f4241b78a1d483a29f3c24b6c4c', type: 'WALLET'},
stakingPositionId: '9bc4c2ccba8192b64d41b46d1770abe9ddbb430b85de3fe73e1b4f21336bc48a',
amount: '32',
description: 'Internal ID: #12838927347',
idempotentId: '12838927347',
isFullAmount: false
})
};
fetch('https://api.anchorage-staging.com/v2/transactions/collect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"transactionId": "8696144cca28a634c05858d00e51191408498a7808a837fc4645b4b6997dde09"
}
}{
"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'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Create a collect request
Permissions required: Initiate Staking and Unstaking
In staking, the “collect” operation is the action of claiming inactive unstaked amount back to the available balance by moving them from the staking protocol or pool into a personal wallet. Once collected, these amounts are fully under wallet’s owner control.
NOTE: This endpoint is under development.
POST
/
transactions
/
collect
Create a collect request
curl --request POST \
--url https://api.anchorage-staging.com/v2/transactions/collect \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"assetType": "ETH",
"source": {
"id": "1c920f4241b78a1d483a29f3c24b6c4c",
"type": "WALLET"
},
"stakingPositionId": "9bc4c2ccba8192b64d41b46d1770abe9ddbb430b85de3fe73e1b4f21336bc48a",
"amount": "32",
"description": "Internal ID: #12838927347",
"idempotentId": "12838927347",
"isFullAmount": false
}
'import requests
url = "https://api.anchorage-staging.com/v2/transactions/collect"
payload = {
"assetType": "ETH",
"source": {
"id": "1c920f4241b78a1d483a29f3c24b6c4c",
"type": "WALLET"
},
"stakingPositionId": "9bc4c2ccba8192b64d41b46d1770abe9ddbb430b85de3fe73e1b4f21336bc48a",
"amount": "32",
"description": "Internal ID: #12838927347",
"idempotentId": "12838927347",
"isFullAmount": False
}
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({
assetType: 'ETH',
source: {id: '1c920f4241b78a1d483a29f3c24b6c4c', type: 'WALLET'},
stakingPositionId: '9bc4c2ccba8192b64d41b46d1770abe9ddbb430b85de3fe73e1b4f21336bc48a',
amount: '32',
description: 'Internal ID: #12838927347',
idempotentId: '12838927347',
isFullAmount: false
})
};
fetch('https://api.anchorage-staging.com/v2/transactions/collect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"transactionId": "8696144cca28a634c05858d00e51191408498a7808a837fc4645b4b6997dde09"
}
}{
"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'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Headers
A hex-encoded Ed25519 signature of timestamp_epoch_seconds + uppercase(http_method) + request_path + request_body.
Construction example:
toHex( ed25519Sign( signing_key, '{}{}{}{}'.format(timestamp_epoch_seconds, toUpper(httpMethod), httpRequestPath, httpBody) ) )
Pattern:
^[0-9A-Fa-f]{128,160}$Body
application/json
Was this page helpful?