Skip to main content

Smart Contracts

Using a CUSTOM voucher to interact with smart contracts — for staking, DeFi, and complex on-chain actions.
CUSTOM vouchers give you full control over transaction details. Instead of a simple “send me X of token Y,” you specify explicit transaction instructions — networks, payments, and extras. This enables smart contract interactions like staking, swapping through a specific DEX, NFT minting, and multi-step DeFi operations. CUSTOM vouchers do not support FX. They are for scenarios where you define exactly what on-chain actions must occur.

Flow

  1. Payer opens their wallet, authenticates, and opens a context — shares the context code with you.
  2. You authenticate using your API key (x-api-key header).
  3. You reserve a voucher using the context code.
  4. You redeem with explicit networks, payments, and extras — the system detects these and creates a CUSTOM voucher.
  5. Payer reviews the transaction in their wallet, signs, and submits the receipt.

Example: Staking contract call

A dApp wants the payer to stake tokens into a staking contract. The payer has already opened their wallet and shared a context code with you.

1. Authenticate and reserve

Pass your API key in the x-api-key header. No separate sign-in step is needed.
Response: { "id": "vch_591234", "code": "591234", "status": "RESERVED" }

2. Encode the contract call

Given a staking contract with this interface:
Use the ABI to encode the function calldata:

3. Redeem with CUSTOM configuration

The system detects networks, payments, and extras were provided (and no expectedPayment), so it automatically creates a CUSTOM voucher. The {payer} placeholder is substituted by the payer’s wallet at resolution time.

4. Payer resolves

The payer reviews the staking transaction in their wallet, signs it, and the wallet submits the receipt. Poll until RESOLVED:

Diagram

When to use CUSTOM

  • Smart contract interactions (staking, lending, governance)
  • Multi-step transactions (approve + transfer, batch calls)
  • Custom on-chain logic that can’t be expressed as a simple transfer
  • dApp flows requiring explicit network and calldata control

Limitations

  • No FX: CUSTOM vouchers do not support automatic currency conversion.
  • No automatic network selection: You must specify the blockchain network explicitly.
  • No expectedPayment: CUSTOM vouchers use payments and extras instead of expectedPayment.

Next steps