@lightsparkdev/lightspark-sdk 1.2.1 → 1.2.2

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{chunk-VTPDR6P4.js → chunk-GLL4KTUT.js} +353 -15
  3. package/dist/{index-5acc6526.d.ts → index-eb604025.d.ts} +662 -3
  4. package/dist/index.cjs +654 -76
  5. package/dist/index.d.cts +2 -2
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.js +265 -17
  8. package/dist/objects/index.cjs +345 -5
  9. package/dist/objects/index.d.cts +1 -1
  10. package/dist/objects/index.d.ts +1 -1
  11. package/dist/objects/index.js +9 -1
  12. package/package.json +1 -1
  13. package/src/client.ts +194 -1
  14. package/src/graphql/ClaimUmaInvitation.ts +21 -0
  15. package/src/graphql/ClaimUmaInvitationWithIncentives.ts +25 -0
  16. package/src/graphql/CreateUmaInvitation.ts +19 -0
  17. package/src/graphql/CreateUmaInvitationWithIncentives.ts +23 -0
  18. package/src/graphql/FetchUmaInvitation.ts +15 -0
  19. package/src/objects/ClaimUmaInvitationInput.ts +26 -0
  20. package/src/objects/ClaimUmaInvitationOutput.ts +30 -0
  21. package/src/objects/ClaimUmaInvitationWithIncentivesInput.ts +44 -0
  22. package/src/objects/ClaimUmaInvitationWithIncentivesOutput.ts +33 -0
  23. package/src/objects/CreateInvitationWithIncentivesInput.ts +37 -0
  24. package/src/objects/CreateInvitationWithIncentivesOutput.ts +32 -0
  25. package/src/objects/CreateUmaInvitationInput.ts +22 -0
  26. package/src/objects/CreateUmaInvitationOutput.ts +30 -0
  27. package/src/objects/Entity.ts +13 -0
  28. package/src/objects/IncentivesIneligibilityReason.ts +24 -0
  29. package/src/objects/IncentivesStatus.ts +18 -0
  30. package/src/objects/OutgoingPayment.ts +1 -0
  31. package/src/objects/OutgoingPaymentAttempt.ts +6 -1
  32. package/src/objects/RegionCode.ts +510 -0
  33. package/src/objects/UmaInvitation.ts +113 -0
  34. package/src/objects/WebhookEventType.ts +4 -0
  35. package/src/objects/index.ts +15 -0
  36. package/src/tests/integration/constants.ts +0 -3
  37. package/src/tests/integration/general-regtest.test.ts +177 -196
package/src/client.ts CHANGED
@@ -25,15 +25,20 @@ import {
25
25
  } from "@lightsparkdev/core";
26
26
  import packageJson from "../package.json";
27
27
  import { BitcoinFeeEstimate as BitcoinFeeEstimateQuery } from "./graphql/BitcoinFeeEstimate.js";
28
+ import { ClaimUmaInvitation } from "./graphql/ClaimUmaInvitation.js";
29
+ import { ClaimUmaInvitationWithIncentives } from "./graphql/ClaimUmaInvitationWithIncentives.js";
28
30
  import { CreateApiToken } from "./graphql/CreateApiToken.js";
29
31
  import { CreateInvoice } from "./graphql/CreateInvoice.js";
30
32
  import { CreateLnurlInvoice } from "./graphql/CreateLnurlInvoice.js";
31
33
  import { CreateNodeWalletAddress } from "./graphql/CreateNodeWalletAddress.js";
32
34
  import { CreateTestModeInvoice } from "./graphql/CreateTestModeInvoice.js";
33
35
  import { CreateTestModePayment } from "./graphql/CreateTestModePayment.js";
36
+ import { CreateUmaInvitation } from "./graphql/CreateUmaInvitation.js";
37
+ import { CreateUmaInvitationWithIncentives } from "./graphql/CreateUmaInvitationWithIncentives.js";
34
38
  import { CreateUmaInvoice } from "./graphql/CreateUmaInvoice.js";
35
39
  import { DecodeInvoice } from "./graphql/DecodeInvoice.js";
36
40
  import { DeleteApiToken } from "./graphql/DeleteApiToken.js";
41
+ import { FetchUmaInvitation } from "./graphql/FetchUmaInvitation.js";
37
42
  import { FundNode } from "./graphql/FundNode.js";
