@lightsparkdev/lightspark-sdk 0.4.11 → 1.0.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/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/BitcoinNetwork-a816c0be.d.ts +18 -0
- package/dist/chunk-5RDIWPBE.js +27 -0
- package/dist/{chunk-NXUFC5J7.js → chunk-K2ZU5YQL.js} +2910 -645
- package/dist/chunk-K6SAUSAX.js +14 -0
- package/dist/env.cjs +101 -0
- package/dist/env.d.ts +17 -0
- package/dist/env.js +47 -0
- package/dist/{index-3ffe9e7b.d.ts → index-dbf06298.d.ts} +374 -79
- package/dist/index.cjs +3397 -805
- package/dist/index.d.ts +8 -3
- package/dist/index.js +412 -94
- package/dist/objects/index.cjs +2735 -553
- package/dist/objects/index.d.ts +2 -1
- package/dist/objects/index.js +20 -6
- package/package.json +21 -8
- package/src/NodeKeyLoaderCache.ts +89 -0
- package/src/SigningKeyLoader.ts +177 -0
- package/src/client.ts +160 -71
- package/src/env.ts +54 -0
- package/src/graphql/CreateInvoice.ts +3 -2
- package/src/graphql/CreateLnurlInvoice.ts +2 -0
- package/src/graphql/CreateUmaInvoice.ts +23 -0
- package/src/graphql/MultiNodeDashboard.ts +0 -3
- package/src/graphql/PayUmaInvoice.ts +29 -0
- package/src/graphql/RecoverNodeSigningKey.ts +1 -1
- package/src/graphql/SingleNodeDashboard.ts +0 -1
- package/src/helpers.ts +31 -0
- package/src/index.ts +1 -0
- package/src/lightspark_crypto/lightspark_crypto.d.ts +157 -0
- package/src/lightspark_crypto/lightspark_crypto.js +1010 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm +0 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm.d.ts +120 -0
- package/src/lightspark_crypto/package.json +11 -0
- package/src/objects/Account.ts +424 -107
- package/src/objects/AccountToNodesConnection.ts +0 -13
- package/src/objects/{CryptoSanctionsScreeningProvider.ts → ComplianceProvider.ts} +3 -3
- package/src/objects/Connection.ts +0 -6
- package/src/objects/CreateInvoiceInput.ts +0 -6
- package/src/objects/CreateLnurlInvoiceInput.ts +0 -6
- package/src/objects/CreateTestModePaymentoutput.ts +13 -1
- package/src/objects/CreateUmaInvoiceInput.ts +24 -0
- package/src/objects/DeclineToSignMessagesInput.ts +16 -0
- package/src/objects/DeclineToSignMessagesOutput.ts +28 -0
- package/src/objects/Entity.ts +401 -66
- package/src/objects/IdAndSignature.ts +16 -0
- package/src/objects/IncomingPayment.ts +18 -5
- package/src/objects/Invoice.ts +118 -21
- package/src/objects/InvoiceData.ts +118 -21
- package/src/objects/LightningTransaction.ts +149 -25
- package/src/objects/LightsparkNode.ts +270 -110
- package/src/objects/LightsparkNodeOwner.ts +4 -0
- package/src/objects/LightsparkNodeWithOSK.ts +389 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +384 -0
- package/src/objects/Node.ts +209 -56
- package/src/objects/OutgoingPayment.ts +136 -21
- package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +25 -0
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +28 -0
- package/src/objects/PayUmaInvoiceInput.ts +25 -0
- package/src/objects/{LightsparkNodePurpose.ts → PaymentDirection.ts} +5 -7
- package/src/objects/PaymentRequest.ts +118 -21
- package/src/objects/PaymentRequestData.ts +118 -21
- package/src/objects/PostTransactionData.ts +39 -0
- package/src/objects/RegisterPaymentInput.ts +31 -0
- package/src/objects/RegisterPaymentOutput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +23 -0
- package/src/objects/ReleasePaymentPreimageInput.ts +20 -0
- package/src/objects/ReleasePaymentPreimageOutput.ts +23 -0
- package/src/objects/RemoteSigningSubEventType.ts +26 -0
- package/src/objects/ScreenNodeInput.ts +20 -0
- package/src/objects/ScreenNodeOutput.ts +22 -0
- package/src/objects/SetInvoicePaymentHashInput.ts +24 -0
- package/src/objects/SetInvoicePaymentHashOutput.ts +23 -0
- package/src/objects/SignInvoiceInput.ts +19 -0
- package/src/objects/SignInvoiceOutput.ts +21 -0
- package/src/objects/SignMessagesInput.ts +18 -0
- package/src/objects/SignMessagesOutput.ts +26 -0
- package/src/objects/Signable.ts +58 -0
- package/src/objects/SignablePayload.ts +93 -0
- package/src/objects/SignablePayloadStatus.ts +17 -0
- package/src/objects/SingleNodeDashboard.ts +0 -2
- package/src/objects/Transaction.ts +149 -25
- package/src/objects/UpdateChannelPerCommitmentPointInput.ts +25 -0
- package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +23 -0
- package/src/objects/UpdateNodeSharedSecretInput.ts +18 -0
- package/src/objects/UpdateNodeSharedSecretOutput.ts +23 -0
- package/src/objects/Wallet.ts +265 -45
- package/src/objects/index.ts +37 -4
- package/src/objects/ScreenBitcoinAddressesInput.ts +0 -23
- package/src/objects/ScreenBitcoinAddressesOutput.ts +0 -25
- /package/src/{__tests__ → tests}/webhooks.test.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @lightsparkdev/lightspark-sdk
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 808c77a: Consolidate some imports to lightspark-sdk and core
|
|
8
|
+
- Updated dependencies [808c77a]
|
|
9
|
+
- @lightsparkdev/core@1.0.1
|
|
10
|
+
|
|
11
|
+
## 1.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- 1f00a50: Update to latest 3P API schema
|
|
16
|
+
Add uma mutations
|
|
17
|
+
Add remote signing support
|
|
18
|
+
|
|
19
|
+
- adds enum for signing key types
|
|
20
|
+
- adds property to NodeKeyCache to save signing key type
|
|
21
|
+
- changes Requester to add signing data specific to signing key type
|
|
22
|
+
- adds wasm packed lightspark_crypto lib
|
|
23
|
+
- adds loadNodeSigningKey function to client which handles both rsa and secp key types for OSK and remote signing
|
|
24
|
+
- updates documentation to reflect new loadNodeSigningKey function
|
|
25
|
+
- updates wasm packed lightspark_crypto lib
|
|
26
|
+
- BREAKING: Removes LightsparkClient unlockNode and adds loadNodeSigningKey which should be used for loading signing keys instead
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [1f00a50]
|
|
31
|
+
- @lightsparkdev/core@1.0.0
|
|
32
|
+
|
|
3
33
|
## 0.4.11
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ const nodeID = <the node ID of a node to unlock>;
|
|
|
49
49
|
const nodePassword = <the password used to unlock the node>;
|
|
50
50
|
|
|
51
51
|
try {
|
|
52
|
-
await lightsparkClient.
|
|
52
|
+
await lightsparkClient.loadNodeSigningKey(nodeID, { password: nodePassword });
|
|
53
53
|
} catch (e) {
|
|
54
54
|
console.error("Failed to unlock node", e);
|
|
55
55
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** This is an enum identifying a particular Bitcoin Network. **/
|
|
2
|
+
declare enum BitcoinNetwork {
|
|
3
|
+
/**
|
|
4
|
+
* This is an enum value that represents values that could be added in the future.
|
|
5
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
6
|
+
*/
|
|
7
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
8
|
+
/** The production version of the Bitcoin Blockchain. **/
|
|
9
|
+
MAINNET = "MAINNET",
|
|
10
|
+
/** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/
|
|
11
|
+
REGTEST = "REGTEST",
|
|
12
|
+
/** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/
|
|
13
|
+
SIGNET = "SIGNET",
|
|
14
|
+
/** A test version of the Bitcoin Blockchain, publicly available. **/
|
|
15
|
+
TESTNET = "TESTNET"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { BitcoinNetwork as B };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/helpers.ts
|
|
2
|
+
var BITCOIN_NETWORKS = [
|
|
3
|
+
"MAINNET" /* MAINNET */,
|
|
4
|
+
"TESTNET" /* TESTNET */,
|
|
5
|
+
"SIGNET" /* SIGNET */,
|
|
6
|
+
"REGTEST" /* REGTEST */
|
|
7
|
+
];
|
|
8
|
+
var isBitcoinNetwork = (bitcoinNetwork) => {
|
|
9
|
+
return BITCOIN_NETWORKS.includes(bitcoinNetwork);
|
|
10
|
+
};
|
|
11
|
+
var assertValidBitcoinNetwork = (bitcoinNetwork) => {
|
|
12
|
+
if (!isBitcoinNetwork(bitcoinNetwork)) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
`Invalid bitcoin network ${bitcoinNetwork}. Valid networks: ${BITCOIN_NETWORKS}`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
var getBitcoinNetworkOrThrow = (bitcoinNetwork) => {
|
|
19
|
+
assertValidBitcoinNetwork(bitcoinNetwork.toUpperCase());
|
|
20
|
+
return bitcoinNetwork;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
isBitcoinNetwork,
|
|
25
|
+
assertValidBitcoinNetwork,
|
|
26
|
+
getBitcoinNetworkOrThrow
|
|
27
|
+
};
|