@lightsparkdev/lightspark-sdk 1.0.7 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lightsparkdev/lightspark-sdk
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c4926df: Change createTestModePayment to return an IncomingPayment
8
+
3
9
  ## 1.0.7
4
10
 
5
11
  ### Patch Changes
@@ -8823,32 +8823,34 @@ export {
8823
8823
  InvoiceFromJson,
8824
8824
  FRAGMENT24 as FRAGMENT5,
8825
8825
  getInvoiceQuery,
8826
+ IncomingPaymentAttemptStatus_default,
8827
+ getIncomingPaymentAttemptQuery,
8828
+ TransactionStatus_default,
8829
+ IncomingPaymentFromJson,
8830
+ FRAGMENT12 as FRAGMENT6,
8831
+ IncomingPayment_default,
8832
+ FRAGMENT25 as FRAGMENT7,
8826
8833
  HtlcAttemptFailureCode_default,
8827
8834
  OutgoingPaymentAttemptStatus_default,
8828
8835
  getHopQuery,
8829
8836
  OutgoingPaymentAttempt_default,
8830
8837
  PaymentFailureReason_default,
8831
- TransactionStatus_default,
8832
8838
  OutgoingPaymentFromJson,
8833
- FRAGMENT15 as FRAGMENT6,
8839
+ FRAGMENT15 as FRAGMENT8,
8834
8840
  OutgoingPayment_default,
8835
- FRAGMENT25 as FRAGMENT7,
8836
8841
  WithdrawalMode_default,
8837
8842
  WithdrawalRequestStatus_default,
8838
8843
  getChannelClosingTransactionQuery,
8839
8844
  getChannelOpeningTransactionQuery,
8840
8845
  WithdrawalRequestFromJson,
8841
- FRAGMENT33 as FRAGMENT8,
8846
+ FRAGMENT33 as FRAGMENT9,
8842
8847
  WithdrawalRequest_default,
8843
- IncomingPaymentAttemptStatus_default,
8844
- getIncomingPaymentAttemptQuery,
8845
- IncomingPayment_default,
8846
8848
  RoutingTransactionFailureReason_default,
8847
8849
  TransactionFromJson,
8848
- FRAGMENT16 as FRAGMENT9,
8850
+ FRAGMENT16 as FRAGMENT10,
8849
8851
  getTransactionQuery,
8850
8852
  TransactionUpdateFromJson,
8851
- FRAGMENT31 as FRAGMENT10,
8853
+ FRAGMENT31 as FRAGMENT11,
8852
8854
  AccountToChannelsConnection_default,
8853
8855
  LightsparkNode_default,
8854
8856
  getPaymentRequestQuery,
@@ -760,6 +760,111 @@ type FeeEstimate = {
760
760
  feeMin: CurrencyAmount;
761
761
  };
762
762
 
763
+ /** This is an enum that enumerates all potential statuses for an incoming payment attempt. **/
764
+ declare enum IncomingPaymentAttemptStatus {
765
+ /**
766
+ * This is an enum value that represents values that could be added in the future.
767
+ * Clients should support unknown values as more of them could be added without notice.
768
+ */
769
+ FUTURE_VALUE = "FUTURE_VALUE",
770
+ ACCEPTED = "ACCEPTED",
771
+ SETTLED = "SETTLED",
772
+ CANCELED = "CANCELED",
773
+ UNKNOWN = "UNKNOWN"
774
+ }
775
+
776
+ /** This object represents any attempted payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific incoming payment attempt. **/
777
+ type IncomingPaymentAttempt = Entity & {
778
+ /**
779
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
780
+ * string.
781
+ **/
782
+ id: string;
783
+ /** The date and time when the entity was first created. **/
784
+ createdAt: string;
785
+ /** The date and time when the entity was last updated. **/
786
+ updatedAt: string;
787
+ /** The status of the incoming payment attempt. **/
788
+ status: IncomingPaymentAttemptStatus;
789
+ /** The total amount of that was attempted to send. **/
790
+ amount: CurrencyAmount;
791
+ /** The channel this attempt was made on. **/
792
+ channelId: string;
793
+ /** The typename of the object **/
794
+ typename: string;
795
+ /** The time the incoming payment attempt failed or succeeded. **/
796
+ resolvedAt?: string;
797
+ };
798
+ declare const getIncomingPaymentAttemptQuery: (id: string) => Query<IncomingPaymentAttempt>;
799
+
800
+ /** The connection from incoming payment to all attempts. **/
801
+ type IncomingPaymentToAttemptsConnection = Connection & {
802
+ /**
803
+ * The total count of objects in this connection, using the current filters. It is different from the
804
+ * number of objects returned in the current page (in the `entities` field).
805
+ **/
806
+ count: number;
807
+ /** An object that holds pagination information about the objects in this connection. **/
808
+ pageInfo: PageInfo;
809
+ /** The incoming payment attempts for the current page of this connection. **/
810
+ entities: IncomingPaymentAttempt[];
811
+ /** The typename of the object **/
812
+ typename: string;
813
+ };
814
+
815
+ /** This is an object representing a transaction made over the Lightning Network. You can retrieve this object to receive information about a specific transaction made over Lightning for a Lightspark node. **/
816
+ type LightningTransaction = Transaction & Entity & {
817
+ /**
818
+ * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
819
+ * string.
820
+ **/
821
+ id: string;
822
+ /** The date and time when this transaction was initiated. **/
823
+ createdAt: string;
824
+ /** The date and time when the entity was last updated. **/
825
+ updatedAt: string;
826
+ /** The current status of this transaction. **/
827
+ status: TransactionStatus;
828
+ /** The amount of money involved in this transaction. **/
829
+ amount: CurrencyAmount;
830
+ /** The typename of the object **/
831
+ typename: string;
832
+ /** The date and time when this transaction was completed or failed. **/
833
+ resolvedAt?: string;
834
+ /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
835
+ transactionHash?: string;
836
+ };
837
+ declare const getLightningTransactionQuery: (id: string) => Query<LightningTransaction>;
838
+
839
+ /** This object represents post-transaction data that could be used to register payment for KYT. **/
840
+ type PostTransactionData = {
841
+ /**
842
+ * The utxo of the channel over which the payment went through in the format of
843
+ * <transaction_hash>:<output_index>.
844
+ **/
845
+ utxo: string;
846
+ /** The amount of funds transferred in the payment. **/
847
+ amount: CurrencyAmount;
848
+ };
849
+
850
+ /** 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. **/
851
+ declare class IncomingPayment implements LightningTransaction {
852
+ readonly id: string;
853
+ readonly createdAt: string;
854
+ readonly updatedAt: string;
855
+ readonly status: TransactionStatus;
856
+ readonly amount: CurrencyAmount;
857
+ readonly destinationId: string;
858
+ readonly typename: string;
859
+ readonly resolvedAt?: string | undefined;
860
+ readonly transactionHash?: string | undefined;
861
+ readonly paymentRequestId?: string | undefined;
862
+ readonly umaPostTransactionData?: PostTransactionData[] | undefined;
863
+ constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, destinationId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, paymentRequestId?: string | undefined, umaPostTransactionData?: PostTransactionData[] | undefined);
864
+ getAttempts(client: LightsparkClient, first?: number | undefined, statuses?: IncomingPaymentAttemptStatus[] | undefined, after?: string | undefined): Promise<IncomingPaymentToAttemptsConnection>;
865
+ static getIncomingPaymentQuery(id: string): Query<IncomingPayment>;
866
+ }
867
+
763
868
  /** This object represents the data associated with a BOLT #11 invoice. You can retrieve this object to receive the relevant data associated with a specific invoice. **/
