@lightsparkdev/lightspark-sdk 1.9.4 → 1.9.6
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/{chunk-VCNFGP4P.js → chunk-INED3BP4.js} +84 -47
- package/dist/{index-CCNALIhi.d.cts → index-B_qpP_0o.d.cts} +120 -36
- package/dist/{index-gyjGw7N4.d.ts → index-CZqitvax.d.ts} +120 -36
- package/dist/index.cjs +103 -46
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -4
- package/dist/objects/index.cjs +83 -44
- package/dist/objects/index.d.cts +1 -1
- package/dist/objects/index.d.ts +1 -1
- package/dist/objects/index.js +5 -1
- package/package.json +3 -3
- package/src/client.ts +13 -0
- package/src/graphql/LookupUmaAddress.ts +9 -0
- package/src/objects/CancelUmaInvitationInput.ts +22 -0
- package/src/objects/CancelUmaInvitationOutput.ts +30 -0
- package/src/objects/ChannelStatus.ts +2 -2
- package/src/objects/CreateInvitationWithIncentivesInput.ts +7 -0
- package/src/objects/CreateInvoiceInput.ts +10 -4
- package/src/objects/CreateLnurlInvoiceInput.ts +18 -0
- package/src/objects/CreateUmaInvitationInput.ts +5 -0
- package/src/objects/CreateUmaInvoiceInput.ts +18 -0
- package/src/objects/CurrencyUnit.ts +8 -3
- package/src/objects/Entity.ts +21 -0
- package/src/objects/LookupUmaAddressInput.ts +22 -0
- package/src/objects/Permission.ts +6 -0
- package/src/objects/TransactionStatus.ts +2 -3
- package/src/objects/UmaCurrency.ts +100 -0
- package/src/objects/UmaCurrencyAmount.ts +24 -37
- package/src/objects/UmaInvitation.ts +37 -33
- package/src/objects/UmaInvitationStatus.ts +19 -0
- package/src/objects/WalletStatus.ts +2 -2
- package/src/objects/WebhookEventType.ts +2 -0
- package/src/objects/index.ts +6 -0
|
@@ -16,10 +16,7 @@ interface CreateInvoiceInput {
|
|
|
16
16
|
|
|
17
17
|
invoiceType?: InvoiceType | undefined;
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* The expiry of the invoice in seconds. Default value is 86400 (1 day) for AMP invoice, or
|
|
21
|
-
* 3600 (1 hour) for STANDARD invoice.
|
|
22
|
-
**/
|
|
19
|
+
/** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/
|
|
23
20
|
expirySecs?: number | undefined;
|
|
24
21
|
|
|
25
22
|
/**
|
|
@@ -28,6 +25,13 @@ interface CreateInvoiceInput {
|
|
|
28
25
|
* REQUEST_INVOICE_PAYMENT_HASH.
|
|
29
26
|
**/
|
|
30
27
|
paymentHash?: string | undefined;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The 32-byte nonce used to generate the invoice preimage if applicable. It will later be
|
|
31
|
+
* included in RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage. This can only
|
|
32
|
+
* be specified when `payment_hash` is specified.
|
|
33
|
+
**/
|
|
34
|
+
preimageNonce?: string | undefined;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => {
|
|
@@ -41,6 +45,7 @@ export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => {
|
|
|
41
45
|
: null,
|
|
42
46
|
expirySecs: obj["create_invoice_input_expiry_secs"],
|
|
43
47
|
paymentHash: obj["create_invoice_input_payment_hash"],
|
|
48
|
+
preimageNonce: obj["create_invoice_input_preimage_nonce"],
|
|
44
49
|
} as CreateInvoiceInput;
|
|
45
50
|
};
|
|
46
51
|
export const CreateInvoiceInputToJson = (obj: CreateInvoiceInput): any => {
|
|
@@ -51,6 +56,7 @@ export const CreateInvoiceInputToJson = (obj: CreateInvoiceInput): any => {
|
|
|
51
56
|
create_invoice_input_invoice_type: obj.invoiceType,
|
|
52
57
|
create_invoice_input_expiry_secs: obj.expirySecs,
|
|
53
58
|
create_invoice_input_payment_hash: obj.paymentHash,
|
|
59
|
+
create_invoice_input_preimage_nonce: obj.preimageNonce,
|
|
54
60
|
};
|
|
55
61
|
};
|
|
56
62
|
|
|
@@ -19,6 +19,20 @@ interface CreateLnurlInvoiceInput {
|
|
|
19
19
|
/** An optional, monthly-rotated, unique hashed identifier corresponding to the receiver of the
|
|
20
20
|
* payment. **/
|
|
21
21
|
receiverHash?: string | undefined;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The payment hash of the invoice. It should only be set if your node is a remote signing
|
|
25
|
+
* node, or if you are creating a hodl invoice. If not set, it will be requested through
|
|
26
|
+
* REMOTE_SIGNING webhooks with sub event type REQUEST_INVOICE_PAYMENT_HASH.
|
|
27
|
+
**/
|
|
28
|
+
paymentHash?: string | undefined;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The 32-byte nonce used to generate the invoice preimage if applicable. It will later be
|
|
32
|
+
* included in RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage. This can only
|
|
33
|
+
* be specified when `payment_hash` is specified.
|
|
34
|
+
**/
|
|
35
|
+
preimageNonce?: string | undefined;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
38
|
export const CreateLnurlInvoiceInputFromJson = (
|
|
@@ -30,6 +44,8 @@ export const CreateLnurlInvoiceInputFromJson = (
|
|
|
30
44
|
metadataHash: obj["create_lnurl_invoice_input_metadata_hash"],
|
|
31
45
|
expirySecs: obj["create_lnurl_invoice_input_expiry_secs"],
|
|
32
46
|
receiverHash: obj["create_lnurl_invoice_input_receiver_hash"],
|
|
47
|
+
paymentHash: obj["create_lnurl_invoice_input_payment_hash"],
|
|
48
|
+
preimageNonce: obj["create_lnurl_invoice_input_preimage_nonce"],
|
|
33
49
|
} as CreateLnurlInvoiceInput;
|
|
34
50
|
};
|
|
35
51
|
export const CreateLnurlInvoiceInputToJson = (
|
|
@@ -41,6 +57,8 @@ export const CreateLnurlInvoiceInputToJson = (
|
|
|
41
57
|
create_lnurl_invoice_input_metadata_hash: obj.metadataHash,
|
|
42
58
|
create_lnurl_invoice_input_expiry_secs: obj.expirySecs,
|
|
43
59
|
create_lnurl_invoice_input_receiver_hash: obj.receiverHash,
|
|
60
|
+
create_lnurl_invoice_input_payment_hash: obj.paymentHash,
|
|
61
|
+
create_lnurl_invoice_input_preimage_nonce: obj.preimageNonce,
|
|
44
62
|
};
|
|
45
63
|
};
|
|
46
64
|
|
|
@@ -6,6 +6,9 @@ interface CreateUmaInvitationInput {
|
|
|
6
6
|
* receiving the invitation.
|
|
7
7
|
**/
|
|
8
8
|
inviterUma: string;
|
|
9
|
+
|
|
10
|
+
/** The optional first name of the user creating the invitation. **/
|
|
11
|
+
inviterFirstName?: string | undefined;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export const CreateUmaInvitationInputFromJson = (
|
|
@@ -13,6 +16,7 @@ export const CreateUmaInvitationInputFromJson = (
|
|
|
13
16
|
): CreateUmaInvitationInput => {
|
|
14
17
|
return {
|
|
15
18
|
inviterUma: obj["create_uma_invitation_input_inviter_uma"],
|
|
19
|
+
inviterFirstName: obj["create_uma_invitation_input_inviter_first_name"],
|
|
16
20
|
} as CreateUmaInvitationInput;
|
|
17
21
|
};
|
|
18
22
|
export const CreateUmaInvitationInputToJson = (
|
|
@@ -20,6 +24,7 @@ export const CreateUmaInvitationInputToJson = (
|
|
|
20
24
|
): any => {
|
|
21
25
|
return {
|
|
22
26
|
create_uma_invitation_input_inviter_uma: obj.inviterUma,
|
|
27
|
+
create_uma_invitation_input_inviter_first_name: obj.inviterFirstName,
|
|
23
28
|
};
|
|
24
29
|
};
|
|
25
30
|
|
|
@@ -19,6 +19,20 @@ interface CreateUmaInvoiceInput {
|
|
|
19
19
|
/** An optional, monthly-rotated, unique hashed identifier corresponding to the receiver of the
|
|
20
20
|
* payment. **/
|
|
21
21
|
receiverHash?: string | undefined;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The payment hash of the invoice. It should only be set if your node is a remote signing
|
|
25
|
+
* node, or if you are creating a hodl invoice. If not set, it will be requested through
|
|
26
|
+
* REMOTE_SIGNING webhooks with sub event type REQUEST_INVOICE_PAYMENT_HASH.
|
|
27
|
+
**/
|
|
28
|
+
paymentHash?: string | undefined;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The 32-byte nonce used to generate the invoice preimage if applicable. It will later be
|
|
32
|
+
* included in RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage. This can only
|
|
33
|
+
* be specified when `payment_hash` is specified.
|
|
34
|
+
**/
|
|
35
|
+
preimageNonce?: string | undefined;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
38
|
export const CreateUmaInvoiceInputFromJson = (
|
|
@@ -30,6 +44,8 @@ export const CreateUmaInvoiceInputFromJson = (
|
|
|
30
44
|
metadataHash: obj["create_uma_invoice_input_metadata_hash"],
|
|
31
45
|
expirySecs: obj["create_uma_invoice_input_expiry_secs"],
|
|
32
46
|
receiverHash: obj["create_uma_invoice_input_receiver_hash"],
|
|
47
|
+
paymentHash: obj["create_uma_invoice_input_payment_hash"],
|
|
48
|
+
preimageNonce: obj["create_uma_invoice_input_preimage_nonce"],
|
|
33
49
|
} as CreateUmaInvoiceInput;
|
|
34
50
|
};
|
|
35
51
|
export const CreateUmaInvoiceInputToJson = (
|
|
@@ -41,6 +57,8 @@ export const CreateUmaInvoiceInputToJson = (
|
|
|
41
57
|
create_uma_invoice_input_metadata_hash: obj.metadataHash,
|
|
42
58
|
create_uma_invoice_input_expiry_secs: obj.expirySecs,
|
|
43
59
|
create_uma_invoice_input_receiver_hash: obj.receiverHash,
|
|
60
|
+
create_uma_invoice_input_payment_hash: obj.paymentHash,
|
|
61
|
+
create_uma_invoice_input_preimage_nonce: obj.preimageNonce,
|
|
44
62
|
};
|
|
45
63
|
};
|
|
46
64
|
|
|
@@ -17,9 +17,8 @@ export enum CurrencyUnit {
|
|
|
17
17
|
* commonly used in Lightning transactions. *
|
|
18
18
|
*/
|
|
19
19
|
SATOSHI = "SATOSHI",
|
|
20
|
-
/**
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
20
|
+
/** 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when
|
|
21
|
+
* possible. **/
|
|
23
22
|
MILLISATOSHI = "MILLISATOSHI",
|
|
24
23
|
/** United States Dollar. **/
|
|
25
24
|
USD = "USD",
|
|
@@ -27,6 +26,12 @@ export enum CurrencyUnit {
|
|
|
27
26
|
MXN = "MXN",
|
|
28
27
|
/** Philippine Peso. **/
|
|
29
28
|
PHP = "PHP",
|
|
29
|
+
/** Euro. **/
|
|
30
|
+
EUR = "EUR",
|
|
31
|
+
/** British Pound. **/
|
|
32
|
+
GBP = "GBP",
|
|
33
|
+
/** Indian Rupee. **/
|
|
34
|
+
INR = "INR",
|
|
30
35
|
/**
|
|
31
36
|
* 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit
|
|
32
37
|
* instead when possible. *
|
package/src/objects/Entity.ts
CHANGED
|
@@ -1417,6 +1417,16 @@ fragment EntityFragment on Entity {
|
|
|
1417
1417
|
id
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
+
... on UmaCurrency {
|
|
1421
|
+
__typename
|
|
1422
|
+
uma_currency_id: id
|
|
1423
|
+
uma_currency_created_at: created_at
|
|
1424
|
+
uma_currency_updated_at: updated_at
|
|
1425
|
+
uma_currency_code: code
|
|
1426
|
+
uma_currency_symbol: symbol
|
|
1427
|
+
uma_currency_name: name
|
|
1428
|
+
uma_currency_decimals: decimals
|
|
1429
|
+
}
|
|
1420
1430
|
... on UmaInvitation {
|
|
1421
1431
|
__typename
|
|
1422
1432
|
uma_invitation_id: id
|
|
@@ -1425,9 +1435,20 @@ fragment EntityFragment on Entity {
|
|
|
1425
1435
|
uma_invitation_code: code
|
|
1426
1436
|
uma_invitation_url: url
|
|
1427
1437
|
uma_invitation_inviter_uma: inviter_uma
|
|
1438
|
+
uma_invitation_inviter_first_name: inviter_first_name
|
|
1428
1439
|
uma_invitation_invitee_uma: invitee_uma
|
|
1429
1440
|
uma_invitation_incentives_status: incentives_status
|
|
1430
1441
|
uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
|
|
1442
|
+
uma_invitation_status: status
|
|
1443
|
+
uma_invitation_payment_amount: payment_amount {
|
|
1444
|
+
__typename
|
|
1445
|
+
uma_currency_amount_value: value
|
|
1446
|
+
uma_currency_amount_currency: currency {
|
|
1447
|
+
id
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
uma_invitation_cancelled_at: cancelled_at
|
|
1451
|
+
uma_invitation_expires_at: expires_at
|
|
1431
1452
|
}
|
|
1432
1453
|
... on Wallet {
|
|
1433
1454
|
__typename
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
interface LookupUmaAddressInput {
|
|
4
|
+
umaAddress: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const LookupUmaAddressInputFromJson = (
|
|
8
|
+
obj: any,
|
|
9
|
+
): LookupUmaAddressInput => {
|
|
10
|
+
return {
|
|
11
|
+
umaAddress: obj["lookup_uma_address_input_uma_address"],
|
|
12
|
+
} as LookupUmaAddressInput;
|
|
13
|
+
};
|
|
14
|
+
export const LookupUmaAddressInputToJson = (
|
|
15
|
+
obj: LookupUmaAddressInput,
|
|
16
|
+
): any => {
|
|
17
|
+
return {
|
|
18
|
+
lookup_uma_address_input_uma_address: obj.umaAddress,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default LookupUmaAddressInput;
|
|
@@ -16,9 +16,8 @@ export enum TransactionStatus {
|
|
|
16
16
|
FAILED = "FAILED",
|
|
17
17
|
/** Transaction has been initiated and is currently in-flight. **/
|
|
18
18
|
PENDING = "PENDING",
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
19
|
+
/** For transaction type PAYMENT_REQUEST only. No payments have been made to a payment
|
|
20
|
+
* request. **/
|
|
22
21
|
NOT_STARTED = "NOT_STARTED",
|
|
23
22
|
/** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/
|
|
24
23
|
EXPIRED = "EXPIRED",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
import { type Query, isObject } from "@lightsparkdev/core";
|
|
4
|
+
|
|
5
|
+
interface UmaCurrency {
|
|
6
|
+
/**
|
|
7
|
+
* The unique identifier of this entity across all Lightspark systems. Should be treated as an
|
|
8
|
+
* opaque string.
|
|
9
|
+
**/
|
|
10
|
+
id: string;
|
|
11
|
+
|
|
12
|
+
/** The date and time when the entity was first created. **/
|
|
13
|
+
createdAt: string;
|
|
14
|
+
|
|
15
|
+
/** The date and time when the entity was last updated. **/
|
|
16
|
+
updatedAt: string;
|
|
17
|
+
|
|
18
|
+
/** The currency code of currency. E.g. USD. **/
|
|
19
|
+
code: string;
|
|
20
|
+
|
|
21
|
+
/** The symbol of currency. E.g. $. **/
|
|
22
|
+
symbol: string;
|
|
23
|
+
|
|
24
|
+
/** The full name of currency. E.g. US Dollar. **/
|
|
25
|
+
name: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The number of digits after the decimal point for display on the sender side, and to add
|
|
29
|
+
* clarity around what the `smallest unit` of the currency is. For example, in USD, by
|
|
30
|
+
* convention, there are 2 digits for cents - $5.95. In this case, `decimals` would be 2. Note
|
|
31
|
+
* that the multiplier is still always in the smallest unit (cents). In addition to display
|
|
32
|
+
* purposes, this field can be used to resolve ambiguity in what the multiplier means. For
|
|
33
|
+
* example, if the currency is `BTC` and the multiplier is 1000, really we're exchanging in
|
|
34
|
+
* SATs, so `decimals` would be 8.
|
|
35
|
+
**/
|
|
36
|
+
decimals: number;
|
|
37
|
+
|
|
38
|
+
/** The typename of the object **/
|
|
39
|
+
typename: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const UmaCurrencyFromJson = (obj: any): UmaCurrency => {
|
|
43
|
+
return {
|
|
44
|
+
id: obj["uma_currency_id"],
|
|
45
|
+
createdAt: obj["uma_currency_created_at"],
|
|
46
|
+
updatedAt: obj["uma_currency_updated_at"],
|
|
47
|
+
code: obj["uma_currency_code"],
|
|
48
|
+
symbol: obj["uma_currency_symbol"],
|
|
49
|
+
name: obj["uma_currency_name"],
|
|
50
|
+
decimals: obj["uma_currency_decimals"],
|
|
51
|
+
typename: "UmaCurrency",
|
|
52
|
+
} as UmaCurrency;
|
|
53
|
+
};
|
|
54
|
+
export const UmaCurrencyToJson = (obj: UmaCurrency): any => {
|
|
55
|
+
return {
|
|
56
|
+
__typename: "UmaCurrency",
|
|
57
|
+
uma_currency_id: obj.id,
|
|
58
|
+
uma_currency_created_at: obj.createdAt,
|
|
59
|
+
uma_currency_updated_at: obj.updatedAt,
|
|
60
|
+
uma_currency_code: obj.code,
|
|
61
|
+
uma_currency_symbol: obj.symbol,
|
|
62
|
+
uma_currency_name: obj.name,
|
|
63
|
+
uma_currency_decimals: obj.decimals,
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const FRAGMENT = `
|
|
68
|
+
fragment UmaCurrencyFragment on UmaCurrency {
|
|
69
|
+
__typename
|
|
70
|
+
uma_currency_id: id
|
|
71
|
+
uma_currency_created_at: created_at
|
|
72
|
+
uma_currency_updated_at: updated_at
|
|
73
|
+
uma_currency_code: code
|
|
74
|
+
uma_currency_symbol: symbol
|
|
75
|
+
uma_currency_name: name
|
|
76
|
+
uma_currency_decimals: decimals
|
|
77
|
+
}`;
|
|
78
|
+
|
|
79
|
+
export const getUmaCurrencyQuery = (id: string): Query<UmaCurrency> => {
|
|
80
|
+
return {
|
|
81
|
+
queryPayload: `
|
|
82
|
+
query GetUmaCurrency($id: ID!) {
|
|
83
|
+
entity(id: $id) {
|
|
84
|
+
... on UmaCurrency {
|
|
85
|
+
...UmaCurrencyFragment
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
${FRAGMENT}
|
|
91
|
+
`,
|
|
92
|
+
variables: { id },
|
|
93
|
+
constructObject: (data: unknown) =>
|
|
94
|
+
isObject(data) && "entity" in data && isObject(data.entity)
|
|
95
|
+
? UmaCurrencyFromJson(data.entity)
|
|
96
|
+
: null,
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default UmaCurrency;
|
|
@@ -1,44 +1,31 @@
|
|
|
1
1
|
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface UmaCurrencyAmount {
|
|
4
4
|
value: number;
|
|
5
|
-
currency: {
|
|
6
|
-
code: string;
|
|
7
|
-
symbol: string;
|
|
8
|
-
decimals: number;
|
|
9
|
-
name: string;
|
|
10
|
-
};
|
|
11
5
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
currency: { code: string; symbol: string; decimals: number; name: string },
|
|
15
|
-
) {
|
|
16
|
-
this.value = value;
|
|
17
|
-
this.currency = currency;
|
|
18
|
-
}
|
|
6
|
+
currencyId: string;
|
|
7
|
+
}
|
|
19
8
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
export const UmaCurrencyAmountFromJson = (obj: any): UmaCurrencyAmount => {
|
|
10
|
+
return {
|
|
11
|
+
value: obj["uma_currency_amount_value"],
|
|
12
|
+
currencyId: obj["uma_currency_amount_currency"].id,
|
|
13
|
+
} as UmaCurrencyAmount;
|
|
14
|
+
};
|
|
15
|
+
export const UmaCurrencyAmountToJson = (obj: UmaCurrencyAmount): any => {
|
|
16
|
+
return {
|
|
17
|
+
uma_currency_amount_value: obj.value,
|
|
18
|
+
uma_currency_amount_currency: { id: obj.currencyId },
|
|
19
|
+
};
|
|
20
|
+
};
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
export const FRAGMENT = `
|
|
23
|
+
fragment UmaCurrencyAmountFragment on UmaCurrencyAmount {
|
|
24
|
+
__typename
|
|
25
|
+
uma_currency_amount_value: value
|
|
26
|
+
uma_currency_amount_currency: currency {
|
|
27
|
+
id
|
|
28
|
+
}
|
|
29
|
+
}`;
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
value: this.value,
|
|
36
|
-
currency: {
|
|
37
|
-
code: this.currency.code,
|
|
38
|
-
symbol: this.currency.symbol,
|
|
39
|
-
decimals: this.currency.decimals,
|
|
40
|
-
name: this.currency.name,
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
31
|
+
export default UmaCurrencyAmount;
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
import { type Query, isObject } from "@lightsparkdev/core";
|
|
4
4
|
import IncentivesIneligibilityReason from "./IncentivesIneligibilityReason.js";
|
|
5
5
|
import IncentivesStatus from "./IncentivesStatus.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
EXPIRED = "EXPIRED",
|
|
13
|
-
}
|
|
6
|
+
import type UmaCurrencyAmount from "./UmaCurrencyAmount.js";
|
|
7
|
+
import {
|
|
8
|
+
UmaCurrencyAmountFromJson,
|
|
9
|
+
UmaCurrencyAmountToJson,
|
|
10
|
+
} from "./UmaCurrencyAmount.js";
|
|
11
|
+
import UmaInvitationStatus from "./UmaInvitationStatus.js";
|
|
14
12
|
|
|
15
13
|
/** This is an object representing an UMA.ME invitation. **/
|
|
16
14
|
interface UmaInvitation {
|
|
@@ -38,25 +36,34 @@ interface UmaInvitation {
|
|
|
38
36
|
/** The current status of the incentives that may be tied to this invitation. **/
|
|
39
37
|
incentivesStatus: IncentivesStatus;
|
|
40
38
|
|
|
39
|
+
/** The status of the invitation. **/
|
|
40
|
+
status: UmaInvitationStatus;
|
|
41
|
+
|
|
41
42
|
/** The typename of the object **/
|
|
42
43
|
typename: string;
|
|
43
44
|
|
|
45
|
+
/** The optional first name of the person who created the invitation. **/
|
|
46
|
+
inviterFirstName?: string | undefined;
|
|
47
|
+
|
|
44
48
|
/** The UMA of the user who claimed the invitation. **/
|
|
45
49
|
inviteeUma?: string | undefined;
|
|
46
50
|
|
|
47
51
|
/** The reason why the invitation is not eligible for incentives, if applicable. **/
|
|
48
52
|
incentivesIneligibilityReason?: IncentivesIneligibilityReason | undefined;
|
|
49
53
|
|
|
50
|
-
/**
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
/**
|
|
55
|
+
* The payment amount with the invitation denominated in the lowest currency unit. If there is
|
|
56
|
+
* no payment attached, this is null.
|
|
57
|
+
**/
|
|
54
58
|
paymentAmount?: UmaCurrencyAmount | undefined;
|
|
55
59
|
|
|
56
|
-
/**
|
|
60
|
+
/** The date and time when the invitation was cancelled, if it was cancelled. **/
|
|
57
61
|
cancelledAt?: string | undefined;
|
|
58
62
|
|
|
59
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* The date and time after which an invitation can no longer be claimed. None, if no expiration
|
|
65
|
+
* is set *
|
|
66
|
+
*/
|
|
60
67
|
expiresAt?: string | undefined;
|
|
61
68
|
}
|
|
62
69
|
|
|
@@ -71,29 +78,26 @@ export const UmaInvitationFromJson = (obj: any): UmaInvitation => {
|
|
|
71
78
|
incentivesStatus:
|
|
72
79
|
IncentivesStatus[obj["uma_invitation_incentives_status"]] ??
|
|
73
80
|
IncentivesStatus.FUTURE_VALUE,
|
|
81
|
+
status:
|
|
82
|
+
UmaInvitationStatus[obj["uma_invitation_status"]] ??
|
|
83
|
+
UmaInvitationStatus.FUTURE_VALUE,
|
|
74
84
|
typename: "UmaInvitation",
|
|
85
|
+
inviterFirstName: obj["uma_invitation_inviter_first_name"],
|
|
75
86
|
inviteeUma: obj["uma_invitation_invitee_uma"],
|
|
76
87
|
incentivesIneligibilityReason: !!obj[
|
|
77
88
|
"uma_invitation_incentives_ineligibility_reason"
|
|
78
89
|
]
|
|
79
|
-
?
|
|
80
|
-
"uma_invitation_incentives_ineligibility_reason"
|
|
81
|
-
]
|
|
82
|
-
IncentivesIneligibilityReason.FUTURE_VALUE
|
|
90
|
+
? IncentivesIneligibilityReason[
|
|
91
|
+
obj["uma_invitation_incentives_ineligibility_reason"]
|
|
92
|
+
] ?? IncentivesIneligibilityReason.FUTURE_VALUE
|
|
83
93
|
: null,
|
|
84
|
-
|
|
85
|
-
(obj["
|
|
86
|
-
(() => {
|
|
87
|
-
throw new Error("Required field 'uma_invitation_status' is missing");
|
|
88
|
-
})(),
|
|
89
|
-
paymentAmount: obj["uma_invitation_payment_amount"]
|
|
90
|
-
? UmaCurrencyAmount.fromJson(obj["uma_invitation_payment_amount"])
|
|
94
|
+
paymentAmount: !!obj["uma_invitation_payment_amount"]
|
|
95
|
+
? UmaCurrencyAmountFromJson(obj["uma_invitation_payment_amount"])
|
|
91
96
|
: undefined,
|
|
92
97
|
cancelledAt: obj["uma_invitation_cancelled_at"],
|
|
93
98
|
expiresAt: obj["uma_invitation_expires_at"],
|
|
94
99
|
} as UmaInvitation;
|
|
95
100
|
};
|
|
96
|
-
|
|
97
101
|
export const UmaInvitationToJson = (obj: UmaInvitation): any => {
|
|
98
102
|
return {
|
|
99
103
|
__typename: "UmaInvitation",
|
|
@@ -103,13 +107,14 @@ export const UmaInvitationToJson = (obj: UmaInvitation): any => {
|
|
|
103
107
|
uma_invitation_code: obj.code,
|
|
104
108
|
uma_invitation_url: obj.url,
|
|
105
109
|
uma_invitation_inviter_uma: obj.inviterUma,
|
|
110
|
+
uma_invitation_inviter_first_name: obj.inviterFirstName,
|
|
106
111
|
uma_invitation_invitee_uma: obj.inviteeUma,
|
|
107
112
|
uma_invitation_incentives_status: obj.incentivesStatus,
|
|
108
113
|
uma_invitation_incentives_ineligibility_reason:
|
|
109
114
|
obj.incentivesIneligibilityReason,
|
|
110
115
|
uma_invitation_status: obj.status,
|
|
111
116
|
uma_invitation_payment_amount: obj.paymentAmount
|
|
112
|
-
? obj.paymentAmount
|
|
117
|
+
? UmaCurrencyAmountToJson(obj.paymentAmount)
|
|
113
118
|
: undefined,
|
|
114
119
|
uma_invitation_cancelled_at: obj.cancelledAt,
|
|
115
120
|
uma_invitation_expires_at: obj.expiresAt,
|
|
@@ -125,17 +130,16 @@ fragment UmaInvitationFragment on UmaInvitation {
|
|
|
125
130
|
uma_invitation_code: code
|
|
126
131
|
uma_invitation_url: url
|
|
127
132
|
uma_invitation_inviter_uma: inviter_uma
|
|
133
|
+
uma_invitation_inviter_first_name: inviter_first_name
|
|
128
134
|
uma_invitation_invitee_uma: invitee_uma
|
|
129
135
|
uma_invitation_incentives_status: incentives_status
|
|
130
136
|
uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
|
|
131
137
|
uma_invitation_status: status
|
|
132
138
|
uma_invitation_payment_amount: payment_amount {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
decimals
|
|
138
|
-
name
|
|
139
|
+
__typename
|
|
140
|
+
uma_currency_amount_value: value
|
|
141
|
+
uma_currency_amount_currency: currency {
|
|
142
|
+
id
|
|
139
143
|
}
|
|
140
144
|
}
|
|
141
145
|
uma_invitation_cancelled_at: cancelled_at
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
|
|
2
|
+
|
|
3
|
+
export enum UmaInvitationStatus {
|
|
4
|
+
/**
|
|
5
|
+
* This is an enum value that represents values that could be added in the future.
|
|
6
|
+
* Clients should support unknown values as more of them could be added without notice.
|
|
7
|
+
*/
|
|
8
|
+
FUTURE_VALUE = "FUTURE_VALUE",
|
|
9
|
+
|
|
10
|
+
PENDING = "PENDING",
|
|
11
|
+
|
|
12
|
+
CLAIMED = "CLAIMED",
|
|
13
|
+
|
|
14
|
+
CANCELLED = "CANCELLED",
|
|
15
|
+
|
|
16
|
+
EXPIRED = "EXPIRED",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default UmaInvitationStatus;
|
|
@@ -33,8 +33,8 @@ export enum WalletStatus {
|
|
|
33
33
|
TERMINATING = "TERMINATING",
|
|
34
34
|
/**
|
|
35
35
|
* The wallet has been terminated and is not available in the Lightspark infrastructure anymore.
|
|
36
|
-
* It is not connected to the Lightning network and its funds can only be accessed using the
|
|
37
|
-
*
|
|
36
|
+
* It is not connected to the Lightning network and its funds can only be accessed using the Funds
|
|
37
|
+
* Recovery flow. *
|
|
38
38
|
*/
|
|
39
39
|
TERMINATED = "TERMINATED",
|
|
40
40
|
}
|
package/src/objects/index.ts
CHANGED
|
@@ -16,6 +16,8 @@ export { default as BitcoinNetwork } from "./BitcoinNetwork.js";
|
|
|
16
16
|
export { default as BlockchainBalance } from "./BlockchainBalance.js";
|
|
17
17
|
export { default as CancelInvoiceInput } from "./CancelInvoiceInput.js";
|
|
18
18
|
export { default as CancelInvoiceOutput } from "./CancelInvoiceOutput.js";
|
|
19
|
+
export { default as CancelUmaInvitationInput } from "./CancelUmaInvitationInput.js";
|
|
20
|
+
export { default as CancelUmaInvitationOutput } from "./CancelUmaInvitationOutput.js";
|
|
19
21
|
export { default as Channel } from "./Channel.js";
|
|
20
22
|
export {
|
|
21
23
|
default as ChannelClosingTransaction,
|
|
@@ -114,6 +116,7 @@ export { default as LightsparkNodeToChannelsConnection } from "./LightsparkNodeT
|
|
|
114
116
|
export { default as LightsparkNodeToDailyLiquidityForecastsConnection } from "./LightsparkNodeToDailyLiquidityForecastsConnection.js";
|
|
115
117
|
export { default as LightsparkNodeWithOSK } from "./LightsparkNodeWithOSK.js";
|
|
116
118
|
export { default as LightsparkNodeWithRemoteSigning } from "./LightsparkNodeWithRemoteSigning.js";
|
|
119
|
+
export { default as LookupUmaAddressInput } from "./LookupUmaAddressInput.js";
|
|
117
120
|
export { default as MultiSigAddressValidationParameters } from "./MultiSigAddressValidationParameters.js";
|
|
118
121
|
export { default as Node, getNodeQuery } from "./Node.js";
|
|
119
122
|
export { default as NodeAddress } from "./NodeAddress.js";
|
|
@@ -195,10 +198,13 @@ export { default as TransactionFailures } from "./TransactionFailures.js";
|
|
|
195
198
|
export { default as TransactionStatus } from "./TransactionStatus.js";
|
|
196
199
|
export { default as TransactionType } from "./TransactionType.js";
|
|
197
200
|
export { default as TransactionUpdate } from "./TransactionUpdate.js";
|
|
201
|
+
export { default as UmaCurrency, getUmaCurrencyQuery } from "./UmaCurrency.js";
|
|
202
|
+
export { default as UmaCurrencyAmount } from "./UmaCurrencyAmount.js";
|
|
198
203
|
export {
|
|
199
204
|
default as UmaInvitation,
|
|
200
205
|
getUmaInvitationQuery,
|
|
201
206
|
} from "./UmaInvitation.js";
|
|
207
|
+
export { default as UmaInvitationStatus } from "./UmaInvitationStatus.js";
|
|
202
208
|
export { default as UpdateChannelPerCommitmentPointInput } from "./UpdateChannelPerCommitmentPointInput.js";
|
|
203
209
|
export { default as UpdateChannelPerCommitmentPointOutput } from "./UpdateChannelPerCommitmentPointOutput.js";
|
|
204
210
|
export { default as UpdateNodeSharedSecretInput } from "./UpdateNodeSharedSecretInput.js";
|