@lightsparkdev/lightspark-sdk 1.5.13 → 1.6.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 +15 -0
- package/dist/{chunk-FGFVWCTL.js → chunk-UHTZSOPX.js} +272 -144
- package/dist/{index-2b493387.d.ts → index-145ff316.d.ts} +232 -87
- package/dist/index.cjs +351 -142
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +85 -3
- package/dist/objects/index.cjs +262 -133
- package/dist/objects/index.d.cts +1 -1
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +3 -1
- package/package.json +2 -2
- package/src/client.ts +62 -0
- package/src/graphql/InvoiceForPaymentHash.ts +17 -0
- package/src/graphql/OutgoingPaymentsForPaymentHash.ts +21 -0
- package/src/objects/Account.ts +14 -2
- package/src/objects/ChannelClosingTransaction.ts +1 -4
- package/src/objects/ChannelOpeningTransaction.ts +1 -4
- package/src/objects/Connection.ts +116 -0
- package/src/objects/Deposit.ts +1 -4
- package/src/objects/Entity.ts +10 -0
- package/src/objects/FailHtlcsInput.ts +27 -0
- package/src/objects/FailHtlcsOutput.ts +26 -0
- package/src/objects/InvoiceForPaymentHashInput.ts +23 -0
- package/src/objects/InvoiceForPaymentHashOutput.ts +30 -0
- package/src/objects/LightningTransaction.ts +3 -0
- package/src/objects/LightsparkNode.ts +3 -1
- package/src/objects/LightsparkNodeWithOSK.ts +8 -4
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +8 -4
- package/src/objects/OnChainFeeTarget.ts +19 -0
- package/src/objects/OnChainTransaction.ts +1 -4
- package/src/objects/OutgoingPayment.ts +5 -0
- package/src/objects/OutgoingPaymentForIdempotencyKeyInput.ts +24 -0
- package/src/objects/OutgoingPaymentForIdempotencyKeyOutput.ts +33 -0
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +1 -0
- package/src/objects/OutgoingPaymentsForPaymentHashQueryInput.ts +34 -0
- package/src/objects/OutgoingPaymentsForPaymentHashQueryOutput.ts +37 -0
- package/src/objects/PayInvoiceInput.ts +8 -0
- package/src/objects/PayUmaInvoiceInput.ts +4 -0
- package/src/objects/PaymentFailureReason.ts +2 -0
- package/src/objects/RemoteSigningSubEventType.ts +2 -0
- package/src/objects/RequestWithdrawalInput.ts +29 -0
- package/src/objects/SendPaymentInput.ts +8 -0
- package/src/objects/Transaction.ts +3 -0
- package/src/objects/TransactionStatus.ts +1 -1
- package/src/objects/Wallet.ts +10 -0
- package/src/objects/Withdrawal.ts +1 -4
- package/src/objects/WithdrawalRequest.ts +107 -11
- package/src/objects/WithdrawalRequestStatus.ts +2 -0
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +15 -10
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +15 -10
- package/src/objects/WithdrawalRequestToWithdrawalsConnection.ts +47 -0
- package/src/objects/index.ts +10 -0
- package/src/webhooks.ts +3 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthProvider } from '@lightsparkdev/core';
|
|
2
|
-
import { W as WebhookEventType, L as LightsparkClient } from './index-
|
|
3
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as
|
|
2
|
+
import { W as WebhookEventType, L as LightsparkClient } from './index-145ff316.js';
|
|
3
|
+
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as FailHtlcsInput, a7 as FailHtlcsOutput, a8 as FeeEstimate, a9 as FundNodeInput, aa as FundNodeOutput, ab as GraphNode, ac as Hop, ae as HtlcAttemptFailureCode, af as IdAndSignature, ag as IncentivesIneligibilityReason, ah as IncentivesStatus, ai as IncomingPayment, aj as IncomingPaymentAttempt, al as IncomingPaymentAttemptStatus, am as IncomingPaymentToAttemptsConnection, an as IncomingPaymentsForInvoiceQueryInput, ao as IncomingPaymentsForInvoiceQueryOutput, ap as Invoice, ar as InvoiceData, as as InvoiceForPaymentHashInput, at as InvoiceForPaymentHashOutput, au as InvoiceType, av as LightningFeeEstimateForInvoiceInput, aw as LightningFeeEstimateForNodeInput, ax as LightningFeeEstimateOutput, ay as LightningPaymentDirection, az as LightningTransaction, aB as LightsparkNode, aD as LightsparkNodeOwner, aF as LightsparkNodeStatus, aG as LightsparkNodeToChannelsConnection, aH as LightsparkNodeToDailyLiquidityForecastsConnection, aI as LightsparkNodeWithOSK, aJ as LightsparkNodeWithRemoteSigning, aK as MultiSigAddressValidationParameters, aL as Node, aN as NodeAddress, aO as NodeAddressType, aP as NodeToAddressesConnection, aQ as OnChainFeeTarget, aR as OnChainTransaction, aT as OutgoingPayment, aU as OutgoingPaymentAttempt, aV as OutgoingPaymentAttemptStatus, aW as OutgoingPaymentAttemptToHopsConnection, aX as OutgoingPaymentForIdempotencyKeyInput, aY as OutgoingPaymentForIdempotencyKeyOutput, aZ as OutgoingPaymentToAttemptsConnection, a_ as OutgoingPaymentsForInvoiceQueryInput, a$ as OutgoingPaymentsForInvoiceQueryOutput, b0 as OutgoingPaymentsForPaymentHashQueryInput, b1 as OutgoingPaymentsForPaymentHashQueryOutput, b2 as PageInfo, b3 as PayInvoiceInput, b4 as PayInvoiceOutput, b5 as PayUmaInvoiceInput, b6 as PaymentDirection, b7 as PaymentFailureReason, b8 as PaymentRequest, ba as PaymentRequestData, bb as PaymentRequestStatus, bc as Permission, bd as PostTransactionData, be as RegionCode, bf as RegisterPaymentInput, bg as RegisterPaymentOutput, bh as ReleaseChannelPerCommitmentSecretInput, bi as ReleaseChannelPerCommitmentSecretOutput, bj as ReleasePaymentPreimageInput, bk as ReleasePaymentPreimageOutput, bl as RemoteSigningSubEventType, bm as RequestWithdrawalInput, bn as RequestWithdrawalOutput, bo as RichText, bp as RiskRating, bq as RoutingTransaction, bs as RoutingTransactionFailureReason, bt as ScreenNodeInput, bu as ScreenNodeOutput, bv as Secret, bw as SendPaymentInput, bx as SendPaymentOutput, by as SetInvoicePaymentHashInput, bz as SetInvoicePaymentHashOutput, bA as SignInvoiceInput, bB as SignInvoiceOutput, bC as SignMessagesInput, bD as SignMessagesOutput, bE as Signable, bG as SignablePayload, bI as SignablePayloadStatus, bJ as SingleNodeDashboard, bK as Transaction, bM as TransactionFailures, bN as TransactionStatus, bO as TransactionType, bP as TransactionUpdate, bQ as UmaInvitation, bS as UpdateChannelPerCommitmentPointInput, bT as UpdateChannelPerCommitmentPointOutput, bU as UpdateNodeSharedSecretInput, bV as UpdateNodeSharedSecretOutput, bW as Wallet, bX as WalletStatus, bY as WalletToPaymentRequestsConnection, bZ as WalletToTransactionsConnection, b_ as WalletToWithdrawalRequestsConnection, b$ as Withdrawal, c1 as WithdrawalFeeEstimateInput, c2 as WithdrawalFeeEstimateOutput, c3 as WithdrawalMode, c4 as WithdrawalRequest, c5 as WithdrawalRequestStatus, c6 as WithdrawalRequestToChannelClosingTransactionsConnection, c7 as WithdrawalRequestToChannelOpeningTransactionsConnection, c8 as WithdrawalRequestToWithdrawalsConnection, i as getApiTokenQuery, k as getAuditLogActorQuery, p as getChannelClosingTransactionQuery, s as getChannelOpeningTransactionQuery, u as getChannelSnapshotQuery, a4 as getDepositQuery, ad as getHopQuery, ak as getIncomingPaymentAttemptQuery, aq as getInvoiceQuery, aA as getLightningTransactionQuery, aE as getLightsparkNodeOwnerQuery, aC as getLightsparkNodeQuery, aM as getNodeQuery, aS as getOnChainTransactionQuery, b9 as getPaymentRequestQuery, br as getRoutingTransactionQuery, bH as getSignablePayloadQuery, bF as getSignableQuery, bL as getTransactionQuery, bR as getUmaInvitationQuery, c0 as getWithdrawalQuery } from './index-145ff316.js';
|
|
4
4
|
import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
|
|
5
5
|
import 'zen-observable';
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AuthProvider } from '@lightsparkdev/core';
|
|
2
|
-
import { W as WebhookEventType, L as LightsparkClient } from './index-
|
|
3
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as
|
|
2
|
+
import { W as WebhookEventType, L as LightsparkClient } from './index-145ff316.js';
|
|
3
|
+
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as AccountToWithdrawalRequestsConnection, h as ApiToken, j as AuditLogActor, B as Balances, l as BlockchainBalance, C as CancelInvoiceInput, m as CancelInvoiceOutput, n as Channel, o as ChannelClosingTransaction, q as ChannelFees, r as ChannelOpeningTransaction, t as ChannelSnapshot, v as ChannelStatus, w as ChannelToTransactionsConnection, x as ClaimUmaInvitationInput, y as ClaimUmaInvitationOutput, z as ClaimUmaInvitationWithIncentivesInput, D as ClaimUmaInvitationWithIncentivesOutput, E as ComplianceProvider, F as Connection, G as CreateApiTokenInput, H as CreateApiTokenOutput, I as CreateInvitationWithIncentivesInput, J as CreateInvitationWithIncentivesOutput, K as CreateInvoiceInput, M as CreateInvoiceOutput, N as CreateLnurlInvoiceInput, O as CreateNodeWalletAddressInput, P as CreateNodeWalletAddressOutput, Q as CreateTestModeInvoiceInput, R as CreateTestModeInvoiceOutput, S as CreateTestModePaymentInput, T as CreateTestModePaymentoutput, U as CreateUmaInvitationInput, V as CreateUmaInvitationOutput, X as CreateUmaInvoiceInput, Y as CurrencyAmount, Z as CurrencyUnit, _ as DailyLiquidityForecast, $ as DeclineToSignMessagesInput, a0 as DeclineToSignMessagesOutput, a1 as DeleteApiTokenInput, a2 as DeleteApiTokenOutput, a3 as Deposit, a5 as Entity, a6 as FailHtlcsInput, a7 as FailHtlcsOutput, a8 as FeeEstimate, a9 as FundNodeInput, aa as FundNodeOutput, ab as GraphNode, ac as Hop, ae as HtlcAttemptFailureCode, af as IdAndSignature, ag as IncentivesIneligibilityReason, ah as IncentivesStatus, ai as IncomingPayment, aj as IncomingPaymentAttempt, al as IncomingPaymentAttemptStatus, am as IncomingPaymentToAttemptsConnection, an as IncomingPaymentsForInvoiceQueryInput, ao as IncomingPaymentsForInvoiceQueryOutput, ap as Invoice, ar as InvoiceData, as as InvoiceForPaymentHashInput, at as InvoiceForPaymentHashOutput, au as InvoiceType, av as LightningFeeEstimateForInvoiceInput, aw as LightningFeeEstimateForNodeInput, ax as LightningFeeEstimateOutput, ay as LightningPaymentDirection, az as LightningTransaction, aB as LightsparkNode, aD as LightsparkNodeOwner, aF as LightsparkNodeStatus, aG as LightsparkNodeToChannelsConnection, aH as LightsparkNodeToDailyLiquidityForecastsConnection, aI as LightsparkNodeWithOSK, aJ as LightsparkNodeWithRemoteSigning, aK as MultiSigAddressValidationParameters, aL as Node, aN as NodeAddress, aO as NodeAddressType, aP as NodeToAddressesConnection, aQ as OnChainFeeTarget, aR as OnChainTransaction, aT as OutgoingPayment, aU as OutgoingPaymentAttempt, aV as OutgoingPaymentAttemptStatus, aW as OutgoingPaymentAttemptToHopsConnection, aX as OutgoingPaymentForIdempotencyKeyInput, aY as OutgoingPaymentForIdempotencyKeyOutput, aZ as OutgoingPaymentToAttemptsConnection, a_ as OutgoingPaymentsForInvoiceQueryInput, a$ as OutgoingPaymentsForInvoiceQueryOutput, b0 as OutgoingPaymentsForPaymentHashQueryInput, b1 as OutgoingPaymentsForPaymentHashQueryOutput, b2 as PageInfo, b3 as PayInvoiceInput, b4 as PayInvoiceOutput, b5 as PayUmaInvoiceInput, b6 as PaymentDirection, b7 as PaymentFailureReason, b8 as PaymentRequest, ba as PaymentRequestData, bb as PaymentRequestStatus, bc as Permission, bd as PostTransactionData, be as RegionCode, bf as RegisterPaymentInput, bg as RegisterPaymentOutput, bh as ReleaseChannelPerCommitmentSecretInput, bi as ReleaseChannelPerCommitmentSecretOutput, bj as ReleasePaymentPreimageInput, bk as ReleasePaymentPreimageOutput, bl as RemoteSigningSubEventType, bm as RequestWithdrawalInput, bn as RequestWithdrawalOutput, bo as RichText, bp as RiskRating, bq as RoutingTransaction, bs as RoutingTransactionFailureReason, bt as ScreenNodeInput, bu as ScreenNodeOutput, bv as Secret, bw as SendPaymentInput, bx as SendPaymentOutput, by as SetInvoicePaymentHashInput, bz as SetInvoicePaymentHashOutput, bA as SignInvoiceInput, bB as SignInvoiceOutput, bC as SignMessagesInput, bD as SignMessagesOutput, bE as Signable, bG as SignablePayload, bI as SignablePayloadStatus, bJ as SingleNodeDashboard, bK as Transaction, bM as TransactionFailures, bN as TransactionStatus, bO as TransactionType, bP as TransactionUpdate, bQ as UmaInvitation, bS as UpdateChannelPerCommitmentPointInput, bT as UpdateChannelPerCommitmentPointOutput, bU as UpdateNodeSharedSecretInput, bV as UpdateNodeSharedSecretOutput, bW as Wallet, bX as WalletStatus, bY as WalletToPaymentRequestsConnection, bZ as WalletToTransactionsConnection, b_ as WalletToWithdrawalRequestsConnection, b$ as Withdrawal, c1 as WithdrawalFeeEstimateInput, c2 as WithdrawalFeeEstimateOutput, c3 as WithdrawalMode, c4 as WithdrawalRequest, c5 as WithdrawalRequestStatus, c6 as WithdrawalRequestToChannelClosingTransactionsConnection, c7 as WithdrawalRequestToChannelOpeningTransactionsConnection, c8 as WithdrawalRequestToWithdrawalsConnection, i as getApiTokenQuery, k as getAuditLogActorQuery, p as getChannelClosingTransactionQuery, s as getChannelOpeningTransactionQuery, u as getChannelSnapshotQuery, a4 as getDepositQuery, ad as getHopQuery, ak as getIncomingPaymentAttemptQuery, aq as getInvoiceQuery, aA as getLightningTransactionQuery, aE as getLightsparkNodeOwnerQuery, aC as getLightsparkNodeQuery, aM as getNodeQuery, aS as getOnChainTransactionQuery, b9 as getPaymentRequestQuery, br as getRoutingTransactionQuery, bH as getSignablePayloadQuery, bF as getSignableQuery, bL as getTransactionQuery, bR as getUmaInvitationQuery, c0 as getWithdrawalQuery } from './index-145ff316.js';
|
|
4
4
|
import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
|
|
5
5
|
import 'zen-observable';
|
|
6
6
|
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
LightsparkNodeWithOSK_default,
|
|
42
42
|
LightsparkNodeWithRemoteSigning_default,
|
|
43
43
|
NodeAddressType_default,
|
|
44
|
+
OnChainFeeTarget_default,
|
|
44
45
|
OutgoingPaymentAttemptStatus_default,
|
|
45
46
|
OutgoingPaymentAttempt_default,
|
|
46
47
|
OutgoingPaymentFromJson,
|
|
@@ -91,7 +92,7 @@ import {
|
|
|
91
92
|
getTransactionQuery,
|
|
92
93
|
getUmaInvitationQuery,
|
|
93
94
|
getWithdrawalQuery
|
|
94
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-UHTZSOPX.js";
|
|
95
96
|
import {
|
|
96
97
|
BitcoinNetwork_default
|
|
97
98
|
} from "./chunk-K6SAUSAX.js";
|
|
@@ -147,7 +148,7 @@ import {
|
|
|
147
148
|
// package.json
|
|
148
149
|
var package_default = {
|
|
149
150
|
name: "@lightsparkdev/lightspark-sdk",
|
|
150
|
-
version: "1.
|
|
151
|
+
version: "1.6.0",
|
|
151
152
|
description: "Lightspark JS SDK",
|
|
152
153
|
author: "Lightspark Inc.",
|
|
153
154
|
keywords: [
|
|
@@ -233,7 +234,7 @@ var package_default = {
|
|
|
233
234
|
license: "Apache-2.0",
|
|
234
235
|
dependencies: {
|
|
235
236
|
"@lightsparkdev/core": "1.1.0",
|
|
236
|
-
"@lightsparkdev/crypto-wasm": "0.1.
|
|
237
|
+
"@lightsparkdev/crypto-wasm": "0.1.4",
|
|
237
238
|
"crypto-browserify": "^3.12.0",
|
|
238
239
|
dayjs: "^1.11.7",
|
|
239
240
|
dotenv: "^16.3.1",
|
|
@@ -749,6 +750,21 @@ var FundNode = `
|
|
|
749
750
|
${FRAGMENT}
|
|
750
751
|
`;
|
|
751
752
|
|
|
753
|
+
// src/graphql/InvoiceForPaymentHash.ts
|
|
754
|
+
var InvoiceForPaymentHash = `
|
|
755
|
+
query InvoiceForPaymentHash($payment_hash: Hash32!) {
|
|
756
|
+
invoice_for_payment_hash(input: {
|
|
757
|
+
payment_hash: $payment_hash
|
|
758
|
+
}) {
|
|
759
|
+
invoice {
|
|
760
|
+
...InvoiceFragment
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
${FRAGMENT4}
|
|
766
|
+
`;
|
|
767
|
+
|
|
752
768
|
// src/graphql/LightningFeeEstimateForInvoice.ts
|
|
753
769
|
var LightningFeeEstimateForInvoice = `
|
|
754
770
|
query LightningFeeEstimateForInvoice(
|
|
@@ -862,6 +878,25 @@ var MultiNodeDashboard = `
|
|
|
862
878
|
${FRAGMENT}
|
|
863
879
|
`;
|
|
864
880
|
|
|
881
|
+
// src/graphql/OutgoingPaymentsForPaymentHash.ts
|
|
882
|
+
var OutgoingPaymentsForPaymentHash = `
|
|
883
|
+
query OutgoingPaymentsForPaymentHash(
|
|
884
|
+
$payment_hash: Hash32!
|
|
885
|
+
$statuses: [TransactionStatus!]
|
|
886
|
+
) {
|
|
887
|
+
outgoing_payments_for_payment_hash(input: {
|
|
888
|
+
payment_hash: $payment_hash
|
|
889
|
+
statuses: $statuses
|
|
890
|
+
}) {
|
|
891
|
+
payments {
|
|
892
|
+
...OutgoingPaymentFragment
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
${FRAGMENT9}
|
|
898
|
+
`;
|
|
899
|
+
|
|
865
900
|
// src/graphql/PayInvoice.ts
|
|
866
901
|
var PayInvoice = `
|
|
867
902
|
mutation PayInvoice(
|
|
@@ -2263,6 +2298,49 @@ var LightsparkClient = class {
|
|
|
2263
2298
|
}
|
|
2264
2299
|
});
|
|
2265
2300
|
}
|
|
2301
|
+
/**
|
|
2302
|
+
* Fetches a created invoice by its payment hash.
|
|
2303
|
+
*
|
|
2304
|
+
* @param paymentHash
|
|
2305
|
+
* @returns The invoice if there is one corresponding to the payment hash, or null if no invoice exists with that payment hash.
|
|
2306
|
+
*/
|
|
2307
|
+
async invoiceForPaymentHash(paymentHash) {
|
|
2308
|
+
return await this.executeRawQuery({
|
|
2309
|
+
queryPayload: InvoiceForPaymentHash,
|
|
2310
|
+
variables: {
|
|
2311
|
+
payment_hash: paymentHash
|
|
2312
|
+
},
|
|
2313
|
+
constructObject: (responseJson) => {
|
|
2314
|
+
if (!responseJson.invoice_for_payment_hash || !responseJson.invoice_for_payment_hash.invoice) {
|
|
2315
|
+
return null;
|
|
2316
|
+
}
|
|
2317
|
+
return InvoiceFromJson(responseJson.invoice_for_payment_hash.invoice);
|
|
2318
|
+
}
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2321
|
+
/**
|
|
2322
|
+
* Fetches outgoing payments for a given payment hash if there are any.
|
|
2323
|
+
*
|
|
2324
|
+
* @param paymentHash
|
|
2325
|
+
* @param statuses Filter to only include payments with the given statuses. If not provided, all statuses are included.
|
|
2326
|
+
*/
|
|
2327
|
+
async outgoingPaymentsForPaymentHash(paymentHash, statuses = void 0) {
|
|
2328
|
+
return await this.executeRawQuery({
|
|
2329
|
+
queryPayload: OutgoingPaymentsForPaymentHash,
|
|
2330
|
+
variables: {
|
|
2331
|
+
payment_hash: paymentHash,
|
|
2332
|
+
statuses
|
|
2333
|
+
},
|
|
2334
|
+
constructObject: (responseJson) => {
|
|
2335
|
+
if (!responseJson.outgoing_payments_for_payment_hash || !responseJson.outgoing_payments_for_payment_hash.payments) {
|
|
2336
|
+
return [];
|
|
2337
|
+
}
|
|
2338
|
+
return responseJson.outgoing_payments_for_payment_hash.payments.map(
|
|
2339
|
+
(payment) => OutgoingPaymentFromJson(payment)
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2266
2344
|
async hashPhoneNumber(e164PhoneNumber) {
|
|
2267
2345
|
const e164PhoneRegex = /^\+[1-9]\d{1,14}$/;
|
|
2268
2346
|
if (!e164PhoneRegex.test(e164PhoneNumber)) {
|
|
@@ -2339,6 +2417,9 @@ var RemoteSigningWebhookHandler = class {
|
|
|
2339
2417
|
this.#masterSeed,
|
|
2340
2418
|
this.validator
|
|
2341
2419
|
);
|
|
2420
|
+
if (!response) {
|
|
2421
|
+
return;
|
|
2422
|
+
}
|
|
2342
2423
|
const variables = JSON.parse(response.variables);
|
|
2343
2424
|
return this.client.executeRawQuery({
|
|
2344
2425
|
queryPayload: response.query,
|
|
@@ -2368,6 +2449,7 @@ export {
|
|
|
2368
2449
|
LightsparkNodeWithOSK_default as LightsparkNodeWithOSK,
|
|
2369
2450
|
LightsparkNodeWithRemoteSigning_default as LightsparkNodeWithRemoteSigning,
|
|
2370
2451
|
NodeAddressType_default as NodeAddressType,
|
|
2452
|
+
OnChainFeeTarget_default as OnChainFeeTarget,
|
|
2371
2453
|
OutgoingPayment_default as OutgoingPayment,
|
|
2372
2454
|
OutgoingPaymentAttempt_default as OutgoingPaymentAttempt,
|
|
2373
2455
|
OutgoingPaymentAttemptStatus_default as OutgoingPaymentAttemptStatus,
|