764
869
  type InvoiceData = PaymentRequestData & {
765
870
  encodedPaymentRequest: string;
@@ -818,30 +923,6 @@ declare enum InvoiceType {
818
923
  AMP = "AMP"
819
924
  }
820
925
 
821
- /** This is an object representing a transaction made over the Lightning Network. You can retrieve this object to receive information about a specific transaction made over Lightning for a Lightspark node. **/
822
- type LightningTransaction = Transaction & Entity & {
823
- /**
824
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
825
- * string.
826
- **/
827
- id: string;
828
- /** The date and time when this transaction was initiated. **/
829
- createdAt: string;
830
- /** The date and time when the entity was last updated. **/
831
- updatedAt: string;
832
- /** The current status of this transaction. **/
833
- status: TransactionStatus;
834
- /** The amount of money involved in this transaction. **/
835
- amount: CurrencyAmount;
836
- /** The typename of the object **/
837
- typename: string;
838
- /** The date and time when this transaction was completed or failed. **/
839
- resolvedAt?: string;
840
- /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/
841
- transactionHash?: string;
842
- };
843
- declare const getLightningTransactionQuery: (id: string) => Query<LightningTransaction>;
844
-
845
926
  /** This is an enum representing a particular reason why an htlc sent over the Lightning Network may have failed. **/
846
927
  declare enum HtlcAttemptFailureCode {
847
928
  /**
@@ -966,17 +1047,6 @@ type OutgoingPaymentToAttemptsConnection = Connection & {
966
1047
  typename: string;
967
1048
  };
968
1049
 
969
- /** This object represents post-transaction data that could be used to register payment for KYT. **/
970
- type PostTransactionData = {
971
- /**
972
- * The utxo of the channel over which the payment went through in the format of
973
- * <transaction_hash>:<output_index>.
974
- **/
975
- utxo: string;
976
- /** The amount of funds transferred in the payment. **/
977
- amount: CurrencyAmount;
978
- };
979
-
980
1050
  type RichText = {
981
1051
  text: string;
982
1052
  };
@@ -1577,7 +1647,7 @@ declare class LightsparkClient {
1577
1647
  * @param amountMsats The amount to pay in milli-satoshis for 0-amount invoices. This should be null for non-zero
1578
1648
  * amount invoices.
1579
1649
  */
1580
- createTestModePayment(localNodeId: string, encodedInvoice: string, amountMsats?: number | undefined): Promise<OutgoingPayment | null>;
1650
+ createTestModePayment(localNodeId: string, encodedInvoice: string, amountMsats?: number | undefined): Promise<IncomingPayment | null>;
1581
1651
  /**
1582
1652
  * Executes a raw `Query` against the Lightspark API.
1583
1653
  *
@@ -1818,76 +1888,6 @@ type IdAndSignature = {
1818
1888
  signature: string;
1819
1889
  };
1820
1890
 
1821
- /** This is an enum that enumerates all potential statuses for an incoming payment attempt. **/
1822
- declare enum IncomingPaymentAttemptStatus {
1823
- /**
1824
- * This is an enum value that represents values that could be added in the future.
1825
- * Clients should support unknown values as more of them could be added without notice.
1826
- */
1827
- FUTURE_VALUE = "FUTURE_VALUE",
1828
- ACCEPTED = "ACCEPTED",
1829
- SETTLED = "SETTLED",
1830
- CANCELED = "CANCELED",
1831
- UNKNOWN = "UNKNOWN"
1832
- }
1833
-
1834
- /** This object represents any attempted payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific incoming payment attempt. **/
1835
- type IncomingPaymentAttempt = Entity & {
1836
- /**
1837
- * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque
1838
- * string.
1839
- **/
1840
- id: string;
1841
- /** The date and time when the entity was first created. **/
1842
- createdAt: string;
1843
- /** The date and time when the entity was last updated. **/
1844
- updatedAt: string;
1845
- /** The status of the incoming payment attempt. **/
1846
- status: IncomingPaymentAttemptStatus;
1847
- /** The total amount of that was attempted to send. **/
1848
- amount: CurrencyAmount;
1849
- /** The channel this attempt was made on. **/
1850
- channelId: string;
1851
- /** The typename of the object **/
1852
- typename: string;
1853
- /** The time the incoming payment attempt failed or succeeded. **/
1854
- resolvedAt?: string;
1855
- };
1856
- declare const getIncomingPaymentAttemptQuery: (id: string) => Query<IncomingPaymentAttempt>;
1857
-
1858
- /** The connection from incoming payment to all attempts. **/
1859
- type IncomingPaymentToAttemptsConnection = Connection & {
1860
- /**
1861
- * The total count of objects in this connection, using the current filters. It is different from the
1862
- * number of objects returned in the current page (in the `entities` field).
1863
- **/
1864
- count: number;
1865
- /** An object that holds pagination information about the objects in this connection. **/
1866
- pageInfo: PageInfo;
1867
- /** The incoming payment attempts for the current page of this connection. **/
1868
- entities: IncomingPaymentAttempt[];
1869
- /** The typename of the object **/
1870
- typename: string;
1871
- };
1872
-
1873
- /** 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. **/
1874
- declare class IncomingPayment implements LightningTransaction {
1875
- readonly id: string;
1876
- readonly createdAt: string;
1877
- readonly updatedAt: string;
1878
- readonly status: TransactionStatus;
1879
- readonly amount: CurrencyAmount;
1880
- readonly destinationId: string;
1881
- readonly typename: string;
1882
- readonly resolvedAt?: string | undefined;
1883
- readonly transactionHash?: string | undefined;
1884
- readonly paymentRequestId?: string | undefined;
1885
- readonly umaPostTransactionData?: PostTransactionData[] | undefined;
1886
- constructor(id: string, createdAt: string, updatedAt: string, status: TransactionStatus, amount: CurrencyAmount, destinationId: string, typename: string, resolvedAt?: string | undefined, transactionHash?: string | undefined, paymentRequestId?: string | undefined, umaPostTransactionData?: PostTransactionData[] | undefined);
1887
- getAttempts(client: LightsparkClient, first?: number | undefined, statuses?: IncomingPaymentAttemptStatus[] | undefined, after?: string | undefined): Promise<IncomingPaymentToAttemptsConnection>;
1888
- static getIncomingPaymentQuery(id: string): Query<IncomingPayment>;
1889
- }
1890
-
1891
1891
  type LightningFeeEstimateForInvoiceInput = {
1892
1892
  /** The node from where you want to send the payment. **/
1893
1893
  nodeId: string;