Skip to main content
X0Client is the primary interface to the x0 protocol. It wraps all specialized managers and provides high-level convenience methods.

Construction

createX0Client(config)

createDevnetClient(wallet?)

Creates a client pre-configured for Solana devnet.

createMainnetClient(wallet?, rpcUrl?)

Creates a client pre-configured for Solana mainnet-beta.

Properties

Wallet Management

connectWallet(wallet)

Connect or switch the active wallet.

setSettlementMint(mint)

Set the Token-2022 mint used for transfers.

Transaction Execution

sendTransaction(instructions, signers?, options?)

Build, sign, and submit a transaction.
Returns: Transaction signature string.

simulateTransaction(instructions)

Simulate a transaction without submitting.

Policy Operations

initializePolicy(agentSigner, config)

Create a new agent policy.

getMyPolicy()

Fetch the connected wallet’s policy.
Returns: AgentPolicyAccount | null

updatePolicy(updates)

Update an existing policy.

rotateAgentSigner(newSigner)

Replace the agent’s signing key.

revokeAgentAuthority()

Kill switch — permanently disable the agent.

Escrow Operations

createEscrow(params)

releaseEscrow(escrowAddress)

Release funds to the seller (buyer only).

initiateDispute(escrowAddress, reason)

Open a dispute with evidence.

Registry Operations

registerAgent(params)

updateRegistry(updates)

findAgents(capType)

Returns: AgentRegistryEntry[]

Reputation Operations

getAgentReputation(agentPolicyId)

getTopAgents(limit?)

Transfer Operations

transfer(recipient, amount, agentSigner?)

Execute a token transfer through the x0-guard policy.

getBalance(owner)

getMyBalance()

getProtocolFee(amount)

Calculate the protocol fee for a given amount.

fetchWithPayment(url, options?)

Fetch a URL with automatic HTTP 402 payment handling.
Generate a Blink for human approval of a transfer.

PDA Derivation

derivePDAs(owner)

Derive all PDA addresses for a given owner.

getTokenAddress(owner)

Get the associated token address for the settlement mint.
Last modified on February 8, 2026