@lightsparkdev/lightspark-sdk 0.4.10 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/dist/{chunk-NXUFC5J7.js → chunk-LZC5C5NI.js} +2908 -635
- package/dist/{index-3ffe9e7b.d.ts → index-09d4ac20.d.ts} +373 -62
- package/dist/index.cjs +3395 -842
- package/dist/index.d.ts +2 -2
- package/dist/index.js +390 -94
- package/dist/objects/index.cjs +2735 -553
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +17 -5
- package/package.json +12 -9
- package/src/NodeKeyLoaderCache.ts +87 -0
- package/src/SigningKeyLoader.ts +177 -0
- package/src/auth/AccountTokenAuthProvider.ts +4 -4
- package/src/client.ts +209 -118
- package/src/graphql/CreateInvoice.ts +3 -2
- package/src/graphql/CreateLnurlInvoice.ts +2 -0
- package/src/graphql/CreateUmaInvoice.ts +23 -0
- package/src/graphql/MultiNodeDashboard.ts +0 -3
- package/src/graphql/PayUmaInvoice.ts +29 -0
- package/src/graphql/RecoverNodeSigningKey.ts +1 -1
- package/src/graphql/SingleNodeDashboard.ts +0 -1
- package/src/lightspark_crypto/lightspark_crypto.d.ts +157 -0
- package/src/lightspark_crypto/lightspark_crypto.js +1010 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm +0 -0
- package/src/lightspark_crypto/lightspark_crypto_bg.wasm.d.ts +120 -0
- package/src/lightspark_crypto/package.json +11 -0
- package/src/objects/Account.ts +437 -120
- package/src/objects/AccountToApiTokensConnection.ts +3 -3
- package/src/objects/AccountToChannelsConnection.ts +4 -4
- package/src/objects/AccountToNodesConnection.ts +2 -15
- package/src/objects/AccountToPaymentRequestsConnection.ts +3 -3
- package/src/objects/AccountToTransactionsConnection.ts +6 -6
- package/src/objects/AccountToWalletsConnection.ts +2 -2
- package/src/objects/Balances.ts +2 -2
- package/src/objects/Channel.ts +4 -4
- package/src/objects/ChannelClosingTransaction.ts +2 -2
- package/src/objects/ChannelOpeningTransaction.ts +2 -2
- package/src/objects/ChannelToTransactionsConnection.ts +4 -4
- package/src/objects/{CryptoSanctionsScreeningProvider.ts → ComplianceProvider.ts} +3 -3
- package/src/objects/Connection.ts +25 -31
- package/src/objects/CreateApiTokenInput.ts +1 -1
- package/src/objects/CreateApiTokenOutput.ts +1 -1
- package/src/objects/CreateInvoiceInput.ts +0 -6
- package/src/objects/CreateLnurlInvoiceInput.ts +1 -7
- package/src/objects/CreateNodeWalletAddressInput.ts +1 -1
- package/src/objects/CreateNodeWalletAddressOutput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceInput.ts +1 -1
- package/src/objects/CreateTestModeInvoiceOutput.ts +1 -1
- package/src/objects/CreateTestModePaymentInput.ts +1 -1
- package/src/objects/CreateTestModePaymentoutput.ts +14 -2
- package/src/objects/CreateUmaInvoiceInput.ts +24 -0
- package/src/objects/DeclineToSignMessagesInput.ts +16 -0
- package/src/objects/DeclineToSignMessagesOutput.ts +28 -0
- package/src/objects/DeleteApiTokenOutput.ts +1 -1
- package/src/objects/Entity.ts +401 -66
- package/src/objects/GraphNode.ts +3 -3
- package/src/objects/IdAndSignature.ts +16 -0
- package/src/objects/IncomingPayment.ts +21 -8
- package/src/objects/IncomingPaymentAttempt.ts +2 -2
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/Invoice.ts +118 -21
- package/src/objects/InvoiceData.ts +118 -21
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +1 -1
- package/src/objects/LightningFeeEstimateForNodeInput.ts +1 -1
- package/src/objects/LightningFeeEstimateOutput.ts +2 -2
- package/src/objects/LightningTransaction.ts +155 -31
- package/src/objects/LightsparkNode.ts +272 -112
- package/src/objects/LightsparkNodeOwner.ts +8 -4
- package/src/objects/LightsparkNodeToChannelsConnection.ts +3 -3
- package/src/objects/LightsparkNodeWithOSK.ts +389 -0
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +384 -0
- package/src/objects/Node.ts +213 -60
- package/src/objects/NodeToAddressesConnection.ts +2 -2
- package/src/objects/OnChainTransaction.ts +2 -2
- package/src/objects/OutgoingPayment.ts +139 -24
- package/src/objects/OutgoingPaymentAttempt.ts +5 -5
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +3 -3
- package/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts +25 -0
- package/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts +28 -0
- package/src/objects/PayUmaInvoiceInput.ts +25 -0
- package/src/objects/{LightsparkNodePurpose.ts → PaymentDirection.ts} +5 -7
- package/src/objects/PaymentRequest.ts +119 -22
- package/src/objects/PaymentRequestData.ts +119 -22
- package/src/objects/PostTransactionData.ts +39 -0
- package/src/objects/RegisterPaymentInput.ts +31 -0
- package/src/objects/RegisterPaymentOutput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretInput.ts +23 -0
- package/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts +23 -0
- package/src/objects/ReleasePaymentPreimageInput.ts +20 -0
- package/src/objects/ReleasePaymentPreimageOutput.ts +23 -0
- package/src/objects/RemoteSigningSubEventType.ts +26 -0
- package/src/objects/RequestWithdrawalInput.ts +1 -1
- package/src/objects/RequestWithdrawalOutput.ts +1 -1
- package/src/objects/RoutingTransaction.ts +1 -1
- package/src/objects/ScreenNodeInput.ts +20 -0
- package/src/objects/ScreenNodeOutput.ts +22 -0
- package/src/objects/SetInvoicePaymentHashInput.ts +24 -0
- package/src/objects/SetInvoicePaymentHashOutput.ts +23 -0
- package/src/objects/SignInvoiceInput.ts +19 -0
- package/src/objects/SignInvoiceOutput.ts +21 -0
- package/src/objects/SignMessagesInput.ts +18 -0
- package/src/objects/SignMessagesOutput.ts +26 -0
- package/src/objects/Signable.ts +58 -0
- package/src/objects/SignablePayload.ts +93 -0
- package/src/objects/SignablePayloadStatus.ts +17 -0
- package/src/objects/SingleNodeDashboard.ts +0 -2
- package/src/objects/Transaction.ts +153 -29
- package/src/objects/TransactionFailures.ts +1 -1
- package/src/objects/UpdateChannelPerCommitmentPointInput.ts +25 -0
- package/src/objects/UpdateChannelPerCommitmentPointOutput.ts +23 -0
- package/src/objects/UpdateNodeSharedSecretInput.ts +18 -0
- package/src/objects/UpdateNodeSharedSecretOutput.ts +23 -0
- package/src/objects/Wallet.ts +271 -51
- package/src/objects/WalletToPaymentRequestsConnection.ts +3 -3
- package/src/objects/WalletToTransactionsConnection.ts +3 -3
- package/src/objects/WithdrawalRequest.ts +6 -6
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +2 -2
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +2 -2
- package/src/objects/index.ts +37 -4
- package/src/{__tests__ → tests}/webhooks.test.ts +1 -1
- package/src/webhooks.ts +1 -1
- package/src/objects/ScreenBitcoinAddressesInput.ts +0 -23
- package/src/objects/ScreenBitcoinAddressesOutput.ts +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Maybe, Query, AuthProvider, CryptoInterface, KeyOrAliasType } from '@lightsparkdev/core';
|
|
1
|
+
import { Maybe, Query, AuthProvider, CryptoInterface, SigningKey, KeyOrAliasType } from '@lightsparkdev/core';
|
|
2
2
|
import Observable from 'zen-observable';
|
|
3
3
|
|
|
4
4
|
/** This enum identifies the unit of currency associated with a CurrencyAmount. **/
|
|
@@ -44,18 +44,6 @@ type CurrencyAmount = {
|
|
|
44
44
|
preferredCurrencyValueApprox: number;
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
/** This is an enum of potential purposes set by a user for a Lightspark node. **/
|
|
48
|
-
declare enum LightsparkNodePurpose {
|
|
49
|
-
/**
|
|
50
|
-
* This is an enum value that represents values that could be added in the future.
|
|
51
|
-
* Clients should support unknown values as more of them could be added without notice.
|
|
52
|
-
*/
|
|
53
|
-
FUTURE_VALUE = "FUTURE_VALUE",
|
|
54
|
-
SEND = "SEND",
|
|
55
|
-
RECEIVE = "RECEIVE",
|
|
56
|
-
ROUTING = "ROUTING"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
47
|
declare enum LightsparkNodeStatus {
|
|
60
48
|
/**
|
|
61
49
|
* This is an enum value that represents values that could be added in the future.
|
|
@@ -93,7 +81,6 @@ type AccountDashboard = {
|
|
|
93
81
|
id: string;
|
|
94
82
|
color: Maybe<string>;
|
|
95
83
|
displayName: string;
|
|
96
|
-
purpose: Maybe<LightsparkNodePurpose>;
|
|
97
84
|
publicKey: Maybe<string>;
|
|
98
85
|
status: Maybe<LightsparkNodeStatus>;
|
|
99
86
|
addresses: {
|
|
@@ -417,34 +404,27 @@ declare class Node implements Entity {
|
|
|
417
404
|
static getNodeQuery(id: string): Query<Node>;
|
|
418
405
|
}
|
|
419
406
|
|
|
420
|
-
|
|
421
|
-
encryptedValue: string;
|
|
422
|
-
cipher: string;
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
/** This is a node that is managed by Lightspark and is managed within the current connected account. It contains many details about the node configuration, state, and metadata. **/
|
|
407
|
+
/** This is an object representing a node managed by Lightspark and owned by the current connected account. This object contains information about the node’s configuration, state, and metadata. **/
|
|
426
408
|
declare class LightsparkNode implements Node {
|
|
427
409
|
readonly id: string;
|
|
428
410
|
readonly createdAt: string;
|
|
429
411
|
readonly updatedAt: string;
|
|
430
412
|
readonly bitcoinNetwork: BitcoinNetwork;
|
|
431
413
|
readonly displayName: string;
|
|
432
|
-
readonly accountId: string;
|
|
433
414
|
readonly ownerId: string;
|
|
415
|
+
readonly umaPrescreeningUtxos: string[];
|
|
434
416
|
readonly typename: string;
|
|
435
417
|
readonly alias?: string | undefined;
|
|
436
418
|
readonly color?: string | undefined;
|
|
437
419
|
readonly conductivity?: number | undefined;
|
|
438
420
|
readonly publicKey?: string | undefined;
|
|
439
|
-
readonly
|
|
440
|
-
readonly encryptedSigningPrivateKey?: Secret | undefined;
|
|
421
|
+
readonly status?: LightsparkNodeStatus | undefined;
|
|
441
422
|
readonly totalBalance?: CurrencyAmount | undefined;
|
|
442
423
|
readonly totalLocalBalance?: CurrencyAmount | undefined;
|
|
443
424
|
readonly localBalance?: CurrencyAmount | undefined;
|
|
444
|
-
readonly purpose?: LightsparkNodePurpose | undefined;
|
|
445
425
|
readonly remoteBalance?: CurrencyAmount | undefined;
|
|
446
|
-
readonly
|
|
447
|
-
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string,
|
|
426
|
+
readonly blockchainBalance?: BlockchainBalance | undefined;
|
|
427
|
+
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string, ownerId: string, umaPrescreeningUtxos: string[], typename: string, alias?: string | undefined, color?: string | undefined, conductivity?: number | undefined, publicKey?: string | undefined, status?: LightsparkNodeStatus | undefined, totalBalance?: CurrencyAmount | undefined, totalLocalBalance?: CurrencyAmount | undefined, localBalance?: CurrencyAmount | undefined, remoteBalance?: CurrencyAmount | undefined, blockchainBalance?: BlockchainBalance | undefined);
|
|
448
428
|
getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
|
|
449
429
|
getChannels(client: LightsparkClient, first?: number | undefined, statuses?: ChannelStatus[] | undefined, after?: string | undefined): Promise<LightsparkNodeToChannelsConnection>;
|
|
450
430
|
static getLightsparkNodeQuery(id: string): Query<LightsparkNode>;
|
|
@@ -463,12 +443,6 @@ type AccountToNodesConnection = Connection & {
|
|
|
463
443
|
entities: LightsparkNode[];
|
|
464
444
|
/** The typename of the object **/
|
|
465
445
|
typename: string;
|
|
466
|
-
/**
|
|
467
|
-
* The main purpose for the selected set of nodes. It is automatically determined from the nodes that
|
|
468
|
-
* are selected in this connection and is used for optimization purposes, as well as to determine the
|
|
469
|
-
* variation of the UI that should be presented to the user.
|
|
470
|
-
**/
|
|
471
|
-
purpose?: LightsparkNodePurpose;
|
|
472
446
|
};
|
|
473
447
|
|
|
474
448
|
/** This object is an interface of a payment request on the Lightning Network (i.e., a Lightning Invoice). It contains data related to parsing the payment details of a Lightning Invoice. **/
|
|
@@ -703,7 +677,8 @@ declare class Wallet implements LightsparkNodeOwner {
|
|
|
703
677
|
readonly typename: string;
|
|
704
678
|
readonly lastLoginAt?: string | undefined;
|
|
705
679
|
readonly balances?: Balances | undefined;
|
|
706
|
-
|
|
680
|
+
readonly accountId?: string | undefined;
|
|
681
|
+
constructor(id: string, createdAt: string, updatedAt: string, thirdPartyIdentifier: string, status: WalletStatus, typename: string, lastLoginAt?: string | undefined, balances?: Balances | undefined, accountId?: string | undefined);
|
|
707
682
|
getTransactions(client: LightsparkClient, first?: number | undefined, after?: string | undefined, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined, statuses?: TransactionStatus[] | undefined, types?: TransactionType[] | undefined): Promise<WalletToTransactionsConnection>;
|
|
708
683
|
getPaymentRequests(client: LightsparkClient, first?: number | undefined, after?: string | undefined, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined): Promise<WalletToPaymentRequestsConnection>;
|
|
709
684
|
getTotalAmountReceived(client: LightsparkClient, createdAfterDate?: string | undefined, createdBeforeDate?: string | undefined): Promise<CurrencyAmount>;
|
|
@@ -1007,6 +982,17 @@ type OutgoingPaymentToAttemptsConnection = Connection & {
|
|
|
1007
982
|
typename: string;
|
|
1008
983
|
};
|
|
1009
984
|
|
|
985
|
+
/** This object represents post-transaction data that could be used to register payment for KYT. **/
|
|
986
|
+
type PostTransactionData = {
|
|
987
|
+
/**
|
|
988
|
+
* The utxo of the channel over which the payment went through in the format of
|
|
989
|
+
* <transaction_hash>:<output_index>.
|
|
990
|
+
**/
|
|
991
|
+
utxo: string;
|
|
992
|
+
/** The amount of funds transferred in the payment. **/
|
|
993
|
+
amount: CurrencyAmount;
|
|
994
|
+
};
|
|
995
|
+
|
|
1010
996
|
type RichText = {
|
|
1011
997
|
text: string;
|
|
1012
998
|
};
|
|
@@ -1027,7 +1013,8 @@ declare class OutgoingPayment implements LightningTransaction {
|
|
|
1027
1013
|
readonly paymentRequestData?: PaymentRequestData | undefined;
|
|
1028
1014
|
readonly failureReason?: PaymentFailureReason | undefined;
|
|
1029
1015
|
readonly failureMessage?: RichText | undefined;
|
|
1030
|
-
|
|
1016
|
+
readonly umaPostTransactionData?: PostTransactionData[] | undefined;
|
|
1017
|
+
constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, originId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, destinationId?: string | undefined, fees?: CurrencyAmount | undefined, paymentRequestData?: PaymentRequestData | undefined, failureReason?: PaymentFailureReason | undefined, failureMessage?: RichText | undefined, umaPostTransactionData?: PostTransactionData[] | undefined);
|
|
1031
1018
|
getAttempts(client: LightsparkClient, first?: number | undefined, after?: string | undefined): Promise<OutgoingPaymentToAttemptsConnection>;
|
|
1032
1019
|
static getOutgoingPaymentQuery(id: string): Query<OutgoingPayment>;
|
|
1033
1020
|
}
|
|
@@ -1035,7 +1022,6 @@ declare class OutgoingPayment implements LightningTransaction {
|
|
|
1035
1022
|
type SingleNodeDashboard = {
|
|
1036
1023
|
id: string;
|
|
1037
1024
|
displayName: string;
|
|
1038
|
-
purpose: Maybe<LightsparkNodePurpose>;
|
|
1039
1025
|
color: Maybe<string>;
|
|
1040
1026
|
publicKey: Maybe<string>;
|
|
1041
1027
|
status: Maybe<LightsparkNodeStatus>;
|
|
@@ -1277,6 +1263,27 @@ declare class WithdrawalRequest implements Entity {
|
|
|
1277
1263
|
static getWithdrawalRequestQuery(id: string): Query<WithdrawalRequest>;
|
|
1278
1264
|
}
|
|
1279
1265
|
|
|
1266
|
+
/**
|
|
1267
|
+
* Args for creating a new SigningKeyLoader. Must be one of the sub types.
|
|
1268
|
+
*/
|
|
1269
|
+
type SigningKeyLoaderArgs = NodeIdAndPasswordSigningKeyLoaderArgs | MasterSeedSigningKeyLoaderArgs;
|
|
1270
|
+
/**
|
|
1271
|
+
* Args for creating a new SigningKeyLoader from a node ID and password.
|
|
1272
|
+
* This cannot be used if you are using remote signing. It is used to recover an RSA operation signing key using
|
|
1273
|
+
* the password you chose when setting up your node. For REGTEST nodes, the password is "1234!@#$".
|
|
1274
|
+
*/
|
|
1275
|
+
interface NodeIdAndPasswordSigningKeyLoaderArgs {
|
|
1276
|
+
password: string;
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Args for creating a new SigningKeyLoader from a master seed and network.
|
|
1280
|
+
* This should be used if you are using remote signing, rather than an RSA operation signing key.
|
|
1281
|
+
*/
|
|
1282
|
+
interface MasterSeedSigningKeyLoaderArgs {
|
|
1283
|
+
masterSeed: Uint8Array;
|
|
1284
|
+
network: BitcoinNetwork;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1280
1287
|
/**
|
|
1281
1288
|
* The LightsparkClient is the main entrypoint for interacting with the Lightspark API.
|
|
1282
1289
|
*
|
|
@@ -1306,6 +1313,8 @@ declare class LightsparkClient {
|
|
|
1306
1313
|
private readonly cryptoImpl;
|
|
1307
1314
|
private requester;
|
|
1308
1315
|
private readonly nodeKeyCache;
|
|
1316
|
+
private readonly nodeKeyLoaderCache;
|
|
1317
|
+
private readonly LIGHTSPARK_SDK_ENDPOINT;
|
|
1309
1318
|
/**
|
|
1310
1319
|
* Constructs a new LightsparkClient.
|
|
1311
1320
|
*
|
|
@@ -1316,6 +1325,22 @@ declare class LightsparkClient {
|
|
|
1316
1325
|
* For React Native, you should use the `ReactNativeCrypto` implementation from `@lightsparkdev/react-native`.
|
|
1317
1326
|
*/
|
|
1318
1327
|
constructor(authProvider?: AuthProvider, serverUrl?: string, cryptoImpl?: CryptoInterface);
|
|
1328
|
+
/**
|
|
1329
|
+
* Sets the key loader for a node. This unlocks client operations that require a private key.
|
|
1330
|
+
* Passing in [NodeIdAndPasswordSigningKeyLoaderArgs] loads the RSA key for an OSK node.
|
|
1331
|
+
* Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a remote signing node.
|
|
1332
|
+
*
|
|
1333
|
+
* @param nodeId The ID of the node the key is for
|
|
1334
|
+
* @param loader The loader for the key
|
|
1335
|
+
*/
|
|
1336
|
+
loadNodeSigningKey(nodeId: string, loaderArgs: SigningKeyLoaderArgs): Promise<boolean>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Gets the signing key for a node. Must have previously called [loadNodeSigningKey].
|
|
1339
|
+
*
|
|
1340
|
+
* @param nodeId The ID of the node the key is for
|
|
1341
|
+
* @returns The signing key for the node
|
|
1342
|
+
*/
|
|
1343
|
+
getNodeSigningKey(nodeId: string): Promise<SigningKey | undefined>;
|
|
1319
1344
|
/**
|
|
1320
1345
|
* Sets the auth provider for the client. This is useful for switching between auth providers if you are using
|
|
1321
1346
|
* multiple accounts or waiting for the user to log in.
|
|
@@ -1380,9 +1405,10 @@ declare class LightsparkClient {
|
|
|
1380
1405
|
* @param type The type of invoice to create. Defaults to a normal payment invoice, but you can pass InvoiceType.AMP
|
|
1381
1406
|
* to create an [AMP invoice](https://docs.lightning.engineering/lightning-network-tools/lnd/amp), which can be
|
|
1382
1407
|
* paid multiple times.
|
|
1408
|
+
* @param expirySecs The number of seconds until the invoice expires. Defaults to 86400 (1 day).
|
|
1383
1409
|
* @returns An encoded payment request for the invoice, or undefined if the invoice could not be created.
|
|
1384
1410
|
*/
|
|
1385
|
-
createInvoice(nodeId: string, amountMsats: number, memo: string, type?: InvoiceType | undefined): Promise<string | undefined>;
|
|
1411
|
+
createInvoice(nodeId: string, amountMsats: number, memo: string, type?: InvoiceType | undefined, expirySecs?: number | undefined): Promise<string | undefined>;
|
|
1386
1412
|
/**
|
|
1387
1413
|
* Generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
|
|
1388
1414
|
* from another Lightning Node. This should only be used for generating invoices for LNURLs,
|
|
@@ -1395,9 +1421,25 @@ declare class LightsparkClient {
|
|
|
1395
1421
|
* @param metadata The LNURL metadata payload field in the initial payreq response. This wil be hashed and present in the
|
|
1396
1422
|
* h-tag (SHA256 purpose of payment) of the resulting Bolt 11 invoice. See
|
|
1397
1423
|
* [this spec](https://github.com/lnurl/luds/blob/luds/06.md#pay-to-static-qrnfclink) for details.
|
|
1424
|
+
* @param expirySecs The number of seconds until the invoice expires. Defaults to 86400 (1 day).
|
|
1425
|
+
* @returns An Invoice object representing the generated invoice.
|
|
1426
|
+
*/
|
|
1427
|
+
createLnurlInvoice(nodeId: string, amountMsats: number, metadata: string, expirySecs?: number | undefined): Promise<Invoice | undefined>;
|
|
1428
|
+
/**
|
|
1429
|
+
* Creates a new invoice for the UMA protocol. The metadata is hashed and included in the invoice.
|
|
1430
|
+
* This API generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment
|
|
1431
|
+
* from another Lightning Node. This should only be used for generating invoices for UMA, with `createInvoice`
|
|
1432
|
+
* preferred in the general case.
|
|
1433
|
+
*
|
|
1434
|
+
* @param nodeId The node ID for which to create an invoice.
|
|
1435
|
+
* @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount.
|
|
1436
|
+
* @param metadata The LNURL metadata payload field in the initial payreq response. This wil be hashed and present in the
|
|
1437
|
+
* h-tag (SHA256 purpose of payment) of the resulting Bolt 11 invoice. See
|
|
1438
|
+
* [this spec](https://github.com/lnurl/luds/blob/luds/06.md#pay-to-static-qrnfclink) for details.
|
|
1439
|
+
* @param expirySecs The number of seconds until the invoice expires. Defaults to 3600 (1 hour).
|
|
1398
1440
|
* @returns An Invoice object representing the generated invoice.
|
|
1399
1441
|
*/
|
|
1400
|
-
|
|
1442
|
+
createUmaInvoice(nodeId: string, amountMsats: number, metadata: string, expirySecs?: number | undefined): Promise<Invoice | undefined>;
|
|
1401
1443
|
/**
|
|
1402
1444
|
* Decodes an encoded lightning invoice string.
|
|
1403
1445
|
*
|
|
@@ -1431,15 +1473,6 @@ declare class LightsparkClient {
|
|
|
1431
1473
|
* @returns An estimate of the fees that will be paid to send a payment to another Lightning node.
|
|
1432
1474
|
*/
|
|
1433
1475
|
getLightningFeeEstimateForNode(nodeId: string, destinationNodePublicKey: string, amountMsats: number): Promise<CurrencyAmount>;
|
|
1434
|
-
/**
|
|
1435
|
-
* Unlock the given node for sensitive operations like sending payments.
|
|
1436
|
-
*
|
|
1437
|
-
* @param nodeId The ID of the node to unlock.
|
|
1438
|
-
* @param password The node password assigned at node creation.
|
|
1439
|
-
* @returns True if the node was unlocked successfully, false otherwise.
|
|
1440
|
-
*/
|
|
1441
|
-
unlockNode(nodeId: string, password: string): Promise<boolean>;
|
|
1442
|
-
private recoverNodeSigningKey;
|
|
1443
1476
|
/**
|
|
1444
1477
|
* Directly unlocks a node with a signing private key or alias.
|
|
1445
1478
|
*
|
|
@@ -1464,6 +1497,22 @@ declare class LightsparkClient {
|
|
|
1464
1497
|
* @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
|
|
1465
1498
|
*/
|
|
1466
1499
|
payInvoice(payerNodeId: string, encodedInvoice: string, maximumFeesMsats: number, timeoutSecs?: number, amountMsats?: number | undefined): Promise<OutgoingPayment | undefined>;
|
|
1500
|
+
/**
|
|
1501
|
+
* sends an UMA payment to a node on the Lightning Network, based on the invoice
|
|
1502
|
+
* (as defined by the BOLT11 specification) that you provide.
|
|
1503
|
+
* This should only be used for paying UMA invoices, with `payInvoice` preferred in the general case.
|
|
1504
|
+
*
|
|
1505
|
+
* @param payerNodeId The ID of the node that will pay the invoice.
|
|
1506
|
+
* @param encodedInvoice The encoded invoice to pay.
|
|
1507
|
+
* @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required.
|
|
1508
|
+
* As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example,
|
|
1509
|
+
* for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats.
|
|
1510
|
+
* @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds.
|
|
1511
|
+
* @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the
|
|
1512
|
+
* invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail.
|
|
1513
|
+
* @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed.
|
|
1514
|
+
*/
|
|
1515
|
+
payUmaInvoice(payerNodeId: string, encodedInvoice: string, maximumFeesMsats: number, timeoutSecs?: number, amountMsats?: number | undefined): Promise<OutgoingPayment | undefined>;
|
|
1467
1516
|
/**
|
|
1468
1517
|
* Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice.
|
|
1469
1518
|
*
|
|
@@ -1557,6 +1606,16 @@ declare class LightsparkClient {
|
|
|
1557
1606
|
executeRawQuery<T>(query: Query<T>): Promise<T | null>;
|
|
1558
1607
|
}
|
|
1559
1608
|
|
|
1609
|
+
/** This is an enum identifying a type of compliance provider. **/
|
|
1610
|
+
declare enum ComplianceProvider {
|
|
1611
|
+
/**
|
|
1612
|
+
* This is an enum value that represents values that could be added in the future.
|
|
1613
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
1614
|
+
*/
|
|
1615
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1616
|
+
CHAINALYSIS = "CHAINALYSIS"
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1560
1619
|
type CreateApiTokenInput = {
|
|
1561
1620
|
/** An arbitrary name that the user can choose to identify the API token in a list. **/
|
|
1562
1621
|
name: string;
|
|
@@ -1573,8 +1632,6 @@ type CreateInvoiceInput = {
|
|
|
1573
1632
|
invoiceType?: InvoiceType;
|
|
1574
1633
|
/** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/
|
|
1575
1634
|
expirySecs?: number;
|
|
1576
|
-
paymentHash?: string;
|
|
1577
|
-
preimageNonce?: string;
|
|
1578
1635
|
};
|
|
1579
1636
|
|
|
1580
1637
|
type CreateInvoiceOutput = {
|
|
@@ -1593,8 +1650,6 @@ type CreateLnurlInvoiceInput = {
|
|
|
1593
1650
|
metadataHash: string;
|
|
1594
1651
|
/** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/
|
|
1595
1652
|
expirySecs?: number;
|
|
1596
|
-
paymentHash?: string;
|
|
1597
|
-
preimageNonce?: string;
|
|
1598
1653
|
};
|
|
1599
1654
|
|
|
1600
1655
|
type CreateNodeWalletAddressInput = {
|
|
@@ -1631,20 +1686,70 @@ type CreateTestModePaymentInput = {
|
|
|
1631
1686
|
|
|
1632
1687
|
/** This is an object identifying the output of a test mode payment. This object can be used to retrieve the associated payment made from a Test Mode Payment call. **/
|
|
1633
1688
|
type CreateTestModePaymentoutput = {
|
|
1634
|
-
/**
|
|
1689
|
+
/**
|
|
1690
|
+
* The payment that has been sent.
|
|
1691
|
+
*
|
|
1692
|
+
* @deprecated Use incoming_payment instead.
|
|
1693
|
+
**/
|
|
1635
1694
|
paymentId: string;
|
|
1695
|
+
/** The payment that has been received. **/
|
|
1696
|
+
incomingPaymentId: string;
|
|
1697
|
+
};
|
|
1698
|
+
|
|
1699
|
+
type CreateUmaInvoiceInput = {
|
|
1700
|
+
nodeId: string;
|
|
1701
|
+
amountMsats: number;
|
|
1702
|
+
metadataHash: string;
|
|
1703
|
+
expirySecs?: number;
|
|
1636
1704
|
};
|
|
1637
1705
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1706
|
+
type DeclineToSignMessagesInput = {
|
|
1707
|
+
/** List of payload ids to decline to sign because validation failed. **/
|
|
1708
|
+
payloadIds: string[];
|
|
1709
|
+
};
|
|
1710
|
+
|
|
1711
|
+
declare enum SignablePayloadStatus {
|
|
1640
1712
|
/**
|
|
1641
1713
|
* This is an enum value that represents values that could be added in the future.
|
|
1642
1714
|
* Clients should support unknown values as more of them could be added without notice.
|
|
1643
1715
|
*/
|
|
1644
1716
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
1645
|
-
|
|
1717
|
+
CREATED = "CREATED",
|
|
1718
|
+
SIGNED = "SIGNED",
|
|
1719
|
+
VALIDATION_FAILED = "VALIDATION_FAILED"
|
|
1646
1720
|
}
|
|
1647
1721
|
|
|
1722
|
+
type SignablePayload = Entity & {
|
|
1723
|
+
/**
|
|
1724
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
1725
|
+
* string.
|
|
1726
|
+
**/
|
|
1727
|
+
id: string;
|
|
1728
|
+
/** The date and time when the entity was first created. **/
|
|
1729
|
+
createdAt: string;
|
|
1730
|
+
/** The date and time when the entity was last updated. **/
|
|
1731
|
+
updatedAt: string;
|
|
1732
|
+
/** The payload that needs to be signed. **/
|
|
1733
|
+
payload: string;
|
|
1734
|
+
/** The consistent method for generating the same set of accounts and wallets for a given private key **/
|
|
1735
|
+
derivationPath: string;
|
|
1736
|
+
/** The status of the payload. **/
|
|
1737
|
+
status: SignablePayloadStatus;
|
|
1738
|
+
/** The signable this payload belongs to. **/
|
|
1739
|
+
signableId: string;
|
|
1740
|
+
/** The typename of the object **/
|
|
1741
|
+
typename: string;
|
|
1742
|
+
/** The tweak value to add. **/
|
|
1743
|
+
addTweak?: string;
|
|
1744
|
+
/** The tweak value to multiply. **/
|
|
1745
|
+
mulTweak?: string;
|
|
1746
|
+
};
|
|
1747
|
+
declare const getSignablePayloadQuery: (id: string) => Query<SignablePayload>;
|
|
1748
|
+
|
|
1749
|
+
type DeclineToSignMessagesOutput = {
|
|
1750
|
+
declinedPayloads: SignablePayload[];
|
|
1751
|
+
};
|
|
1752
|
+
|
|
1648
1753
|
type DeleteApiTokenInput = {
|
|
1649
1754
|
apiTokenId: string;
|
|
1650
1755
|
};
|
|
@@ -1724,6 +1829,11 @@ declare class GraphNode implements Node {
|
|
|
1724
1829
|
static getGraphNodeQuery(id: string): Query<GraphNode>;
|
|
1725
1830
|
}
|
|
1726
1831
|
|
|
1832
|
+
type IdAndSignature = {
|
|
1833
|
+
id: string;
|
|
1834
|
+
signature: string;
|
|
1835
|
+
};
|
|
1836
|
+
|
|
1727
1837
|
/** This is an enum that enumerates all potential statuses for an incoming payment attempt. **/
|
|
1728
1838
|
declare enum IncomingPaymentAttemptStatus {
|
|
1729
1839
|
/**
|
|
@@ -1787,9 +1897,9 @@ declare class IncomingPayment implements LightningTransaction {
|
|
|
1787
1897
|
readonly typename: string;
|
|
1788
1898
|
readonly resolvedAt?: string | undefined;
|
|
1789
1899
|
readonly transactionHash?: string | undefined;
|
|
1790
|
-
readonly originId?: string | undefined;
|
|
1791
1900
|
readonly paymentRequestId?: string | undefined;
|
|
1792
|
-
|
|
1901
|
+
readonly umaPostTransactionData?: PostTransactionData[] | undefined;
|
|
1902
|
+
constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, destinationId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, paymentRequestId?: string | undefined, umaPostTransactionData?: PostTransactionData[] | undefined);
|
|
1793
1903
|
getAttempts(client: LightsparkClient, first?: number | undefined, statuses?: IncomingPaymentAttemptStatus[] | undefined, after?: string | undefined): Promise<IncomingPaymentToAttemptsConnection>;
|
|
1794
1904
|
static getIncomingPaymentQuery(id: string): Query<IncomingPayment>;
|
|
1795
1905
|
}
|
|
@@ -1820,6 +1930,75 @@ type LightningFeeEstimateOutput = {
|
|
|
1820
1930
|
feeEstimate: CurrencyAmount;
|
|
1821
1931
|
};
|
|
1822
1932
|
|
|
1933
|
+
type Secret = {
|
|
1934
|
+
encryptedValue: string;
|
|
1935
|
+
cipher: string;
|
|
1936
|
+
};
|
|
1937
|
+
|
|
1938
|
+
/** This is a Lightspark node with OSK. **/
|
|
1939
|
+
declare class LightsparkNodeWithOSK implements LightsparkNode {
|
|
1940
|
+
readonly id: string;
|
|
1941
|
+
readonly createdAt: string;
|
|
1942
|
+
readonly updatedAt: string;
|
|
1943
|
+
readonly bitcoinNetwork: BitcoinNetwork;
|
|
1944
|
+
readonly displayName: string;
|
|
1945
|
+
readonly ownerId: string;
|
|
1946
|
+
readonly umaPrescreeningUtxos: string[];
|
|
1947
|
+
readonly typename: string;
|
|
1948
|
+
readonly alias?: string | undefined;
|
|
1949
|
+
readonly color?: string | undefined;
|
|
1950
|
+
readonly conductivity?: number | undefined;
|
|
1951
|
+
readonly publicKey?: string | undefined;
|
|
1952
|
+
readonly status?: LightsparkNodeStatus | undefined;
|
|
1953
|
+
readonly totalBalance?: CurrencyAmount | undefined;
|
|
1954
|
+
readonly totalLocalBalance?: CurrencyAmount | undefined;
|
|
1955
|
+
readonly localBalance?: CurrencyAmount | undefined;
|
|
1956
|
+
readonly remoteBalance?: CurrencyAmount | undefined;
|
|
1957
|
+
readonly blockchainBalance?: BlockchainBalance | undefined;
|
|
1958
|
+
readonly encryptedSigningPrivateKey?: Secret | undefined;
|
|
1959
|
+
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string, ownerId: string, umaPrescreeningUtxos: string[], typename: string, alias?: string | undefined, color?: string | undefined, conductivity?: number | undefined, publicKey?: string | undefined, status?: LightsparkNodeStatus | undefined, totalBalance?: CurrencyAmount | undefined, totalLocalBalance?: CurrencyAmount | undefined, localBalance?: CurrencyAmount | undefined, remoteBalance?: CurrencyAmount | undefined, blockchainBalance?: BlockchainBalance | undefined, encryptedSigningPrivateKey?: Secret | undefined);
|
|
1960
|
+
getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
|
|
1961
|
+
getChannels(client: LightsparkClient, first?: number | undefined, statuses?: ChannelStatus[] | undefined, after?: string | undefined): Promise<LightsparkNodeToChannelsConnection>;
|
|
1962
|
+
static getLightsparkNodeWithOSKQuery(id: string): Query<LightsparkNodeWithOSK>;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
/** This is a Lightspark node with remote signing. **/
|
|
1966
|
+
declare class LightsparkNodeWithRemoteSigning implements LightsparkNode {
|
|
1967
|
+
readonly id: string;
|
|
1968
|
+
readonly createdAt: string;
|
|
1969
|
+
readonly updatedAt: string;
|
|
1970
|
+
readonly bitcoinNetwork: BitcoinNetwork;
|
|
1971
|
+
readonly displayName: string;
|
|
1972
|
+
readonly ownerId: string;
|
|
1973
|
+
readonly umaPrescreeningUtxos: string[];
|
|
1974
|
+
readonly typename: string;
|
|
1975
|
+
readonly alias?: string | undefined;
|
|
1976
|
+
readonly color?: string | undefined;
|
|
1977
|
+
readonly conductivity?: number | undefined;
|
|
1978
|
+
readonly publicKey?: string | undefined;
|
|
1979
|
+
readonly status?: LightsparkNodeStatus | undefined;
|
|
1980
|
+
readonly totalBalance?: CurrencyAmount | undefined;
|
|
1981
|
+
readonly totalLocalBalance?: CurrencyAmount | undefined;
|
|
1982
|
+
readonly localBalance?: CurrencyAmount | undefined;
|
|
1983
|
+
readonly remoteBalance?: CurrencyAmount | undefined;
|
|
1984
|
+
readonly blockchainBalance?: BlockchainBalance | undefined;
|
|
1985
|
+
constructor(id: string, createdAt: string, updatedAt: string, bitcoinNetwork: BitcoinNetwork, displayName: string, ownerId: string, umaPrescreeningUtxos: string[], typename: string, alias?: string | undefined, color?: string | undefined, conductivity?: number | undefined, publicKey?: string | undefined, status?: LightsparkNodeStatus | undefined, totalBalance?: CurrencyAmount | undefined, totalLocalBalance?: CurrencyAmount | undefined, localBalance?: CurrencyAmount | undefined, remoteBalance?: CurrencyAmount | undefined, blockchainBalance?: BlockchainBalance | undefined);
|
|
1986
|
+
getAddresses(client: LightsparkClient, first?: number | undefined, types?: NodeAddressType[] | undefined): Promise<NodeToAddressesConnection>;
|
|
1987
|
+
getChannels(client: LightsparkClient, first?: number | undefined, statuses?: ChannelStatus[] | undefined, after?: string | undefined): Promise<LightsparkNodeToChannelsConnection>;
|
|
1988
|
+
static getLightsparkNodeWithRemoteSigningQuery(id: string): Query<LightsparkNodeWithRemoteSigning>;
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
type OutgoingPaymentsForInvoiceQueryInput = {
|
|
1992
|
+
/** The encoded invoice that the outgoing payments paid to. **/
|
|
1993
|
+
encodedInvoice: string;
|
|
1994
|
+
/** An optional filter to only query outgoing payments of given statuses. **/
|
|
1995
|
+
statuses?: TransactionStatus[];
|
|
1996
|
+
};
|
|
1997
|
+
|
|
1998
|
+
type OutgoingPaymentsForInvoiceQueryOutput = {
|
|
1999
|
+
payments: OutgoingPayment[];
|
|
2000
|
+
};
|
|
2001
|
+
|
|
1823
2002
|
type PayInvoiceInput = {
|
|
1824
2003
|
/** The node from where you want to send the payment. **/
|
|
1825
2004
|
nodeId: string;
|
|
@@ -1841,6 +2020,73 @@ type PayInvoiceOutput = {
|
|
|
1841
2020
|
paymentId: string;
|
|
1842
2021
|
};
|
|
1843
2022
|
|
|
2023
|
+
/** This is an enum indicating the direction of the payment. **/
|
|
2024
|
+
declare enum PaymentDirection {
|
|
2025
|
+
/**
|
|
2026
|
+
* This is an enum value that represents values that could be added in the future.
|
|
2027
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
2028
|
+
*/
|
|
2029
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
2030
|
+
SENT = "SENT",
|
|
2031
|
+
RECEIVED = "RECEIVED"
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
type PayUmaInvoiceInput = {
|
|
2035
|
+
nodeId: string;
|
|
2036
|
+
encodedInvoice: string;
|
|
2037
|
+
timeoutSecs: number;
|
|
2038
|
+
maximumFeesMsats: number;
|
|
2039
|
+
amountMsats?: number;
|
|
2040
|
+
};
|
|
2041
|
+
|
|
2042
|
+
type RegisterPaymentInput = {
|
|
2043
|
+
provider: ComplianceProvider;
|
|
2044
|
+
paymentId: string;
|
|
2045
|
+
nodePubkey: string;
|
|
2046
|
+
direction: PaymentDirection;
|
|
2047
|
+
};
|
|
2048
|
+
|
|
2049
|
+
type RegisterPaymentOutput = {
|
|
2050
|
+
paymentId: string;
|
|
2051
|
+
};
|
|
2052
|
+
|
|
2053
|
+
type ReleaseChannelPerCommitmentSecretInput = {
|
|
2054
|
+
channelId: string;
|
|
2055
|
+
perCommitmentSecret: string;
|
|
2056
|
+
perCommitmentIndex: number;
|
|
2057
|
+
};
|
|
2058
|
+
|
|
2059
|
+
type ReleaseChannelPerCommitmentSecretOutput = {
|
|
2060
|
+
channelId: string;
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
type ReleasePaymentPreimageInput = {
|
|
2064
|
+
/** The invoice the preimage belongs to. **/
|
|
2065
|
+
invoiceId: string;
|
|
2066
|
+
/** The preimage to release. **/
|
|
2067
|
+
paymentPreimage: string;
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2070
|
+
type ReleasePaymentPreimageOutput = {
|
|
2071
|
+
invoiceId: string;
|
|
2072
|
+
};
|
|
2073
|
+
|
|
2074
|
+
/** This is an enum of the potential sub-event types for Remote Signing webook events. **/
|
|
2075
|
+
declare enum RemoteSigningSubEventType {
|
|
2076
|
+
/**
|
|
2077
|
+
* This is an enum value that represents values that could be added in the future.
|
|
2078
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
2079
|
+
*/
|
|
2080
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
2081
|
+
ECDH = "ECDH",
|
|
2082
|
+
GET_PER_COMMITMENT_POINT = "GET_PER_COMMITMENT_POINT",
|
|
2083
|
+
RELEASE_PER_COMMITMENT_SECRET = "RELEASE_PER_COMMITMENT_SECRET",
|
|
2084
|
+
SIGN_INVOICE = "SIGN_INVOICE",
|
|
2085
|
+
DERIVE_KEY_AND_SIGN = "DERIVE_KEY_AND_SIGN",
|
|
2086
|
+
RELEASE_PAYMENT_PREIMAGE = "RELEASE_PAYMENT_PREIMAGE",
|
|
2087
|
+
REQUEST_INVOICE_PAYMENT_HASH = "REQUEST_INVOICE_PAYMENT_HASH"
|
|
2088
|
+
}
|
|
2089
|
+
|
|
1844
2090
|
type RequestWithdrawalInput = {
|
|
1845
2091
|
/** The node from which you'd like to make the withdrawal. **/
|
|
1846
2092
|
nodeId: string;
|
|
@@ -1909,13 +2155,13 @@ type RoutingTransaction = LightningTransaction & Transaction & Entity & {
|
|
|
1909
2155
|
};
|
|
1910
2156
|
declare const getRoutingTransactionQuery: (id: string) => Query<RoutingTransaction>;
|
|
1911
2157
|
|
|
1912
|
-
type
|
|
1913
|
-
provider:
|
|
1914
|
-
|
|
2158
|
+
type ScreenNodeInput = {
|
|
2159
|
+
provider: ComplianceProvider;
|
|
2160
|
+
nodePubkey: string;
|
|
1915
2161
|
};
|
|
1916
2162
|
|
|
1917
|
-
type
|
|
1918
|
-
|
|
2163
|
+
type ScreenNodeOutput = {
|
|
2164
|
+
rating: RiskRating;
|
|
1919
2165
|
};
|
|
1920
2166
|
|
|
1921
2167
|
type SendPaymentInput = {
|
|
@@ -1936,6 +2182,71 @@ type SendPaymentOutput = {
|
|
|
1936
2182
|
paymentId: string;
|
|
1937
2183
|
};
|
|
1938
2184
|
|
|
2185
|
+
type SetInvoicePaymentHashInput = {
|
|
2186
|
+
/** The invoice that needs to be updated. **/
|
|
2187
|
+
invoiceId: string;
|
|
2188
|
+
/** The 32-byte hash of the payment preimage. **/
|
|
2189
|
+
paymentHash: string;
|
|
2190
|
+
/** The 32-byte nonce used to generate the invoice preimage. **/
|
|
2191
|
+
preimageNonce: string;
|
|
2192
|
+
};
|
|
2193
|
+
|
|
2194
|
+
type SetInvoicePaymentHashOutput = {
|
|
2195
|
+
invoiceId: string;
|
|
2196
|
+
};
|
|
2197
|
+
|
|
2198
|
+
type Signable = Entity & {
|
|
2199
|
+
/**
|
|
2200
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
|
|
2201
|
+
* string.
|
|
2202
|
+
**/
|
|
2203
|
+
id: string;
|
|
2204
|
+
/** The date and time when the entity was first created. **/
|
|
2205
|
+
createdAt: string;
|
|
2206
|
+
/** The date and time when the entity was last updated. **/
|
|
2207
|
+
updatedAt: string;
|
|
2208
|
+
/** The typename of the object **/
|
|
2209
|
+
typename: string;
|
|
2210
|
+
};
|
|
2211
|
+
declare const getSignableQuery: (id: string) => Query<Signable>;
|
|
2212
|
+
|
|
2213
|
+
type SignInvoiceInput = {
|
|
2214
|
+
invoiceId: string;
|
|
2215
|
+
signature: string;
|
|
2216
|
+
recoveryId: number;
|
|
2217
|
+
};
|
|
2218
|
+
|
|
2219
|
+
type SignInvoiceOutput = {
|
|
2220
|
+
invoiceId: string;
|
|
2221
|
+
};
|
|
2222
|
+
|
|
2223
|
+
type SignMessagesInput = {
|
|
2224
|
+
signatures: IdAndSignature[];
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
type SignMessagesOutput = {
|
|
2228
|
+
signedPayloads: SignablePayload[];
|
|
2229
|
+
};
|
|
2230
|
+
|
|
2231
|
+
type UpdateChannelPerCommitmentPointInput = {
|
|
2232
|
+
channelId: string;
|
|
2233
|
+
perCommitmentPoint: string;
|
|
2234
|
+
perCommitmentPointIndex: number;
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
type UpdateChannelPerCommitmentPointOutput = {
|
|
2238
|
+
channelId: string;
|
|
2239
|
+
};
|
|
2240
|
+
|
|
2241
|
+
type UpdateNodeSharedSecretInput = {
|
|
2242
|
+
nodeId: string;
|
|
2243
|
+
sharedSecret: string;
|
|
2244
|
+
};
|
|
2245
|
+
|
|
2246
|
+
type UpdateNodeSharedSecretOutput = {
|
|
2247
|
+
nodeId: string;
|
|
2248
|
+
};
|
|
2249
|
+
|
|
1939
2250
|
/** This is an enum of the potential event types that can be associated with your Lightspark wallets. **/
|
|
1940
2251
|
declare enum WebhookEventType {
|
|
1941
2252
|
/**
|
|
@@ -1998,4 +2309,4 @@ type Withdrawal = OnChainTransaction & Transaction & Entity & {
|
|
|
1998
2309
|
};
|
|
1999
2310
|
declare const getWithdrawalQuery: (id: string) => Query<Withdrawal>;
|
|
2000
2311
|
|
|
2001
|
-
export {
|
|
2312
|
+
export { IncomingPayment as $, Account as A, Balances as B, Channel as C, CreateTestModeInvoiceInput as D, CreateTestModeInvoiceOutput as E, CreateTestModePaymentInput as F, CreateTestModePaymentoutput as G, CreateUmaInvoiceInput as H, CurrencyAmount as I, CurrencyUnit as J, DeclineToSignMessagesInput as K, LightsparkClient as L, DeclineToSignMessagesOutput as M, DeleteApiTokenInput as N, DeleteApiTokenOutput as O, Deposit as P, getDepositQuery as Q, Entity as R, FeeEstimate as S, FundNodeInput as T, FundNodeOutput as U, GraphNode as V, WebhookEventType as W, Hop as X, getHopQuery as Y, HtlcAttemptFailureCode as Z, IdAndSignature as _, AccountToApiTokensConnection as a, SendPaymentOutput as a$, IncomingPaymentAttempt as a0, getIncomingPaymentAttemptQuery as a1, IncomingPaymentAttemptStatus as a2, IncomingPaymentToAttemptsConnection as a3, Invoice as a4, getInvoiceQuery as a5, InvoiceData as a6, InvoiceType as a7, LightningFeeEstimateForInvoiceInput as a8, LightningFeeEstimateForNodeInput as a9, PaymentDirection as aA, PaymentFailureReason as aB, PaymentRequest as aC, getPaymentRequestQuery as aD, PaymentRequestData as aE, PaymentRequestStatus as aF, PayUmaInvoiceInput as aG, Permission as aH, PostTransactionData as aI, RegisterPaymentInput as aJ, RegisterPaymentOutput as aK, ReleaseChannelPerCommitmentSecretInput as aL, ReleaseChannelPerCommitmentSecretOutput as aM, ReleasePaymentPreimageInput as aN, ReleasePaymentPreimageOutput as aO, RemoteSigningSubEventType as aP, RequestWithdrawalInput as aQ, RequestWithdrawalOutput as aR, RichText as aS, RiskRating as aT, RoutingTransaction as aU, getRoutingTransactionQuery as aV, RoutingTransactionFailureReason as aW, ScreenNodeInput as aX, ScreenNodeOutput as aY, Secret as aZ, SendPaymentInput as a_, LightningFeeEstimateOutput as aa, LightningTransaction as ab, getLightningTransactionQuery as ac, LightsparkNode as ad, LightsparkNodeOwner as ae, getLightsparkNodeOwnerQuery as af, LightsparkNodeStatus as ag, LightsparkNodeToChannelsConnection as ah, LightsparkNodeWithOSK as ai, LightsparkNodeWithRemoteSigning as aj, Node as ak, NodeAddress as al, NodeAddressType as am, NodeToAddressesConnection as an, OnChainTransaction as ao, getOnChainTransactionQuery as ap, OutgoingPayment as aq, OutgoingPaymentAttempt as ar, OutgoingPaymentAttemptStatus as as, OutgoingPaymentAttemptToHopsConnection as at, OutgoingPaymentsForInvoiceQueryInput as au, OutgoingPaymentsForInvoiceQueryOutput as av, OutgoingPaymentToAttemptsConnection as aw, PageInfo as ax, PayInvoiceInput as ay, PayInvoiceOutput as az, AccountToChannelsConnection as b, SetInvoicePaymentHashInput as b0, SetInvoicePaymentHashOutput as b1, Signable as b2, getSignableQuery as b3, SignablePayload as b4, getSignablePayloadQuery as b5, SignablePayloadStatus as b6, SignInvoiceInput as b7, SignInvoiceOutput as b8, SignMessagesInput as b9, SignMessagesOutput as ba, SingleNodeDashboard as bb, Transaction as bc, getTransactionQuery as bd, TransactionFailures as be, TransactionStatus as bf, TransactionType as bg, TransactionUpdate as bh, UpdateChannelPerCommitmentPointInput as bi, UpdateChannelPerCommitmentPointOutput as bj, UpdateNodeSharedSecretInput as bk, UpdateNodeSharedSecretOutput as bl, Wallet as bm, WalletStatus as bn, WalletToPaymentRequestsConnection as bo, WalletToTransactionsConnection as bp, Withdrawal as bq, getWithdrawalQuery as br, WithdrawalMode as bs, WithdrawalRequest as bt, WithdrawalRequestStatus as bu, WithdrawalRequestToChannelClosingTransactionsConnection as bv, WithdrawalRequestToChannelOpeningTransactionsConnection as bw, AccountToNodesConnection as c, AccountToPaymentRequestsConnection as d, AccountToTransactionsConnection as e, AccountToWalletsConnection as f, ApiToken as g, getApiTokenQuery as h, BitcoinNetwork as i, BlockchainBalance as j, ChannelClosingTransaction as k, getChannelClosingTransactionQuery as l, ChannelFees as m, ChannelOpeningTransaction as n, getChannelOpeningTransactionQuery as o, ChannelStatus as p, ChannelToTransactionsConnection as q, ComplianceProvider as r, Connection as s, CreateApiTokenInput as t, CreateApiTokenOutput as u, CreateInvoiceInput as v, CreateInvoiceOutput as w, CreateLnurlInvoiceInput as x, CreateNodeWalletAddressInput as y, CreateNodeWalletAddressOutput as z };
|