@lightsparkdev/lightspark-sdk 0.2.2 → 0.2.4
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 +14 -0
- package/README.md +0 -1
- package/dist/.DS_Store +0 -0
- package/dist/{Withdrawal-ebb4865c.d.ts → Withdrawal-6e015ff8.d.ts} +55 -4
- package/dist/{Withdrawal-27a4d10d.d.ts → Withdrawal-f68ab02c.d.ts} +98 -31
- package/dist/Withdrawal-f8570ed4.d.ts +1739 -0
- package/dist/{chunk-5Z7FB6OT.js → chunk-OKTW3ZBO.js} +257 -31
- package/dist/{chunk-XFOVS6EY.js → chunk-ZBDRJ7IU.js} +263 -31
- package/dist/index.cjs +284 -49
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -21
- package/dist/objects/index.cjs +251 -24
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +3 -1
- package/package.json +2 -2
- package/src/.DS_Store +0 -0
- package/src/client.ts +29 -21
- package/src/objects/{WalletDashboard.ts → SingleNodeDashboard.ts} +2 -2
- package/src/objects/index.ts +1 -1
- package/dist/chunk-3VRI7CHE.js +0 -5508
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
TransactionStatus_default,
|
|
41
41
|
TransactionType_default,
|
|
42
42
|
TransactionUpdateFromJson,
|
|
43
|
+
Wallet_default,
|
|
43
44
|
WebhookEventType_default,
|
|
44
45
|
WithdrawalMode_default,
|
|
45
46
|
WithdrawalRequestFromJson,
|
|
@@ -59,14 +60,14 @@ import {
|
|
|
59
60
|
getRoutingTransactionQuery,
|
|
60
61
|
getTransactionQuery,
|
|
61
62
|
getWithdrawalQuery
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-OKTW3ZBO.js";
|
|
63
64
|
|
|
64
65
|
// package.json
|
|
65
66
|
var require_package = __commonJS({
|
|
66
67
|
"package.json"(exports, module) {
|
|
67
68
|
module.exports = {
|
|
68
69
|
name: "@lightsparkdev/lightspark-sdk",
|
|
69
|
-
version: "0.2.
|
|
70
|
+
version: "0.2.3",
|
|
70
71
|
description: "Lightspark JS SDK",
|
|
71
72
|
author: "Lightspark Inc.",
|
|
72
73
|
keywords: [
|
|
@@ -134,7 +135,7 @@ var require_package = __commonJS({
|
|
|
134
135
|
},
|
|
135
136
|
license: "Apache-2.0",
|
|
136
137
|
dependencies: {
|
|
137
|
-
"@lightsparkdev/core": "^0.2.
|
|
138
|
+
"@lightsparkdev/core": "^0.2.2",
|
|
138
139
|
"auto-bind": "^5.0.1",
|
|
139
140
|
crypto: "^1.0.1",
|
|
140
141
|
"crypto-browserify": "^3.12.0",
|
|
@@ -190,13 +191,13 @@ var AccountTokenAuthProvider = class {
|
|
|
190
191
|
var AccountTokenAuthProvider_default = AccountTokenAuthProvider;
|
|
191
192
|
|
|
192
193
|
// src/client.ts
|
|
194
|
+
import { LightsparkSigningException } from "@lightsparkdev/core";
|
|
193
195
|
import autoBind2 from "auto-bind";
|
|
194
196
|
import {
|
|
195
197
|
b64encode as b64encode2,
|
|
196
|
-
|
|
198
|
+
DefaultCrypto,
|
|
197
199
|
LightsparkAuthException,
|
|
198
200
|
LightsparkException,
|
|
199
|
-
LightsparkSigningException,
|
|
200
201
|
NodeKeyCache,
|
|
201
202
|
Requester,
|
|
202
203
|
StubAuthProvider
|
|
@@ -513,9 +514,9 @@ var SendPayment = `
|
|
|
513
514
|
${FRAGMENT6}
|
|
514
515
|
`;
|
|
515
516
|
|
|
516
|
-
// src/graphql/
|
|
517
|
-
var
|
|
518
|
-
query
|
|
517
|
+
// src/graphql/SinglesNodeDashboard.ts
|
|
518
|
+
var SinglesNodeDashboard = `
|
|
519
|
+
query SinglesNodeDashboard(
|
|
519
520
|
$network: BitcoinNetwork!,
|
|
520
521
|
$nodeId: ID!,
|
|
521
522
|
$numTransactions: Int,
|
|
@@ -690,21 +691,24 @@ var LightsparkClient = class {
|
|
|
690
691
|
* @param nodeKeyCache This is used to cache node keys for the duration of the session. Defaults to a new instance of
|
|
691
692
|
* `NodeKeyCache`. You should not need to change this.
|
|
692
693
|
*/
|
|
693
|
-
constructor(authProvider = new StubAuthProvider(), serverUrl = "api.lightspark.com",
|
|
694
|
+
constructor(authProvider = new StubAuthProvider(), serverUrl = "api.lightspark.com", cryptoImpl = DefaultCrypto) {
|
|
694
695
|
this.authProvider = authProvider;
|
|
695
696
|
this.serverUrl = serverUrl;
|
|
696
|
-
this.
|
|
697
|
+
this.cryptoImpl = cryptoImpl;
|
|
697
698
|
const sdkVersion = require_package().version;
|
|
699
|
+
this.nodeKeyCache = new NodeKeyCache(this.cryptoImpl);
|
|
698
700
|
this.requester = new Requester(
|
|
699
701
|
this.nodeKeyCache,
|
|
700
702
|
LIGHTSPARK_SDK_ENDPOINT,
|
|
701
703
|
`js-lightspark-sdk/${sdkVersion}`,
|
|
702
704
|
authProvider,
|
|
703
|
-
serverUrl
|
|
705
|
+
serverUrl,
|
|
706
|
+
this.cryptoImpl
|
|
704
707
|
);
|
|
705
708
|
autoBind2(this);
|
|
706
709
|
}
|
|
707
710
|
requester;
|
|
711
|
+
nodeKeyCache;
|
|
708
712
|
/**
|
|
709
713
|
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
710
714
|
* multiple accounts or waiting for the user to log in.
|
|
@@ -718,7 +722,8 @@ var LightsparkClient = class {
|
|
|
718
722
|
LIGHTSPARK_SDK_ENDPOINT,
|
|
719
723
|
`js-lightspark-sdk/${sdkVersion}`,
|
|
720
724
|
authProvider,
|
|
721
|
-
this.serverUrl
|
|
725
|
+
this.serverUrl,
|
|
726
|
+
this.cryptoImpl
|
|
722
727
|
);
|
|
723
728
|
this.authProvider = authProvider;
|
|
724
729
|
}
|
|
@@ -840,7 +845,7 @@ var LightsparkClient = class {
|
|
|
840
845
|
};
|
|
841
846
|
}
|
|
842
847
|
/**
|
|
843
|
-
* Gets a basic dashboard for a single node, including recent transactions. See `
|
|
848
|
+
* Gets a basic dashboard for a single node, including recent transactions. See `SinglesNodeDashboard` for which info is
|
|
844
849
|
* included.
|
|
845
850
|
*
|
|
846
851
|
* @param nodeId The node ID for which to get a dashboard.
|
|
@@ -849,13 +854,16 @@ var LightsparkClient = class {
|
|
|
849
854
|
* Defaults to undefined (no limit).
|
|
850
855
|
* @returns A basic dashboard for the given node ID.
|
|
851
856
|
*/
|
|
852
|
-
async
|
|
853
|
-
const response = await this.requester.makeRawRequest(
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
857
|
+
async getSinglesNodeDashboard(nodeId, bitcoinNetwork = BitcoinNetwork_default.MAINNET, transactionsAfterDate = void 0) {
|
|
858
|
+
const response = await this.requester.makeRawRequest(
|
|
859
|
+
SinglesNodeDashboard,
|
|
860
|
+
{
|
|
861
|
+
nodeId,
|
|
862
|
+
network: bitcoinNetwork,
|
|
863
|
+
numTransactions: 20,
|
|
864
|
+
transactionsAfterDate
|
|
865
|
+
}
|
|
866
|
+
);
|
|
859
867
|
if (!response.current_account) {
|
|
860
868
|
throw new LightsparkAuthException("No current account");
|
|
861
869
|
}
|
|
@@ -1010,7 +1018,7 @@ var LightsparkClient = class {
|
|
|
1010
1018
|
console.warn("No encrypted key found for node " + nodeId);
|
|
1011
1019
|
return false;
|
|
1012
1020
|
}
|
|
1013
|
-
const signingPrivateKey = await decryptSecretWithNodePassword(
|
|
1021
|
+
const signingPrivateKey = await this.cryptoImpl.decryptSecretWithNodePassword(
|
|
1014
1022
|
encryptedKey.cipher,
|
|
1015
1023
|
encryptedKey.encrypted_value,
|
|
1016
1024
|
password
|
|
@@ -1260,6 +1268,7 @@ export {
|
|
|
1260
1268
|
RoutingTransactionFailureReason_default as RoutingTransactionFailureReason,
|
|
1261
1269
|
TransactionStatus_default as TransactionStatus,
|
|
1262
1270
|
TransactionType_default as TransactionType,
|
|
1271
|
+
Wallet_default as Wallet,
|
|
1263
1272
|
WebhookEventType_default as WebhookEventType,
|
|
1264
1273
|
WithdrawalMode_default as WithdrawalMode,
|
|
1265
1274
|
WithdrawalRequest_default as WithdrawalRequest,
|
package/dist/objects/index.cjs
CHANGED
|
@@ -55,6 +55,7 @@ __export(objects_exports, {
|
|
|
55
55
|
RoutingTransactionFailureReason: () => RoutingTransactionFailureReason_default,
|
|
56
56
|
TransactionStatus: () => TransactionStatus_default,
|
|
57
57
|
TransactionType: () => TransactionType_default,
|
|
58
|
+
Wallet: () => Wallet_default,
|
|
58
59
|
WebhookEventType: () => WebhookEventType_default,
|
|
59
60
|
WithdrawalMode: () => WithdrawalMode_default,
|
|
60
61
|
WithdrawalRequest: () => WithdrawalRequest_default,
|
|
@@ -76,7 +77,7 @@ __export(objects_exports, {
|
|
|
76
77
|
module.exports = __toCommonJS(objects_exports);
|
|
77
78
|
|
|
78
79
|
// src/objects/Account.ts
|
|
79
|
-
var
|
|
80
|
+
var import_auto_bind10 = __toESM(require("auto-bind"), 1);
|
|
80
81
|
|
|
81
82
|
// src/objects/Permission.ts
|
|
82
83
|
var Permission = /* @__PURE__ */ ((Permission2) => {
|
|
@@ -2819,6 +2820,168 @@ var AccountToTransactionsConnectionFromJson = (obj) => {
|
|
|
2819
2820
|
};
|
|
2820
2821
|
};
|
|
2821
2822
|
|
|
2823
|
+
// src/objects/Wallet.ts
|
|
2824
|
+
var import_auto_bind9 = __toESM(require("auto-bind"), 1);
|
|
2825
|
+
|
|
2826
|
+
// src/objects/Balances.ts
|
|
2827
|
+
var BalancesFromJson = (obj) => {
|
|
2828
|
+
return {
|
|
2829
|
+
ownedBalance: CurrencyAmountFromJson(obj["balances_owned_balance"]),
|
|
2830
|
+
availableToSendBalance: CurrencyAmountFromJson(
|
|
2831
|
+
obj["balances_available_to_send_balance"]
|
|
2832
|
+
),
|
|
2833
|
+
availableToWithdrawBalance: CurrencyAmountFromJson(
|
|
2834
|
+
obj["balances_available_to_withdraw_balance"]
|
|
2835
|
+
)
|
|
2836
|
+
};
|
|
2837
|
+
};
|
|
2838
|
+
|
|
2839
|
+
// src/objects/Wallet.ts
|
|
2840
|
+
var Wallet = class {
|
|
2841
|
+
constructor(id, createdAt, updatedAt, thirdPartyIdentifier, typename, lastLoginAt, balances) {
|
|
2842
|
+
this.id = id;
|
|
2843
|
+
this.createdAt = createdAt;
|
|
2844
|
+
this.updatedAt = updatedAt;
|
|
2845
|
+
this.thirdPartyIdentifier = thirdPartyIdentifier;
|
|
2846
|
+
this.typename = typename;
|
|
2847
|
+
this.lastLoginAt = lastLoginAt;
|
|
2848
|
+
this.balances = balances;
|
|
2849
|
+
(0, import_auto_bind9.default)(this);
|
|
2850
|
+
}
|
|
2851
|
+
async getTotalAmountReceived(client, createdAfterDate = void 0, createdBeforeDate = void 0) {
|
|
2852
|
+
return await client.executeRawQuery({
|
|
2853
|
+
queryPayload: `
|
|
2854
|
+
query FetchWalletTotalAmountReceived($created_after_date: DateTime, $created_before_date: DateTime) {
|
|
2855
|
+
current_wallet {
|
|
2856
|
+
... on Wallet {
|
|
2857
|
+
total_amount_received(, created_after_date: $created_after_date, created_before_date: $created_before_date) {
|
|
2858
|
+
__typename
|
|
2859
|
+
currency_amount_original_value: original_value
|
|
2860
|
+
currency_amount_original_unit: original_unit
|
|
2861
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2862
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2863
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
`,
|
|
2869
|
+
variables: {
|
|
2870
|
+
created_after_date: createdAfterDate,
|
|
2871
|
+
created_before_date: createdBeforeDate
|
|
2872
|
+
},
|
|
2873
|
+
constructObject: (json) => {
|
|
2874
|
+
const connection = json["current_wallet"]["total_amount_received"];
|
|
2875
|
+
return CurrencyAmountFromJson(connection);
|
|
2876
|
+
}
|
|
2877
|
+
});
|
|
2878
|
+
}
|
|
2879
|
+
async getTotalAmountSent(client, createdAfterDate = void 0, createdBeforeDate = void 0) {
|
|
2880
|
+
return await client.executeRawQuery({
|
|
2881
|
+
queryPayload: `
|
|
2882
|
+
query FetchWalletTotalAmountSent($created_after_date: DateTime, $created_before_date: DateTime) {
|
|
2883
|
+
current_wallet {
|
|
2884
|
+
... on Wallet {
|
|
2885
|
+
total_amount_sent(, created_after_date: $created_after_date, created_before_date: $created_before_date) {
|
|
2886
|
+
__typename
|
|
2887
|
+
currency_amount_original_value: original_value
|
|
2888
|
+
currency_amount_original_unit: original_unit
|
|
2889
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2890
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2891
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
`,
|
|
2897
|
+
variables: {
|
|
2898
|
+
created_after_date: createdAfterDate,
|
|
2899
|
+
created_before_date: createdBeforeDate
|
|
2900
|
+
},
|
|
2901
|
+
constructObject: (json) => {
|
|
2902
|
+
const connection = json["current_wallet"]["total_amount_sent"];
|
|
2903
|
+
return CurrencyAmountFromJson(connection);
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2906
|
+
}
|
|
2907
|
+
static getWalletQuery() {
|
|
2908
|
+
return {
|
|
2909
|
+
queryPayload: `
|
|
2910
|
+
query GetWallet {
|
|
2911
|
+
current_wallet {
|
|
2912
|
+
... on Wallet {
|
|
2913
|
+
...WalletFragment
|
|
2914
|
+
}
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
${FRAGMENT13}
|
|
2919
|
+
`,
|
|
2920
|
+
variables: {},
|
|
2921
|
+
constructObject: (data) => WalletFromJson(data.current_wallet)
|
|
2922
|
+
};
|
|
2923
|
+
}
|
|
2924
|
+
};
|
|
2925
|
+
var WalletFromJson = (obj) => {
|
|
2926
|
+
return new Wallet(
|
|
2927
|
+
obj["wallet_id"],
|
|
2928
|
+
obj["wallet_created_at"],
|
|
2929
|
+
obj["wallet_updated_at"],
|
|
2930
|
+
obj["wallet_third_party_identifier"],
|
|
2931
|
+
"Wallet",
|
|
2932
|
+
obj["wallet_last_login_at"],
|
|
2933
|
+
!!obj["wallet_balances"] ? BalancesFromJson(obj["wallet_balances"]) : void 0
|
|
2934
|
+
);
|
|
2935
|
+
};
|
|
2936
|
+
var FRAGMENT13 = `
|
|
2937
|
+
fragment WalletFragment on Wallet {
|
|
2938
|
+
__typename
|
|
2939
|
+
wallet_id: id
|
|
2940
|
+
wallet_created_at: created_at
|
|
2941
|
+
wallet_updated_at: updated_at
|
|
2942
|
+
wallet_last_login_at: last_login_at
|
|
2943
|
+
wallet_balances: balances {
|
|
2944
|
+
__typename
|
|
2945
|
+
balances_owned_balance: owned_balance {
|
|
2946
|
+
__typename
|
|
2947
|
+
currency_amount_original_value: original_value
|
|
2948
|
+
currency_amount_original_unit: original_unit
|
|
2949
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2950
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2951
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2952
|
+
}
|
|
2953
|
+
balances_available_to_send_balance: available_to_send_balance {
|
|
2954
|
+
__typename
|
|
2955
|
+
currency_amount_original_value: original_value
|
|
2956
|
+
currency_amount_original_unit: original_unit
|
|
2957
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2958
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2959
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2960
|
+
}
|
|
2961
|
+
balances_available_to_withdraw_balance: available_to_withdraw_balance {
|
|
2962
|
+
__typename
|
|
2963
|
+
currency_amount_original_value: original_value
|
|
2964
|
+
currency_amount_original_unit: original_unit
|
|
2965
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
2966
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
2967
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
2968
|
+
}
|
|
2969
|
+
}
|
|
2970
|
+
wallet_third_party_identifier: third_party_identifier
|
|
2971
|
+
}`;
|
|
2972
|
+
var Wallet_default = Wallet;
|
|
2973
|
+
|
|
2974
|
+
// src/objects/AccountToWalletsConnection.ts
|
|
2975
|
+
var AccountToWalletsConnectionFromJson = (obj) => {
|
|
2976
|
+
return {
|
|
2977
|
+
pageInfo: PageInfoFromJson(obj["account_to_wallets_connection_page_info"]),
|
|
2978
|
+
count: obj["account_to_wallets_connection_count"],
|
|
2979
|
+
entities: obj["account_to_wallets_connection_entities"].map(
|
|
2980
|
+
(e) => WalletFromJson(e)
|
|
2981
|
+
)
|
|
2982
|
+
};
|
|
2983
|
+
};
|
|
2984
|
+
|
|
2822
2985
|
// src/objects/Account.ts
|
|
2823
2986
|
var Account = class {
|
|
2824
2987
|
constructor(id, createdAt, updatedAt, typename, name) {
|
|
@@ -2827,7 +2990,7 @@ var Account = class {
|
|
|
2827
2990
|
this.updatedAt = updatedAt;
|
|
2828
2991
|
this.typename = typename;
|
|
2829
2992
|
this.name = name;
|
|
2830
|
-
(0,
|
|
2993
|
+
(0, import_auto_bind10.default)(this);
|
|
2831
2994
|
}
|
|
2832
2995
|
async getApiTokens(client, first = void 0) {
|
|
2833
2996
|
return await client.executeRawQuery({
|
|
@@ -3905,6 +4068,69 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte
|
|
|
3905
4068
|
}
|
|
3906
4069
|
});
|
|
3907
4070
|
}
|
|
4071
|
+
async getWallets(client, first = void 0) {
|
|
4072
|
+
return await client.executeRawQuery({
|
|
4073
|
+
queryPayload: `
|
|
4074
|
+
query FetchAccountToWalletsConnection($first: Int) {
|
|
4075
|
+
current_account {
|
|
4076
|
+
... on Account {
|
|
4077
|
+
wallets(, first: $first) {
|
|
4078
|
+
__typename
|
|
4079
|
+
account_to_wallets_connection_page_info: page_info {
|
|
4080
|
+
__typename
|
|
4081
|
+
page_info_has_next_page: has_next_page
|
|
4082
|
+
page_info_has_previous_page: has_previous_page
|
|
4083
|
+
page_info_start_cursor: start_cursor
|
|
4084
|
+
page_info_end_cursor: end_cursor
|
|
4085
|
+
}
|
|
4086
|
+
account_to_wallets_connection_count: count
|
|
4087
|
+
account_to_wallets_connection_entities: entities {
|
|
4088
|
+
__typename
|
|
4089
|
+
wallet_id: id
|
|
4090
|
+
wallet_created_at: created_at
|
|
4091
|
+
wallet_updated_at: updated_at
|
|
4092
|
+
wallet_last_login_at: last_login_at
|
|
4093
|
+
wallet_balances: balances {
|
|
4094
|
+
__typename
|
|
4095
|
+
balances_owned_balance: owned_balance {
|
|
4096
|
+
__typename
|
|
4097
|
+
currency_amount_original_value: original_value
|
|
4098
|
+
currency_amount_original_unit: original_unit
|
|
4099
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
4100
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
4101
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
4102
|
+
}
|
|
4103
|
+
balances_available_to_send_balance: available_to_send_balance {
|
|
4104
|
+
__typename
|
|
4105
|
+
currency_amount_original_value: original_value
|
|
4106
|
+
currency_amount_original_unit: original_unit
|
|
4107
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
4108
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
4109
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
4110
|
+
}
|
|
4111
|
+
balances_available_to_withdraw_balance: available_to_withdraw_balance {
|
|
4112
|
+
__typename
|
|
4113
|
+
currency_amount_original_value: original_value
|
|
4114
|
+
currency_amount_original_unit: original_unit
|
|
4115
|
+
currency_amount_preferred_currency_unit: preferred_currency_unit
|
|
4116
|
+
currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded
|
|
4117
|
+
currency_amount_preferred_currency_value_approx: preferred_currency_value_approx
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
wallet_third_party_identifier: third_party_identifier
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
`,
|
|
4127
|
+
variables: { first },
|
|
4128
|
+
constructObject: (json) => {
|
|
4129
|
+
const connection = json["current_account"]["wallets"];
|
|
4130
|
+
return AccountToWalletsConnectionFromJson(connection);
|
|
4131
|
+
}
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
3908
4134
|
static getAccountQuery() {
|
|
3909
4135
|
return {
|
|
3910
4136
|
queryPayload: `
|
|
@@ -3916,7 +4142,7 @@ query GetAccount {
|
|
|
3916
4142
|
}
|
|
3917
4143
|
}
|
|
3918
4144
|
|
|
3919
|
-
${
|
|
4145
|
+
${FRAGMENT14}
|
|
3920
4146
|
`,
|
|
3921
4147
|
variables: {},
|
|
3922
4148
|
constructObject: (data) => AccountFromJson(data.current_account)
|
|
@@ -3932,7 +4158,7 @@ var AccountFromJson = (obj) => {
|
|
|
3932
4158
|
obj["account_name"]
|
|
3933
4159
|
);
|
|
3934
4160
|
};
|
|
3935
|
-
var
|
|
4161
|
+
var FRAGMENT14 = `
|
|
3936
4162
|
fragment AccountFragment on Account {
|
|
3937
4163
|
__typename
|
|
3938
4164
|
account_id: id
|
|
@@ -3961,7 +4187,7 @@ var ChannelClosingTransactionFromJson = (obj) => {
|
|
|
3961
4187
|
channelId: obj["channel_closing_transaction_channel"]?.id ?? void 0
|
|
3962
4188
|
};
|
|
3963
4189
|
};
|
|
3964
|
-
var
|
|
4190
|
+
var FRAGMENT15 = `
|
|
3965
4191
|
fragment ChannelClosingTransactionFragment on ChannelClosingTransaction {
|
|
3966
4192
|
__typename
|
|
3967
4193
|
channel_closing_transaction_id: id
|
|
@@ -4005,7 +4231,7 @@ query GetChannelClosingTransaction($id: ID!) {
|
|
|
4005
4231
|
}
|
|
4006
4232
|
}
|
|
4007
4233
|
|
|
4008
|
-
${
|
|
4234
|
+
${FRAGMENT15}
|
|
4009
4235
|
`,
|
|
4010
4236
|
variables: { id },
|
|
4011
4237
|
constructObject: (data) => ChannelClosingTransactionFromJson(data.entity)
|
|
@@ -4031,7 +4257,7 @@ var ChannelOpeningTransactionFromJson = (obj) => {
|
|
|
4031
4257
|
channelId: obj["channel_opening_transaction_channel"]?.id ?? void 0
|
|
4032
4258
|
};
|
|
4033
4259
|
};
|
|
4034
|
-
var
|
|
4260
|
+
var FRAGMENT16 = `
|
|
4035
4261
|
fragment ChannelOpeningTransactionFragment on ChannelOpeningTransaction {
|
|
4036
4262
|
__typename
|
|
4037
4263
|
channel_opening_transaction_id: id
|
|
@@ -4075,7 +4301,7 @@ query GetChannelOpeningTransaction($id: ID!) {
|
|
|
4075
4301
|
}
|
|
4076
4302
|
}
|
|
4077
4303
|
|
|
4078
|
-
${
|
|
4304
|
+
${FRAGMENT16}
|
|
4079
4305
|
`,
|
|
4080
4306
|
variables: { id },
|
|
4081
4307
|
constructObject: (data) => ChannelOpeningTransactionFromJson(data.entity)
|
|
@@ -4110,7 +4336,7 @@ var DepositFromJson = (obj) => {
|
|
|
4110
4336
|
numConfirmations: obj["deposit_num_confirmations"]
|
|
4111
4337
|
};
|
|
4112
4338
|
};
|
|
4113
|
-
var
|
|
4339
|
+
var FRAGMENT17 = `
|
|
4114
4340
|
fragment DepositFragment on Deposit {
|
|
4115
4341
|
__typename
|
|
4116
4342
|
deposit_id: id
|
|
@@ -4154,7 +4380,7 @@ query GetDeposit($id: ID!) {
|
|
|
4154
4380
|
}
|
|
4155
4381
|
}
|
|
4156
4382
|
|
|
4157
|
-
${
|
|
4383
|
+
${FRAGMENT17}
|
|
4158
4384
|
`,
|
|
4159
4385
|
variables: { id },
|
|
4160
4386
|
constructObject: (data) => DepositFromJson(data.entity)
|
|
@@ -4173,7 +4399,7 @@ var InvoiceFromJson = (obj) => {
|
|
|
4173
4399
|
amountPaid: !!obj["invoice_amount_paid"] ? CurrencyAmountFromJson(obj["invoice_amount_paid"]) : void 0
|
|
4174
4400
|
};
|
|
4175
4401
|
};
|
|
4176
|
-
var
|
|
4402
|
+
var FRAGMENT18 = `
|
|
4177
4403
|
fragment InvoiceFragment on Invoice {
|
|
4178
4404
|
__typename
|
|
4179
4405
|
invoice_id: id
|
|
@@ -4337,7 +4563,7 @@ query GetInvoice($id: ID!) {
|
|
|
4337
4563
|
}
|
|
4338
4564
|
}
|
|
4339
4565
|
|
|
4340
|
-
${
|
|
4566
|
+
${FRAGMENT18}
|
|
4341
4567
|
`,
|
|
4342
4568
|
variables: { id },
|
|
4343
4569
|
constructObject: (data) => InvoiceFromJson(data.entity)
|
|
@@ -4404,7 +4630,7 @@ var LightningTransactionFromJson = (obj) => {
|
|
|
4404
4630
|
`Couldn't find a concrete type for interface LightningTransaction corresponding to the typename=${obj["__typename"]}`
|
|
4405
4631
|
);
|
|
4406
4632
|
};
|
|
4407
|
-
var
|
|
4633
|
+
var FRAGMENT19 = `
|
|
4408
4634
|
fragment LightningTransactionFragment on LightningTransaction {
|
|
4409
4635
|
__typename
|
|
4410
4636
|
... on IncomingPayment {
|
|
@@ -4657,7 +4883,7 @@ query GetLightningTransaction($id: ID!) {
|
|
|
4657
4883
|
}
|
|
4658
4884
|
}
|
|
4659
4885
|
|
|
4660
|
-
${
|
|
4886
|
+
${FRAGMENT19}
|
|
4661
4887
|
`,
|
|
4662
4888
|
variables: { id },
|
|
4663
4889
|
constructObject: (data) => LightningTransactionFromJson(data.entity)
|
|
@@ -4744,7 +4970,7 @@ var OnChainTransactionFromJson = (obj) => {
|
|
|
4744
4970
|
`Couldn't find a concrete type for interface OnChainTransaction corresponding to the typename=${obj["__typename"]}`
|
|
4745
4971
|
);
|
|
4746
4972
|
};
|
|
4747
|
-
var
|
|
4973
|
+
var FRAGMENT20 = `
|
|
4748
4974
|
fragment OnChainTransactionFragment on OnChainTransaction {
|
|
4749
4975
|
__typename
|
|
4750
4976
|
... on ChannelClosingTransaction {
|
|
@@ -4887,7 +5113,7 @@ query GetOnChainTransaction($id: ID!) {
|
|
|
4887
5113
|
}
|
|
4888
5114
|
}
|
|
4889
5115
|
|
|
4890
|
-
${
|
|
5116
|
+
${FRAGMENT20}
|
|
4891
5117
|
`,
|
|
4892
5118
|
variables: { id },
|
|
4893
5119
|
constructObject: (data) => OnChainTransactionFromJson(data.entity)
|
|
@@ -4921,7 +5147,7 @@ var RoutingTransactionFromJson = (obj) => {
|
|
|
4921
5147
|
failureReason: !!obj["routing_transaction_failure_reason"] ? RoutingTransactionFailureReason_default[obj["routing_transaction_failure_reason"]] ?? RoutingTransactionFailureReason_default.FUTURE_VALUE : null
|
|
4922
5148
|
};
|
|
4923
5149
|
};
|
|
4924
|
-
var
|
|
5150
|
+
var FRAGMENT21 = `
|
|
4925
5151
|
fragment RoutingTransactionFragment on RoutingTransaction {
|
|
4926
5152
|
__typename
|
|
4927
5153
|
routing_transaction_id: id
|
|
@@ -4969,7 +5195,7 @@ query GetRoutingTransaction($id: ID!) {
|
|
|
4969
5195
|
}
|
|
4970
5196
|
}
|
|
4971
5197
|
|
|
4972
|
-
${
|
|
5198
|
+
${FRAGMENT21}
|
|
4973
5199
|
`,
|
|
4974
5200
|
variables: { id },
|
|
4975
5201
|
constructObject: (data) => RoutingTransactionFromJson(data.entity)
|
|
@@ -5026,7 +5252,7 @@ var WithdrawalFromJson = (obj) => {
|
|
|
5026
5252
|
numConfirmations: obj["withdrawal_num_confirmations"]
|
|
5027
5253
|
};
|
|
5028
5254
|
};
|
|
5029
|
-
var
|
|
5255
|
+
var FRAGMENT22 = `
|
|
5030
5256
|
fragment WithdrawalFragment on Withdrawal {
|
|
5031
5257
|
__typename
|
|
5032
5258
|
withdrawal_id: id
|
|
@@ -5070,7 +5296,7 @@ query GetWithdrawal($id: ID!) {
|
|
|
5070
5296
|
}
|
|
5071
5297
|
}
|
|
5072
5298
|
|
|
5073
|
-
${
|
|
5299
|
+
${FRAGMENT22}
|
|
5074
5300
|
`,
|
|
5075
5301
|
variables: { id },
|
|
5076
5302
|
constructObject: (data) => WithdrawalFromJson(data.entity)
|
|
@@ -5078,7 +5304,7 @@ ${FRAGMENT21}
|
|
|
5078
5304
|
};
|
|
5079
5305
|
|
|
5080
5306
|
// src/objects/WithdrawalRequest.ts
|
|
5081
|
-
var
|
|
5307
|
+
var import_auto_bind11 = __toESM(require("auto-bind"), 1);
|
|
5082
5308
|
|
|
5083
5309
|
// src/objects/WithdrawalRequestStatus.ts
|
|
5084
5310
|
var WithdrawalRequestStatus = /* @__PURE__ */ ((WithdrawalRequestStatus2) => {
|
|
@@ -5126,7 +5352,7 @@ var WithdrawalRequest = class {
|
|
|
5126
5352
|
this.estimatedAmount = estimatedAmount;
|
|
5127
5353
|
this.completedAt = completedAt;
|
|
5128
5354
|
this.withdrawalId = withdrawalId;
|
|
5129
|
-
(0,
|
|
5355
|
+
(0, import_auto_bind11.default)(this);
|
|
5130
5356
|
}
|
|
5131
5357
|
async getChannelClosingTransactions(client, first = void 0) {
|
|
5132
5358
|
return await client.executeRawQuery({
|
|
@@ -5263,7 +5489,7 @@ query GetWithdrawalRequest($id: ID!) {
|
|
|
5263
5489
|
}
|
|
5264
5490
|
}
|
|
5265
5491
|
|
|
5266
|
-
${
|
|
5492
|
+
${FRAGMENT23}
|
|
5267
5493
|
`,
|
|
5268
5494
|
variables: { id },
|
|
5269
5495
|
constructObject: (data) => WithdrawalRequestFromJson(data.entity)
|
|
@@ -5285,7 +5511,7 @@ var WithdrawalRequestFromJson = (obj) => {
|
|
|
5285
5511
|
obj["withdrawal_request_withdrawal"]?.id ?? void 0
|
|
5286
5512
|
);
|
|
5287
5513
|
};
|
|
5288
|
-
var
|
|
5514
|
+
var FRAGMENT23 = `
|
|
5289
5515
|
fragment WithdrawalRequestFragment on WithdrawalRequest {
|
|
5290
5516
|
__typename
|
|
5291
5517
|
withdrawal_request_id: id
|
|
@@ -5343,6 +5569,7 @@ var WithdrawalRequest_default = WithdrawalRequest;
|
|
|
5343
5569
|
RoutingTransactionFailureReason,
|
|
5344
5570
|
TransactionStatus,
|
|
5345
5571
|
TransactionType,
|
|
5572
|
+
Wallet,
|
|
5346
5573
|
WebhookEventType,
|
|
5347
5574
|
WithdrawalMode,
|
|
5348
5575
|
WithdrawalRequest,
|
package/dist/objects/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as Account, a as AccountToApiTokensConnection, b as AccountToChannelsConnection, c as AccountToNodesConnection, d as AccountToPaymentRequestsConnection, e as AccountToTransactionsConnection, f as ApiToken, B as 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 ApiToken, B as Balances, i as BitcoinNetwork, j as BlockchainBalance, C as Channel, k as ChannelClosingTransaction, m as ChannelFees, n as ChannelOpeningTransaction, p as ChannelStatus, q as ChannelToTransactionsConnection, r as CreateApiTokenInput, s as CreateApiTokenOutput, t as CreateInvoiceInput, u as CreateInvoiceOutput, v as CreateNodeWalletAddressInput, w as CreateNodeWalletAddressOutput, x as CurrencyAmount, y as CurrencyUnit, D as DeleteApiTokenInput, z as DeleteApiTokenOutput, E as Deposit, G as Entity, H as FeeEstimate, I as FundNodeInput, J as FundNodeOutput, K as GraphNode, M as Hop, O as HtlcAttemptFailureCode, P as IncomingPayment, Q as IncomingPaymentAttempt, S as IncomingPaymentAttemptStatus, T as IncomingPaymentToAttemptsConnection, U as Invoice, W as InvoiceData, X as InvoiceType, Y as LightningFeeEstimateForInvoiceInput, Z as LightningFeeEstimateForNodeInput, _ as LightningFeeEstimateOutput, $ as LightningTransaction, a1 as LightsparkNode, a2 as LightsparkNodePurpose, a3 as LightsparkNodeStatus, a4 as LightsparkNodeToChannelsConnection, a5 as Node, a6 as NodeAddress, a7 as NodeAddressType, a8 as NodeToAddressesConnection, a9 as OnChainTransaction, ab as OutgoingPayment, ac as OutgoingPaymentAttempt, ad as OutgoingPaymentAttemptStatus, ae as OutgoingPaymentAttemptToHopsConnection, af as OutgoingPaymentToAttemptsConnection, ag as PageInfo, ah as PayInvoiceInput, ai as PayInvoiceOutput, aj as PaymentFailureReason, ak as PaymentRequest, am as PaymentRequestData, an as PaymentRequestStatus, ao as Permission, ap as RequestWithdrawalInput, aq as RequestWithdrawalOutput, ar as RichText, as as RoutingTransaction, au as RoutingTransactionFailureReason, av as Secret, aw as SendPaymentInput, ax as SendPaymentOutput, ay as SinglesNodeDashboard, az as Transaction, aB as TransactionFailures, aC as TransactionStatus, aD as TransactionType, aE as TransactionUpdate, aF as Wallet, aG as WebhookEventType, aH as Withdrawal, aJ as WithdrawalMode, aK as WithdrawalRequest, aL as WithdrawalRequestStatus, aM as WithdrawalRequestToChannelClosingTransactionsConnection, aN as WithdrawalRequestToChannelOpeningTransactionsConnection, h as getApiTokenQuery, l as getChannelClosingTransactionQuery, o as getChannelOpeningTransactionQuery, F as getDepositQuery, N as getHopQuery, R as getIncomingPaymentAttemptQuery, V as getInvoiceQuery, a0 as getLightningTransactionQuery, aa as getOnChainTransactionQuery, al as getPaymentRequestQuery, at as getRoutingTransactionQuery, aA as getTransactionQuery, aI as getWithdrawalQuery } from '../Withdrawal-f8570ed4.js';
|
|
2
2
|
import '@lightsparkdev/core';
|
|
3
3
|
import 'zen-observable';
|
package/dist/objects/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
RoutingTransactionFailureReason_default,
|
|
25
25
|
TransactionStatus_default,
|
|
26
26
|
TransactionType_default,
|
|
27
|
+
Wallet_default,
|
|
27
28
|
WebhookEventType_default,
|
|
28
29
|
WithdrawalMode_default,
|
|
29
30
|
WithdrawalRequestStatus_default,
|
|
@@ -41,7 +42,7 @@ import {
|
|
|
41
42
|
getRoutingTransactionQuery,
|
|
42
43
|
getTransactionQuery,
|
|
43
44
|
getWithdrawalQuery
|
|
44
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-OKTW3ZBO.js";
|
|
45
46
|
export {
|
|
46
47
|
Account_default as Account,
|
|
47
48
|
AccountToChannelsConnection_default as AccountToChannelsConnection,
|
|
@@ -68,6 +69,7 @@ export {
|
|
|
68
69
|
RoutingTransactionFailureReason_default as RoutingTransactionFailureReason,
|
|
69
70
|
TransactionStatus_default as TransactionStatus,
|
|
70
71
|
TransactionType_default as TransactionType,
|
|
72
|
+
Wallet_default as Wallet,
|
|
71
73
|
WebhookEventType_default as WebhookEventType,
|
|
72
74
|
WithdrawalMode_default as WithdrawalMode,
|
|
73
75
|
WithdrawalRequest_default as WithdrawalRequest,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightsparkdev/lightspark-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Lightspark JS SDK",
|
|
5
5
|
"author": "Lightspark Inc.",
|
|
6
6
|
"keywords": [
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"license": "Apache-2.0",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@lightsparkdev/core": "^0.2.
|
|
71
|
+
"@lightsparkdev/core": "^0.2.2",
|
|
72
72
|
"auto-bind": "^5.0.1",
|
|
73
73
|
"crypto": "^1.0.1",
|
|
74
74
|
"crypto-browserify": "^3.12.0",
|
package/src/.DS_Store
ADDED
|
Binary file
|