payments.prepare
Build a gasless GBLIN payment. The vault's share token implements EIP-3009, so the holder signs an authorization and anybody can carry it on chain: the payer needs no ETH. Returns the EIP-712 message to sign (its domain is read from the token, not assumed), the calldata that carries the signed authorization, and the x402 'exact' payload for paying an HTTP endpoint in GBLIN. Use method 'receive' when paying a known recipient: only that recipient can submit it, so nobody can front-run the transfer. Use 'transfer' for an x402 facilitator, which submits on the seller's behalf. With relay: true it also prepares the fee authorization for relay_gblin_payment, for when nobody else will carry the payment. No private key is requested, held or transmitted: the signature is produced by the caller's own wallet.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | The recipient's address. | |
| from | Yes | The payer's address: the wallet that will sign. | |
| relay | No | true when nobody else will carry the payment on chain: also prepares the relay fee authorization, paid in GBLIN at the live NAV, for relay_gblin_payment. Forces method 'transfer'. | |
| method | No | 'receive' (default) can be submitted only by the recipient; 'transfer' by anyone. | |
| amount_usd | No | Amount in USD, converted at the live NAV. Give this or amount_gblin. | |
| amount_gblin | No | Amount in GBLIN shares, e.g. '0.25'. Give this or amount_usd. | |
| valid_for_seconds | No | How long the authorization stays valid. Default 600, maximum 86400. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relay | No | With relay: true, the fee authorization to sign and where to send both. | |
| amount | No | ||
| digest | Yes | The EIP-712 digest of typed_data. | |
| method | Yes | ||
| submit | No | ||
| warnings | No | ||
| next_steps | No | ||
| typed_data | Yes | The EIP-712 message to sign with eth_signTypedData_v4. | |
| x402_payload | Yes | The x402 exact-scheme payment payload, with the signature left to fill. | |
| authorization | Yes | from, to, value, validAfter, validBefore, nonce. | |
| payer_balance | No | ||
| x402_accepts_for_sellers | No |