@breeztech/breez-sdk-spark 0.27.0-dev2 → 0.27.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.
- package/breez-sdk-spark.tgz +0 -0
- package/bundler/breez_sdk_spark_wasm.d.ts +347 -95
- package/bundler/breez_sdk_spark_wasm_bg.js +210 -92
- package/bundler/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/bundler/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/bundler/storage/index.js +251 -20
- package/bundler/tree-store/index.js +39 -6
- package/deno/breez_sdk_spark_wasm.d.ts +347 -95
- package/deno/breez_sdk_spark_wasm.js +210 -92
- package/deno/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/deno/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/itest/database-drivers.test.js +45 -0
- package/nodejs/breez_sdk_spark_wasm.d.ts +347 -95
- package/nodejs/breez_sdk_spark_wasm.js +210 -92
- package/nodejs/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/nodejs/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/nodejs/index.js +6 -0
- package/nodejs/mysql-session-store/index.cjs +3 -1
- package/nodejs/mysql-storage/index.cjs +238 -20
- package/nodejs/mysql-storage/migrations.cjs +49 -1
- package/nodejs/mysql-token-store/index.cjs +3 -7
- package/nodejs/mysql-tree-store/index.cjs +26 -1
- package/nodejs/postgres-session-store/index.cjs +3 -1
- package/nodejs/postgres-storage/index.cjs +228 -19
- package/nodejs/postgres-storage/migrations.cjs +49 -0
- package/nodejs/postgres-token-store/index.cjs +3 -1
- package/nodejs/postgres-tree-store/index.cjs +25 -1
- package/nodejs/postgres-tree-store/migrations.cjs +10 -0
- package/nodejs/storage/index.cjs +210 -19
- package/nodejs/storage/migrations.cjs +38 -0
- package/nodejs/tree-store/index.cjs +35 -0
- package/package.json +1 -1
- package/web/breez_sdk_spark_wasm.d.ts +375 -109
- package/web/breez_sdk_spark_wasm.js +210 -92
- package/web/breez_sdk_spark_wasm_bg.wasm +0 -0
- package/web/breez_sdk_spark_wasm_bg.wasm.d.ts +28 -14
- package/web/storage/index.js +251 -20
- package/web/tree-store/index.js +39 -6
|
@@ -22,16 +22,20 @@ export const bitcoinchainservicehandle_tipHeight: (a: number) => any;
|
|
|
22
22
|
export const breezsdk_addContact: (a: number, b: any) => any;
|
|
23
23
|
export const breezsdk_addEventListener: (a: number, b: any) => any;
|
|
24
24
|
export const breezsdk_authorizeLightningAddressTransfer: (a: number, b: any) => any;
|
|
25
|
+
export const breezsdk_bridgeFromCashApp: (a: number, b: any) => any;
|
|
26
|
+
export const breezsdk_bridgeToCashApp: (a: number, b: any) => any;
|
|
25
27
|
export const breezsdk_buildUnsignedBatchPackage: (a: number, b: any) => any;
|
|
26
28
|
export const breezsdk_buildUnsignedLnurlPayPackage: (a: number, b: any) => any;
|
|
29
|
+
export const breezsdk_buildUnsignedPullPackage: (a: number, b: any) => any;
|
|
27
30
|
export const breezsdk_buildUnsignedTransferPackage: (a: number, b: any) => any;
|
|
28
31
|
export const breezsdk_buyBitcoin: (a: number, b: any) => any;
|
|
29
32
|
export const breezsdk_checkLightningAddressAvailable: (a: number, b: any) => any;
|
|
30
33
|
export const breezsdk_checkMessage: (a: number, b: any) => any;
|
|
31
|
-
export const
|
|
34
|
+
export const breezsdk_checkRecoverFunds: (a: number, b: any) => any;
|
|
32
35
|
export const breezsdk_claimDeposit: (a: number, b: any) => any;
|
|
33
36
|
export const breezsdk_claimHtlcPayment: (a: number, b: any) => any;
|
|
34
37
|
export const breezsdk_claimLightningAddressTransfer: (a: number, b: any) => any;
|
|
38
|
+
export const breezsdk_createTokenAllowance: (a: number, b: any) => any;
|
|
35
39
|
export const breezsdk_deleteContact: (a: number, b: number, c: number) => any;
|
|
36
40
|
export const breezsdk_deleteLightningAddress: (a: number) => any;
|
|
37
41
|
export const breezsdk_disconnect: (a: number) => any;
|
|
@@ -50,6 +54,7 @@ export const breezsdk_listContacts: (a: number, b: any) => any;
|
|
|
50
54
|
export const breezsdk_listFiatCurrencies: (a: number) => any;
|
|
51
55
|
export const breezsdk_listFiatRates: (a: number) => any;
|
|
52
56
|
export const breezsdk_listPayments: (a: number, b: any) => any;
|
|
57
|
+
export const breezsdk_listTokenAllowances: (a: number, b: any) => any;
|
|
53
58
|
export const breezsdk_listUnclaimedDeposits: (a: number, b: any) => any;
|
|
54
59
|
export const breezsdk_listWebhooks: (a: number) => any;
|
|
55
60
|
export const breezsdk_lnurlAuth: (a: number, b: any) => any;
|
|
@@ -59,23 +64,27 @@ export const breezsdk_optimizeLeaves: (a: number, b: any) => any;
|
|
|
59
64
|
export const breezsdk_parse: (a: number, b: number, c: number) => any;
|
|
60
65
|
export const breezsdk_prepareLnurlPay: (a: number, b: any) => any;
|
|
61
66
|
export const breezsdk_preparePaymentLink: (a: number, b: any) => any;
|
|
67
|
+
export const breezsdk_preparePullPayment: (a: number, b: any) => any;
|
|
68
|
+
export const breezsdk_prepareRecoverFunds: (a: number, b: any) => any;
|
|
62
69
|
export const breezsdk_prepareSendBatch: (a: number, b: any) => any;
|
|
63
70
|
export const breezsdk_prepareSendPayment: (a: number, b: any) => any;
|
|
64
|
-
export const breezsdk_prepareUnilateralExit: (a: number, b: any) => any;
|
|
65
71
|
export const breezsdk_publishSignedLnurlPayPackage: (a: number, b: any) => any;
|
|
72
|
+
export const breezsdk_publishSignedPullPackage: (a: number, b: any) => any;
|
|
66
73
|
export const breezsdk_publishSignedTransferPackage: (a: number, b: any) => any;
|
|
74
|
+
export const breezsdk_pullPayment: (a: number, b: any) => any;
|
|
67
75
|
export const breezsdk_receivePayment: (a: number, b: any) => any;
|
|
68
76
|
export const breezsdk_recommendedFees: (a: number) => any;
|
|
77
|
+
export const breezsdk_recoverFunds: (a: number, b: any, c: number) => any;
|
|
69
78
|
export const breezsdk_refundDeposit: (a: number, b: any) => any;
|
|
70
79
|
export const breezsdk_refundPendingConversions: (a: number) => any;
|
|
71
80
|
export const breezsdk_registerLightningAddress: (a: number, b: any) => any;
|
|
72
81
|
export const breezsdk_registerWebhook: (a: number, b: any) => any;
|
|
73
82
|
export const breezsdk_removeEventListener: (a: number, b: number, c: number) => any;
|
|
83
|
+
export const breezsdk_revokeTokenAllowance: (a: number, b: any) => any;
|
|
74
84
|
export const breezsdk_sendBatch: (a: number, b: any) => any;
|
|
75
85
|
export const breezsdk_sendPayment: (a: number, b: any) => any;
|
|
76
86
|
export const breezsdk_signMessage: (a: number, b: any) => any;
|
|
77
87
|
export const breezsdk_syncWallet: (a: number, b: any) => any;
|
|
78
|
-
export const breezsdk_unilateralExit: (a: number, b: any, c: any) => any;
|
|
79
88
|
export const breezsdk_unregisterWebhook: (a: number, b: any) => any;
|
|
80
89
|
export const breezsdk_updateContact: (a: number, b: any) => any;
|
|
81
90
|
export const breezsdk_updateUserSettings: (a: number, b: any) => any;
|
|
@@ -110,6 +119,7 @@ export const externalsigningsignerhandle_signHashSchnorr: (a: number, b: number,
|
|
|
110
119
|
export const externalsparksignerhandle_getIdentityPublicKey: (a: number) => any;
|
|
111
120
|
export const externalsparksignerhandle_getPublicKeyForLeaf: (a: number, b: any) => any;
|
|
112
121
|
export const externalsparksignerhandle_getStaticDepositPublicKey: (a: number, b: number) => any;
|
|
122
|
+
export const externalsparksignerhandle_isRemote: (a: number) => number;
|
|
113
123
|
export const externalsparksignerhandle_prepareClaim: (a: number, b: any) => any;
|
|
114
124
|
export const externalsparksignerhandle_prepareLightningReceive: (a: number, b: any) => any;
|
|
115
125
|
export const externalsparksignerhandle_prepareStaticDeposit: (a: number, b: any) => any;
|
|
@@ -122,7 +132,9 @@ export const externalsparksignerhandle_signLeafRefundSpend: (a: number, b: any,
|
|
|
122
132
|
export const externalsparksignerhandle_signMessage: (a: number, b: number, c: number) => any;
|
|
123
133
|
export const externalsparksignerhandle_signSparkInvoice: (a: number, b: any) => any;
|
|
124
134
|
export const externalsparksignerhandle_signStaticDepositRefund: (a: number, b: any) => any;
|
|
135
|
+
export const externalsparksignerhandle_signWatchtowerExitRecovery: (a: number, b: any) => any;
|
|
125
136
|
export const externalsparksignerhandle_startStaticDepositRefund: (a: number, b: any) => any;
|
|
137
|
+
export const externalsparksignerhandle_startWatchtowerExitRecovery: (a: number, b: any) => any;
|
|
126
138
|
export const getSparkStatus: () => any;
|
|
127
139
|
export const initLogging: (a: any, b: number, c: number) => any;
|
|
128
140
|
export const mysqlStorage: (a: any) => number;
|
|
@@ -185,21 +197,23 @@ export const intounderlyingsource_cancel: (a: number) => void;
|
|
|
185
197
|
export const intounderlyingsource_pull: (a: number, b: any) => any;
|
|
186
198
|
export const __wbg_externalbreezsignerhandle_free: (a: number, b: number) => void;
|
|
187
199
|
export const __wbg_defaultsessionstore_free: (a: number, b: number) => void;
|
|
188
|
-
export const __wbg_externalsigningsignerhandle_free: (a: number, b: number) => void;
|
|
189
200
|
export const __wbg_externalsparksignerhandle_free: (a: number, b: number) => void;
|
|
201
|
+
export const __wbg_externalsigningsignerhandle_free: (a: number, b: number) => void;
|
|
190
202
|
export const __wbg_signingonlyexternalsigners_free: (a: number, b: number) => void;
|
|
191
203
|
export const signingonlyexternalsigners_breezSigner: (a: number) => number;
|
|
192
204
|
export const signingonlyexternalsigners_sparkSigner: (a: number) => number;
|
|
193
|
-
export const
|
|
194
|
-
export const
|
|
195
|
-
export const
|
|
196
|
-
export const
|
|
197
|
-
export const
|
|
198
|
-
export const
|
|
199
|
-
export const
|
|
200
|
-
export const
|
|
201
|
-
export const
|
|
202
|
-
export const
|
|
205
|
+
export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31: (a: number, b: number, c: any) => [number, number];
|
|
206
|
+
export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_6: (a: number, b: number, c: any) => [number, number];
|
|
207
|
+
export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_7: (a: number, b: number, c: any) => [number, number];
|
|
208
|
+
export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_8: (a: number, b: number, c: any) => [number, number];
|
|
209
|
+
export const wasm_bindgen__convert__closures_____invoke__h6a948436da8c8a31_9: (a: number, b: number, c: any) => [number, number];
|
|
210
|
+
export const wasm_bindgen__convert__closures_____invoke__h118cfc65b353d9fd: (a: number, b: number, c: any, d: any) => void;
|
|
211
|
+
export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed: (a: number, b: number, c: any) => void;
|
|
212
|
+
export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_2: (a: number, b: number, c: any) => void;
|
|
213
|
+
export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_3: (a: number, b: number, c: any) => void;
|
|
214
|
+
export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_4: (a: number, b: number, c: any) => void;
|
|
215
|
+
export const wasm_bindgen__convert__closures_____invoke__h06397208c6d2b4ed_5: (a: number, b: number, c: any) => void;
|
|
216
|
+
export const wasm_bindgen__convert__closures_____invoke__h02848814aa3937de: (a: number, b: number) => void;
|
|
203
217
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
204
218
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
205
219
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
// This project installs neither `pg` nor `mysql2`. The package loads without
|
|
4
|
+
// a warning about them, and tells an app that selects PostgreSQL or MySQL
|
|
5
|
+
// storage which driver to install. No network.
|
|
6
|
+
|
|
7
|
+
const assert = require('node:assert/strict')
|
|
8
|
+
const test = require('node:test')
|
|
9
|
+
|
|
10
|
+
// The package prints its warnings on the first require in a process.
|
|
11
|
+
const warnings = []
|
|
12
|
+
const consoleWarn = console.warn
|
|
13
|
+
console.warn = (...args) => warnings.push(args.join(' '))
|
|
14
|
+
const {
|
|
15
|
+
SdkBuilder,
|
|
16
|
+
defaultConfig,
|
|
17
|
+
defaultMysqlStorageConfig,
|
|
18
|
+
defaultPostgresStorageConfig,
|
|
19
|
+
mysqlStorage,
|
|
20
|
+
postgresStorage,
|
|
21
|
+
} = require('@breeztech/breez-sdk-spark/nodejs')
|
|
22
|
+
console.warn = consoleWarn
|
|
23
|
+
|
|
24
|
+
function buildWith(storage) {
|
|
25
|
+
const mnemonic = require('bip39').generateMnemonic()
|
|
26
|
+
const builder = SdkBuilder.new(defaultConfig('regtest'), { type: 'mnemonic', mnemonic })
|
|
27
|
+
return builder.withStorageBackend(storage).build()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
test('loading the package prints no database driver warning', () => {
|
|
31
|
+
assert.deepEqual(
|
|
32
|
+
warnings.filter((warning) => /PostgreSQL|MySQL/.test(warning)),
|
|
33
|
+
[]
|
|
34
|
+
)
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('selecting PostgreSQL storage names the missing driver', async () => {
|
|
38
|
+
const config = defaultPostgresStorageConfig('postgres://user:password@localhost:5432/spark')
|
|
39
|
+
await assert.rejects(buildWith(postgresStorage(config)), /pg not found\. Please install it/)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
test('selecting MySQL storage names the missing driver', async () => {
|
|
43
|
+
const config = defaultMysqlStorageConfig('mysql://user:password@localhost:3306/spark')
|
|
44
|
+
await assert.rejects(buildWith(mysqlStorage(config)), /mysql2 not found\. Please install it/)
|
|
45
|
+
})
|