38
43
  import { LightningFeeEstimateForInvoice } from "./graphql/LightningFeeEstimateForInvoice.js";
39
44
  import { LightningFeeEstimateForNode } from "./graphql/LightningFeeEstimateForNode.js";
@@ -47,7 +52,6 @@ import { SendPayment } from "./graphql/SendPayment.js";
47
52
  import { SingleNodeDashboard as SingleNodeDashboardQuery } from "./graphql/SingleNodeDashboard.js";
48
53
  import { TransactionsForNode } from "./graphql/TransactionsForNode.js";
49
54
  import { TransactionSubscription } from "./graphql/TransactionSubscription.js";
50
- import { TransactionStatus } from "./index.js";
51
55
  import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js";
52
56
  import Account from "./objects/Account.js";
53
57
  import { ApiTokenFromJson } from "./objects/ApiToken.js";
@@ -68,14 +72,18 @@ import type OutgoingPayment from "./objects/OutgoingPayment.js";
68
72
  import { OutgoingPaymentFromJson } from "./objects/OutgoingPayment.js";
69
73
  import { PaymentRequestFromJson } from "./objects/PaymentRequest.js";
70
74
  import Permission from "./objects/Permission.js";
75
+ import type RegionCode from "./objects/RegionCode.js";
71
76
  import type SingleNodeDashboard from "./objects/SingleNodeDashboard.js";
72
77
  import type Transaction from "./objects/Transaction.js";
73
78
  import {
74
79
  getTransactionQuery,
75
80
  TransactionFromJson,
76
81
  } from "./objects/Transaction.js";
82
+ import TransactionStatus from "./objects/TransactionStatus.js";
77
83
  import type TransactionUpdate from "./objects/TransactionUpdate.js";
78
84
  import { TransactionUpdateFromJson } from "./objects/TransactionUpdate.js";
85
+ import type UmaInvitation from "./objects/UmaInvitation.js";
86
+ import { UmaInvitationFromJson } from "./objects/UmaInvitation.js";
79
87
  import type WithdrawalMode from "./objects/WithdrawalMode.js";
80
88
  import type WithdrawalRequest from "./objects/WithdrawalRequest.js";
81
89
  import { WithdrawalRequestFromJson } from "./objects/WithdrawalRequest.js";
@@ -1070,6 +1078,191 @@ class LightsparkClient {
1070
1078
  });
1071
1079
  }
1072
1080
 
