@lightsparkdev/lightspark-sdk 1.2.1 → 1.2.3
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/dist/{BitcoinNetwork-a816c0be.d.ts → BitcoinNetwork-37e9f091.d.ts} +8 -3
- package/dist/{chunk-VTPDR6P4.js → chunk-NCPWHRFO.js} +353 -15
- package/dist/env.d.cts +1 -1
- package/dist/env.d.ts +1 -1
- package/dist/{index-5acc6526.d.ts → index-449c9f58.d.ts} +2089 -644
- package/dist/index.cjs +1082 -470
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +584 -302
- package/dist/objects/index.cjs +345 -5
- package/dist/objects/index.d.cts +2 -2
- package/dist/objects/index.d.ts +2 -2
- package/dist/objects/index.js +9 -1
- package/package.json +4 -4
- package/src/NodeKeyLoaderCache.ts +4 -3
- package/src/SigningKeyLoader.ts +12 -7
- package/src/client.ts +287 -60
- package/src/env.ts +3 -1
- package/src/graphql/ClaimUmaInvitation.ts +21 -0
- package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
- package/src/graphql/CreateUmaInvitation.ts +19 -0
- package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
- package/src/graphql/FetchUmaInvitation.ts +15 -0
- package/src/objects/Account.ts +7 -3
- package/src/objects/AccountToApiTokensConnection.ts +7 -3
- package/src/objects/AccountToChannelsConnection.ts +3 -2
- package/src/objects/AccountToNodesConnection.ts +7 -3
- package/src/objects/AccountToPaymentRequestsConnection.ts +7 -3
- package/src/objects/AccountToTransactionsConnection.ts +13 -9
- package/src/objects/AccountToWalletsConnection.ts +7 -3
- package/src/objects/ApiToken.ts +13 -7
- package/src/objects/Balances.ts +22 -12
- package/src/objects/BitcoinNetwork.ts +8 -3
- package/src/objects/BlockchainBalance.ts +4 -1
- package/src/objects/Channel.ts +37 -14
- package/src/objects/ChannelClosingTransaction.ts +22 -11
- package/src/objects/ChannelFees.ts +4 -1
- package/src/objects/ChannelOpeningTransaction.ts +22 -11
- package/src/objects/ChannelStatus.ts +33 -8
- package/src/objects/ChannelToTransactionsConnection.ts +9 -8
- package/src/objects/ClaimUmaInvitationInput.ts +26 -0
- package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
- package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
- package/src/objects/ComplianceProvider.ts +3 -2
- package/src/objects/Connection.ts +7 -3
- package/src/objects/CreateApiTokenInput.ts +4 -1
- package/src/objects/CreateApiTokenOutput.ts +3 -3
- package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
- package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
- package/src/objects/CreateLnurlInvoiceInput.ts +3 -2
- package/src/objects/CreateTestModePaymentInput.ts +2 -2
- package/src/objects/CreateTestModePaymentoutput.ts +5 -1
- package/src/objects/CreateUmaInvitationInput.ts +22 -0
- package/src/objects/CreateUmaInvitationOutput.ts +30 -0
- package/src/objects/CurrencyAmount.ts +6 -4
- package/src/objects/CurrencyUnit.ts +36 -9
- package/src/objects/Deposit.ts +22 -11
- package/src/objects/Entity.ts +21 -3
- package/src/objects/FeeEstimate.ts +5 -1
- package/src/objects/GraphNode.ts +30 -14
- package/src/objects/Hop.ts +12 -4
- package/src/objects/HtlcAttemptFailureCode.ts +7 -3
- package/src/objects/IncentivesIneligibilityReason.ts +48 -0
- package/src/objects/IncentivesStatus.ts +28 -0
- package/src/objects/IncomingPayment.ts +18 -7
- package/src/objects/IncomingPaymentAttempt.ts +8 -3
- package/src/objects/IncomingPaymentAttemptStatus.ts +7 -3
- package/src/objects/IncomingPaymentToAttemptsConnection.ts +7 -3
- package/src/objects/Invoice.ts +2 -2
- package/src/objects/InvoiceData.ts +7 -3
- package/src/objects/InvoiceType.ts +3 -2
- package/src/objects/LightningFeeEstimateForInvoiceInput.ts +2 -2
- package/src/objects/LightningTransaction.ts +12 -4
- package/src/objects/LightsparkNode.ts +33 -18
- package/src/objects/LightsparkNodeOwner.ts +2 -2
- package/src/objects/LightsparkNodeStatus.ts +3 -2
- package/src/objects/LightsparkNodeToChannelsConnection.ts +7 -3
- package/src/objects/LightsparkNodeWithOSK.ts +35 -19
- package/src/objects/LightsparkNodeWithRemoteSigning.ts +31 -18
- package/src/objects/Node.ts +28 -14
- package/src/objects/NodeAddressType.ts +7 -3
- package/src/objects/NodeToAddressesConnection.ts +7 -3
- package/src/objects/OnChainTransaction.ts +23 -11
- package/src/objects/OutgoingPayment.ts +25 -7
- package/src/objects/OutgoingPaymentAttempt.ts +34 -14
- package/src/objects/OutgoingPaymentAttemptStatus.ts +7 -3
- package/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +12 -4
- package/src/objects/OutgoingPaymentToAttemptsConnection.ts +7 -3
- package/src/objects/PageInfo.ts +6 -1
- package/src/objects/PayInvoiceInput.ts +6 -3
- package/src/objects/PaymentDirection.ts +3 -2
- package/src/objects/PaymentFailureReason.ts +7 -3
- package/src/objects/PaymentRequest.ts +8 -3
- package/src/objects/PaymentRequestData.ts +5 -1
- package/src/objects/PaymentRequestStatus.ts +7 -3
- package/src/objects/Permission.ts +7 -3
- package/src/objects/PostTransactionData.ts +6 -3
- package/src/objects/RegionCode.ts +541 -0
- package/src/objects/RegisterPaymentInput.ts +12 -7
- package/src/objects/RemoteSigningSubEventType.ts +7 -3
- package/src/objects/RequestWithdrawalInput.ts +2 -2
- package/src/objects/RiskRating.ts +8 -3
- package/src/objects/RoutingTransaction.ts +20 -7
- package/src/objects/RoutingTransactionFailureReason.ts +8 -3
- package/src/objects/ScreenNodeInput.ts +3 -2
- package/src/objects/SendPaymentInput.ts +4 -1
- package/src/objects/SetInvoicePaymentHashInput.ts +3 -2
- package/src/objects/Signable.ts +2 -2
- package/src/objects/SignablePayload.ts +6 -3
- package/src/objects/SignablePayloadStatus.ts +3 -2
- package/src/objects/Transaction.ts +14 -4
- package/src/objects/TransactionFailures.ts +4 -1
- package/src/objects/TransactionStatus.ts +16 -5
- package/src/objects/TransactionType.ts +30 -8
- package/src/objects/TransactionUpdate.ts +6 -3
- package/src/objects/UmaInvitation.ts +119 -0
- package/src/objects/Wallet.ts +13 -4
- package/src/objects/WalletStatus.ts +36 -9
- package/src/objects/WalletToPaymentRequestsConnection.ts +7 -3
- package/src/objects/WalletToTransactionsConnection.ts +7 -3
- package/src/objects/WebhookEventType.ts +11 -3
- package/src/objects/Withdrawal.ts +22 -11
- package/src/objects/WithdrawalMode.ts +7 -3
- package/src/objects/WithdrawalRequest.ts +15 -6
- package/src/objects/WithdrawalRequestStatus.ts +3 -2
- package/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +11 -4
- package/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +11 -4
- package/src/objects/index.ts +21 -6
- package/src/tests/integration/constants.ts +0 -3
- package/src/tests/integration/general-regtest.test.ts +178 -197
|
@@ -1,25 +1,50 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This is an enum representing the status of a channel on the Lightning
|
|
5
|
+
* Network. *
|
|
6
|
+
*/
|
|
4
7
|
export enum ChannelStatus {
|
|
5
8
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
9
|
+
* This is an enum value that represents values that could be added in the
|
|
10
|
+
* future. Clients should support unknown values as more of them could be
|
|
11
|
+
* added without notice.
|
|
8
12
|
*/
|
|
9
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
14
|
/** The channel is online and ready to send and receive funds. **/
|
|
11
15
|
OK = "OK",
|
|
12
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The channel has been created, but the Bitcoin transaction that initiates
|
|
18
|
+
* it still needs to be confirmed on the Bitcoin blockchain.
|
|
19
|
+
* *
|
|
20
|
+
*/
|
|
13
21
|
PENDING = "PENDING",
|
|
14
22
|
/** The channel is not available, likely because the peer is not online. **/
|
|
15
23
|
OFFLINE = "OFFLINE",
|
|
16
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The channel is behaving properly, but its remote balance is much higher
|
|
26
|
+
* than its local balance so it is not balanced properly for sending funds
|
|
27
|
+
* out.
|
|
28
|
+
* *
|
|
29
|
+
*/
|
|
17
30
|
UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
|
|
18
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* The channel is behaving properly, but its remote balance is much lower
|
|
33
|
+
* than its local balance so it is not balanced properly for receiving funds.
|
|
34
|
+
* *
|
|
35
|
+
*/
|
|
19
36
|
UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
|
|
20
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* The channel has been closed. Information about the channel is still
|
|
39
|
+
* available for historical purposes but the channel cannot be used anymore.
|
|
40
|
+
* *
|
|
41
|
+
*/
|
|
21
42
|
CLOSED = "CLOSED",
|
|
22
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* Something unexpected happened and we cannot determine the status of this
|
|
45
|
+
* channel. Please try again later or contact the support.
|
|
46
|
+
* *
|
|
47
|
+
*/
|
|
23
48
|
ERROR = "ERROR",
|
|
24
49
|
}
|
|
25
50
|
|
|
@@ -8,26 +8,27 @@ import {
|
|
|
8
8
|
|
|
9
9
|
interface ChannelToTransactionsConnection {
|
|
10
10
|
/**
|
|
11
|
-
* The total count of objects in this connection, using the current filters.
|
|
12
|
-
* number of objects returned in the current page
|
|
11
|
+
* The total count of objects in this connection, using the current filters.
|
|
12
|
+
* It is different from the number of objects returned in the current page
|
|
13
|
+
* (in the `entities` field).
|
|
13
14
|
**/
|
|
14
15
|
count: number;
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* The average fee for the transactions that transited through this channel,
|
|
18
|
-
* and constraints of the connection.
|
|
18
|
+
* The average fee for the transactions that transited through this channel,
|
|
19
|
+
* according to the filters and constraints of the connection.
|
|
19
20
|
**/
|
|
20
21
|
averageFee?: CurrencyAmount | undefined;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* The total amount transacted for the transactions that transited through
|
|
24
|
-
* the filters and constraints of the connection.
|
|
24
|
+
* The total amount transacted for the transactions that transited through
|
|
25
|
+
* this channel, according to the filters and constraints of the connection.
|
|
25
26
|
**/
|
|
26
27
|
totalAmountTransacted?: CurrencyAmount | undefined;
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
* The total amount of fees for the transactions that transited through this
|
|
30
|
-
* filters and constraints of the connection.
|
|
30
|
+
* The total amount of fees for the transactions that transited through this
|
|
31
|
+
* channel, according to the filters and constraints of the connection.
|
|
31
32
|
**/
|
|
32
33
|
totalFees?: CurrencyAmount | undefined;
|
|
33
34
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface ClaimUmaInvitationInput {
|
|
4
|
+
invitationCode: string;
|
|
5
|
+
|
|
6
|
+
inviteeUma: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const ClaimUmaInvitationInputFromJson = (
|
|
10
|
+
obj: any,
|
|
11
|
+
): ClaimUmaInvitationInput => {
|
|
12
|
+
return {
|
|
13
|
+
invitationCode: obj["claim_uma_invitation_input_invitation_code"],
|
|
14
|
+
inviteeUma: obj["claim_uma_invitation_input_invitee_uma"],
|
|
15
|
+
} as ClaimUmaInvitationInput;
|
|
16
|
+
};
|
|
17
|
+
export const ClaimUmaInvitationInputToJson = (
|
|
18
|
+
obj: ClaimUmaInvitationInput,
|
|
19
|
+
): any => {
|
|
20
|
+
return {
|
|
21
|
+
claim_uma_invitation_input_invitation_code: obj.invitationCode,
|
|
22
|
+
claim_uma_invitation_input_invitee_uma: obj.inviteeUma,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default ClaimUmaInvitationInput;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface ClaimUmaInvitationOutput {
|
|
4
|
+
invitationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ClaimUmaInvitationOutputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): ClaimUmaInvitationOutput => {
|
|
10
|
+
return {
|
|
11
|
+
invitationId: obj["claim_uma_invitation_output_invitation"].id,
|
|
12
|
+
} as ClaimUmaInvitationOutput;
|
|
13
|
+
};
|
|
14
|
+
export const ClaimUmaInvitationOutputToJson = (
|
|
15
|
+
obj: ClaimUmaInvitationOutput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
claim_uma_invitation_output_invitation: { id: obj.invitationId },
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const FRAGMENT = `
|
|
23
|
+
fragment ClaimUmaInvitationOutputFragment on ClaimUmaInvitationOutput {
|
|
24
|
+
__typename
|
|
25
|
+
claim_uma_invitation_output_invitation: invitation {
|
|
26
|
+
id
|
|
27
|
+
}
|
|
28
|
+
}`;
|
|
29
|
+
|
|
30
|
+
export default ClaimUmaInvitationOutput;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import RegionCode from "./RegionCode.js";
|
|
4
|
+
|
|
5
|
+
interface ClaimUmaInvitationWithIncentivesInput {
|
|
6
|
+
invitationCode: string;
|
|
7
|
+
|
|
8
|
+
inviteeUma: string;
|
|
9
|
+
|
|
10
|
+
inviteePhoneHash: string;
|
|
11
|
+
|
|
12
|
+
inviteeRegion: RegionCode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ClaimUmaInvitationWithIncentivesInputFromJson = (
|
|
16
|
+
obj: any,
|
|
17
|
+
): ClaimUmaInvitationWithIncentivesInput => {
|
|
18
|
+
return {
|
|
19
|
+
invitationCode:
|
|
20
|
+
obj["claim_uma_invitation_with_incentives_input_invitation_code"],
|
|
21
|
+
inviteeUma: obj["claim_uma_invitation_with_incentives_input_invitee_uma"],
|
|
22
|
+
inviteePhoneHash:
|
|
23
|
+
obj["claim_uma_invitation_with_incentives_input_invitee_phone_hash"],
|
|
24
|
+
inviteeRegion:
|
|
25
|
+
RegionCode[
|
|
26
|
+
obj["claim_uma_invitation_with_incentives_input_invitee_region"]
|
|
27
|
+
] ?? RegionCode.FUTURE_VALUE,
|
|
28
|
+
} as ClaimUmaInvitationWithIncentivesInput;
|
|
29
|
+
};
|
|
30
|
+
export const ClaimUmaInvitationWithIncentivesInputToJson = (
|
|
31
|
+
obj: ClaimUmaInvitationWithIncentivesInput,
|
|
32
|
+
): any => {
|
|
33
|
+
return {
|
|
34
|
+
claim_uma_invitation_with_incentives_input_invitation_code:
|
|
35
|
+
obj.invitationCode,
|
|
36
|
+
claim_uma_invitation_with_incentives_input_invitee_uma: obj.inviteeUma,
|
|
37
|
+
claim_uma_invitation_with_incentives_input_invitee_phone_hash:
|
|
38
|
+
obj.inviteePhoneHash,
|
|
39
|
+
claim_uma_invitation_with_incentives_input_invitee_region:
|
|
40
|
+
obj.inviteeRegion,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default ClaimUmaInvitationWithIncentivesInput;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface ClaimUmaInvitationWithIncentivesOutput {
|
|
4
|
+
invitationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ClaimUmaInvitationWithIncentivesOutputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): ClaimUmaInvitationWithIncentivesOutput => {
|
|
10
|
+
return {
|
|
11
|
+
invitationId:
|
|
12
|
+
obj["claim_uma_invitation_with_incentives_output_invitation"].id,
|
|
13
|
+
} as ClaimUmaInvitationWithIncentivesOutput;
|
|
14
|
+
};
|
|
15
|
+
export const ClaimUmaInvitationWithIncentivesOutputToJson = (
|
|
16
|
+
obj: ClaimUmaInvitationWithIncentivesOutput,
|
|
17
|
+
): any => {
|
|
18
|
+
return {
|
|
19
|
+
claim_uma_invitation_with_incentives_output_invitation: {
|
|
20
|
+
id: obj.invitationId,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const FRAGMENT = `
|
|
26
|
+
fragment ClaimUmaInvitationWithIncentivesOutputFragment on ClaimUmaInvitationWithIncentivesOutput {
|
|
27
|
+
__typename
|
|
28
|
+
claim_uma_invitation_with_incentives_output_invitation: invitation {
|
|
29
|
+
id
|
|
30
|
+
}
|
|
31
|
+
}`;
|
|
32
|
+
|
|
33
|
+
export default ClaimUmaInvitationWithIncentivesOutput;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
/** This is an enum identifying a type of compliance provider. **/
|
|
4
4
|
export enum ComplianceProvider {
|
|
5
5
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
6
|
+
* This is an enum value that represents values that could be added in the
|
|
7
|
+
* future. Clients should support unknown values as more of them could be
|
|
8
|
+
* added without notice.
|
|
8
9
|
*/
|
|
9
10
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
11
|
|
|
@@ -39,12 +39,16 @@ import type WalletToTransactionsConnection from "./WalletToTransactionsConnectio
|
|
|
39
39
|
|
|
40
40
|
interface Connection {
|
|
41
41
|
/**
|
|
42
|
-
* The total count of objects in this connection, using the current filters.
|
|
43
|
-
* number of objects returned in the current page
|
|
42
|
+
* The total count of objects in this connection, using the current filters.
|
|
43
|
+
* It is different from the number of objects returned in the current page
|
|
44
|
+
* (in the `entities` field).
|
|
44
45
|
**/
|
|
45
46
|
count: number;
|
|
46
47
|
|
|
47
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* An object that holds pagination information about the objects in this
|
|
50
|
+
* connection. *
|
|
51
|
+
*/
|
|
48
52
|
pageInfo: PageInfo;
|
|
49
53
|
|
|
50
54
|
/** The typename of the object **/
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import Permission from "./Permission.js";
|
|
4
4
|
|
|
5
5
|
interface CreateApiTokenInput {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* An arbitrary name that the user can choose to identify the API token in a
|
|
8
|
+
* list. *
|
|
9
|
+
*/
|
|
7
10
|
name: string;
|
|
8
11
|
|
|
9
12
|
/** List of permissions to grant to the API token **/
|
|
@@ -8,9 +8,9 @@ interface CreateApiTokenOutput {
|
|
|
8
8
|
apiToken: ApiToken;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The secret that should be used to authenticate against our API.
|
|
12
|
-
* never be available again after this.
|
|
13
|
-
* account.
|
|
11
|
+
* The secret that should be used to authenticate against our API.
|
|
12
|
+
* This secret is not stored and will never be available again after this.
|
|
13
|
+
* You must keep this secret secure as it grants access to your account.
|
|
14
14
|
**/
|
|
15
15
|
clientSecret: string;
|
|
16
16
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import RegionCode from "./RegionCode.js";
|
|
4
|
+
|
|
5
|
+
interface CreateInvitationWithIncentivesInput {
|
|
6
|
+
inviterUma: string;
|
|
7
|
+
|
|
8
|
+
inviterPhoneHash: string;
|
|
9
|
+
|
|
10
|
+
inviterRegion: RegionCode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const CreateInvitationWithIncentivesInputFromJson = (
|
|
14
|
+
obj: any,
|
|
15
|
+
): CreateInvitationWithIncentivesInput => {
|
|
16
|
+
return {
|
|
17
|
+
inviterUma: obj["create_invitation_with_incentives_input_inviter_uma"],
|
|
18
|
+
inviterPhoneHash:
|
|
19
|
+
obj["create_invitation_with_incentives_input_inviter_phone_hash"],
|
|
20
|
+
inviterRegion:
|
|
21
|
+
RegionCode[
|
|
22
|
+
obj["create_invitation_with_incentives_input_inviter_region"]
|
|
23
|
+
] ?? RegionCode.FUTURE_VALUE,
|
|
24
|
+
} as CreateInvitationWithIncentivesInput;
|
|
25
|
+
};
|
|
26
|
+
export const CreateInvitationWithIncentivesInputToJson = (
|
|
27
|
+
obj: CreateInvitationWithIncentivesInput,
|
|
28
|
+
): any => {
|
|
29
|
+
return {
|
|
30
|
+
create_invitation_with_incentives_input_inviter_uma: obj.inviterUma,
|
|
31
|
+
create_invitation_with_incentives_input_inviter_phone_hash:
|
|
32
|
+
obj.inviterPhoneHash,
|
|
33
|
+
create_invitation_with_incentives_input_inviter_region: obj.inviterRegion,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default CreateInvitationWithIncentivesInput;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface CreateInvitationWithIncentivesOutput {
|
|
4
|
+
invitationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CreateInvitationWithIncentivesOutputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): CreateInvitationWithIncentivesOutput => {
|
|
10
|
+
return {
|
|
11
|
+
invitationId: obj["create_invitation_with_incentives_output_invitation"].id,
|
|
12
|
+
} as CreateInvitationWithIncentivesOutput;
|
|
13
|
+
};
|
|
14
|
+
export const CreateInvitationWithIncentivesOutputToJson = (
|
|
15
|
+
obj: CreateInvitationWithIncentivesOutput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
create_invitation_with_incentives_output_invitation: {
|
|
19
|
+
id: obj.invitationId,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const FRAGMENT = `
|
|
25
|
+
fragment CreateInvitationWithIncentivesOutputFragment on CreateInvitationWithIncentivesOutput {
|
|
26
|
+
__typename
|
|
27
|
+
create_invitation_with_incentives_output_invitation: invitation {
|
|
28
|
+
id
|
|
29
|
+
}
|
|
30
|
+
}`;
|
|
31
|
+
|
|
32
|
+
export default CreateInvitationWithIncentivesOutput;
|
|
@@ -8,8 +8,9 @@ interface CreateLnurlInvoiceInput {
|
|
|
8
8
|
amountMsats: number;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The SHA256 hash of the LNURL metadata payload.
|
|
12
|
-
*
|
|
11
|
+
* The SHA256 hash of the LNURL metadata payload.
|
|
12
|
+
* This will be present in the h-tag (SHA256 purpose of payment) of the
|
|
13
|
+
* resulting Bolt 11 invoice.
|
|
13
14
|
**/
|
|
14
15
|
metadataHash: string;
|
|
15
16
|
|
|
@@ -8,8 +8,8 @@ interface CreateTestModePaymentInput {
|
|
|
8
8
|
encodedInvoice: string;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* The amount you will be paid for this invoice, expressed in msats.
|
|
12
|
-
* invoice amount is zero.
|
|
11
|
+
* The amount you will be paid for this invoice, expressed in msats.
|
|
12
|
+
* It should ONLY be set when the invoice amount is zero.
|
|
13
13
|
**/
|
|
14
14
|
amountMsats?: number | undefined;
|
|
15
15
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This is an object identifying the output of a test mode payment.
|
|
5
|
+
* This object can be used to retrieve the associated payment made from a Test
|
|
6
|
+
* Mode Payment call. *
|
|
7
|
+
*/
|
|
4
8
|
interface CreateTestModePaymentoutput {
|
|
5
9
|
/**
|
|
6
10
|
* The payment that has been sent.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface CreateUmaInvitationInput {
|
|
4
|
+
inviterUma: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CreateUmaInvitationInputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): CreateUmaInvitationInput => {
|
|
10
|
+
return {
|
|
11
|
+
inviterUma: obj["create_uma_invitation_input_inviter_uma"],
|
|
12
|
+
} as CreateUmaInvitationInput;
|
|
13
|
+
};
|
|
14
|
+
export const CreateUmaInvitationInputToJson = (
|
|
15
|
+
obj: CreateUmaInvitationInput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
create_uma_invitation_input_inviter_uma: obj.inviterUma,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default CreateUmaInvitationInput;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface CreateUmaInvitationOutput {
|
|
4
|
+
invitationId: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CreateUmaInvitationOutputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): CreateUmaInvitationOutput => {
|
|
10
|
+
return {
|
|
11
|
+
invitationId: obj["create_uma_invitation_output_invitation"].id,
|
|
12
|
+
} as CreateUmaInvitationOutput;
|
|
13
|
+
};
|
|
14
|
+
export const CreateUmaInvitationOutputToJson = (
|
|
15
|
+
obj: CreateUmaInvitationOutput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
create_uma_invitation_output_invitation: { id: obj.invitationId },
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const FRAGMENT = `
|
|
23
|
+
fragment CreateUmaInvitationOutputFragment on CreateUmaInvitationOutput {
|
|
24
|
+
__typename
|
|
25
|
+
create_uma_invitation_output_invitation: invitation {
|
|
26
|
+
id
|
|
27
|
+
}
|
|
28
|
+
}`;
|
|
29
|
+
|
|
30
|
+
export default CreateUmaInvitationOutput;
|
|
@@ -14,14 +14,16 @@ interface CurrencyAmount {
|
|
|
14
14
|
preferredCurrencyUnit: CurrencyUnit;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* The rounded numeric value for this CurrencyAmount in the very base level
|
|
18
|
-
* currency. For example, for USD, the value will be in
|
|
17
|
+
* The rounded numeric value for this CurrencyAmount in the very base level
|
|
18
|
+
* of user's preferred currency. For example, for USD, the value will be in
|
|
19
|
+
* cents.
|
|
19
20
|
**/
|
|
20
21
|
preferredCurrencyValueRounded: number;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
|
-
* The approximate float value for this CurrencyAmount in the very base level
|
|
24
|
-
* currency. For example, for USD, the value will be in
|
|
24
|
+
* The approximate float value for this CurrencyAmount in the very base level
|
|
25
|
+
* of user's preferred currency. For example, for USD, the value will be in
|
|
26
|
+
* cents.
|
|
25
27
|
**/
|
|
26
28
|
preferredCurrencyValueApprox: number;
|
|
27
29
|
}
|
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This enum identifies the unit of currency associated with a CurrencyAmount.
|
|
5
|
+
* *
|
|
6
|
+
*/
|
|
4
7
|
export enum CurrencyUnit {
|
|
5
8
|
/**
|
|
6
|
-
* This is an enum value that represents values that could be added in the
|
|
7
|
-
* Clients should support unknown values as more of them could be
|
|
9
|
+
* This is an enum value that represents values that could be added in the
|
|
10
|
+
* future. Clients should support unknown values as more of them could be
|
|
11
|
+
* added without notice.
|
|
8
12
|
*/
|
|
9
13
|
FUTURE_VALUE = "FUTURE_VALUE",
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Bitcoin is the cryptocurrency native to the Bitcoin network.
|
|
16
|
+
* It is used as the native medium for value transfer for the Lightning
|
|
17
|
+
* Network. *
|
|
18
|
+
*/
|
|
11
19
|
BITCOIN = "BITCOIN",
|
|
12
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin.
|
|
22
|
+
* This is the unit most commonly used in Lightning transactions.
|
|
23
|
+
* *
|
|
24
|
+
*/
|
|
13
25
|
SATOSHI = "SATOSHI",
|
|
14
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit
|
|
28
|
+
* instead when possible. *
|
|
29
|
+
*/
|
|
15
30
|
MILLISATOSHI = "MILLISATOSHI",
|
|
16
31
|
/** United States Dollar. **/
|
|
17
32
|
USD = "USD",
|
|
18
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin.
|
|
35
|
+
* We recommend using the Satoshi unit instead when possible.
|
|
36
|
+
* *
|
|
37
|
+
*/
|
|
19
38
|
NANOBITCOIN = "NANOBITCOIN",
|
|
20
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin.
|
|
41
|
+
* We recommend using the Satoshi unit instead when possible.
|
|
42
|
+
* *
|
|
43
|
+
*/
|
|
21
44
|
MICROBITCOIN = "MICROBITCOIN",
|
|
22
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin.
|
|
47
|
+
* We recommend using the Satoshi unit instead when possible.
|
|
48
|
+
* *
|
|
49
|
+
*/
|
|
23
50
|
MILLIBITCOIN = "MILLIBITCOIN",
|
|
24
51
|
}
|
|
25
52
|
|
package/src/objects/Deposit.ts
CHANGED
|
@@ -8,11 +8,16 @@ import {
|
|
|
8
8
|
} from "./CurrencyAmount.js";
|
|
9
9
|
import TransactionStatus from "./TransactionStatus.js";
|
|
10
10
|
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* This object represents a Deposit made to a Lightspark node wallet.
|
|
13
|
+
* This operation occurs for any L1 funding transaction to the wallet.
|
|
14
|
+
* You can retrieve this object to receive detailed information about the
|
|
15
|
+
* deposit. *
|
|
16
|
+
*/
|
|
12
17
|
interface Deposit {
|
|
13
18
|
/**
|
|
14
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
15
|
-
* string.
|
|
19
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
20
|
+
* Should be treated as an opaque string.
|
|
16
21
|
**/
|
|
17
22
|
id: string;
|
|
18
23
|
|
|
@@ -29,8 +34,8 @@ interface Deposit {
|
|
|
29
34
|
amount: CurrencyAmount;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
* The height of the block that included this transaction.
|
|
33
|
-
* transactions.
|
|
37
|
+
* The height of the block that included this transaction.
|
|
38
|
+
* This will be zero for unconfirmed transactions.
|
|
34
39
|
**/
|
|
35
40
|
blockHeight: number;
|
|
36
41
|
|
|
@@ -46,22 +51,28 @@ interface Deposit {
|
|
|
46
51
|
/** The date and time when this transaction was completed or failed. **/
|
|
47
52
|
resolvedAt?: string | undefined;
|
|
48
53
|
|
|
49
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* The hash of this transaction, so it can be uniquely identified on the
|
|
56
|
+
* Lightning Network. *
|
|
57
|
+
*/
|
|
50
58
|
transactionHash?: string | undefined;
|
|
51
59
|
|
|
52
60
|
/**
|
|
53
|
-
* The fees that were paid by the wallet sending the transaction to commit it
|
|
54
|
-
* blockchain.
|
|
61
|
+
* The fees that were paid by the wallet sending the transaction to commit it
|
|
62
|
+
* to the Bitcoin blockchain.
|
|
55
63
|
**/
|
|
56
64
|
fees?: CurrencyAmount | undefined;
|
|
57
65
|
|
|
58
66
|
/**
|
|
59
|
-
* The hash of the block that included this transaction.
|
|
60
|
-
* transactions.
|
|
67
|
+
* The hash of the block that included this transaction.
|
|
68
|
+
* This will be null for unconfirmed transactions.
|
|
61
69
|
**/
|
|
62
70
|
blockHash?: string | undefined;
|
|
63
71
|
|
|
64
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* The number of blockchain confirmations for this transaction in real time.
|
|
74
|
+
* *
|
|
75
|
+
*/
|
|
65
76
|
numConfirmations?: number | undefined;
|
|
66
77
|
}
|
|
67
78
|
|
package/src/objects/Entity.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* This interface is used by all the entities in the Lightspark system.
|
|
5
|
+
* It defines a few core fields that are available everywhere.
|
|
6
|
+
* Any object that implements this interface can be queried using the `entity`
|
|
7
|
+
* query and its ID. *
|
|
8
|
+
*/
|
|
4
9
|
interface Entity {
|
|
5
10
|
/**
|
|
6
|
-
* The unique identifier of this entity across all Lightspark systems.
|
|
7
|
-
* string.
|
|
11
|
+
* The unique identifier of this entity across all Lightspark systems.
|
|
12
|
+
* Should be treated as an opaque string.
|
|
8
13
|
**/
|
|
9
14
|
id: string;
|
|
10
15
|
|
|
@@ -1237,6 +1242,7 @@ fragment EntityFragment on Entity {
|
|
|
1237
1242
|
outgoing_payment_attempt_status: status
|
|
1238
1243
|
outgoing_payment_attempt_failure_code: failure_code
|
|
1239
1244
|
outgoing_payment_attempt_failure_source_index: failure_source_index
|
|
1245
|
+
outgoing_payment_attempt_attempted_at: attempted_at
|
|
1240
1246
|
outgoing_payment_attempt_resolved_at: resolved_at
|
|
1241
1247
|
outgoing_payment_attempt_amount: amount {
|
|
1242
1248
|
__typename
|
|
@@ -1361,6 +1367,18 @@ fragment EntityFragment on Entity {
|
|
|
1361
1367
|
id
|
|
1362
1368
|
}
|
|
1363
1369
|
}
|
|
1370
|
+
... on UmaInvitation {
|
|
1371
|
+
__typename
|
|
1372
|
+
uma_invitation_id: id
|
|
1373
|
+
uma_invitation_created_at: created_at
|
|
1374
|
+
uma_invitation_updated_at: updated_at
|
|
1375
|
+
uma_invitation_code: code
|
|
1376
|
+
uma_invitation_url: url
|
|
1377
|
+
uma_invitation_inviter_uma: inviter_uma
|
|
1378
|
+
uma_invitation_invitee_uma: invitee_uma
|
|
1379
|
+
uma_invitation_incentives_status: incentives_status
|
|
1380
|
+
uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
|
|
1381
|
+
}
|
|
1364
1382
|
... on Wallet {
|
|
1365
1383
|
__typename
|
|
1366
1384
|
wallet_id: id
|
|
@@ -6,7 +6,11 @@ import {
|
|
|
6
6
|
CurrencyAmountToJson,
|
|
7
7
|
} from "./CurrencyAmount.js";
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* This object represents the estimated L1 transaction fees for the Bitcoin
|
|
11
|
+
* network. Fee estimates are separated by potential confirmation speeds for
|
|
12
|
+
* settlement. *
|
|
13
|
+
*/
|
|
10
14
|
interface FeeEstimate {
|
|
11
15
|
feeFast: CurrencyAmount;
|
|
12
16
|
|