@lightsparkdev/lightspark-sdk 0.4.10 → 1.0.0
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/{chunk-NXUFC5J7.js → chunk-LZC5C5NI.js} +2908 -635
- package/dist/{index-3ffe9e7b.d.ts → index-09d4ac20.d.ts} +373 -62
- package/dist/index.cjs +3395 -842
- package/dist/index.d.ts +2 -2
- package/dist/index.js +390 -94
- package/dist/objects/index.cjs +2735 -553
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +17 -5
- package/package.json +12 -9
- package/src/NodeKeyLoaderCache.ts +87 -0
- package/src/SigningKeyLoader.ts +177 -0
- package/src/auth/AccountTokenAuthProvider.ts +4 -4
- package/src/client.ts +209 -118
- 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/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 +437 -120
- package/src/objects/AccountToApiTokensConnection.ts +3 -3
- package/src/objects/AccountToChannelsConnection.ts +4 -4
- package/src/objects/AccountToNodesConnection.ts +2 -15
- package/src/objects/AccountToPaymentRequestsConnection.ts +3 -3
- package/src/objects/AccountToTransactionsConnection.ts +6 -6
- package/src/objects/AccountToWalletsConnection.ts +2 -2
- package/src/objects/Balances.ts +2 -2
- package/src/objects/Channel.ts +4 -4
- package/src/objects/ChannelClosingTransaction.ts +2 -2
- package/src/objects/ChannelOpeningTransaction.ts +2 -2
- package/src/objects/ChannelToTransactionsConnection.ts +4 -4
- package/src/objects/{CryptoSanctionsScreeningProvider.ts → ComplianceProvider.ts} +3 -3
- package/src/objects/Connection.ts +25 -31
- package/src/objects/CreateApiTokenInput.ts +1 -1
- package/src/objects/CreateApiTokenOutput.ts +1 -1
- package/src/objects/CreateInvoiceInput.ts +0 -6
- package/src/objects/CreateLnurlInvoiceInput.ts +1 -7
- package/src/objects/CreateNodeWalletAddressInput.ts +1 -1
- package/src/objects/CreateNodeWalletAddressOutput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceInput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceOutput.ts +1 -1
- package/src/objects/CreateTestModePaymentInput.ts +1 -1
- package/src/objects/CreateTestModePaymentoutput.ts +14 -2
- package/src/objects/CreateUmaInvoiceInput.ts +24 -0
- package/src/objects/DeclineToSignMessagesInput.ts +16 -0
- package/src/objects/DeclineToSignMessagesOutput.ts +28 -0
- package/src/objects/DeleteApiTokenOutput.ts +1 -1
- package/src/objects/Entity.ts +401 -66
- package/src/objects/GraphNode.ts +3 -3
- package/src/objects/IdAndSignature.ts +16 -0
- package/src/objects/IncomingPayment.ts +21 -8
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/Invoice.ts +118 -21
- package/src/objects/InvoiceData.ts +118 -21
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +1 -1
- package/src/objects/LightningFeeEstimateForNodeInput.ts +1 -1
- package/src/objects/LightningFeeEstimateOutput.ts +2 -2
- package/src/objects/LightningTransaction.ts +155 -31
- package/src/objects/LightsparkNode.ts +272 -112
- package/src/objects/LightsparkNodeOwner.ts +8 -4
- package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -3
- package/src/objects/LightsparkNodeWithOSK.ts +389 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +384 -0
- package/src/objects/Node.ts +213 -60
- package/src/objects/NodeToAddressesConnection.ts +2 -2
- package/src/objects/OnChainTransaction.ts +2 -2
- package/src/objects/OutgoingPayment.ts +139 -24
- package/src/objects/OutgoingPaymentAttempt.ts +5 -5
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -3
- 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 +119 -22
- package/src/objects/PaymentRequestData.ts +119 -22
- 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/RequestWithdrawalInput.ts +1 -1
- package/src/objects/RequestWithdrawalOutput.ts +1 -1
- package/src/objects/RoutingTransaction.ts +1 -1
- 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 +153 -29
- package/src/objects/TransactionFailures.ts +1 -1
- 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 +271 -51
- package/src/objects/WalletToPaymentRequestsConnection.ts +3 -3
- package/src/objects/WalletToTransactionsConnection.ts +3 -3
- package/src/objects/WithdrawalRequest.ts +6 -6
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
- package/src/objects/index.ts +37 -4
- package/src/{__tests__ → tests}/webhooks.test.ts +1 -1
- package/src/webhooks.ts +1 -1
- package/src/objects/ScreenBitcoinAddressesInput.ts +0 -23
- package/src/objects/ScreenBitcoinAddressesOutput.ts +0 -25
package/src/objects/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export {
|
|
|
21
21
|
} from "./ChannelOpeningTransaction.js";
|
|
22
22
|
export { default as ChannelStatus } from "./ChannelStatus.js";
|
|
23
23
|
export { default as ChannelToTransactionsConnection } from "./ChannelToTransactionsConnection.js";
|
|
24
|
+
export { default as ComplianceProvider } from "./ComplianceProvider.js";
|
|
24
25
|
export { default as Connection } from "./Connection.js";
|
|
25
26
|
export { default as CreateApiTokenInput } from "./CreateApiTokenInput.js";
|
|
26
27
|
export { default as CreateApiTokenOutput } from "./CreateApiTokenOutput.js";
|
|
@@ -33,9 +34,11 @@ export { default as CreateTestModeInvoiceInput } from "./CreateTestModeInvoiceIn
|
|
|
33
34
|
export { default as CreateTestModeInvoiceOutput } from "./CreateTestModeInvoiceOutput.js";
|
|
34
35
|
export { default as CreateTestModePaymentInput } from "./CreateTestModePaymentInput.js";
|
|
35
36
|
export { default as CreateTestModePaymentoutput } from "./CreateTestModePaymentoutput.js";
|
|
36
|
-
export { default as
|
|
37
|
+
export { default as CreateUmaInvoiceInput } from "./CreateUmaInvoiceInput.js";
|
|
37
38
|
export { default as CurrencyAmount } from "./CurrencyAmount.js";
|
|
38
39
|
export { default as CurrencyUnit } from "./CurrencyUnit.js";
|
|
40
|
+
export { default as DeclineToSignMessagesInput } from "./DeclineToSignMessagesInput.js";
|
|
41
|
+
export { default as DeclineToSignMessagesOutput } from "./DeclineToSignMessagesOutput.js";
|
|
39
42
|
export { default as DeleteApiTokenInput } from "./DeleteApiTokenInput.js";
|
|
40
43
|
export { default as DeleteApiTokenOutput } from "./DeleteApiTokenOutput.js";
|
|
41
44
|
export { default as Deposit, getDepositQuery } from "./Deposit.js";
|
|
@@ -46,6 +49,7 @@ export { default as FundNodeOutput } from "./FundNodeOutput.js";
|
|
|
46
49
|
export { default as GraphNode } from "./GraphNode.js";
|
|
47
50
|
export { default as Hop, getHopQuery } from "./Hop.js";
|
|
48
51
|
export { default as HtlcAttemptFailureCode } from "./HtlcAttemptFailureCode.js";
|
|
52
|
+
export { default as IdAndSignature } from "./IdAndSignature.js";
|
|
49
53
|
export { default as IncomingPayment } from "./IncomingPayment.js";
|
|
50
54
|
export {
|
|
51
55
|
default as IncomingPaymentAttempt,
|
|
@@ -68,9 +72,10 @@ export {
|
|
|
68
72
|
default as LightsparkNodeOwner,
|
|
69
73
|
getLightsparkNodeOwnerQuery,
|
|
70
74
|
} from "./LightsparkNodeOwner.js";
|
|
71
|
-
export { default as LightsparkNodePurpose } from "./LightsparkNodePurpose.js";
|
|
72
75
|
export { default as LightsparkNodeStatus } from "./LightsparkNodeStatus.js";
|
|
73
76
|
export { default as LightsparkNodeToChannelsConnection } from "./LightsparkNodeToChannelsConnection.js";
|
|
77
|
+
export { default as LightsparkNodeWithOSK } from "./LightsparkNodeWithOSK.js";
|
|
78
|
+
export { default as LightsparkNodeWithRemoteSigning } from "./LightsparkNodeWithRemoteSigning.js";
|
|
74
79
|
export { default as Node } from "./Node.js";
|
|
75
80
|
export { default as NodeAddress } from "./NodeAddress.js";
|
|
76
81
|
export { default as NodeAddressType } from "./NodeAddressType.js";
|
|
@@ -83,10 +88,13 @@ export { default as OutgoingPayment } from "./OutgoingPayment.js";
|
|
|
83
88
|
export { default as OutgoingPaymentAttempt } from "./OutgoingPaymentAttempt.js";
|
|
84
89
|
export { default as OutgoingPaymentAttemptStatus } from "./OutgoingPaymentAttemptStatus.js";
|
|
85
90
|
export { default as OutgoingPaymentAttemptToHopsConnection } from "./OutgoingPaymentAttemptToHopsConnection.js";
|
|
91
|
+
export { default as OutgoingPaymentsForInvoiceQueryInput } from "./OutgoingPaymentsForInvoiceQueryInput.js";
|
|
92
|
+
export { default as OutgoingPaymentsForInvoiceQueryOutput } from "./OutgoingPaymentsForInvoiceQueryOutput.js";
|
|
86
93
|
export { default as OutgoingPaymentToAttemptsConnection } from "./OutgoingPaymentToAttemptsConnection.js";
|
|
87
94
|
export { default as PageInfo } from "./PageInfo.js";
|
|
88
95
|
export { default as PayInvoiceInput } from "./PayInvoiceInput.js";
|
|
89
96
|
export { default as PayInvoiceOutput } from "./PayInvoiceOutput.js";
|
|
97
|
+
export { default as PaymentDirection } from "./PaymentDirection.js";
|
|
90
98
|
export { default as PaymentFailureReason } from "./PaymentFailureReason.js";
|
|
91
99
|
export {
|
|
92
100
|
default as PaymentRequest,
|
|
@@ -94,7 +102,16 @@ export {
|
|
|
94
102
|
} from "./PaymentRequest.js";
|
|
95
103
|
export { default as PaymentRequestData } from "./PaymentRequestData.js";
|
|
96
104
|
export { default as PaymentRequestStatus } from "./PaymentRequestStatus.js";
|
|
105
|
+
export { default as PayUmaInvoiceInput } from "./PayUmaInvoiceInput.js";
|
|
97
106
|
export { default as Permission } from "./Permission.js";
|
|
107
|
+
export { default as PostTransactionData } from "./PostTransactionData.js";
|
|
108
|
+
export { default as RegisterPaymentInput } from "./RegisterPaymentInput.js";
|
|
109
|
+
export { default as RegisterPaymentOutput } from "./RegisterPaymentOutput.js";
|
|
110
|
+
export { default as ReleaseChannelPerCommitmentSecretInput } from "./ReleaseChannelPerCommitmentSecretInput.js";
|
|
111
|
+
export { default as ReleaseChannelPerCommitmentSecretOutput } from "./ReleaseChannelPerCommitmentSecretOutput.js";
|
|
112
|
+
export { default as ReleasePaymentPreimageInput } from "./ReleasePaymentPreimageInput.js";
|
|
113
|
+
export { default as ReleasePaymentPreimageOutput } from "./ReleasePaymentPreimageOutput.js";
|
|
114
|
+
export { default as RemoteSigningSubEventType } from "./RemoteSigningSubEventType.js";
|
|
98
115
|
export { default as RequestWithdrawalInput } from "./RequestWithdrawalInput.js";
|
|
99
116
|
export { default as RequestWithdrawalOutput } from "./RequestWithdrawalOutput.js";
|
|
100
117
|
export { default as RichText } from "./RichText.js";
|
|
@@ -104,17 +121,33 @@ export {
|
|
|
104
121
|
getRoutingTransactionQuery,
|
|
105
122
|
} from "./RoutingTransaction.js";
|
|
106
123
|
export { default as RoutingTransactionFailureReason } from "./RoutingTransactionFailureReason.js";
|
|
107
|
-
export { default as
|
|
108
|
-
export { default as
|
|
124
|
+
export { default as ScreenNodeInput } from "./ScreenNodeInput.js";
|
|
125
|
+
export { default as ScreenNodeOutput } from "./ScreenNodeOutput.js";
|
|
109
126
|
export { default as Secret } from "./Secret.js";
|
|
110
127
|
export { default as SendPaymentInput } from "./SendPaymentInput.js";
|
|
111
128
|
export { default as SendPaymentOutput } from "./SendPaymentOutput.js";
|
|
129
|
+
export { default as SetInvoicePaymentHashInput } from "./SetInvoicePaymentHashInput.js";
|
|
130
|
+
export { default as SetInvoicePaymentHashOutput } from "./SetInvoicePaymentHashOutput.js";
|
|
131
|
+
export { default as Signable, getSignableQuery } from "./Signable.js";
|
|
132
|
+
export {
|
|
133
|
+
default as SignablePayload,
|
|
134
|
+
getSignablePayloadQuery,
|
|
135
|
+
} from "./SignablePayload.js";
|
|
136
|
+
export { default as SignablePayloadStatus } from "./SignablePayloadStatus.js";
|
|
137
|
+
export { default as SignInvoiceInput } from "./SignInvoiceInput.js";
|
|
138
|
+
export { default as SignInvoiceOutput } from "./SignInvoiceOutput.js";
|
|
139
|
+
export { default as SignMessagesInput } from "./SignMessagesInput.js";
|
|
140
|
+
export { default as SignMessagesOutput } from "./SignMessagesOutput.js";
|
|
112
141
|
export { default as SingleNodeDashboard } from "./SingleNodeDashboard.js";
|
|
113
142
|
export { default as Transaction, getTransactionQuery } from "./Transaction.js";
|
|
114
143
|
export { default as TransactionFailures } from "./TransactionFailures.js";
|
|
115
144
|
export { default as TransactionStatus } from "./TransactionStatus.js";
|
|
116
145
|
export { default as TransactionType } from "./TransactionType.js";
|
|
117
146
|
export { default as TransactionUpdate } from "./TransactionUpdate.js";
|
|
147
|
+
export { default as UpdateChannelPerCommitmentPointInput } from "./UpdateChannelPerCommitmentPointInput.js";
|
|
148
|
+
export { default as UpdateChannelPerCommitmentPointOutput } from "./UpdateChannelPerCommitmentPointOutput.js";
|
|
149
|
+
export { default as UpdateNodeSharedSecretInput } from "./UpdateNodeSharedSecretInput.js";
|
|
150
|
+
export { default as UpdateNodeSharedSecretOutput } from "./UpdateNodeSharedSecretOutput.js";
|
|
118
151
|
export { default as Wallet } from "./Wallet.js";
|
|
119
152
|
export { default as WalletStatus } from "./WalletStatus.js";
|
|
120
153
|
export { default as WalletToPaymentRequestsConnection } from "./WalletToPaymentRequestsConnection.js";
|
package/src/webhooks.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface WebhookEvent {
|
|
|
14
14
|
export const verifyAndParseWebhook = (
|
|
15
15
|
data: Uint8Array,
|
|
16
16
|
hexdigest: string,
|
|
17
|
-
webhook_secret: string
|
|
17
|
+
webhook_secret: string,
|
|
18
18
|
): Promise<WebhookEvent> => {
|
|
19
19
|
const sig = createHmac("sha256", webhook_secret).update(data).digest("hex");
|
|
20
20
|
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
-
|
|
3
|
-
import CryptoSanctionsScreeningProvider from "./CryptoSanctionsScreeningProvider.js";
|
|
4
|
-
|
|
5
|
-
type ScreenBitcoinAddressesInput = {
|
|
6
|
-
provider: CryptoSanctionsScreeningProvider;
|
|
7
|
-
|
|
8
|
-
addresses: string[];
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const ScreenBitcoinAddressesInputFromJson = (
|
|
12
|
-
obj: any
|
|
13
|
-
): ScreenBitcoinAddressesInput => {
|
|
14
|
-
return {
|
|
15
|
-
provider:
|
|
16
|
-
CryptoSanctionsScreeningProvider[
|
|
17
|
-
obj["screen_bitcoin_addresses_input_provider"]
|
|
18
|
-
] ?? CryptoSanctionsScreeningProvider.FUTURE_VALUE,
|
|
19
|
-
addresses: obj["screen_bitcoin_addresses_input_addresses"],
|
|
20
|
-
} as ScreenBitcoinAddressesInput;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default ScreenBitcoinAddressesInput;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
-
|
|
3
|
-
import RiskRating from "./RiskRating.js";
|
|
4
|
-
|
|
5
|
-
type ScreenBitcoinAddressesOutput = {
|
|
6
|
-
ratings: RiskRating[];
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const ScreenBitcoinAddressesOutputFromJson = (
|
|
10
|
-
obj: any
|
|
11
|
-
): ScreenBitcoinAddressesOutput => {
|
|
12
|
-
return {
|
|
13
|
-
ratings: obj["screen_bitcoin_addresses_output_ratings"].map(
|
|
14
|
-
(e) => RiskRating[e]
|
|
15
|
-
),
|
|
16
|
-
} as ScreenBitcoinAddressesOutput;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const FRAGMENT = `
|
|
20
|
-
fragment ScreenBitcoinAddressesOutputFragment on ScreenBitcoinAddressesOutput {
|
|
21
|
-
__typename
|
|
22
|
-
screen_bitcoin_addresses_output_ratings: ratings
|
|
23
|
-
}`;
|
|
24
|
-
|
|
25
|
-
export default ScreenBitcoinAddressesOutput;
|