Skip to content

Commit 7a93f63

Browse files
Lightspark Engjklein24
authored andcommitted
Project import generated by Copybara.
GitOrigin-RevId: b87f0bc2494634f7dc5523b1fc85789d33cae510
1 parent ff4a710 commit 7a93f63

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ This is the Lightspark Typescript SDK, which can be used either from a node or b
44

55
## Getting started
66

7-
> TODO: Add npm install instructions when this is published.
7+
To use the SDK, you'll need to install it from npm:
8+
9+
```bash
10+
$ npm install @lightsparkdev/js-sdk
11+
```
812

913
The entry-point to the SDK is the `LightsparkClient` class, which can be imported from the root package.
1014
To create and authenticate a client from a server-environment, you'll need to provide your API token ID and secret. You can create these from the [Lightspark API Tokens page](https://app.lightspark.com/api-config).
1115

1216
```typescript
13-
import { LightsparkClient } from "@lightspark/js-sdk";
14-
import { AccountTokenAuthProvider } from "@lightspark/js-sdk/auth";
17+
import { LightsparkClient } from "@lightsparkdev/js-sdk";
18+
import { AccountTokenAuthProvider } from "@lightsparkdev/js-sdk/auth";
1519

1620
const TOKEN_ID = <your api token id>;
1721
// NOTE: This should be stored securely, e.g. in an environment variable and shouldn't be present in client-side code.
@@ -24,8 +28,6 @@ const lightsparkClient = new LightsparkClient(
2428

2529
If you want to use the client in a browser environment, you'll need to use a different authentication provider. The `OAuthProvider` can be used to authenticate with the user's Lightspark account. It will open a popup window to the Lightspark login page, and then exchange the authorization code for an access token.
2630

27-
> TODO: Add example of using OAuthProvider when that's available.
28-
2931
You can then use the client to make API calls. For example, to create an invoice:
3032

3133
```typescript

examples/streaming-wallet-extension/public/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "Lightspark Streaming Money Demo Wallet",
33
"description": "A Lightspark demo that shows money streaming in real-time using the Lightning Network.",
4-
"version": "0.2.0",
4+
"version": "1.0.0",
55
"manifest_version": 3,
66
"action": {
77
"default_popup": "index.html",

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lightsparkdev/js-sdk",
3-
"version": "1.0.1",
3+
"version": "1.0.4",
44
"description": "Lightspark JS SDK",
55
"author": "Lightspark Inc.",
66
"keywords": [

src/objects/TransactionUpdate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const TransactionUpdateFromJson = (obj: any): TransactionUpdate => {
3939
updatedAt: obj["updated_at"],
4040
status: TransactionStatus[obj["status"]] ?? TransactionStatus.FUTURE_VALUE,
4141
amount: CurrencyAmountFromJson(obj["amount"]),
42-
typename: "ChannelClosingTransaction",
42+
typename: obj["__typename"] ?? "TransactionUpdate",
4343
resolvedAt: obj["resolved_at"],
4444
transactionHash: obj["transaction_hash"],
4545
};

src/requester/Requester.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class Requester {
168168
const platformVersion = isNode ? process.version : "";
169169
// TODO: Figure out how to properly load this from the package.json. Using an import
170170
// is breaking the streaming sats extension.
171-
const sdkVersion = "1.0.1";
171+
const sdkVersion = "1.0.4";
172172
return `lightspark-js-sdk/${sdkVersion} ${platform}/${platformVersion}`;
173173
}
174174

0 commit comments

Comments
 (0)