Seven API endpoints that replace 50+ lines of polling, parsing, and retry logic per agent. Every tool expresses domain intent and lets Viaclave do the multi-step work behind it.
/v1/payments/:id/waitLong-polls a payment until it reaches a terminal state (confirmed, failed, or refunded). Removes the need for agents to implement their own polling loops with reorg handling.
timeout(number)Max seconds to wait (1-25, default 25){
"status": "confirmed",
"payment": { "id": "pay_...", "status": "confirmed", ... }
}/v1/payments/verify-receivedAnswers the question "did X pay me in the last hour?" without parsing signatures or scanning ledger events manually.
from(string)Sender handle or wallet IDamount(number)Minimum amount in micro unitssince(number)Unix timestamp to search fromexact_match(boolean)Require exact amount match{
"matched": { "id": "pay_...", "amount": 1000000, "status": "confirmed", ... }
}/v1/payments/simulateDry-run a payment with fee calculation, balance check, and limit verification. No funds move. Removes 'will my tx fail' anxiety.
from_wallet_id(string)Source walletto_wallet_id(string)Destination wallet (or to_handle/to_address)amount(number)Amount in micro unitstoken(string)Token symbol (default USDC){
"allow": true,
"fee_micro": 100,
"fee_bps": 10,
"total_debit_micro": 1000100,
"post_balance_micro": 4999900,
"blocking_reason": null
}/v1/payments/:id/retryIdempotently retry a failed or refunded payment. Generates a new idempotency key automatically, preserving the original payment parameters.
{
"payment": { "id": "pay_new_...", "status": "pending", ... }
}/v1/wallets/:id/wait-for-depositLong-polls for an incoming deposit on a wallet. Useful for onboarding flows where an agent needs to wait for the user to fund their wallet.
timeout(number)Max seconds to wait (1-25)min_amount(number)Minimum deposit amountsince(number)Only look for deposits after this timestamp{
"status": "deposit_found",
"event": { "type": "credit", "amount": 5000000, ... }
}/v1/wallets/:id/funding-statusSingle-call composite health check for a wallet. Replaces 3-4 separate API calls to check balance, limits, suspension, and pause status.
{
"status": "ready",
"details": {
"usdc_balance": 5000000,
"daily_spent": 100000,
"daily_limit": 10000000,
"is_suspended": false,
"is_paused": false
}
}/v1/lookup?q=...Fuzzy search across your wallets, agents, and address book. Resolves handles, addresses, and aliases with Levenshtein-based scoring.
q(string)Search query (min 2 characters){
"matches": [
{ "type": "agent", "id": "agt_...", "label": "payment-bot", "score": 0.9 },
{ "type": "address_book", "id": "ab_...", "label": "Alice Treasury", "score": 0.7 }
]
}Save frequently-used recipients for quick lookup via the fuzzy resolver.
POST /v1/address-bookGET /v1/address-bookPUT /v1/address-book/:idDELETE /v1/address-book/:idimport { Viaclave } from "@viaclave/sdk";
const vc = new Viaclave({ apiKey: "your-key" });
// Simulate before sending
const sim = await vc.payments.simulate({
from_wallet_id: "wal_...",
to_handle: "merchant-bot",
amount: 1_000_000,
});
if (!sim.allow) console.log(sim.blocking_reason);
// Send and wait
const { payment } = await vc.payments.send({ ... });
const result = await vc.payments.wait(payment.id);
// Check wallet readiness
const status = await vc.wallets.fundingStatus("wal_...");
// Fuzzy lookup
const { matches } = await vc.lookup.search("alice");