Create a new collateral package
curl --request POST \
--url https://api.anchorage-staging.com/v2/collateral_management/packages \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"collateralAssetsConfig": [
{
"asset": {
"assetType": "<string>"
},
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
'import requests
url = "https://api.anchorage-staging.com/v2/collateral_management/packages"
payload = {
"collateralAssetsConfig": [
{
"asset": { "assetType": "<string>" },
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
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({
collateralAssetsConfig: [
{
asset: {assetType: '<string>'},
liquidationPriority: 123,
weight: '<string>',
maxStalenessMinutes: 123,
notes: '<string>'
}
],
pledgorId: '<string>',
securedPartyId: '<string>',
clientReferenceId: '<string>',
ltvRoundingPrecision: 123
})
};
fetch('https://api.anchorage-staging.com/v2/collateral_management/packages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"packageId": "<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'."
}Create a new collateral package
Permissions required: Manage Collateral Packages and Read vault activity
Creates a new collateral package in the Collateral Management service.
POST
/
collateral_management
/
packages
Create a new collateral package
curl --request POST \
--url https://api.anchorage-staging.com/v2/collateral_management/packages \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"collateralAssetsConfig": [
{
"asset": {
"assetType": "<string>"
},
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
'import requests
url = "https://api.anchorage-staging.com/v2/collateral_management/packages"
payload = {
"collateralAssetsConfig": [
{
"asset": { "assetType": "<string>" },
"liquidationPriority": 123,
"weight": "<string>",
"maxStalenessMinutes": 123,
"notes": "<string>"
}
],
"pledgorId": "<string>",
"securedPartyId": "<string>",
"clientReferenceId": "<string>",
"ltvRoundingPrecision": 123
}
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({
collateralAssetsConfig: [
{
asset: {assetType: '<string>'},
liquidationPriority: 123,
weight: '<string>',
maxStalenessMinutes: 123,
notes: '<string>'
}
],
pledgorId: '<string>',
securedPartyId: '<string>',
clientReferenceId: '<string>',
ltvRoundingPrecision: 123
})
};
fetch('https://api.anchorage-staging.com/v2/collateral_management/packages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"packageId": "<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'."
}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
The details for creating a new collateral package
The request payload for creating a new collateral package.
Was this page helpful?