Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 44 additions & 0 deletions .github/workflows/publish-jsr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to JSR in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/lightsparkdev/grid-js-sdk/actions/workflows/publish-jsr.yml
name: Publish JSR
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
environment: npm

steps:
- uses: actions/checkout@v6

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Set up pnpm
uses: pnpm/action-setup@v4

- name: Install dependencies
run: |
pnpm install

- name: Publish to JSR
run: |
bash ./bin/publish-jsr

- name: Upload MCP Server DXT GitHub release asset
run: |
gh release upload ${{ github.event.release.tag_name }} \
packages/mcp-server/lightsparkdev_grid_api.mcpb
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.5.0"
".": "0.6.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 44
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lightspark%2Fgrid-2055da1ed4887a7cda84a20bf85c1861152ac598aa732d9ba4aa4c6d25864303.yml
openapi_spec_hash: 36a4b67bfa16a6d57102e6364f2db0e6
config_hash: bc4423ce1d5f28c3aeb6b9f252351f64
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lightspark%2Fgrid-8f56910cb8d117037f936d5a2d65d773d98c498c21a9ad3226596d2e813c73fb.yml
openapi_spec_hash: 95f64df549377dd552239c80b705b003
config_hash: 9588711e3e3cf4a4f11714e9ee3e057e
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 0.6.0 (2026-02-14)

