Documentation Index
Fetch the complete documentation index at: https://docs.spark.money/llms.txt
Use this file to discover all available pages before exploring further.
Flashnet is the leading AMM (automated market maker) on Spark. It enables instant token swaps, liquidity pools, and market creation without custody risk. Built on Spark’s cryptographic messaging layer, Flashnet provides near-instant settlement and zero-fee transactions for Bitcoin and token trading in your applications.
Learn more ->
Use Cases
Quick Integration
npm install @flashnet/sdk @buildonspark/spark-sdk
Initialize Flashnet Client
import { FlashnetClient } from '@flashnet/sdk';
import { SparkWallet } from '@buildonspark/spark-sdk';
// Initialize your Spark wallet
const { wallet } = await SparkWallet.initialize({
mnemonicOrSeed: process.env.MNEMONIC,
options: {
network: "REGTEST", // or "MAINNET"
},
});
// Create the Flashnet client
const client = new FlashnetClient(wallet);
await client.initialize();
// The client will automatically:
// - Authenticate with the AMM service
// - Handle all signing and intent generation
Using the Spark Wallet
The Flashnet client can also be used as a regular Spark wallet:
// Create a Lightning invoice using the client wallet
const invoice = await client.wallet.createLightningInvoice({
amountSats: 1000000,
memo: "Test invoice",
});
console.log(invoice);
Documentation