buyVolumeQuota
Buy volume quota with USDC. Submit a signed L2Transfer of quota × 500 USDC base units to the volume quota payment account; the server validates it, sends it and credits the quota to the payer's L1 address (or destination_l1_address) once the transfer executes. If execution takes longer than about 5 seconds the response is status=pending and the purchase is claimed by calling again with tx_hash. Exactly one of tx_info (new purchase) or tx_hash (claim) is sent per call. Each transfer is credited once. Only Plus and Premium/Advanced accounts can receive quota, and the balance after the purchase may not exceed 30,000,000. See Volume Quota.
Auth token in the Authorization header (or pass auth in the body).
Volume quota to buy, in transactions. Price is quota × 500 USDC base units (1,000,000 quota = 500 USDC); at most 15,000,000 per request.
Required for a new purchase (omit when claiming with tx_hash). Signed L2Transfer (tx type 12) of USDC (asset index 3), exactly quota × 500 USDC base units from the paying account to the volume quota payment account (index 765210 on Lighter, 51687 on Lighter on Robinhood Chain), as sent to sendTx. Omit when claiming a pending purchase with tx_hash.
Optional; claim only, not needed for a normal purchase. Pass instead of tx_info to finish a purchase whose earlier call answered status=pending: the tx_hash from that response. No new payment is made. Credits that purchase once its transfer has executed; the payer must authenticate.
Credit this L1 address instead of the payer's own. Must be a Plus or Premium/Advanced account's L1 address.
Auth token of the paying account (alternatively the Authorization header).
A successful response.
200Hash of the USDC payment transfer; use it with tx_hash to claim a pending purchase.
0x70997970C51812dc3A010C7d01b50e0d17dc79C8L1 address the quota is (or will be) credited to.
0x70997970C51812dc3A010C7d01b50e0d17dc79C8Quota credited (status=credited) or to be credited (status=pending).
1000000Balance of the credited L1 address after the purchase. Omitted while pending.
1010780credited: quota added. pending: the transfer has not executed within the wait; call again with tx_hash.
creditedPossible values: Bad request
POST /api/v1/buyVolumeQuota HTTP/1.1
Host: mainnet.zklighter.elliot.ai
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 91
"quota=1&tx_info='text'&tx_hash='text'&destination_l1_address='text'&auth='text'"{
"code": 200,
"message": "text",
"tx_hash": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"l1_address": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"quota": 1000000,
"volume_quota_remaining": 1010780,
"status": "credited"
}Last updated
Was this helpful?