Skip to main content
The Intents builder composes NEAR Intents, has a wallet sign them and publishes them to the solver relay. Amounts can be numbers (converted with the token’s decimals) or bigint base units.
On the server, or with an explicit signer:

Building

Options for the signed commitment: attachDeadline(date), attachTimeout(seconds), attachNonce(bytes), attachWallet(wallet), attachSeed(seed).

Signing and publishing

depositAndExecute takes title, message, allowedTokens, excludedTokens, silent and onStep. Steps are "payment" | "funds" | "signing" | "publishing" | "confirming".

Retries

When the publish times out after the intents were sent, execute() throws SubmittedStatusUnknownError and keeps the signed commitments. Calling execute() again on the same builder checks the status first and republishes the same commitments (same nonce, so they cannot settle twice). discardUnknownOutcome() drops them to start over. See Errors and waits.