diff --git a/apps/examples/streaming-wallet-extension/src/components/TransactionRow.tsx b/apps/examples/streaming-wallet-extension/src/components/TransactionRow.tsx index 7bd0f9d79..8d72d7468 100644 --- a/apps/examples/streaming-wallet-extension/src/components/TransactionRow.tsx +++ b/apps/examples/streaming-wallet-extension/src/components/TransactionRow.tsx @@ -2,7 +2,6 @@ import styled from "@emotion/styled"; import { ChannelClosingTransaction, ChannelOpeningTransaction, - IncomingPayment, OutgoingPayment, RoutingTransaction, Transaction, @@ -43,7 +42,7 @@ const getTransactionOtherNode = (transaction: Transaction): Maybe => { case "OutgoingPayment": return (transaction as OutgoingPayment).destinationId; case "IncomingPayment": - return (transaction as IncomingPayment).originId; + return "Unknown"; case "RoutingTransaction": return (transaction as RoutingTransaction).incomingChannelId; default: diff --git a/packages/lightspark-sdk/src/client.ts b/packages/lightspark-sdk/src/client.ts index c5f7beaf5..8e42f2a17 100644 --- a/packages/lightspark-sdk/src/client.ts +++ b/packages/lightspark-sdk/src/client.ts @@ -251,7 +251,6 @@ class LightsparkClient { return { color: node.color, displayName: node.display_name, - purpose: node.purpose, id: node.id, publicKey: node.public_key, status: node.status, @@ -354,7 +353,6 @@ class LightsparkClient { return { color: node.color, displayName: account.name, - purpose: node.purpose, id: node.id, publicKey: node.public_key, status: node.status, diff --git a/packages/lightspark-sdk/src/graphql/MultiNodeDashboard.ts b/packages/lightspark-sdk/src/graphql/MultiNodeDashboard.ts index f3f35e553..46d51f138 100644 --- a/packages/lightspark-sdk/src/graphql/MultiNodeDashboard.ts +++ b/packages/lightspark-sdk/src/graphql/MultiNodeDashboard.ts @@ -3,7 +3,6 @@ import type { Maybe } from "@lightsparkdev/core"; import type CurrencyAmount from "../objects/CurrencyAmount.js"; import { FRAGMENT as CurrencyAmountFragment } from "../objects/CurrencyAmount.js"; -import type LightsparkNodePurpose from "../objects/LightsparkNodePurpose.js"; import type LightsparkNodeStatus from "../objects/LightsparkNodeStatus.js"; import type NodeAddressType from "../objects/NodeAddressType.js"; @@ -14,7 +13,6 @@ export type AccountDashboard = { id: string; color: Maybe; displayName: string; - purpose: Maybe; publicKey: Maybe; status: Maybe; addresses: { @@ -57,7 +55,6 @@ export const MultiNodeDashboard = ` entities { color display_name - purpose id addresses(first: 1) { entities { diff --git a/packages/lightspark-sdk/src/graphql/SingleNodeDashboard.ts b/packages/lightspark-sdk/src/graphql/SingleNodeDashboard.ts index f62887ed5..aa6003388 100644 --- a/packages/lightspark-sdk/src/graphql/SingleNodeDashboard.ts +++ b/packages/lightspark-sdk/src/graphql/SingleNodeDashboard.ts @@ -24,7 +24,6 @@ query SingleNodeDashboard( entities { color display_name - purpose id addresses(first: 1) { entities { diff --git a/packages/lightspark-sdk/src/objects/Account.ts b/packages/lightspark-sdk/src/objects/Account.ts index 2711e3f59..fe9667c6c 100644 --- a/packages/lightspark-sdk/src/objects/Account.ts +++ b/packages/lightspark-sdk/src/objects/Account.ts @@ -227,27 +227,24 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw page_info_start_cursor: start_cursor page_info_end_cursor: end_cursor } - account_to_nodes_connection_purpose: purpose account_to_nodes_connection_entities: entities { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { - id - } - lightspark_node_owner: owner { - id - } - lightspark_node_blockchain_balance: blockchain_balance { + ... on LightsparkNodeWithOSK { __typename - blockchain_balance_total_balance: total_balance { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { + id + } + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -255,7 +252,7 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_confirmed_balance: confirmed_balance { + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -263,7 +260,7 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_unconfirmed_balance: unconfirmed_balance { + lightspark_node_with_o_s_k_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -271,7 +268,7 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_locked_balance: locked_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -279,7 +276,80 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_required_reserve: required_reserve { + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { + __typename + secret_encrypted_value: encrypted_value + secret_cipher: cipher + } + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -287,7 +357,7 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_available_balance: available_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -295,46 +365,75 @@ query FetchAccountToNodesConnection($first: Int, $bitcoin_networks: [BitcoinNetw currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } + lightspark_node_with_remote_signing_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { - __typename - secret_encrypted_value: encrypted_value - secret_cipher: cipher - } - lightspark_node_total_balance: total_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_total_local_balance: total_local_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_local_balance: local_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_status: status } } } @@ -708,15 +807,24 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } incoming_payment_transaction_hash: transaction_hash - incoming_payment_origin: origin { - id - } incoming_payment_destination: destination { id } incoming_payment_payment_request: payment_request { id } + incoming_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on OutgoingPayment { __typename @@ -780,24 +888,54 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -848,12 +986,29 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -861,7 +1016,7 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -869,7 +1024,7 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -877,8 +1032,7 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -886,7 +1040,58 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -896,6 +1101,18 @@ query FetchAccountToTransactionsConnection($first: Int, $after: String, $types: __typename rich_text_text: text } + outgoing_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on RoutingTransaction { __typename @@ -1050,24 +1267,54 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -1118,12 +1365,29 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -1131,7 +1395,7 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -1139,7 +1403,7 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -1147,8 +1411,7 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -1156,7 +1419,58 @@ query FetchAccountToPaymentRequestsConnection($first: Int, $after: String, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -1246,6 +1560,9 @@ query FetchAccountToWalletsConnection($first: Int, $after: String, $third_party_ } } wallet_third_party_identifier: third_party_identifier + wallet_account: account { + id + } wallet_status: status } } diff --git a/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts b/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts index abced25a7..ecb2ff028 100644 --- a/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts @@ -3,7 +3,6 @@ import type Connection from "./Connection.js"; import type LightsparkNode from "./LightsparkNode.js"; import { LightsparkNodeFromJson } from "./LightsparkNode.js"; -import LightsparkNodePurpose from "./LightsparkNodePurpose.js"; import type PageInfo from "./PageInfo.js"; import { PageInfoFromJson } from "./PageInfo.js"; @@ -23,13 +22,6 @@ type AccountToNodesConnection = Connection & { /** The typename of the object **/ typename: string; - - /** - * The main purpose for the selected set of nodes. It is automatically determined from the nodes that - * are selected in this connection and is used for optimization purposes, as well as to determine the - * variation of the UI that should be presented to the user. - **/ - purpose?: LightsparkNodePurpose; }; export const AccountToNodesConnectionFromJson = ( @@ -42,10 +34,6 @@ export const AccountToNodesConnectionFromJson = ( LightsparkNodeFromJson(e), ), typename: "AccountToNodesConnection", - purpose: !!obj["account_to_nodes_connection_purpose"] - ? LightsparkNodePurpose[obj["account_to_nodes_connection_purpose"]] ?? - LightsparkNodePurpose.FUTURE_VALUE - : null, } as AccountToNodesConnection; }; @@ -60,7 +48,6 @@ fragment AccountToNodesConnectionFragment on AccountToNodesConnection { page_info_start_cursor: start_cursor page_info_end_cursor: end_cursor } - account_to_nodes_connection_purpose: purpose account_to_nodes_connection_entities: entities { id } diff --git a/packages/lightspark-sdk/src/objects/CryptoSanctionsScreeningProvider.ts b/packages/lightspark-sdk/src/objects/ComplianceProvider.ts similarity index 64% rename from packages/lightspark-sdk/src/objects/CryptoSanctionsScreeningProvider.ts rename to packages/lightspark-sdk/src/objects/ComplianceProvider.ts index 3ee6d6bd6..6b4100aee 100644 --- a/packages/lightspark-sdk/src/objects/CryptoSanctionsScreeningProvider.ts +++ b/packages/lightspark-sdk/src/objects/ComplianceProvider.ts @@ -1,7 +1,7 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum identifying a type of crypto sanctions screening provider. **/ -export enum CryptoSanctionsScreeningProvider { +/** This is an enum identifying a type of compliance provider. **/ +export enum ComplianceProvider { /** * This is an enum value that represents values that could be added in the future. * Clients should support unknown values as more of them could be added without notice. @@ -11,4 +11,4 @@ export enum CryptoSanctionsScreeningProvider { CHAINALYSIS = "CHAINALYSIS", } -export default CryptoSanctionsScreeningProvider; +export default ComplianceProvider; diff --git a/packages/lightspark-sdk/src/objects/Connection.ts b/packages/lightspark-sdk/src/objects/Connection.ts index f729554e1..849b24741 100644 --- a/packages/lightspark-sdk/src/objects/Connection.ts +++ b/packages/lightspark-sdk/src/objects/Connection.ts @@ -13,7 +13,6 @@ import { HopFromJson } from "./Hop.js"; import { IncomingPaymentAttemptFromJson } from "./IncomingPaymentAttempt.js"; import type IncomingPaymentToAttemptsConnection from "./IncomingPaymentToAttemptsConnection.js"; import { LightsparkNodeFromJson } from "./LightsparkNode.js"; -import LightsparkNodePurpose from "./LightsparkNodePurpose.js"; import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js"; import { OutgoingPaymentAttemptFromJson } from "./OutgoingPaymentAttempt.js"; import type OutgoingPaymentAttemptToHopsConnection from "./OutgoingPaymentAttemptToHopsConnection.js"; @@ -61,10 +60,6 @@ export const ConnectionFromJson = (obj: any): Connection => { LightsparkNodeFromJson(e), ), typename: "AccountToNodesConnection", - purpose: !!obj["account_to_nodes_connection_purpose"] - ? LightsparkNodePurpose[obj["account_to_nodes_connection_purpose"]] ?? - LightsparkNodePurpose.FUTURE_VALUE - : null, } as AccountToNodesConnection; } if (obj["__typename"] == "AccountToPaymentRequestsConnection") { @@ -227,7 +222,6 @@ fragment ConnectionFragment on Connection { page_info_start_cursor: start_cursor page_info_end_cursor: end_cursor } - account_to_nodes_connection_purpose: purpose account_to_nodes_connection_entities: entities { id } diff --git a/packages/lightspark-sdk/src/objects/CreateInvoiceInput.ts b/packages/lightspark-sdk/src/objects/CreateInvoiceInput.ts index 8b4731f95..75f9825c9 100644 --- a/packages/lightspark-sdk/src/objects/CreateInvoiceInput.ts +++ b/packages/lightspark-sdk/src/objects/CreateInvoiceInput.ts @@ -15,10 +15,6 @@ type CreateInvoiceInput = { /** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/ expirySecs?: number; - - paymentHash?: string; - - preimageNonce?: string; }; export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => { @@ -31,8 +27,6 @@ export const CreateInvoiceInputFromJson = (obj: any): CreateInvoiceInput => { InvoiceType.FUTURE_VALUE : null, expirySecs: obj["create_invoice_input_expiry_secs"], - paymentHash: obj["create_invoice_input_payment_hash"], - preimageNonce: obj["create_invoice_input_preimage_nonce"], } as CreateInvoiceInput; }; diff --git a/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts b/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts index de3e46b5b..25e6183d1 100644 --- a/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts +++ b/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts @@ -15,10 +15,6 @@ type CreateLnurlInvoiceInput = { /** The expiry of the invoice in seconds. Default value is 86400 (1 day). **/ expirySecs?: number; - - paymentHash?: string; - - preimageNonce?: string; }; export const CreateLnurlInvoiceInputFromJson = ( @@ -29,8 +25,6 @@ export const CreateLnurlInvoiceInputFromJson = ( amountMsats: obj["create_lnurl_invoice_input_amount_msats"], metadataHash: obj["create_lnurl_invoice_input_metadata_hash"], expirySecs: obj["create_lnurl_invoice_input_expiry_secs"], - paymentHash: obj["create_lnurl_invoice_input_payment_hash"], - preimageNonce: obj["create_lnurl_invoice_input_preimage_nonce"], } as CreateLnurlInvoiceInput; }; diff --git a/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts b/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts index eada5dd0e..512a8d2b9 100644 --- a/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts +++ b/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts @@ -2,8 +2,15 @@ /** This is an object identifying the output of a test mode payment. This object can be used to retrieve the associated payment made from a Test Mode Payment call. **/ type CreateTestModePaymentoutput = { - /** The payment that has been sent. **/ + /** + * The payment that has been sent. + * + * @deprecated Use incoming_payment instead. + **/ paymentId: string; + + /** The payment that has been received. **/ + incomingPaymentId: string; }; export const CreateTestModePaymentoutputFromJson = ( @@ -11,6 +18,8 @@ export const CreateTestModePaymentoutputFromJson = ( ): CreateTestModePaymentoutput => { return { paymentId: obj["create_test_mode_paymentoutput_payment"].id, + incomingPaymentId: + obj["create_test_mode_paymentoutput_incoming_payment"].id, } as CreateTestModePaymentoutput; }; @@ -20,6 +29,9 @@ fragment CreateTestModePaymentoutputFragment on CreateTestModePaymentoutput { create_test_mode_paymentoutput_payment: payment { id } + create_test_mode_paymentoutput_incoming_payment: incoming_payment { + id + } }`; export default CreateTestModePaymentoutput; diff --git a/packages/lightspark-sdk/src/objects/CreateUmaInvoiceInput.ts b/packages/lightspark-sdk/src/objects/CreateUmaInvoiceInput.ts new file mode 100644 index 000000000..715e41364 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/CreateUmaInvoiceInput.ts @@ -0,0 +1,24 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type CreateUmaInvoiceInput = { + nodeId: string; + + amountMsats: number; + + metadataHash: string; + + expirySecs?: number; +}; + +export const CreateUmaInvoiceInputFromJson = ( + obj: any, +): CreateUmaInvoiceInput => { + return { + nodeId: obj["create_uma_invoice_input_node_id"], + amountMsats: obj["create_uma_invoice_input_amount_msats"], + metadataHash: obj["create_uma_invoice_input_metadata_hash"], + expirySecs: obj["create_uma_invoice_input_expiry_secs"], + } as CreateUmaInvoiceInput; +}; + +export default CreateUmaInvoiceInput; diff --git a/packages/lightspark-sdk/src/objects/DeclineToSignMessagesInput.ts b/packages/lightspark-sdk/src/objects/DeclineToSignMessagesInput.ts new file mode 100644 index 000000000..2cbc5bceb --- /dev/null +++ b/packages/lightspark-sdk/src/objects/DeclineToSignMessagesInput.ts @@ -0,0 +1,16 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type DeclineToSignMessagesInput = { + /** List of payload ids to decline to sign because validation failed. **/ + payloadIds: string[]; +}; + +export const DeclineToSignMessagesInputFromJson = ( + obj: any, +): DeclineToSignMessagesInput => { + return { + payloadIds: obj["decline_to_sign_messages_input_payload_ids"], + } as DeclineToSignMessagesInput; +}; + +export default DeclineToSignMessagesInput; diff --git a/packages/lightspark-sdk/src/objects/DeclineToSignMessagesOutput.ts b/packages/lightspark-sdk/src/objects/DeclineToSignMessagesOutput.ts new file mode 100644 index 000000000..16c135a2a --- /dev/null +++ b/packages/lightspark-sdk/src/objects/DeclineToSignMessagesOutput.ts @@ -0,0 +1,28 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type SignablePayload from "./SignablePayload.js"; +import { SignablePayloadFromJson } from "./SignablePayload.js"; + +type DeclineToSignMessagesOutput = { + declinedPayloads: SignablePayload[]; +}; + +export const DeclineToSignMessagesOutputFromJson = ( + obj: any, +): DeclineToSignMessagesOutput => { + return { + declinedPayloads: obj[ + "decline_to_sign_messages_output_declined_payloads" + ].map((e) => SignablePayloadFromJson(e)), + } as DeclineToSignMessagesOutput; +}; + +export const FRAGMENT = ` +fragment DeclineToSignMessagesOutputFragment on DeclineToSignMessagesOutput { + __typename + decline_to_sign_messages_output_declined_payloads: declined_payloads { + id + } +}`; + +export default DeclineToSignMessagesOutput; diff --git a/packages/lightspark-sdk/src/objects/Entity.ts b/packages/lightspark-sdk/src/objects/Entity.ts index f905fa99a..699f45d2a 100644 --- a/packages/lightspark-sdk/src/objects/Entity.ts +++ b/packages/lightspark-sdk/src/objects/Entity.ts @@ -283,15 +283,24 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } incoming_payment_transaction_hash: transaction_hash - incoming_payment_origin: origin { - id - } incoming_payment_destination: destination { id } incoming_payment_payment_request: payment_request { id } + incoming_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on IncomingPaymentAttempt { __typename @@ -347,24 +356,54 @@ fragment EntityFragment on Entity { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -415,12 +454,29 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -428,7 +484,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -436,7 +492,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -444,8 +500,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -453,7 +508,58 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -467,24 +573,54 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -535,12 +671,29 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -548,7 +701,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -556,7 +709,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -564,8 +717,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -573,7 +725,58 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } ... on OutgoingPayment { __typename @@ -637,24 +840,54 @@ fragment EntityFragment on Entity { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -705,12 +938,29 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -718,7 +968,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -726,7 +976,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -734,8 +984,7 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -743,7 +992,58 @@ fragment EntityFragment on Entity { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -753,6 +1053,18 @@ fragment EntityFragment on Entity { __typename rich_text_text: text } + outgoing_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on OutgoingPaymentAttempt { __typename @@ -819,6 +1131,26 @@ fragment EntityFragment on Entity { } routing_transaction_failure_reason: failure_reason } + ... on Signable { + __typename + signable_id: id + signable_created_at: created_at + signable_updated_at: updated_at + } + ... on SignablePayload { + __typename + signable_payload_id: id + signable_payload_created_at: created_at + signable_payload_updated_at: updated_at + signable_payload_payload: payload + signable_payload_derivation_path: derivation_path + signable_payload_status: status + signable_payload_add_tweak: add_tweak + signable_payload_mul_tweak: mul_tweak + signable_payload_signable: signable { + id + } + } ... on Wallet { __typename wallet_id: id @@ -853,6 +1185,9 @@ fragment EntityFragment on Entity { } } wallet_third_party_identifier: third_party_identifier + wallet_account: account { + id + } wallet_status: status } ... on Withdrawal { diff --git a/packages/lightspark-sdk/src/objects/IdAndSignature.ts b/packages/lightspark-sdk/src/objects/IdAndSignature.ts new file mode 100644 index 000000000..52c238bda --- /dev/null +++ b/packages/lightspark-sdk/src/objects/IdAndSignature.ts @@ -0,0 +1,16 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type IdAndSignature = { + id: string; + + signature: string; +}; + +export const IdAndSignatureFromJson = (obj: any): IdAndSignature => { + return { + id: obj["id_and_signature_id"], + signature: obj["id_and_signature_signature"], + } as IdAndSignature; +}; + +export default IdAndSignature; diff --git a/packages/lightspark-sdk/src/objects/IncomingPayment.ts b/packages/lightspark-sdk/src/objects/IncomingPayment.ts index 5a7d5aba0..cc02049cf 100644 --- a/packages/lightspark-sdk/src/objects/IncomingPayment.ts +++ b/packages/lightspark-sdk/src/objects/IncomingPayment.ts @@ -9,6 +9,8 @@ import type IncomingPaymentAttemptStatus from "./IncomingPaymentAttemptStatus.js import type IncomingPaymentToAttemptsConnection from "./IncomingPaymentToAttemptsConnection.js"; import { IncomingPaymentToAttemptsConnectionFromJson } from "./IncomingPaymentToAttemptsConnection.js"; import type LightningTransaction from "./LightningTransaction.js"; +import type PostTransactionData from "./PostTransactionData.js"; +import { PostTransactionDataFromJson } from "./PostTransactionData.js"; import TransactionStatus from "./TransactionStatus.js"; /** This object represents any payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific payment received by a Lightspark node. **/ @@ -23,8 +25,8 @@ class IncomingPayment implements LightningTransaction { public readonly typename: string, public readonly resolvedAt?: string, public readonly transactionHash?: string, - public readonly originId?: string, public readonly paymentRequestId?: string, + public readonly umaPostTransactionData?: PostTransactionData[], ) { autoBind(this); } @@ -118,8 +120,10 @@ export const IncomingPaymentFromJson = (obj: any): IncomingPayment => { "IncomingPayment", obj["incoming_payment_resolved_at"], obj["incoming_payment_transaction_hash"], - obj["incoming_payment_origin"]?.id ?? undefined, obj["incoming_payment_payment_request"]?.id ?? undefined, + obj["incoming_payment_uma_post_transaction_data"].map((e) => + PostTransactionDataFromJson(e), + ), ); }; @@ -140,15 +144,24 @@ fragment IncomingPaymentFragment on IncomingPayment { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } incoming_payment_transaction_hash: transaction_hash - incoming_payment_origin: origin { - id - } incoming_payment_destination: destination { id } incoming_payment_payment_request: payment_request { id } + incoming_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } }`; export default IncomingPayment; diff --git a/packages/lightspark-sdk/src/objects/Invoice.ts b/packages/lightspark-sdk/src/objects/Invoice.ts index 6dc504359..22e552945 100644 --- a/packages/lightspark-sdk/src/objects/Invoice.ts +++ b/packages/lightspark-sdk/src/objects/Invoice.ts @@ -89,24 +89,54 @@ fragment InvoiceFragment on Invoice { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -157,12 +187,29 @@ fragment InvoiceFragment on Invoice { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -170,7 +217,7 @@ fragment InvoiceFragment on Invoice { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -178,7 +225,7 @@ fragment InvoiceFragment on Invoice { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -186,8 +233,7 @@ fragment InvoiceFragment on Invoice { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -195,7 +241,58 @@ fragment InvoiceFragment on Invoice { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } diff --git a/packages/lightspark-sdk/src/objects/InvoiceData.ts b/packages/lightspark-sdk/src/objects/InvoiceData.ts index 7048f17f1..727551c89 100644 --- a/packages/lightspark-sdk/src/objects/InvoiceData.ts +++ b/packages/lightspark-sdk/src/objects/InvoiceData.ts @@ -85,24 +85,54 @@ fragment InvoiceDataFragment on InvoiceData { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -153,12 +183,29 @@ fragment InvoiceDataFragment on InvoiceData { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -166,7 +213,7 @@ fragment InvoiceDataFragment on InvoiceData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -174,7 +221,7 @@ fragment InvoiceDataFragment on InvoiceData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -182,8 +229,7 @@ fragment InvoiceDataFragment on InvoiceData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -191,7 +237,58 @@ fragment InvoiceDataFragment on InvoiceData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } }`; diff --git a/packages/lightspark-sdk/src/objects/LightningTransaction.ts b/packages/lightspark-sdk/src/objects/LightningTransaction.ts index 166fb36b2..c59cd3509 100644 --- a/packages/lightspark-sdk/src/objects/LightningTransaction.ts +++ b/packages/lightspark-sdk/src/objects/LightningTransaction.ts @@ -8,6 +8,7 @@ import IncomingPayment from "./IncomingPayment.js"; import OutgoingPayment from "./OutgoingPayment.js"; import PaymentFailureReason from "./PaymentFailureReason.js"; import { PaymentRequestDataFromJson } from "./PaymentRequestData.js"; +import { PostTransactionDataFromJson } from "./PostTransactionData.js"; import { RichTextFromJson } from "./RichText.js"; import type RoutingTransaction from "./RoutingTransaction.js"; import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js"; @@ -60,8 +61,10 @@ export const LightningTransactionFromJson = ( "IncomingPayment", obj["incoming_payment_resolved_at"], obj["incoming_payment_transaction_hash"], - obj["incoming_payment_origin"]?.id ?? undefined, obj["incoming_payment_payment_request"]?.id ?? undefined, + obj["incoming_payment_uma_post_transaction_data"].map((e) => + PostTransactionDataFromJson(e), + ), ); } if (obj["__typename"] == "OutgoingPayment") { @@ -92,6 +95,9 @@ export const LightningTransactionFromJson = ( !!obj["outgoing_payment_failure_message"] ? RichTextFromJson(obj["outgoing_payment_failure_message"]) : undefined, + obj["outgoing_payment_uma_post_transaction_data"].map((e) => + PostTransactionDataFromJson(e), + ), ); } if (obj["__typename"] == "RoutingTransaction") { @@ -148,15 +154,24 @@ fragment LightningTransactionFragment on LightningTransaction { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } incoming_payment_transaction_hash: transaction_hash - incoming_payment_origin: origin { - id - } incoming_payment_destination: destination { id } incoming_payment_payment_request: payment_request { id } + incoming_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on OutgoingPayment { __typename @@ -220,24 +235,54 @@ fragment LightningTransactionFragment on LightningTransaction { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -288,12 +333,29 @@ fragment LightningTransactionFragment on LightningTransaction { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -301,7 +363,7 @@ fragment LightningTransactionFragment on LightningTransaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -309,7 +371,7 @@ fragment LightningTransactionFragment on LightningTransaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -317,8 +379,7 @@ fragment LightningTransactionFragment on LightningTransaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -326,7 +387,58 @@ fragment LightningTransactionFragment on LightningTransaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -336,6 +448,18 @@ fragment LightningTransactionFragment on LightningTransaction { __typename rich_text_text: text } + outgoing_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on RoutingTransaction { __typename diff --git a/packages/lightspark-sdk/src/objects/LightsparkNode.ts b/packages/lightspark-sdk/src/objects/LightsparkNode.ts index 40078310d..655f480e1 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNode.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNode.ts @@ -1,6 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -import { type Query } from "@lightsparkdev/core"; +import { LightsparkException, type Query } from "@lightsparkdev/core"; import autoBind from "auto-bind"; import type LightsparkClient from "../client.js"; import BitcoinNetwork from "./BitcoinNetwork.js"; @@ -9,18 +9,18 @@ import { BlockchainBalanceFromJson } from "./BlockchainBalance.js"; import type ChannelStatus from "./ChannelStatus.js"; import type CurrencyAmount from "./CurrencyAmount.js"; import { CurrencyAmountFromJson } from "./CurrencyAmount.js"; -import LightsparkNodePurpose from "./LightsparkNodePurpose.js"; import LightsparkNodeStatus from "./LightsparkNodeStatus.js"; import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js"; import { LightsparkNodeToChannelsConnectionFromJson } from "./LightsparkNodeToChannelsConnection.js"; +import LightsparkNodeWithOSK from "./LightsparkNodeWithOSK.js"; +import LightsparkNodeWithRemoteSigning from "./LightsparkNodeWithRemoteSigning.js"; import type Node from "./Node.js"; import type NodeAddressType from "./NodeAddressType.js"; import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js"; -import type Secret from "./Secret.js"; import { SecretFromJson } from "./Secret.js"; -/** This is a node that is managed by Lightspark and is managed within the current connected account. It contains many details about the node configuration, state, and metadata. **/ +/** This is an object representing a node managed by Lightspark and owned by the current connected account. This object contains information about the node’s configuration, state, and metadata. **/ class LightsparkNode implements Node { constructor( public readonly id: string, @@ -28,21 +28,19 @@ class LightsparkNode implements Node { public readonly updatedAt: string, public readonly bitcoinNetwork: BitcoinNetwork, public readonly displayName: string, - public readonly accountId: string, public readonly ownerId: string, + public readonly umaPrescreeningUtxos: string[], public readonly typename: string, public readonly alias?: string, public readonly color?: string, public readonly conductivity?: number, public readonly publicKey?: string, - public readonly blockchainBalance?: BlockchainBalance, - public readonly encryptedSigningPrivateKey?: Secret, + public readonly status?: LightsparkNodeStatus, public readonly totalBalance?: CurrencyAmount, public readonly totalLocalBalance?: CurrencyAmount, public readonly localBalance?: CurrencyAmount, - public readonly purpose?: LightsparkNodePurpose, public readonly remoteBalance?: CurrencyAmount, - public readonly status?: LightsparkNodeStatus, + public readonly blockchainBalance?: BlockchainBalance, ) { autoBind(this); } @@ -231,70 +229,130 @@ ${FRAGMENT} } export const LightsparkNodeFromJson = (obj: any): LightsparkNode => { - return new LightsparkNode( - obj["lightspark_node_id"], - obj["lightspark_node_created_at"], - obj["lightspark_node_updated_at"], - BitcoinNetwork[obj["lightspark_node_bitcoin_network"]] ?? - BitcoinNetwork.FUTURE_VALUE, - obj["lightspark_node_display_name"], - obj["lightspark_node_account"].id, - obj["lightspark_node_owner"].id, - "LightsparkNode", - obj["lightspark_node_alias"], - obj["lightspark_node_color"], - obj["lightspark_node_conductivity"], - obj["lightspark_node_public_key"], - !!obj["lightspark_node_blockchain_balance"] - ? BlockchainBalanceFromJson(obj["lightspark_node_blockchain_balance"]) - : undefined, - !!obj["lightspark_node_encrypted_signing_private_key"] - ? SecretFromJson(obj["lightspark_node_encrypted_signing_private_key"]) - : undefined, - !!obj["lightspark_node_total_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_total_balance"]) - : undefined, - !!obj["lightspark_node_total_local_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_total_local_balance"]) - : undefined, - !!obj["lightspark_node_local_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_local_balance"]) - : undefined, - !!obj["lightspark_node_purpose"] - ? LightsparkNodePurpose[obj["lightspark_node_purpose"]] ?? - LightsparkNodePurpose.FUTURE_VALUE - : null, - !!obj["lightspark_node_remote_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_remote_balance"]) - : undefined, - !!obj["lightspark_node_status"] - ? LightsparkNodeStatus[obj["lightspark_node_status"]] ?? - LightsparkNodeStatus.FUTURE_VALUE - : null, + if (obj["__typename"] == "LightsparkNodeWithOSK") { + return new LightsparkNodeWithOSK( + obj["lightspark_node_with_o_s_k_id"], + obj["lightspark_node_with_o_s_k_created_at"], + obj["lightspark_node_with_o_s_k_updated_at"], + BitcoinNetwork[obj["lightspark_node_with_o_s_k_bitcoin_network"]] ?? + BitcoinNetwork.FUTURE_VALUE, + obj["lightspark_node_with_o_s_k_display_name"], + obj["lightspark_node_with_o_s_k_owner"].id, + obj["lightspark_node_with_o_s_k_uma_prescreening_utxos"], + "LightsparkNodeWithOSK", + obj["lightspark_node_with_o_s_k_alias"], + obj["lightspark_node_with_o_s_k_color"], + obj["lightspark_node_with_o_s_k_conductivity"], + obj["lightspark_node_with_o_s_k_public_key"], + !!obj["lightspark_node_with_o_s_k_status"] + ? LightsparkNodeStatus[obj["lightspark_node_with_o_s_k_status"]] ?? + LightsparkNodeStatus.FUTURE_VALUE + : null, + !!obj["lightspark_node_with_o_s_k_total_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_total_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_total_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_total_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_remote_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_remote_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_blockchain_balance"] + ? BlockchainBalanceFromJson( + obj["lightspark_node_with_o_s_k_blockchain_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"] + ? SecretFromJson( + obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"], + ) + : undefined, + ); + } + if (obj["__typename"] == "LightsparkNodeWithRemoteSigning") { + return new LightsparkNodeWithRemoteSigning( + obj["lightspark_node_with_remote_signing_id"], + obj["lightspark_node_with_remote_signing_created_at"], + obj["lightspark_node_with_remote_signing_updated_at"], + BitcoinNetwork[ + obj["lightspark_node_with_remote_signing_bitcoin_network"] + ] ?? BitcoinNetwork.FUTURE_VALUE, + obj["lightspark_node_with_remote_signing_display_name"], + obj["lightspark_node_with_remote_signing_owner"].id, + obj["lightspark_node_with_remote_signing_uma_prescreening_utxos"], + "LightsparkNodeWithRemoteSigning", + obj["lightspark_node_with_remote_signing_alias"], + obj["lightspark_node_with_remote_signing_color"], + obj["lightspark_node_with_remote_signing_conductivity"], + obj["lightspark_node_with_remote_signing_public_key"], + !!obj["lightspark_node_with_remote_signing_status"] + ? LightsparkNodeStatus[ + obj["lightspark_node_with_remote_signing_status"] + ] ?? LightsparkNodeStatus.FUTURE_VALUE + : null, + !!obj["lightspark_node_with_remote_signing_total_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_total_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_total_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_total_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_remote_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_remote_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_blockchain_balance"] + ? BlockchainBalanceFromJson( + obj["lightspark_node_with_remote_signing_blockchain_balance"], + ) + : undefined, + ); + } + throw new LightsparkException( + "DeserializationError", + `Couldn't find a concrete type for interface LightsparkNode corresponding to the typename=${obj["__typename"]}`, ); }; export const FRAGMENT = ` fragment LightsparkNodeFragment on LightsparkNode { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { - id - } - lightspark_node_owner: owner { - id - } - lightspark_node_blockchain_balance: blockchain_balance { + ... on LightsparkNodeWithOSK { __typename - blockchain_balance_total_balance: total_balance { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { + id + } + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -302,7 +360,7 @@ fragment LightsparkNodeFragment on LightsparkNode { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_confirmed_balance: confirmed_balance { + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -310,7 +368,7 @@ fragment LightsparkNodeFragment on LightsparkNode { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_unconfirmed_balance: unconfirmed_balance { + lightspark_node_with_o_s_k_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -318,7 +376,7 @@ fragment LightsparkNodeFragment on LightsparkNode { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_locked_balance: locked_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -326,7 +384,80 @@ fragment LightsparkNodeFragment on LightsparkNode { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_required_reserve: required_reserve { + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { + __typename + secret_encrypted_value: encrypted_value + secret_cipher: cipher + } + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -334,7 +465,7 @@ fragment LightsparkNodeFragment on LightsparkNode { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - blockchain_balance_available_balance: available_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -342,46 +473,75 @@ fragment LightsparkNodeFragment on LightsparkNode { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } + lightspark_node_with_remote_signing_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { - __typename - secret_encrypted_value: encrypted_value - secret_cipher: cipher - } - lightspark_node_total_balance: total_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_total_local_balance: total_local_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_local_balance: local_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { - __typename - currency_amount_original_value: original_value - currency_amount_original_unit: original_unit - currency_amount_preferred_currency_unit: preferred_currency_unit - currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded - currency_amount_preferred_currency_value_approx: preferred_currency_value_approx - } - lightspark_node_status: status }`; export default LightsparkNode; diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts index 3ac293584..0594f07ac 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts @@ -47,6 +47,7 @@ export const LightsparkNodeOwnerFromJson = (obj: any): LightsparkNodeOwner => { !!obj["wallet_balances"] ? BalancesFromJson(obj["wallet_balances"]) : undefined, + obj["wallet_account"]?.id ?? undefined, ); } throw new LightsparkException( @@ -99,6 +100,9 @@ fragment LightsparkNodeOwnerFragment on LightsparkNodeOwner { } } wallet_third_party_identifier: third_party_identifier + wallet_account: account { + id + } wallet_status: status } }`; diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts new file mode 100644 index 000000000..92dcdfe6c --- /dev/null +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts @@ -0,0 +1,389 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from "@lightsparkdev/core"; +import autoBind from "auto-bind"; +import type LightsparkClient from "../client.js"; +import BitcoinNetwork from "./BitcoinNetwork.js"; +import type BlockchainBalance from "./BlockchainBalance.js"; +import { BlockchainBalanceFromJson } from "./BlockchainBalance.js"; +import type ChannelStatus from "./ChannelStatus.js"; +import type CurrencyAmount from "./CurrencyAmount.js"; +import { CurrencyAmountFromJson } from "./CurrencyAmount.js"; +import type LightsparkNode from "./LightsparkNode.js"; +import LightsparkNodeStatus from "./LightsparkNodeStatus.js"; +import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js"; +import { LightsparkNodeToChannelsConnectionFromJson } from "./LightsparkNodeToChannelsConnection.js"; +import type NodeAddressType from "./NodeAddressType.js"; +import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; +import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js"; +import type Secret from "./Secret.js"; +import { SecretFromJson } from "./Secret.js"; + +/** This is a Lightspark node with OSK. **/ +class LightsparkNodeWithOSK implements LightsparkNode { + constructor( + public readonly id: string, + public readonly createdAt: string, + public readonly updatedAt: string, + public readonly bitcoinNetwork: BitcoinNetwork, + public readonly displayName: string, + public readonly ownerId: string, + public readonly umaPrescreeningUtxos: string[], + public readonly typename: string, + public readonly alias?: string, + public readonly color?: string, + public readonly conductivity?: number, + public readonly publicKey?: string, + public readonly status?: LightsparkNodeStatus, + public readonly totalBalance?: CurrencyAmount, + public readonly totalLocalBalance?: CurrencyAmount, + public readonly localBalance?: CurrencyAmount, + public readonly remoteBalance?: CurrencyAmount, + public readonly blockchainBalance?: BlockchainBalance, + public readonly encryptedSigningPrivateKey?: Secret, + ) { + autoBind(this); + } + + public async getAddresses( + client: LightsparkClient, + first: number | undefined = undefined, + types: NodeAddressType[] | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) { + entity(id: $entity_id) { + ... on LightsparkNodeWithOSK { + addresses(, first: $first, types: $types) { + __typename + node_to_addresses_connection_count: count + node_to_addresses_connection_entities: entities { + __typename + node_address_address: address + node_address_type: type + } + } + } + } +} +`, + variables: { entity_id: this.id, first: first, types: types }, + constructObject: (json) => { + const connection = json["entity"]["addresses"]; + return NodeToAddressesConnectionFromJson(connection); + }, + }))!; + } + + public async getChannels( + client: LightsparkClient, + first: number | undefined = undefined, + statuses: ChannelStatus[] | undefined = undefined, + after: string | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $statuses: [ChannelStatus!], $after: String) { + entity(id: $entity_id) { + ... on LightsparkNodeWithOSK { + channels(, first: $first, statuses: $statuses, after: $after) { + __typename + lightspark_node_to_channels_connection_count: count + lightspark_node_to_channels_connection_page_info: page_info { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + lightspark_node_to_channels_connection_entities: entities { + __typename + channel_id: id + channel_created_at: created_at + channel_updated_at: updated_at + channel_funding_transaction: funding_transaction { + id + } + channel_capacity: capacity { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_local_unsettled_balance: local_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_remote_unsettled_balance: remote_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_unsettled_balance: unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_status: status + channel_estimated_force_closure_wait_minutes: estimated_force_closure_wait_minutes + channel_commit_fee: commit_fee { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_fees: fees { + __typename + channel_fees_base_fee: base_fee { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_fees_fee_rate_per_mil: fee_rate_per_mil + } + channel_remote_node: remote_node { + id + } + channel_local_node: local_node { + id + } + channel_short_channel_id: short_channel_id + } + } + } + } +} +`, + variables: { + entity_id: this.id, + first: first, + statuses: statuses, + after: after, + }, + constructObject: (json) => { + const connection = json["entity"]["channels"]; + return LightsparkNodeToChannelsConnectionFromJson(connection); + }, + }))!; + } + + static getLightsparkNodeWithOSKQuery( + id: string, + ): Query { + return { + queryPayload: ` +query GetLightsparkNodeWithOSK($id: ID!) { + entity(id: $id) { + ... on LightsparkNodeWithOSK { + ...LightsparkNodeWithOSKFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => + LightsparkNodeWithOSKFromJson(data.entity), + }; + } +} + +export const LightsparkNodeWithOSKFromJson = ( + obj: any, +): LightsparkNodeWithOSK => { + return new LightsparkNodeWithOSK( + obj["lightspark_node_with_o_s_k_id"], + obj["lightspark_node_with_o_s_k_created_at"], + obj["lightspark_node_with_o_s_k_updated_at"], + BitcoinNetwork[obj["lightspark_node_with_o_s_k_bitcoin_network"]] ?? + BitcoinNetwork.FUTURE_VALUE, + obj["lightspark_node_with_o_s_k_display_name"], + obj["lightspark_node_with_o_s_k_owner"].id, + obj["lightspark_node_with_o_s_k_uma_prescreening_utxos"], + "LightsparkNodeWithOSK", + obj["lightspark_node_with_o_s_k_alias"], + obj["lightspark_node_with_o_s_k_color"], + obj["lightspark_node_with_o_s_k_conductivity"], + obj["lightspark_node_with_o_s_k_public_key"], + !!obj["lightspark_node_with_o_s_k_status"] + ? LightsparkNodeStatus[obj["lightspark_node_with_o_s_k_status"]] ?? + LightsparkNodeStatus.FUTURE_VALUE + : null, + !!obj["lightspark_node_with_o_s_k_total_balance"] + ? CurrencyAmountFromJson(obj["lightspark_node_with_o_s_k_total_balance"]) + : undefined, + !!obj["lightspark_node_with_o_s_k_total_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_total_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_local_balance"] + ? CurrencyAmountFromJson(obj["lightspark_node_with_o_s_k_local_balance"]) + : undefined, + !!obj["lightspark_node_with_o_s_k_remote_balance"] + ? CurrencyAmountFromJson(obj["lightspark_node_with_o_s_k_remote_balance"]) + : undefined, + !!obj["lightspark_node_with_o_s_k_blockchain_balance"] + ? BlockchainBalanceFromJson( + obj["lightspark_node_with_o_s_k_blockchain_balance"], + ) + : undefined, + !!obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"] + ? SecretFromJson( + obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"], + ) + : undefined, + ); +}; + +export const FRAGMENT = ` +fragment LightsparkNodeWithOSKFragment on LightsparkNodeWithOSK { + __typename + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { + id + } + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { + __typename + secret_encrypted_value: encrypted_value + secret_cipher: cipher + } +}`; + +export default LightsparkNodeWithOSK; diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts new file mode 100644 index 000000000..f41c1e196 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts @@ -0,0 +1,384 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from "@lightsparkdev/core"; +import autoBind from "auto-bind"; +import type LightsparkClient from "../client.js"; +import BitcoinNetwork from "./BitcoinNetwork.js"; +import type BlockchainBalance from "./BlockchainBalance.js"; +import { BlockchainBalanceFromJson } from "./BlockchainBalance.js"; +import type ChannelStatus from "./ChannelStatus.js"; +import type CurrencyAmount from "./CurrencyAmount.js"; +import { CurrencyAmountFromJson } from "./CurrencyAmount.js"; +import type LightsparkNode from "./LightsparkNode.js"; +import LightsparkNodeStatus from "./LightsparkNodeStatus.js"; +import type LightsparkNodeToChannelsConnection from "./LightsparkNodeToChannelsConnection.js"; +import { LightsparkNodeToChannelsConnectionFromJson } from "./LightsparkNodeToChannelsConnection.js"; +import type NodeAddressType from "./NodeAddressType.js"; +import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; +import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js"; + +/** This is a Lightspark node with remote signing. **/ +class LightsparkNodeWithRemoteSigning implements LightsparkNode { + constructor( + public readonly id: string, + public readonly createdAt: string, + public readonly updatedAt: string, + public readonly bitcoinNetwork: BitcoinNetwork, + public readonly displayName: string, + public readonly ownerId: string, + public readonly umaPrescreeningUtxos: string[], + public readonly typename: string, + public readonly alias?: string, + public readonly color?: string, + public readonly conductivity?: number, + public readonly publicKey?: string, + public readonly status?: LightsparkNodeStatus, + public readonly totalBalance?: CurrencyAmount, + public readonly totalLocalBalance?: CurrencyAmount, + public readonly localBalance?: CurrencyAmount, + public readonly remoteBalance?: CurrencyAmount, + public readonly blockchainBalance?: BlockchainBalance, + ) { + autoBind(this); + } + + public async getAddresses( + client: LightsparkClient, + first: number | undefined = undefined, + types: NodeAddressType[] | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchNodeToAddressesConnection($entity_id: ID!, $first: Int, $types: [NodeAddressType!]) { + entity(id: $entity_id) { + ... on LightsparkNodeWithRemoteSigning { + addresses(, first: $first, types: $types) { + __typename + node_to_addresses_connection_count: count + node_to_addresses_connection_entities: entities { + __typename + node_address_address: address + node_address_type: type + } + } + } + } +} +`, + variables: { entity_id: this.id, first: first, types: types }, + constructObject: (json) => { + const connection = json["entity"]["addresses"]; + return NodeToAddressesConnectionFromJson(connection); + }, + }))!; + } + + public async getChannels( + client: LightsparkClient, + first: number | undefined = undefined, + statuses: ChannelStatus[] | undefined = undefined, + after: string | undefined = undefined, + ): Promise { + return (await client.executeRawQuery({ + queryPayload: ` +query FetchLightsparkNodeToChannelsConnection($entity_id: ID!, $first: Int, $statuses: [ChannelStatus!], $after: String) { + entity(id: $entity_id) { + ... on LightsparkNodeWithRemoteSigning { + channels(, first: $first, statuses: $statuses, after: $after) { + __typename + lightspark_node_to_channels_connection_count: count + lightspark_node_to_channels_connection_page_info: page_info { + __typename + page_info_has_next_page: has_next_page + page_info_has_previous_page: has_previous_page + page_info_start_cursor: start_cursor + page_info_end_cursor: end_cursor + } + lightspark_node_to_channels_connection_entities: entities { + __typename + channel_id: id + channel_created_at: created_at + channel_updated_at: updated_at + channel_funding_transaction: funding_transaction { + id + } + channel_capacity: capacity { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_local_unsettled_balance: local_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_remote_unsettled_balance: remote_unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_unsettled_balance: unsettled_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_status: status + channel_estimated_force_closure_wait_minutes: estimated_force_closure_wait_minutes + channel_commit_fee: commit_fee { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_fees: fees { + __typename + channel_fees_base_fee: base_fee { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + channel_fees_fee_rate_per_mil: fee_rate_per_mil + } + channel_remote_node: remote_node { + id + } + channel_local_node: local_node { + id + } + channel_short_channel_id: short_channel_id + } + } + } + } +} +`, + variables: { + entity_id: this.id, + first: first, + statuses: statuses, + after: after, + }, + constructObject: (json) => { + const connection = json["entity"]["channels"]; + return LightsparkNodeToChannelsConnectionFromJson(connection); + }, + }))!; + } + + static getLightsparkNodeWithRemoteSigningQuery( + id: string, + ): Query { + return { + queryPayload: ` +query GetLightsparkNodeWithRemoteSigning($id: ID!) { + entity(id: $id) { + ... on LightsparkNodeWithRemoteSigning { + ...LightsparkNodeWithRemoteSigningFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => + LightsparkNodeWithRemoteSigningFromJson(data.entity), + }; + } +} + +export const LightsparkNodeWithRemoteSigningFromJson = ( + obj: any, +): LightsparkNodeWithRemoteSigning => { + return new LightsparkNodeWithRemoteSigning( + obj["lightspark_node_with_remote_signing_id"], + obj["lightspark_node_with_remote_signing_created_at"], + obj["lightspark_node_with_remote_signing_updated_at"], + BitcoinNetwork[ + obj["lightspark_node_with_remote_signing_bitcoin_network"] + ] ?? BitcoinNetwork.FUTURE_VALUE, + obj["lightspark_node_with_remote_signing_display_name"], + obj["lightspark_node_with_remote_signing_owner"].id, + obj["lightspark_node_with_remote_signing_uma_prescreening_utxos"], + "LightsparkNodeWithRemoteSigning", + obj["lightspark_node_with_remote_signing_alias"], + obj["lightspark_node_with_remote_signing_color"], + obj["lightspark_node_with_remote_signing_conductivity"], + obj["lightspark_node_with_remote_signing_public_key"], + !!obj["lightspark_node_with_remote_signing_status"] + ? LightsparkNodeStatus[ + obj["lightspark_node_with_remote_signing_status"] + ] ?? LightsparkNodeStatus.FUTURE_VALUE + : null, + !!obj["lightspark_node_with_remote_signing_total_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_total_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_total_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_total_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_remote_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_remote_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_blockchain_balance"] + ? BlockchainBalanceFromJson( + obj["lightspark_node_with_remote_signing_blockchain_balance"], + ) + : undefined, + ); +}; + +export const FRAGMENT = ` +fragment LightsparkNodeWithRemoteSigningFragment on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos +}`; + +export default LightsparkNodeWithRemoteSigning; diff --git a/packages/lightspark-sdk/src/objects/Node.ts b/packages/lightspark-sdk/src/objects/Node.ts index 7d028e3e3..ef612ad6b 100644 --- a/packages/lightspark-sdk/src/objects/Node.ts +++ b/packages/lightspark-sdk/src/objects/Node.ts @@ -8,9 +8,9 @@ import { BlockchainBalanceFromJson } from "./BlockchainBalance.js"; import { CurrencyAmountFromJson } from "./CurrencyAmount.js"; import type Entity from "./Entity.js"; import GraphNode from "./GraphNode.js"; -import LightsparkNode from "./LightsparkNode.js"; -import LightsparkNodePurpose from "./LightsparkNodePurpose.js"; import LightsparkNodeStatus from "./LightsparkNodeStatus.js"; +import LightsparkNodeWithOSK from "./LightsparkNodeWithOSK.js"; +import LightsparkNodeWithRemoteSigning from "./LightsparkNodeWithRemoteSigning.js"; import type NodeAddressType from "./NodeAddressType.js"; import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js"; @@ -99,47 +99,103 @@ export const NodeFromJson = (obj: any): Node => { obj["graph_node_public_key"], ); } - if (obj["__typename"] == "LightsparkNode") { - return new LightsparkNode( - obj["lightspark_node_id"], - obj["lightspark_node_created_at"], - obj["lightspark_node_updated_at"], - BitcoinNetwork[obj["lightspark_node_bitcoin_network"]] ?? + if (obj["__typename"] == "LightsparkNodeWithOSK") { + return new LightsparkNodeWithOSK( + obj["lightspark_node_with_o_s_k_id"], + obj["lightspark_node_with_o_s_k_created_at"], + obj["lightspark_node_with_o_s_k_updated_at"], + BitcoinNetwork[obj["lightspark_node_with_o_s_k_bitcoin_network"]] ?? BitcoinNetwork.FUTURE_VALUE, - obj["lightspark_node_display_name"], - obj["lightspark_node_account"].id, - obj["lightspark_node_owner"].id, - "LightsparkNode", - obj["lightspark_node_alias"], - obj["lightspark_node_color"], - obj["lightspark_node_conductivity"], - obj["lightspark_node_public_key"], - !!obj["lightspark_node_blockchain_balance"] - ? BlockchainBalanceFromJson(obj["lightspark_node_blockchain_balance"]) + obj["lightspark_node_with_o_s_k_display_name"], + obj["lightspark_node_with_o_s_k_owner"].id, + obj["lightspark_node_with_o_s_k_uma_prescreening_utxos"], + "LightsparkNodeWithOSK", + obj["lightspark_node_with_o_s_k_alias"], + obj["lightspark_node_with_o_s_k_color"], + obj["lightspark_node_with_o_s_k_conductivity"], + obj["lightspark_node_with_o_s_k_public_key"], + !!obj["lightspark_node_with_o_s_k_status"] + ? LightsparkNodeStatus[obj["lightspark_node_with_o_s_k_status"]] ?? + LightsparkNodeStatus.FUTURE_VALUE + : null, + !!obj["lightspark_node_with_o_s_k_total_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_total_balance"], + ) : undefined, - !!obj["lightspark_node_encrypted_signing_private_key"] - ? SecretFromJson(obj["lightspark_node_encrypted_signing_private_key"]) + !!obj["lightspark_node_with_o_s_k_total_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_total_local_balance"], + ) : undefined, - !!obj["lightspark_node_total_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_total_balance"]) + !!obj["lightspark_node_with_o_s_k_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_local_balance"], + ) : undefined, - !!obj["lightspark_node_total_local_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_total_local_balance"]) + !!obj["lightspark_node_with_o_s_k_remote_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_o_s_k_remote_balance"], + ) : undefined, - !!obj["lightspark_node_local_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_local_balance"]) + !!obj["lightspark_node_with_o_s_k_blockchain_balance"] + ? BlockchainBalanceFromJson( + obj["lightspark_node_with_o_s_k_blockchain_balance"], + ) : undefined, - !!obj["lightspark_node_purpose"] - ? LightsparkNodePurpose[obj["lightspark_node_purpose"]] ?? - LightsparkNodePurpose.FUTURE_VALUE - : null, - !!obj["lightspark_node_remote_balance"] - ? CurrencyAmountFromJson(obj["lightspark_node_remote_balance"]) + !!obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"] + ? SecretFromJson( + obj["lightspark_node_with_o_s_k_encrypted_signing_private_key"], + ) : undefined, - !!obj["lightspark_node_status"] - ? LightsparkNodeStatus[obj["lightspark_node_status"]] ?? - LightsparkNodeStatus.FUTURE_VALUE + ); + } + if (obj["__typename"] == "LightsparkNodeWithRemoteSigning") { + return new LightsparkNodeWithRemoteSigning( + obj["lightspark_node_with_remote_signing_id"], + obj["lightspark_node_with_remote_signing_created_at"], + obj["lightspark_node_with_remote_signing_updated_at"], + BitcoinNetwork[ + obj["lightspark_node_with_remote_signing_bitcoin_network"] + ] ?? BitcoinNetwork.FUTURE_VALUE, + obj["lightspark_node_with_remote_signing_display_name"], + obj["lightspark_node_with_remote_signing_owner"].id, + obj["lightspark_node_with_remote_signing_uma_prescreening_utxos"], + "LightsparkNodeWithRemoteSigning", + obj["lightspark_node_with_remote_signing_alias"], + obj["lightspark_node_with_remote_signing_color"], + obj["lightspark_node_with_remote_signing_conductivity"], + obj["lightspark_node_with_remote_signing_public_key"], + !!obj["lightspark_node_with_remote_signing_status"] + ? LightsparkNodeStatus[ + obj["lightspark_node_with_remote_signing_status"] + ] ?? LightsparkNodeStatus.FUTURE_VALUE : null, + !!obj["lightspark_node_with_remote_signing_total_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_total_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_total_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_total_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_local_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_local_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_remote_balance"] + ? CurrencyAmountFromJson( + obj["lightspark_node_with_remote_signing_remote_balance"], + ) + : undefined, + !!obj["lightspark_node_with_remote_signing_blockchain_balance"] + ? BlockchainBalanceFromJson( + obj["lightspark_node_with_remote_signing_blockchain_balance"], + ) + : undefined, ); } throw new LightsparkException( @@ -163,24 +219,54 @@ fragment NodeFragment on Node { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -231,12 +317,29 @@ fragment NodeFragment on Node { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -244,7 +347,7 @@ fragment NodeFragment on Node { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -252,7 +355,7 @@ fragment NodeFragment on Node { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -260,8 +363,7 @@ fragment NodeFragment on Node { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -269,7 +371,58 @@ fragment NodeFragment on Node { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } }`; diff --git a/packages/lightspark-sdk/src/objects/OutgoingPayment.ts b/packages/lightspark-sdk/src/objects/OutgoingPayment.ts index 23b96aff9..23c2255a8 100644 --- a/packages/lightspark-sdk/src/objects/OutgoingPayment.ts +++ b/packages/lightspark-sdk/src/objects/OutgoingPayment.ts @@ -11,6 +11,8 @@ import { OutgoingPaymentToAttemptsConnectionFromJson } from "./OutgoingPaymentTo import PaymentFailureReason from "./PaymentFailureReason.js"; import type PaymentRequestData from "./PaymentRequestData.js"; import { PaymentRequestDataFromJson } from "./PaymentRequestData.js"; +import type PostTransactionData from "./PostTransactionData.js"; +import { PostTransactionDataFromJson } from "./PostTransactionData.js"; import type RichText from "./RichText.js"; import { RichTextFromJson } from "./RichText.js"; import TransactionStatus from "./TransactionStatus.js"; @@ -32,6 +34,7 @@ class OutgoingPayment implements LightningTransaction { public readonly paymentRequestData?: PaymentRequestData, public readonly failureReason?: PaymentFailureReason, public readonly failureMessage?: RichText, + public readonly umaPostTransactionData?: PostTransactionData[], ) { autoBind(this); } @@ -143,6 +146,9 @@ 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) => + PostTransactionDataFromJson(e), + ), ); }; @@ -209,24 +215,54 @@ fragment OutgoingPaymentFragment on OutgoingPayment { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -277,12 +313,29 @@ fragment OutgoingPaymentFragment on OutgoingPayment { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -290,7 +343,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -298,7 +351,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -306,8 +359,7 @@ fragment OutgoingPaymentFragment on OutgoingPayment { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -315,7 +367,58 @@ fragment OutgoingPaymentFragment on OutgoingPayment { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -325,6 +428,18 @@ fragment OutgoingPaymentFragment on OutgoingPayment { __typename rich_text_text: text } + outgoing_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } }`; export default OutgoingPayment; diff --git a/packages/lightspark-sdk/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts b/packages/lightspark-sdk/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts new file mode 100644 index 000000000..1b393aaf9 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/OutgoingPaymentsForInvoiceQueryInput.ts @@ -0,0 +1,25 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import TransactionStatus from "./TransactionStatus.js"; + +type OutgoingPaymentsForInvoiceQueryInput = { + /** The encoded invoice that the outgoing payments paid to. **/ + encodedInvoice: string; + + /** An optional filter to only query outgoing payments of given statuses. **/ + statuses?: TransactionStatus[]; +}; + +export const OutgoingPaymentsForInvoiceQueryInputFromJson = ( + obj: any, +): OutgoingPaymentsForInvoiceQueryInput => { + return { + encodedInvoice: + obj["outgoing_payments_for_invoice_query_input_encoded_invoice"], + statuses: obj["outgoing_payments_for_invoice_query_input_statuses"]?.map( + (e) => TransactionStatus[e], + ), + } as OutgoingPaymentsForInvoiceQueryInput; +}; + +export default OutgoingPaymentsForInvoiceQueryInput; diff --git a/packages/lightspark-sdk/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts b/packages/lightspark-sdk/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts new file mode 100644 index 000000000..91e39a8f8 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/OutgoingPaymentsForInvoiceQueryOutput.ts @@ -0,0 +1,28 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type OutgoingPayment from "./OutgoingPayment.js"; +import { OutgoingPaymentFromJson } from "./OutgoingPayment.js"; + +type OutgoingPaymentsForInvoiceQueryOutput = { + payments: OutgoingPayment[]; +}; + +export const OutgoingPaymentsForInvoiceQueryOutputFromJson = ( + obj: any, +): OutgoingPaymentsForInvoiceQueryOutput => { + return { + payments: obj["outgoing_payments_for_invoice_query_output_payments"].map( + (e) => OutgoingPaymentFromJson(e), + ), + } as OutgoingPaymentsForInvoiceQueryOutput; +}; + +export const FRAGMENT = ` +fragment OutgoingPaymentsForInvoiceQueryOutputFragment on OutgoingPaymentsForInvoiceQueryOutput { + __typename + outgoing_payments_for_invoice_query_output_payments: payments { + id + } +}`; + +export default OutgoingPaymentsForInvoiceQueryOutput; diff --git a/packages/lightspark-sdk/src/objects/PayUmaInvoiceInput.ts b/packages/lightspark-sdk/src/objects/PayUmaInvoiceInput.ts new file mode 100644 index 000000000..b074f9ce6 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/PayUmaInvoiceInput.ts @@ -0,0 +1,25 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type PayUmaInvoiceInput = { + nodeId: string; + + encodedInvoice: string; + + timeoutSecs: number; + + maximumFeesMsats: number; + + amountMsats?: number; +}; + +export const PayUmaInvoiceInputFromJson = (obj: any): PayUmaInvoiceInput => { + return { + nodeId: obj["pay_uma_invoice_input_node_id"], + encodedInvoice: obj["pay_uma_invoice_input_encoded_invoice"], + timeoutSecs: obj["pay_uma_invoice_input_timeout_secs"], + maximumFeesMsats: obj["pay_uma_invoice_input_maximum_fees_msats"], + amountMsats: obj["pay_uma_invoice_input_amount_msats"], + } as PayUmaInvoiceInput; +}; + +export default PayUmaInvoiceInput; diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodePurpose.ts b/packages/lightspark-sdk/src/objects/PaymentDirection.ts similarity index 57% rename from packages/lightspark-sdk/src/objects/LightsparkNodePurpose.ts rename to packages/lightspark-sdk/src/objects/PaymentDirection.ts index cb7934241..50aa9e706 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodePurpose.ts +++ b/packages/lightspark-sdk/src/objects/PaymentDirection.ts @@ -1,18 +1,16 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of potential purposes set by a user for a Lightspark node. **/ -export enum LightsparkNodePurpose { +/** This is an enum indicating the direction of the payment. **/ +export enum PaymentDirection { /** * This is an enum value that represents values that could be added in the future. * Clients should support unknown values as more of them could be added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", - SEND = "SEND", + SENT = "SENT", - RECEIVE = "RECEIVE", - - ROUTING = "ROUTING", + RECEIVED = "RECEIVED", } -export default LightsparkNodePurpose; +export default PaymentDirection; diff --git a/packages/lightspark-sdk/src/objects/PaymentRequest.ts b/packages/lightspark-sdk/src/objects/PaymentRequest.ts index c3e63d972..3e32d5d9b 100644 --- a/packages/lightspark-sdk/src/objects/PaymentRequest.ts +++ b/packages/lightspark-sdk/src/objects/PaymentRequest.ts @@ -92,24 +92,54 @@ fragment PaymentRequestFragment on PaymentRequest { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -160,12 +190,29 @@ fragment PaymentRequestFragment on PaymentRequest { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -173,7 +220,7 @@ fragment PaymentRequestFragment on PaymentRequest { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -181,7 +228,7 @@ fragment PaymentRequestFragment on PaymentRequest { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -189,8 +236,7 @@ fragment PaymentRequestFragment on PaymentRequest { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -198,7 +244,58 @@ fragment PaymentRequestFragment on PaymentRequest { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } diff --git a/packages/lightspark-sdk/src/objects/PaymentRequestData.ts b/packages/lightspark-sdk/src/objects/PaymentRequestData.ts index 2cded3186..5127c4290 100644 --- a/packages/lightspark-sdk/src/objects/PaymentRequestData.ts +++ b/packages/lightspark-sdk/src/objects/PaymentRequestData.ts @@ -71,24 +71,54 @@ fragment PaymentRequestDataFragment on PaymentRequestData { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -139,12 +169,29 @@ fragment PaymentRequestDataFragment on PaymentRequestData { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -152,7 +199,7 @@ fragment PaymentRequestDataFragment on PaymentRequestData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -160,7 +207,7 @@ fragment PaymentRequestDataFragment on PaymentRequestData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -168,8 +215,7 @@ fragment PaymentRequestDataFragment on PaymentRequestData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -177,7 +223,58 @@ fragment PaymentRequestDataFragment on PaymentRequestData { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } diff --git a/packages/lightspark-sdk/src/objects/PostTransactionData.ts b/packages/lightspark-sdk/src/objects/PostTransactionData.ts new file mode 100644 index 000000000..7ba8a4948 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/PostTransactionData.ts @@ -0,0 +1,39 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type CurrencyAmount from "./CurrencyAmount.js"; +import { CurrencyAmountFromJson } from "./CurrencyAmount.js"; + +/** This object represents post-transaction data that could be used to register payment for KYT. **/ +type PostTransactionData = { + /** + * The utxo of the channel over which the payment went through in the format of + * :. + **/ + utxo: string; + + /** The amount of funds transferred in the payment. **/ + amount: CurrencyAmount; +}; + +export const PostTransactionDataFromJson = (obj: any): PostTransactionData => { + return { + utxo: obj["post_transaction_data_utxo"], + amount: CurrencyAmountFromJson(obj["post_transaction_data_amount"]), + } as PostTransactionData; +}; + +export const FRAGMENT = ` +fragment PostTransactionDataFragment on PostTransactionData { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } +}`; + +export default PostTransactionData; diff --git a/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts b/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts new file mode 100644 index 000000000..0b0a99229 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts @@ -0,0 +1,31 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import ComplianceProvider from "./ComplianceProvider.js"; +import PaymentDirection from "./PaymentDirection.js"; + +type RegisterPaymentInput = { + provider: ComplianceProvider; + + paymentId: string; + + nodePubkey: string; + + direction: PaymentDirection; +}; + +export const RegisterPaymentInputFromJson = ( + obj: any, +): RegisterPaymentInput => { + return { + provider: + ComplianceProvider[obj["register_payment_input_provider"]] ?? + ComplianceProvider.FUTURE_VALUE, + paymentId: obj["register_payment_input_payment_id"], + nodePubkey: obj["register_payment_input_node_pubkey"], + direction: + PaymentDirection[obj["register_payment_input_direction"]] ?? + PaymentDirection.FUTURE_VALUE, + } as RegisterPaymentInput; +}; + +export default RegisterPaymentInput; diff --git a/packages/lightspark-sdk/src/objects/RegisterPaymentOutput.ts b/packages/lightspark-sdk/src/objects/RegisterPaymentOutput.ts new file mode 100644 index 000000000..87907a46b --- /dev/null +++ b/packages/lightspark-sdk/src/objects/RegisterPaymentOutput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type RegisterPaymentOutput = { + paymentId: string; +}; + +export const RegisterPaymentOutputFromJson = ( + obj: any, +): RegisterPaymentOutput => { + return { + paymentId: obj["register_payment_output_payment"].id, + } as RegisterPaymentOutput; +}; + +export const FRAGMENT = ` +fragment RegisterPaymentOutputFragment on RegisterPaymentOutput { + __typename + register_payment_output_payment: payment { + id + } +}`; + +export default RegisterPaymentOutput; diff --git a/packages/lightspark-sdk/src/objects/ReleaseChannelPerCommitmentSecretInput.ts b/packages/lightspark-sdk/src/objects/ReleaseChannelPerCommitmentSecretInput.ts new file mode 100644 index 000000000..6eaa1e59d --- /dev/null +++ b/packages/lightspark-sdk/src/objects/ReleaseChannelPerCommitmentSecretInput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type ReleaseChannelPerCommitmentSecretInput = { + channelId: string; + + perCommitmentSecret: string; + + perCommitmentIndex: number; +}; + +export const ReleaseChannelPerCommitmentSecretInputFromJson = ( + obj: any, +): ReleaseChannelPerCommitmentSecretInput => { + return { + channelId: obj["release_channel_per_commitment_secret_input_channel_id"], + perCommitmentSecret: + obj["release_channel_per_commitment_secret_input_per_commitment_secret"], + perCommitmentIndex: + obj["release_channel_per_commitment_secret_input_per_commitment_index"], + } as ReleaseChannelPerCommitmentSecretInput; +}; + +export default ReleaseChannelPerCommitmentSecretInput; diff --git a/packages/lightspark-sdk/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts b/packages/lightspark-sdk/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts new file mode 100644 index 000000000..b1de2b77e --- /dev/null +++ b/packages/lightspark-sdk/src/objects/ReleaseChannelPerCommitmentSecretOutput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type ReleaseChannelPerCommitmentSecretOutput = { + channelId: string; +}; + +export const ReleaseChannelPerCommitmentSecretOutputFromJson = ( + obj: any, +): ReleaseChannelPerCommitmentSecretOutput => { + return { + channelId: obj["release_channel_per_commitment_secret_output_channel"].id, + } as ReleaseChannelPerCommitmentSecretOutput; +}; + +export const FRAGMENT = ` +fragment ReleaseChannelPerCommitmentSecretOutputFragment on ReleaseChannelPerCommitmentSecretOutput { + __typename + release_channel_per_commitment_secret_output_channel: channel { + id + } +}`; + +export default ReleaseChannelPerCommitmentSecretOutput; diff --git a/packages/lightspark-sdk/src/objects/ReleasePaymentPreimageInput.ts b/packages/lightspark-sdk/src/objects/ReleasePaymentPreimageInput.ts new file mode 100644 index 000000000..039238747 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/ReleasePaymentPreimageInput.ts @@ -0,0 +1,20 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type ReleasePaymentPreimageInput = { + /** The invoice the preimage belongs to. **/ + invoiceId: string; + + /** The preimage to release. **/ + paymentPreimage: string; +}; + +export const ReleasePaymentPreimageInputFromJson = ( + obj: any, +): ReleasePaymentPreimageInput => { + return { + invoiceId: obj["release_payment_preimage_input_invoice_id"], + paymentPreimage: obj["release_payment_preimage_input_payment_preimage"], + } as ReleasePaymentPreimageInput; +}; + +export default ReleasePaymentPreimageInput; diff --git a/packages/lightspark-sdk/src/objects/ReleasePaymentPreimageOutput.ts b/packages/lightspark-sdk/src/objects/ReleasePaymentPreimageOutput.ts new file mode 100644 index 000000000..3f6d2ab9c --- /dev/null +++ b/packages/lightspark-sdk/src/objects/ReleasePaymentPreimageOutput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type ReleasePaymentPreimageOutput = { + invoiceId: string; +}; + +export const ReleasePaymentPreimageOutputFromJson = ( + obj: any, +): ReleasePaymentPreimageOutput => { + return { + invoiceId: obj["release_payment_preimage_output_invoice"].id, + } as ReleasePaymentPreimageOutput; +}; + +export const FRAGMENT = ` +fragment ReleasePaymentPreimageOutputFragment on ReleasePaymentPreimageOutput { + __typename + release_payment_preimage_output_invoice: invoice { + id + } +}`; + +export default ReleasePaymentPreimageOutput; diff --git a/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts b/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts new file mode 100644 index 000000000..629a3e385 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts @@ -0,0 +1,26 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +/** This is an enum of the potential sub-event types for Remote Signing webook events. **/ +export enum RemoteSigningSubEventType { + /** + * This is an enum value that represents values that could be added in the future. + * Clients should support unknown values as more of them could be added without notice. + */ + FUTURE_VALUE = "FUTURE_VALUE", + + ECDH = "ECDH", + + GET_PER_COMMITMENT_POINT = "GET_PER_COMMITMENT_POINT", + + RELEASE_PER_COMMITMENT_SECRET = "RELEASE_PER_COMMITMENT_SECRET", + + SIGN_INVOICE = "SIGN_INVOICE", + + DERIVE_KEY_AND_SIGN = "DERIVE_KEY_AND_SIGN", + + RELEASE_PAYMENT_PREIMAGE = "RELEASE_PAYMENT_PREIMAGE", + + REQUEST_INVOICE_PAYMENT_HASH = "REQUEST_INVOICE_PAYMENT_HASH", +} + +export default RemoteSigningSubEventType; diff --git a/packages/lightspark-sdk/src/objects/ScreenBitcoinAddressesInput.ts b/packages/lightspark-sdk/src/objects/ScreenBitcoinAddressesInput.ts deleted file mode 100644 index be23151ce..000000000 --- a/packages/lightspark-sdk/src/objects/ScreenBitcoinAddressesInput.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved - -import CryptoSanctionsScreeningProvider from "./CryptoSanctionsScreeningProvider.js"; - -type ScreenBitcoinAddressesInput = { - provider: CryptoSanctionsScreeningProvider; - - addresses: string[]; -}; - -export const ScreenBitcoinAddressesInputFromJson = ( - obj: any, -): ScreenBitcoinAddressesInput => { - return { - provider: - CryptoSanctionsScreeningProvider[ - obj["screen_bitcoin_addresses_input_provider"] - ] ?? CryptoSanctionsScreeningProvider.FUTURE_VALUE, - addresses: obj["screen_bitcoin_addresses_input_addresses"], - } as ScreenBitcoinAddressesInput; -}; - -export default ScreenBitcoinAddressesInput; diff --git a/packages/lightspark-sdk/src/objects/ScreenBitcoinAddressesOutput.ts b/packages/lightspark-sdk/src/objects/ScreenBitcoinAddressesOutput.ts deleted file mode 100644 index 5e9a706e3..000000000 --- a/packages/lightspark-sdk/src/objects/ScreenBitcoinAddressesOutput.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved - -import RiskRating from "./RiskRating.js"; - -type ScreenBitcoinAddressesOutput = { - ratings: RiskRating[]; -}; - -export const ScreenBitcoinAddressesOutputFromJson = ( - obj: any, -): ScreenBitcoinAddressesOutput => { - return { - ratings: obj["screen_bitcoin_addresses_output_ratings"].map( - (e) => RiskRating[e], - ), - } as ScreenBitcoinAddressesOutput; -}; - -export const FRAGMENT = ` -fragment ScreenBitcoinAddressesOutputFragment on ScreenBitcoinAddressesOutput { - __typename - screen_bitcoin_addresses_output_ratings: ratings -}`; - -export default ScreenBitcoinAddressesOutput; diff --git a/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts b/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts new file mode 100644 index 000000000..b2f6d451b --- /dev/null +++ b/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts @@ -0,0 +1,20 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import ComplianceProvider from "./ComplianceProvider.js"; + +type ScreenNodeInput = { + provider: ComplianceProvider; + + nodePubkey: string; +}; + +export const ScreenNodeInputFromJson = (obj: any): ScreenNodeInput => { + return { + provider: + ComplianceProvider[obj["screen_node_input_provider"]] ?? + ComplianceProvider.FUTURE_VALUE, + nodePubkey: obj["screen_node_input_node_pubkey"], + } as ScreenNodeInput; +}; + +export default ScreenNodeInput; diff --git a/packages/lightspark-sdk/src/objects/ScreenNodeOutput.ts b/packages/lightspark-sdk/src/objects/ScreenNodeOutput.ts new file mode 100644 index 000000000..c4125e7a2 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/ScreenNodeOutput.ts @@ -0,0 +1,22 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import RiskRating from "./RiskRating.js"; + +type ScreenNodeOutput = { + rating: RiskRating; +}; + +export const ScreenNodeOutputFromJson = (obj: any): ScreenNodeOutput => { + return { + rating: + RiskRating[obj["screen_node_output_rating"]] ?? RiskRating.FUTURE_VALUE, + } as ScreenNodeOutput; +}; + +export const FRAGMENT = ` +fragment ScreenNodeOutputFragment on ScreenNodeOutput { + __typename + screen_node_output_rating: rating +}`; + +export default ScreenNodeOutput; diff --git a/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts b/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts new file mode 100644 index 000000000..d2580e825 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts @@ -0,0 +1,24 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type SetInvoicePaymentHashInput = { + /** The invoice that needs to be updated. **/ + invoiceId: string; + + /** The 32-byte hash of the payment preimage. **/ + paymentHash: string; + + /** The 32-byte nonce used to generate the invoice preimage. **/ + preimageNonce: string; +}; + +export const SetInvoicePaymentHashInputFromJson = ( + obj: any, +): SetInvoicePaymentHashInput => { + return { + invoiceId: obj["set_invoice_payment_hash_input_invoice_id"], + paymentHash: obj["set_invoice_payment_hash_input_payment_hash"], + preimageNonce: obj["set_invoice_payment_hash_input_preimage_nonce"], + } as SetInvoicePaymentHashInput; +}; + +export default SetInvoicePaymentHashInput; diff --git a/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashOutput.ts b/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashOutput.ts new file mode 100644 index 000000000..c1fa96b59 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashOutput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type SetInvoicePaymentHashOutput = { + invoiceId: string; +}; + +export const SetInvoicePaymentHashOutputFromJson = ( + obj: any, +): SetInvoicePaymentHashOutput => { + return { + invoiceId: obj["set_invoice_payment_hash_output_invoice"].id, + } as SetInvoicePaymentHashOutput; +}; + +export const FRAGMENT = ` +fragment SetInvoicePaymentHashOutputFragment on SetInvoicePaymentHashOutput { + __typename + set_invoice_payment_hash_output_invoice: invoice { + id + } +}`; + +export default SetInvoicePaymentHashOutput; diff --git a/packages/lightspark-sdk/src/objects/SignInvoiceInput.ts b/packages/lightspark-sdk/src/objects/SignInvoiceInput.ts new file mode 100644 index 000000000..793e17ae2 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SignInvoiceInput.ts @@ -0,0 +1,19 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type SignInvoiceInput = { + invoiceId: string; + + signature: string; + + recoveryId: number; +}; + +export const SignInvoiceInputFromJson = (obj: any): SignInvoiceInput => { + return { + invoiceId: obj["sign_invoice_input_invoice_id"], + signature: obj["sign_invoice_input_signature"], + recoveryId: obj["sign_invoice_input_recovery_id"], + } as SignInvoiceInput; +}; + +export default SignInvoiceInput; diff --git a/packages/lightspark-sdk/src/objects/SignInvoiceOutput.ts b/packages/lightspark-sdk/src/objects/SignInvoiceOutput.ts new file mode 100644 index 000000000..1319bb7d3 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SignInvoiceOutput.ts @@ -0,0 +1,21 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type SignInvoiceOutput = { + invoiceId: string; +}; + +export const SignInvoiceOutputFromJson = (obj: any): SignInvoiceOutput => { + return { + invoiceId: obj["sign_invoice_output_invoice"].id, + } as SignInvoiceOutput; +}; + +export const FRAGMENT = ` +fragment SignInvoiceOutputFragment on SignInvoiceOutput { + __typename + sign_invoice_output_invoice: invoice { + id + } +}`; + +export default SignInvoiceOutput; diff --git a/packages/lightspark-sdk/src/objects/SignMessagesInput.ts b/packages/lightspark-sdk/src/objects/SignMessagesInput.ts new file mode 100644 index 000000000..040a85507 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SignMessagesInput.ts @@ -0,0 +1,18 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type IdAndSignature from "./IdAndSignature.js"; +import { IdAndSignatureFromJson } from "./IdAndSignature.js"; + +type SignMessagesInput = { + signatures: IdAndSignature[]; +}; + +export const SignMessagesInputFromJson = (obj: any): SignMessagesInput => { + return { + signatures: obj["sign_messages_input_signatures"].map((e) => + IdAndSignatureFromJson(e), + ), + } as SignMessagesInput; +}; + +export default SignMessagesInput; diff --git a/packages/lightspark-sdk/src/objects/SignMessagesOutput.ts b/packages/lightspark-sdk/src/objects/SignMessagesOutput.ts new file mode 100644 index 000000000..a9161d4a2 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SignMessagesOutput.ts @@ -0,0 +1,26 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import type SignablePayload from "./SignablePayload.js"; +import { SignablePayloadFromJson } from "./SignablePayload.js"; + +type SignMessagesOutput = { + signedPayloads: SignablePayload[]; +}; + +export const SignMessagesOutputFromJson = (obj: any): SignMessagesOutput => { + return { + signedPayloads: obj["sign_messages_output_signed_payloads"].map((e) => + SignablePayloadFromJson(e), + ), + } as SignMessagesOutput; +}; + +export const FRAGMENT = ` +fragment SignMessagesOutputFragment on SignMessagesOutput { + __typename + sign_messages_output_signed_payloads: signed_payloads { + id + } +}`; + +export default SignMessagesOutput; diff --git a/packages/lightspark-sdk/src/objects/Signable.ts b/packages/lightspark-sdk/src/objects/Signable.ts new file mode 100644 index 000000000..5e16d65e8 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/Signable.ts @@ -0,0 +1,58 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from "@lightsparkdev/core"; +import type Entity from "./Entity.js"; + +type Signable = Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string; + + /** The date and time when the entity was first created. **/ + createdAt: string; + + /** The date and time when the entity was last updated. **/ + updatedAt: string; + + /** The typename of the object **/ + typename: string; +}; + +export const SignableFromJson = (obj: any): Signable => { + return { + id: obj["signable_id"], + createdAt: obj["signable_created_at"], + updatedAt: obj["signable_updated_at"], + typename: "Signable", + } as Signable; +}; + +export const FRAGMENT = ` +fragment SignableFragment on Signable { + __typename + signable_id: id + signable_created_at: created_at + signable_updated_at: updated_at +}`; + +export const getSignableQuery = (id: string): Query => { + return { + queryPayload: ` +query GetSignable($id: ID!) { + entity(id: $id) { + ... on Signable { + ...SignableFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => SignableFromJson(data.entity), + }; +}; + +export default Signable; diff --git a/packages/lightspark-sdk/src/objects/SignablePayload.ts b/packages/lightspark-sdk/src/objects/SignablePayload.ts new file mode 100644 index 000000000..c4d95a722 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SignablePayload.ts @@ -0,0 +1,93 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +import { type Query } from "@lightsparkdev/core"; +import type Entity from "./Entity.js"; +import SignablePayloadStatus from "./SignablePayloadStatus.js"; + +type SignablePayload = Entity & { + /** + * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque + * string. + **/ + id: string; + + /** The date and time when the entity was first created. **/ + createdAt: string; + + /** The date and time when the entity was last updated. **/ + updatedAt: string; + + /** The payload that needs to be signed. **/ + payload: string; + + /** The consistent method for generating the same set of accounts and wallets for a given private key **/ + derivationPath: string; + + /** The status of the payload. **/ + status: SignablePayloadStatus; + + /** The signable this payload belongs to. **/ + signableId: string; + + /** The typename of the object **/ + typename: string; + + /** The tweak value to add. **/ + addTweak?: string; + + /** The tweak value to multiply. **/ + mulTweak?: string; +}; + +export const SignablePayloadFromJson = (obj: any): SignablePayload => { + return { + id: obj["signable_payload_id"], + createdAt: obj["signable_payload_created_at"], + updatedAt: obj["signable_payload_updated_at"], + payload: obj["signable_payload_payload"], + derivationPath: obj["signable_payload_derivation_path"], + status: + SignablePayloadStatus[obj["signable_payload_status"]] ?? + SignablePayloadStatus.FUTURE_VALUE, + signableId: obj["signable_payload_signable"].id, + typename: "SignablePayload", + addTweak: obj["signable_payload_add_tweak"], + mulTweak: obj["signable_payload_mul_tweak"], + } as SignablePayload; +}; + +export const FRAGMENT = ` +fragment SignablePayloadFragment on SignablePayload { + __typename + signable_payload_id: id + signable_payload_created_at: created_at + signable_payload_updated_at: updated_at + signable_payload_payload: payload + signable_payload_derivation_path: derivation_path + signable_payload_status: status + signable_payload_add_tweak: add_tweak + signable_payload_mul_tweak: mul_tweak + signable_payload_signable: signable { + id + } +}`; + +export const getSignablePayloadQuery = (id: string): Query => { + return { + queryPayload: ` +query GetSignablePayload($id: ID!) { + entity(id: $id) { + ... on SignablePayload { + ...SignablePayloadFragment + } + } +} + +${FRAGMENT} +`, + variables: { id }, + constructObject: (data: any) => SignablePayloadFromJson(data.entity), + }; +}; + +export default SignablePayload; diff --git a/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts b/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts new file mode 100644 index 000000000..90bec434c --- /dev/null +++ b/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts @@ -0,0 +1,17 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +export enum SignablePayloadStatus { + /** + * This is an enum value that represents values that could be added in the future. + * Clients should support unknown values as more of them could be added without notice. + */ + FUTURE_VALUE = "FUTURE_VALUE", + + CREATED = "CREATED", + + SIGNED = "SIGNED", + + VALIDATION_FAILED = "VALIDATION_FAILED", +} + +export default SignablePayloadStatus; diff --git a/packages/lightspark-sdk/src/objects/SingleNodeDashboard.ts b/packages/lightspark-sdk/src/objects/SingleNodeDashboard.ts index 8ea45d4a2..0d15cb8e3 100644 --- a/packages/lightspark-sdk/src/objects/SingleNodeDashboard.ts +++ b/packages/lightspark-sdk/src/objects/SingleNodeDashboard.ts @@ -1,6 +1,5 @@ import type { Maybe } from "@lightsparkdev/core"; import type CurrencyAmount from "./CurrencyAmount.js"; -import type LightsparkNodePurpose from "./LightsparkNodePurpose.js"; import type LightsparkNodeStatus from "./LightsparkNodeStatus.js"; import type NodeAddressType from "./NodeAddressType.js"; import type Transaction from "./Transaction.js"; @@ -8,7 +7,6 @@ import type Transaction from "./Transaction.js"; type SingleNodeDashboard = { id: string; displayName: string; - purpose: Maybe; color: Maybe; publicKey: Maybe; status: Maybe; diff --git a/packages/lightspark-sdk/src/objects/Transaction.ts b/packages/lightspark-sdk/src/objects/Transaction.ts index fe63b458f..dc8e6d857 100644 --- a/packages/lightspark-sdk/src/objects/Transaction.ts +++ b/packages/lightspark-sdk/src/objects/Transaction.ts @@ -11,6 +11,7 @@ import IncomingPayment from "./IncomingPayment.js"; import OutgoingPayment from "./OutgoingPayment.js"; import PaymentFailureReason from "./PaymentFailureReason.js"; import { PaymentRequestDataFromJson } from "./PaymentRequestData.js"; +import { PostTransactionDataFromJson } from "./PostTransactionData.js"; import { RichTextFromJson } from "./RichText.js"; import type RoutingTransaction from "./RoutingTransaction.js"; import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js"; @@ -128,8 +129,10 @@ export const TransactionFromJson = (obj: any): Transaction => { "IncomingPayment", obj["incoming_payment_resolved_at"], obj["incoming_payment_transaction_hash"], - obj["incoming_payment_origin"]?.id ?? undefined, obj["incoming_payment_payment_request"]?.id ?? undefined, + obj["incoming_payment_uma_post_transaction_data"].map((e) => + PostTransactionDataFromJson(e), + ), ); } if (obj["__typename"] == "OutgoingPayment") { @@ -160,6 +163,9 @@ 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) => + PostTransactionDataFromJson(e), + ), ); } if (obj["__typename"] == "RoutingTransaction") { @@ -334,15 +340,24 @@ fragment TransactionFragment on Transaction { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } incoming_payment_transaction_hash: transaction_hash - incoming_payment_origin: origin { - id - } incoming_payment_destination: destination { id } incoming_payment_payment_request: payment_request { id } + incoming_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on OutgoingPayment { __typename @@ -406,24 +421,54 @@ fragment TransactionFragment on Transaction { graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -474,12 +519,29 @@ fragment TransactionFragment on Transaction { currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -487,7 +549,7 @@ fragment TransactionFragment on Transaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -495,7 +557,7 @@ fragment TransactionFragment on Transaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -503,8 +565,7 @@ fragment TransactionFragment on Transaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -512,7 +573,58 @@ fragment TransactionFragment on Transaction { currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -522,6 +634,18 @@ fragment TransactionFragment on Transaction { __typename rich_text_text: text } + outgoing_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on RoutingTransaction { __typename diff --git a/packages/lightspark-sdk/src/objects/UpdateChannelPerCommitmentPointInput.ts b/packages/lightspark-sdk/src/objects/UpdateChannelPerCommitmentPointInput.ts new file mode 100644 index 000000000..eed157d03 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/UpdateChannelPerCommitmentPointInput.ts @@ -0,0 +1,25 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type UpdateChannelPerCommitmentPointInput = { + channelId: string; + + perCommitmentPoint: string; + + perCommitmentPointIndex: number; +}; + +export const UpdateChannelPerCommitmentPointInputFromJson = ( + obj: any, +): UpdateChannelPerCommitmentPointInput => { + return { + channelId: obj["update_channel_per_commitment_point_input_channel_id"], + perCommitmentPoint: + obj["update_channel_per_commitment_point_input_per_commitment_point"], + perCommitmentPointIndex: + obj[ + "update_channel_per_commitment_point_input_per_commitment_point_index" + ], + } as UpdateChannelPerCommitmentPointInput; +}; + +export default UpdateChannelPerCommitmentPointInput; diff --git a/packages/lightspark-sdk/src/objects/UpdateChannelPerCommitmentPointOutput.ts b/packages/lightspark-sdk/src/objects/UpdateChannelPerCommitmentPointOutput.ts new file mode 100644 index 000000000..2dc963f26 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/UpdateChannelPerCommitmentPointOutput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type UpdateChannelPerCommitmentPointOutput = { + channelId: string; +}; + +export const UpdateChannelPerCommitmentPointOutputFromJson = ( + obj: any, +): UpdateChannelPerCommitmentPointOutput => { + return { + channelId: obj["update_channel_per_commitment_point_output_channel"].id, + } as UpdateChannelPerCommitmentPointOutput; +}; + +export const FRAGMENT = ` +fragment UpdateChannelPerCommitmentPointOutputFragment on UpdateChannelPerCommitmentPointOutput { + __typename + update_channel_per_commitment_point_output_channel: channel { + id + } +}`; + +export default UpdateChannelPerCommitmentPointOutput; diff --git a/packages/lightspark-sdk/src/objects/UpdateNodeSharedSecretInput.ts b/packages/lightspark-sdk/src/objects/UpdateNodeSharedSecretInput.ts new file mode 100644 index 000000000..6c6824c54 --- /dev/null +++ b/packages/lightspark-sdk/src/objects/UpdateNodeSharedSecretInput.ts @@ -0,0 +1,18 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type UpdateNodeSharedSecretInput = { + nodeId: string; + + sharedSecret: string; +}; + +export const UpdateNodeSharedSecretInputFromJson = ( + obj: any, +): UpdateNodeSharedSecretInput => { + return { + nodeId: obj["update_node_shared_secret_input_node_id"], + sharedSecret: obj["update_node_shared_secret_input_shared_secret"], + } as UpdateNodeSharedSecretInput; +}; + +export default UpdateNodeSharedSecretInput; diff --git a/packages/lightspark-sdk/src/objects/UpdateNodeSharedSecretOutput.ts b/packages/lightspark-sdk/src/objects/UpdateNodeSharedSecretOutput.ts new file mode 100644 index 000000000..7554e773a --- /dev/null +++ b/packages/lightspark-sdk/src/objects/UpdateNodeSharedSecretOutput.ts @@ -0,0 +1,23 @@ +// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved + +type UpdateNodeSharedSecretOutput = { + nodeId: string; +}; + +export const UpdateNodeSharedSecretOutputFromJson = ( + obj: any, +): UpdateNodeSharedSecretOutput => { + return { + nodeId: obj["update_node_shared_secret_output_node"].id, + } as UpdateNodeSharedSecretOutput; +}; + +export const FRAGMENT = ` +fragment UpdateNodeSharedSecretOutputFragment on UpdateNodeSharedSecretOutput { + __typename + update_node_shared_secret_output_node: node { + id + } +}`; + +export default UpdateNodeSharedSecretOutput; diff --git a/packages/lightspark-sdk/src/objects/Wallet.ts b/packages/lightspark-sdk/src/objects/Wallet.ts index a3b0f9ae5..6ce4dd208 100644 --- a/packages/lightspark-sdk/src/objects/Wallet.ts +++ b/packages/lightspark-sdk/src/objects/Wallet.ts @@ -27,6 +27,7 @@ class Wallet implements LightsparkNodeOwner { public readonly typename: string, public readonly lastLoginAt?: string, public readonly balances?: Balances, + public readonly accountId?: string, ) { autoBind(this); } @@ -169,15 +170,24 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } incoming_payment_transaction_hash: transaction_hash - incoming_payment_origin: origin { - id - } incoming_payment_destination: destination { id } incoming_payment_payment_request: payment_request { id } + incoming_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on OutgoingPayment { __typename @@ -241,24 +251,54 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -309,12 +349,29 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -322,7 +379,7 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -330,7 +387,7 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -338,8 +395,7 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -347,7 +403,58 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -357,6 +464,18 @@ query FetchWalletToTransactionsConnection($entity_id: ID!, $first: Int, $after: __typename rich_text_text: text } + outgoing_payment_uma_post_transaction_data: uma_post_transaction_data { + __typename + post_transaction_data_utxo: utxo + post_transaction_data_amount: amount { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } } ... on RoutingTransaction { __typename @@ -507,24 +626,54 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte graph_node_display_name: display_name graph_node_public_key: public_key } - ... on LightsparkNode { + ... on LightsparkNodeWithOSK { __typename - lightspark_node_id: id - lightspark_node_created_at: created_at - lightspark_node_updated_at: updated_at - lightspark_node_alias: alias - lightspark_node_bitcoin_network: bitcoin_network - lightspark_node_color: color - lightspark_node_conductivity: conductivity - lightspark_node_display_name: display_name - lightspark_node_public_key: public_key - lightspark_node_account: account { + lightspark_node_with_o_s_k_id: id + lightspark_node_with_o_s_k_created_at: created_at + lightspark_node_with_o_s_k_updated_at: updated_at + lightspark_node_with_o_s_k_alias: alias + lightspark_node_with_o_s_k_bitcoin_network: bitcoin_network + lightspark_node_with_o_s_k_color: color + lightspark_node_with_o_s_k_conductivity: conductivity + lightspark_node_with_o_s_k_display_name: display_name + lightspark_node_with_o_s_k_public_key: public_key + lightspark_node_with_o_s_k_owner: owner { id } - lightspark_node_owner: owner { - id + lightspark_node_with_o_s_k_status: status + lightspark_node_with_o_s_k_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_total_local_balance: total_local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_blockchain_balance: blockchain_balance { + lightspark_node_with_o_s_k_local_balance: local_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_remote_balance: remote_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + lightspark_node_with_o_s_k_blockchain_balance: blockchain_balance { __typename blockchain_balance_total_balance: total_balance { __typename @@ -575,12 +724,29 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } } - lightspark_node_encrypted_signing_private_key: encrypted_signing_private_key { + lightspark_node_with_o_s_k_uma_prescreening_utxos: uma_prescreening_utxos + lightspark_node_with_o_s_k_encrypted_signing_private_key: encrypted_signing_private_key { __typename secret_encrypted_value: encrypted_value secret_cipher: cipher } - lightspark_node_total_balance: total_balance { + } + ... on LightsparkNodeWithRemoteSigning { + __typename + lightspark_node_with_remote_signing_id: id + lightspark_node_with_remote_signing_created_at: created_at + lightspark_node_with_remote_signing_updated_at: updated_at + lightspark_node_with_remote_signing_alias: alias + lightspark_node_with_remote_signing_bitcoin_network: bitcoin_network + lightspark_node_with_remote_signing_color: color + lightspark_node_with_remote_signing_conductivity: conductivity + lightspark_node_with_remote_signing_display_name: display_name + lightspark_node_with_remote_signing_public_key: public_key + lightspark_node_with_remote_signing_owner: owner { + id + } + lightspark_node_with_remote_signing_status: status + lightspark_node_with_remote_signing_total_balance: total_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -588,7 +754,7 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_total_local_balance: total_local_balance { + lightspark_node_with_remote_signing_total_local_balance: total_local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -596,7 +762,7 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_local_balance: local_balance { + lightspark_node_with_remote_signing_local_balance: local_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -604,8 +770,7 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_purpose: purpose - lightspark_node_remote_balance: remote_balance { + lightspark_node_with_remote_signing_remote_balance: remote_balance { __typename currency_amount_original_value: original_value currency_amount_original_unit: original_unit @@ -613,7 +778,58 @@ query FetchWalletToPaymentRequestsConnection($entity_id: ID!, $first: Int, $afte currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded currency_amount_preferred_currency_value_approx: preferred_currency_value_approx } - lightspark_node_status: status + lightspark_node_with_remote_signing_blockchain_balance: blockchain_balance { + __typename + blockchain_balance_total_balance: total_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_confirmed_balance: confirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_unconfirmed_balance: unconfirmed_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_locked_balance: locked_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_required_reserve: required_reserve { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + blockchain_balance_available_balance: available_balance { + __typename + currency_amount_original_value: original_value + currency_amount_original_unit: original_unit + currency_amount_preferred_currency_unit: preferred_currency_unit + currency_amount_preferred_currency_value_rounded: preferred_currency_value_rounded + currency_amount_preferred_currency_value_approx: preferred_currency_value_approx + } + } + lightspark_node_with_remote_signing_uma_prescreening_utxos: uma_prescreening_utxos } } } @@ -746,6 +962,7 @@ export const WalletFromJson = (obj: any): Wallet => { !!obj["wallet_balances"] ? BalancesFromJson(obj["wallet_balances"]) : undefined, + obj["wallet_account"]?.id ?? undefined, ); }; @@ -784,6 +1001,9 @@ fragment WalletFragment on Wallet { } } wallet_third_party_identifier: third_party_identifier + wallet_account: account { + id + } wallet_status: status }`; diff --git a/packages/lightspark-sdk/src/objects/index.ts b/packages/lightspark-sdk/src/objects/index.ts index ab33e9b10..7908dc0c0 100644 --- a/packages/lightspark-sdk/src/objects/index.ts +++ b/packages/lightspark-sdk/src/objects/index.ts @@ -21,6 +21,7 @@ export { } from "./ChannelOpeningTransaction.js"; export { default as ChannelStatus } from "./ChannelStatus.js"; export { default as ChannelToTransactionsConnection } from "./ChannelToTransactionsConnection.js"; +export { default as ComplianceProvider } from "./ComplianceProvider.js"; export { default as Connection } from "./Connection.js"; export { default as CreateApiTokenInput } from "./CreateApiTokenInput.js"; export { default as CreateApiTokenOutput } from "./CreateApiTokenOutput.js"; @@ -33,9 +34,11 @@ export { default as CreateTestModeInvoiceInput } from "./CreateTestModeInvoiceIn export { default as CreateTestModeInvoiceOutput } from "./CreateTestModeInvoiceOutput.js"; export { default as CreateTestModePaymentInput } from "./CreateTestModePaymentInput.js"; export { default as CreateTestModePaymentoutput } from "./CreateTestModePaymentoutput.js"; -export { default as CryptoSanctionsScreeningProvider } from "./CryptoSanctionsScreeningProvider.js"; +export { default as CreateUmaInvoiceInput } from "./CreateUmaInvoiceInput.js"; export { default as CurrencyAmount } from "./CurrencyAmount.js"; export { default as CurrencyUnit } from "./CurrencyUnit.js"; +export { default as DeclineToSignMessagesInput } from "./DeclineToSignMessagesInput.js"; +export { default as DeclineToSignMessagesOutput } from "./DeclineToSignMessagesOutput.js"; export { default as DeleteApiTokenInput } from "./DeleteApiTokenInput.js"; export { default as DeleteApiTokenOutput } from "./DeleteApiTokenOutput.js"; export { default as Deposit, getDepositQuery } from "./Deposit.js"; @@ -46,6 +49,7 @@ export { default as FundNodeOutput } from "./FundNodeOutput.js"; export { default as GraphNode } from "./GraphNode.js"; export { default as Hop, getHopQuery } from "./Hop.js"; export { default as HtlcAttemptFailureCode } from "./HtlcAttemptFailureCode.js"; +export { default as IdAndSignature } from "./IdAndSignature.js"; export { default as IncomingPayment } from "./IncomingPayment.js"; export { default as IncomingPaymentAttempt, @@ -68,9 +72,10 @@ export { default as LightsparkNodeOwner, getLightsparkNodeOwnerQuery, } from "./LightsparkNodeOwner.js"; -export { default as LightsparkNodePurpose } from "./LightsparkNodePurpose.js"; export { default as LightsparkNodeStatus } from "./LightsparkNodeStatus.js"; export { default as LightsparkNodeToChannelsConnection } from "./LightsparkNodeToChannelsConnection.js"; +export { default as LightsparkNodeWithOSK } from "./LightsparkNodeWithOSK.js"; +export { default as LightsparkNodeWithRemoteSigning } from "./LightsparkNodeWithRemoteSigning.js"; export { default as Node } from "./Node.js"; export { default as NodeAddress } from "./NodeAddress.js"; export { default as NodeAddressType } from "./NodeAddressType.js"; @@ -83,10 +88,13 @@ export { default as OutgoingPayment } from "./OutgoingPayment.js"; export { default as OutgoingPaymentAttempt } from "./OutgoingPaymentAttempt.js"; export { default as OutgoingPaymentAttemptStatus } from "./OutgoingPaymentAttemptStatus.js"; export { default as OutgoingPaymentAttemptToHopsConnection } from "./OutgoingPaymentAttemptToHopsConnection.js"; +export { default as OutgoingPaymentsForInvoiceQueryInput } from "./OutgoingPaymentsForInvoiceQueryInput.js"; +export { default as OutgoingPaymentsForInvoiceQueryOutput } from "./OutgoingPaymentsForInvoiceQueryOutput.js"; export { default as OutgoingPaymentToAttemptsConnection } from "./OutgoingPaymentToAttemptsConnection.js"; export { default as PageInfo } from "./PageInfo.js"; export { default as PayInvoiceInput } from "./PayInvoiceInput.js"; export { default as PayInvoiceOutput } from "./PayInvoiceOutput.js"; +export { default as PaymentDirection } from "./PaymentDirection.js"; export { default as PaymentFailureReason } from "./PaymentFailureReason.js"; export { default as PaymentRequest, @@ -94,7 +102,16 @@ export { } from "./PaymentRequest.js"; export { default as PaymentRequestData } from "./PaymentRequestData.js"; export { default as PaymentRequestStatus } from "./PaymentRequestStatus.js"; +export { default as PayUmaInvoiceInput } from "./PayUmaInvoiceInput.js"; export { default as Permission } from "./Permission.js"; +export { default as PostTransactionData } from "./PostTransactionData.js"; +export { default as RegisterPaymentInput } from "./RegisterPaymentInput.js"; +export { default as RegisterPaymentOutput } from "./RegisterPaymentOutput.js"; +export { default as ReleaseChannelPerCommitmentSecretInput } from "./ReleaseChannelPerCommitmentSecretInput.js"; +export { default as ReleaseChannelPerCommitmentSecretOutput } from "./ReleaseChannelPerCommitmentSecretOutput.js"; +export { default as ReleasePaymentPreimageInput } from "./ReleasePaymentPreimageInput.js"; +export { default as ReleasePaymentPreimageOutput } from "./ReleasePaymentPreimageOutput.js"; +export { default as RemoteSigningSubEventType } from "./RemoteSigningSubEventType.js"; export { default as RequestWithdrawalInput } from "./RequestWithdrawalInput.js"; export { default as RequestWithdrawalOutput } from "./RequestWithdrawalOutput.js"; export { default as RichText } from "./RichText.js"; @@ -104,17 +121,33 @@ export { getRoutingTransactionQuery, } from "./RoutingTransaction.js"; export { default as RoutingTransactionFailureReason } from "./RoutingTransactionFailureReason.js"; -export { default as ScreenBitcoinAddressesInput } from "./ScreenBitcoinAddressesInput.js"; -export { default as ScreenBitcoinAddressesOutput } from "./ScreenBitcoinAddressesOutput.js"; +export { default as ScreenNodeInput } from "./ScreenNodeInput.js"; +export { default as ScreenNodeOutput } from "./ScreenNodeOutput.js"; export { default as Secret } from "./Secret.js"; export { default as SendPaymentInput } from "./SendPaymentInput.js"; export { default as SendPaymentOutput } from "./SendPaymentOutput.js"; +export { default as SetInvoicePaymentHashInput } from "./SetInvoicePaymentHashInput.js"; +export { default as SetInvoicePaymentHashOutput } from "./SetInvoicePaymentHashOutput.js"; +export { default as Signable, getSignableQuery } from "./Signable.js"; +export { + default as SignablePayload, + getSignablePayloadQuery, +} from "./SignablePayload.js"; +export { default as SignablePayloadStatus } from "./SignablePayloadStatus.js"; +export { default as SignInvoiceInput } from "./SignInvoiceInput.js"; +export { default as SignInvoiceOutput } from "./SignInvoiceOutput.js"; +export { default as SignMessagesInput } from "./SignMessagesInput.js"; +export { default as SignMessagesOutput } from "./SignMessagesOutput.js"; export { default as SingleNodeDashboard } from "./SingleNodeDashboard.js"; export { default as Transaction, getTransactionQuery } from "./Transaction.js"; export { default as TransactionFailures } from "./TransactionFailures.js"; export { default as TransactionStatus } from "./TransactionStatus.js"; export { default as TransactionType } from "./TransactionType.js"; export { default as TransactionUpdate } from "./TransactionUpdate.js"; +export { default as UpdateChannelPerCommitmentPointInput } from "./UpdateChannelPerCommitmentPointInput.js"; +export { default as UpdateChannelPerCommitmentPointOutput } from "./UpdateChannelPerCommitmentPointOutput.js"; +export { default as UpdateNodeSharedSecretInput } from "./UpdateNodeSharedSecretInput.js"; +export { default as UpdateNodeSharedSecretOutput } from "./UpdateNodeSharedSecretOutput.js"; export { default as Wallet } from "./Wallet.js"; export { default as WalletStatus } from "./WalletStatus.js"; export { default as WalletToPaymentRequestsConnection } from "./WalletToPaymentRequestsConnection.js"; diff --git a/packages/wallet-sdk/src/objects/CreateTestModePaymentoutput.ts b/packages/wallet-sdk/src/objects/CreateTestModePaymentoutput.ts index eada5dd0e..512a8d2b9 100644 --- a/packages/wallet-sdk/src/objects/CreateTestModePaymentoutput.ts +++ b/packages/wallet-sdk/src/objects/CreateTestModePaymentoutput.ts @@ -2,8 +2,15 @@ /** This is an object identifying the output of a test mode payment. This object can be used to retrieve the associated payment made from a Test Mode Payment call. **/ type CreateTestModePaymentoutput = { - /** The payment that has been sent. **/ + /** + * The payment that has been sent. + * + * @deprecated Use incoming_payment instead. + **/ paymentId: string; + + /** The payment that has been received. **/ + incomingPaymentId: string; }; export const CreateTestModePaymentoutputFromJson = ( @@ -11,6 +18,8 @@ export const CreateTestModePaymentoutputFromJson = ( ): CreateTestModePaymentoutput => { return { paymentId: obj["create_test_mode_paymentoutput_payment"].id, + incomingPaymentId: + obj["create_test_mode_paymentoutput_incoming_payment"].id, } as CreateTestModePaymentoutput; }; @@ -20,6 +29,9 @@ fragment CreateTestModePaymentoutputFragment on CreateTestModePaymentoutput { create_test_mode_paymentoutput_payment: payment { id } + create_test_mode_paymentoutput_incoming_payment: incoming_payment { + id + } }`; export default CreateTestModePaymentoutput;