billing.submit
Send a signed top-up and get the credits once it is final.
Details
- Endpoint
- POST /v1/billing/topup/submit
- Credits
- Free
- Rate class
- Light. Counts against your light requests per second.
Takes the transaction bytes from /v1/billing/topup (or any transaction that pays USDC to the treasury) with the sender's signature, submits it, waits for its checkpoint and credits the sender's account. Returns the digest, the credits added and the new prepaid balance. Sending it yourself works too: tide credits any USDC transfer to the treasury by sender within a few seconds.
Parameters
| Name | Type | Description |
|---|---|---|
| txBytesrequired | string | Base64 TransactionData. |
| signaturerequired | string | Base64 Sui signature of the sender. |
Request
Send your key in the x-api-key header, or leave it out to use the keyless tier.
curl
curl -X POST "https://api.tide.ad/v1/billing/topup/submit" \
-H "x-api-key: YOUR_API_KEY" \
-H "content-type: application/json" \
-d '{
"txBytes": "AAAC...",
"signature": "AF2..."
}'TypeScript
const res = await fetch("https://api.tide.ad/v1/billing/topup/submit", {
method: "POST",
headers: {
"x-api-key": process.env.TIDE_API_KEY!,
"content-type": "application/json",
},
body: JSON.stringify({
"txBytes": "AAAC...",
"signature": "AF2..."
}),
});
const data = await res.json();Response
JSON
{
"digest": "5ajkuHAnivMiKRne6EYS2bzvHpCHWYx849cmoSHN89Vm",
"checkpoint": 341700000,
"credits": 3333333,
"prepaid": 3333333
}