1081
+ /**
1082
+ * Creates an UMA invitation. If you are part of the incentive program, you should use
1083
+ * [createUmaInvitationWithIncentives].
1084
+ *
1085
+ * @param inviterUma The UMA of the inviter.
1086
+ * @returns The invitation that was created.
1087
+ */
1088
+ public async createUmaInvitation(
1089
+ inviterUma: string,
1090
+ ): Promise<UmaInvitation | null> {
1091
+ return await this.executeRawQuery({
1092
+ queryPayload: CreateUmaInvitation,
1093
+ variables: {
1094
+ inviterUma,
1095
+ },
1096
+ constructObject: (responseJson: {
1097
+ create_uma_invitation: {
1098
+ invitation: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1099
+ } | null;
1100
+ }) => {
1101
+ if (!responseJson.create_uma_invitation?.invitation) {
1102
+ throw new LightsparkException(
1103
+ "CreateUmaInvitationError",
1104
+ "Unable to create UMA invitation",
1105
+ );
1106
+ }
1107
+ return UmaInvitationFromJson(
1108
+ responseJson.create_uma_invitation?.invitation,
1109
+ );
1110
+ },
1111
+ });
1112
+ }
1113
+
1114
+ /**
1115
+ * Creates an UMA invitation as part of the incentive program.
1116
+ * @param inviterUma The UMA of the inviter.
1117
+ * @param inviterPhoneNumber The phone number of the inviter in E164 format.
1118
+ * @param inviterRegion The region of the inviter.
1119
+ * @returns The invitation that was created.
1120
+ */
1121
+ public async createUmaInvitationWithIncentives(
1122
+ inviterUma: string,
1123
+ inviterPhoneNumber: string,
1124
+ inviterRegion: RegionCode,
1125
+ ): Promise<UmaInvitation | null> {
1126
+ const inviterPhoneHash = await this.hashPhoneNumber(inviterPhoneNumber);
1127
+ return await this.executeRawQuery({
1128
+ queryPayload: CreateUmaInvitationWithIncentives,
1129
+ variables: {
1130
+ inviterUma,
1131
+ inviterPhoneHash,
1132
+ inviterRegion,
1133
+ },
1134
+ constructObject: (responseJson: {
1135
+ create_uma_invitation_with_incentives: {
1136
+ invitation: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1137
+ } | null;
1138
+ }) => {
1139
+ if (!responseJson.create_uma_invitation_with_incentives?.invitation) {
1140
+ throw new LightsparkException(
1141
+ "CreateUmaInvitationError",
1142
+ "Unable to create UMA invitation",
1143
+ );
1144
+ }
1145
+ return UmaInvitationFromJson(
1146
+ responseJson.create_uma_invitation_with_incentives?.invitation,
1147
+ );
1148
+ },
1149
+ });
1150
+ }
1151
+
1152
+ /**
1153
+ * Claims an UMA invitation. If you are part of the incentive program, you should use
1154
+ * [claimUmaInvitationWithIncentives].
1155
+ *
1156
+ * @param invitationCode The invitation code to claim.
1157
+ * @param inviteeUma The UMA of the invitee.
1158
+ * @returns The invitation that was claimed.
1159
+ */
1160
+ public async claimUmaInvitation(
1161
+ invitationCode: string,
1162
+ inviteeUma: string,
1163
+ ): Promise<UmaInvitation | null> {
1164
+ return await this.executeRawQuery({
1165
+ queryPayload: ClaimUmaInvitation,
1166
+ variables: {
1167
+ invitationCode,
1168
+ inviteeUma,
1169
+ },
1170
+ constructObject: (responseJson: {
1171
+ claim_uma_invitation: {
1172
+ invitation: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1173
+ } | null;
1174
+ }) => {
1175
+ if (!responseJson.claim_uma_invitation?.invitation) {
1176
+ throw new LightsparkException(
1177
+ "ClaimUmaInvitationError",
1178
+ "Unable to claim UMA invitation",
1179
+ );
1180
+ }
1181
+ return UmaInvitationFromJson(
1182
+ responseJson.claim_uma_invitation?.invitation,
1183
+ );
1184
+ },
1185
+ });
1186
+ }
1187
+
1188
+ /**
1189
+ * Claims an UMA invitation as part of the incentive program.
1190
+ *
1191
+ * @param invitationCode The invitation code to claim.
1192
+ * @param inviteeUma The UMA of the invitee.
1193
+ * @param inviteePhoneNumber The phone number of the invitee in E164 format.
1194
+ * @param inviteeRegion The region of the invitee.
1195
+ * @returns The invitation that was claimed.
1196
+ */
1197
+ public async claimUmaInvitationWithIncentives(
1198
+ invitationCode: string,
1199
+ inviteeUma: string,
1200
+ inviteePhoneNumber: string,
1201
+ inviteeRegion: RegionCode,
1202
+ ): Promise<UmaInvitation | null> {
1203
+ const inviteePhoneHash = await this.hashPhoneNumber(inviteePhoneNumber);
1204
+ return await this.executeRawQuery({
1205
+ queryPayload: ClaimUmaInvitationWithIncentives,
1206
+ variables: {
1207
+ invitationCode,
1208
+ inviteeUma,
1209
+ inviteePhoneHash,
1210
+ inviteeRegion,
1211
+ },
1212
+ constructObject: (responseJson: {
1213
+ claim_uma_invitation_with_incentives: {
1214
+ invitation: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1215
+ } | null;
1216
+ }) => {
1217
+ if (!responseJson.claim_uma_invitation_with_incentives?.invitation) {
1218
+ throw new LightsparkException(
1219
+ "ClaimUmaInvitationError",
1220
+ "Unable to claim UMA invitation",
1221
+ );
1222
+ }
1223
+ return UmaInvitationFromJson(
1224
+ responseJson.claim_uma_invitation_with_incentives?.invitation,
1225
+ );
1226
+ },
1227
+ });
1228
+ }
1229
+
1230
+ /**
1231
+ * Fetches an UMA invitation by its invitation code.
1232
+ *
1233
+ * @param invitationCode The code of the invitation to fetch.
1234
+ * @returns The invitation with the given code, or null if no invitation exists with that code.
1235
+ */
1236
+ public async fetchUmaInvitation(
1237
+ invitationCode: string,
1238
+ ): Promise<UmaInvitation | null> {
1239
+ return await this.executeRawQuery({
1240
+ queryPayload: FetchUmaInvitation,
1241
+ variables: {
1242
+ invitationCode,
1243
+ },
1244
+ constructObject: (responseJson: {
1245
+ uma_invitation_by_code: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1246
+ }) => {
1247
+ if (!responseJson.uma_invitation_by_code) {
1248
+ return null;
1249
+ }
1250
+ return UmaInvitationFromJson(responseJson.uma_invitation_by_code);
1251
+ },
1252
+ });
1253
+ }
1254
+
1255
+ private async hashPhoneNumber(e164PhoneNumber: string): Promise<string> {
1256
+ const e164PhoneRegex = /^\+[1-9]\d{1,14}$/;
1257
+ if (!e164PhoneRegex.test(e164PhoneNumber)) {
1258
+ throw new LightsparkException(
1259
+ "InvalidPhoneNumber",
1260
+ "Invalid phone number. Phone number must be in E164 format.",
1261
+ );
1262
+ }
1263
+ return await createSha256Hash(e164PhoneNumber, true);
1264
+ }
1265
+
1073
1266
  /**
1074
1267
  * Executes a raw `Query` against the Lightspark API.
1075
1268
  *
@@ -0,0 +1,21 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as UmaInvitationFragment } from "../objects/UmaInvitation.js";
4
+
5
+ export const ClaimUmaInvitation = `
6
+ mutation ClaimUmaInvitation(
7
+ $invitationCode: String!
8
+ $inviteeUma: String!
9
+ ) {
10
+ claim_uma_invitation(input: {
11
+ invitation_code: $invitationCode
12
+ invitee_uma: $inviteeUma
13
+ }) {
14
+ invitation {
15
+ ...UmaInvitationFragment
16
+ }
17
+ }
18
+ }
19
+
20
+ ${UmaInvitationFragment}
21
+ `;
@@ -0,0 +1,25 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as UmaInvitationFragment } from "../objects/UmaInvitation.js";
4
+
5
+ export const ClaimUmaInvitationWithIncentives = `
6
+ mutation ClaimUmaInvitationWithIncentives(
7
+ $invitationCode: String!
8
+ $inviteeUma: String!
9
+ $inviteePhoneHash: String!
10
+ $inviteeRegion: RegionCode!
11
+ ) {
12
+ claim_uma_invitation_with_incentives(input: {
13
+ invitation_code: $invitationCode
14
+ invitee_uma: $inviteeUma
15
+ invitee_phone_hash: $inviteePhoneHash
16
+ invitee_region: $inviteeRegion
17
+ }) {
18
+ invitation {
19
+ ...UmaInvitationFragment
20
+ }
21
+ }
22
+ }
23
+
24
+ ${UmaInvitationFragment}
25
+ `;
@@ -0,0 +1,19 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as UmaInvitationFragment } from "../objects/UmaInvitation.js";
4
+
5
+ export const CreateUmaInvitation = `
6
+ mutation CreateUmaInvitation(
7
+ $inviterUma: String!
8
+ ) {
9
+ create_uma_invitation(input: {
10
+ inviter_uma: $inviterUma
11
+ }) {
12
+ invitation {
13
+ ...UmaInvitationFragment
14
+ }
15
+ }
16
+ }
17
+
18
+ ${UmaInvitationFragment}
19
+ `;
@@ -0,0 +1,23 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as UmaInvitationFragment } from "../objects/UmaInvitation.js";
4
+
5
+ export const CreateUmaInvitationWithIncentives = `
6
+ mutation CreateUmaInvitationWithIncentives(
7
+ $inviterUma: String!
8
+ $inviterPhoneHash: String!
9
+ $inviterRegion: RegionCode!
10
+ ) {
11
+ create_uma_invitation_with_incentives(input: {
12
+ inviter_uma: $inviterUma
13
+ inviter_phone_hash: $inviterPhoneHash
14
+ inviter_region: $inviterRegion
15
+ }) {
16
+ invitation {
17
+ ...UmaInvitationFragment
18
+ }
19
+ }
20
+ }
21
+
22
+ ${UmaInvitationFragment}
23
+ `;
@@ -0,0 +1,15 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ import { FRAGMENT as UmaInvitationFragment } from "../objects/UmaInvitation.js";
4
+
5
+ export const FetchUmaInvitation = `
6
+ query FetchUmaInvitation(
7
+ $invitationCode: String!
8
+ ) {
9
+ uma_invitation_by_code(code: $invitationCode) {
10
+ ...UmaInvitationFragment
11
+ }
12
+ }
13
+
14
+ ${UmaInvitationFragment}
15
+ `;
@@ -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;
@@ -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;
@@ -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;
@@ -1237,6 +1237,7 @@ fragment EntityFragment on Entity {
1237
1237
  outgoing_payment_attempt_status: status
1238
1238
  outgoing_payment_attempt_failure_code: failure_code
1239
1239
  outgoing_payment_attempt_failure_source_index: failure_source_index
1240
+ outgoing_payment_attempt_attempted_at: attempted_at
1240
1241
  outgoing_payment_attempt_resolved_at: resolved_at
1241
1242
  outgoing_payment_attempt_amount: amount {
1242
1243
  __typename
@@ -1361,6 +1362,18 @@ fragment EntityFragment on Entity {
1361
1362
  id
1362
1363
  }
1363
1364
  }
1365
+ ... on UmaInvitation {
1366
+ __typename
1367
+ uma_invitation_id: id
1368
+ uma_invitation_created_at: created_at
1369
+ uma_invitation_updated_at: updated_at
1370
+ uma_invitation_code: code
1371
+ uma_invitation_url: url
1372
+ uma_invitation_inviter_uma: inviter_uma
1373
+ uma_invitation_invitee_uma: invitee_uma
1374
+ uma_invitation_incentives_status: incentives_status
1375
+ uma_invitation_incentives_ineligibility_reason: incentives_ineligibility_reason
1376
+ }
1364
1377
  ... on Wallet {
1365
1378
  __typename
1366
1379
  wallet_id: id
@@ -0,0 +1,24 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ /** Describes the reason for an invitation to not be eligible for incentives. **/
4
+ export enum IncentivesIneligibilityReason {
5
+ /**
6
+ * This is an enum value that represents values that could be added in the future.
7
+ * Clients should support unknown values as more of them could be added without notice.
8
+ */
9
+ FUTURE_VALUE = "FUTURE_VALUE",
10
+ /** This invitation is not eligible for incentives because it has been created outside of the incentives flow. **/
11
+ DISABLED = "DISABLED",
12
+ /** This invitation is not eligible for incentives because the sender is not eligible. **/
13
+ SENDER_NOT_ELIGIBLE = "SENDER_NOT_ELIGIBLE",
14
+ /** This invitation is not eligible for incentives because the receiver is not eligible. **/
15
+ RECEIVER_NOT_ELIGIBLE = "RECEIVER_NOT_ELIGIBLE",
16
+ /** This invitation is not eligible for incentives because the sending VASP is not part of the incentives program. **/
17
+ SENDING_VASP_NOT_ELIGIBLE = "SENDING_VASP_NOT_ELIGIBLE",
18
+ /** This invitation is not eligible for incentives because the receiving VASP is not part of the incentives program. **/
19
+ RECEIVING_VASP_NOT_ELIGIBLE = "RECEIVING_VASP_NOT_ELIGIBLE",
20
+ /** This invitation is not eligible for incentives because the sender and receiver are in the same region. **/
21
+ NOT_CROSS_BORDER = "NOT_CROSS_BORDER",
22
+ }
23
+
24
+ export default IncentivesIneligibilityReason;
@@ -0,0 +1,18 @@
1
+ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
2
+
3
+ /** Describes the status of the incentives for this invitation. **/
4
+ export enum IncentivesStatus {
5
+ /**
6
+ * This is an enum value that represents values that could be added in the future.
7
+ * Clients should support unknown values as more of them could be added without notice.
8
+ */
9
+ FUTURE_VALUE = "FUTURE_VALUE",
10
+ /** The invitation is eligible for incentives in its current state. When it is claimed, we will reassess. **/
11
+ PENDING = "PENDING",
12
+ /** The incentives have been validated. **/
13
+ VALIDATED = "VALIDATED",
14
+ /** This invitation is not eligible for incentives. A more detailed reason can be found in the `incentives_ineligibility_reason` field. **/
15
+ INELIGIBLE = "INELIGIBLE",
16
+ }
17
+
18
+ export default IncentivesStatus;