cURL
curl --request POST \
--url http://localhost:4100/v1/mandate-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schemaVersion": 1,
"kind": "mandate.gas-policy.approve",
"chainId": 84532,
"agentAddress": "<string>",
"recipients": [
"<string>"
],
"maxPerActionBaseUnits": "<string>",
"maxTotalBaseUnits": "<string>",
"maxGasPerActionWei": "<string>",
"maxGasTotalWei": "<string>",
"expiresAt": 2,
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schemaVersion: 1,
kind: 'mandate.gas-policy.approve',
chainId: 84532,
agentAddress: '<string>',
recipients: ['<string>'],
maxPerActionBaseUnits: '<string>',
maxTotalBaseUnits: '<string>',
maxGasPerActionWei: '<string>',
maxGasTotalWei: '<string>',
expiresAt: 2,
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('http://localhost:4100/v1/mandate-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"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>"
}
}Canonical mandate requests
Post v1mandate requests
Creator agent only; OAuth mandate:request. Same agent/account idempotency key and intent return the same request. Changed intent conflicts.
cURL
curl --request POST \
--url http://localhost:4100/v1/mandate-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"schemaVersion": 1,
"kind": "mandate.gas-policy.approve",
"chainId": 84532,
"agentAddress": "<string>",
"recipients": [
"<string>"
],
"maxPerActionBaseUnits": "<string>",
"maxTotalBaseUnits": "<string>",
"maxGasPerActionWei": "<string>",
"maxGasTotalWei": "<string>",
"expiresAt": 2,
"idempotencyKey": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schemaVersion: 1,
kind: 'mandate.gas-policy.approve',
chainId: 84532,
agentAddress: '<string>',
recipients: ['<string>'],
maxPerActionBaseUnits: '<string>',
maxTotalBaseUnits: '<string>',
maxGasPerActionWei: '<string>',
maxGasTotalWei: '<string>',
expiresAt: 2,
idempotencyKey: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('http://localhost:4100/v1/mandate-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"url": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"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>"
}
}Authorizations
Body
application/json