Set Gas Sponsor Wallet
Nominates one of the platform node's wallets to pay users' gas on a network, or clears the nomination. The change applies at once (nothing goes on chain) and the response has no body.
- The wallet must belong to the platform node and sit on the network's chain. A wallet from another chain could never sign on this network, so it is refused up front rather than stored as a sponsor that can never pay.
- An empty
wallet_idclears the sponsor, which is why the field is not required. After clearing, gas cannot be sent on that network and transactions that need it fail. Clearing a network that has no sponsor succeeds. - A network has at most one sponsor: setting a new wallet replaces the previous one.
Only an API client of the platform node (the root of the node hierarchy) may call this. Any other client is refused with 10005. Read the current sponsors with List Gas Sponsor Wallets.
Required permission: node:create-root-wallet
Request
PUT /v2/gas-sponsor-wallets/networks/{network_id}
Parameters
| Name | Type | In | Description |
|---|---|---|---|
network_id | string | path | Required. Network id from Get Networks (24-character hex) |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Content-Type | Required. application/json |
Body
| Field | Type | Required | Description |
|---|---|---|---|
wallet_id | string | No | Id of the platform node's wallet that pays gas on this network (24-character hex). Send "" or omit it to clear the sponsor |
Example
curl --request PUT \
--url '{{baseUrl}}/v2/gas-sponsor-wallets/networks/6740e0a20000000000000102' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "6a89b68e0c46ca4c941271aa"
}'
Response
204 No Content, with an empty body.
Errors
| Status | Code | Description |
|---|---|---|
| 403 | 10005 | The caller is not a client of the platform node (domain 2) |
| 400 | 10016 | network_id or wallet_id is not a valid 24-character hex id |
| 400 | 10015 | The body is not valid JSON, or no network has this id (message network not found) |
| 400 | 10021 | The wallet does not exist, does not belong to the platform node, or is not on the network's chain (domain 2, message no wallet on the selected network's chain) |
| 400 | 10001 | The platform node was not found (domain 2) |
| 500 | 10000 | Unexpected server-side failure |
See Errors for the error format and common codes.