@arkade-os/swap 0.0.7 → 0.0.9
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.
- package/README.md +276 -12
- package/dist/{chunk-ZDTRQZE2.js → chunk-2FEMUOIH.js} +83 -57
- package/dist/{chunk-WGRU2DBF.js → chunk-6ZUS47GA.js} +15 -1
- package/dist/index.cjs +1155 -443
- package/dist/index.d.cts +293 -1140
- package/dist/index.d.ts +293 -1140
- package/dist/index.js +761 -87
- package/dist/nostr.cjs +1 -0
- package/dist/nostr.d.cts +1 -1
- package/dist/nostr.d.ts +1 -1
- package/dist/nostr.js +1 -1
- package/dist/repositories/realm/index.cjs +49 -5
- package/dist/repositories/realm/index.d.cts +28 -6
- package/dist/repositories/realm/index.d.ts +28 -6
- package/dist/repositories/realm/index.js +50 -6
- package/dist/repositories/sqlite/index.cjs +45 -4
- package/dist/repositories/sqlite/index.d.cts +20 -7
- package/dist/repositories/sqlite/index.d.ts +20 -7
- package/dist/repositories/sqlite/index.js +46 -5
- package/dist/repository-DEHLtD9l.d.cts +1862 -0
- package/dist/repository-DIAr5XYk.d.ts +1862 -0
- package/dist/{rfq-DfT9dAss.d.cts → rfq-hbzhTWHT.d.cts} +71 -3
- package/dist/{rfq-DfT9dAss.d.ts → rfq-hbzhTWHT.d.ts} +71 -3
- package/package.json +3 -2
- package/dist/repository-BwnZ8N62.d.cts +0 -236
- package/dist/repository-BwnZ8N62.d.ts +0 -236
|
@@ -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
|
+
version = 4;
|
|
5
5
|
swaps = /* @__PURE__ */ new Map();
|
|
6
|
+
rfqSwaps = /* @__PURE__ */ new Map();
|
|
6
7
|
scanned = /* @__PURE__ */ new Set();
|
|
7
8
|
markets = /* @__PURE__ */ new Map();
|
|
8
9
|
async saveSwap(swap) {
|
|
@@ -11,6 +12,18 @@ var InMemoryAssetSwapRepository = class {
|
|
|
11
12
|
async getAllSwaps() {
|
|
12
13
|
return [...this.swaps.values()];
|
|
13
14
|
}
|
|
15
|
+
async saveRfqSwap(record) {
|
|
16
|
+
this.rfqSwaps.set(record.rfqId, record);
|
|
17
|
+
}
|
|
18
|
+
async getRfqSwap(rfqId) {
|
|
19
|
+
return this.rfqSwaps.get(rfqId);
|
|
20
|
+
}
|
|
21
|
+
async getAllRfqSwaps() {
|
|
22
|
+
return [...this.rfqSwaps.values()];
|
|
23
|
+
}
|
|
24
|
+
async removeRfqSwap(rfqId) {
|
|
25
|
+
this.rfqSwaps.delete(rfqId);
|
|
26
|
+
}
|
|
14
27
|
async getScannedTxids() {
|
|
15
28
|
return new Set(this.scanned);
|
|
16
29
|
}
|
|
@@ -25,6 +38,7 @@ var InMemoryAssetSwapRepository = class {
|
|
|
25
38
|
}
|
|
26
39
|
async clear() {
|
|
27
40
|
this.swaps.clear();
|
|
41
|
+
this.rfqSwaps.clear();
|
|
28
42
|
this.scanned.clear();
|
|
29
43
|
this.markets.clear();
|
|
30
44
|
}
|