Skip to content

Commit f5247b0

Browse files
github-actions[bot]bsiaotickchongLightspark EngJasonCWang
authored
Updates to ui, lightspark-sdk (#473)
* [nage] add pagination design for DataManagerTable, add temp security log table (#19556) - adds custom DataManagerTable for nage with common props - adds temporary security log table to test pagination - adds customization to Dropdown to allow showing the menu above the button ![Screenshot 2025-07-31 at 4.24.28 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/7f329b0c-d223-4225-a112-da517dac8bbd.png) ![Screenshot 2025-07-30 at 6.01.52 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/59bbed82-711e-421b-a81d-a32123e02ab2.png) The pagination has a few different possible states: 1. show first and 2nd page and last ![Screenshot 2025-07-31 at 3.13.09 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/0a92c43f-db47-4c17-8eb6-ecbbd3a25c53.png) 2. show current page if between those with ellipses ![Screenshot 2025-07-31 at 3.30.23 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/eebe6cba-428b-4627-aa81-1a0b56bb53b7.png) 3. only show ellipses if there are pages between ![Screenshot 2025-07-31 at 3.30.51 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/4f4b9388-f930-4549-83c7-d19b974c6b45.png) Note: Clicking on page numbers doesn't work if it's a later page that has not been queried yet. This is because we use cursor based pagination and trying to jump to a page is a limitation. We would have to query all pages in between which isn't scalable. For now just allowing clicking on previously seen pages instead GitOrigin-RevId: 916311d5507ece64bedd26d3b39a2f0c527611d1 * [nage] add code section to DetailsPage (#19576) ![Screenshot 2025-08-01 at 3.06.14 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/NU8OmLauzLqa61yWDJkY/41416683-5499-4670-b0f3-58816e463a01.png) GitOrigin-RevId: db09e1902f935af2d462c5334d2d8f3a40b59433 * CI update lock file for PR * Cleanup ls-sdk client.ts (#19540) GitOrigin-RevId: bbecc81cf1cc398f1e168299866fb5e3e1b13941 * Regenerate js-sdk objects (#19649) GitOrigin-RevId: 5702e553a68bc5691fc389404c3d8058b1f87ba9 * Create old-knives-wish.md * Create smart-ways-fetch.md --------- Co-authored-by: Brian Siao Tick Chong <bsiaotickchong@gmail.com> Co-authored-by: Lightspark Eng <engineering@lightspark.com> Co-authored-by: Jason Wang <jason@lightspark.com>
1 parent ffa04c4 commit f5247b0

19 files changed

Lines changed: 334 additions & 38 deletions

File tree

.changeset/old-knives-wish.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@lightsparkdev/ui": patch
3+
---
4+
5+
Adding additional nage dashboard designs and components

.changeset/smart-ways-fetch.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+
- Regenerated Graphql Objects and added new code field onto UmaCurrency query.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
"@changesets/cli": "^2.29.4",
4646
"@manypkg/cli": "^0.24.0",
4747
"@octokit/auth-action": "^4.0.1",
48+
"@types/prismjs": "^1.26.0",
4849
"human-id": "^4.1.1",
4950
"octokit": "^4.0.2",
51+
"prismjs": "^1.29.0",
5052
"ts-prune": "^0.10.3",
5153
"turbo": "^2.5.4"
5254
},

packages/lightspark-sdk/src/client.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ class LightsparkClient {
791791
* @param withdrawalMode The strategy that should be used to withdraw the funds from this node.
792792
* @returns An estimated amount for the L1 withdrawal fees for the specified node, amount, and strategy.
793793
*/
794-
public async getWithrawalFeeEstimate(
794+
public async getWithdrawalFeeEstimate(
795795
nodeId: string,
796796
amountSats: number,
797797
withdrawalMode: WithdrawalMode,
@@ -1820,8 +1820,14 @@ class LightsparkClient {
18201820
});
18211821
}
18221822

1823+
/**
1824+
* Looks up a UMA address to check if it exists.
1825+
*
1826+
* @param umaAddress The UMA address to look up.
1827+
* @returns True if the UMA address exists, false otherwise.
1828+
*/
18231829
public async lookupUmaAddress(umaAddress: string): Promise<boolean> {
1824-
return await this.executeRawQuery({
1830+
const result = await this.executeRawQuery({
18251831
queryPayload: LookupUmaAddress,
18261832
variables: { uma_address: umaAddress },
18271833
constructObject: (responseJson: {
@@ -1830,6 +1836,7 @@ class LightsparkClient {
18301836
return responseJson.lookup_uma_address;
18311837
},
18321838
});
1839+
return result ?? false;
18331840
}
18341841
}
18351842

packages/lightspark-sdk/src/objects/ChannelStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export enum ChannelStatus {
2222
*/
2323
UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND",
2424
/**
25-
* The channel is behaving properly, but its remote balance is much lower than its
26-
* local balance so it is not balanced properly for receiving funds. *
25+
* The channel is behaving properly, but its remote balance is much lower than its local balance
26+
* so it is not balanced properly for receiving funds. *
2727
*/
2828
UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE",
2929
/**

packages/lightspark-sdk/src/objects/CurrencyUnit.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ export enum CurrencyUnit {
1717
* commonly used in Lightning transactions. *
1818
*/
1919
SATOSHI = "SATOSHI",
20-
/** 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when
21-
* possible. **/
20+
/**
21+
* 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. *
22+
*/
2223
MILLISATOSHI = "MILLISATOSHI",
2324
/** United States Dollar. **/
2425
USD = "USD",

packages/lightspark-sdk/src/objects/Entity.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ fragment EntityFragment on Entity {
14441444
__typename
14451445
uma_currency_amount_value: value
14461446
uma_currency_amount_currency: currency {
1447-
id
1447+
code
14481448
}
14491449
}
14501450
uma_invitation_cancelled_at: cancelled_at

packages/lightspark-sdk/src/objects/TransactionStatus.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ export enum TransactionStatus {
1616
FAILED = "FAILED",
1717
/** Transaction has been initiated and is currently in-flight. **/
1818
PENDING = "PENDING",
19-
/** For transaction type PAYMENT_REQUEST only. No payments have been made to a payment
20-
* request. **/
19+
/**
20+
* For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request. *
21+
*/
2122
NOT_STARTED = "NOT_STARTED",
2223
/** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/
2324
EXPIRED = "EXPIRED",

packages/lightspark-sdk/src/objects/UmaCurrencyAmount.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved
22

3+
import type UmaCurrency from "./UmaCurrency.js";
4+
import { UmaCurrencyFromJson, UmaCurrencyToJson } from "./UmaCurrency.js";
5+
36
interface UmaCurrencyAmount {
47
value: number;
58

6-
currencyId: string;
9+
currency: UmaCurrency;
710
}
811

912
export const UmaCurrencyAmountFromJson = (obj: any): UmaCurrencyAmount => {
1013
return {
1114
value: obj["uma_currency_amount_value"],
12-
currencyId: obj["uma_currency_amount_currency"].id,
15+
currency: UmaCurrencyFromJson(obj["uma_currency_amount_currency"]),
1316
} as UmaCurrencyAmount;
1417
};
1518
export const UmaCurrencyAmountToJson = (obj: UmaCurrencyAmount): any => {
1619
return {
1720
uma_currency_amount_value: obj.value,
18-
uma_currency_amount_currency: { id: obj.currencyId },
21+
uma_currency_amount_currency: UmaCurrencyToJson(obj.currency),
1922
};
2023
};
2124

@@ -24,7 +27,7 @@ fragment UmaCurrencyAmountFragment on UmaCurrencyAmount {
2427
__typename
2528
uma_currency_amount_value: value
2629
uma_currency_amount_currency: currency {
27-
id
30+
code
2831
}
2932
}`;
3033

packages/lightspark-sdk/src/objects/UmaInvitation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fragment UmaInvitationFragment on UmaInvitation {
139139
__typename
140140
uma_currency_amount_value: value
141141
uma_currency_amount_currency: currency {
142-
id
142+
code
143143
}
144144
}
145145
uma_invitation_cancelled_at: cancelled_at

0 commit comments

Comments
 (0)