@arkade-os/sdk 0.4.64 → 0.4.65

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.
Files changed (55) hide show
  1. package/dist/adapters/expo.cjs +5 -5
  2. package/dist/adapters/expo.js +3 -3
  3. package/dist/adapters/indexedDB.cjs +5 -5
  4. package/dist/adapters/indexedDB.js +4 -4
  5. package/dist/{chunk-HQ2DDMQN.js → chunk-3G5V564P.js} +141 -3
  6. package/dist/chunk-3G5V564P.js.map +1 -0
  7. package/dist/{chunk-WJN2BLEI.js → chunk-5YTSQSLE.js} +226 -353
  8. package/dist/chunk-5YTSQSLE.js.map +1 -0
  9. package/dist/{chunk-35YIP6OA.cjs → chunk-7X744EFF.cjs} +10 -10
  10. package/dist/{chunk-35YIP6OA.cjs.map → chunk-7X744EFF.cjs.map} +1 -1
  11. package/dist/{chunk-WXCVS6PD.cjs → chunk-BABJ77NG.cjs} +196 -57
  12. package/dist/chunk-BABJ77NG.cjs.map +1 -0
  13. package/dist/{chunk-FZFSGOTZ.cjs → chunk-G552MISJ.cjs} +3 -3
  14. package/dist/{chunk-FZFSGOTZ.cjs.map → chunk-G552MISJ.cjs.map} +1 -1
  15. package/dist/{chunk-LPEE2H2M.cjs → chunk-GFZNEMGL.cjs} +629 -748
  16. package/dist/chunk-GFZNEMGL.cjs.map +1 -0
  17. package/dist/{chunk-USXWE2EJ.js → chunk-RESN6QHP.js} +4 -4
  18. package/dist/{chunk-USXWE2EJ.js.map → chunk-RESN6QHP.js.map} +1 -1
  19. package/dist/{chunk-4N45WCSJ.cjs → chunk-SJQM5AVB.cjs} +17 -17
  20. package/dist/{chunk-4N45WCSJ.cjs.map → chunk-SJQM5AVB.cjs.map} +1 -1
  21. package/dist/{chunk-XJCBV4AA.js → chunk-TFSVXMTM.js} +3 -3
  22. package/dist/{chunk-XJCBV4AA.js.map → chunk-TFSVXMTM.js.map} +1 -1
  23. package/dist/{chunk-ZUEGFM3T.js → chunk-TYTPVPKD.js} +4 -4
  24. package/dist/{chunk-ZUEGFM3T.js.map → chunk-TYTPVPKD.js.map} +1 -1
  25. package/dist/{chunk-LN2VZP63.js → chunk-XMOIRDLF.js} +151 -12
  26. package/dist/chunk-XMOIRDLF.js.map +1 -0
  27. package/dist/{chunk-RXITDAV4.cjs → chunk-XN55B6EP.cjs} +155 -17
  28. package/dist/chunk-XN55B6EP.cjs.map +1 -0
  29. package/dist/contracts/handlers/index.cjs +9 -9
  30. package/dist/contracts/handlers/index.d.cts +1 -1
  31. package/dist/contracts/handlers/index.d.ts +1 -1
  32. package/dist/contracts/handlers/index.js +2 -2
  33. package/dist/{index-aZycGEsQ.d.cts → index-BtTtQFUX.d.cts} +109 -0
  34. package/dist/{index-Bxe9kBFs.d.ts → index-fDDiA1-L.d.ts} +109 -0
  35. package/dist/index.cjs +300 -268
  36. package/dist/index.d.cts +187 -13
  37. package/dist/index.d.ts +187 -13
  38. package/dist/index.js +4 -4
  39. package/dist/repositories/realm/index.cjs +19 -19
  40. package/dist/repositories/realm/index.js +5 -5
  41. package/dist/repositories/sqlite/index.cjs +18 -18
  42. package/dist/repositories/sqlite/index.js +5 -5
  43. package/dist/wallet/expo/background.cjs +14 -14
  44. package/dist/wallet/expo/background.js +6 -6
  45. package/dist/wallet/expo/index.cjs +14 -14
  46. package/dist/wallet/expo/index.js +5 -5
  47. package/dist/worker/expo/index.cjs +9 -9
  48. package/dist/worker/expo/index.js +5 -5
  49. package/package.json +1 -1
  50. package/dist/chunk-HQ2DDMQN.js.map +0 -1
  51. package/dist/chunk-LN2VZP63.js.map +0 -1
  52. package/dist/chunk-LPEE2H2M.cjs.map +0 -1
  53. package/dist/chunk-RXITDAV4.cjs.map +0 -1
  54. package/dist/chunk-WJN2BLEI.js.map +0 -1
  55. package/dist/chunk-WXCVS6PD.cjs.map +0 -1
