Skip to content

Commit 7ae2525

Browse files
github-actions[bot]matthappensJasonCWangbsiaotickchongLightspark Eng
authored
Updates to lightspark-sdk, core, ui (#460)
* ui fixes for 3a onboarding / link bank (#17347) # Design fixes for 3a onboarding / link bank This addresses several design requests from a recent design review: Link bank 1. add an 8px left margin to align with title and input box 2. set a min height 3. group "about iban" with bottom button 4. use bridge modal for iban bank info on Verify3aIdentity 1. remove the back button 2. set border radius and border width on birthday input GitOrigin-RevId: c243af24b20620cf01718c1415dc3898a116ad1e * Refactor link bank mx with new UI (#17742) GitOrigin-RevId: 01278048d8d810d6cc99a069886c78463543c57e * [S2C] Fix url query for receipt id in share link (#17758) This PR: - Updates BridgeCardForm/Add-credential to check is_shadow search param - Makes BirthdayInput text size per spec - Makes EntBridgeUserExample default to is_shadow is false for tests GitOrigin-RevId: 11141e9265731a824e0e17d0a0875d91c883892c * [bridge] add amplitude session replays (#18078) GitOrigin-RevId: a38c4e1e23d85ce9dbfd0e43fe1a46118786ec26 * CI update lock file for PR * [bridge] Update UMA activation flow with onboarding progress indicators (#18149) # UMA Activation UI Enhancements This PR improves the UMA activation experience with several UI updates: - Added a new "Confirm your phone" onboarding step with appropriate icon and translations - Enhanced the UMA card with a new activation banner showing completion progress - Updated welcome messaging to be more inviting ("Welcome to UMA!" instead of "Complete Setup") - Improved the onboarding progress modal with: - Changed button text from "Get Started" to "Continue" - Added "In Progress" status indicator for current steps - Updated modal title to "Activate your UMA" for clarity - Added new translations for all new UI elements in English, Spanish, and Portuguese - Refined styling for various UI components including rounded corners and consistent spacing ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/oOuIssbrOKuvWkHIBu32/73d68e67-146e-4f35-9074-e7524e229fb6.png) ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/oOuIssbrOKuvWkHIBu32/d5466bca-dfc6-495e-ab38-6aa2aef4f85d.png) GitOrigin-RevId: 9e9b291a7137b2f67ad2ac5c8036dc207f152f74 * Update packages for cross-spawn security alert (#18100) GitOrigin-RevId: 76b711f021ad7182c620fe9562ef05686af00a23 * CI update lock file for PR * add create invitation with payment to lightspark sdk (#18198) ### TL;DR Added support for creating UMA invitations with attached payments. ### What changed? - Added a new GraphQL mutation `CreateUmaInvitationWithPayment.ts` that allows creating UMA invitations with an attached payment - Implemented a new client method `createUmaInvitationWithPayment()` in the LightsparkClient class that accepts: - inviterUma (string) - amountToSend (object with amount and currency details) - expiresAt (string or Date) - Added proper error handling and type conversion for the new method ### How to test? Test the new functionality by calling the `createUmaInvitationWithPayment()` method with valid parameters: ```typescript const invitation = await client.createUmaInvitationWithPayment( "[email protected]", { amount: 1000, // amount in cents currency: { code: "USD", symbol: "$", name: "US Dollar", decimals: 2 } }, new Date(Date.now() + 86400000) // expires in 24 hours ); ``` Verify that the returned invitation object contains the expected payment details. ### Why make this change? This enhancement allows users to create UMA invitations with payments attached, enabling a more seamless onboarding experience where new users can receive funds as part of their invitation. This feature expands the functionality of the UMA invitation system and provides more flexibility for application developers. GitOrigin-RevId: b322a58977f940ddd5d49faa0dbd08940cf056e3 * add cancel uma invitation to js lightspark sdk (#18201) ### TL;DR Added functionality to cancel UMA invitations in the Lightspark SDK. ### What changed? - Added a new `cancelUmaInvitation` method to the `LightsparkClient` class that allows canceling UMA invitations by their invite code - Created a new GraphQL mutation file `CancelUmaInvitation.ts` that defines the mutation for canceling UMA invitations - Imported the new mutation in the client file ### How to test? 1. Create a UMA invitation using the existing SDK methods 2. Call the new `cancelUmaInvitation` method with the invitation code 3. Verify that the invitation is successfully canceled and the method returns the canceled invitation object 4. Try to claim the canceled invitation and confirm it fails ### Why make this change? This change provides users with the ability to cancel UMA invitations that were previously created but are no longer needed. This completes the UMA invitation lifecycle management in the SDK, which already supported creating and claiming invitations. GitOrigin-RevId: df6edac150e6443f6a020d77fb37bbaa4a616bdb * [lightspark-sdk, core] Remove crypto-browserify as dependencies (#18296) GitOrigin-RevId: 033289ee54c0aeb55422589e986923593c5cfa0a * CI update lock file for PR * Add time localization when in progress (#18266) ![Screenshot 2025-06-05 at 10.46.37 AM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/EJphitdgYFvuACNazm1q/81cb4ab4-a63f-47c9-b1b7-5cc9d116f006.png) ![Screenshot 2025-06-05 at 10.46.43 AM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/EJphitdgYFvuACNazm1q/b389f814-ec1c-49e1-9aa2-c10e47e10c98.png) GitOrigin-RevId: fbaaa90c14ca2c2fe4f3379d91310836fd8aa713 * debug * Add human-id as dep * remove unused * Create pretty-radios-rest.md * Create thirty-planets-sleep.md * Create twenty-hands-grow.md --------- Co-authored-by: Matt Davis <[email protected]> Co-authored-by: Jason Wang <[email protected]> Co-authored-by: Brian Siao Tick Chong <[email protected]> Co-authored-by: Lightspark Eng <[email protected]> Co-authored-by: Aaryaman Bhute <[email protected]> Co-authored-by: Joel Weinberger <[email protected]> Co-authored-by: Corey Martin <[email protected]>
1 parent 8c098c7 commit 7ae2525

File tree

17 files changed

+741
-1214
lines changed

17 files changed

+741
-1214
lines changed

.changeset/pretty-radios-rest.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@lightsparkdev/lightspark-sdk": patch
3+
---
4+
5+
- Add createUmaInvitationWithPayment
6+
- Add cancelUmaInvitation
7+
- Remove unneeded crypto-browserify as dependency

.changeset/thirty-planets-sleep.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@lightsparkdev/ui": patch
3+
---
4+
5+
- Updates to BirthdayInput
6+
- Add icons

.changeset/twenty-hands-grow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@lightsparkdev/core": patch
3+
---
4+
5+
- Remove unneeded crypto-browserify as dependency

.github/workflows/runChangeset.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { parse as parseConfig } from "@changesets/config";
33
import * as git from "@changesets/git";
44
import parseChangeset from "@changesets/parse";
55
import * as fs from "fs";
6-
import humanId from "human-id";
6+
import { humanId } from "human-id";
77

88
const configText = fs.readFileSync(".changeset/config.json", {
99
encoding: "utf8",

.github/workflows/updatePR.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const { data: comments } = await github.rest.issues.listComments({
2727
let comment = comments.find((comment) => comment.user.id === 41898282);
2828

2929
let changesetRawStr = process.env.CHANGESET.replace(/\n/g, "\\n");
30+
3031
changesetRawStr = changesetRawStr.replace(/^'(.*)'$/, "$1");
31-
const hasUndef = changesetRawStr.includes("undefined");
3232
const changeset = JSON.parse(changesetRawStr);
3333

3434
const changedPackagesLines = changeset.changedPackages

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
"apps/private/*",
4141
"apps/examples/*"
4242
],
43-
"dependencies": {
44-
"@changesets/cli": "^2.27.1",
45-
"@manypkg/cli": "^0.21.0",
43+
"devDependencies": {
44+
"@amplitude/session-replay-browser": "^1.22.6",
45+
"@changesets/cli": "^2.29.4",
46+
"@manypkg/cli": "^0.24.0",
4647
"@octokit/auth-action": "^4.0.1",
48+
"human-id": "^4.1.1",
4749
"octokit": "^4.0.2",
4850
"ts-prune": "^0.10.3",
4951
"turbo": "^2.4.4"

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
},
6161
"license": "Apache-2.0",
6262
"dependencies": {
63-
"crypto-browserify": "^3.12.0",
6463
"dayjs": "^1.11.7",
6564
"graphql": "^16.6.0",
6665
"graphql-ws": "^5.11.3",

packages/lightspark-sdk/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
"dependencies": {
7272
"@lightsparkdev/core": "1.4.0",
7373
"@lightsparkdev/crypto-wasm": "0.1.14",
74-
"crypto-browserify": "^3.12.0",
7574
"dayjs": "^1.11.7",
7675
"dotenv": "^16.3.1",
7776
"graphql": "^16.6.0",

packages/lightspark-sdk/src/client.ts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js";
2929
import { type SigningKeyLoaderArgs } from "./SigningKeyLoader.js";
3030
import { BitcoinFeeEstimate as BitcoinFeeEstimateQuery } from "./graphql/BitcoinFeeEstimate.js";
3131
import { CancelInvoice } from "./graphql/CancelInvoice.js";
32+
import { CancelUmaInvitation } from "./graphql/CancelUmaInvitation.js";
3233
import { ClaimUmaInvitation } from "./graphql/ClaimUmaInvitation.js";
3334
import { ClaimUmaInvitationWithIncentives } from "./graphql/ClaimUmaInvitationWithIncentives.js";
3435
import { CreateApiToken } from "./graphql/CreateApiToken.js";
@@ -40,6 +41,7 @@ import { CreateTestModeInvoice } from "./graphql/CreateTestModeInvoice.js";
4041
import { CreateTestModePayment } from "./graphql/CreateTestModePayment.js";
4142
import { CreateUmaInvitation } from "./graphql/CreateUmaInvitation.js";
4243
import { CreateUmaInvitationWithIncentives } from "./graphql/CreateUmaInvitationWithIncentives.js";
44+
import { CreateUmaInvitationWithPayment } from "./graphql/CreateUmaInvitationWithPayment.js";
4345
import { CreateUmaInvoice } from "./graphql/CreateUmaInvoice.js";
4446
import { DecodeInvoice } from "./graphql/DecodeInvoice.js";
4547
import { DeleteApiToken } from "./graphql/DeleteApiToken.js";
@@ -1737,6 +1739,85 @@ class LightsparkClient {
17371739
coreLogger.setEnabled(enabled, level);
17381740
logger.setEnabled(enabled, level);
17391741
}
1742+
1743+
/**
1744+
* Creates an UMA invitation with an attached payment.
1745+
*
1746+
* @param inviterUma The UMA of the inviter.
1747+
* @param amountToSend The amount and currency to send in the smallest unit of the currency (i.e. cents for USD).
1748+
* @param expiresAt The expiration date/time (Date).
1749+
* @returns The invitation that was created, or null if creation failed.
1750+
*/
1751+
public async createUmaInvitationWithPayment(
1752+
inviterUma: string,
1753+
amountToSend: {
1754+
amount: number;
1755+
currency: {
1756+
code: string;
1757+
name: string;
1758+
symbol: string;
1759+
decimals: number;
1760+
};
1761+
},
1762+
expiresAt: Date,
1763+
): Promise<UmaInvitation | null> {
1764+
return await this.executeRawQuery({
1765+
queryPayload: CreateUmaInvitationWithPayment,
1766+
variables: {
1767+
inviterUma,
1768+
paymentAmount: amountToSend.amount,
1769+
paymentCurrency: amountToSend.currency,
1770+
expiresAt: expiresAt.toISOString(),
1771+
},
1772+
constructObject: (responseJson: {
1773+
create_uma_invitation_with_payment: {
1774+
invitation: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1775+
} | null;
1776+
}) => {
1777+
if (!responseJson.create_uma_invitation_with_payment?.invitation) {
1778+
throw new LightsparkException(
1779+
"CreateUmaInvitationWithPaymentError",
1780+
"Unable to create UMA invitation with payment",
1781+
);
1782+
}
1783+
return UmaInvitationFromJson(
1784+
responseJson.create_uma_invitation_with_payment.invitation,
1785+
);
1786+
},
1787+
});
1788+
}
1789+
1790+
/**
1791+
* Cancels an UMA invitation by its invite code.
1792+
*
1793+
* @param invitationCode The code of the invitation to cancel.
1794+
* @returns The cancelled invitation, or null if cancellation failed.
1795+
*/
1796+
public async cancelUmaInvitation(
1797+
invitationCode: string,
1798+
): Promise<UmaInvitation | null> {
1799+
return await this.executeRawQuery({
1800+
queryPayload: CancelUmaInvitation,
1801+
variables: {
1802+
inviteCode: invitationCode,
1803+
},
1804+
constructObject: (responseJson: {
1805+
cancel_uma_invitation: {
1806+
invitation: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1807+
} | null;
1808+
}) => {
1809+
if (!responseJson.cancel_uma_invitation?.invitation) {
1810+
throw new LightsparkException(
1811+
"CancelUmaInvitationError",
1812+
"Unable to cancel UMA invitation",
1813+
);
1814+
}
1815+
return UmaInvitationFromJson(
1816+
responseJson.cancel_uma_invitation.invitation,
1817+
);
1818+
},
1819+
});
1820+
}
17401821
}
17411822

17421823
export default LightsparkClient;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 CancelUmaInvitation = `
6+
mutation CancelUmaInvitation(
7+
$inviteCode: String!
8+
) {
9+
cancel_uma_invitation(input: {
10+
invite_code: $inviteCode
11+
}) {
12+
invitation {
13+
...UmaInvitationFragment
14+
}
15+
}
16+
}
17+
18+
${UmaInvitationFragment}
19+
`;

0 commit comments

Comments
 (0)