@arkade-os/sdk 0.5.5 → 0.5.6
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 +6 -6
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +3 -3
- package/dist/{asyncStorageTaskQueue-BbH-THYJ.d.cts → asyncStorageTaskQueue-Bh2n0msM.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-BlvkJyTa.d.ts → asyncStorageTaskQueue-CpkstKZ5.d.ts} +2 -2
- package/dist/{chunk-BCA6D255.js → chunk-47Z4LEIW.js} +3 -3
- package/dist/{chunk-BCA6D255.js.map → chunk-47Z4LEIW.js.map} +1 -1
- package/dist/{chunk-HQQ4NRXI.cjs → chunk-4X67IB2V.cjs} +15 -15
- package/dist/{chunk-HQQ4NRXI.cjs.map → chunk-4X67IB2V.cjs.map} +1 -1
- package/dist/{chunk-7GIKLFHC.js → chunk-C7NY6WSA.js} +3 -3
- package/dist/{chunk-7GIKLFHC.js.map → chunk-C7NY6WSA.js.map} +1 -1
- package/dist/{chunk-CE46RS6L.js → chunk-DJYX73W2.js} +4 -4
- package/dist/{chunk-CE46RS6L.js.map → chunk-DJYX73W2.js.map} +1 -1
- package/dist/{chunk-XWUCNMPN.cjs → chunk-HKEPJBTY.cjs} +16 -16
- package/dist/{chunk-XWUCNMPN.cjs.map → chunk-HKEPJBTY.cjs.map} +1 -1
- package/dist/{chunk-KCL5AVML.cjs → chunk-LZAINCGU.cjs} +3 -3
- package/dist/{chunk-KCL5AVML.cjs.map → chunk-LZAINCGU.cjs.map} +1 -1
- package/dist/{chunk-AMH7Q3DF.cjs → chunk-NDQ4LB4X.cjs} +8 -8
- package/dist/{chunk-AMH7Q3DF.cjs.map → chunk-NDQ4LB4X.cjs.map} +1 -1
- package/dist/{chunk-4I53THL6.js → chunk-QTMK34TP.js} +3 -3
- package/dist/{chunk-4I53THL6.js.map → chunk-QTMK34TP.js.map} +1 -1
- package/dist/{chunk-FVVXCDNE.js → chunk-VWW2ZBPI.js} +4 -4
- package/dist/{chunk-FVVXCDNE.js.map → chunk-VWW2ZBPI.js.map} +1 -1
- package/dist/{chunk-T254PXSN.cjs → chunk-Y3CDDPWI.cjs} +454 -443
- package/dist/chunk-Y3CDDPWI.cjs.map +1 -0
- package/dist/{chunk-OO2KEK64.js → chunk-YKT4NAQG.js} +45 -34
- package/dist/chunk-YKT4NAQG.js.map +1 -0
- package/dist/{chunk-5SYUEVJH.cjs → chunk-YS76JSGP.cjs} +10 -10
- package/dist/{chunk-5SYUEVJH.cjs.map → chunk-YS76JSGP.cjs.map} +1 -1
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.d.cts +2 -2
- package/dist/contracts/handlers/index.d.ts +2 -2
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{index-Bx-iArDs.d.ts → index-2wKMrT0a.d.ts} +1 -1
- package/dist/{index-BWwVnJhU.d.cts → index-46g577Ka.d.cts} +1 -1
- package/dist/{index-DCml4QJn.d.ts → index-C66rjxz2.d.ts} +25 -25
- package/dist/{index-DkyzIzKL.d.cts → index-Dqk07NwJ.d.cts} +25 -25
- package/dist/index.cjs +311 -311
- package/dist/index.d.cts +23 -23
- package/dist/index.d.ts +23 -23
- package/dist/index.js +4 -4
- package/dist/{keyringDescriptorProvider-CS4w4PWd.d.ts → keyringDescriptorProvider-DiBM4GmB.d.ts} +9 -9
- package/dist/{keyringDescriptorProvider-CmHXrIXd.d.cts → keyringDescriptorProvider-DnaLUC7v.d.cts} +9 -9
- package/dist/repositories/realm/index.cjs +37 -37
- package/dist/repositories/realm/index.cjs.map +1 -1
- package/dist/repositories/realm/index.d.cts +6 -6
- package/dist/repositories/realm/index.d.ts +6 -6
- package/dist/repositories/realm/index.js +6 -6
- package/dist/repositories/realm/index.js.map +1 -1
- package/dist/repositories/sqlite/index.cjs +35 -35
- package/dist/repositories/sqlite/index.cjs.map +1 -1
- package/dist/repositories/sqlite/index.d.cts +6 -6
- package/dist/repositories/sqlite/index.d.ts +6 -6
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/repositories/sqlite/index.js.map +1 -1
- package/dist/{taskRunner-DgMLSk_O.d.ts → taskRunner-BM6IAKlS.d.ts} +2 -2
- package/dist/{taskRunner-buh6aFpG.d.cts → taskRunner-BmDIZiSl.d.cts} +2 -2
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +15 -15
- package/dist/wallet/expo/index.cjs.map +1 -1
- package/dist/wallet/expo/index.d.cts +6 -6
- package/dist/wallet/expo/index.d.ts +6 -6
- package/dist/wallet/expo/index.js +5 -5
- package/dist/wallet/expo/index.js.map +1 -1
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-OO2KEK64.js.map +0 -1
- package/dist/chunk-T254PXSN.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkY3CDDPWI_cjs = require('./chunk-Y3CDDPWI.cjs');
|
|
4
|
+
var chunkLZAINCGU_cjs = require('./chunk-LZAINCGU.cjs');
|
|
5
5
|
|
|
6
6
|
// src/worker/expo/taskRunner.ts
|
|
7
7
|
async function runTasks(queue, processors, deps) {
|
|
@@ -33,7 +33,7 @@ async function runTasks(queue, processors, deps) {
|
|
|
33
33
|
}
|
|
34
34
|
const result = {
|
|
35
35
|
...partial,
|
|
36
|
-
id:
|
|
36
|
+
id: chunkY3CDDPWI_cjs.getRandomId(),
|
|
37
37
|
executedAt: Date.now()
|
|
38
38
|
};
|
|
39
39
|
await queue.pushResult(result);
|
|
@@ -45,7 +45,7 @@ async function runTasks(queue, processors, deps) {
|
|
|
45
45
|
function createTaskDependencies(options) {
|
|
46
46
|
return {
|
|
47
47
|
...options,
|
|
48
|
-
extendVtxo: (vtxo, contract) =>
|
|
48
|
+
extendVtxo: (vtxo, contract) => chunkY3CDDPWI_cjs.extendVirtualCoinForContract(vtxo, contract)
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ var contractPollProcessor = {
|
|
|
55
55
|
taskType: CONTRACT_POLL_TASK_TYPE,
|
|
56
56
|
async execute(item, deps) {
|
|
57
57
|
const { contractRepository, walletRepository, indexerProvider, extendVtxo } = deps;
|
|
58
|
-
const contracts = await
|
|
58
|
+
const contracts = await chunkY3CDDPWI_cjs.collectContracts(contractRepository, {
|
|
59
59
|
watch: ["watched", "awaiting-funds"]
|
|
60
60
|
});
|
|
61
61
|
let contractsProcessed = 0;
|
|
@@ -66,7 +66,7 @@ var contractPollProcessor = {
|
|
|
66
66
|
let hasMore = true;
|
|
67
67
|
const allVtxos = [];
|
|
68
68
|
while (hasMore) {
|
|
69
|
-
const { vtxos, page } = await
|
|
69
|
+
const { vtxos, page } = await chunkLZAINCGU_cjs.getNormalizedVtxos(indexerProvider, {
|
|
70
70
|
scripts: [contract.script],
|
|
71
71
|
pageIndex,
|
|
72
72
|
pageSize
|
|
@@ -77,12 +77,12 @@ var contractPollProcessor = {
|
|
|
77
77
|
hasMore = page ? vtxos.length === pageSize : false;
|
|
78
78
|
pageIndex++;
|
|
79
79
|
}
|
|
80
|
-
const filtered =
|
|
80
|
+
const filtered = chunkY3CDDPWI_cjs.warnAndFilterVtxosForScript(
|
|
81
81
|
allVtxos,
|
|
82
82
|
contract.script,
|
|
83
83
|
"contractPollProcessor"
|
|
84
84
|
);
|
|
85
|
-
await
|
|
85
|
+
await chunkY3CDDPWI_cjs.saveVtxosForContract(walletRepository, contract, filtered);
|
|
86
86
|
vtxosSaved += filtered.length;
|
|
87
87
|
contractsProcessed++;
|
|
88
88
|
}
|
|
@@ -99,5 +99,5 @@ exports.CONTRACT_POLL_TASK_TYPE = CONTRACT_POLL_TASK_TYPE;
|
|
|
99
99
|
exports.contractPollProcessor = contractPollProcessor;
|
|
100
100
|
exports.createTaskDependencies = createTaskDependencies;
|
|
101
101
|
exports.runTasks = runTasks;
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
103
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-YS76JSGP.cjs.map
|
|
103
|
+
//# sourceMappingURL=chunk-YS76JSGP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/worker/expo/taskRunner.ts","../src/worker/expo/processors/contractPollProcessor.ts"],"names":["getRandomId","extendVirtualCoinForContract","collectContracts","getNormalizedVtxos","warnAndFilterVtxosForScript","saveVtxosForContract"],"mappings":";;;;;;AAkDA,eAAsB,QAAA,CAClB,KAAA,EACA,UAAA,EACA,IAAA,EACqB;AACrB,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,QAAA,EAAS;AACnC,EAAA,MAAM,YAAA,GAAe,IAAI,GAAA,CAAI,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,QAAA,EAAU,CAAC,CAAC,CAAC,CAAA;AACnE,EAAA,MAAM,UAAwB,EAAC;AAE/B,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACtB,IAAA,MAAM,SAAA,GAAY,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAE5C,IAAA,IAAI,OAAA;AAEJ,IAAA,IAAI,CAAC,SAAA,EAAW;AACZ,MAAA,OAAA,GAAU;AAAA,QACN,YAAY,IAAA,CAAK,EAAA;AAAA,QACjB,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,MAAA,EAAQ;AAAA,OACZ;AAAA,IACJ,CAAA,MAAO;AACH,MAAA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ent":["import type { TaskItem, TaskResult, TaskQueue } from \"./taskQueue\";\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { IndexerProvider } from \"../../providers/indexer\";\nimport type { OperatorProvider } from \"../../providers/ark\";\nimport type { ExtendedVirtualCoin, VirtualCoin } from \"../../wallet\";\nimport type { Contract } from \"../../contracts/types\";\nimport { getRandomId, extendVirtualCoinForContract } from \"../../wallet/utils\";\n\n/**\n * Shared dependencies injected into every processor at runtime.\n *\n * `extendVtxo` requires the owning contract — processors must resolve each\n * vtxo's `script` to a known contract (via the contract repository) before\n * calling this. The strict signature prevents the footgun where a missing\n * contract silently falls back to the wallet's default tapscript.\n */\nexport interface TaskDependencies {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: OperatorProvider;\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) => ExtendedVirtualCoin;\n}\n\n/**\n * A stateless unit that handles one type of task item.\n *\n * Processors must not keep in-memory state across invocations —\n * all coordination lives in the @see TaskQueue and repositories.\n *\n * The `TDeps` parameter defaults to @see TaskDependencies but\n * can be overridden for domain-specific processors (e.g. swap processing).\n */\nexport interface TaskProcessor<TDeps = TaskDependencies> {\n readonly taskType: string;\n execute(item: TaskItem, deps: TDeps): Promise<Omit<TaskResult, \"id\" | \"executedAt\">>;\n}\n\n/**\n * Run all pending tasks from the queue through matching processors.\n *\n * For each task in the inbox:\n * 1. Find the processor whose `taskType` matches `task.type`.\n * 2. Execute it, producing a @see TaskResult.\n * 3. Push the result to the outbox and remove the task from the inbox.\n *\n * Tasks with no matching processor produce a `\"noop\"` result.\n * Processor errors produce a `\"failed\"` result with the error message.\n */\nexport async function runTasks<TDeps = TaskDependencies>(\n queue: TaskQueue,\n processors: TaskProcessor<TDeps>[],\n deps: TDeps,\n): Promise<TaskResult[]> {\n const tasks = await queue.getTasks();\n const processorMap = new Map(processors.map((p) => [p.taskType, p]));\n const results: TaskResult[] = [];\n\n for (const task of tasks) {\n const processor = processorMap.get(task.type);\n\n let partial: Omit<TaskResult, \"id\" | \"executedAt\">;\n\n if (!processor) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"noop\",\n };\n } else {\n try {\n partial = await processor.execute(task, deps);\n } catch (error) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"failed\",\n data: {\n error: error instanceof Error ? error.message : String(error),\n },\n };\n }\n }\n\n const result: TaskResult = {\n ...partial,\n id: getRandomId(),\n executedAt: Date.now(),\n };\n\n await queue.pushResult(result);\n await queue.removeTask(task.id);\n results.push(result);\n }\n\n return results;\n}\n\n/**\n * Options for @see createTaskDependencies.\n */\nexport interface CreateTaskDependenciesOptions {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: OperatorProvider;\n}\n\n/**\n * Build the @see TaskDependencies needed by task processors\n * (e.g. `src/worker/expo/processors/contractPollProcessor.ts`)\n *\n * This is the same construction that `defineExpoBackgroundTask` does\n * internally, extracted so that consumers with custom schedulers\n * (e.g. bare React Native with `react-native-background-fetch`)\n * can build deps without depending on Expo.\n */\nexport function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies {\n return {\n ...options,\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) =>\n extendVirtualCoinForContract(vtxo, contract),\n };\n}\n","import { collectContracts } from \"../../../repositories/contractRepository\";\nimport type { TaskItem, TaskResult } from \"../taskQueue\";\nimport type { TaskProcessor, TaskDependencies } from \"../taskRunner\";\nimport type { ExtendedVirtualCoin } from \"../../../wallet\";\nimport { getNormalizedVtxos } from \"../../../wallet/vtxo\";\nimport {\n warnAndFilterVtxosForScript,\n saveVtxosForContract,\n} from \"../../../contracts/vtxoOwnership\";\n\nexport const CONTRACT_POLL_TASK_TYPE = \"contract-poll\";\n\n/**\n * Polls the indexer for the latest VTXO state of every contract and\n * persists the results to the wallet repository.\n *\n * Replicates the polling subset of @see ContractManager.initialize:\n * 1. Load every watched contract from the contract repository.\n * 2. Paginated fetch of every VTXO (including spent) from the indexer.\n * 3. Extend each VTXO with tapscript data.\n * 4. Save to the wallet repository.\n *\n * NOTE: the indexer query deliberately omits `spendableOnly`. Every\n * repository implements `saveVtxos` as an upsert with no batch delete,\n * so filtering to spendable-only would leave VTXOs that became spent\n * between polls marked as spendable forever. Fetching the full set lets\n * the upsert overwrite stale records with their latest state.\n */\nexport const contractPollProcessor: TaskProcessor = {\n taskType: CONTRACT_POLL_TASK_TYPE,\n\n async execute(\n item: TaskItem,\n deps: TaskDependencies,\n ): Promise<Omit<TaskResult, \"id\" | \"executedAt\">> {\n const { contractRepository, walletRepository, indexerProvider, extendVtxo } = deps;\n\n // Background channel, so it covers exactly what the watcher's\n // subscription covers: `retained` rows are kept for reads only.\n const contracts = await collectContracts(contractRepository, {\n watch: [\"watched\", \"awaiting-funds\"],\n });\n let contractsProcessed = 0;\n let vtxosSaved = 0;\n\n for (const contract of contracts) {\n // Paginated fetch of spendable virtual outputs\n const pageSize = 100;\n let pageIndex = 0;\n let hasMore = true;\n const allVtxos: ExtendedVirtualCoin[] = [];\n\n while (hasMore) {\n const { vtxos, page } = await getNormalizedVtxos(indexerProvider, {\n scripts: [contract.script],\n pageIndex,\n pageSize,\n });\n\n for (const vtxo of vtxos) {\n allVtxos.push(extendVtxo(vtxo, contract));\n }\n\n hasMore = page ? vtxos.length === pageSize : false;\n pageIndex++;\n }\n\n // Skip wrong-script rows (legacy duplicates or indexer drift)\n // before persisting; the loop must keep going for the remaining\n // contracts even when one row is rejected.\n const filtered = warnAndFilterVtxosForScript(\n allVtxos,\n contract.script,\n \"contractPollProcessor\",\n );\n await saveVtxosForContract(walletRepository, contract, filtered);\n vtxosSaved += filtered.length;\n contractsProcessed++;\n }\n\n return {\n taskItemId: item.id,\n type: CONTRACT_POLL_TASK_TYPE,\n status: \"success\",\n data: { contractsProcessed, vtxosSaved },\n };\n },\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/worker/expo/taskRunner.ts","../src/worker/expo/processors/contractPollProcessor.ts"],"names":["getRandomId","extendVirtualCoinForContract","collectContracts","getNormalizedVtxos","warnAndFilterVtxosForScript","saveVtxosForContract"],"mappings":";;;;;;AAkDA,eAAsB,QAAA,CAClB,KAAA,EACA,UAAA,EACA,IAAA,EACqB;AACrB,EAAA,MAAM,KAAA,GAAQ,MAAM,KAAA,CAAM,QAAA,EAAS;AACnC,EAAA,MAAM,YAAA,GAAe,IAAI,GAAA,CAAI,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,QAAA,EAAU,CAAC,CAAC,CAAC,CAAA;AACnE,EAAA,MAAM,UAAwB,EAAC;AAE/B,EAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACtB,IAAA,MAAM,SAAA,GAAY,YAAA,CAAa,GAAA,CAAI,IAAA,CAAK,IAAI,CAAA;AAE5C,IAAA,IAAI,OAAA;AAEJ,IAAA,IAAI,CAAC,SAAA,EAAW;AACZ,MAAA,OAAA,GAAU;AAAA,QACN,YAAY,IAAA,CAAK,EAAA;AAAA,QACjB,MAAM,IAAA,CAAK,IAAA;AAAA,QACX,MAAA,EAAQ;AAAA,OACZ;AAAA,IACJ,CAAA,MAAO;AACH,MAAA,IAAI;AACA,QAAA,OAAA,GAAU,MAAM,SAAA,CAAU,OAAA,CAAQ,IAAA,EAAM,IAAI,CAAA;AAAA,MAChD,SAAS,KAAA,EAAO;AACZ,QAAA,OAAA,GAAU;AAAA,UACN,YAAY,IAAA,CAAK,EAAA;AAAA,UACjB,MAAM,IAAA,CAAK,IAAA;AAAA,UACX,MAAA,EAAQ,QAAA;AAAA,UACR,IAAA,EAAM;AAAA,YACF,OAAO,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK;AAAA;AAChE,SACJ;AAAA,MACJ;AAAA,IACJ;AAEA,IAAA,MAAM,MAAA,GAAqB;AAAA,MACvB,GAAG,O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AS,MAAM,CAAA;AAAA,UACzB,SAAA;AAAA,UACA;AAAA,SACH,CAAA;AAED,QAAA,KAAA,MAAW,QAAQ,KAAA,EAAO;AACtB,UAAA,QAAA,CAAS,IAAA,CAAK,UAAA,CAAW,IAAA,EAAM,QAAQ,CAAC,CAAA;AAAA,QAC5C;AAEA,QAAA,OAAA,GAAU,IAAA,GAAO,KAAA,CAAM,MAAA,KAAW,QAAA,GAAW,KAAA;AAC7C,QAAA,SAAA,EAAA;AAAA,MACJ;AAKA,MAAA,MAAM,QAAA,GAAWC,6CAAA;AAAA,QACb,QAAA;AAAA,QACA,QAAA,CAAS,MAAA;AAAA,QACT;AAAA,OACJ;AACA,MAAA,MAAMC,sCAAA,CAAqB,gBAAA,EAAkB,QAAA,EAAU,QAAQ,CAAA;AAC/D,MAAA,UAAA,IAAc,QAAA,CAAS,MAAA;AACvB,MAAA,kBAAA,EAAA;AAAA,IACJ;AAEA,IAAA,OAAO;AAAA,MACH,YAAY,IAAA,CAAK,EAAA;AAAA,MACjB,IAAA,EAAM,uBAAA;AAAA,MACN,MAAA,EAAQ,SAAA;AAAA,MACR,IAAA,EAAM,EAAE,kBAAA,EAAoB,UAAA;AAAW,KAC3C;AAAA,EACJ;AACJ","file":"chunk-YS76JSGP.cjs","sourcesContent":["import type { TaskItem, TaskResult, TaskQueue } from \"./taskQueue\";\nimport type { WalletRepository } from \"../../repositories/walletRepository\";\nimport type { ContractRepository } from \"../../repositories/contractRepository\";\nimport type { IndexerProvider } from \"../../providers/indexer\";\nimport type { OperatorProvider } from \"../../providers/ark\";\nimport type { ExtendedVirtualCoin, VirtualCoin } from \"../../wallet\";\nimport type { Contract } from \"../../contracts/types\";\nimport { getRandomId, extendVirtualCoinForContract } from \"../../wallet/utils\";\n\n/**\n * Shared dependencies injected into every processor at runtime.\n *\n * `extendVtxo` requires the owning contract — processors must resolve each\n * vtxo's `script` to a known contract (via the contract repository) before\n * calling this. The strict signature prevents the footgun where a missing\n * contract silently falls back to the wallet's default tapscript.\n */\nexport interface TaskDependencies {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: OperatorProvider;\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) => ExtendedVirtualCoin;\n}\n\n/**\n * A stateless unit that handles one type of task item.\n *\n * Processors must not keep in-memory state across invocations —\n * all coordination lives in the @see TaskQueue and repositories.\n *\n * The `TDeps` parameter defaults to @see TaskDependencies but\n * can be overridden for domain-specific processors (e.g. swap processing).\n */\nexport interface TaskProcessor<TDeps = TaskDependencies> {\n readonly taskType: string;\n execute(item: TaskItem, deps: TDeps): Promise<Omit<TaskResult, \"id\" | \"executedAt\">>;\n}\n\n/**\n * Run all pending tasks from the queue through matching processors.\n *\n * For each task in the inbox:\n * 1. Find the processor whose `taskType` matches `task.type`.\n * 2. Execute it, producing a @see TaskResult.\n * 3. Push the result to the outbox and remove the task from the inbox.\n *\n * Tasks with no matching processor produce a `\"noop\"` result.\n * Processor errors produce a `\"failed\"` result with the error message.\n */\nexport async function runTasks<TDeps = TaskDependencies>(\n queue: TaskQueue,\n processors: TaskProcessor<TDeps>[],\n deps: TDeps,\n): Promise<TaskResult[]> {\n const tasks = await queue.getTasks();\n const processorMap = new Map(processors.map((p) => [p.taskType, p]));\n const results: TaskResult[] = [];\n\n for (const task of tasks) {\n const processor = processorMap.get(task.type);\n\n let partial: Omit<TaskResult, \"id\" | \"executedAt\">;\n\n if (!processor) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"noop\",\n };\n } else {\n try {\n partial = await processor.execute(task, deps);\n } catch (error) {\n partial = {\n taskItemId: task.id,\n type: task.type,\n status: \"failed\",\n data: {\n error: error instanceof Error ? error.message : String(error),\n },\n };\n }\n }\n\n const result: TaskResult = {\n ...partial,\n id: getRandomId(),\n executedAt: Date.now(),\n };\n\n await queue.pushResult(result);\n await queue.removeTask(task.id);\n results.push(result);\n }\n\n return results;\n}\n\n/**\n * Options for @see createTaskDependencies.\n */\nexport interface CreateTaskDependenciesOptions {\n walletRepository: WalletRepository;\n contractRepository: ContractRepository;\n indexerProvider: IndexerProvider;\n arkProvider: OperatorProvider;\n}\n\n/**\n * Build the @see TaskDependencies needed by task processors\n * (e.g. `src/worker/expo/processors/contractPollProcessor.ts`)\n *\n * This is the same construction that `defineExpoBackgroundTask` does\n * internally, extracted so that consumers with custom schedulers\n * (e.g. bare React Native with `react-native-background-fetch`)\n * can build deps without depending on Expo.\n */\nexport function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies {\n return {\n ...options,\n extendVtxo: (vtxo: VirtualCoin, contract: Contract) =>\n extendVirtualCoinForContract(vtxo, contract),\n };\n}\n","import { collectContracts } from \"../../../repositories/contractRepository\";\nimport type { TaskItem, TaskResult } from \"../taskQueue\";\nimport type { TaskProcessor, TaskDependencies } from \"../taskRunner\";\nimport type { ExtendedVirtualCoin } from \"../../../wallet\";\nimport { getNormalizedVtxos } from \"../../../wallet/vtxo\";\nimport {\n warnAndFilterVtxosForScript,\n saveVtxosForContract,\n} from \"../../../contracts/vtxoOwnership\";\n\nexport const CONTRACT_POLL_TASK_TYPE = \"contract-poll\";\n\n/**\n * Polls the indexer for the latest VTXO state of every contract and\n * persists the results to the wallet repository.\n *\n * Replicates the polling subset of @see ContractManager.initialize:\n * 1. Load every watched contract from the contract repository.\n * 2. Paginated fetch of every VTXO (including spent) from the indexer.\n * 3. Extend each VTXO with tapscript data.\n * 4. Save to the wallet repository.\n *\n * NOTE: the indexer query deliberately omits `spendableOnly`. Every\n * repository implements `saveVtxos` as an upsert with no batch delete,\n * so filtering to spendable-only would leave VTXOs that became spent\n * between polls marked as spendable forever. Fetching the full set lets\n * the upsert overwrite stale records with their latest state.\n */\nexport const contractPollProcessor: TaskProcessor = {\n taskType: CONTRACT_POLL_TASK_TYPE,\n\n async execute(\n item: TaskItem,\n deps: TaskDependencies,\n ): Promise<Omit<TaskResult, \"id\" | \"executedAt\">> {\n const { contractRepository, walletRepository, indexerProvider, extendVtxo } = deps;\n\n // Background channel, so it covers exactly what the watcher's\n // subscription covers: `retained` rows are kept for reads only.\n const contracts = await collectContracts(contractRepository, {\n watch: [\"watched\", \"awaiting-funds\"],\n });\n let contractsProcessed = 0;\n let vtxosSaved = 0;\n\n for (const contract of contracts) {\n // Paginated fetch of spendable virtual outputs\n const pageSize = 100;\n let pageIndex = 0;\n let hasMore = true;\n const allVtxos: ExtendedVirtualCoin[] = [];\n\n while (hasMore) {\n const { vtxos, page } = await getNormalizedVtxos(indexerProvider, {\n scripts: [contract.script],\n pageIndex,\n pageSize,\n });\n\n for (const vtxo of vtxos) {\n allVtxos.push(extendVtxo(vtxo, contract));\n }\n\n hasMore = page ? vtxos.length === pageSize : false;\n pageIndex++;\n }\n\n // Skip wrong-script rows (legacy duplicates or indexer drift)\n // before persisting; the loop must keep going for the remaining\n // contracts even when one row is rejected.\n const filtered = warnAndFilterVtxosForScript(\n allVtxos,\n contract.script,\n \"contractPollProcessor\",\n );\n await saveVtxosForContract(walletRepository, contract, filtered);\n vtxosSaved += filtered.length;\n contractsProcessed++;\n }\n\n return {\n taskItemId: item.id,\n type: CONTRACT_POLL_TASK_TYPE,\n status: \"success\",\n data: { contractsProcessed, vtxosSaved },\n };\n },\n};\n"]}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNDQ4LB4X_cjs = require('../../chunk-NDQ4LB4X.cjs');
|
|
4
4
|
require('../../chunk-JFJNB7ZH.cjs');
|
|
5
|
-
require('../../chunk-
|
|
5
|
+
require('../../chunk-LZAINCGU.cjs');
|
|
6
6
|
require('../../chunk-FLPWNMX3.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "ArkadeContractHandler", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkNDQ4LB4X_cjs.ArkadeContractHandler; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "BoardingContractHandler", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkNDQ4LB4X_cjs.BoardingContractHandler; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "DefaultContractHandler", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkNDQ4LB4X_cjs.DefaultContractHandler; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "DelegateContractHandler", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkNDQ4LB4X_cjs.DelegateContractHandler; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "VHTLCContractHandler", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkNDQ4LB4X_cjs.VHTLCContractHandler; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "VHTLCV2ContractHandler", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkNDQ4LB4X_cjs.VHTLCV2ContractHandler; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "contractHandlers", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkNDQ4LB4X_cjs.contractHandlers; }
|
|
37
37
|
});
|
|
38
38
|
//# sourceMappingURL=index.cjs.map
|
|
39
39
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-
|
|
2
|
-
import '../../index-
|
|
1
|
+
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-46g577Ka.cjs';
|
|
2
|
+
import '../../index-Dqk07NwJ.cjs';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
4
|
import '@scure/btc-signer';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-
|
|
2
|
-
import '../../index-
|
|
1
|
+
export { A as ArkadeContractHandler, B as BoardingContractHandler, a as BoardingContractParams, D as DefaultContractHandler, b as DefaultContractParams, c as DelegateContractHandler, d as DelegateContractParams, e as VHTLCContractHandler, f as VHTLCContractParams, g as VHTLCV2ContractHandler, h as VHTLCV2ContractParams, i as contractHandlers } from '../../index-2wKMrT0a.js';
|
|
2
|
+
import '../../index-C66rjxz2.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
4
|
import '@scure/btc-signer';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DelegateContractHandler, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers } from '../../chunk-
|
|
1
|
+
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DelegateContractHandler, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers } from '../../chunk-47Z4LEIW.js';
|
|
2
2
|
import '../../chunk-DNFTHG73.js';
|
|
3
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-QTMK34TP.js';
|
|
4
4
|
import '../../chunk-FDJ734CH.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bF as ContractHandler, bS as Discoverable, dS as TapscriptDeriving } from './index-C66rjxz2.js';
|
|
2
2
|
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-iyDum4fw.js';
|
|
3
3
|
import { R as RelativeTimelock, V as VtxoScript, T as TapLeafScript } from './base-C-Y5t_0F.js';
|
|
4
4
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bF as ContractHandler, bS as Discoverable, dS as TapscriptDeriving } from './index-Dqk07NwJ.cjs';
|
|
2
2
|
import { D as DefaultVtxo, a as DelegateVtxo } from './delegate-gGkUnYpi.cjs';
|
|
3
3
|
import { R as RelativeTimelock, V as VtxoScript, T as TapLeafScript } from './base-C-Y5t_0F.cjs';
|
|
4
4
|
import { Bytes } from '@scure/btc-signer/utils.js';
|
|
@@ -1152,9 +1152,9 @@ interface OperatorProvider {
|
|
|
1152
1152
|
/** Finalize a previously submitted Arkade transaction. */
|
|
1153
1153
|
finalizeTx(arkTxid: string, finalCheckpointTxs: string[]): Promise<void>;
|
|
1154
1154
|
/** Register a signed intent with the operator. */
|
|
1155
|
-
registerIntent(intent:
|
|
1155
|
+
registerIntent(intent: SignedProof<Proof.RegisterMessage>): Promise<string>;
|
|
1156
1156
|
/** Delete a previously registered intent. */
|
|
1157
|
-
deleteIntent(intent:
|
|
1157
|
+
deleteIntent(intent: SignedProof<Proof.DeleteMessage>): Promise<void>;
|
|
1158
1158
|
/** Confirm an already registered intent id. */
|
|
1159
1159
|
confirmRegistration(intentId: string): Promise<void>;
|
|
1160
1160
|
/** Submit musig2 tree nonces for a batch signing session. */
|
|
@@ -1200,7 +1200,7 @@ declare class RestOperatorProvider implements OperatorProvider {
|
|
|
1200
1200
|
* `DIGEST_MISMATCH` refresh or when {@link getInfo} observes a changed digest.
|
|
1201
1201
|
* Returns an unsubscribe function.
|
|
1202
1202
|
*/
|
|
1203
|
-
onServerInfoChanged(listener: (info:
|
|
1203
|
+
onServerInfoChanged(listener: (info: OperatorInfo) => void): () => void;
|
|
1204
1204
|
private emitServerInfoChanged;
|
|
1205
1205
|
/**
|
|
1206
1206
|
* `fetch` wrapper for arkd requests that participates in operator info digest
|
|
@@ -1222,8 +1222,8 @@ declare class RestOperatorProvider implements OperatorProvider {
|
|
|
1222
1222
|
}>;
|
|
1223
1223
|
cosignOnchainTx(psbtB64: string): Promise<string>;
|
|
1224
1224
|
finalizeTx(arkTxid: string, finalCheckpointTxs: string[]): Promise<void>;
|
|
1225
|
-
registerIntent(intent:
|
|
1226
|
-
deleteIntent(intent:
|
|
1225
|
+
registerIntent(intent: SignedProof<Proof.RegisterMessage>): Promise<string>;
|
|
1226
|
+
deleteIntent(intent: SignedProof<Proof.DeleteMessage>): Promise<void>;
|
|
1227
1227
|
confirmRegistration(intentId: string): Promise<void>;
|
|
1228
1228
|
submitTreeNonces(batchId: string, pubkey: string, nonces: TreeNonces): Promise<void>;
|
|
1229
1229
|
submitTreeSignatures(batchId: string, pubkey: string, signatures: TreePartialSigs): Promise<void>;
|
|
@@ -1982,7 +1982,7 @@ interface MigrationVtxoRef {
|
|
|
1982
1982
|
}
|
|
1983
1983
|
/**
|
|
1984
1984
|
* Machine-readable status for a single deprecated signer the wallet holds funds under. Derived at
|
|
1985
|
-
* read time from contract params plus a fresh {@link
|
|
1985
|
+
* read time from contract params plus a fresh {@link OperatorInfo} snapshot — never persisted.
|
|
1986
1986
|
*/
|
|
1987
1987
|
interface DeprecatedSignerReport {
|
|
1988
1988
|
/** Deprecated signer key (x-only hex). */
|
|
@@ -2625,7 +2625,7 @@ interface BatchRegistration {
|
|
|
2625
2625
|
* until the proof is registered with the operator.
|
|
2626
2626
|
*/
|
|
2627
2627
|
registrationId?: string;
|
|
2628
|
-
state:
|
|
2628
|
+
state: BatchRegistrationState;
|
|
2629
2629
|
validFrom?: number;
|
|
2630
2630
|
validUntil?: number;
|
|
2631
2631
|
createdAt: number;
|
|
@@ -2667,13 +2667,13 @@ interface BatchRegistrationRepository extends AsyncDisposable {
|
|
|
2667
2667
|
readonly version: 1;
|
|
2668
2668
|
clear(): Promise<void>;
|
|
2669
2669
|
/** Upsert by primary key; implementation sets `updatedAt = Date.now()`. */
|
|
2670
|
-
saveBatchRegistration(intent:
|
|
2670
|
+
saveBatchRegistration(intent: BatchRegistration): Promise<void>;
|
|
2671
2671
|
/** @deprecated Use {@link saveBatchRegistration}. */
|
|
2672
|
-
saveIntent:
|
|
2672
|
+
saveIntent: BatchRegistrationRepository["saveBatchRegistration"];
|
|
2673
2673
|
/** Bounded registrations in primary key order, not chronological order; `after` is exclusive. */
|
|
2674
|
-
getBatchRegistrationsPage(filter:
|
|
2674
|
+
getBatchRegistrationsPage(filter: BatchRegistrationPageFilter | undefined, page: PageRequest): Promise<PageResult<BatchRegistration>>;
|
|
2675
2675
|
/** @deprecated Use {@link getBatchRegistrationsPage}. */
|
|
2676
|
-
getIntentsPage:
|
|
2676
|
+
getIntentsPage: BatchRegistrationRepository["getBatchRegistrationsPage"];
|
|
2677
2677
|
/**
|
|
2678
2678
|
* Outpoints held by NON-terminal registrations — `waiting_to_submit`,
|
|
2679
2679
|
* `waiting_for_batch`, and `batch_in_progress` — to exclude from spendable
|
|
@@ -2688,8 +2688,8 @@ interface BatchRegistrationRepository extends AsyncDisposable {
|
|
|
2688
2688
|
*/
|
|
2689
2689
|
getLockedVtxoOutpoints(): Promise<Outpoint[]>;
|
|
2690
2690
|
}
|
|
2691
|
-
/**
|
|
2692
|
-
declare const
|
|
2691
|
+
/** Collects in primary key order; sort by `createdAt` for chronological display. */
|
|
2692
|
+
declare const collectBatchRegistrations: (repository: Pick<BatchRegistrationRepository, "getBatchRegistrationsPage">, filter?: BatchRegistrationPageFilter) => Promise<BatchRegistration[]>;
|
|
2693
2693
|
/** @deprecated Use {@link BatchRegistrationState}. */
|
|
2694
2694
|
type ArkIntentState = BatchRegistrationState;
|
|
2695
2695
|
/** @deprecated Use {@link BatchRegistrationRepository}. */
|
|
@@ -2698,8 +2698,8 @@ type IntentRepository = BatchRegistrationRepository;
|
|
|
2698
2698
|
declare const isTerminalIntentState: typeof isTerminalBatchRegistrationState;
|
|
2699
2699
|
/** @deprecated Use {@link BATCH_REGISTRATION_TERMINAL_STATES}. */
|
|
2700
2700
|
declare const INTENT_TERMINAL_STATES: ReadonlySet<BatchRegistrationState>;
|
|
2701
|
-
/**
|
|
2702
|
-
declare const
|
|
2701
|
+
/** @deprecated Use {@link collectBatchRegistrations}. */
|
|
2702
|
+
declare const collectIntents: (repository: Pick<BatchRegistrationRepository, "getBatchRegistrationsPage">, filter?: BatchRegistrationPageFilter) => Promise<BatchRegistration[]>;
|
|
2703
2703
|
|
|
2704
2704
|
/**
|
|
2705
2705
|
* Type of a tx inside a VTXO's chain (commitment → leaf), as reported by
|
|
@@ -3023,13 +3023,13 @@ declare function assertRecipientArkadeAddress(encoded: string, address: ArkAddre
|
|
|
3023
3023
|
/** Minimal indexer surface the reconciler needs. */
|
|
3024
3024
|
type IntentReconcilerIndexer = Pick<IndexerProvider, "getVtxos">;
|
|
3025
3025
|
interface IntentReconciliationDeps {
|
|
3026
|
-
intentRepository:
|
|
3026
|
+
intentRepository: BatchRegistrationRepository;
|
|
3027
3027
|
indexerProvider: IntentReconcilerIndexer;
|
|
3028
3028
|
/**
|
|
3029
3029
|
* Replays an intent's stored delete proof against arkd. Absent ⇒ an unresolved, unexpired
|
|
3030
3030
|
* intent stays locked, since arkd never expires a queued intent on its own.
|
|
3031
3031
|
*/
|
|
3032
|
-
deleteIntent?: (intent:
|
|
3032
|
+
deleteIntent?: (intent: SignedProof<Proof.DeleteMessage>) => Promise<void>;
|
|
3033
3033
|
/**
|
|
3034
3034
|
* Whether a live settlement in this wallet is spending the outpoint. An intent with an
|
|
3035
3035
|
* in-flight input belongs to that settlement and is skipped.
|
|
@@ -3381,7 +3381,7 @@ interface ContractManagerConfig {
|
|
|
3381
3381
|
* When present, the online sync reconciles persisted non-terminal settlement intents against
|
|
3382
3382
|
* indexer state (crash recovery) on boot and reconnect; see {@link reconcileIntents}.
|
|
3383
3383
|
*/
|
|
3384
|
-
intentRepository?:
|
|
3384
|
+
intentRepository?: BatchRegistrationRepository;
|
|
3385
3385
|
/** Lets the reconciliation release stale intents from arkd; see {@link IntentReconciliationDeps}. */
|
|
3386
3386
|
intentReconciliation?: Pick<IntentReconciliationDeps, "deleteIntent" | "isOutpointInFlight">;
|
|
3387
3387
|
/**
|
|
@@ -4471,7 +4471,7 @@ interface ResolvedArkadeService {
|
|
|
4471
4471
|
/** The operator's cosigner that emulates Arkade Script; absent for an `operatorUrl` service
|
|
4472
4472
|
* without `emulatorUrl`. */
|
|
4473
4473
|
emulator?: EmulatorProvider;
|
|
4474
|
-
info:
|
|
4474
|
+
info: OperatorInfo;
|
|
4475
4475
|
}
|
|
4476
4476
|
/**
|
|
4477
4477
|
* Resolve a service into providers and the operator's info.
|
|
@@ -4482,7 +4482,7 @@ interface ResolvedArkadeService {
|
|
|
4482
4482
|
*/
|
|
4483
4483
|
declare function resolveArkadeService(service: ArkadeService, opts?: {
|
|
4484
4484
|
arkProvider?: OperatorProvider;
|
|
4485
|
-
info?:
|
|
4485
|
+
info?: OperatorInfo;
|
|
4486
4486
|
}): Promise<ResolvedArkadeService>;
|
|
4487
4487
|
|
|
4488
4488
|
/**
|
|
@@ -4718,7 +4718,7 @@ type StorageConfig = {
|
|
|
4718
4718
|
* instance may settle against it: reconciliation deletes from the operator any
|
|
4719
4719
|
* pending intent that instance is not settling itself.
|
|
4720
4720
|
*/
|
|
4721
|
-
intentRepository?:
|
|
4721
|
+
intentRepository?: BatchRegistrationRepository;
|
|
4722
4722
|
/**
|
|
4723
4723
|
* Optional virtual-tx (exit-branch) repository. When set, the wallet captures each received
|
|
4724
4724
|
* VTXO's exit branch into it and prunes it on spend (both best-effort, see
|
|
@@ -5438,11 +5438,11 @@ interface IReadonlyWallet {
|
|
|
5438
5438
|
* `signerPubkey` or a delay into a covenant, where a stale snapshot could derive an address
|
|
5439
5439
|
* the operator no longer co-signs for.
|
|
5440
5440
|
*
|
|
5441
|
-
* @see
|
|
5441
|
+
* @see OperatorInfo
|
|
5442
5442
|
*/
|
|
5443
|
-
getOperatorInfo(opts?: GetOperatorInfoOptions): Promise<
|
|
5443
|
+
getOperatorInfo(opts?: GetOperatorInfoOptions): Promise<OperatorInfo>;
|
|
5444
5444
|
/** @deprecated Use {@link getOperatorInfo}. */
|
|
5445
|
-
getArkadeInfo(opts?: GetOperatorInfoOptions): Promise<
|
|
5445
|
+
getArkadeInfo(opts?: GetOperatorInfoOptions): Promise<OperatorInfo>;
|
|
5446
5446
|
/**
|
|
5447
5447
|
* Operator-side chain reads for scripts the wallet does not own (e.g. a plugin's covenant);
|
|
5448
5448
|
* {@link getVtxos} reads the wallet's own outputs from repositories.
|
|
@@ -5654,4 +5654,4 @@ declare function isBatchSignable(identity: Identity): identity is BatchSignableI
|
|
|
5654
5654
|
*/
|
|
5655
5655
|
declare function isSigningIdentity(value: unknown): value is Identity;
|
|
5656
5656
|
|
|
5657
|
-
export { type
|
|
5657
|
+
export { type VirtualTxRepository as $, type ArkadeReader as A, type Outpoint as B, type ContractRepository as C, type PageResult as D, type ExtendedCoin as E, type ScriptVtxoCursor as F, type GetOperatorInfoOptions as G, type ScriptVtxoPageOptions as H, type IWallet as I, type StoredVtxo as J, type VtxoRepositoryKey as K, type TransactionHistoryPageFilter as L, type TransactionHistoryPageCursor as M, type NormalizedExtendedVirtualCoin as N, type OperatorInfo as O, type PageRequest as P, type AtomicWalletState as Q, type Recipient as R, type SettleParams as S, type TxNotificationEvent as T, type WalletState as U, type VirtualCoin as V, type WalletRepository as W, type ContractFilter as X, type BatchRegistrationRepository as Y, type BatchRegistration as Z, type BatchRegistrationPageFilter as _, type Identity as a, type ContractEvent as a$, type VirtualTx as a0, type VtxoBranch as a1, ChainedTxType as a2, type Network as a3, type BatchStartedEvent as a4, type TreeSigningStartedEvent as a5, TxTree as a6, type TreeNoncesEvent as a7, type BatchFinalizationEvent as a8, type BatchFinalizedEvent as a9, Intent as aA, type SignedProof as aB, Proof as aC, type TimeHeight as aD, type DescriptorSigningRequest as aE, type IntentFeeConfig as aF, type OffchainInput as aG, FeeAmount as aH, type OnchainInput as aI, type FeeOutput as aJ, type ContractWatcherConfig as aK, type Asset as aL, type FeeInfo as aM, type GetVtxosOptions as aN, type PaginationOptions as aO, type CreateContractParams as aP, type GetContractsFilter as aQ, type GetSpendablePathsOptions as aR, type GetAllSpendingPathsOptions as aS, type InputExpiryFloor as aT, type IssuanceParams as aU, type ReissuanceParams as aV, type BurnParams as aW, type RenewVtxosOptions as aX, type NormalizedVtxoPage as aY, type WatchedScript as aZ, type PathSelection as a_, type BatchFailedEvent as aa, type TreeTxEvent as ab, type TreeSignatureEvent as ac, type DescriptorProvider as ad, type IReadonlyWallet as ae, type ReadonlyIdentity as af, type OnchainProvider as ag, type DelegateProvider as ah, type ReadonlyWalletConfig as ai, type ExitCaptureMode as aj, type ExitDataSource as ak, type IReadonlyAssetManager as al, type ContractSyncState as am, type RecipientArkadeAddressContext as an, EsploraProvider as ao, type NetworkName as ap, type ContractWithVtxos as aq, selectPendingRecoveryOutpoints as ar, type Coin as as, ContractManager as at, type ContractManagerConfig as au, type SettlementConfig as av, VtxoManager as aw, type SignerSession as ax, Transaction as ay, type SignedIntent as az, type WalletConfig as b, type ExitChainResolver as b$, type AssetDetails as b0, type IssuanceResult as b1, type DelegateInfo as b2, type MigrationGlobalSkipReason as b3, type MigrationLegSkipReason as b4, type SignerStatus as b5, type StorageConfig as b6, type IVtxoManager as b7, type SendBitcoinParams as b8, type ExplorerTransaction as b9, ChainTxType as bA, type CommitmentTx as bB, type ConnectorTreeNode as bC, type ContractBalance as bD, type ContractEventCallback as bE, type ContractHandler as bF, type ContractScope as bG, type ContractState as bH, type ContractVtxo as bI, ContractWatcher as bJ, type ContractWatcherEventCallback as bK, DEFAULT_ARKADE_EMULATOR_URL as bL, DEFAULT_VTXO_PAGE_SIZE as bM, DelegateManagerImpl as bN, type DelegateOptions as bO, type DeprecatedSignerMigrationReport as bP, type DeprecatedSignerReport as bQ, DigestMismatchError as bR, type Discoverable as bS, type DiscoveredContract as bT, type DiscoveryDeps as bU, ESPLORA_URL as bV, type EmulatorInfo as bW, type EventSourceCapable as bX, type EventSourceFactory as bY, type EventSourceLike as bZ, EventSourceUnavailableError as b_, type TreeNonces as ba, type TreePartialSigs as bb, type PendingTx as bc, type EmulatorProvider as bd, type Status as be, type ChainTx as bf, type ArkadeService as bg, type ContractVtxoEvent as bh, type ExtendedContractVtxo as bi, type ResolvedArkadeService as bj, resolveArkadeService as bk, type PathContext as bl, type ActivityIntent as bm, type ActivityResolver as bn, type ArkIntent as bo, type ArkIntentState as bp, type ArkadeInfo as bq, type AssetMetadata as br, BATCH_REGISTRATION_TERMINAL_STATES as bs, BITCOIN_EMULATOR_PUBKEY as bt, type BaseWalletConfig as bu, type BatchInfo as bv, type BatchRegistrationFilter as bw, type BatchRegistrationState as bx, type BatchSignableIdentity as by, type CandidateDeps as bz, type ArkadeBroadcaster as c, assertRecipientArkadeAddress as c$, type GetArkadeInfoOptions as c0, type GetUtxosOptions as c1, type GroupMembership as c2, type HandlerError as c3, INTENT_TERMINAL_STATES as c4, IndexerTxType as c5, type IndexerUtxo as c6, IndexerUtxosUnsupportedError as c7, type IntentCoin as c8, type IntentFilter as c9, RestEmulatorProvider as cA, type ScanContractsOptions as cB, type ScanResult as cC, type ScheduledSession as cD, SettlementEventType as cE, type SignRequest as cF, type SignerClassification as cG, type SignerSet as cH, type SubscriptionFilter as cI, type SubscriptionResponse as cJ, type SweepTxNotification as cK, type TapLeaves as cL, TreeSignerSession as cM, type Tx as cN, type TxHistoryRecord as cO, type TxKey as cP, type TxNotification as cQ, type TxTag as cR, type TxTreeNode as cS, TxType as cT, type Vtxo as cU, type VtxoChain as cV, type VtxoType as cW, type WalletMode as cX, type WithPrevTx as cY, assertAllowedSighashTypes as cZ, assertPageRequest as c_, type IntentPageFilter as ca, type IntentRepository as cb, type KnownMetadata as cc, MAX_PAGE_SIZE as cd, MUTINYNET_EMULATOR_PUBKEY as ce, type MigrateDeprecatedSignerOptions as cf, type MigrationLegReport as cg, type MigrationVtxoRef as ch, type NewAddressType as ci, type Nonces as cj, OnchainCosignAmbiguousError as ck, OnchainCosignRejectedError as cl, OnchainCosignUnsupportedError as cm, type Output as cn, type PageResponse as co, PartialSig as cp, type PrevTxSource as cq, PrevTxUnavailableError as cr, type ProofInput as cs, type ProviderClass as ct, REGTEST_EMULATOR_PUBKEY as cu, type RawTxSource as cv, type RenewalSplit as cw, type RenewalSplitContext as cx, RestArkProvider as cy, RestDelegateProvider as cz, type WalletBalance as d, assetMintResolver as d0, attachPrevArkTxs as d1, attachPrevoutTxs as d2, boardingResolver as d3, canRecoverOnchain as d4, canSpendOffchain as d5, canSweepOnchain as d6, classifyAgainstSignerSet as d7, classifyContractSigner as d8, collabExitResolver as d9, isSubdust as dA, isTerminalBatchRegistrationState as dB, isTerminalIntentState as dC, isVirtualCoin as dD, isVtxoExpiringSoon as dE, isVtxoSpent as dF, iteratePages as dG, networkFromArkadeInfo as dH, networkFromOperatorInfo as dI, networks as dJ, pageResult as dK, resolveEmulatorPubkey as dL, resolveEventSource as dM, resolvePrevTxs as dN, signerSetFromInfo as dO, toOffchainInputFeeParams as dP, toXOnlySignerHex as dQ, withPrevTxs as dR, type TapscriptDeriving as dS, collectBatchRegistrations as da, collectContracts as db, collectIntents as dc, collectPages as dd, collectScriptVtxos as de, collectTransactionHistory as df, collectUtxos as dg, collectVtxos as dh, configureEventSource as di, createDefaultActivityRegistry as dj, createExitChainResolver as dk, defaultEmulatorPubkey as dl, getAllNormalizedVtxos as dm, getConfiguredEventSource as dn, getNetwork as dp, getNormalizedVtxos as dq, getRandomId as dr, hasCandidates as ds, isBatchSignable as dt, isContractVtxoEvent as du, isCooperativelyMigratable as dv, isDiscoverable as dw, isEventSourceUnavailableError as dx, isPastExpiry as dy, isSigningIdentity as dz, type GetVtxosFilter as e, type GetSpendableVtxosFilter as f, type ArkTransaction as g, ActivityRegistry as h, type Activity as i, type IContractManager as j, type GetNewAddressesOptions as k, type NewAddress as l, type IDelegateManager as m, type SettlementEvent as n, type SendParams as o, type SendOnchainParams as p, type IAssetManager as q, RestOperatorProvider as r, RestIndexerProvider as s, type SubscriptionEvent as t, type SubscriptionHeartbeat as u, type ArkProvider as v, type IndexerProvider as w, type OperatorProvider as x, type Contract as y, type ExtendedVirtualCoin as z };
|