Skip to main content

createProvingConfig

Creates a ProvingConfig for createWalletClient({ proving }) — the adapter that lets a wallet client with a local account build, prove, and broadcast transactions using this handle's network binaries. 'local' mode builds proofs in-process from the WASM binaries; 'delegated' mode submits a proving request to a remote prover service instead.

Usage​

import { createWalletClient, http } from '@provablehq/veil-core'
import { loadNetwork } from '@provablehq/veil-aleo-sdk'

const aleo = await loadNetwork('testnet')
const account = aleo.privateKeyToAccount('APrivateKey1...')

const proving = aleo.createProvingConfig({
mode: 'delegated',
networkUrl: 'https://edge.provable.com/api/v2',
proverUrl: 'https://edge.provable.com/api/prove',
account,
})

const walletClient = createWalletClient({
account,
transport: http('https://edge.provable.com/api/v2', { network: 'testnet' }),
proving,
})

Returns​

ProvingConfig

An object carrying mode, buildTransaction, buildDeployment, simulate, execute, decrypt, and switchNetwork — the hooks createWalletClient uses to build, prove, and broadcast on behalf of a local account.

Parameters​

mode​

  • Type: 'delegated' | 'local'

Where proofs are produced. 'local' builds proofs in-process using the handle's WASM binaries; 'delegated' submits a proving request to the service at proverUrl.

networkUrl​

  • Type: string

Base URL of the Aleo node the built transaction is queried against and, in local mode, submitted to.

proverUrl​

  • Type: string
  • Optional

Base URL of the delegated proving service. Required when mode is 'delegated'; execute throws without it.

apiKey​

  • Type: string
  • Optional

API key for the legacy JWT model. With consumerId it forms the pair a session mints JWTs from when proverUrl names a legacy gateway such as https://api.provable.com/prove. On the default gateway the pair is carried and nothing mints. For a provisioned gateway key use auth.

consumerId​

  • Type: string
  • Optional

Consumer id for the legacy JWT model, paired with apiKey. Omit both for the default gateway, which needs no consumer.

account​

  • Type: LocalAccount<'privateKey'>
  • Optional

Account whose private key signs the built transaction and whose view key decrypts owned record outputs. Required to spend records or decrypt transaction outputs; omit for account-less reads.

confirmationTimeout​

  • Type: number
  • Optional
  • Default: 60_000 (1 minute)

Milliseconds execute waits for the submitted transaction to reach accepted before it throws a timeout error. A rejected confirmation throws immediately, without waiting out the timeout.

The default covers a healthy confirmation with room to spare; a transaction still absent after a minute is more often one the node never included than one about to land, and waiting longer only delays the report. Raise it for a path known to be slower — multi-hop swaps have been measured at 322 seconds, so a client submitting them should set around 400_000.