Full Changelog: [v0.5.0...v0.6.0](https://github.com/lightsparkdev/grid-js-sdk/compare/v0.5.0...v0.6.0)

### Features

* **api:** manual updates ([7fac5ee](https://github.com/lightsparkdev/grid-js-sdk/commit/7fac5ee05345d1dc003f53ed185ca21a2ea87cd9))
* **api:** manual updates ([66e96dd](https://github.com/lightsparkdev/grid-js-sdk/commit/66e96dd633c290f28e6750c9f11f2c40d6d461b0))
* **api:** manual updates ([a73f73f](https://github.com/lightsparkdev/grid-js-sdk/commit/a73f73fe3438683bb3dcfb295f7d86afebebac8a))
* Revert main to af3a51a ([bc6c9e5](https://github.com/lightsparkdev/grid-js-sdk/commit/bc6c9e56b7568a61c9fae20789a126b898d73896))


### Bug Fixes

* **api:** remove originalQuoteId field from Quote ([afdf12f](https://github.com/lightsparkdev/grid-js-sdk/commit/afdf12f9d0001062b021a2b93531b0c560389d31))
* **types:** remove counterpartyInformation field from quotes destination ([701e407](https://github.com/lightsparkdev/grid-js-sdk/commit/701e407c46d3d5101426afd436608a5db6d311da))


### Chores

* **internal:** improve layout of generated MCP server files ([37f0c7c](https://github.com/lightsparkdev/grid-js-sdk/commit/37f0c7c7495d20ab41a371d17d3ce49c8e15ff16))
* **internal:** improve reliability of MCP servers when using local code mode execution ([8773471](https://github.com/lightsparkdev/grid-js-sdk/commit/8773471c7db98972ee23262831b312ef5fae93a6))
* **mcp:** forward STAINLESS_API_KEY to docs search endpoint ([198f88d](https://github.com/lightsparkdev/grid-js-sdk/commit/198f88dab4010c91a871dc83be7d22781ac7cd57))
* remove custom code ([54b0242](https://github.com/lightsparkdev/grid-js-sdk/commit/54b02424fcf626d7ae3647a987caa6d0d23bc763))

## 0.5.0 (2026-02-13)

Full Changelog: [v0.4.0...v0.5.0](https://github.com/lightsparkdev/grid-js-sdk/compare/v0.4.0...v0.5.0)
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lightspark Grid TypeScript API Library

[![NPM version](<https://img.shields.io/npm/v/@lightsparkdev/grid.svg?label=npm%20(stable)>)](https://npmjs.org/package/@lightsparkdev/grid) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@lightsparkdev/grid)
[![NPM version](<https://img.shields.io/npm/v/@lightsparkdev/grid.svg?label=npm%20(stable)>)](https://npmjs.org/package/@lightsparkdev/grid) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@lightsparkdev/grid) [![JSR Version](https://jsr.io/badges/@lightsparkdev/grid)](https://jsr.io/@lightsparkdev/grid)

This library provides convenient access to the Lightspark Grid REST API from server-side TypeScript or JavaScript.

Expand All @@ -23,6 +23,21 @@ Use the Lightspark Grid MCP Server to enable AI assistants to interact with this
npm install @lightsparkdev/grid
```

### Installation from JSR

```sh
deno add jsr:@lightsparkdev/grid
npx jsr add @lightsparkdev/grid
```

These commands will make the module importable from the `@lightsparkdev/grid` scope:

You can also [import directly from JSR](https://jsr.io/docs/using-packages#importing-with-jsr-specifiers) without an install step if you're using the Deno JavaScript runtime:

```ts
import LightsparkGrid from 'jsr:@lightsparkdev/grid';
```

## Usage

The full API of this library can be found in [api.md](api.md).
Expand Down Expand Up @@ -453,7 +468,7 @@ const client = new LightsparkGrid({
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>

```ts
import LightsparkGrid from 'npm:@lightsparkdev/grid';
import LightsparkGrid from 'jsr:@lightsparkdev/grid';

const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
const client = new LightsparkGrid({
Expand Down
32 changes: 4 additions & 28 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,17 @@ Methods:

Types:

- <code><a href="./src/resources/customers/external-accounts.ts">Address</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">BaseWalletInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">BeneficiaryOneOf</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">CadAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">ClabeAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">BusinessBeneficiary</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">ExternalAccount</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">ExternalAccountCreate</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">ExternalAccountInfoOneOf</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">GbpAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">IbanAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">LightningWalletInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">NgnAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">PhpAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">PixAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">PolygonWalletInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">SgdAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">SolanaWalletInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">SparkWalletInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">TronWalletInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">UpiAccountInfo</a></code>
- <code><a href="./src/resources/customers/external-accounts.ts">UsAccountInfo</a></code>

Methods:

Expand Down Expand Up @@ -143,15 +134,11 @@ Methods:

Types:

- <code><a href="./src/resources/quotes.ts">BaseDestination</a></code>
- <code><a href="./src/resources/quotes.ts">BasePaymentAccountInfo</a></code>
- <code><a href="./src/resources/quotes.ts">BaseQuoteSource</a></code>
- <code><a href="./src/resources/quotes.ts">Currency</a></code>
- <code><a href="./src/resources/quotes.ts">OutgoingRateDetails</a></code>
- <code><a href="./src/resources/quotes.ts">PaymentInstructions</a></code>
- <code><a href="./src/resources/quotes.ts">Quote</a></code>
- <code><a href="./src/resources/quotes.ts">QuoteDestinationOneOf</a></code>
- <code><a href="./src/resources/quotes.ts">QuoteSourceOneOf</a></code>

Methods:

Expand All @@ -165,9 +152,7 @@ Methods:
Types:

- <code><a href="./src/resources/transactions.ts">BaseTransactionSource</a></code>
- <code><a href="./src/resources/transactions.ts">CounterpartyInformation</a></code>
- <code><a href="./src/resources/transactions.ts">IncomingTransaction</a></code>
- <code><a href="./src/resources/transactions.ts">TransactionDestinationOneOf</a></code>
- <code><a href="./src/resources/transactions.ts">TransactionSourceOneOf</a></code>
- <code><a href="./src/resources/transactions.ts">TransactionStatus</a></code>
- <code><a href="./src/resources/transactions.ts">TransactionType</a></code>
Expand All @@ -183,18 +168,11 @@ Methods:

Types:

- <code><a href="./src/resources/webhooks.ts">IncomingPaymentWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">OutgoingPaymentWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">TestWebhookWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">BulkUploadWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">InvitationClaimedWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">KYCStatusWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">AccountStatusWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">UnwrapWebhookEvent</a></code>
- <code><a href="./src/resources/webhooks.ts">WebhookSendTestResponse</a></code>

Methods:

- <code>client.webhooks.<a href="./src/resources/webhooks.ts">unwrap</a>(body) -> void</code>
- <code title="post /webhooks/test">client.webhooks.<a href="./src/resources/webhooks.ts">sendTest</a>() -> WebhookSendTestResponse</code>

# Invitations

Expand All @@ -215,12 +193,10 @@ Methods:
Types:

- <code><a href="./src/resources/sandbox/sandbox.ts">SandboxSendFundsResponse</a></code>
- <code><a href="./src/resources/sandbox/sandbox.ts">SandboxSendTestWebhookResponse</a></code>

Methods:

- <code title="post /sandbox/send">client.sandbox.<a href="./src/resources/sandbox/sandbox.ts">sendFunds</a>({ ...params }) -> SandboxSendFundsResponse</code>
- <code title="post /webhooks/test">client.sandbox.<a href="./src/resources/sandbox/sandbox.ts">sendTestWebhook</a>() -> SandboxSendTestWebhookResponse</code>

## Uma

Expand Down
11 changes: 11 additions & 0 deletions bin/publish-jsr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -eux

# Build the project
pnpm build

# Navigate to the dist directory
cd dist-deno

npx jsr publish ${JSR_TOKEN:+"--token=$JSR_TOKEN"}
10 changes: 10 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@lightsparkdev/grid",
"version": "0.6.0",
"exports": "./index.ts",
"publish": {
"exclude": [
"!."
]
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightsparkdev/grid",
"version": "0.5.0",
"version": "0.6.0",
"description": "The official TypeScript library for the Lightspark Grid API",
"author": "Lightspark Grid <support@lightspark.com>",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -35,6 +35,7 @@
"@types/node": "^20.17.6",
"@typescript-eslint/eslint-plugin": "8.31.1",
"@typescript-eslint/parser": "8.31.1",
"@typescript-eslint/typescript-estree": "8.31.1",
"eslint": "^9.39.1",
"eslint-plugin-prettier": "^5.4.1",
"eslint-plugin-unused-imports": "^4.1.4",
Expand Down
8 changes: 2 additions & 6 deletions packages/mcp-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
# Set working directory
WORKDIR /app

# Copy the built mcp-server preserving directory structure
COPY --from=builder /build/packages/mcp-server/dist ./packages/mcp-server/dist
COPY --from=builder /build/packages/mcp-server/node_modules ./packages/mcp-server/node_modules

# Copy node_modules from root (pnpm hoists dependencies here)
COPY --from=builder /build/node_modules ./node_modules
# Copy the build results, preserving directory structure
COPY --from=builder /build .

# Copy the built @lightsparkdev/grid into node_modules
COPY --from=builder /build/dist ./node_modules/@lightsparkdev/grid
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dxt_version": "0.2",
"name": "@lightsparkdev/grid-mcp",
"version": "0.4.0",
"version": "0.5.0",
"description": "The official MCP Server for the Lightspark Grid API",
"author": {
"name": "Lightspark Grid",
Expand Down
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightsparkdev/grid-mcp",
"version": "0.5.0",
"version": "0.6.0",
"description": "The official MCP Server for the Lightspark Grid API",
"author": "Lightspark Grid <support@lightspark.com>",
"types": "dist/index.d.ts",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/mcp-server/src/code-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { McpTool, Metadata, ToolCallResult, asErrorResult, asTextContentResult } from './types';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { readEnv, requireValue } from './server';
import { readEnv, requireValue } from './util';
import { WorkerInput, WorkerOutput } from './code-tool-types';
import { SdkMethod } from './methods';
import { LightsparkGrid } from '@lightsparkdev/grid';
Expand Down
8 changes: 7 additions & 1 deletion packages/mcp-server/src/docs-search-tool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { Metadata, asTextContentResult } from './types';
import { readEnv } from './util';

import { Tool } from '@modelcontextprotocol/sdk/types.js';

Expand Down Expand Up @@ -45,7 +46,12 @@ const docsSearchURL =
export const handler = async (_: unknown, args: Record<string, unknown> | undefined) => {
const body = args as any;
const query = new URLSearchParams(body).toString();
const result = await fetch(`${docsSearchURL}?${query}`);
const stainlessAPIKey = readEnv('STAINLESS_API_KEY');
const result = await fetch(`${docsSearchURL}?${query}`, {
headers: {
...(stainlessAPIKey && { Authorization: stainlessAPIKey }),
},
});

if (!result.ok) {
throw new Error(
Expand Down
5 changes: 3 additions & 2 deletions packages/mcp-server/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp';
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
import { ClientOptions } from '@lightsparkdev/grid';
import express from 'express';
import morgan from 'morgan';
import morganBody from 'morgan-body';
import { parseAuthHeaders } from './auth';
import { McpOptions } from './options';
import { ClientOptions, initMcpServer, newMcpServer } from './server';
import { parseAuthHeaders } from './headers';
import { initMcpServer, newMcpServer } from './server';

const newServer = async ({
clientOptions,
Expand Down
15 changes: 8 additions & 7 deletions packages/mcp-server/src/methods.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { McpOptions } from './options';

export type SdkMethod = {
Expand Down Expand Up @@ -188,7 +190,12 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/transactions/{transactionId}/reject',
},
{ clientCallName: 'client.webhooks.unwrap', fullyQualifiedName: 'webhooks.unwrap' },
{
clientCallName: 'client.webhooks.sendTest',
fullyQualifiedName: 'webhooks.sendTest',
httpMethod: 'post',
httpPath: '/webhooks/test',
},
{
clientCallName: 'client.invitations.create',
fullyQualifiedName: 'invitations.create',
Expand Down Expand Up @@ -219,12 +226,6 @@ export const sdkMethods: SdkMethod[] = [
httpMethod: 'post',
httpPath: '/sandbox/send',
},
{
clientCallName: 'client.sandbox.sendTestWebhook',
fullyQualifiedName: 'sandbox.sendTestWebhook',
httpMethod: 'post',
httpPath: '/webhooks/test',
},
{
clientCallName: 'client.sandbox.uma.receivePayment',
fullyQualifiedName: 'sandbox.uma.receivePayment',
Expand Down
2 changes: 2 additions & 0 deletions packages/mcp-server/src/options.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import qs from 'qs';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
Expand Down
Loading
Loading