@lightsparkdev/lightspark-sdk 1.3.1 → 1.4.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 +7 -0
- package/dist/{BitcoinNetwork-972b1d01.d.ts → BitcoinNetwork-4f6ea015.d.ts} +2 -2
- package/dist/{chunk-Y55D3PD4.js → chunk-LCDROGA5.js} +938 -725
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-a5028d74.d.ts → index-6f544cad.d.ts} +711 -714
- package/dist/index.cjs +309 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +96 -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 +77 -1
- package/src/graphql/RegisterPayment.ts +21 -0
- package/src/graphql/ScreenNode.ts +15 -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/WithdrawalRequest.ts +43 -7
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -3
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -3
- package/src/objects/index.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -1949,7 +1949,7 @@ var import_core9 = require("@lightsparkdev/core");
|
|
|
1949
1949
|
// package.json
|
|
1950
1950
|
var package_default = {
|
|
1951
1951
|
name: "@lightsparkdev/lightspark-sdk",
|
|
1952
|
-
version: "1.
|
|
1952
|
+
version: "1.4.0",
|
|
1953
1953
|
description: "Lightspark JS SDK",
|
|
1954
1954
|
author: "Lightspark Inc.",
|
|
1955
1955
|
keywords: [
|
|
@@ -6975,6 +6975,27 @@ query PaymentRequestsForNode(
|
|
|
6975
6975
|
${FRAGMENT18}
|
|
6976
6976
|
`;
|
|
6977
6977
|
|
|
6978
|
+
// src/graphql/RegisterPayment.ts
|
|
6979
|
+
var RegisterPayment = `
|
|
6980
|
+
mutation RegisterPayment(
|
|
6981
|
+
$provider: ComplianceProvider!
|
|
6982
|
+
$payment_id: ID!
|
|
6983
|
+
$node_pubkey: String!
|
|
6984
|
+
$direction: PaymentDirection!
|
|
6985
|
+
) {
|
|
6986
|
+
register_payment(input: {
|
|
6987
|
+
provider: $provider
|
|
6988
|
+
payment_id: $payment_id
|
|
6989
|
+
node_pubkey: $node_pubkey
|
|
6990
|
+
direction: $direction
|
|
6991
|
+
}) {
|
|
6992
|
+
payment {
|
|
6993
|
+
id
|
|
6994
|
+
}
|
|
6995
|
+
}
|
|
6996
|
+
}
|
|
6997
|
+
`;
|
|
6998
|
+
|
|
6978
6999
|
// src/objects/WithdrawalRequest.ts
|
|
6979
7000
|
var import_auto_bind9 = __toESM(require("auto-bind"), 1);
|
|
6980
7001
|
|
|
@@ -7162,16 +7183,18 @@ var WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson = (obj) => {
|
|
|
7162
7183
|
|
|
7163
7184
|
// src/objects/WithdrawalRequest.ts
|
|
7164
7185
|
var WithdrawalRequest = class {
|
|
7165
|
-
constructor(id, createdAt, updatedAt, amount, bitcoinAddress, withdrawalMode, status, typename, estimatedAmount, completedAt, withdrawalId) {
|
|
7186
|
+
constructor(id, createdAt, updatedAt, requestedAmount, amount, bitcoinAddress, withdrawalMode, status, typename, estimatedAmount, amountWithdrawn, completedAt, withdrawalId) {
|
|
7166
7187
|
this.id = id;
|
|
7167
7188
|
this.createdAt = createdAt;
|
|
7168
7189
|
this.updatedAt = updatedAt;
|
|
7190
|
+
this.requestedAmount = requestedAmount;
|
|
7169
7191
|
this.amount = amount;
|
|
7170
7192
|
this.bitcoinAddress = bitcoinAddress;
|
|
7171
7193
|
this.withdrawalMode = withdrawalMode;
|
|
7172
7194
|
this.status = status;
|
|
7173
7195
|
this.typename = typename;
|
|
7174
7196
|
this.estimatedAmount = estimatedAmount;
|
|
7197
|
+
this.amountWithdrawn = amountWithdrawn;
|
|
7175
7198
|
this.completedAt = completedAt;
|
|
7176
7199
|
this.withdrawalId = withdrawalId;
|
|
7177
7200
|
(0, import_auto_bind9.default)(this);
|
|
@@ -7323,8 +7346,12 @@ ${FRAGMENT21}
|
|
|
7323
7346
|
withdrawal_request_id: this.id,
|
|
7324
7347
|
withdrawal_request_created_at: this.createdAt,
|
|
7325
7348
|
withdrawal_request_updated_at: this.updatedAt,
|
|
7349
|
+
withdrawal_request_requested_amount: CurrencyAmountToJson(
|
|
7350
|
+
this.requestedAmount
|
|
7351
|
+
),
|
|
7326
7352
|
withdrawal_request_amount: CurrencyAmountToJson(this.amount),
|
|
7327
7353
|
withdrawal_request_estimated_amount: this.estimatedAmount ? CurrencyAmountToJson(this.estimatedAmount) : void 0,
|
|
7354
|
+
withdrawal_request_amount_withdrawn: this.amountWithdrawn ? CurrencyAmountToJson(this.amountWithdrawn) : void 0,
|
|
7328
7355
|
withdrawal_request_bitcoin_address: this.bitcoinAddress,
|
|
7329
7356
|
withdrawal_request_withdrawal_mode: this.withdrawalMode,
|
|
7330
7357
|
withdrawal_request_status: this.status,
|
|
@@ -7338,12 +7365,14 @@ var WithdrawalRequestFromJson = (obj) => {
|
|
|
7338
7365
|
obj["withdrawal_request_id"],
|
|
7339
7366
|
obj["withdrawal_request_created_at"],
|
|
7340
7367
|
obj["withdrawal_request_updated_at"],
|
|
7368
|
+
CurrencyAmountFromJson(obj["withdrawal_request_requested_amount"]),
|
|
7341
7369
|
CurrencyAmountFromJson(obj["withdrawal_request_amount"]),
|
|
7342
7370
|
obj["withdrawal_request_bitcoin_address"],
|
|
7343
7371
|
WithdrawalMode_default[obj["withdrawal_request_withdrawal_mode"]] ?? WithdrawalMode_default.FUTURE_VALUE,
|
|
7344
7372
|
WithdrawalRequestStatus_default[obj["withdrawal_request_status"]] ?? WithdrawalRequestStatus_default.FUTURE_VALUE,
|
|
7345
7373
|
"WithdrawalRequest",
|
|
7346
7374
|
!!obj["withdrawal_request_estimated_amount"] ? CurrencyAmountFromJson(obj["withdrawal_request_estimated_amount"]) : void 0,
|
|
7375
|
+
!!obj["withdrawal_request_amount_withdrawn"] ? CurrencyAmountFromJson(obj["withdrawal_request_amount_withdrawn"]) : void 0,
|
|
7347
7376
|
obj["withdrawal_request_completed_at"],
|
|
7348
7377
|
obj["withdrawal_request_withdrawal"]?.id ?? void 0
|
|
7349
7378
|
);
|
|
@@ -7354,6 +7383,14 @@ fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
|
7354
7383
|
withdrawal_request_id: id
|
|
7355
7384
|
withdrawal_request_created_at: created_at
|
|
7356
7385
|
withdrawal_request_updated_at: updated_at
|
|
7386
|
+
withdrawal_request_requested_amount: requested_amount {
|
|
7387
|
+
__typename
|
|
7388
|
+
currency_amount_original_value: original_value
|
|
7389
|
+
currency_amount_original_unit: original_unit
|
|
7390
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
7391
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
7392
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
7393
|
+
}
|
|
7357
7394
|
withdrawal_request_amount: amount {
|
|
7358
7395
|
__typename
|
|
7359
7396
|
currency_amount_original_value: original_value
|
|
@@ -7370,6 +7407,14 @@ fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
|
7370
7407
|
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
7371
7408
|
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
7372
7409
|
}
|
|
7410
|
+
withdrawal_request_amount_withdrawn: amount_withdrawn {
|
|
7411
|
+
__typename
|
|
7412
|
+
currency_amount_original_value: original_value
|
|
7413
|
+
currency_amount_original_unit: original_unit
|
|
7414
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
7415
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
7416
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
7417
|
+
}
|
|
7373
7418
|
withdrawal_request_bitcoin_address: bitcoin_address
|
|
7374
7419
|
withdrawal_request_withdrawal_mode: withdrawal_mode
|
|
7375
7420
|
withdrawal_request_status: status
|
|
@@ -7403,6 +7448,21 @@ var RequestWithdrawal = `
|
|
|
7403
7448
|
${FRAGMENT21}
|
|
7404
7449
|
`;
|
|
7405
7450
|
|
|
7451
|
+
// src/graphql/ScreenNode.ts
|
|
7452
|
+
var ScreenNode = `
|
|
7453
|
+
mutation ScreenNode(
|
|
7454
|
+
$provider: ComplianceProvider!
|
|
7455
|
+
$node_pubkey: String!
|
|
7456
|
+
) {
|
|
7457
|
+
screen_node(input: {
|
|
7458
|
+
provider: $provider
|
|
7459
|
+
node_pubkey: $node_pubkey
|
|
7460
|
+
}) {
|
|
7461
|
+
rating
|
|
7462
|
+
}
|
|
7463
|
+
}
|
|
7464
|
+
`;
|
|
7465
|
+
|
|
7406
7466
|
// src/graphql/SendPayment.ts
|
|
7407
7467
|
var SendPayment = `
|
|
7408
7468
|
mutation SendPayment(
|
|
@@ -8839,6 +8899,20 @@ var WalletToTransactionsConnectionFromJson = (obj) => {
|
|
|
8839
8899
|
};
|
|
8840
8900
|
};
|
|
8841
8901
|
|
|
8902
|
+
// src/objects/WalletToWithdrawalRequestsConnection.ts
|
|
8903
|
+
var WalletToWithdrawalRequestsConnectionFromJson = (obj) => {
|
|
8904
|
+
return {
|
|
8905
|
+
count: obj["wallet_to_withdrawal_requests_connection_count"],
|
|
8906
|
+
pageInfo: PageInfoFromJson(
|
|
8907
|
+
obj["wallet_to_withdrawal_requests_connection_page_info"]
|
|
8908
|
+
),
|
|
8909
|
+
entities: obj["wallet_to_withdrawal_requests_connection_entities"].map(
|
|
8910
|
+
(e) => WithdrawalRequestFromJson(e)
|
|
8911
|
+
),
|
|
8912
|
+
typename: "WalletToWithdrawalRequestsConnection"
|
|
8913
|
+
};
|
|
8914
|
+
};
|
|
8915
|
+
|
|
8842
8916
|
// src/objects/Wallet.ts
|
|
8843
8917
|
var Wallet = class {
|
|
8844
8918
|
constructor(id, createdAt, updatedAt, thirdPartyIdentifier, status, typename, lastLoginAt, balances, accountId) {
|
|
@@ -9806,6 +9880,86 @@ query FetchWalletTotalAmountReceived($entity_id: ID!, $created_after_date: DateT
|
|
|
9806
9880
|
}
|
|
9807
9881
|
});
|
|
9808
9882
|
}
|
|
9883
|
+
async getWithdrawalRequests(client, first = void 0, after = void 0, statuses = void 0, createdAfterDate = void 0, createdBeforeDate = void 0) {
|
|
9884
|
+
return await client.executeRawQuery({
|
|
9885
|
+
queryPayload: `
|
|
9886
|
+
query FetchWalletToWithdrawalRequestsConnection($entity_id: ID!, $first: Int, $after: ID, $statuses: [WithdrawalRequestStatus!], $created_after_date: DateTime, $created_before_date: DateTime) {
|
|
9887
|
+
entity(id: $entity_id) {
|
|
9888
|
+
... on Wallet {
|
|
9889
|
+
withdrawal_requests(, first: $first, after: $after, statuses: $statuses, created_after_date: $created_after_date, created_before_date: $created_before_date) {
|
|
9890
|
+
__typename
|
|
9891
|
+
wallet_to_withdrawal_requests_connection_count: count
|
|
9892
|
+
wallet_to_withdrawal_requests_connection_page_info: page_info {
|
|
9893
|
+
__typename
|
|
9894
|
+
page_info_has_next_page: has_next_page
|
|
9895
|
+
page_info_has_previous_page: has_previous_page
|
|
9896
|
+
page_info_start_cursor: start_cursor
|
|
9897
|
+
page_info_end_cursor: end_cursor
|
|
9898
|
+
}
|
|
9899
|
+
wallet_to_withdrawal_requests_connection_entities: entities {
|
|
9900
|
+
__typename
|
|
9901
|
+
withdrawal_request_id: id
|
|
9902
|
+
withdrawal_request_created_at: created_at
|
|
9903
|
+
withdrawal_request_updated_at: updated_at
|
|
9904
|
+
withdrawal_request_requested_amount: requested_amount {
|
|
9905
|
+
__typename
|
|
9906
|
+
currency_amount_original_value: original_value
|
|
9907
|
+
currency_amount_original_unit: original_unit
|
|
9908
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
9909
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
9910
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
9911
|
+
}
|
|
9912
|
+
withdrawal_request_amount: amount {
|
|
9913
|
+
__typename
|
|
9914
|
+
currency_amount_original_value: original_value
|
|
9915
|
+
currency_amount_original_unit: original_unit
|
|
9916
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
9917
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
9918
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
9919
|
+
}
|
|
9920
|
+
withdrawal_request_estimated_amount: estimated_amount {
|
|
9921
|
+
__typename
|
|
9922
|
+
currency_amount_original_value: original_value
|
|
9923
|
+
currency_amount_original_unit: original_unit
|
|
9924
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
9925
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
9926
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
9927
|
+
}
|
|
9928
|
+
withdrawal_request_amount_withdrawn: amount_withdrawn {
|
|
9929
|
+
__typename
|
|
9930
|
+
currency_amount_original_value: original_value
|
|
9931
|
+
currency_amount_original_unit: original_unit
|
|
9932
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
9933
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
9934
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
9935
|
+
}
|
|
9936
|
+
withdrawal_request_bitcoin_address: bitcoin_address
|
|
9937
|
+
withdrawal_request_withdrawal_mode: withdrawal_mode
|
|
9938
|
+
withdrawal_request_status: status
|
|
9939
|
+
withdrawal_request_completed_at: completed_at
|
|
9940
|
+
withdrawal_request_withdrawal: withdrawal {
|
|
9941
|
+
id
|
|
9942
|
+
}
|
|
9943
|
+
}
|
|
9944
|
+
}
|
|
9945
|
+
}
|
|
9946
|
+
}
|
|
9947
|
+
}
|
|
9948
|
+
`,
|
|
9949
|
+
variables: {
|
|
9950
|
+
entity_id: this.id,
|
|
9951
|
+
first,
|
|
9952
|
+
after,
|
|
9953
|
+
statuses,
|
|
9954
|
+
created_after_date: createdAfterDate,
|
|
9955
|
+
created_before_date: createdBeforeDate
|
|
9956
|
+
},
|
|
9957
|
+
constructObject: (json) => {
|
|
9958
|
+
const connection = json["entity"]["withdrawal_requests"];
|
|
9959
|
+
return WalletToWithdrawalRequestsConnectionFromJson(connection);
|
|
9960
|
+
}
|
|
9961
|
+
});
|
|
9962
|
+
}
|
|
9809
9963
|
async getTotalAmountSent(client, createdAfterDate = void 0, createdBeforeDate = void 0) {
|
|
9810
9964
|
return await client.executeRawQuery({
|
|
9811
9965
|
queryPayload: `
|
|
@@ -9933,6 +10087,20 @@ var AccountToWalletsConnectionFromJson = (obj) => {
|
|
|
9933
10087
|
};
|
|
9934
10088
|
};
|
|
9935
10089
|
|
|
10090
|
+
// src/objects/AccountToWithdrawalRequestsConnection.ts
|
|
10091
|
+
var AccountToWithdrawalRequestsConnectionFromJson = (obj) => {
|
|
10092
|
+
return {
|
|
10093
|
+
count: obj["account_to_withdrawal_requests_connection_count"],
|
|
10094
|
+
pageInfo: PageInfoFromJson(
|
|
10095
|
+
obj["account_to_withdrawal_requests_connection_page_info"]
|
|
10096
|
+
),
|
|
10097
|
+
entities: obj["account_to_withdrawal_requests_connection_entities"].map(
|
|
10098
|
+
(e) => WithdrawalRequestFromJson(e)
|
|
10099
|
+
),
|
|
10100
|
+
typename: "AccountToWithdrawalRequestsConnection"
|
|
10101
|
+
};
|
|
10102
|
+
};
|
|
10103
|
+
|
|
9936
10104
|
// src/objects/Account.ts
|
|
9937
10105
|
var Account = class {
|
|
9938
10106
|
constructor(id, createdAt, updatedAt, typename, name) {
|
|
@@ -11506,6 +11674,87 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
|
|
|
11506
11674
|
}
|
|
11507
11675
|
});
|
|
11508
11676
|
}
|
|
11677
|
+
async getWithdrawalRequests(client, first = void 0, after = void 0, bitcoinNetworks = void 0, statuses = void 0, nodeIds = void 0, afterDate = void 0, beforeDate = void 0) {
|
|
11678
|
+
return await client.executeRawQuery({
|
|
11679
|
+
queryPayload: `
|
|
11680
|
+
query FetchAccountToWithdrawalRequestsConnection($first: Int, $after: String, $bitcoin_networks: [BitcoinNetwork!], $statuses: [WithdrawalRequestStatus!], $node_ids: [ID!], $after_date: DateTime, $before_date: DateTime) {
|
|
11681
|
+
current_account {
|
|
11682
|
+
... on Account {
|
|
11683
|
+
withdrawal_requests(, first: $first, after: $after, bitcoin_networks: $bitcoin_networks, statuses: $statuses, node_ids: $node_ids, after_date: $after_date, before_date: $before_date) {
|
|
11684
|
+
__typename
|
|
11685
|
+
account_to_withdrawal_requests_connection_count: count
|
|
11686
|
+
account_to_withdrawal_requests_connection_page_info: page_info {
|
|
11687
|
+
__typename
|
|
11688
|
+
page_info_has_next_page: has_next_page
|
|
11689
|
+
page_info_has_previous_page: has_previous_page
|
|
11690
|
+
page_info_start_cursor: start_cursor
|
|
11691
|
+
page_info_end_cursor: end_cursor
|
|
11692
|
+
}
|
|
11693
|
+
account_to_withdrawal_requests_connection_entities: entities {
|
|
11694
|
+
__typename
|
|
11695
|
+
withdrawal_request_id: id
|
|
11696
|
+
withdrawal_request_created_at: created_at
|
|
11697
|
+
withdrawal_request_updated_at: updated_at
|
|
11698
|
+
withdrawal_request_requested_amount: requested_amount {
|
|
11699
|
+
__typename
|
|
11700
|
+
currency_amount_original_value: original_value
|
|
11701
|
+
currency_amount_original_unit: original_unit
|
|
11702
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
11703
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
11704
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
11705
|
+
}
|
|
11706
|
+
withdrawal_request_amount: amount {
|
|
11707
|
+
__typename
|
|
11708
|
+
currency_amount_original_value: original_value
|
|
11709
|
+
currency_amount_original_unit: original_unit
|
|
11710
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
11711
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
11712
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
11713
|
+
}
|
|
11714
|
+
withdrawal_request_estimated_amount: estimated_amount {
|
|
11715
|
+
__typename
|
|
11716
|
+
currency_amount_original_value: original_value
|
|
11717
|
+
currency_amount_original_unit: original_unit
|
|
11718
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
11719
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
11720
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
11721
|
+
}
|
|
11722
|
+
withdrawal_request_amount_withdrawn: amount_withdrawn {
|
|
11723
|
+
__typename
|
|
11724
|
+
currency_amount_original_value: original_value
|
|
11725
|
+
currency_amount_original_unit: original_unit
|
|
11726
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
11727
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
11728
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
11729
|
+
}
|
|
11730
|
+
withdrawal_request_bitcoin_address: bitcoin_address
|
|
11731
|
+
withdrawal_request_withdrawal_mode: withdrawal_mode
|
|
11732
|
+
withdrawal_request_status: status
|
|
11733
|
+
withdrawal_request_completed_at: completed_at
|
|
11734
|
+
withdrawal_request_withdrawal: withdrawal {
|
|
11735
|
+
id
|
|
11736
|
+
}
|
|
11737
|
+
}
|
|
11738
|
+
}
|
|
11739
|
+
}
|
|
11740
|
+
}
|
|
11741
|
+
}
|
|
11742
|
+
`,
|
|
11743
|
+
variables: {
|
|
11744
|
+
first,
|
|
11745
|
+
after,
|
|
11746
|
+
bitcoin_networks: bitcoinNetworks,
|
|
11747
|
+
statuses,
|
|
11748
|
+
node_ids: nodeIds,
|
|
11749
|
+
after_date: afterDate,
|
|
11750
|
+
before_date: beforeDate
|
|
11751
|
+
},
|
|
11752
|
+
constructObject: (json) => {
|
|
11753
|
+
const connection = json["current_account"]["withdrawal_requests"];
|
|
11754
|
+
return AccountToWithdrawalRequestsConnectionFromJson(connection);
|
|
11755
|
+
}
|
|
11756
|
+
});
|
|
11757
|
+
}
|
|
11509
11758
|
async getWallets(client, first = void 0, after = void 0, thirdPartyIds = void 0) {
|
|
11510
11759
|
return await client.executeRawQuery({
|
|
11511
11760
|
queryPayload: `
|
|
@@ -12450,6 +12699,64 @@ var LightsparkClient = class {
|
|
|
12450
12699
|
}
|
|
12451
12700
|
});
|
|
12452
12701
|
}
|
|
12702
|
+
/**
|
|
12703
|
+
* Performs sanction screening on a lightning node against a given compliance provider.
|
|
12704
|
+
*
|
|
12705
|
+
* @param complianceProvider The provider that you want to use to perform the screening. You must have a valid
|
|
12706
|
+
* API token for the provider set in your Lightspark account settings.
|
|
12707
|
+
* @param nodePubKey The public key of the node that needs to be screened.
|
|
12708
|
+
* @returns A RiskRating for the node.
|
|
12709
|
+
*/
|
|
12710
|
+
async screenNode(complianceProvider, nodePubKey) {
|
|
12711
|
+
return await this.requester.executeQuery({
|
|
12712
|
+
queryPayload: ScreenNode,
|
|
12713
|
+
variables: {
|
|
12714
|
+
node_pubkey: nodePubKey,
|
|
12715
|
+
provider: complianceProvider
|
|
12716
|
+
},
|
|
12717
|
+
constructObject: (responseJson) => {
|
|
12718
|
+
if (responseJson.screen_node?.rating === void 0) {
|
|
12719
|
+
throw new import_core9.LightsparkException(
|
|
12720
|
+
"ScreenNodeError",
|
|
12721
|
+
"Unable to screen node"
|
|
12722
|
+
);
|
|
12723
|
+
}
|
|
12724
|
+
const rating = responseJson.screen_node.rating;
|
|
12725
|
+
return RiskRating_default[rating] ?? RiskRating_default.FUTURE_VALUE;
|
|
12726
|
+
}
|
|
12727
|
+
});
|
|
12728
|
+
}
|
|
12729
|
+
/**
|
|
12730
|
+
* Registers a succeeded payment with a compliance provider for monitoring.
|
|
12731
|
+
*
|
|
12732
|
+
* @param complianceProvider The provider that you want to use to register the payment. You must have
|
|
12733
|
+
* a valid API token for the provider set in your Lightspark account settings.
|
|
12734
|
+
* @param paymentId The unique ID of the payment
|
|
12735
|
+
* @param nodePubKey The public key of the counterparty node which is the recipient node if the
|
|
12736
|
+
* payment is an outgoing payment and the sender node if the payment is an incoming payment.
|
|
12737
|
+
* @param paymentDirection Indicates whether the payment is an incoming or outgoing payment.
|
|
12738
|
+
* @returns The ID of the payment that was registered.
|
|
12739
|
+
*/
|
|
12740
|
+
async registerPayment(complianceProvider, paymentId, nodePubKey, paymentDirection) {
|
|
12741
|
+
return await this.requester.executeQuery({
|
|
12742
|
+
queryPayload: RegisterPayment,
|
|
12743
|
+
variables: {
|
|
12744
|
+
payment_id: paymentId,
|
|
12745
|
+
node_pubkey: nodePubKey,
|
|
12746
|
+
direction: paymentDirection,
|
|
12747
|
+
provider: complianceProvider
|
|
12748
|
+
},
|
|
12749
|
+
constructObject: (responseJson) => {
|
|
12750
|
+
if (!responseJson.register_payment?.payment?.id) {
|
|
12751
|
+
throw new import_core9.LightsparkException(
|
|
12752
|
+
"RegisterPaymentError",
|
|
12753
|
+
"Unable to register payment"
|
|
12754
|
+
);
|
|
12755
|
+
}
|
|
12756
|
+
return responseJson.register_payment.payment.id;
|
|
12757
|
+
}
|
|
12758
|
+
});
|
|
12759
|
+
}
|
|
12453
12760
|
/**
|
|
12454
12761
|
* Creates an UMA invitation. If you are part of the incentive program,
|
|
12455
12762
|
* you should use [createUmaInvitationWithIncentives].
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 ApiToken, B as Balances,
|
|
4
|
-
import { B as BitcoinNetwork } from './BitcoinNetwork-
|
|
2
|
+
import { W as WebhookEventType, L as LightsparkClient } from './index-6f544cad.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, 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, bJ as Withdrawal, bL as WithdrawalMode, bM as WithdrawalRequest, bN as WithdrawalRequestStatus, bO as WithdrawalRequestToChannelClosingTransactionsConnection, bP 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-6f544cad.js';
|
|
4
|
+
import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
|
|
5
5
|
import 'zen-observable';
|
|
6
6
|
|
|
7
7
|
declare class AccountTokenAuthProvider implements AuthProvider {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 ApiToken, B as Balances,
|
|
4
|
-
import { B as BitcoinNetwork } from './BitcoinNetwork-
|
|
2
|
+
import { W as WebhookEventType, L as LightsparkClient } from './index-6f544cad.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, 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, bJ as Withdrawal, bL as WithdrawalMode, bM as WithdrawalRequest, bN as WithdrawalRequestStatus, bO as WithdrawalRequestToChannelClosingTransactionsConnection, bP 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-6f544cad.js';
|
|
4
|
+
import { B as BitcoinNetwork } from './BitcoinNetwork-4f6ea015.js';
|
|
5
5
|
import 'zen-observable';
|
|
6
6
|
|
|
7
7
|
declare class AccountTokenAuthProvider implements AuthProvider {
|
package/dist/index.js
CHANGED
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
getTransactionQuery,
|
|
87
87
|
getUmaInvitationQuery,
|
|
88
88
|
getWithdrawalQuery
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-LCDROGA5.js";
|
|
90
90
|
import {
|
|
91
91
|
BitcoinNetwork_default
|
|
92
92
|
} from "./chunk-K6SAUSAX.js";
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
// package.json
|
|
145
145
|
var package_default = {
|
|
146
146
|
name: "@lightsparkdev/lightspark-sdk",
|
|
147
|
-
version: "1.
|
|
147
|
+
version: "1.4.0",
|
|
148
148
|
description: "Lightspark JS SDK",
|
|
149
149
|
author: "Lightspark Inc.",
|
|
150
150
|
keywords: [
|
|
@@ -944,6 +944,27 @@ query PaymentRequestsForNode(
|
|
|
944
944
|
${FRAGMENT10}
|
|
945
945
|
`;
|
|
946
946
|
|
|
947
|
+
// src/graphql/RegisterPayment.ts
|
|
948
|
+
var RegisterPayment = `
|
|
949
|
+
mutation RegisterPayment(
|
|
950
|
+
$provider: ComplianceProvider!
|
|
951
|
+
$payment_id: ID!
|
|
952
|
+
$node_pubkey: String!
|
|
953
|
+
$direction: PaymentDirection!
|
|
954
|
+
) {
|
|
955
|
+
register_payment(input: {
|
|
956
|
+
provider: $provider
|
|
957
|
+
payment_id: $payment_id
|
|
958
|
+
node_pubkey: $node_pubkey
|
|
959
|
+
direction: $direction
|
|
960
|
+
}) {
|
|
961
|
+
payment {
|
|
962
|
+
id
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
`;
|
|
967
|
+
|
|
947
968
|
// src/graphql/RequestWithdrawal.ts
|
|
948
969
|
var RequestWithdrawal = `
|
|
949
970
|
mutation RequestWithdrawal(
|
|
@@ -967,6 +988,21 @@ var RequestWithdrawal = `
|
|
|
967
988
|
${FRAGMENT11}
|
|
968
989
|
`;
|
|
969
990
|
|
|
991
|
+
// src/graphql/ScreenNode.ts
|
|
992
|
+
var ScreenNode = `
|
|
993
|
+
mutation ScreenNode(
|
|
994
|
+
$provider: ComplianceProvider!
|
|
995
|
+
$node_pubkey: String!
|
|
996
|
+
) {
|
|
997
|
+
screen_node(input: {
|
|
998
|
+
provider: $provider
|
|
999
|
+
node_pubkey: $node_pubkey
|
|
1000
|
+
}) {
|
|
1001
|
+
rating
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
`;
|
|
1005
|
+
|
|
970
1006
|
// src/graphql/SendPayment.ts
|
|
971
1007
|
var SendPayment = `
|
|
972
1008
|
mutation SendPayment(
|
|
@@ -1981,6 +2017,64 @@ var LightsparkClient = class {
|
|
|
1981
2017
|
}
|
|
1982
2018
|
});
|
|
1983
2019
|
}
|
|
2020
|
+
/**
|
|
2021
|
+
* Performs sanction screening on a lightning node against a given compliance provider.
|
|
2022
|
+
*
|
|
2023
|
+
* @param complianceProvider The provider that you want to use to perform the screening. You must have a valid
|
|
2024
|
+
* API token for the provider set in your Lightspark account settings.
|
|
2025
|
+
* @param nodePubKey The public key of the node that needs to be screened.
|
|
2026
|
+
* @returns A RiskRating for the node.
|
|
2027
|
+
*/
|
|
2028
|
+
async screenNode(complianceProvider, nodePubKey) {
|
|
2029
|
+
return await this.requester.executeQuery({
|
|
2030
|
+
queryPayload: ScreenNode,
|
|
2031
|
+
variables: {
|
|
2032
|
+
node_pubkey: nodePubKey,
|
|
2033
|
+
provider: complianceProvider
|
|
2034
|
+
},
|
|
2035
|
+
constructObject: (responseJson) => {
|
|
2036
|
+
if (responseJson.screen_node?.rating === void 0) {
|
|
2037
|
+
throw new LightsparkException(
|
|
2038
|
+
"ScreenNodeError",
|
|
2039
|
+
"Unable to screen node"
|
|
2040
|
+
);
|
|
2041
|
+
}
|
|
2042
|
+
const rating = responseJson.screen_node.rating;
|
|
2043
|
+
return RiskRating_default[rating] ?? RiskRating_default.FUTURE_VALUE;
|
|
2044
|
+
}
|
|
2045
|
+
});
|
|
2046
|
+
}
|
|
2047
|
+
/**
|
|
2048
|
+
* Registers a succeeded payment with a compliance provider for monitoring.
|
|
2049
|
+
*
|
|
2050
|
+
* @param complianceProvider The provider that you want to use to register the payment. You must have
|
|
2051
|
+
* a valid API token for the provider set in your Lightspark account settings.
|
|
2052
|
+
* @param paymentId The unique ID of the payment
|
|
2053
|
+
* @param nodePubKey The public key of the counterparty node which is the recipient node if the
|
|
2054
|
+
* payment is an outgoing payment and the sender node if the payment is an incoming payment.
|
|
2055
|
+
* @param paymentDirection Indicates whether the payment is an incoming or outgoing payment.
|
|
2056
|
+
* @returns The ID of the payment that was registered.
|
|
2057
|
+
*/
|
|
2058
|
+
async registerPayment(complianceProvider, paymentId, nodePubKey, paymentDirection) {
|
|
2059
|
+
return await this.requester.executeQuery({
|
|
2060
|
+
queryPayload: RegisterPayment,
|
|
2061
|
+
variables: {
|
|
2062
|
+
payment_id: paymentId,
|
|
2063
|
+
node_pubkey: nodePubKey,
|
|
2064
|
+
direction: paymentDirection,
|
|
2065
|
+
provider: complianceProvider
|
|
2066
|
+
},
|
|
2067
|
+
constructObject: (responseJson) => {
|
|
2068
|
+
if (!responseJson.register_payment?.payment?.id) {
|
|
2069
|
+
throw new LightsparkException(
|
|
2070
|
+
"RegisterPaymentError",
|
|
2071
|
+
"Unable to register payment"
|
|
2072
|
+
);
|
|
2073
|
+
}
|
|
2074
|
+
return responseJson.register_payment.payment.id;
|
|
2075
|
+
}
|
|
2076
|
+
});
|
|
2077
|
+
}
|
|
1984
2078
|
/**
|
|
1985
2079
|
* Creates an UMA invitation. If you are part of the incentive program,
|
|
1986
2080
|
* you should use [createUmaInvitationWithIncentives].
|