curl --request GET \
--url https://api.floprouter.com/v1/grants/params \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.floprouter.com/v1/grants/params', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.floprouter.com/v1/grants/params"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"object": "grant_params",
"owner": "5F29vNoqgKpXxgUyz4DXifLnfAPQUQCq3ZQXGVjVbxp7sWBS",
"delegate": "5EfBc9f69NuPUV9zue18zeURWriF64Q9d7MN7h626D3pm2r7",
"network": "devnet",
"genesis_hash": "0x99c172c095340ace980631f9123544c6bebd4839f3437e463533422d8be2d631",
"limits": {
"max_session_duration_blocks": 864000,
"max_sessions_per_delegate": 10,
"max_sessions_per_owner": 10,
"max_rotations_per_hour": 3,
"epoch_blocks": 86400,
"circuit_breaker": {
"period_blocks": 60,
"max_txs": 100,
"max_spend": "250"
},
"block_time_ms": 1000,
"allowed_pallets": [
"ComputeChannel"
]
},
"amounts": {
"spending_cap": "5",
"per_tx_limit": "0.5",
"daily_cap": "2",
"duration_blocks": 864000,
"duration_hours": 240,
"max_escrow_per_session": "0.5"
},
"call": {
"pallet": "flopSessionKeys",
"method": "createSession",
"args": [
"5EfBc9f69NuPUV9zue18zeURWriF64Q9d7MN7h626D3pm2r7",
"5000000000000000000",
"500000000000000000",
"2000000000000000000",
864000,
[
"ComputeChannel"
]
],
"args_names": [
"delegate",
"spending_cap",
"per_tx_limit",
"daily_cap",
"duration_blocks",
"allowed_pallets"
]
},
"call_data": "0x5e0072c4397216285801092592606cb1e02ed8f54f45c7a3508e565e13ed6bdee57a0000f4448291634500000000000000000000b2d3595bf00600000000000000000000c84e676dc11b0000000000000000002f0d000438436f6d707574654368616e6e656c",
"notes": [
"Sign and submit this one extrinsic with the wallet that should pay for its sessions, then call POST /v1/grants/sync.",
"The grant lets the delegate open ComputeChannel channels for you, within the caps. It cannot transfer funds. Revoke it at any time with flopSessionKeys.revokeSession(delegate).",
"Every grant expires after at most 864000 blocks; sign a new one before then (GET /v1/grants shows the expiry). Granting the same delegate again replaces the old record.",
"Escrow is paid from your wallet on chain. The router fee is taken from your prepaid balance (GET /v1/balance), and only for sessions that settle paid. The delegate's transaction fees are paid by the router."
]
}{
"error": {
"code": 400,
"message": "each message needs a role of system, developer, user or assistant (tool messages are not supported)",
"metadata": {
"reason": "invalid_message"
}
}
}{
"error": {
"code": 401,
"message": "a wallet API key is required (Authorization: Bearer fr_...); see POST /v1/auth/challenge",
"metadata": {
"reason": "unauthorized"
}
}
}{
"error": {
"code": 429,
"message": "chat requests for this key: limit 20 per minute; retry in 41 s",
"metadata": {
"reason": "rate_limited"
}
}
}The grant to sign for grant mode
Delegate address, chain limits, suggested caps, and the exact createSession call (arguments and SCALE call data) for the wallet to sign. With a key, for the key’s wallet; without one, pass address. Read-only: nothing is reserved. The delegate shown is the one this wallet already granted, else the lowest router delegate with a free slot on chain; if two wallets grant its last slot at once, the chain refuses the second grant (TooManySessions) and asking again shows the next delegate. The router records a grant when POST /v1/grants/sync (or a chat request) finds it on chain. While a grant to the delegate is active the chain refuses a second one: then renewal is true and call_data is utility.batchAll[revokeSession(delegate), createSession(...)], one signature that replaces the grant.
curl --request GET \
--url https://api.floprouter.com/v1/grants/params \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.floprouter.com/v1/grants/params', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.floprouter.com/v1/grants/params"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"object": "grant_params",
"owner": "5F29vNoqgKpXxgUyz4DXifLnfAPQUQCq3ZQXGVjVbxp7sWBS",
"delegate": "5EfBc9f69NuPUV9zue18zeURWriF64Q9d7MN7h626D3pm2r7",
"network": "devnet",
"genesis_hash": "0x99c172c095340ace980631f9123544c6bebd4839f3437e463533422d8be2d631",
"limits": {
"max_session_duration_blocks": 864000,
"max_sessions_per_delegate": 10,
"max_sessions_per_owner": 10,
"max_rotations_per_hour": 3,
"epoch_blocks": 86400,
"circuit_breaker": {
"period_blocks": 60,
"max_txs": 100,
"max_spend": "250"
},
"block_time_ms": 1000,
"allowed_pallets": [
"ComputeChannel"
]
},
"amounts": {
"spending_cap": "5",
"per_tx_limit": "0.5",
"daily_cap": "2",
"duration_blocks": 864000,
"duration_hours": 240,
"max_escrow_per_session": "0.5"
},
"call": {
"pallet": "flopSessionKeys",
"method": "createSession",
"args": [
"5EfBc9f69NuPUV9zue18zeURWriF64Q9d7MN7h626D3pm2r7",
"5000000000000000000",
"500000000000000000",
"2000000000000000000",
864000,
[
"ComputeChannel"
]
],
"args_names": [
"delegate",
"spending_cap",
"per_tx_limit",
"daily_cap",
"duration_blocks",
"allowed_pallets"
]
},
"call_data": "0x5e0072c4397216285801092592606cb1e02ed8f54f45c7a3508e565e13ed6bdee57a0000f4448291634500000000000000000000b2d3595bf00600000000000000000000c84e676dc11b0000000000000000002f0d000438436f6d707574654368616e6e656c",
"notes": [
"Sign and submit this one extrinsic with the wallet that should pay for its sessions, then call POST /v1/grants/sync.",
"The grant lets the delegate open ComputeChannel channels for you, within the caps. It cannot transfer funds. Revoke it at any time with flopSessionKeys.revokeSession(delegate).",
"Every grant expires after at most 864000 blocks; sign a new one before then (GET /v1/grants shows the expiry). Granting the same delegate again replaces the old record.",
"Escrow is paid from your wallet on chain. The router fee is taken from your prepaid balance (GET /v1/balance), and only for sessions that settle paid. The delegate's transaction fees are paid by the router."
]
}{
"error": {
"code": 400,
"message": "each message needs a role of system, developer, user or assistant (tool messages are not supported)",
"metadata": {
"reason": "invalid_message"
}
}
}{
"error": {
"code": 401,
"message": "a wallet API key is required (Authorization: Bearer fr_...); see POST /v1/auth/challenge",
"metadata": {
"reason": "unauthorized"
}
}
}{
"error": {
"code": 429,
"message": "chat requests for this key: limit 20 per minute; retry in 41 s",
"metadata": {
"reason": "rate_limited"
}
}
}Response
OK
Chain constants of the flopSessionKeys pallet.