@arkade-os/swap 0.1.0-rc.13 → 0.1.0-rc.15

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 (53) hide show
  1. package/README.md +11 -0
  2. package/dist/advanced.cjs +1028 -1006
  3. package/dist/advanced.d.cts +145 -279
  4. package/dist/advanced.d.ts +145 -279
  5. package/dist/advanced.js +14 -8
  6. package/dist/{chunk-SC3SAY3X.js → chunk-4WPDXLXH.js} +501 -271
  7. package/dist/chunk-A3SHHRX4.js +104 -0
  8. package/dist/{chunk-KRXPQQJ7.js → chunk-BBP25BWH.js} +198 -218
  9. package/dist/{chunk-ZDFMD4FA.js → chunk-RX3WPV5D.js} +356 -584
  10. package/dist/errors-BcOgFV-F.d.ts +1559 -0
  11. package/dist/errors-n6IHTG-Z.d.cts +1559 -0
  12. package/dist/index.cjs +1406 -1331
  13. package/dist/index.d.cts +69 -186
  14. package/dist/index.d.ts +69 -186
  15. package/dist/index.js +102 -158
  16. package/dist/lockupContract-B_jNbjrG.d.ts +215 -0
  17. package/dist/lockupContract-ZsftgqMc.d.cts +215 -0
  18. package/dist/node/index.cjs +61 -10
  19. package/dist/node/index.d.cts +227 -600
  20. package/dist/node/index.d.ts +227 -600
  21. package/dist/node/index.js +65 -10
  22. package/dist/nostr.cjs +11 -11
  23. package/dist/nostr.d.cts +23 -68
  24. package/dist/nostr.d.ts +23 -68
  25. package/dist/nostr.js +3 -4
  26. package/dist/offer--1zVkNsV.d.ts +261 -0
  27. package/dist/offer-DsP1q6GE.d.cts +261 -0
  28. package/dist/protocol.cjs +747 -1012
  29. package/dist/protocol.d.cts +120 -255
  30. package/dist/protocol.d.ts +120 -255
  31. package/dist/protocol.js +146 -149
  32. package/dist/repositories/realm/index.cjs +55 -11
  33. package/dist/repositories/realm/index.d.cts +18 -30
  34. package/dist/repositories/realm/index.d.ts +18 -30
  35. package/dist/repositories/realm/index.js +49 -12
  36. package/dist/repositories/sqlite/index.cjs +61 -10
  37. package/dist/repositories/sqlite/index.d.cts +7 -6
  38. package/dist/repositories/sqlite/index.d.ts +7 -6
  39. package/dist/repositories/sqlite/index.js +57 -11
  40. package/dist/repository-BY6GUQiW.d.ts +2233 -0
  41. package/dist/repository-C32GKpR5.d.cts +2233 -0
  42. package/dist/{rfq-BWE8qkV2.d.ts → rfq-60PGpQ_x.d.cts} +178 -408
  43. package/dist/{rfq-BWE8qkV2.d.cts → rfq-60PGpQ_x.d.ts} +178 -408
  44. package/dist/{watch-D8Z78RAV.d.ts → watch-Cejw5cNQ.d.cts} +12 -30
  45. package/dist/{watch-C4ReJR5z.d.cts → watch-D8uzWrHc.d.ts} +12 -30
  46. package/package.json +2 -2
  47. package/dist/chunk-U7VWWTL6.js +0 -66
  48. package/dist/errors-LXMcNhNS.d.ts +0 -2222
  49. package/dist/errors-XUs8r0LT.d.cts +0 -2222
  50. package/dist/lockupContract-BhMebZCb.d.cts +0 -650
  51. package/dist/lockupContract-CAiN97fX.d.ts +0 -650
  52. package/dist/repository-BJLuVFQ0.d.ts +0 -3436
  53. package/dist/repository-DsR3b0JJ.d.cts +0 -3436
package/dist/advanced.js CHANGED
@@ -67,6 +67,7 @@ import {
67
67
  familyOfSwapId,
68
68
  fateMoved,
69
69
  feedFetch,
70
+ feedSpread,
70
71
  formatAssetId,
71
72
  fromAtomicDecimal,
72
73
  fromRfqAmountSide,
@@ -122,7 +123,10 @@ import {
122
123
  toRfqAmountSide,
123
124
  toSafeNumber,
124
125
  usableMarkets,
126
+ verifiedCarrierSats,
127
+ verifyCrossAssetAmount,
125
128
  verifyPair,
129
+ verifyPlanLegs,
126
130
  verifyQuoteTtl,
127
131
  verifyQuotedAmount,
128
132
  verifyReceiveInvoiceFacts,
@@ -135,7 +139,7 @@ import {
135
139
  withCanonicalAmount,
136
140
  withDepositFate,
137
141
  withRfqState
138
- } from "./chunk-SC3SAY3X.js";
142
+ } from "./chunk-4WPDXLXH.js";
139
143
  import {
140
144
  ACTIVITY_TOKEN,
141
145
  CORRIDOR_PASS,
@@ -150,16 +154,16 @@ import {
150
154
  onchainCorridor,
151
155
  readsChain,
152
156
  recordOutcome
153
- } from "./chunk-ZDFMD4FA.js";
157
+ } from "./chunk-RX3WPV5D.js";
154
158
  import {
155
159
  SwapRefusal,
160
+ assertPreimageMatches,
156
161
  sealClaimPacket
157
- } from "./chunk-KRXPQQJ7.js";
162
+ } from "./chunk-BBP25BWH.js";
163
+ import "./chunk-A3SHHRX4.js";
158
164
 
159
165
  // src/reveal.ts
160
166
  import { base64, hex } from "@scure/base";
161
- import { ripemd160 } from "@noble/hashes/legacy.js";
162
- import { sha256 } from "@noble/hashes/sha2.js";
163
167
  import { ArkAddress } from "@arkade-os/sdk";
164
168
  var CovclaimdRevealError = class extends Error {
165
169
  name = "CovclaimdRevealError";
@@ -267,9 +271,7 @@ async function revealClaimPacket(client, input) {
267
271
  if (hex.encode(ArkAddress.decode(input.address).pkScript) !== hex.encode(input.script.pkScript)) {
268
272
  throw new Error("address does not belong to this covenant");
269
273
  }
270
- if (hex.encode(ripemd160(sha256(input.preimage))) !== hex.encode(input.script.options.preimageHash)) {
271
- throw new Error("preimage does not match the covenant's payment hash");
272
- }
274
+ assertPreimageMatches(input.preimage, input.script.options.preimageHash);
273
275
  const { ciphertext } = await sealClaimPacket({
274
276
  preimage: input.preimage,
275
277
  covclaimdPubkey: (await client.info()).covclaimdPubkey
@@ -356,6 +358,7 @@ export {
356
358
  familyOfSwapId,
357
359
  fateMoved,
358
360
  feedFetch,
361
+ feedSpread,
359
362
  formatAssetId,
360
363
  fromAtomicDecimal,
361
364
  fromRfqAmountSide,
@@ -419,7 +422,10 @@ export {
419
422
  toRfqAmountSide,
420
423
  toSafeNumber,
421
424
  usableMarkets,
425
+ verifiedCarrierSats,
426
+ verifyCrossAssetAmount,
422
427
  verifyPair,
428
+ verifyPlanLegs,
423
429
  verifyQuoteTtl,
424
430
  verifyQuotedAmount,
425
431
  verifyReceiveInvoiceFacts,