@@ -121,6 +121,51 @@ declare namespace VHTLC {
121
121
  nonInteractiveClaim?: {
122
122
  receiverPkScript: Bytes;
123
123
  emulatorPubkey: Bytes;
124
+ /**
125
+ * OPT-IN: also require the claim to pay at least these amounts.
126
+ *
127
+ * The covenant's default bound is conservation (`out >= in`) — see
128
+ * {@link enforcePayTo} for why a quote is normally not the
129
+ * covenant's business. This is the escape hatch for a consumer that
130
+ * wants the quote enforced in script rather than at its own
131
+ * admission layer.
132
+ *
133
+ * ADDITIVE, NEVER A REPLACEMENT. The conservation bound stays. On
134
+ * its own, `out >= quoted` leaves everything ABOVE the quote
135
+ * unconstrained, so an overfunded lockup's surplus could be routed
136
+ * anywhere by whoever assembles the spend — trading an underfunding
137
+ * hole for a skimming one. Both bounds together admit neither.
138
+ *
139
+ * WHAT IT COSTS, and it is not only opcodes:
140
+ *
141
+ * - THE ADDRESS BECOMES A FUNCTION OF THE QUOTE. These amounts
142
+ * compile into the leaf, hence the emulator key, hence the
143
+ * pkScript. A re-quote is a different address, and cannot be
144
+ * applied to a lockup already funded.
145
+ * - AN UNDERFUNDED LOCKUP BECOMES UNCLAIMABLE. Its only exit is the
146
+ * refund path, which waits out the CLTV. That is the intended
147
+ * incentive and it lands on whoever misfunded — but it converts
148
+ * "claim the short amount now and settle up" into "wait for the
149
+ * timelock".
150
+ *
151
+ * Omit for the default. Omitting leaves every script byte unchanged,
152
+ * so contracts already funded keep their addresses.
153
+ */
154
+ strict?: {
155
+ /** Sats the claim must pay. Positive. */
156
+ amount: bigint;
157
+ /**
158
+ * Asset base units the claim must pay.
159
+ *
160
+ * Required iff {@link VHTLC.Options.asset} is set, and refused
161
+ * otherwise. Strict-on-sats-only against an asset-denominated
162
+ * contract would pin the sat CARRIER and say nothing about the
163
+ * asset that is the actual amount — half-enforcement that reads
164
+ * like enforcement, which is the failure this option exists to
165
+ * avoid rather than introduce.
166
+ */
167
+ assetAmount?: bigint;
168
+ };
124
169
  };
125
170
  /**
126
171
  * Optional non-interactive refund leaf: `server` + `receiver` + a
@@ -141,6 +186,54 @@ declare namespace VHTLC {
141
186
  senderPkScript: Bytes;
142
187
  emulatorPubkey: Bytes;
143
188
  };
189
+ /**
190
+ * Optional: denominate this contract in an Arkade ASSET rather than in
191
+ * sats alone.
192
+ *
193
+ * Only the two NON-INTERACTIVE leaves change. Every other leaf is a
194
+ * signature path that asserts nothing about value, so an asset makes no
195
+ * difference to them — which is why this option reaches exactly the
196
+ * leaves whose covenant the emulator enforces.
197
+ *
198
+ * When set, those covenants additionally require the output to carry at
199
+ * least the input's amount of THIS asset, and to carry exactly one
200
+ * asset. The sat clause is RETAINED, not replaced: an asset-carrying
201
+ * VTXO carries sats too, so dropping it would let a spend satisfy the
202
+ * asset covenant while stripping the sats — exactly as the sat-only
203
+ * covenant lets a spend strip the asset.
204
+ *
205
+ * ONE ASSET IS BOUND, AND ONLY THAT ONE IS PROTECTED. If a VTXO funded to
206
+ * this contract carries ADDITIONAL assets alongside the bound one, those
207
+ * are not covered: whoever assembles a covenant spend chooses where they
208
+ * go, and can send them anywhere.
209
+ *
210
+ * `INSPECTOUTASSETCOUNT == 1` does not close that. It constrains the
211
+ * covenant's OUTPUT to exactly one asset — so the extras cannot ride
212
+ * along with the bound asset — but arkd's conservation rule is satisfied
213
+ * by routing them to a different output, which the covenant says nothing
214
+ * about. The bound asset arrives; the rest is the spender's to direct.
215
+ *
216
+ * So fund an asset contract with the asset it names and nothing else. A
217
+ * multi-asset VTXO behind this covenant is a loss waiting for whoever
218
+ * pushes the spend.
219
+ *
220
+ * The id is the pair the introspection opcodes take. A canonical Asset
221
+ * ID is `(genesis txid, group index)`, never a single blob.
222
+ */
223
+ asset?: {
224
+ /**
225
+ * The asset's genesis transaction id, 32 bytes, in CANONICAL order
226
+ * — exactly the leading 32 bytes of a serialized Asset ID, no flip.
227
+ *
228
+ * The covenant reverses it internally because the introspection
229
+ * opcodes match wire order; callers never do that themselves, and a
230
+ * caller who pre-reverses gets a contract that is unspendable on its
231
+ * covenant leaves with nothing in the error naming why.
232
+ */
233
+ txid: Bytes;
234
+ /** The asset group index within that genesis transaction. */
235
+ groupIndex: number;
236
+ };
144
237
  }
145
238
  /**
146
239
  * Shared construction and accessors for every VHTLC script version. The
@@ -287,10 +380,26 @@ interface VHTLCV2ContractParams {
287
380
  unilateralClaimDelay: RelativeTimelock;
288
381
  unilateralRefundDelay: RelativeTimelock;
289
382
  unilateralRefundWithoutReceiverDelay: RelativeTimelock;
383
+ /**
384
+ * The Arkade asset the covenant leaves bind, if any.
385
+ *
386
+ * @see VHTLC.Options.asset
387
+ */
388
+ asset?: {
389
+ /** The asset's genesis txid, 32 bytes, canonical order — as the serialized Asset ID carries it. */
390
+ txid: Uint8Array;
391
+ /** The asset group index within that genesis transaction. */
392
+ groupIndex: number;
393
+ };
290
394
  /** @see VHTLC.Options.nonInteractiveClaim */
291
395
  nonInteractiveClaim?: {
292
396
  receiverPkScript: Uint8Array;
293
397
  emulatorPubkey: Uint8Array;
398
+ /** @see VHTLC.Options.nonInteractiveClaim.strict */
399
+ strict?: {
400
+ amount: bigint;
401
+ assetAmount?: bigint;
402
+ };
294
403
  };
295
404
  /** @see VHTLC.Options.nonInteractiveRefund */
296
405
  nonInteractiveRefund?: {