Guide
Vanilla JS
No framework needed. Phantom direct, Reown modal, or pure REST API.
Phantom / Solflare Direct
$
npm install @buff/sdk @solana/web3.jsCopyapp.ts
typescript
1import { Buff } from '@buff/sdk'23const provider = (window as any).solana4await provider.connect()56const buff = await Buff.init({7 platformId: 'your-platform-id',8 signMessage: (msg) => provider.signMessage(msg, 'utf8'),9 plan: 'sprout',10})1112const { transaction, breakdown } = await buff.wrap(13 tx, provider.publicKey, { txValueUsd: 15.42 }14)1516const signed = await provider.signTransaction(transaction)17// send signed transaction...Note
All approaches produce identical results. Choose based on your environment.