Paying a HyperBEAM node should not require every application to rebuild the same funding flow.

A client has to find the node's deposit address, ask what the request will cost, check the user's local balance, transfer any missing AO, import that payment into the node's ledger and check the balance again. None of those steps are especially complicated, but getting one of them wrong can leave a request underfunded or send tokens to the wrong place.

We built Hyperbalance to handle that flow in one small TypeScript library.

Ask the node

Hyperbalance does not keep its own list of operators or payment settings. It reads the routes a HyperBEAM node already exposes for its address, AO deposit account, local ledger and pricing device.

That matters because the deposit address does not have to be the operator address, and the price of an upload should not be copied into client code. The node advertises the values; Hyperbalance discovers them and uses them for the request at hand.

For a paid upload, the flow looks like this:

discover node payment details
-> quote the request
-> read local balance
-> transfer the shortfall on AO
-> import the verified deposit
-> read the new balance

If the local balance is already high enough, no transfer is made. If it is short, Hyperbalance funds only the difference.

Wallets stay with the application

The library knows how to construct the AO transfer and deposit-import flow, but it does not take control of the user's wallet. The calling application supplies an adapter that signs and submits the token transfer using its own wallet setup.

Once the AO transfer has an assignment slot, Hyperbalance sends its message ID, sender, quantity and slot to the node's ao-payment@1.0 import route. The node verifies the payment before adding it to the local ledger.

No new paid-request protocol

Hyperbalance does not invent another wire format for paid services. The service call is a normal signed HyperBEAM request. P4 reads the signer, checks the local balance and charges the account according to the node's pricing rules.

The library composes the client side: make sure the signer has enough credit, send the signed request through AO Core or another compatible sender, then read the balance after the call when the application needs it.

We tested the complete path against a paid Whisper device: fund a signer with AO, import the credit, submit an audio transcription request and let P4 charge the local ledger.

The source, examples and client API are available at github.com/xylophonez/hyperbalance.