Quickstart
Connect a wallet, shield assets into a Ring, settle your first confidential swap, and verify the Transaction Viewing Key receipt.
This guide takes you from an unshielded Solana wallet to a settled confidential swap and a verified Transaction Viewing Key (TVK) receipt, both in the web terminal and with @mera/sdk.
Web terminal flow
- Open Vault and connect a Solana wallet.
- Confirm the active Ring in the selector (
Default Ringis open to any wallet without allowlisting). - Select
SOLorUSDC, enter an amount, and press Shield Assets. Approve the unsigned v0 transaction in your wallet. The transfer moves tokens into the Ring'sShieldedVaultPDA and creates an encryptedCommitmentNote. - Open Terminal, select the Swap tab, and choose a pair such as
SOL / USDC. - Enter an input amount from your shielded balance. Mera requests a sealed quote with a 25-second expiry countdown and displays the execution price,
0.10%execution fee, and minimum output. - Press Execute Swap and sign the transaction. The swap clears atomically in a single slot, updates your shielded balances, and adds the fill to the recent fills table with a Copy TVK action.
- Click Copy TVK, open Receipts, paste the key, and press Verify Receipt. The verifier recomputes the SHA-256 settlement commitment hash, checks the on-chain
RfqSettlementRecordPDA, and displays the exact pair, input amount, output amount, execution price, fee, slot, and transaction signature.
TypeScript SDK flow
Install @mera/sdk alongside @solana/web3.js in a Node.js or TypeScript project, then create a client with createMeraClient and a keypairSigner (or any Wallet Standard signer implementing MeraSigner).
ts
import { Keypair } from '@solana/web3.js'
import { createMeraClient, keypairSigner } from '@mera/sdk'
const signer = keypairSigner(Keypair.generate())
const mera = createMeraClient({
apiUrl: 'http://127.0.0.1:36102',
signer,
})
// 1. Inspect available rings, mints, and pairs
const { items: mints } = await mera.getMints()
const solMint = mints.find((m) => m.symbol === 'SOL')!
// 2. Shield 1 SOL (1_000_000_000 lamports) into the Default Ring
const deposit = await mera.shieldDeposit({
ringId: 'ring-default',
mint: solMint.mint,
amount: '1000000000',
})
console.log('Shielded tx:', deposit.signature, 'slot:', deposit.slot)
// 3. Quote and settle an Instant Confidential Swap (sell 0.5 SOL for USDC)
const { quote, submission } = await mera.executeSwap({
ringId: 'ring-default',
pairId: 'SOL-USDC',
side: 'sell',
inputAmount: '500000000',
slippageBps: 50,
})
console.log('Settled in:', submission.finalityMs, 'ms')
console.log('TVK receipt:', submission.tvk)
// 4. Verify the TVK receipt without wallet access
if (submission.tvk) {
const receipt = await mera.verifyTvk(submission.tvk)
console.log('Verified:', receipt.verified, 'On-chain match:', receipt.onchainMatched)
console.log('Execution price:', receipt.executionPrice, 'Fee:', receipt.feeAmount)
}What each call returns
| Call | Key returned fields |
|---|---|
shieldDeposit | id, status (confirmed), signature, slot, finalityMs |
executeSwap | quote (quoteId, outputAmount, minOutputAmount, feeAmount, expiresAt) and submission (signature, slot, finalityMs, settlementId, tvk) |
verifyTvk | verified, onchainMatched, pairId, inputAmount, outputAmount, executionPrice, feeAmount, feeRecipient, commitmentHash, nullifierHash, slot, signature |
Next steps
- Manage multiple notes, viewing keys, and unshielding in Shielding Assets.
- Place hidden-size orders in Hidden-Size Limit Orders or clear block trades in Sealed RFQ Block Trades.
- Deploy an institutional Ring with compliance controls in Deploying a Custom Ring.