Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
0206dc1
Added Artillery for Spark SDK load testing.
danielost Aug 22, 2025
92bfca0
Sync from private repository
yellowred Aug 20, 2025
bfb68f7
[tests] Remove impossible static deposits SSP test
yellowred Aug 22, 2025
5538540
Sync from private repository
keenan-lightspark Aug 22, 2025
033aa4a
Sync from private repository
akanter Aug 22, 2025
897a432
[spark-sdk] Stop using deprecated functions from
carsonp6 Aug 22, 2025
1f884c5
[spark-sdk] Revert changes to RN transport and fix type errors
coreymartin Aug 22, 2025
ac3448d
Sync from private repository
alexjweil Aug 22, 2025
1c68b95
Sync from private repository
coreymartin Aug 22, 2025
0cae01c
Sync from private repository
coreymartin Aug 22, 2025
8dae311
Sync from private repository
coreymartin Aug 22, 2025
014f81f
Sync from private repository
kphurley7 Aug 22, 2025
0147dfe
Add logger class to sdk. Allow adding different levels of logs as wel…
lightsparkmax Aug 22, 2025
d939f51
Sync from private repository
peterrojs Aug 22, 2025
3524243
The original test amount 100 was too small and it cannot pass
changli2023 Aug 22, 2025
6b79cb9
Sync from private repository
mhrheaume Aug 22, 2025
6fd0b52
Sync from private repository
ch-brian Aug 22, 2025
39fec16
Version packages
lightsparkmax Aug 22, 2025
c43009b
Add SubPlan index for query_token_outputs
peterrojs Aug 22, 2025
e8ae240
Sync from private repository
mhrheaume Aug 23, 2025
3b914d2
Sync from private repository
benwgold Aug 23, 2025
49934dd
fix: correct spelling errors and improve code clarity
ecurrencyhodler Aug 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions sdks/js/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Spark JS SDK workspaces

# Install
## Install

Running `yarn` will install dependencies for all workspaces. Please note there is a postinstall script that runs after install to build some dependencies. This will run automatically when the dependency tree changes or when manually running `yarn rebuild`.
You should use [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) to manage your node versions. That way you're using the same version as CI, it's easier to upgrade, and easier to repro any issues that are tied to a specific version.

With nvm installed:

```
cd spark/sdks/js
nvm use || nvm install
```

