### Install and Run Development Server Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/README.md Install dependencies and start the development server. ```bash npm install --legacy-peer-deps npm run dev ``` -------------------------------- ### Start Specific Workspace Source: https://github.com/lightsparkdev/js-sdk/blob/main/CLAUDE.md Example of starting a specific workspace, 'uma-bridge'. ```bash yarn workspace @lightsparkdev/uma-bridge start ``` -------------------------------- ### Run a Specific Lightspark SDK Example Source: https://github.com/lightsparkdev/js-sdk/blob/main/README.md Build dependencies and run a specific example application by passing its package name (without the @lightsparkdev/ prefix) to the 'yarn start' command from the repository root. ```bash yarn start remote-signing-server ``` -------------------------------- ### Run Node Script Example Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/lightspark-sdk/README.md Execute a node script example using ts-node after installing dependencies. This example demonstrates creating an invoice with specified amount and memo. ```bash cd examples/node-scripts npm install npx ts-node createInvoice.ts -a "100" -m "Whasssupppp" ``` -------------------------------- ### Clone and Setup Lightspark JS/TS SDKs Source: https://github.com/lightsparkdev/js-sdk/blob/main/README.md Clone the repository, navigate to the directory, enable corepack, and install all project dependencies using Yarn. ```bash git clone git@github.com:lightsparkdev/js-sdk.git cd js-sdk corepack enable corepack prepare --activate yarn ``` -------------------------------- ### Install and Run Commands Source: https://github.com/lightsparkdev/js-sdk/blob/main/AGENTS.md Common commands for managing the monorepo, including installation, starting applications, building, testing, linting, formatting, and cleaning. ```bash yarn install ``` ```bash yarn start site uma-bridge ops ``` ```bash yarn build ``` ```bash yarn test ``` ```bash yarn lint && yarn format ``` ```bash yarn checks ``` ```bash yarn gql-codegen ``` ```bash yarn clean-all ``` -------------------------------- ### Start Applications Source: https://github.com/lightsparkdev/js-sdk/blob/main/CLAUDE.md Command to start specific applications within the monorepo. ```bash yarn start site uma-bridge ops ``` -------------------------------- ### Install and Build Plugin Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/tools/base-ui-lint/README.md Commands to install dependencies and build the plugin from the tools/base-ui-lint directory. ```bash cd tools/base-ui-lint npm install npm run build ``` -------------------------------- ### Install Origin Package Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/README.md Install the Origin package and Sass as dependencies. ```bash npm install @lightsparkdev/origin sass ``` -------------------------------- ### Run Example Node.js Script with ts-node Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/nodejs-scripts/README.md Execute the full example Node.js script using `ts-node`. This requires prior environment configuration. ```bash yarn ts-node example.ts ``` -------------------------------- ### Install Dependencies Source: https://github.com/lightsparkdev/js-sdk/blob/main/CLAUDE.md Run this command to install all project dependencies using Yarn. ```bash yarn ``` -------------------------------- ### Install Lightspark UI Package Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/ui/README.md Install the @lightsparkdev/ui package using npm. ```bash npm install @lightsparkdev/ui ``` -------------------------------- ### Start UMA VASP Server Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/uma-vasp/README.md Starts the UMA VASP server on port 8081. This is a prerequisite for running the subsequent examples. ```bash $ PORT=8081 yarn start ``` -------------------------------- ### Install Lightspark JS+TS SDK Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/lightspark-sdk/README.md Install the Lightspark SDK using npm. This is the first step to using the SDK in your project. ```bash npm install @lightsparkdev/lightspark-sdk ``` -------------------------------- ### Install Lightspark OAuth Package Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/oauth/README.md Install the package using npm. This command is required before using the OAuth functionality. ```bash npm install @lightsparkdev/oauth ``` -------------------------------- ### Install Lightspark JS/TS SDK Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Install the Lightspark JS/TS SDK using npm or yarn. ```bash npm install @lightsparkdev/lightspark-sdk # or yarn add @lightsparkdev/lightspark-sdk ``` -------------------------------- ### Start UMA VASP Server Instance for Testing Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/uma-vasp/README.md Start a UMA VASP server instance on a specific port (e.g., 8080) after exporting necessary configuration variables. This is the first step in running test queries with multiple server instances. ```bash # First set up config variables. You can also save these in a file or export them to your environment. $ export LIGHTSPARK_API_TOKEN_CLIENT_ID= $ export LIGHTSPARK_API_TOKEN_CLIENT_SECRET= # etc... See UmaConfig.ts for the full list of config variables. # Now start the server on port 8080 $ PORT=8080 yarn start ``` -------------------------------- ### Install Lightspark Core Package Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/core/README.md Install the package using npm. This is the first step to using the Lightspark Typescript Core package. ```bash npm install @lightsparkdev/core ``` -------------------------------- ### Run Development Server Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/oauth-app/README.md Starts the React app in development mode. Access the app at http://localhost:3102. ```bash npm start ``` -------------------------------- ### Install x86_64 toolchain for M1 Macs Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/crypto-wasm/README.md If you are using an M1 chip MacBook, you need to install and use the x86_64 toolchain for building. This involves installing a separate instance of Homebrew and LLVM. ```shell # Note - this is going to install and use a separate instance of homebrew than you probably already have installed that installs into /usr/local/bin instead of /opt/homebrew/bin. For M1 macs the default is /opt/homebrew/bin - read more about why this is necessary [here](https://earthly.dev/blog/homebrew-on-m1/). arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" arch -x86_64 /usr/local/bin/brew install llvm export PATH="/usr/local/opt/llvm/bin:$PATH" # add this to your shell profile too so it's sourced automatically ``` -------------------------------- ### Test Specific Workspace Source: https://github.com/lightsparkdev/js-sdk/blob/main/CLAUDE.md Example of running tests within a specific workspace, 'ui'. ```bash yarn workspace @lightsparkdev/ui test ``` -------------------------------- ### Importing Components Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/skills/origin/SKILL.md Import components from the Origin package root. This example shows importing several common components. ```tsx import { Button, Dialog, CentralIcon, Tabs } from '@lightsparkdev/origin'; ``` -------------------------------- ### Run UMA VASP Server Locally Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/uma-vasp/README.md Execute this command in the `uma-vasp` directory to start the server. The default port is 3104, but it can be changed using the `PORT` environment variable. ```bash yarn start ``` ```bash PORT=8080 yarn start ``` -------------------------------- ### Use CentralIcon Component Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/CONTEXT.md Example of how to import and use the CentralIcon component with different names, sizes, and colors. ```tsx import { CentralIcon } from '@/components/Icon'; ``` -------------------------------- ### Get Account Balances Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/lightspark-cli/README.md Query the current balances for your Lightspark account. ```bash lightspark balances ``` -------------------------------- ### Chart Component Examples Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/skills/origin/SKILL.md Shows various chart types available through the Chart namespace export. Each example demonstrates a different chart visualization with its respective data and series props. ```tsx import { Chart } from '@lightsparkdev/origin'; ``` -------------------------------- ### Example Accordion React Component Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/CONTEXT.md Demonstrates the implementation of an Accordion component using Base UI, SCSS modules for styling, and Central Icons. ```tsx import { Accordion } from '@base-ui-components/react/accordion'; import styles from './Accordion.module.scss'; {title} {content} ``` -------------------------------- ### Set Environment Variables for Node Scripts Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/lightspark-sdk/README.md Configure necessary environment variables for running node script examples, including API credentials and test node passwords. ```bash export LIGHTSPARK_API_TOKEN_CLIENT_ID= $ export LIGHTSPARK_API_TOKEN_CLIENT_SECRET= $ export LIGHTSPARK_TEST_NODE_PASSWORD= ``` ```bash # If you want to run internal_example.ts, you'll also need to set these: $ export LIGHTSPARK_EXAMPLE_NODE_1_NAME= $ export LIGHTSPARK_EXAMPLE_NODE_2_NAME= $ export LIGHTSPARK_EXAMPLE_NODE_2_PASSWORD= ``` -------------------------------- ### Simple Component Usage (Button) Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/skills/origin/SKILL.md Illustrates the usage of simple components, like the Button, which accept direct props for customization. This example shows a filled button with a leading icon. ```tsx ``` -------------------------------- ### Update Local JS SDK Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/oauth-app/README.md Updates the Lightspark JS SDK used in the example to the latest version built locally from your current repository. ```bash npm run pull-sdk ``` -------------------------------- ### Fetch Account Info and Node Details Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Retrieves the current account details and lists REGTEST nodes. It also shows how to get local/remote balances and check node conductivity. ```typescript import { AccountTokenAuthProvider, BitcoinNetwork, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( process.env.LIGHTSPARK_API_TOKEN_CLIENT_ID!, process.env.LIGHTSPARK_API_TOKEN_CLIENT_SECRET!, ), ); const account = await client.getCurrentAccount(); if (!account) throw new Error("No account found"); console.log("Account name:", account.name); // List all REGTEST nodes const nodesConnection = await account.getNodes(client, 50, [ BitcoinNetwork.REGTEST, ]); console.log(`You have ${nodesConnection.count} REGTEST nodes.`); for (const node of nodesConnection.entities) { console.log(` - ${node.displayName} (${node.id})`); } // Get local/remote balances for REGTEST const localBalance = await account.getLocalBalance(client, [ BitcoinNetwork.REGTEST, ]); const remoteBalance = await account.getRemoteBalance(client, [ BitcoinNetwork.REGTEST, ]); console.log( `Local balance: ${localBalance?.preferredCurrencyValueApprox} ${localBalance?.preferredCurrencyUnit}`, ); console.log( `Remote balance: ${remoteBalance?.preferredCurrencyValueApprox} ${remoteBalance?.preferredCurrencyUnit}`, ); // Check node conductivity (0-10 score for routing efficiency) const conductivity = await account.getConductivity(client, [ BitcoinNetwork.REGTEST, ]); console.log(`Conductivity: ${conductivity}/10`); ``` -------------------------------- ### Initialize Lightspark Environment Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/lightspark-cli/README.md Run this command to set up your API token's client ID and client secret. It will create a `.lightsparkapienv` file in your home directory. If arguments are omitted, you will be prompted to enter them. ```bash lightspark init-env ``` ```bash lightspark init-env -c -s ``` -------------------------------- ### LightsparkClient Initialization and Current Account Fetch Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Shows how to initialize `LightsparkClient` with `AccountTokenAuthProvider` and fetch the current account details. ```APIDOC ## LightsparkClient Initialization and Account Fetch (Server-Side) ### Description Initializes the `LightsparkClient` using server-side authentication and retrieves the current account information. ### Method `LightsparkClient` constructor with `AccountTokenAuthProvider`, `client.isAuthorized()`, `client.getCurrentAccount()` ### Endpoint N/A (SDK methods) ### Parameters #### Constructor Parameters - **authProvider** (`AccountTokenAuthProvider`): An instance of `AccountTokenAuthProvider` configured with client ID and secret. #### `AccountTokenAuthProvider` Constructor Parameters - **clientId** (`string`): Your Lightspark API token client ID. - **clientSecret** (`string`): Your Lightspark API token client secret. ### Method Calls `client.isAuthorized()` `client.getCurrentAccount()` ### Returns - `client.isAuthorized()`: `Promise` - `client.getCurrentAccount()`: `Promise` ### Request Example ```typescript import { AccountTokenAuthProvider, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( "your-api-token-client-id", "your-api-token-client-secret", ), ); // Verify the client is authorized before making calls if (await client.isAuthorized()) { const account = await client.getCurrentAccount(); console.log("Account name:", account?.name); } ``` ### Response Example ```json { "example": "Account name: Your Account Name" } ``` ``` -------------------------------- ### Run Tests Source: https://github.com/lightsparkdev/js-sdk/blob/main/CLAUDE.md Initiates the test suite for the entire project. ```bash yarn test ``` -------------------------------- ### LightsparkClient Initialization for Browser with OAuth Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Demonstrates initializing `LightsparkClient` for browser environments using OAuth and managing authentication flow. ```APIDOC ## LightsparkClient Initialization (Browser with OAuth) ### Description Initializes the `LightsparkClient` for browser or React Native applications using OAuth for authentication. It includes steps for initiating the login flow. ### Method `LightsparkClient` constructor with `OAuthProvider`, `OAuthStateHelper` ### Endpoint N/A (SDK methods) ### Parameters #### `OAuthStateHelper` Constructor Parameters - **clientId** (`string`): Your OAuth client ID for the application. - **redirectUri** (`string`): The URI where the user is redirected after authentication. - **domain** (`string`): The Lightspark API domain (e.g., "api.lightspark.com"). #### `LightsparkClient` Constructor Parameters - **authProvider** (`OAuthProvider`): An instance of `OAuthProvider` wrapping an `OAuthStateHelper`. ### Method Calls `oauthHelper.loginWithRedirect()` `client.isAuthorized()` ### Returns - `oauthHelper.loginWithRedirect()`: `Promise` - `client.isAuthorized()`: `Promise` ### Request Example ```typescript import { LightsparkClient } from "@lightsparkdev/lightspark-sdk"; import { OAuthProvider, OAuthStateHelper } from "@lightsparkdev/oauth"; // Initialize the OAuth helper with your app's client ID and redirect URI const oauthHelper = new OAuthStateHelper( "your-oauth-client-id", "https://yourapp.example.com/callback", "api.lightspark.com", ); const client = new LightsparkClient(new OAuthProvider(oauthHelper)); // Redirect user to login; after callback, the helper stores the token await oauthHelper.loginWithRedirect(); // Later, after the redirect callback: const isAuthorized = await client.isAuthorized(); console.log("User is authorized:", isAuthorized); ``` ### Response Example ```json { "example": "User is authorized: true" } ``` ``` -------------------------------- ### LightsparkClient Initialization and Authorization Check Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Demonstrates how to initialize the `LightsparkClient` using `AccountTokenAuthProvider` for server-side authentication and checks if the client is authorized. ```APIDOC ## LightsparkClient Initialization (Server-Side) ### Description Initializes the `LightsparkClient` for server-side applications using an API token. It then checks the authorization status. ### Method `LightsparkClient` constructor with `AccountTokenAuthProvider` ### Endpoint N/A (SDK method) ### Parameters #### Constructor Parameters - **authProvider** (`AccountTokenAuthProvider`): An instance of `AccountTokenAuthProvider` configured with client ID and secret. #### `AccountTokenAuthProvider` Constructor Parameters - **clientId** (`string`): Your Lightspark API token client ID. - **clientSecret** (`string`): Your Lightspark API token client secret. ### Method Call `client.isAuthorized()` ### Returns - `Promise`: Resolves to `true` if authorized, `false` otherwise. ### Request Example ```typescript import { AccountTokenAuthProvider, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( process.env.LIGHTSPARK_API_TOKEN_CLIENT_ID!, process.env.LIGHTSPARK_API_TOKEN_CLIENT_SECRET!, ), ); const isAuthorized = await client.isAuthorized(); console.log("Authorized:", isAuthorized); // true ``` ### Response Example ```json { "example": "true" } ``` ``` -------------------------------- ### Project Structure Overview Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/CONTEXT.md This outlines the directory structure of the Origin project, including source files, token management, tooling, and scripts. ```bash origin/ ├── src/ │ ├── app/ # Next.js app │ │ ├── globals.scss # Global styles + icon stroke CSS │ │ ├── layout.tsx │ │ └── page.tsx │ ├── components/ │ │ └── Icon/ # CentralIcon system │ │ ├── icons/ # Vendored icon files (generated) │ │ └── icon-registry.ts # Icon registry (generated) │ ├── lib/ │ │ └── dev-warn.ts # Dev-only warning utility │ └── tokens/ │ ├── _variables.scss # Generated from Figma tokens │ └── _mixins.scss # SCSS mixins ├── tokens/ │ └── figma/ │ ├── origin/ # Origin tokens (Dark, Light, Value) │ └── baseline/ # Baseline tokens ├── tools/ │ └── base-ui-lint/ # Figma lint plugin │ ├── rules/ # 37 component rule files │ ├── src/ # Plugin source │ └── dist/ # Built plugin ├── scripts/ │ ├── build-tokens.js # Token transformation script │ └── extract-icons.mjs # Icon vendoring + registry generation └── CONTEXT.md # This file ``` -------------------------------- ### Build Figma Lint Plugin Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/README.md Navigate to the lint plugin directory and build it. ```bash cd tools/base-ui-lint npm run build ``` -------------------------------- ### Subscribe to Transaction Updates Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/lightspark-sdk/README.md Subscribe to real-time transaction updates for a specific node. Includes functions to start and stop listening for these events. ```typescript const nodeID = ; let subscription; function startListening(nodeId: string) { if (subscription) { return; } console.log("Starting to listen for transactions..."); subscription = lightsparkClient.listenToTransactions([nodeID]).subscribe({ next: (transaction) => { if (transaction) { console.log(`Transaction updated! ${JSON.stringify(transaction)}`); } }, }); } function stopListening() { if (!subscription) { return; } console.log("Stopping listening for transactions..."); subscription.unsubscribe(); subscription = undefined; } ``` -------------------------------- ### Build the wasm package Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/crypto-wasm/README.md Run this command to build the WebAssembly package after setting up the environment. ```shell yarn build ``` -------------------------------- ### Development and Build Commands Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/origin/CONTEXT.md Provides essential npm commands for running the development server, building the project, transforming tokens, and extracting icons. ```bash # Development npm run dev # Start Next.js dev server npm run storybook # Start Storybook # Build npm run build # Build Next.js npm run tokens:build # Transform Figma tokens to SCSS npm run icons:extract # Vendor icons + regenerate registry # Lint plugin cd tools/base-ui-lint npm run build # Build the Figma plugin ``` -------------------------------- ### Initialize LightsparkClient with AccountTokenAuthProvider (Manual) Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Initialize the LightsparkClient for server-side authentication using manually provided API token credentials. Verify authorization before making API calls. ```typescript import { AccountTokenAuthProvider, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( "your-api-token-client-id", "your-api-token-client-secret", ), ); // Verify the client is authorized before making calls if (await client.isAuthorized()) { const account = await client.getCurrentAccount(); console.log("Account name:", account?.name); } ``` -------------------------------- ### Get On-Chain Fee Estimate Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Returns fee-per-byte estimates for L1 Bitcoin transactions for a given network. Use `BitcoinNetwork.MAINNET` for mainnet estimates. ```typescript import { AccountTokenAuthProvider, BitcoinNetwork, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( process.env.LIGHTSPARK_API_TOKEN_CLIENT_ID!, process.env.LIGHTSPARK_API_TOKEN_CLIENT_SECRET!, ), ); const feeEstimate = await client.getBitcoinFeeEstimate(BitcoinNetwork.MAINNET); console.log( "Fast fee:", feeEstimate.feeFast.preferredCurrencyValueApprox, feeEstimate.feeFast.preferredCurrencyUnit, ); console.log( "Min fee:", feeEstimate.feeMin.preferredCurrencyValueApprox, feeEstimate.feeMin.preferredCurrencyUnit, ); ``` -------------------------------- ### Run Node.js Script with ts-node Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/nodejs-scripts/README.md Execute a Node.js script using `ts-node`. Ensure you have run `yarn` to install dependencies and configured necessary environment variables. ```bash yarn ts-node getWalletDashboard.ts ``` -------------------------------- ### Get Single Node Dashboard Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Returns a detailed dashboard for a single node, including address info, balances, and recent transactions. Requires a specific `nodeId`. ```typescript import { AccountTokenAuthProvider, BitcoinNetwork, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( process.env.LIGHTSPARK_API_TOKEN_CLIENT_ID!, process.env.LIGHTSPARK_API_TOKEN_CLIENT_SECRET!, ), ); const nodeId = "LightsparkNodeWithOSK:018a1234-abcd-0000-0000-000000000000"; const dashboard = await client.getSingleNodeDashboard( nodeId, BitcoinNetwork.REGTEST, ); console.log("Node:", dashboard.displayName); console.log("Status:", dashboard.status); console.log("Public key:", dashboard.publicKey); console.log( "Total local balance:", dashboard.totalLocalBalance?.preferredCurrencyValueApprox, dashboard.totalLocalBalance?.preferredCurrencyUnit, ); console.log("Recent transactions:", dashboard.recentTransactions.length); ``` -------------------------------- ### Configure UMA VASP Docker Environment Variables Source: https://github.com/lightsparkdev/js-sdk/blob/main/apps/examples/uma-vasp/README.md Create a `local.env` file in `js/apps/examples/uma-vasp/` to store environment variables for the Docker container. This includes Lightspark API credentials, UMA receiver details, and encryption/signing key information. ```bash LIGHTSPARK_API_TOKEN_CLIENT_ID= LIGHTSPARK_API_TOKEN_CLIENT_SECRET= LIGHTSPARK_UMA_NODE_ID= LIGHTSPARK_UMA_RECEIVER_USER= LIGHTSPARK_UMA_ENCRYPTION_CERT_CHAIN= LIGHTSPARK_UMA_ENCRYPTION_PUBKEY= LIGHTSPARK_UMA_ENCRYPTION_PRIVKEY= LIGHTSPARK_UMA_SIGNING_CERT_CHAIN= LIGHTSPARK_UMA_SIGNING_PUBKEY= LIGHTSPARK_UMA_SIGNING_PRIVKEY= # If you are using an OSK node: LIGHTSPARK_UMA_OSK_NODE_SIGNING_KEY_PASSWORD= # If you are using a remote signing node: LIGHTSPARK_UMA_REMOTE_SIGNING_NODE_MASTER_SEED= # Optional: A custom VASP domain in case you're hosting this at a fixed hostname. LIGHTSPARK_UMA_VASP_DOMAIN= ``` -------------------------------- ### Get Account Dashboard Overview Source: https://context7.com/lightsparkdev/js-sdk/llms.txt Fetches a high-level dashboard of account-wide balances and node summaries for all or specific nodes. Use `undefined` for `nodeIds` to fetch all nodes. ```typescript import { AccountTokenAuthProvider, BitcoinNetwork, LightsparkClient, } from "@lightsparkdev/lightspark-sdk"; const client = new LightsparkClient( new AccountTokenAuthProvider( process.env.LIGHTSPARK_API_TOKEN_CLIENT_ID!, process.env.LIGHTSPARK_API_TOKEN_CLIENT_SECRET!, ), ); const dashboard = await client.getAccountDashboard( undefined, // nodeIds — undefined fetches all nodes BitcoinNetwork.REGTEST, ); console.log("Account:", dashboard.name); console.log( "Local balance:", dashboard.localBalance?.preferredCurrencyValueApprox, dashboard.localBalance?.preferredCurrencyUnit, ); console.log( "Remote balance:", dashboard.remoteBalance?.preferredCurrencyValueApprox, dashboard.remoteBalance?.preferredCurrencyUnit, ); for (const node of dashboard.nodes) { console.log(`Node: ${node.displayName} (${node.id})`); console.log( ` Status: ${node.status}, Local: ${node.localBalance?.preferredCurrencyValueApprox}`, ); } ``` -------------------------------- ### Initialize Lightspark UI Components Source: https://github.com/lightsparkdev/js-sdk/blob/main/packages/ui/README.md Set up the LightsparkProvider and use the Button component in your React application. ```jsx import { LightsparkProvider, Button } from "@lightsparkdev/ui/src/components"; function App() { return (