@agicash/breez-sdk-spark 0.12.2-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +126 -0
  2. package/bundler/breez_sdk_spark_wasm.d.ts +1537 -0
  3. package/bundler/breez_sdk_spark_wasm.js +5 -0
  4. package/bundler/breez_sdk_spark_wasm_bg.js +3028 -0
  5. package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
  6. package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +134 -0
  7. package/bundler/index.d.ts +3 -0
  8. package/bundler/index.js +33 -0
  9. package/bundler/package.json +29 -0
  10. package/bundler/storage/index.js +2331 -0
  11. package/bundler/storage/package.json +12 -0
  12. package/deno/breez_sdk_spark_wasm.d.ts +1537 -0
  13. package/deno/breez_sdk_spark_wasm.js +2782 -0
  14. package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
  15. package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +134 -0
  16. package/nodejs/breez_sdk_spark_wasm.d.ts +1537 -0
  17. package/nodejs/breez_sdk_spark_wasm.js +3042 -0
  18. package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
  19. package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +134 -0
  20. package/nodejs/index.d.ts +1 -0
  21. package/nodejs/index.js +52 -0
  22. package/nodejs/index.mjs +24 -0
  23. package/nodejs/package.json +16 -0
  24. package/nodejs/postgres-storage/errors.cjs +19 -0
  25. package/nodejs/postgres-storage/index.cjs +1390 -0
  26. package/nodejs/postgres-storage/migrations.cjs +265 -0
  27. package/nodejs/postgres-storage/package.json +9 -0
  28. package/nodejs/postgres-token-store/errors.cjs +13 -0
  29. package/nodejs/postgres-token-store/index.cjs +857 -0
  30. package/nodejs/postgres-token-store/migrations.cjs +163 -0
  31. package/nodejs/postgres-token-store/package.json +9 -0
  32. package/nodejs/postgres-tree-store/errors.cjs +13 -0
  33. package/nodejs/postgres-tree-store/index.cjs +808 -0
  34. package/nodejs/postgres-tree-store/migrations.cjs +150 -0
  35. package/nodejs/postgres-tree-store/package.json +9 -0
  36. package/nodejs/storage/errors.cjs +19 -0
  37. package/nodejs/storage/index.cjs +1343 -0
  38. package/nodejs/storage/migrations.cjs +417 -0
  39. package/nodejs/storage/package.json +9 -0
  40. package/package.json +45 -0
  41. package/web/breez_sdk_spark_wasm.d.ts +1695 -0
  42. package/web/breez_sdk_spark_wasm.js +2873 -0
  43. package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
  44. package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +134 -0
  45. package/web/index.d.ts +3 -0
  46. package/web/index.js +33 -0
  47. package/web/package.json +28 -0
  48. package/web/storage/index.js +2331 -0
  49. package/web/storage/package.json +12 -0
package/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # Breez SDK - Spark
2
+
3
+ ## **What is the Breez SDK?**
4
+
5
+ The Breez SDK provides developers with an end-to-end solution for integrating self-custodial Lightning into their apps and services. It eliminates the need for third parties, simplifies the complexities of Bitcoin and Lightning, and enables seamless onboarding for billions of users to the future of value transfer.
6
+
7
+ ## **What is the Breez SDK - Spark?**
8
+
9
+ It’s a nodeless integration that offers a self-custodial, end-to-end solution for integrating Lightning payments, utilizing Spark with on-chain interoperability and third-party fiat on-ramps.
10
+
11
+ ## Installation
12
+
13
+ To install the package:
14
+
15
+ ```sh
16
+ npm install @breeztech/breez-sdk-spark
17
+ ```
18
+
19
+ or
20
+
21
+ ```sh
22
+ yarn add @breeztech/breez-sdk-spark
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ Head over to the Breez SDK - Spark [documentation](https://sdk-doc-spark.breez.technology/) to start implementing Lightning in your app.
28
+
29
+ ### Web
30
+
31
+ When developing a browser application you should import `@breeztech/breez-sdk-spark` (or the explicit `@breeztech/breez-sdk-spark/web` submodule).
32
+
33
+ It's important to first initialise the WebAssembly module by using `await init()` before making any other calls to the module.
34
+
35
+ ```js
36
+ import init, {
37
+ initLogging,
38
+ defaultConfig,
39
+ SdkBuilder,
40
+ } from "@breeztech/breez-sdk-spark/web";
41
+
42
+ // Initialise the WebAssembly module
43
+ await init();
44
+ ```
45
+
46
+ ### Node.js
47
+
48
+ > **Note**: This package requires Node.js v22 or higher.
49
+
50
+ When developing a node.js application you should require `@breeztech/breez-sdk-spark` (or the explicit `@breeztech/breez-sdk-spark/node` submodule).
51
+
52
+ ```js
53
+ const {
54
+ initLogging,
55
+ defaultConfig,
56
+ SdkBuilder,
57
+ } = require("@breeztech/breez-sdk-spark/nodejs");
58
+ const { Command } = require("commander");
59
+ require("dotenv").config();
60
+
61
+ class JsLogger {
62
+ log = (logEntry) => {
63
+ console.log(
64
+ `[${new Date().toISOString()} ${logEntry.level}]: ${logEntry.line}`
65
+ );
66
+ };
67
+ }
68
+
69
+ const fileLogger = new JsLogger();
70
+
71
+ class JsEventListener {
72
+ onEvent = (event) => {
73
+ fileLogger.log({
74
+ level: "INFO",
75
+ line: `Received event: ${JSON.stringify(event)}`,
76
+ });
77
+ };
78
+ }
79
+
80
+ const eventListener = new JsEventListener();
81
+ const program = new Command();
82
+
83
+ const initSdk = async () => {
84
+ // Set the logger to trace
85
+ await initLogging(fileLogger);
86
+
87
+ // Get the mnemonic
88
+ const mnemonic = process.env.MNEMONIC;
89
+
90
+ // Connect using the config
91
+ let config = defaultConfig("regtest");
92
+ config.apiKey = process.env.BREEZ_API_KEY;
93
+ console.log(`defaultConfig: ${JSON.stringify(config)}`);
94
+
95
+ let sdkBuilder = SdkBuilder.new(config, {
96
+ type: "mnemonic",
97
+ mnemonic: mnemonic,
98
+ });
99
+ sdkBuilder = await sdkBuilder.withDefaultStorage("./.data");
100
+
101
+ const sdk = await sdkBuilder.build();
102
+
103
+ await sdk.addEventListener(eventListener);
104
+ return sdk;
105
+ };
106
+
107
+ program
108
+ .name("breez-sdk-spark-wasm-cli")
109
+ .description("CLI for Breez SDK Spark - Wasm");
110
+
111
+ program.command("get-info").action(async () => {
112
+ const sdk = await initSdk();
113
+ const res = await sdk.getInfo({});
114
+ console.log(`getInfo: ${JSON.stringify(res)}`);
115
+ });
116
+
117
+ program.parse();
118
+ ```
119
+
120
+ ## Pricing
121
+
122
+ The Breez SDK is **free** for developers.
123
+
124
+ ## Support
125
+
126
+ Have a question for the team? Join us on [Telegram](https://t.me/breezsdk) or email us at <contact@breez.technology>.