@arkade-os/swap 0.1.0-rc.2 → 0.1.0-rc.21

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 (54) hide show
  1. package/README.md +52 -2
  2. package/dist/advanced.cjs +8376 -0
  3. package/dist/advanced.d.cts +550 -0
  4. package/dist/advanced.d.ts +550 -0
  5. package/dist/advanced.js +451 -0
  6. package/dist/chunk-A3SHHRX4.js +104 -0
  7. package/dist/chunk-HUQQVBC4.js +4262 -0
  8. package/dist/{chunk-EOYGUCDM.js → chunk-ITFCQWPG.js} +755 -1382
  9. package/dist/chunk-PVB7EBAM.js +2517 -0
  10. package/dist/errors-C3h8ANmE.d.ts +1560 -0
  11. package/dist/errors-hm7aqnRM.d.cts +1560 -0
  12. package/dist/index.cjs +4861 -3988
  13. package/dist/index.d.cts +69 -2812
  14. package/dist/index.d.ts +69 -2812
  15. package/dist/index.js +179 -3719
  16. package/dist/lockupContract-5r5RlgOJ.d.cts +137 -0
  17. package/dist/lockupContract-5r5RlgOJ.d.ts +137 -0
  18. package/dist/node/index.cjs +61 -10
  19. package/dist/node/index.d.cts +249 -591
  20. package/dist/node/index.d.ts +249 -591
  21. package/dist/node/index.js +65 -10
  22. package/dist/nostr.cjs +191 -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-Bd9Yvd8Z.d.ts +261 -0
  27. package/dist/offer-F88rtL_I.d.cts +261 -0
  28. package/dist/protocol.cjs +4086 -3706
  29. package/dist/protocol.d.cts +163 -768
  30. package/dist/protocol.d.ts +163 -768
  31. package/dist/protocol.js +190 -173
  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-BuYWGAKz.d.cts +2261 -0
  41. package/dist/repository-DYnRLPt-.d.ts +2261 -0
  42. package/dist/rfq-60PGpQ_x.d.cts +950 -0
  43. package/dist/rfq-60PGpQ_x.d.ts +950 -0
  44. package/dist/watch-BTyiBLSd.d.ts +74 -0
  45. package/dist/watch-M_KY-5ho.d.cts +74 -0
  46. package/package.json +20 -10
  47. package/dist/chunk-LYCMM3VB.js +0 -1357
  48. package/dist/chunk-U7VWWTL6.js +0 -66
  49. package/dist/repository-_zU9_pM3.d.cts +0 -3426
  50. package/dist/repository-kO95noyv.d.ts +0 -3426
  51. package/dist/rfq-DdBV4JO5.d.cts +0 -1097
  52. package/dist/rfq-DdBV4JO5.d.ts +0 -1097
  53. package/dist/watch-CQqvwgwY.d.cts +0 -96
  54. package/dist/watch-wMbmfN4p.d.ts +0 -96
@@ -1,66 +0,0 @@
1
- // src/repository.ts
2
- var marketsCacheKey = (network, registry) => `arkade-intents-markets-${network}-${registry}`;
3
- var InMemoryAssetSwapRepository = class {
4
- version = 5;
5
- swaps = /* @__PURE__ */ new Map();
6
- records = /* @__PURE__ */ new Map();
7
- rfqSwaps = /* @__PURE__ */ new Map();
8
- scanned = /* @__PURE__ */ new Set();
9
- markets = /* @__PURE__ */ new Map();
10
- async saveSwap(swap) {
11
- this.swaps.set(swap.id, swap);
12
- }
13
- async getAllSwaps() {
14
- return [...this.swaps.values()];
15
- }
16
- async saveRfqSwap(record) {
17
- this.rfqSwaps.set(record.rfqId, record);
18
- }
19
- async getRfqSwap(rfqId) {
20
- return this.rfqSwaps.get(rfqId);
21
- }
22
- async getAllRfqSwaps() {
23
- return [...this.rfqSwaps.values()];
24
- }
25
- async removeRfqSwap(rfqId) {
26
- this.rfqSwaps.delete(rfqId);
27
- }
28
- async saveSwapRecord(record) {
29
- this.records.set(record.id, record);
30
- }
31
- async getSwapRecord(id) {
32
- return this.records.get(id);
33
- }
34
- async getAllSwapRecords() {
35
- return [...this.records.values()];
36
- }
37
- async removeSwapRecord(id) {
38
- this.records.delete(id);
39
- }
40
- async getScannedTxids() {
41
- return new Set(this.scanned);
42
- }
43
- async markTxidsScanned(txids) {
44
- for (const txid of txids) this.scanned.add(txid);
45
- }
46
- async getCachedMarkets(network, registry) {
47
- return this.markets.get(marketsCacheKey(network, registry));
48
- }
49
- async saveCachedMarkets(network, registry, entry) {
50
- this.markets.set(marketsCacheKey(network, registry), entry);
51
- }
52
- async clear() {
53
- this.swaps.clear();
54
- this.rfqSwaps.clear();
55
- this.records.clear();
56
- this.scanned.clear();
57
- this.markets.clear();
58
- }
59
- async [Symbol.asyncDispose]() {
60
- }
61
- };
62
-
63
- export {
64
- marketsCacheKey,
65
- InMemoryAssetSwapRepository
66
- };