Skip to content

Commit

Permalink
[generator] handle nullable lists in js_writer and fix LightsparkNode…
Browse files Browse the repository at this point in the history
… typenames (#6182)

- updates js_writer to handle nullable lists
- fixes node names due to OSK/remote changes

GitOrigin-RevId: ba076fb3153c2056439c9fed35f170be3bf8f2cd
  • Loading branch information
bsiaotickchong authored and Lightspark Eng committed Sep 16, 2023
1 parent f7069eb commit 94ba7f7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/lightspark-sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class LightsparkClient {
{ nodeId },
);
const nodeEntity = response.entity;
if (nodeEntity?.__typename === "LightsparkNode") {
if (nodeEntity?.__typename === "LightsparkNodeWithOSK") {
return nodeEntity.encrypted_signing_private_key;
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const RecoverNodeSigningKey = `
query RecoverNodeSigningKey($nodeId: ID!) {
entity(id: $nodeId) {
__typename
... on LightsparkNode {
... on LightsparkNodeWithOSK {
encrypted_signing_private_key {
encrypted_value
cipher
Expand Down
2 changes: 1 addition & 1 deletion packages/lightspark-sdk/src/objects/IncomingPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const IncomingPaymentFromJson = (obj: any): IncomingPayment => {
obj["incoming_payment_resolved_at"],
obj["incoming_payment_transaction_hash"],
obj["incoming_payment_payment_request"]?.id ?? undefined,
obj["incoming_payment_uma_post_transaction_data"].map((e) =>
obj["incoming_payment_uma_post_transaction_data"]?.map((e) =>
PostTransactionDataFromJson(e),
),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/lightspark-sdk/src/objects/LightningTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const LightningTransactionFromJson = (
obj["incoming_payment_resolved_at"],
obj["incoming_payment_transaction_hash"],
obj["incoming_payment_payment_request"]?.id ?? undefined,
obj["incoming_payment_uma_post_transaction_data"].map((e) =>
obj["incoming_payment_uma_post_transaction_data"]?.map((e) =>
PostTransactionDataFromJson(e),
),
);
Expand Down Expand Up @@ -95,7 +95,7 @@ export const LightningTransactionFromJson = (
!!obj["outgoing_payment_failure_message"]
? RichTextFromJson(obj["outgoing_payment_failure_message"])
: undefined,
obj["outgoing_payment_uma_post_transaction_data"].map((e) =>
obj["outgoing_payment_uma_post_transaction_data"]?.map((e) =>
PostTransactionDataFromJson(e),
),
);
Expand Down
2 changes: 1 addition & 1 deletion packages/lightspark-sdk/src/objects/OutgoingPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const OutgoingPaymentFromJson = (obj: any): OutgoingPayment => {
!!obj["outgoing_payment_failure_message"]
? RichTextFromJson(obj["outgoing_payment_failure_message"])
: undefined,
obj["outgoing_payment_uma_post_transaction_data"].map((e) =>
obj["outgoing_payment_uma_post_transaction_data"]?.map((e) =>
PostTransactionDataFromJson(e),
),
);
Expand Down
4 changes: 2 additions & 2 deletions packages/lightspark-sdk/src/objects/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const TransactionFromJson = (obj: any): Transaction => {
obj["incoming_payment_resolved_at"],
obj["incoming_payment_transaction_hash"],
obj["incoming_payment_payment_request"]?.id ?? undefined,
obj["incoming_payment_uma_post_transaction_data"].map((e) =>
obj["incoming_payment_uma_post_transaction_data"]?.map((e) =>
PostTransactionDataFromJson(e),
),
);
Expand Down Expand Up @@ -163,7 +163,7 @@ export const TransactionFromJson = (obj: any): Transaction => {
!!obj["outgoing_payment_failure_message"]
? RichTextFromJson(obj["outgoing_payment_failure_message"])
: undefined,
obj["outgoing_payment_uma_post_transaction_data"].map((e) =>
obj["outgoing_payment_uma_post_transaction_data"]?.map((e) =>
PostTransactionDataFromJson(e),
),
);
Expand Down

0 comments on commit 94ba7f7

Please sign in to comment.