@arkade-os/swap 0.0.12 → 0.1.0-rc.1

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.
@@ -1,8 +1,9 @@
1
1
  // src/repository.ts
2
2
  var marketsCacheKey = (network, registry) => `arkade-intents-markets-${network}-${registry}`;
3
3
  var InMemoryAssetSwapRepository = class {
4
- version = 4;
4
+ version = 5;
5
5
  swaps = /* @__PURE__ */ new Map();
6
+ records = /* @__PURE__ */ new Map();
6
7
  rfqSwaps = /* @__PURE__ */ new Map();
7
8
  scanned = /* @__PURE__ */ new Set();
8
9
  markets = /* @__PURE__ */ new Map();
@@ -24,6 +25,18 @@ var InMemoryAssetSwapRepository = class {
24
25
  async removeRfqSwap(rfqId) {
25
26
  this.rfqSwaps.delete(rfqId);
26
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
+ }
27
40
  async getScannedTxids() {
28
41
  return new Set(this.scanned);
29
42
  }
@@ -39,6 +52,7 @@ var InMemoryAssetSwapRepository = class {
39
52
  async clear() {
40
53
  this.swaps.clear();
41
54
  this.rfqSwaps.clear();
55
+ this.records.clear();
42
56
  this.scanned.clear();
43
57
  this.markets.clear();
44
58
  }