Skip to content

Commit 52a274f

Browse files
github-actions[bot]coreymartinLightspark Engmatthappensjklein24
authored
Updates to core, lightspark-sdk, ui (#462)
* [js] Move amplitude to uma-bridge deps (#18300) GitOrigin-RevId: 9210f28fbdd6dce2d5ddb1518902313dd3c4e0b4 * Update from public js-sdk main branch (#18299) * Version Packages (#461) * Version Packages * CI update lock file for PR --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> GitOrigin-RevId: 0142bdc * CI update lock file for PR * fix --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Lightspark Eng <engineering@lightspark.com> Co-authored-by: Corey Martin <coreyn.martin@gmail.com> GitOrigin-RevId: 3fe68f68e43e007db5b7a59e1ca5a1c6ff891e9d * add british pound currency (#17239) # Add British Pound currency this will allow us to onboard users who use pounds GitOrigin-RevId: 60891006f8e3354f312fe1d8364670801cb87597 * CI update lock file for PR * Include yarn releases in the docker image for js uma vasp (#18435) GitOrigin-RevId: f4861ca3dd079e9ba18602321bc5813828c7cc44 * add state to ops manual reviews (#18446) GitOrigin-RevId: ab6c7b9a485cd621d065cdc4489f04b13ca2fc10 * add payment fields to javascript sdk object, and add docs to match (#18367) ### TL;DR Added new fields to the UMA invitation object to support invitation status, payment details, and expiration information. ![Screenshot 2025-06-09 at 1.57.07 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/kXS0LK7Piva9kiHcEnGv/71488bfc-da31-4bb4-9946-fba49d1c7b7a.png) ### What changed? - Added new fields to the `UmaInvitation` interface: - `status`: Enum with values `PENDING`, `CLAIMED`, `CANCELLED`, `EXPIRED` - `paymentAmount`: Optional object containing payment value and currency details - `cancelledAt`: Optional timestamp for when an invitation was cancelled - `expiresAt`: Optional timestamp for when an invitation will expire - Updated the JSON serialization/deserialization methods to handle these new fields - Updated the GraphQL fragment to include the new fields in queries - Updated documentation to reflect these new fields and their possible values ### How to test? 1. Create a UMA invitation with payment details and expiration date 2. Verify the new fields are properly populated in the returned object 3. Test each status transition (pending → claimed, pending → cancelled, pending → expired) 4. Verify the JSON serialization/deserialization works correctly with the new fields ### Why make this change? These additions provide more comprehensive information about UMA invitations, allowing developers to: - Track the current status of invitations - Include payment information with invitations - Set and monitor expiration dates - Handle invitation cancellations This enables more sophisticated invitation workflows and better user experiences in applications using the Lightspark SDK. GitOrigin-RevId: d2cbbccfb5bf6fb103d4cff1acff867af88eaf32 * Add new send flow for payments with invites (#18381) ![Screenshot 2025-06-09 at 4.28.44 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/EJphitdgYFvuACNazm1q/c6c099c0-b736-4c37-9f13-204d57d3d99b.png) Contributes to PX-525 GitOrigin-RevId: b1471fc84f733a5f013d9052e33acf4752d1bf87 * Add lock send GK to uma home screen (#18650) ![Screenshot 2025-06-18 at 9.14.20 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/EJphitdgYFvuACNazm1q/3c1c581b-be24-469d-9bcd-e628968292ae.png) ![Screenshot 2025-06-18 at 9.14.24 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/EJphitdgYFvuACNazm1q/885957d8-975f-4aae-b1e7-9069d0f5e2cc.png) GitOrigin-RevId: abddb144186fab127093df3d17fdfeb0d6b090fb * [ui] add status header option for CardForm (#18646) - adds status header option to CardForm - allows passing react to nodes arg - also onClick which will be used to open a modal upon clicking the header - desktop version is a pill - hacky solution to update the theme-color so that the iphone status bar matches color - replaces margins on CardForm with padding so that the border radius at the top (and the background color) is correct for mobile screens - updates theme border color to be darker Example: ![Screenshot 2025-06-18 at 6.11.42 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/5d22150d-0fb5-47d5-9d9a-5b082f4b7634.png) ![Screenshot 2025-06-18 at 6.11.26 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/8923e43d-23a2-43b8-bf28-4a0e8009b761.png) GitOrigin-RevId: d13a11e0e486c6ad4672af9c76df7e99f13b32b2 * Create mighty-buckets-add.md * Create shaggy-clowns-exist.md * Create slimy-zoos-repeat.md --------- Co-authored-by: Corey Martin <coreyn.martin@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Lightspark Eng <engineering@lightspark.com> Co-authored-by: Matt Davis <matthappens@gmail.com> Co-authored-by: Jeremy Klein <jklein24@gmail.com> Co-authored-by: Jason Wang <jason@lightspark.com> Co-authored-by: Brian Siao Tick Chong <bsiaotickchong@gmail.com>
1 parent 0142bdc commit 52a274f

18 files changed

Lines changed: 1405 additions & 259 deletions

File tree

.changeset/mighty-buckets-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@lightsparkdev/lightspark-sdk": patch
3+
---
4+
5+
- Regenerate GQL objects, add UmaCurrencyAmount object, update UmaInvitation with additional statuses

.changeset/shaggy-clowns-exist.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@lightsparkdev/core": patch
3+
---
4+
5+
- Add GBP as valid CurrencyUnit
6+
- Add zipcodeToState util

.changeset/slimy-zoos-repeat.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 Button, CardForm, IconWithCircleBackground
6+
- Updates to colors, theme defaults

apps/examples/uma-vasp/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ COPY packages/lightspark-sdk/package.json ./packages/lightspark-sdk/
1111
COPY packages/core/package.json packages/core/
1212
COPY packages/eslint-config/package.json ./packages/eslint-config/
1313
COPY packages/tsconfig/package.json ./packages/tsconfig/
14+
COPY .yarn/releases ./.yarn/releases
1415

1516
RUN corepack enable
1617
RUN corepack prepare --activate

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"apps/examples/*"
4242
],
4343
"devDependencies": {
44-
"@amplitude/session-replay-browser": "^1.22.6",
4544
"@changesets/cli": "^2.29.4",
4645
"@manypkg/cli": "^0.24.0",
4746
"@octokit/auth-action": "^4.0.1",

packages/core/src/utils/currency.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const CurrencyUnit = {
2222
MXN: "MXN",
2323
PHP: "PHP",
2424
EUR: "EUR",
25+
GBP: "GBP",
2526

2627
Bitcoin: "BITCOIN",
2728
Microbitcoin: "MICROBITCOIN",
@@ -32,6 +33,7 @@ export const CurrencyUnit = {
3233
Usd: "USD",
3334
Mxn: "MXN",
3435
Php: "PHP",
36+
Gbp: "GBP",
3537
} as const;
3638

3739
export type CurrencyUnitType = (typeof CurrencyUnit)[keyof typeof CurrencyUnit];
@@ -61,6 +63,7 @@ const standardUnitConversionObj = {
6163
[CurrencyUnit.MXN]: (v: number) => v,
6264
[CurrencyUnit.PHP]: (v: number) => v,
6365
[CurrencyUnit.EUR]: (v: number) => v,
66+
[CurrencyUnit.GBP]: (v: number) => v,
6467
};
6568

6669
/* Round without decimals since we're returning cents: */
@@ -89,6 +92,7 @@ const CONVERSION_MAP = {
8992
[CurrencyUnit.MXN]: toBitcoinConversion,
9093
[CurrencyUnit.PHP]: toBitcoinConversion,
9194
[CurrencyUnit.EUR]: toBitcoinConversion,
95+
[CurrencyUnit.GBP]: toBitcoinConversion,
9296
},
9397
[CurrencyUnit.MICROBITCOIN]: {
9498
[CurrencyUnit.BITCOIN]: (v: number) => v / 1_000_000,
@@ -101,6 +105,7 @@ const CONVERSION_MAP = {
101105
[CurrencyUnit.MXN]: toMicrobitcoinConversion,
102106
[CurrencyUnit.PHP]: toMicrobitcoinConversion,
103107
[CurrencyUnit.EUR]: toMicrobitcoinConversion,
108+
[CurrencyUnit.GBP]: toMicrobitcoinConversion,
104109
},
105110
[CurrencyUnit.MILLIBITCOIN]: {
106111
[CurrencyUnit.BITCOIN]: (v: number) => v / 1_000,
@@ -113,6 +118,7 @@ const CONVERSION_MAP = {
113118
[CurrencyUnit.MXN]: toMillibitcoinConversion,
114119
[CurrencyUnit.PHP]: toMillibitcoinConversion,
115120
[CurrencyUnit.EUR]: toMillibitcoinConversion,
121+
[CurrencyUnit.GBP]: toMillibitcoinConversion,
116122
},
117123
[CurrencyUnit.MILLISATOSHI]: {
118124
[CurrencyUnit.BITCOIN]: (v: number) => v / 100_000_000_000,
@@ -125,6 +131,7 @@ const CONVERSION_MAP = {
125131
[CurrencyUnit.MXN]: toMillisatoshiConversion,
126132
[CurrencyUnit.PHP]: toMillisatoshiConversion,
127133
[CurrencyUnit.EUR]: toMillisatoshiConversion,
134+
[CurrencyUnit.GBP]: toMillisatoshiConversion,
128135
},
129136
[CurrencyUnit.NANOBITCOIN]: {
130137
[CurrencyUnit.BITCOIN]: (v: number) => v / 1_000_000_000,
@@ -137,6 +144,7 @@ const CONVERSION_MAP = {
137144
[CurrencyUnit.MXN]: toNanobitcoinConversion,
138145
[CurrencyUnit.PHP]: toNanobitcoinConversion,
139146
[CurrencyUnit.EUR]: toNanobitcoinConversion,
147+
[CurrencyUnit.GBP]: toNanobitcoinConversion,
140148
},
141149
[CurrencyUnit.SATOSHI]: {
142150
[CurrencyUnit.BITCOIN]: (v: number) => v / 100_000_000,
@@ -149,11 +157,13 @@ const CONVERSION_MAP = {
149157
[CurrencyUnit.MXN]: toSatoshiConversion,
150158
[CurrencyUnit.PHP]: toSatoshiConversion,
151159
[CurrencyUnit.EUR]: toSatoshiConversion,
160+
[CurrencyUnit.GBP]: toSatoshiConversion,
152161
},
153162
[CurrencyUnit.USD]: standardUnitConversionObj,
154163
[CurrencyUnit.MXN]: standardUnitConversionObj,
155164
[CurrencyUnit.PHP]: standardUnitConversionObj,
156165
[CurrencyUnit.EUR]: standardUnitConversionObj,
166+
[CurrencyUnit.GBP]: standardUnitConversionObj,
157167
};
158168

159169
export function convertCurrencyAmountValue(
@@ -219,6 +229,7 @@ export type CurrencyMap = {
219229
[CurrencyUnit.MXN]: number;
220230
[CurrencyUnit.PHP]: number;
221231
[CurrencyUnit.EUR]: number;
232+
[CurrencyUnit.GBP]: number;
222233
[CurrencyUnit.FUTURE_VALUE]: number;
223234
formatted: {
224235
sats: string;
@@ -234,6 +245,7 @@ export type CurrencyMap = {
234245
[CurrencyUnit.MXN]: string;
235246
[CurrencyUnit.PHP]: string;
236247
[CurrencyUnit.EUR]: string;
248+
[CurrencyUnit.GBP]: string;
237249
[CurrencyUnit.FUTURE_VALUE]: string;
238250
};
239251
isZero: boolean;
@@ -430,6 +442,7 @@ function convertCurrencyAmountValues(
430442
mxn: CurrencyUnit.MXN,
431443
php: CurrencyUnit.PHP,
432444
eur: CurrencyUnit.EUR,
445+
gbp: CurrencyUnit.GBP,
433446
mibtc: CurrencyUnit.MICROBITCOIN,
434447
mlbtc: CurrencyUnit.MILLIBITCOIN,
435448
nbtc: CurrencyUnit.NANOBITCOIN,
@@ -479,7 +492,7 @@ export function mapCurrencyAmount(
479492
* preferred_currency_unit on CurrencyAmount types: */
480493
const conversionOverride = getPreferredConversionOverride(currencyAmountArg);
481494

482-
const { sats, msats, btc, usd, mxn, php, mibtc, mlbtc, nbtc, eur } =
495+
const { sats, msats, btc, usd, mxn, php, mibtc, mlbtc, nbtc, eur, gbp } =
483496
convertCurrencyAmountValues(unit, value, unitsPerBtc, conversionOverride);
484497

485498
const mapWithCurrencyUnits = {
@@ -490,6 +503,7 @@ export function mapCurrencyAmount(
490503
[CurrencyUnit.MXN]: mxn,
491504
[CurrencyUnit.PHP]: php,
492505
[CurrencyUnit.EUR]: eur,
506+
[CurrencyUnit.GBP]: gbp,
493507
[CurrencyUnit.MICROBITCOIN]: mibtc,
494508
[CurrencyUnit.MILLIBITCOIN]: mlbtc,
495509
[CurrencyUnit.NANOBITCOIN]: nbtc,
@@ -535,6 +549,10 @@ export function mapCurrencyAmount(
535549
value: eur,
536550
unit: CurrencyUnit.EUR,
537551
}),
552+
[CurrencyUnit.GBP]: formatCurrencyStr({
553+
value: gbp,
554+
unit: CurrencyUnit.GBP,
555+
}),
538556
[CurrencyUnit.FUTURE_VALUE]: "-",
539557
},
540558
};
@@ -611,6 +629,8 @@ export const abbrCurrencyUnit = (unit: CurrencyUnitType) => {
611629
return "PHP";
612630
case CurrencyUnit.EUR:
613631
return "EUR";
632+
case CurrencyUnit.GBP:
633+
return "GBP";
614634
}
615635
return "Unsupported CurrencyUnit";
616636
};
@@ -665,6 +685,7 @@ export function formatCurrencyStr(
665685
CurrencyUnit.MXN,
666686
CurrencyUnit.PHP,
667687
CurrencyUnit.EUR,
688+
CurrencyUnit.GBP,
668689
] as string[];
669690
/* centCurrencies are always provided in the smallest unit, e.g. cents for USD. These should be
670691
* divided by 100 for proper display format: */

packages/core/src/utils/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ export * from "./sleep.js";
1616
export * from "./strings.js";
1717
export * from "./typeGuards.js";
1818
export * from "./types.js";
19+
export * from "./zipcodeToState.js";

0 commit comments

Comments
 (0)