This walks you from a fresh install to a successful USDB swap. You need a Spark wallet mnemonic and the URL of a Flashnet Execution gateway.Documentation Index
Fetch the complete documentation index at: https://flashnet-build.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Install
The SDK is pre-release. Until the mainnet npm publish, install it from a git tag. Add this to yourpackage.json:
--ignore-scripts matters. @flashnet/sdk’s prepare hook runs rollup -c against its devDependencies before your installer has linked them, so a plain npm install may fail with Cannot find module 'rollup'. The --ignore-scripts flag avoids that ordering. npm still builds the package on its own pass, so you end up with a working dist/.
If you prefer bun and the dist isn’t there after install, build it manually:
Create the clients
authenticate() derives the Execution-side EVM address from the same identity key that controls the Spark wallet. There is no separate signup, faucet, or funding step.
Swap BTC for USDB
useAvailableBalance: true makes the SDK pull the input from your Spark wallet, run the swap, and dispatch the output back to Spark in one signed intent. Nothing needs to sit on the EVM side before or after.
What just happened
- The SDK pulled
100_000sats from your Spark wallet and sent them to the gateway’s deposit address. - It bundled that Spark transfer id, the Conductor swap call, and the USDB withdrawal into one canonical intent and signed it with your identity key.
- The gateway admitted the intent. The sequencer included it once the deposit oracle confirmed the Spark transfer. Validators finalized the block.
- SparkGateway emitted a
SparkWithdrawalevent for the USDB output. The settlement layer scanned the log and dispatched the matching Spark token transfer back to your Spark wallet.
finalized. If you need to follow status changes, see Intents.
Next steps
Deposits
Move sats and Spark tokens in without swapping.
Withdrawals
Sweep balances back to Spark on demand.
Deploy your own contract
Sign and submit arbitrary EVM transactions through
ExecutionClient.execute.Reading state
Token info, balances, allowances, fees.