@kaleidorg/wallet-protocols 1.0.0-beta.2 → 1.0.0-beta.3

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.
@@ -50,21 +50,6 @@ export interface HodlInvoiceDescriptor {
50
50
  amount_sats: number;
51
51
  expires_at: number;
52
52
  }
53
- /**
54
- * Descriptor for an outbound Spark HTLC payment, used in the
55
- * Arkade -> Spark direction. The maker SENDs a Spark HTLC to the taker;
56
- * once the taker claims it, the preimage propagates back to the maker via
57
- * `Payment.htlc_details.preimage` so the maker can claim its source-side
58
- * Arkade VHTLC. The descriptor carries the SDK payment id needed to drive
59
- * the polling.
60
- */
61
- export interface SparkHtlcSendDescriptor {
62
- payment_id: string;
63
- payment_hash: string;
64
- amount_sats: number;
65
- receiver_address: string;
66
- expires_at: number;
67
- }
68
53
  export interface CrossL2QuoteRequest {
69
54
  from_layer: Layer;
70
55
  to_layer: Layer;
@@ -86,57 +71,22 @@ export interface CrossL2Quote {
86
71
  * Cross-L2 swap initiation, taker-driven.
87
72
  *
88
73
  * The TAKER generates a single secret preimage P and supplies sha256(P)
89
- * as `payment_hash`. The same hash is used on BOTH sides of the swap.
90
- *
91
- * Spark -> Arkade direction:
92
- * - source: Spark Lightning HODL committed to sha256(P) (taker pays)
93
- * - destination: Arkade SHA256-VHTLC committed to sha256(P) (maker
94
- * funds, taker claims with P). `receiver_dest_pubkey` = taker's
95
- * Arkade x-only pubkey (VHTLC receiver). `taker_spark_address` is
96
- * unused.
97
- *
98
- * Arkade -> Spark direction:
99
- * - source: Arkade SHA256-VHTLC committed to sha256(P) (taker funds,
100
- * maker claims with P). `receiver_dest_pubkey` = taker's Arkade
101
- * x-only pubkey (VHTLC sender — refund-path beneficiary).
102
- * - destination: Spark HTLC payment to `taker_spark_address` (maker
103
- * sends, taker claims with P; preimage propagates back to maker
104
- * via Payment.htlc_details.preimage).
105
- *
106
- * Atomicity holds because a single preimage unlocks both sides.
74
+ * as `payment_hash`. The same hash is used on BOTH sides:
75
+ * - source: Spark Lightning HODL committed to sha256(P)
76
+ * - destination: Arkade SHA256-VHTLC committed to sha256(P)
77
+ * Atomicity holds because knowledge of P unlocks both sides; the taker
78
+ * reveals P on Arkade by claiming the VHTLC, the maker scrapes P from
79
+ * the spend witness and settles the HODL on Spark.
107
80
  */
108
81
  export interface CrossL2InitiatePayload {
109
82
  quote_id: string;
110
- /** sha256(preimage), 32-byte hex. Used for both source and dest. */
83
+ /** sha256(preimage), 32-byte hex. Used for both source HODL and dest SHA256-VHTLC. */
111
84
  payment_hash: string;
112
- /**
113
- * Taker's Arkade x-only pubkey (32-byte hex). VHTLC receiver in
114
- * Spark->Arkade; VHTLC sender in Arkade->Spark.
115
- */
116
85
  receiver_dest_pubkey: string;
117
- /**
118
- * Taker's Spark address. Required for Arkade->Spark (maker SENDs the
119
- * Spark HTLC to this address). Ignored for Spark->Arkade.
120
- */
121
- taker_spark_address?: string;
122
86
  }
123
- /**
124
- * Direction-aware /initiate response.
125
- *
126
- * Spark -> Arkade:
127
- * - `source_invoice` is the Spark Lightning HODL invoice (taker pays).
128
- * - `dest_vhtlc_address` / `vhtlc_params` describe the destination
129
- * Arkade VHTLC the maker has already FUNDED (taker claims with P).
130
- *
131
- * Arkade -> Spark:
132
- * - `source_invoice` is null (no source Lightning invoice).
133
- * - `dest_vhtlc_address` / `vhtlc_params` describe the SOURCE Arkade
134
- * VHTLC the taker MUST FUND (maker later claims with P). Despite the
135
- * legacy field name, it is the source-side VHTLC in this direction.
136
- */
137
87
  export interface CrossL2InitiateResponse {
138
88
  swap_id: string;
139
- source_invoice: string | null;
89
+ source_invoice: string;
140
90
  dest_vhtlc_address: string;
141
91
  vhtlc_params: VhtlcParams;
142
92
  vhtlc_script_hex: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cross-l2.d.ts","sourceRoot":"","sources":["../../src/types/cross-l2.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,E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,CAAA;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,YAAY,EAAE,WAAW,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,YAAY,CAAA;IACnB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;CACpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaleidorg/wallet-protocols",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "WDK-based multi-protocol wallet engine (Spark, RGB/RLN, Liquid, Arkade): IProtocolAdapter contract + WDK adapters, cross-protocol router, BIP321 unified receive, and lite/advanced disclosure.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,6 +28,12 @@
28
28
  "@kaleidorg/wdk-wallet-liquid": "^1.0.0-beta.2",
29
29
  "@kaleidorg/wdk-protocol-swap-kaleidoswap": "^1.0.0-beta.2"
30
30
  },
31
+ "devDependencies": {
32
+ "@buildonspark/spark-sdk": "^0.7.10",
33
+ "@arkade-os/sdk": "^0.4.14",
34
+ "@flashnet/sdk": "^0.5.7",
35
+ "typescript": "~5.9.3"
36
+ },
31
37
  "publishConfig": {
32
38
  "access": "public"
33
39
  },