HOW-TO

How to cook something up with your hot wallet

A short, opinionated tour of building on a Guveno hot wallet: from your first deposit webhook to a working refund flow, with the calls you can paste into a terminal.

May 18, 2026·5 min read
How to cook something up with your hot wallet

What the hot wallet is for

The hot wallet is a Guveno wallet whose withdrawals your own code signs and sends, with no person in the loop. It is for the sends your backend makes on its own: refunds, payouts, gas top-ups, sweeps. It is intentionally not where you keep your treasury.

If money has to move without a person signing, it belongs in the hot wallet. If it can wait for someone to sign it offline, keep it in cold storage. A common split is a small hot wallet for day-to-day flow and cold storage for the rest.

The smallest useful thing: a deposit webhook

Create a wallet, turn on server-side address derivation, give each customer a deposit address with POST /wallets/:id/addresses (your user id can go in the label), and register one webhook for deposit.confirmed, withdrawal.confirmed and withdrawal.rejected. A webhook's events are set when you create it, so ask for the refund events now too. The deposit payload includes the address id, the asset, the amount and the on-chain tx hash. That is enough to credit a balance in your app. Polkadot, Solana and TON wallets can't derive addresses server-side; register client-derived addresses with PATCH /wallets/:id instead.

curl -X POST https://api.guveno.com/v1/wallets/42/addresses \
  -H "Authorization: Bearer $GUVENO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"label": "customer-4471"}'

curl https://api.guveno.com/v1/webhooks \
  -H "Authorization: Bearer $GUVENO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "api", "config": {"url": "https://example.com/guveno"}, "events": ["deposit.confirmed", "withdrawal.confirmed", "withdrawal.rejected"], "walletIds": [42]}'

Credit only on deposit.confirmed, never on deposit.detected, and check the x-guveno-signature header before you trust a payload. Guveno sends one deposit.confirmed per transfer, and its event id stays the same across delivery retries, so the same id can arrive more than once: store the event id (the envelope id) before you credit anything, and skip one you have already seen. If your endpoint times out, we retry with exponential backoff (about 5s, doubling, capped at 60s) for up to 5 attempts, then mark the delivery failed. If a deposit fails or is reorged away you get deposit.rejected; reverse anything you provisionally credited, and wait for a fresh deposit.confirmed before treating funds as final.

A wallet transaction detail view with hash, status, value and fee
Every webhook maps to a transaction or withdrawal you can open and inspect, and every delivery is logged with its payload and response.

A worked refund flow

Imagine a customer is owed a 20 USDT refund. From your backend, call the SDK hot wallet's withdraw() with the wallet, the USDT asset id, the customer's address, the amount and an idempotency key. It prepares the withdrawal, signs it in your process with your key provider, and broadcasts it; confirmation follows on-chain. The API key alone can't move the money: signing needs the key material your provider holds, and Guveno never has it.

import { Guveno, FileKeyProvider, SendOutcomeUnknownError } from "@guveno/wallet-sdk";

const guveno = new Guveno({ apiKey: process.env.GUVENO_API_KEY });
const keys = new FileKeyProvider("/run/secrets/guveno-keys.json");
const wallet = await guveno.loadWallet(42, { keys });

try {
  await wallet.withdraw({
    assetId: 3, // the wallet's USDT asset id
    toAddress: "0xCustomer...",
    amount: "20",
    idempotencyKey: "refund-8812",
  });
} catch (err) {
  if (err instanceof SendOutcomeUnknownError) {
    // It may already have gone out. Don't retry: reconcile against the chain.
  }
  throw err;
}

The webhook you registered above also receives withdrawal.confirmed and withdrawal.rejected. On confirmed, mark the refund as settled. On rejected, the event's reason says whether the send was dropped from the mempool or failed on chain; surface it to the operator queue. Handle errors from withdraw() too: a refusal means nothing was sent, but a SendOutcomeUnknownError means the refund may already have gone out, so never retry it. Send it to the operator queue to reconcile against the chain.

Gas, the silent killer

A common reason hot-wallet automations stall is a gas balance you forgot to refill. Guveno does not top gas up for you. If the source address cannot fund gas, the node refuses the broadcast and the error says nothing was sent, so the withdrawal stays prepared and you can fix the balance and try again. Keep native coin (ETH, BNB, TRX) on every address that pays out tokens.

When your code shouldn’t sign

Not every automation should hold a signing key. On Pro and Enterprise, if a script or an AI agent raises refunds, give its API key withdrawals:request instead of withdrawals:create. It proposes a withdrawal request through the API, a person approves it, and what they approve is exactly what gets signed. The key can propose payouts and never send one.

Everything here is in the reference: wallets and addresses, webhooks, withdrawals and withdrawal requests, and the hot-wallet SDK.

Try this in Guveno
Start free on the Developer tier, or talk to us about a team setup. Sign-ups use referral codes right now, so just ask us for one. It's quick.
See the hot wallet →