Skip to main content

@provablehq/veil-aleo-sdk

Wraps @provablehq/sdk (the Provable WASM SDK) and binds it to a named network. Applies when the code holds a private key directly and must sign and prove locally or via delegated proving — a bot, script, server, or CI job. It builds a fully-wired client from a private key, derives accounts from keys or BIP39 mnemonics, and configures record scanning. It is the headless, server-side counterpart to @provablehq/veil-aleo-wallet-adapter.

Installation​

npm install @provablehq/veil-core @provablehq/veil-aleo-sdk

Key exports​

  • loadNetwork(name) — the entry point; asynchronously loads the WASM binaries for 'mainnet' or 'testnet' and returns a network-bound AleoSdk handle.
  • AleoSdk methods — createAleoClient, privateKeyToAccount, mnemonicToAccount, generateMnemonicAccount, generateAccount, createProvingConfig, createNetworkClient, createRemoteScanner, createStandaloneScanner, decryptRecord, verifySignature.
  • Standalone — generateAccount (uses statically-loaded testnet binaries; no loadNetwork call needed), createDevnodeClient (zero-config client pointed at a local devnode).
  • Mnemonic / HD — generateMnemonic, validateMnemonic, mnemonicToHDKey, STANDARD_PATH, LEGACY_PATH.

Key and mnemonic operations are mathematically network-agnostic — the same private key or mnemonic derives the same address and view key regardless of which network's binary set is loaded. Proving and program operations (createProvingConfig, createAleoClient, the scanners) are network-bound to the handle that created them.

Example​

import { loadNetwork } from '@provablehq/veil-aleo-sdk'

const aleo = await loadNetwork('mainnet')

const { publicClient, walletClient, account } = aleo.createAleoClient({
privateKey: 'APrivateKey1...',
networkUrl: 'https://edge.provable.com/api/v2',
provingMode: 'delegated', // or 'local'
})

createAleoClient also accepts a records provider (aleo.createRemoteScanner(...)) for actions that spend private records — without one, requestRecords throws with a setup hint. Switching networks means loading a new handle; existing accounts remain valid since keys and addresses don't depend on which binary set produced them.

See the /api/provable-sdk pages for every method's parameters and defaults, and Executing transactions for the proving config in context.

Record management​

createAleoClient accepts recordManagement and returns a wallet client with inventory methods already attached. Configure its scanner and shared store when constructing the client:

import { loadNetwork } from '@provablehq/veil-aleo-sdk'
import type { RecordInventoryStore } from '@provablehq/veil-core'

async function createManagedClient(privateKey: string, store: RecordInventoryStore) {
const aleo = await loadNetwork('testnet')
return aleo.createAleoClient({
privateKey,
records: aleo.createRemoteScanner({ waitForSync: true }),
recordManagement: { enabled: true, store, chainId: 'aleo:testnet' },
}).walletClient
}
// Call client.getRecordInventory(), client.planRecordInventory(), and
// client.rebalanceRecordInventory() on the returned client.

Coordination defaults to disabled. Share the store across clients, and use durable storage when operations must survive a restart. Local and delegated proving both persist prepared transactions before managed submission. See record management for a complete setup and concurrent swaps for the trading flow.