@arkade-os/sdk 0.4.69 → 0.4.70
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/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.js +3 -3
- package/dist/adapters/indexedDB.cjs +5 -5
- package/dist/adapters/indexedDB.js +4 -4
- package/dist/{chunk-GVHUHTRH.cjs → chunk-3KW4TWP2.cjs} +17 -17
- package/dist/{chunk-GVHUHTRH.cjs.map → chunk-3KW4TWP2.cjs.map} +1 -1
- package/dist/{chunk-WIFL5QYZ.cjs → chunk-3OKEUDHU.cjs} +49 -49
- package/dist/{chunk-WIFL5QYZ.cjs.map → chunk-3OKEUDHU.cjs.map} +1 -1
- package/dist/{chunk-5MLC2HU3.cjs → chunk-57636V35.cjs} +3 -3
- package/dist/{chunk-5MLC2HU3.cjs.map → chunk-57636V35.cjs.map} +1 -1
- package/dist/{chunk-2PPL3O7Z.js → chunk-6UM55KPZ.js} +3 -3
- package/dist/{chunk-2PPL3O7Z.js.map → chunk-6UM55KPZ.js.map} +1 -1
- package/dist/{chunk-HQ4DMGA4.cjs → chunk-B73Q75IL.cjs} +10 -10
- package/dist/{chunk-HQ4DMGA4.cjs.map → chunk-B73Q75IL.cjs.map} +1 -1
- package/dist/{chunk-YG7T6LI3.js → chunk-F5E7LI6G.js} +3 -3
- package/dist/{chunk-YG7T6LI3.js.map → chunk-F5E7LI6G.js.map} +1 -1
- package/dist/{chunk-XLWDX7QZ.js → chunk-IUFTICRY.js} +4 -4
- package/dist/{chunk-XLWDX7QZ.js.map → chunk-IUFTICRY.js.map} +1 -1
- package/dist/{chunk-XQPN5YP2.cjs → chunk-JJ7AXR4O.cjs} +17 -17
- package/dist/{chunk-XQPN5YP2.cjs.map → chunk-JJ7AXR4O.cjs.map} +1 -1
- package/dist/{chunk-TA7XLEP2.js → chunk-JVHO6XHG.js} +84 -11
- package/dist/chunk-JVHO6XHG.js.map +1 -0
- package/dist/{chunk-L5SCQYHF.js → chunk-TXSF2DKX.js} +3 -3
- package/dist/{chunk-L5SCQYHF.js.map → chunk-TXSF2DKX.js.map} +1 -1
- package/dist/{chunk-MNMPGEK2.js → chunk-UG3EZDLF.js} +4 -4
- package/dist/{chunk-MNMPGEK2.js.map → chunk-UG3EZDLF.js.map} +1 -1
- package/dist/{chunk-EBYCTLET.cjs → chunk-XTCOSZ34.cjs} +519 -440
- package/dist/chunk-XTCOSZ34.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/index.cjs +315 -291
- package/dist/index.d.cts +72 -13
- package/dist/index.d.ts +72 -13
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +19 -19
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +18 -18
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +14 -14
- package/dist/wallet/expo/index.js +5 -5
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.js +5 -5
- package/package.json +2 -1
- package/dist/chunk-EBYCTLET.cjs.map +0 -1
- package/dist/chunk-TA7XLEP2.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { scriptFromArkAddress, serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
import { scriptFromArkAddress, serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-JVHO6XHG.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-JVHO6XHG.js';
|
|
3
|
+
import '../../chunk-F5E7LI6G.js';
|
|
4
|
+
import '../../chunk-6UM55KPZ.js';
|
|
5
|
+
import '../../chunk-TXSF2DKX.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
|
|
8
8
|
// src/repositories/sqlite/transaction.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
3
|
+
var chunkB73Q75IL_cjs = require('../../chunk-B73Q75IL.cjs');
|
|
4
|
+
var chunkJJ7AXR4O_cjs = require('../../chunk-JJ7AXR4O.cjs');
|
|
5
|
+
var chunkXTCOSZ34_cjs = require('../../chunk-XTCOSZ34.cjs');
|
|
6
|
+
require('../../chunk-3KW4TWP2.cjs');
|
|
7
|
+
require('../../chunk-3OKEUDHU.cjs');
|
|
8
|
+
require('../../chunk-57636V35.cjs');
|
|
9
9
|
require('../../chunk-5BLDMQED.cjs');
|
|
10
10
|
var TaskManager = require('expo-task-manager');
|
|
11
11
|
var BackgroundTask = require('expo-background-task');
|
|
@@ -36,7 +36,7 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
36
36
|
taskQueue,
|
|
37
37
|
walletRepository,
|
|
38
38
|
contractRepository,
|
|
39
|
-
processors = [
|
|
39
|
+
processors = [chunkB73Q75IL_cjs.contractPollProcessor]
|
|
40
40
|
} = options;
|
|
41
41
|
TaskManager__namespace.defineTask(taskName, async () => {
|
|
42
42
|
try {
|
|
@@ -44,24 +44,24 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
44
44
|
if (!config) {
|
|
45
45
|
return BackgroundTask__namespace.BackgroundTaskResult.Success;
|
|
46
46
|
}
|
|
47
|
-
const indexerProvider = new
|
|
48
|
-
const arkProvider = new
|
|
49
|
-
const deps =
|
|
47
|
+
const indexerProvider = new chunkJJ7AXR4O_cjs.ExpoIndexerProvider(config.arkServerUrl);
|
|
48
|
+
const arkProvider = new chunkJJ7AXR4O_cjs.ExpoArkProvider(config.arkServerUrl);
|
|
49
|
+
const deps = chunkB73Q75IL_cjs.createTaskDependencies({
|
|
50
50
|
walletRepository,
|
|
51
51
|
contractRepository,
|
|
52
52
|
indexerProvider,
|
|
53
53
|
arkProvider
|
|
54
54
|
});
|
|
55
|
-
await
|
|
55
|
+
await chunkB73Q75IL_cjs.runTasks(taskQueue, processors, deps);
|
|
56
56
|
const results = await taskQueue.getResults();
|
|
57
57
|
if (results.length > 0) {
|
|
58
58
|
await taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
59
59
|
}
|
|
60
|
-
const existing = await taskQueue.getTasks(
|
|
60
|
+
const existing = await taskQueue.getTasks(chunkB73Q75IL_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
61
61
|
if (existing.length === 0) {
|
|
62
62
|
const task = {
|
|
63
|
-
id:
|
|
64
|
-
type:
|
|
63
|
+
id: chunkXTCOSZ34_cjs.getRandomId(),
|
|
64
|
+
type: chunkB73Q75IL_cjs.CONTRACT_POLL_TASK_TYPE,
|
|
65
65
|
data: {},
|
|
66
66
|
createdAt: Date.now()
|
|
67
67
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-
|
|
2
|
-
import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-
|
|
3
|
-
import { getRandomId } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
1
|
+
import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-IUFTICRY.js';
|
|
2
|
+
import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-UG3EZDLF.js';
|
|
3
|
+
import { getRandomId } from '../../chunk-JVHO6XHG.js';
|
|
4
|
+
import '../../chunk-F5E7LI6G.js';
|
|
5
|
+
import '../../chunk-6UM55KPZ.js';
|
|
6
|
+
import '../../chunk-TXSF2DKX.js';
|
|
7
7
|
import '../../chunk-NSBPE2FW.js';
|
|
8
8
|
import * as TaskManager from 'expo-task-manager';
|
|
9
9
|
import * as BackgroundTask from 'expo-background-task';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
3
|
+
var chunkB73Q75IL_cjs = require('../../chunk-B73Q75IL.cjs');
|
|
4
|
+
var chunkXTCOSZ34_cjs = require('../../chunk-XTCOSZ34.cjs');
|
|
5
|
+
require('../../chunk-3KW4TWP2.cjs');
|
|
6
|
+
require('../../chunk-3OKEUDHU.cjs');
|
|
7
|
+
require('../../chunk-57636V35.cjs');
|
|
8
8
|
require('../../chunk-5BLDMQED.cjs');
|
|
9
9
|
var base = require('@scure/base');
|
|
10
10
|
|
|
@@ -58,18 +58,18 @@ var ExpoWallet = class _ExpoWallet {
|
|
|
58
58
|
*/
|
|
59
59
|
static async setup(config) {
|
|
60
60
|
warnOnRemovedBackgroundFields(config.background);
|
|
61
|
-
const wallet = await
|
|
62
|
-
const processors = config.background.processors ?? [
|
|
61
|
+
const wallet = await chunkXTCOSZ34_cjs.Wallet.create(config);
|
|
62
|
+
const processors = config.background.processors ?? [chunkB73Q75IL_cjs.contractPollProcessor];
|
|
63
63
|
const deps = {
|
|
64
64
|
walletRepository: wallet.walletRepository,
|
|
65
65
|
contractRepository: wallet.contractRepository,
|
|
66
66
|
indexerProvider: wallet.indexerProvider,
|
|
67
67
|
arkProvider: wallet.arkProvider,
|
|
68
|
-
extendVtxo: (vtxo, contract) =>
|
|
68
|
+
extendVtxo: (vtxo, contract) => chunkXTCOSZ34_cjs.extendVirtualCoinForContract(vtxo, contract)
|
|
69
69
|
};
|
|
70
70
|
const { taskQueue } = config.background;
|
|
71
71
|
if ("persistConfig" in taskQueue) {
|
|
72
|
-
const arkServerUrl = config.arkServerUrl ||
|
|
72
|
+
const arkServerUrl = config.arkServerUrl || chunkXTCOSZ34_cjs.extractArkProviderUrl(wallet.arkProvider);
|
|
73
73
|
if (arkServerUrl) {
|
|
74
74
|
const timelock = wallet.offchainTapscript.options.csvTimelock;
|
|
75
75
|
const bgConfig = {
|
|
@@ -100,7 +100,7 @@ var ExpoWallet = class _ExpoWallet {
|
|
|
100
100
|
}
|
|
101
101
|
async runForegroundPoll() {
|
|
102
102
|
if (this.cleared) return;
|
|
103
|
-
await
|
|
103
|
+
await chunkB73Q75IL_cjs.runTasks(this.taskQueue, this.processors, this.deps);
|
|
104
104
|
const results = await this.taskQueue.getResults();
|
|
105
105
|
if (results.length > 0) {
|
|
106
106
|
await this.taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
@@ -109,18 +109,18 @@ var ExpoWallet = class _ExpoWallet {
|
|
|
109
109
|
await this.seedContractPollTask();
|
|
110
110
|
}
|
|
111
111
|
async seedContractPollTask() {
|
|
112
|
-
const existing = await this.taskQueue.getTasks(
|
|
112
|
+
const existing = await this.taskQueue.getTasks(chunkB73Q75IL_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
113
113
|
if (existing.length > 0) return;
|
|
114
114
|
const task = {
|
|
115
|
-
id:
|
|
116
|
-
type:
|
|
115
|
+
id: chunkXTCOSZ34_cjs.getRandomId(),
|
|
116
|
+
type: chunkB73Q75IL_cjs.CONTRACT_POLL_TASK_TYPE,
|
|
117
117
|
data: {},
|
|
118
118
|
createdAt: Date.now()
|
|
119
119
|
};
|
|
120
120
|
await this.taskQueue.addTask(task);
|
|
121
121
|
}
|
|
122
122
|
async removeContractPollTasks() {
|
|
123
|
-
const tasks = await this.taskQueue.getTasks(
|
|
123
|
+
const tasks = await this.taskQueue.getTasks(chunkB73Q75IL_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
124
124
|
for (const task of tasks) {
|
|
125
125
|
await this.taskQueue.removeTask(task.id);
|
|
126
126
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { contractPollProcessor, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-
|
|
2
|
-
import { Wallet, extractArkProviderUrl, getRandomId, extendVirtualCoinForContract } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
import { contractPollProcessor, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-IUFTICRY.js';
|
|
2
|
+
import { Wallet, extractArkProviderUrl, getRandomId, extendVirtualCoinForContract } from '../../chunk-JVHO6XHG.js';
|
|
3
|
+
import '../../chunk-F5E7LI6G.js';
|
|
4
|
+
import '../../chunk-6UM55KPZ.js';
|
|
5
|
+
import '../../chunk-TXSF2DKX.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
import { hex } from '@scure/base';
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
3
|
+
var chunkB73Q75IL_cjs = require('../../chunk-B73Q75IL.cjs');
|
|
4
|
+
require('../../chunk-XTCOSZ34.cjs');
|
|
5
|
+
require('../../chunk-3KW4TWP2.cjs');
|
|
6
|
+
require('../../chunk-3OKEUDHU.cjs');
|
|
7
|
+
require('../../chunk-57636V35.cjs');
|
|
8
8
|
require('../../chunk-5BLDMQED.cjs');
|
|
9
9
|
|
|
10
10
|
// src/worker/expo/taskQueue.ts
|
|
@@ -121,19 +121,19 @@ var AsyncStorageTaskQueue = class {
|
|
|
121
121
|
|
|
122
122
|
Object.defineProperty(exports, "CONTRACT_POLL_TASK_TYPE", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkB73Q75IL_cjs.CONTRACT_POLL_TASK_TYPE; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "contractPollProcessor", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkB73Q75IL_cjs.contractPollProcessor; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "createTaskDependencies", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkB73Q75IL_cjs.createTaskDependencies; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "runTasks", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkB73Q75IL_cjs.runTasks; }
|
|
137
137
|
});
|
|
138
138
|
exports.AsyncStorageTaskQueue = AsyncStorageTaskQueue;
|
|
139
139
|
exports.InMemoryTaskQueue = InMemoryTaskQueue;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { CONTRACT_POLL_TASK_TYPE, contractPollProcessor, createTaskDependencies, runTasks } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
export { CONTRACT_POLL_TASK_TYPE, contractPollProcessor, createTaskDependencies, runTasks } from '../../chunk-IUFTICRY.js';
|
|
2
|
+
import '../../chunk-JVHO6XHG.js';
|
|
3
|
+
import '../../chunk-F5E7LI6G.js';
|
|
4
|
+
import '../../chunk-6UM55KPZ.js';
|
|
5
|
+
import '../../chunk-TXSF2DKX.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
|
|
8
8
|
// src/worker/expo/taskQueue.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkade-os/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.70",
|
|
4
4
|
"description": "TypeScript SDK for building Bitcoin wallets using the Arkade protocol",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -206,6 +206,7 @@
|
|
|
206
206
|
"build": "tsup",
|
|
207
207
|
"smoke:dist": "node scripts/smoke-dist.mjs",
|
|
208
208
|
"typecheck": "tsc --noEmit",
|
|
209
|
+
"typecheck:types": "tsc -p tsconfig.typecheck.json --noEmit",
|
|
209
210
|
"check:vtxo": "node scripts/check-virtual-status.mjs && node scripts/check-provider-boundary.mjs",
|
|
210
211
|
"docs:build": "pnpm run typecheck && pnpm typedoc",
|
|
211
212
|
"docs:open": "open ../../docs/index.html",
|