cURL
curl --request POST \
--url http://localhost:4100/v1/agents/{agentId}/mandates/{mandateId}/narrow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bounds": {
"budgets": [
{
"symbol": "<string>",
"amount": "<string>"
}
],
"perActionMax": {
"symbol": "<string>",
"amount": "<string>"
},
"recipients": [
"<string>"
],
"venues": [
"<string>"
],
"allowedContract": "<string>",
"maxActions": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"swapVenue": {
"router": "<string>",
"symbol": "<string>",
"maxAllowance": "<string>"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bounds: {
budgets: [{symbol: '<string>', amount: '<string>'}],
perActionMax: {symbol: '<string>', amount: '<string>'},
recipients: ['<string>'],
venues: ['<string>'],
allowedContract: '<string>',
maxActions: 123,
expiresAt: '2023-11-07T05:31:56Z',
swapVenue: {router: '<string>', symbol: '<string>', maxAllowance: '<string>'}
}
})
};
fetch('http://localhost:4100/v1/agents/{agentId}/mandates/{mandateId}/narrow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"version": 123,
"bounds": {
"budgets": [
{
"symbol": "<string>",
"amount": "<string>",
"period": "total"
}
],
"perActionMax": {
"symbol": "<string>",
"amount": "<string>"
},
"recipients": [
"<string>"
],
"venues": [
"<string>"
],
"allowedContract": "<string>",
"maxActions": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"swapVenue": {
"router": "<string>",
"symbol": "<string>",
"maxAllowance": "<string>"
}
},
"boundsHash": "<string>",
"frozenAt": "2023-11-07T05:31:56Z",
"status": "draft"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}Mandates
Post v1agents mandates narrow
cURL
curl --request POST \
--url http://localhost:4100/v1/agents/{agentId}/mandates/{mandateId}/narrow \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"bounds": {
"budgets": [
{
"symbol": "<string>",
"amount": "<string>"
}
],
"perActionMax": {
"symbol": "<string>",
"amount": "<string>"
},
"recipients": [
"<string>"
],
"venues": [
"<string>"
],
"allowedContract": "<string>",
"maxActions": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"swapVenue": {
"router": "<string>",
"symbol": "<string>",
"maxAllowance": "<string>"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
bounds: {
budgets: [{symbol: '<string>', amount: '<string>'}],
perActionMax: {symbol: '<string>', amount: '<string>'},
recipients: ['<string>'],
venues: ['<string>'],
allowedContract: '<string>',
maxActions: 123,
expiresAt: '2023-11-07T05:31:56Z',
swapVenue: {router: '<string>', symbol: '<string>', maxAllowance: '<string>'}
}
})
};
fetch('http://localhost:4100/v1/agents/{agentId}/mandates/{mandateId}/narrow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"version": 123,
"bounds": {
"budgets": [
{
"symbol": "<string>",
"amount": "<string>",
"period": "total"
}
],
"perActionMax": {
"symbol": "<string>",
"amount": "<string>"
},
"recipients": [
"<string>"
],
"venues": [
"<string>"
],
"allowedContract": "<string>",
"maxActions": 123,
"expiresAt": "2023-11-07T05:31:56Z",
"swapVenue": {
"router": "<string>",
"symbol": "<string>",
"maxAllowance": "<string>"
}
},
"boundsHash": "<string>",
"frozenAt": "2023-11-07T05:31:56Z",
"status": "draft"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"correlationId": "<string>"
}
}