@lightsparkdev/lightspark-sdk 1.3.1 → 1.5.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 +13 -0
- package/dist/{BitcoinNetwork-972b1d01.d.ts → BitcoinNetwork-4f6ea015.d.ts} +2 -2
- package/dist/{chunk-Y55D3PD4.js → chunk-ENYS5WAU.js} +712 -476
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-a5028d74.d.ts → index-f100aa27.d.ts} +726 -702
- package/dist/index.cjs +402 -24
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +148 -2
- package/dist/objects/index.cjs +1339 -1126
- package/dist/objects/index.d.cts +2 -2
- package/dist/objects/index.d.ts +2 -2
- package/dist/objects/index.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +121 -1
- package/src/graphql/RegisterPayment.ts +21 -0
- package/src/graphql/ScreenNode.ts +15 -0
- package/src/graphql/WithdrawalFeeEstimate.ts +21 -0
- package/src/objects/Account.ts +98 -5
- package/src/objects/AccountToApiTokensConnection.ts +2 -3
- package/src/objects/AccountToChannelsConnection.ts +2 -3
- package/src/objects/AccountToNodesConnection.ts +2 -3
- package/src/objects/AccountToPaymentRequestsConnection.ts +2 -3
- package/src/objects/AccountToTransactionsConnection.ts +6 -7
- package/src/objects/AccountToWalletsConnection.ts +2 -3
- package/src/objects/AccountToWithdrawalRequestsConnection.ts +71 -0
- package/src/objects/ApiToken.ts +5 -6
- package/src/objects/Balances.ts +9 -12
- package/src/objects/BitcoinNetwork.ts +2 -2
- package/src/objects/Channel.ts +7 -10
- package/src/objects/ChannelClosingTransaction.ts +3 -4
- package/src/objects/ChannelOpeningTransaction.ts +3 -4
- package/src/objects/ChannelStatus.ts +5 -9
- package/src/objects/ChannelToTransactionsConnection.ts +6 -7
- package/src/objects/Connection.ts +85 -3
- package/src/objects/CreateApiTokenOutput.ts +3 -3
- package/src/objects/CreateLnurlInvoiceInput.ts +2 -3
- package/src/objects/CreateTestModePaymentInput.ts +2 -2
- package/src/objects/CreateTestModePaymentoutput.ts +2 -3
- package/src/objects/CurrencyUnit.ts +11 -17
- package/src/objects/Deposit.ts +5 -6
- package/src/objects/Entity.ts +21 -6
- package/src/objects/FeeEstimate.ts +2 -3
- package/src/objects/GraphNode.ts +10 -12
- package/src/objects/Hop.ts +5 -6
- package/src/objects/IncentivesStatus.ts +2 -3
- package/src/objects/IncomingPayment.ts +7 -7
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +4 -5
- package/src/objects/LightningTransaction.ts +5 -5
- package/src/objects/LightsparkNode.ts +8 -10
- package/src/objects/LightsparkNodeOwner.ts +2 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +2 -3
- package/src/objects/LightsparkNodeWithOSK.ts +7 -8
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +7 -8
- package/src/objects/Node.ts +9 -11
- package/src/objects/NodeToAddressesConnection.ts +2 -3
- package/src/objects/OnChainTransaction.ts +5 -6
- package/src/objects/OutgoingPayment.ts +5 -6
- package/src/objects/OutgoingPaymentAttempt.ts +12 -14
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +2 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +2 -3
- package/src/objects/PageInfo.ts +3 -3
- package/src/objects/PaymentRequest.ts +2 -2
- package/src/objects/PaymentRequestData.ts +1 -2
- package/src/objects/RegisterPaymentInput.ts +7 -8
- package/src/objects/RequestWithdrawalInput.ts +2 -2
- package/src/objects/RiskRating.ts +1 -2
- package/src/objects/RoutingTransaction.ts +6 -8
- package/src/objects/ScreenNodeInput.ts +2 -3
- package/src/objects/SetInvoicePaymentHashInput.ts +2 -3
- package/src/objects/Signable.ts +2 -2
- package/src/objects/SignablePayload.ts +2 -2
- package/src/objects/Transaction.ts +3 -4
- package/src/objects/TransactionStatus.ts +1 -2
- package/src/objects/UmaInvitation.ts +2 -2
- package/src/objects/Wallet.ts +97 -8
- package/src/objects/WalletStatus.ts +5 -7
- package/src/objects/WalletToPaymentRequestsConnection.ts +2 -3
- package/src/objects/WalletToTransactionsConnection.ts +2 -3
- package/src/objects/WalletToWithdrawalRequestsConnection.ts +70 -0
- package/src/objects/Withdrawal.ts +5 -5
- package/src/objects/WithdrawalFeeEstimateInput.ts +40 -0
- package/src/objects/WithdrawalFeeEstimateOutput.ts +46 -0
- package/src/objects/WithdrawalRequest.ts +43 -7
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -3
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -3
- package/src/objects/index.ts +4 -0
- package/src/tests/integration/general-regtest.test.ts +9 -0
package/dist/objects/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances,
|
|
2
|
-
export { B as BitcoinNetwork } from '../BitcoinNetwork-
|
|
1
|
+
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, B as Balances, j as BlockchainBalance, C as CancelInvoiceInput, k as CancelInvoiceOutput, l as Channel, m as ChannelClosingTransaction, o as ChannelFees, p as ChannelOpeningTransaction, r as ChannelSnapshot, s as ChannelStatus, t as ChannelToTransactionsConnection, u as ClaimUmaInvitationInput, v as ClaimUmaInvitationOutput, w as ClaimUmaInvitationWithIncentivesInput, x as ClaimUmaInvitationWithIncentivesOutput, y as ComplianceProvider, z as Connection, D as CreateApiTokenInput, E as CreateApiTokenOutput, F as CreateInvitationWithIncentivesInput, G as CreateInvitationWithIncentivesOutput, H as CreateInvoiceInput, I as CreateInvoiceOutput, J as CreateLnurlInvoiceInput, K as CreateNodeWalletAddressInput, M as CreateNodeWalletAddressOutput, N as CreateTestModeInvoiceInput, O as CreateTestModeInvoiceOutput, P as CreateTestModePaymentInput, Q as CreateTestModePaymentoutput, R as CreateUmaInvitationInput, S as CreateUmaInvitationOutput, T as CreateUmaInvoiceInput, U as CurrencyAmount, V as CurrencyUnit, X as DeclineToSignMessagesInput, Y as DeclineToSignMessagesOutput, Z as DeleteApiTokenInput, _ as DeleteApiTokenOutput, $ as Deposit, a1 as Entity, a2 as FeeEstimate, a3 as FundNodeInput, a4 as FundNodeOutput, a5 as GraphNode, a6 as Hop, a8 as HtlcAttemptFailureCode, a9 as IdAndSignature, aa as IncentivesIneligibilityReason, ab as IncentivesStatus, ac as IncomingPayment, ad as IncomingPaymentAttempt, af as IncomingPaymentAttemptStatus, ag as IncomingPaymentToAttemptsConnection, ah as Invoice, aj as InvoiceData, ak as InvoiceType, al as LightningFeeEstimateForInvoiceInput, am as LightningFeeEstimateForNodeInput, an as LightningFeeEstimateOutput, ao as LightningTransaction, aq as LightsparkNode, as as LightsparkNodeOwner, au as LightsparkNodeStatus, av as LightsparkNodeToChannelsConnection, aw as LightsparkNodeWithOSK, ax as LightsparkNodeWithRemoteSigning, ay as Node, aA as NodeAddress, aB as NodeAddressType, aC as NodeToAddressesConnection, aD as OnChainTransaction, aF as OutgoingPayment, aG as OutgoingPaymentAttempt, aH as OutgoingPaymentAttemptStatus, aI as OutgoingPaymentAttemptToHopsConnection, aJ as OutgoingPaymentToAttemptsConnection, aK as OutgoingPaymentsForInvoiceQueryInput, aL as OutgoingPaymentsForInvoiceQueryOutput, aM as PageInfo, aN as PayInvoiceInput, aO as PayInvoiceOutput, aP as PayUmaInvoiceInput, aQ as PaymentDirection, aR as PaymentFailureReason, aS as PaymentRequest, aU as PaymentRequestData, aV as PaymentRequestStatus, aW as Permission, aX as PostTransactionData, aY as RegionCode, aZ as RegisterPaymentInput, a_ as RegisterPaymentOutput, a$ as ReleaseChannelPerCommitmentSecretInput, b0 as ReleaseChannelPerCommitmentSecretOutput, b1 as ReleasePaymentPreimageInput, b2 as ReleasePaymentPreimageOutput, b3 as RemoteSigningSubEventType, b4 as RequestWithdrawalInput, b5 as RequestWithdrawalOutput, b6 as RichText, b7 as RiskRating, b8 as RoutingTransaction, ba as RoutingTransactionFailureReason, bb as ScreenNodeInput, bc as ScreenNodeOutput, bd as Secret, be as SendPaymentInput, bf as SendPaymentOutput, bg as SetInvoicePaymentHashInput, bh as SetInvoicePaymentHashOutput, bi as SignInvoiceInput, bj as SignInvoiceOutput, bk as SignMessagesInput, bl as SignMessagesOutput, bm as Signable, bo as SignablePayload, bq as SignablePayloadStatus, br as SingleNodeDashboard, bs as Transaction, bu as TransactionFailures, bv as TransactionStatus, bw as TransactionType, bx as TransactionUpdate, by as UmaInvitation, bA as UpdateChannelPerCommitmentPointInput, bB as UpdateChannelPerCommitmentPointOutput, bC as UpdateNodeSharedSecretInput, bD as UpdateNodeSharedSecretOutput, bE as Wallet, bF as WalletStatus, bG as WalletToPaymentRequestsConnection, bH as WalletToTransactionsConnection, bI as WalletToWithdrawalRequestsConnection, W as WebhookEventType, bJ as Withdrawal, bL as WithdrawalFeeEstimateInput, bM as WithdrawalFeeEstimateOutput, bN as WithdrawalMode, bO as WithdrawalRequest, bP as WithdrawalRequestStatus, bQ as WithdrawalRequestToChannelClosingTransactionsConnection, bR as WithdrawalRequestToChannelOpeningTransactionsConnection, i as getApiTokenQuery, n as getChannelClosingTransactionQuery, q as getChannelOpeningTransactionQuery, a0 as getDepositQuery, a7 as getHopQuery, ae as getIncomingPaymentAttemptQuery, ai as getInvoiceQuery, ap as getLightningTransactionQuery, at as getLightsparkNodeOwnerQuery, ar as getLightsparkNodeQuery, az as getNodeQuery, aE as getOnChainTransactionQuery, aT as getPaymentRequestQuery, b9 as getRoutingTransactionQuery, bp as getSignablePayloadQuery, bn as getSignableQuery, bt as getTransactionQuery, bz as getUmaInvitationQuery, bK as getWithdrawalQuery } from '../index-f100aa27.js';
|
|
2
|
+
export { B as BitcoinNetwork } from '../BitcoinNetwork-4f6ea015.js';
|
|
3
3
|
import '@lightsparkdev/core';
|
|
4
4
|
import 'zen-observable';
|
package/dist/objects/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as AccountToWalletsConnection, g as ApiToken, B as Balances,
|
|
2
|
-
export { B as BitcoinNetwork } from '../BitcoinNetwork-
|
|
1
|
+
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, B as Balances, j as BlockchainBalance, C as CancelInvoiceInput, k as CancelInvoiceOutput, l as Channel, m as ChannelClosingTransaction, o as ChannelFees, p as ChannelOpeningTransaction, r as ChannelSnapshot, s as ChannelStatus, t as ChannelToTransactionsConnection, u as ClaimUmaInvitationInput, v as ClaimUmaInvitationOutput, w as ClaimUmaInvitationWithIncentivesInput, x as ClaimUmaInvitationWithIncentivesOutput, y as ComplianceProvider, z as Connection, D as CreateApiTokenInput, E as CreateApiTokenOutput, F as CreateInvitationWithIncentivesInput, G as CreateInvitationWithIncentivesOutput, H as CreateInvoiceInput, I as CreateInvoiceOutput, J as CreateLnurlInvoiceInput, K as CreateNodeWalletAddressInput, M as CreateNodeWalletAddressOutput, N as CreateTestModeInvoiceInput, O as CreateTestModeInvoiceOutput, P as CreateTestModePaymentInput, Q as CreateTestModePaymentoutput, R as CreateUmaInvitationInput, S as CreateUmaInvitationOutput, T as CreateUmaInvoiceInput, U as CurrencyAmount, V as CurrencyUnit, X as DeclineToSignMessagesInput, Y as DeclineToSignMessagesOutput, Z as DeleteApiTokenInput, _ as DeleteApiTokenOutput, $ as Deposit, a1 as Entity, a2 as FeeEstimate, a3 as FundNodeInput, a4 as FundNodeOutput, a5 as GraphNode, a6 as Hop, a8 as HtlcAttemptFailureCode, a9 as IdAndSignature, aa as IncentivesIneligibilityReason, ab as IncentivesStatus, ac as IncomingPayment, ad as IncomingPaymentAttempt, af as IncomingPaymentAttemptStatus, ag as IncomingPaymentToAttemptsConnection, ah as Invoice, aj as InvoiceData, ak as InvoiceType, al as LightningFeeEstimateForInvoiceInput, am as LightningFeeEstimateForNodeInput, an as LightningFeeEstimateOutput, ao as LightningTransaction, aq as LightsparkNode, as as LightsparkNodeOwner, au as LightsparkNodeStatus, av as LightsparkNodeToChannelsConnection, aw as LightsparkNodeWithOSK, ax as LightsparkNodeWithRemoteSigning, ay as Node, aA as NodeAddress, aB as NodeAddressType, aC as NodeToAddressesConnection, aD as OnChainTransaction, aF as OutgoingPayment, aG as OutgoingPaymentAttempt, aH as OutgoingPaymentAttemptStatus, aI as OutgoingPaymentAttemptToHopsConnection, aJ as OutgoingPaymentToAttemptsConnection, aK as OutgoingPaymentsForInvoiceQueryInput, aL as OutgoingPaymentsForInvoiceQueryOutput, aM as PageInfo, aN as PayInvoiceInput, aO as PayInvoiceOutput, aP as PayUmaInvoiceInput, aQ as PaymentDirection, aR as PaymentFailureReason, aS as PaymentRequest, aU as PaymentRequestData, aV as PaymentRequestStatus, aW as Permission, aX as PostTransactionData, aY as RegionCode, aZ as RegisterPaymentInput, a_ as RegisterPaymentOutput, a$ as ReleaseChannelPerCommitmentSecretInput, b0 as ReleaseChannelPerCommitmentSecretOutput, b1 as ReleasePaymentPreimageInput, b2 as ReleasePaymentPreimageOutput, b3 as RemoteSigningSubEventType, b4 as RequestWithdrawalInput, b5 as RequestWithdrawalOutput, b6 as RichText, b7 as RiskRating, b8 as RoutingTransaction, ba as RoutingTransactionFailureReason, bb as ScreenNodeInput, bc as ScreenNodeOutput, bd as Secret, be as SendPaymentInput, bf as SendPaymentOutput, bg as SetInvoicePaymentHashInput, bh as SetInvoicePaymentHashOutput, bi as SignInvoiceInput, bj as SignInvoiceOutput, bk as SignMessagesInput, bl as SignMessagesOutput, bm as Signable, bo as SignablePayload, bq as SignablePayloadStatus, br as SingleNodeDashboard, bs as Transaction, bu as TransactionFailures, bv as TransactionStatus, bw as TransactionType, bx as TransactionUpdate, by as UmaInvitation, bA as UpdateChannelPerCommitmentPointInput, bB as UpdateChannelPerCommitmentPointOutput, bC as UpdateNodeSharedSecretInput, bD as UpdateNodeSharedSecretOutput, bE as Wallet, bF as WalletStatus, bG as WalletToPaymentRequestsConnection, bH as WalletToTransactionsConnection, bI as WalletToWithdrawalRequestsConnection, W as WebhookEventType, bJ as Withdrawal, bL as WithdrawalFeeEstimateInput, bM as WithdrawalFeeEstimateOutput, bN as WithdrawalMode, bO as WithdrawalRequest, bP as WithdrawalRequestStatus, bQ as WithdrawalRequestToChannelClosingTransactionsConnection, bR as WithdrawalRequestToChannelOpeningTransactionsConnection, i as getApiTokenQuery, n as getChannelClosingTransactionQuery, q as getChannelOpeningTransactionQuery, a0 as getDepositQuery, a7 as getHopQuery, ae as getIncomingPaymentAttemptQuery, ai as getInvoiceQuery, ap as getLightningTransactionQuery, at as getLightsparkNodeOwnerQuery, ar as getLightsparkNodeQuery, az as getNodeQuery, aE as getOnChainTransactionQuery, aT as getPaymentRequestQuery, b9 as getRoutingTransactionQuery, bp as getSignablePayloadQuery, bn as getSignableQuery, bt as getTransactionQuery, bz as getUmaInvitationQuery, bK as getWithdrawalQuery } from '../index-f100aa27.js';
|
|
2
|
+
export { B as BitcoinNetwork } from '../BitcoinNetwork-4f6ea015.js';
|
|
3
3
|
import '@lightsparkdev/core';
|
|
4
4
|
import 'zen-observable';
|
package/dist/objects/index.js
CHANGED
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -50,15 +50,19 @@ import { MultiNodeDashboard } from "./graphql/MultiNodeDashboard.js";
|
|
|
50
50
|
import { PayInvoice } from "./graphql/PayInvoice.js";
|
|
51
51
|
import { PayUmaInvoice } from "./graphql/PayUmaInvoice.js";
|
|
52
52
|
import { PaymentRequestsForNode } from "./graphql/PaymentRequestsForNode.js";
|
|
53
|
+
import { RegisterPayment } from "./graphql/RegisterPayment.js";
|
|
53
54
|
import { RequestWithdrawal } from "./graphql/RequestWithdrawal.js";
|
|
55
|
+
import { ScreenNode } from "./graphql/ScreenNode.js";
|
|
54
56
|
import { SendPayment } from "./graphql/SendPayment.js";
|
|
55
57
|
import { SingleNodeDashboard as SingleNodeDashboardQuery } from "./graphql/SingleNodeDashboard.js";
|
|
56
58
|
import { TransactionSubscription } from "./graphql/TransactionSubscription.js";
|
|
57
59
|
import { TransactionsForNode } from "./graphql/TransactionsForNode.js";
|
|
58
|
-
import {
|
|
60
|
+
import { WithdrawalFeeEstimate } from "./graphql/WithdrawalFeeEstimate.js";
|
|
61
|
+
import { RiskRating, TransactionStatus } from "./index.js";
|
|
59
62
|
import Account from "./objects/Account.js";
|
|
60
63
|
import { ApiTokenFromJson } from "./objects/ApiToken.js";
|
|
61
64
|
import BitcoinNetwork from "./objects/BitcoinNetwork.js";
|
|
65
|
+
import type ComplianceProvider from "./objects/ComplianceProvider.js";
|
|
62
66
|
import type CreateApiTokenOutput from "./objects/CreateApiTokenOutput.js";
|
|
63
67
|
import type CurrencyAmount from "./objects/CurrencyAmount.js";
|
|
64
68
|
import { CurrencyAmountFromJson } from "./objects/CurrencyAmount.js";
|
|
@@ -73,6 +77,7 @@ import { InvoiceDataFromJson } from "./objects/InvoiceData.js";
|
|
|
73
77
|
import InvoiceType from "./objects/InvoiceType.js";
|
|
74
78
|
import type OutgoingPayment from "./objects/OutgoingPayment.js";
|
|
75
79
|
import { OutgoingPaymentFromJson } from "./objects/OutgoingPayment.js";
|
|
80
|
+
import type PaymentDirection from "./objects/PaymentDirection.js";
|
|
76
81
|
import { PaymentRequestFromJson } from "./objects/PaymentRequest.js";
|
|
77
82
|
import Permission from "./objects/Permission.js";
|
|
78
83
|
import type RegionCode from "./objects/RegionCode.js";
|
|
@@ -86,6 +91,8 @@ import type TransactionUpdate from "./objects/TransactionUpdate.js";
|
|
|
86
91
|
import { TransactionUpdateFromJson } from "./objects/TransactionUpdate.js";
|
|
87
92
|
import type UmaInvitation from "./objects/UmaInvitation.js";
|
|
88
93
|
import { UmaInvitationFromJson } from "./objects/UmaInvitation.js";
|
|
94
|
+
import type WithdrawalFeeEstimateOutput from "./objects/WithdrawalFeeEstimateOutput.js";
|
|
95
|
+
import { WithdrawalFeeEstimateOutputFromJson } from "./objects/WithdrawalFeeEstimateOutput.js";
|
|
89
96
|
import type WithdrawalMode from "./objects/WithdrawalMode.js";
|
|
90
97
|
import type WithdrawalRequest from "./objects/WithdrawalRequest.js";
|
|
91
98
|
import { WithdrawalRequestFromJson } from "./objects/WithdrawalRequest.js";
|
|
@@ -710,6 +717,47 @@ class LightsparkClient {
|
|
|
710
717
|
);
|
|
711
718
|
}
|
|
712
719
|
|
|
720
|
+
/**
|
|
721
|
+
* Returns an estimated amount for the L1 withdrawal fees for the specified node, amount, and
|
|
722
|
+
* strategy.
|
|
723
|
+
*
|
|
724
|
+
* @param nodeId The node from which you'd like to make the withdrawal.
|
|
725
|
+
* @param amountSats The amount you want to withdraw from this node in Satoshis. Use the special value -1 to withdrawal all funds from this node.
|
|
726
|
+
* @param withdrawalMode The strategy that should be used to withdraw the funds from this node.
|
|
727
|
+
* @returns An estimated amount for the L1 withdrawal fees for the specified node, amount, and strategy.
|
|
728
|
+
*/
|
|
729
|
+
public async getWithrawalFeeEstimate(
|
|
730
|
+
nodeId: string,
|
|
731
|
+
amountSats: number,
|
|
732
|
+
withdrawalMode: WithdrawalMode,
|
|
733
|
+
): Promise<CurrencyAmount> {
|
|
734
|
+
const response: WithdrawalFeeEstimateOutput | null =
|
|
735
|
+
await this.executeRawQuery({
|
|
736
|
+
queryPayload: WithdrawalFeeEstimate,
|
|
737
|
+
variables: {
|
|
738
|
+
node_id: nodeId,
|
|
739
|
+
amount_sats: amountSats,
|
|
740
|
+
withdrawal_mode: withdrawalMode,
|
|
741
|
+
},
|
|
742
|
+
constructObject: (response: {
|
|
743
|
+
withdrawal_fee_estimate: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
744
|
+
}) => {
|
|
745
|
+
return WithdrawalFeeEstimateOutputFromJson(
|
|
746
|
+
response.withdrawal_fee_estimate,
|
|
747
|
+
);
|
|
748
|
+
},
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
if (!response) {
|
|
752
|
+
throw new LightsparkException(
|
|
753
|
+
"WithdrawalFeeEstimateError",
|
|
754
|
+
"Null or invalid fee estimate response from server",
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
return response.feeEstimate;
|
|
759
|
+
}
|
|
760
|
+
|
|
713
761
|
/**
|
|
714
762
|
* Directly unlocks a node with a signing private key or alias.
|
|
715
763
|
*
|
|
@@ -1129,6 +1177,78 @@ class LightsparkClient {
|
|
|
1129
1177
|
});
|
|
1130
1178
|
}
|
|
1131
1179
|
|
|
1180
|
+
/**
|
|
1181
|
+
* Performs sanction screening on a lightning node against a given compliance provider.
|
|
1182
|
+
*
|
|
1183
|
+
* @param complianceProvider The provider that you want to use to perform the screening. You must have a valid
|
|
1184
|
+
* API token for the provider set in your Lightspark account settings.
|
|
1185
|
+
* @param nodePubKey The public key of the node that needs to be screened.
|
|
1186
|
+
* @returns A RiskRating for the node.
|
|
1187
|
+
*/
|
|
1188
|
+
public async screenNode(
|
|
1189
|
+
complianceProvider: ComplianceProvider,
|
|
1190
|
+
nodePubKey: string,
|
|
1191
|
+
): Promise<RiskRating | null> {
|
|
1192
|
+
return await this.requester.executeQuery({
|
|
1193
|
+
queryPayload: ScreenNode,
|
|
1194
|
+
variables: {
|
|
1195
|
+
node_pubkey: nodePubKey,
|
|
1196
|
+
provider: complianceProvider,
|
|
1197
|
+
},
|
|
1198
|
+
constructObject: (responseJson: {
|
|
1199
|
+
screen_node: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1200
|
+
}) => {
|
|
1201
|
+
if (responseJson.screen_node?.rating === undefined) {
|
|
1202
|
+
throw new LightsparkException(
|
|
1203
|
+
"ScreenNodeError",
|
|
1204
|
+
"Unable to screen node",
|
|
1205
|
+
);
|
|
1206
|
+
}
|
|
1207
|
+
const rating = responseJson.screen_node.rating;
|
|
1208
|
+
return RiskRating[rating] ?? RiskRating.FUTURE_VALUE;
|
|
1209
|
+
},
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Registers a succeeded payment with a compliance provider for monitoring.
|
|
1215
|
+
*
|
|
1216
|
+
* @param complianceProvider The provider that you want to use to register the payment. You must have
|
|
1217
|
+
* a valid API token for the provider set in your Lightspark account settings.
|
|
1218
|
+
* @param paymentId The unique ID of the payment
|
|
1219
|
+
* @param nodePubKey The public key of the counterparty node which is the recipient node if the
|
|
1220
|
+
* payment is an outgoing payment and the sender node if the payment is an incoming payment.
|
|
1221
|
+
* @param paymentDirection Indicates whether the payment is an incoming or outgoing payment.
|
|
1222
|
+
* @returns The ID of the payment that was registered.
|
|
1223
|
+
*/
|
|
1224
|
+
public async registerPayment(
|
|
1225
|
+
complianceProvider: ComplianceProvider,
|
|
1226
|
+
paymentId: string,
|
|
1227
|
+
nodePubKey: string,
|
|
1228
|
+
paymentDirection: PaymentDirection,
|
|
1229
|
+
): Promise<string | null> {
|
|
1230
|
+
return await this.requester.executeQuery({
|
|
1231
|
+
queryPayload: RegisterPayment,
|
|
1232
|
+
variables: {
|
|
1233
|
+
payment_id: paymentId,
|
|
1234
|
+
node_pubkey: nodePubKey,
|
|
1235
|
+
direction: paymentDirection,
|
|
1236
|
+
provider: complianceProvider,
|
|
1237
|
+
},
|
|
1238
|
+
constructObject: (responseJson: {
|
|
1239
|
+
register_payment: any; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
1240
|
+
}) => {
|
|
1241
|
+
if (!responseJson.register_payment?.payment?.id) {
|
|
1242
|
+
throw new LightsparkException(
|
|
1243
|
+
"RegisterPaymentError",
|
|
1244
|
+
"Unable to register payment",
|
|
1245
|
+
);
|
|
1246
|
+
}
|
|
1247
|
+
return responseJson.register_payment.payment.id as string;
|
|
1248
|
+
},
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1132
1252
|
/**
|
|
1133
1253
|
* Creates an UMA invitation. If you are part of the incentive program,
|
|
1134
1254
|
* you should use [createUmaInvitationWithIncentives].
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
export const RegisterPayment = `
|
|
4
|
+
mutation RegisterPayment(
|
|
5
|
+
$provider: ComplianceProvider!
|
|
6
|
+
$payment_id: ID!
|
|
7
|
+
$node_pubkey: String!
|
|
8
|
+
$direction: PaymentDirection!
|
|
9
|
+
) {
|
|
10
|
+
register_payment(input: {
|
|
11
|
+
provider: $provider
|
|
12
|
+
payment_id: $payment_id
|
|
13
|
+
node_pubkey: $node_pubkey
|
|
14
|
+
direction: $direction
|
|
15
|
+
}) {
|
|
16
|
+
payment {
|
|
17
|
+
id
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
export const ScreenNode = `
|
|
4
|
+
mutation ScreenNode(
|
|
5
|
+
$provider: ComplianceProvider!
|
|
6
|
+
$node_pubkey: String!
|
|
7
|
+
) {
|
|
8
|
+
screen_node(input: {
|
|
9
|
+
provider: $provider
|
|
10
|
+
node_pubkey: $node_pubkey
|
|
11
|
+
}) {
|
|
12
|
+
rating
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import { FRAGMENT as WithdrawalFeeEstimateOutputFragment } from "../objects/WithdrawalFeeEstimateOutput.js";
|
|
4
|
+
|
|
5
|
+
export const WithdrawalFeeEstimate = `
|
|
6
|
+
query WithdrawalFeeEstimate(
|
|
7
|
+
$node_id: ID!
|
|
8
|
+
$amount_sats: Long!
|
|
9
|
+
$withdrawal_mode: WithdrawalMode!
|
|
10
|
+
) {
|
|
11
|
+
withdrawal_fee_estimate(input: {
|
|
12
|
+
node_id: $node_id,
|
|
13
|
+
amount_sats: $amount_sats,
|
|
14
|
+
withdrawal_mode: $withdrawal_mode
|
|
15
|
+
}) {
|
|
16
|
+
...WithdrawalFeeEstimateOutputFragment
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
${WithdrawalFeeEstimateOutputFragment}
|
|
21
|
+
`;
|
package/src/objects/Account.ts
CHANGED
|
@@ -15,6 +15,8 @@ import type AccountToTransactionsConnection from "./AccountToTransactionsConnect
|
|
|
15
15
|
import { AccountToTransactionsConnectionFromJson } from "./AccountToTransactionsConnection.js";
|
|
16
16
|
import type AccountToWalletsConnection from "./AccountToWalletsConnection.js";
|
|
17
17
|
import { AccountToWalletsConnectionFromJson } from "./AccountToWalletsConnection.js";
|
|
18
|
+
import type AccountToWithdrawalRequestsConnection from "./AccountToWithdrawalRequestsConnection.js";
|
|
19
|
+
import { AccountToWithdrawalRequestsConnectionFromJson } from "./AccountToWithdrawalRequestsConnection.js";
|
|
18
20
|
import type BitcoinNetwork from "./BitcoinNetwork.js";
|
|
19
21
|
import type BlockchainBalance from "./BlockchainBalance.js";
|
|
20
22
|
import { BlockchainBalanceFromJson } from "./BlockchainBalance.js";
|
|
@@ -25,17 +27,17 @@ import type LightsparkNodeOwner from "./LightsparkNodeOwner.js";
|
|
|
25
27
|
import type TransactionFailures from "./TransactionFailures.js";
|
|
26
28
|
import type TransactionStatus from "./TransactionStatus.js";
|
|
27
29
|
import type TransactionType from "./TransactionType.js";
|
|
30
|
+
import type WithdrawalRequestStatus from "./WithdrawalRequestStatus.js";
|
|
28
31
|
|
|
29
32
|
/**
|
|
30
|
-
* This is an object representing the connected Lightspark account.
|
|
31
|
-
*
|
|
32
|
-
* *
|
|
33
|
+
* This is an object representing the connected Lightspark account. You can retrieve this object to
|
|
34
|
+
* see your account information and objects tied to your account. *
|
|
33
35
|
*/
|
|
34
36
|
class Account implements LightsparkNodeOwner, Entity {
|
|
35
37
|
constructor(
|
|
36
38
|
/**
|
|
37
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
38
|
-
*
|
|
39
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
40
|
+
* opaque string.
|
|
39
41
|
**/
|
|
40
42
|
public readonly id: string,
|
|
41
43
|
/** The date and time when the entity was first created. **/
|
|
@@ -1681,6 +1683,97 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
|
|
|
1681
1683
|
}))!;
|
|
1682
1684
|
}
|
|
1683
1685
|
|
|
1686
|
+
public async getWithdrawalRequests(
|
|
1687
|
+
client: LightsparkClient,
|
|
1688
|
+
first: number | undefined = undefined,
|
|
1689
|
+
after: string | undefined = undefined,
|
|
1690
|
+
bitcoinNetworks: BitcoinNetwork[] | undefined = undefined,
|
|
1691
|
+
statuses: WithdrawalRequestStatus[] | undefined = undefined,
|
|
1692
|
+
nodeIds: string[] | undefined = undefined,
|
|
1693
|
+
afterDate: string | undefined = undefined,
|
|
1694
|
+
beforeDate: string | undefined = undefined,
|
|
1695
|
+
): Promise<AccountToWithdrawalRequestsConnection> {
|
|
1696
|
+
return (await client.executeRawQuery({
|
|
1697
|
+
queryPayload: `
|
|
1698
|
+
query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $after_date: DateTime, $before_date: DateTime) {
|
|
1699
|
+
current_account {
|
|
1700
|
+
... on Account {
|
|
1701
|
+
withdrawal_requests(, first: $first, after: $after, bitcoin_networks: $bitcoin_networks, statuses: $statuses, node_ids: $node_ids, after_date: $after_date, before_date: $before_date) {
|
|
1702
|
+
__typename
|
|
1703
|
+
account_to_withdrawal_requests_connection_count: count
|
|
1704
|
+
account_to_withdrawal_requests_connection_page_info: page_info {
|
|
1705
|
+
__typename
|
|
1706
|
+
page_info_has_next_page: has_next_page
|
|
1707
|
+
page_info_has_previous_page: has_previous_page
|
|
1708
|
+
page_info_start_cursor: start_cursor
|
|
1709
|
+
page_info_end_cursor: end_cursor
|
|
1710
|
+
}
|
|
1711
|
+
account_to_withdrawal_requests_connection_entities: entities {
|
|
1712
|
+
__typename
|
|
1713
|
+
withdrawal_request_id: id
|
|
1714
|
+
withdrawal_request_created_at: created_at
|
|
1715
|
+
withdrawal_request_updated_at: updated_at
|
|
1716
|
+
withdrawal_request_requested_amount: requested_amount {
|
|
1717
|
+
__typename
|
|
1718
|
+
currency_amount_original_value: original_value
|
|
1719
|
+
currency_amount_original_unit: original_unit
|
|
1720
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1721
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1722
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1723
|
+
}
|
|
1724
|
+
withdrawal_request_amount: amount {
|
|
1725
|
+
__typename
|
|
1726
|
+
currency_amount_original_value: original_value
|
|
1727
|
+
currency_amount_original_unit: original_unit
|
|
1728
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1729
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1730
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1731
|
+
}
|
|
1732
|
+
withdrawal_request_estimated_amount: estimated_amount {
|
|
1733
|
+
__typename
|
|
1734
|
+
currency_amount_original_value: original_value
|
|
1735
|
+
currency_amount_original_unit: original_unit
|
|
1736
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1737
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1738
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1739
|
+
}
|
|
1740
|
+
withdrawal_request_amount_withdrawn: amount_withdrawn {
|
|
1741
|
+
__typename
|
|
1742
|
+
currency_amount_original_value: original_value
|
|
1743
|
+
currency_amount_original_unit: original_unit
|
|
1744
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
1745
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
1746
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
1747
|
+
}
|
|
1748
|
+
withdrawal_request_bitcoin_address: bitcoin_address
|
|
1749
|
+
withdrawal_request_withdrawal_mode: withdrawal_mode
|
|
1750
|
+
withdrawal_request_status: status
|
|
1751
|
+
withdrawal_request_completed_at: completed_at
|
|
1752
|
+
withdrawal_request_withdrawal: withdrawal {
|
|
1753
|
+
id
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
`,
|
|
1761
|
+
variables: {
|
|
1762
|
+
first: first,
|
|
1763
|
+
after: after,
|
|
1764
|
+
bitcoin_networks: bitcoinNetworks,
|
|
1765
|
+
statuses: statuses,
|
|
1766
|
+
node_ids: nodeIds,
|
|
1767
|
+
after_date: afterDate,
|
|
1768
|
+
before_date: beforeDate,
|
|
1769
|
+
},
|
|
1770
|
+
constructObject: (json) => {
|
|
1771
|
+
const connection = json["current_account"]["withdrawal_requests"];
|
|
1772
|
+
return AccountToWithdrawalRequestsConnectionFromJson(connection);
|
|
1773
|
+
},
|
|
1774
|
+
}))!;
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1684
1777
|
public async getWallets(
|
|
1685
1778
|
client: LightsparkClient,
|
|
1686
1779
|
first: number | undefined = undefined,
|
|
@@ -7,9 +7,8 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
|
7
7
|
|
|
8
8
|
interface AccountToApiTokensConnection {
|
|
9
9
|
/**
|
|
10
|
-
* The total count of objects in this connection, using the current filters.
|
|
11
|
-
*
|
|
12
|
-
* field).
|
|
10
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
11
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
13
12
|
**/
|
|
14
13
|
count: number;
|
|
15
14
|
|
|
@@ -7,9 +7,8 @@ import { ChannelFromJson } from "./Channel.js";
|
|
|
7
7
|
class AccountToChannelsConnection {
|
|
8
8
|
constructor(
|
|
9
9
|
/**
|
|
10
|
-
* The total count of objects in this connection, using the current filters.
|
|
11
|
-
*
|
|
12
|
-
* field).
|
|
10
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
11
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
13
12
|
**/
|
|
14
13
|
public readonly count: number,
|
|
15
14
|
/** The channels for the current page of this connection. **/
|
|
@@ -11,9 +11,8 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
|
11
11
|
/** A connection between an account and the nodes it manages. **/
|
|
12
12
|
interface AccountToNodesConnection {
|
|
13
13
|
/**
|
|
14
|
-
* The total count of objects in this connection, using the current filters.
|
|
15
|
-
*
|
|
16
|
-
* field).
|
|
14
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
15
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
17
16
|
**/
|
|
18
17
|
count: number;
|
|
19
18
|
|
|
@@ -10,9 +10,8 @@ import {
|
|
|
10
10
|
|
|
11
11
|
interface AccountToPaymentRequestsConnection {
|
|
12
12
|
/**
|
|
13
|
-
* The total count of objects in this connection, using the current filters.
|
|
14
|
-
*
|
|
15
|
-
* field).
|
|
13
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
14
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
16
15
|
**/
|
|
17
16
|
count: number;
|
|
18
17
|
|
|
@@ -12,9 +12,8 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js";
|
|
|
12
12
|
|
|
13
13
|
interface AccountToTransactionsConnection {
|
|
14
14
|
/**
|
|
15
|
-
* The total count of objects in this connection, using the current filters.
|
|
16
|
-
*
|
|
17
|
-
* field).
|
|
15
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
16
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
18
17
|
**/
|
|
19
18
|
count: number;
|
|
20
19
|
|
|
@@ -28,14 +27,14 @@ interface AccountToTransactionsConnection {
|
|
|
28
27
|
typename: string;
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
|
-
* Profit (or loss) generated by the transactions in this connection,
|
|
32
|
-
*
|
|
30
|
+
* Profit (or loss) generated by the transactions in this connection, with the set of filters
|
|
31
|
+
* and constraints provided.
|
|
33
32
|
**/
|
|
34
33
|
profitLoss?: CurrencyAmount | undefined;
|
|
35
34
|
|
|
36
35
|
/**
|
|
37
|
-
* Average fee earned for the transactions in this connection,
|
|
38
|
-
*
|
|
36
|
+
* Average fee earned for the transactions in this connection, with the set of filters and
|
|
37
|
+
* constraints provided.
|
|
39
38
|
**/
|
|
40
39
|
averageFeeEarned?: CurrencyAmount | undefined;
|
|
41
40
|
|
|
@@ -7,9 +7,8 @@ import { WalletFromJson } from "./Wallet.js";
|
|
|
7
7
|
|
|
8
8
|
interface AccountToWalletsConnection {
|
|
9
9
|
/**
|
|
10
|
-
* The total count of objects in this connection, using the current filters.
|
|
11
|
-
*
|
|
12
|
-
* field).
|
|
10
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
11
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
13
12
|
**/
|
|
14
13
|
count: number;
|
|
15
14
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import type PageInfo from "./PageInfo.js";
|
|
4
|
+
import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js";
|
|
5
|
+
import type WithdrawalRequest from "./WithdrawalRequest.js";
|
|
6
|
+
import { WithdrawalRequestFromJson } from "./WithdrawalRequest.js";
|
|
7
|
+
|
|
8
|
+
/** A connection between an account and its past and present withdrawal requests. **/
|
|
9
|
+
interface AccountToWithdrawalRequestsConnection {
|
|
10
|
+
/**
|
|
11
|
+
* The total count of objects in this connection, using the current filters. It is different
|
|
12
|
+
* from the number of objects returned in the current page (in the `entities` field).
|
|
13
|
+
**/
|
|
14
|
+
count: number;
|
|
15
|
+
|
|
16
|
+
/** An object that holds pagination information about the objects in this connection. **/
|
|
17
|
+
pageInfo: PageInfo;
|
|
18
|
+
|
|
19
|
+
/** The withdrawal requests for the current page of this connection. **/
|
|
20
|
+
entities: WithdrawalRequest[];
|
|
21
|
+
|
|
22
|
+
/** The typename of the object **/
|
|
23
|
+
typename: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const AccountToWithdrawalRequestsConnectionFromJson = (
|
|
27
|
+
obj: any,
|
|
28
|
+
): AccountToWithdrawalRequestsConnection => {
|
|
29
|
+
return {
|
|
30
|
+
count: obj["account_to_withdrawal_requests_connection_count"],
|
|
31
|
+
pageInfo: PageInfoFromJson(
|
|
32
|
+
obj["account_to_withdrawal_requests_connection_page_info"],
|
|
33
|
+
),
|
|
34
|
+
entities: obj["account_to_withdrawal_requests_connection_entities"].map(
|
|
35
|
+
(e) => WithdrawalRequestFromJson(e),
|
|
36
|
+
),
|
|
37
|
+
typename: "AccountToWithdrawalRequestsConnection",
|
|
38
|
+
} as AccountToWithdrawalRequestsConnection;
|
|
39
|
+
};
|
|
40
|
+
export const AccountToWithdrawalRequestsConnectionToJson = (
|
|
41
|
+
obj: AccountToWithdrawalRequestsConnection,
|
|
42
|
+
): any => {
|
|
43
|
+
return {
|
|
44
|
+
__typename: "AccountToWithdrawalRequestsConnection",
|
|
45
|
+
account_to_withdrawal_requests_connection_count: obj.count,
|
|
46
|
+
account_to_withdrawal_requests_connection_page_info: PageInfoToJson(
|
|
47
|
+
obj.pageInfo,
|
|
48
|
+
),
|
|
49
|
+
account_to_withdrawal_requests_connection_entities: obj.entities.map((e) =>
|
|
50
|
+
e.toJson(),
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const FRAGMENT = `
|
|
56
|
+
fragment AccountToWithdrawalRequestsConnectionFragment on AccountToWithdrawalRequestsConnection {
|
|
57
|
+
__typename
|
|
58
|
+
account_to_withdrawal_requests_connection_count: count
|
|
59
|
+
account_to_withdrawal_requests_connection_page_info: page_info {
|
|
60
|
+
__typename
|
|
61
|
+
page_info_has_next_page: has_next_page
|
|
62
|
+
page_info_has_previous_page: has_previous_page
|
|
63
|
+
page_info_start_cursor: start_cursor
|
|
64
|
+
page_info_end_cursor: end_cursor
|
|
65
|
+
}
|
|
66
|
+
account_to_withdrawal_requests_connection_entities: entities {
|
|
67
|
+
id
|
|
68
|
+
}
|
|
69
|
+
}`;
|
|
70
|
+
|
|
71
|
+
export default AccountToWithdrawalRequestsConnection;
|
package/src/objects/ApiToken.ts
CHANGED
|
@@ -4,15 +4,14 @@ import { type Query } from "@lightsparkdev/core";
|
|
|
4
4
|
import Permission from "./Permission.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* This is an object representing a Lightspark API token,
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* *
|
|
7
|
+
* This is an object representing a Lightspark API token, that can be used to authenticate this
|
|
8
|
+
* account when making API calls or using our SDKs. See the “Authentication” section of our API
|
|
9
|
+
* docs for more details on its usage. *
|
|
11
10
|
*/
|
|
12
11
|
interface ApiToken {
|
|
13
12
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
*
|
|
13
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
14
|
+
* opaque string.
|
|
16
15
|
**/
|
|
17
16
|
id: string;
|
|
18
17
|
|