Similarly to manage yarn versions [it's recommended](https://yarnpkg.com/getting-started/install) using corepack which is built in with node:

```
corepack enable
cd spark/sdks/js
# use yarn version from packageManager key in package.json:
corepack prepare --activate
```

Then install dependencies for all workspaces:

```
# cd to js or to any subdirectory of js
cd spark/sdks/js
yarn
```

Please note there is a postinstall script that runs after install to build some dependencies. This will run automatically when the dependency tree changes or when manually running `yarn rebuild`.
7 changes: 7 additions & 0 deletions sdks/js/examples/nestjs-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @buildonspark/nestjs-app

## 0.0.69

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11

## 0.0.68

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/examples/nestjs-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@buildonspark/nestjs-app",
"version": "0.0.68",
"version": "0.0.69",
"description": "",
"author": "",
"private": true,
Expand All @@ -19,7 +19,7 @@
"test:e2e": "NODE_OPTIONS=\"--experimental-vm-modules\" yarn jest --config ./test/jest-e2e.json --detectOpenHandles --forceExit"
},
"dependencies": {
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/spark-sdk": "0.2.11",
"@nestjs/common": "^10.0.0",
"@nestjs/core": "^10.0.0",
"@nestjs/platform-express": "^10.0.0",
Expand Down
8 changes: 8 additions & 0 deletions sdks/js/examples/nodejs-scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @buildonspark/nodejs-scripts

## 0.0.85

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11
- @buildonspark/issuer-sdk@0.0.90

## 0.0.84

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions sdks/js/examples/nodejs-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@buildonspark/nodejs-scripts",
"version": "0.0.84",
"version": "0.0.85",
"private": true,
"description": "Example NodeJS scripts for Spark SDK",
"main": "index.js",
Expand All @@ -24,8 +24,8 @@
"typescript": "^5.7.3"
},
"dependencies": {
"@buildonspark/issuer-sdk": "0.0.89",
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/issuer-sdk": "0.0.90",
"@buildonspark/spark-sdk": "0.2.11",
"tsx": "^4.19.3"
},
"engines": {
Expand Down
8 changes: 8 additions & 0 deletions sdks/js/examples/spark-bare-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @buildonspark/spark-bare-app

## 0.0.7

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11
- @buildonspark/bare@0.0.7

## 0.0.6

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions sdks/js/examples/spark-bare-app/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@buildonspark/spark-bare-app",
"version": "0.0.6",
"version": "0.0.7",
"private": true,
"type": "module",
"scripts": {
"get-wallet-details": "bare get-wallet-details.js",
"create-lightning-invoice": "bare create-lightning-invoice.js 1000"
},
"dependencies": {
"@buildonspark/bare": "0.0.6",
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/bare": "0.0.7",
"@buildonspark/spark-sdk": "0.2.11",
"bare": "^1.21.3",
"bare-assert": "^1.0.2",
"bare-async-hooks": "^0.0.0",
Expand Down
7 changes: 7 additions & 0 deletions sdks/js/examples/spark-browser-extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# spark-browser-extension

## 0.0.6

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11

## 0.0.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/examples/spark-browser-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spark-browser-extension",
"version": "0.0.5",
"version": "0.0.6",
"private": true,
"type": "module",
"scripts": {
Expand All @@ -11,7 +11,7 @@
"format": "prettier src --check"
},
"dependencies": {
"@buildonspark/spark-sdk": "0.2.10"
"@buildonspark/spark-sdk": "0.2.11"
},
"devDependencies": {
"@types/chrome": "^0.0.276",
Expand Down
8 changes: 8 additions & 0 deletions sdks/js/examples/spark-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @buildonspark/spark-cli

## 0.0.68

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11
- @buildonspark/issuer-sdk@0.0.90

## 0.0.67

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions sdks/js/examples/spark-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@buildonspark/spark-cli",
"version": "0.0.67",
"version": "0.0.68",
"private": true,
"description": "Spark CLI",
"main": "index.js",
Expand Down Expand Up @@ -28,8 +28,8 @@
"typescript": "^5.7.3"
},
"dependencies": {
"@buildonspark/issuer-sdk": "0.0.89",
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/issuer-sdk": "0.0.90",
"@buildonspark/spark-sdk": "0.2.11",
"tsx": "^4.19.3",
"yargs": "^18.0.0"
},
Expand Down
16 changes: 15 additions & 1 deletion sdks/js/examples/spark-cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import {
WalletConfig,
SparkAddressFormat,
validateSparkInvoiceSignature,
SparkSdkLogger,
} from "@buildonspark/spark-sdk";
import { LoggingLevel } from "@lightsparkdev/core";
import {
TokenTransactionStatus,
TreeNode,
Expand Down Expand Up @@ -355,6 +357,8 @@ const commands = [
"fulfillsparkinvoice",
"validateinvoicesig",

"enablelogging",
"setloggerlevel",
"help",
"exit",
"quit",
Expand Down Expand Up @@ -684,6 +688,8 @@ async function runCLI() {
createtoken <tokenName> <tokenTicker> <decimals> <maxSupply> <isFreezable> - Create a new token
decodetokenidentifier <tokenIdentifier> - Returns the raw token identifier as a hex string

enablelogging <true|false> - Enable or disable logging
setloggerlevel <trace|info> - Set the logging level
help - Show this help message
exit/quit - Exit the program
`;
Expand All @@ -710,6 +716,14 @@ async function runCLI() {
case "help":
console.log(helpMessage);
break;
case "enablelogging":
SparkSdkLogger.setAllEnabled(args[0] === "true");
break;
case "setloggerlevel":
SparkSdkLogger.setAllLevels(
args[0] === "trace" ? LoggingLevel.Trace : LoggingLevel.Info,
);
break;
case "nontrustydeposit":
if (process.env.NODE_ENV !== "development" || network !== "REGTEST") {
console.log(
Expand All @@ -722,7 +736,7 @@ async function runCLI() {
*
* 1. Get an address to deposit funds from L1 to Spark
* 2. Construct a tx spending from the L1 address to the Spark address
* 3. Call initalizeDeposit with the tx hex
* 3. Call initializeDeposit with the tx hex
* 4. Sign the tx
* 5. Broadcast the tx
*/
Expand Down
7 changes: 7 additions & 0 deletions sdks/js/examples/spark-expo-react-native-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# my-app

## 1.0.6

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11

## 1.0.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/examples/spark-expo-react-native-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@buildonspark/spark-expo-react-native-app",
"main": "expo-router/entry",
"version": "1.0.5",
"version": "1.0.6",
"type": "module",
"scripts": {
"start": "expo start",
Expand All @@ -13,7 +13,7 @@
"lint": "expo lint"
},
"dependencies": {
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/spark-sdk": "0.2.11",
"@expo/vector-icons": "^14.1.0",
"@react-native-community/cli": "19.0.0",
"@react-navigation/bottom-tabs": "^7.3.10",
Expand Down
7 changes: 7 additions & 0 deletions sdks/js/examples/spark-nextjs-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# spark-nextjs-app

## 0.1.31

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11

## 0.1.30

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/examples/spark-nextjs-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spark-nextjs-app",
"version": "0.1.30",
"version": "0.1.31",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
Expand All @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/spark-sdk": "0.2.11",
"next": "15.3.2",
"react": "19.0.0",
"react-dom": "19.0.0"
Expand Down
8 changes: 8 additions & 0 deletions sdks/js/examples/spark-node-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# spark-node-express

## 0.0.77

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11
- @buildonspark/issuer-sdk@0.0.90

## 0.0.76

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions sdks/js/examples/spark-node-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spark-node-express",
"version": "0.0.76",
"version": "0.0.77",
"main": "dist/index.js",
"type": "module",
"private": true,
Expand All @@ -14,8 +14,8 @@
"author": "",
"description": "basic express server consuming the @buildonspark/spark-sdk and @buildonspark/issuer-sdk",
"dependencies": {
"@buildonspark/issuer-sdk": "0.0.89",
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/issuer-sdk": "0.0.90",
"@buildonspark/spark-sdk": "0.2.11",
"@lightsparkdev/core": "^1.4.3",
"@noble/curves": "^1.8.0",
"express": "^4.21.2"
Expand Down
7 changes: 7 additions & 0 deletions sdks/js/examples/spark-react-native-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# spark-react-native-app

## 0.0.17

### Patch Changes

- Updated dependencies
- @buildonspark/spark-sdk@0.2.11

## 0.0.16

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/examples/spark-react-native-app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ PODS:
- React-perflogger (= 0.79.4)
- React-utils (= 0.79.4)
- SocketRocket (0.7.1)
- spark-sdk (0.2.5):
- spark-sdk (0.2.10):
- React
- React-Core
- Yoga (0.0.0)
Expand Down Expand Up @@ -1961,7 +1961,7 @@ SPEC CHECKSUMS:
ReactCodegen: e713bcd88244fff6026629aebe9aa61b693beb9c
ReactCommon: c7d636ec1b9801ff4ee83cce8e0bf74a1610fc3f
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
spark-sdk: 476b47d7cdc485b64fbc1865d935c8aff99524c9
spark-sdk: a126ef95d385f3dd89438855e291c86e7b884ebc
Yoga: a6cb833e04fb8c59a012b49fb1d040fcb0cbb633

PODFILE CHECKSUM: ea1210c0e7d02ebb3d518cc5766a9f3dde871573
Expand Down
4 changes: 2 additions & 2 deletions sdks/js/examples/spark-react-native-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@buildonspark/spark-react-native-app",
"version": "0.0.16",
"version": "0.0.17",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand All @@ -12,7 +12,7 @@
},
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@buildonspark/spark-sdk": "0.2.10",
"@buildonspark/spark-sdk": "0.2.11",
"@react-native/new-app-screen": "0.80.1",
"react": "19.0.0",
"react-native": "0.79.4",
Expand Down
6 changes: 6 additions & 0 deletions sdks/js/examples/spark-token-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @buildonspark/spark-token-cli

## 0.0.49

### Patch Changes

- @buildonspark/issuer-sdk@0.0.90

## 0.0.48

### Patch Changes
Expand Down
Loading