@arkade-os/boltz-swap 0.3.32 → 0.3.33
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 +22 -26
- package/dist/{arkade-swaps-CS8FZSVL.d.cts → arkade-swaps-9M7FRuq1.d.cts} +57 -5
- package/dist/{arkade-swaps-WiKCanCL.d.ts → arkade-swaps-DNsyWeFr.d.ts} +57 -5
- package/dist/{chunk-NHBWNN6H.js → chunk-HNQDJOLM.js} +8 -27
- package/dist/{chunk-B3Q4TFWT.js → chunk-SJ5SYSMK.js} +551 -779
- package/dist/chunk-SJQJQO7P.js +25 -0
- package/dist/expo/background.cjs +573 -805
- package/dist/expo/background.d.cts +3 -3
- package/dist/expo/background.d.ts +3 -3
- package/dist/expo/background.js +8 -20
- package/dist/expo/index.cjs +574 -783
- package/dist/expo/index.d.cts +7 -5
- package/dist/expo/index.d.ts +7 -5
- package/dist/expo/index.js +17 -20
- package/dist/index.cjs +732 -931
- package/dist/index.d.cts +80 -10
- package/dist/index.d.ts +80 -10
- package/dist/index.js +126 -115
- package/dist/repositories/realm/index.cjs +10 -22
- package/dist/repositories/realm/index.d.cts +7 -5
- package/dist/repositories/realm/index.d.ts +7 -5
- package/dist/repositories/realm/index.js +8 -22
- package/dist/repositories/sqlite/index.cjs +12 -23
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.js +10 -23
- package/dist/{swapsPollProcessor-wYOMzldd.d.ts → swapsPollProcessor-CEgeGlbP.d.ts} +3 -3
- package/dist/{swapsPollProcessor-BF3uTFae.d.cts → swapsPollProcessor-CuITxZie.d.cts} +3 -3
- package/dist/{types-BBI7-KJ0.d.cts → types-CrKkVzBB.d.cts} +9 -3
- package/dist/{types-BBI7-KJ0.d.ts → types-CrKkVzBB.d.ts} +9 -3
- package/package.json +10 -25
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-
|
|
2
|
-
export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-
|
|
1
|
+
import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-CuITxZie.cjs';
|
|
2
|
+
export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-CuITxZie.cjs';
|
|
3
3
|
import '@arkade-os/sdk/worker/expo';
|
|
4
4
|
import '@arkade-os/sdk';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-CrKkVzBB.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Define the Expo background task handler for swap polling.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-
|
|
2
|
-
export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-
|
|
1
|
+
import { D as DefineSwapBackgroundTaskOptions } from '../swapsPollProcessor-CEgeGlbP.js';
|
|
2
|
+
export { P as PersistedSwapBackgroundConfig, S as SWAP_POLL_TASK_TYPE, a as SwapTaskDependencies, s as swapsPollProcessor } from '../swapsPollProcessor-CEgeGlbP.js';
|
|
3
3
|
import '@arkade-os/sdk/worker/expo';
|
|
4
4
|
import '@arkade-os/sdk';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-CrKkVzBB.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Define the Expo background task handler for swap polling.
|
package/dist/expo/background.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SWAP_POLL_TASK_TYPE,
|
|
3
3
|
swapsPollProcessor
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-HNQDJOLM.js";
|
|
5
5
|
import {
|
|
6
6
|
BoltzSwapProvider
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-SJ5SYSMK.js";
|
|
8
|
+
import "../chunk-SJQJQO7P.js";
|
|
8
9
|
|
|
9
10
|
// src/expo/background.ts
|
|
10
11
|
import * as TaskManager from "expo-task-manager";
|
|
11
12
|
import * as BackgroundTask from "expo-background-task";
|
|
12
13
|
import { runTasks } from "@arkade-os/sdk/worker/expo";
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
ExpoIndexerProvider
|
|
16
|
-
} from "@arkade-os/sdk/adapters/expo";
|
|
17
|
-
function getRandomId() {
|
|
18
|
-
return Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
19
|
-
}
|
|
14
|
+
import { ExpoArkProvider, ExpoIndexerProvider } from "@arkade-os/sdk/adapters/expo";
|
|
15
|
+
import { getRandomId } from "@arkade-os/sdk";
|
|
20
16
|
function createBackgroundWalletShim(args) {
|
|
21
17
|
const notImplemented = (method) => {
|
|
22
18
|
throw new Error(
|
|
@@ -51,9 +47,7 @@ function defineExpoSwapBackgroundTask(taskName, options) {
|
|
|
51
47
|
}
|
|
52
48
|
const identity = await identityFactory();
|
|
53
49
|
const arkProvider = new ExpoArkProvider(config.arkServerUrl);
|
|
54
|
-
const indexerProvider = new ExpoIndexerProvider(
|
|
55
|
-
config.arkServerUrl
|
|
56
|
-
);
|
|
50
|
+
const indexerProvider = new ExpoIndexerProvider(config.arkServerUrl);
|
|
57
51
|
const swapProvider = new BoltzSwapProvider({
|
|
58
52
|
network: config.network,
|
|
59
53
|
apiUrl: config.boltzApiUrl
|
|
@@ -68,11 +62,7 @@ function defineExpoSwapBackgroundTask(taskName, options) {
|
|
|
68
62
|
const serverPubKey = hex.decode(info.signerPubkey);
|
|
69
63
|
const xOnlyServerPubKey = serverPubKey.length === 33 ? serverPubKey.slice(1) : serverPubKey;
|
|
70
64
|
const hrp = info.network === "bitcoin" ? "ark" : "tark";
|
|
71
|
-
return new ArkAddress(
|
|
72
|
-
xOnlyServerPubKey,
|
|
73
|
-
pubkey,
|
|
74
|
-
hrp
|
|
75
|
-
).encode();
|
|
65
|
+
return new ArkAddress(xOnlyServerPubKey, pubkey, hrp).encode();
|
|
76
66
|
}
|
|
77
67
|
});
|
|
78
68
|
const deps = {
|
|
@@ -86,9 +76,7 @@ function defineExpoSwapBackgroundTask(taskName, options) {
|
|
|
86
76
|
await runTasks(taskQueue, [swapsPollProcessor], deps);
|
|
87
77
|
const results = await taskQueue.getResults();
|
|
88
78
|
if (results.length > 0) {
|
|
89
|
-
await taskQueue.acknowledgeResults(
|
|
90
|
-
results.map((r) => r.id)
|
|
91
|
-
);
|
|
79
|
+
await taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
92
80
|
}
|
|
93
81
|
const existing = await taskQueue.getTasks(SWAP_POLL_TASK_TYPE);
|
|
94
82
|
if (existing.length === 0) {
|