@arkade-os/sdk 0.4.36 → 0.4.38
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 +4 -4
- package/dist/adapters/expo.d.cts +2 -2
- package/dist/adapters/expo.d.ts +2 -2
- package/dist/adapters/expo.js +2 -2
- package/dist/adapters/indexedDB.cjs +3 -3
- package/dist/adapters/indexedDB.js +2 -2
- package/dist/{ark-D6sau_6-.d.cts → ark-BzUNnkoc.d.cts} +1 -1
- package/dist/{ark-D6sau_6-.d.ts → ark-BzUNnkoc.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-CpC027t_.d.cts → asyncStorageTaskQueue-C0kQoY1x.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-GT8fmPUG.d.ts → asyncStorageTaskQueue-CIYeI6GM.d.ts} +2 -2
- package/dist/{chunk-Z2VRVZW4.js → chunk-A25NYZT5.js} +3 -3
- package/dist/{chunk-Z2VRVZW4.js.map → chunk-A25NYZT5.js.map} +1 -1
- package/dist/{chunk-HBPKIIMN.js → chunk-CCUUO2GR.js} +6 -7
- package/dist/chunk-CCUUO2GR.js.map +1 -0
- package/dist/{chunk-2JJKX2RK.js → chunk-ISWKPRX3.js} +21 -21
- package/dist/chunk-ISWKPRX3.js.map +1 -0
- package/dist/{chunk-TUSGEWOX.cjs → chunk-JSTCR7PQ.cjs} +81 -82
- package/dist/chunk-JSTCR7PQ.cjs.map +1 -0
- package/dist/{chunk-A5PY4NBP.cjs → chunk-KHUOY3QD.cjs} +7 -7
- package/dist/{chunk-A5PY4NBP.cjs.map → chunk-KHUOY3QD.cjs.map} +1 -1
- package/dist/{chunk-C6OODRWD.cjs → chunk-PXMV7RPT.cjs} +21 -21
- package/dist/chunk-PXMV7RPT.cjs.map +1 -0
- package/dist/{chunk-KZV3FJJR.js → chunk-RJK63VVZ.js} +3 -3
- package/dist/{chunk-KZV3FJJR.js.map → chunk-RJK63VVZ.js.map} +1 -1
- package/dist/{chunk-2XE5BSIY.cjs → chunk-ZLDWJQIY.cjs} +11 -11
- package/dist/{chunk-2XE5BSIY.cjs.map → chunk-ZLDWJQIY.cjs.map} +1 -1
- package/dist/contracts/handlers/index.d.cts +3 -3
- package/dist/contracts/handlers/index.d.ts +3 -3
- package/dist/{delegate-De5__fpZ.d.ts → delegate-BjPbX-MR.d.ts} +1 -1
- package/dist/{delegate-C-L6gSZx.d.cts → delegate-DHAgMIS9.d.cts} +1 -1
- package/dist/{index-BETdjE_o.d.ts → index-BOQKDCmS.d.ts} +2 -2
- package/dist/{index-jwQfHP6D.d.cts → index-YkMAtSfw.d.cts} +2 -2
- package/dist/index.cjs +119 -111
- package/dist/index.d.cts +19 -10
- package/dist/index.d.ts +19 -10
- package/dist/index.js +2 -2
- package/dist/repositories/realm/index.cjs +11 -11
- package/dist/repositories/realm/index.d.cts +1 -1
- package/dist/repositories/realm/index.d.ts +1 -1
- package/dist/repositories/realm/index.js +2 -2
- package/dist/repositories/sqlite/index.cjs +11 -11
- package/dist/repositories/sqlite/index.d.cts +1 -1
- package/dist/repositories/sqlite/index.d.ts +1 -1
- package/dist/repositories/sqlite/index.js +2 -2
- package/dist/{taskRunner-DCyp6Gea.d.cts → taskRunner-CVEgBO6d.d.cts} +2 -2
- package/dist/{taskRunner-DnxtObeq.d.ts → taskRunner-Dfmt7ZPN.d.ts} +2 -2
- package/dist/wallet/expo/background.cjs +12 -12
- package/dist/wallet/expo/background.d.cts +3 -3
- package/dist/wallet/expo/background.d.ts +3 -3
- package/dist/wallet/expo/background.js +4 -4
- package/dist/wallet/expo/index.cjs +11 -11
- package/dist/wallet/expo/index.d.cts +4 -4
- package/dist/wallet/expo/index.d.ts +4 -4
- package/dist/wallet/expo/index.js +3 -3
- package/dist/{wallet-Bth5uucA.d.ts → wallet-C4Pide44.d.ts} +2 -2
- package/dist/{wallet-BWHbd5b1.d.cts → wallet-_PTv-lMe.d.cts} +2 -2
- package/dist/worker/expo/index.cjs +7 -7
- package/dist/worker/expo/index.d.cts +4 -4
- package/dist/worker/expo/index.d.ts +4 -4
- package/dist/worker/expo/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-2JJKX2RK.js.map +0 -1
- package/dist/chunk-C6OODRWD.cjs.map +0 -1
- package/dist/chunk-HBPKIIMN.js.map +0 -1
- package/dist/chunk-TUSGEWOX.cjs.map +0 -1
package/dist/adapters/expo.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkZLDWJQIY_cjs = require('../chunk-ZLDWJQIY.cjs');
|
|
4
|
+
require('../chunk-PXMV7RPT.cjs');
|
|
5
5
|
require('../chunk-CMPJR3HS.cjs');
|
|
6
6
|
require('../chunk-5BLDMQED.cjs');
|
|
7
7
|
|
|
@@ -9,11 +9,11 @@ require('../chunk-5BLDMQED.cjs');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "ExpoArkProvider", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkZLDWJQIY_cjs.ExpoArkProvider; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "ExpoIndexerProvider", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkZLDWJQIY_cjs.ExpoIndexerProvider; }
|
|
17
17
|
});
|
|
18
18
|
//# sourceMappingURL=expo.cjs.map
|
|
19
19
|
//# sourceMappingURL=expo.cjs.map
|
package/dist/adapters/expo.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { m as ArkProvider, n as IndexerProvider } from '../ark-
|
|
1
|
+
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-BzUNnkoc.cjs';
|
|
2
|
+
export { m as ArkProvider, n as IndexerProvider } from '../ark-BzUNnkoc.cjs';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
package/dist/adapters/expo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-
|
|
2
|
-
export { m as ArkProvider, n as IndexerProvider } from '../ark-
|
|
1
|
+
import { j as RestArkProvider, h as SettlementEvent, T as TxNotification, k as RestIndexerProvider, l as SubscriptionResponse } from '../ark-BzUNnkoc.js';
|
|
2
|
+
export { m as ArkProvider, n as IndexerProvider } from '../ark-BzUNnkoc.js';
|
|
3
3
|
import '@scure/btc-signer/transaction.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
5
|
import '@scure/btc-signer/psbt.js';
|
package/dist/adapters/expo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ExpoArkProvider, ExpoIndexerProvider } from '../chunk-RJK63VVZ.js';
|
|
2
|
+
import '../chunk-ISWKPRX3.js';
|
|
3
3
|
import '../chunk-OUVTG72A.js';
|
|
4
4
|
import '../chunk-NSBPE2FW.js';
|
|
5
5
|
//# sourceMappingURL=expo.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkJSTCR7PQ_cjs = require('../chunk-JSTCR7PQ.cjs');
|
|
4
|
+
require('../chunk-PXMV7RPT.cjs');
|
|
5
5
|
require('../chunk-GUTKJMSF.cjs');
|
|
6
6
|
require('../chunk-CMPJR3HS.cjs');
|
|
7
7
|
require('../chunk-5BLDMQED.cjs');
|
|
@@ -11,7 +11,7 @@ var IndexedDBStorageAdapter = class {
|
|
|
11
11
|
dbName;
|
|
12
12
|
version;
|
|
13
13
|
db = null;
|
|
14
|
-
constructor(dbName, version =
|
|
14
|
+
constructor(dbName, version = chunkJSTCR7PQ_cjs.DB_VERSION) {
|
|
15
15
|
this.dbName = dbName;
|
|
16
16
|
this.version = version;
|
|
17
17
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DB_VERSION } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { DB_VERSION } from '../chunk-CCUUO2GR.js';
|
|
2
|
+
import '../chunk-ISWKPRX3.js';
|
|
3
3
|
import '../chunk-CUSABEUQ.js';
|
|
4
4
|
import '../chunk-OUVTG72A.js';
|
|
5
5
|
import '../chunk-NSBPE2FW.js';
|
|
@@ -4432,4 +4432,4 @@ declare namespace ProtoTypes {
|
|
|
4432
4432
|
export { };
|
|
4433
4433
|
}
|
|
4434
4434
|
|
|
4435
|
-
export {
|
|
4435
|
+
export { type SignerSession as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type DescriptorProvider as D, type ExtendedVirtualCoin as E, type IReadonlyWallet as F, type GetVtxosFilter as G, type ReadonlyIdentity as H, type IWallet as I, type DelegateProvider as J, type ReadonlyWalletConfig as K, type IReadonlyAssetManager as L, type NetworkName as M, type Network as N, type OnchainProvider as O, type ArkInfo as P, ArkAddress as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type Coin as U, VtxoScript as V, type WalletRepository as W, ContractManager as X, CSVMultisigTapscript as Y, type SettlementConfig as Z, VtxoManager as _, type Identity as a, DigestMismatchError as a$, type SignedIntent as a0, Intent as a1, type VtxoRepositoryKey as a2, type WalletState as a3, type ContractFilter as a4, type DescriptorSigningRequest as a5, Transaction as a6, type IntentFeeConfig as a7, type OffchainInput as a8, FeeAmount as a9, type Outpoint as aA, type ChainTx as aB, type PathContext as aC, type ArkTapscript as aD, type Asset as aE, type AssetMetadata as aF, type BaseWalletConfig as aG, type BatchInfo as aH, type BatchSignableIdentity as aI, CLTVMultisigTapscript as aJ, ChainTxType as aK, type CommitmentTx as aL, ConditionCSVMultisigTapscript as aM, ConditionMultisigTapscript as aN, type ContractBalance as aO, type ContractEventCallback as aP, type ContractHandler as aQ, type ContractManagerConfig as aR, type ContractState as aS, type ContractVtxo as aT, ContractWatcher as aU, DelegateManagerImpl as aV, type DelegateOptions as aW, DelegatorManagerImpl as aX, type DelegatorProvider as aY, type DeprecatedSignerMigrationReport as aZ, type DeprecatedSignerReport as a_, type OnchainInput as aa, type FeeOutput as ab, type ContractWatcherConfig as ac, type FeeInfo as ad, type CreateContractParams as ae, type GetContractsFilter as af, type GetSpendablePathsOptions as ag, type GetAllSpendingPathsOptions as ah, type IssuanceParams as ai, type ReissuanceParams as aj, type BurnParams as ak, type RenewVtxosOptions as al, type ContractWithVtxos as am, type PathSelection as an, type ContractEvent as ao, type AssetDetails as ap, type IssuanceResult as aq, type DelegateInfo as ar, type MigrationGlobalSkipReason as as, type MigrationLegSkipReason as at, type SignerStatus as au, type StorageConfig as av, type IVtxoManager as aw, type ExplorerTransaction as ax, type EncodedVtxoScript as ay, type Status as az, type WalletConfig as b, type Discoverable as b0, type DiscoveredContract as b1, type DiscoveryDeps as b2, ESPLORA_URL as b3, EsploraProvider as b4, type ExtendedContractVtxo as b5, type HandlerError as b6, type IDelegatorManager as b7, IndexerTxType as b8, type KnownMetadata as b9, type Tx as bA, type TxHistoryRecord as bB, type TxKey as bC, type TxTreeNode as bD, TxType as bE, type VirtualStatus as bF, type Vtxo as bG, type VtxoChain as bH, type VtxoType as bI, type WalletMode as bJ, classifyAgainstSignerSet as bK, classifyContractSigner as bL, decodeTapscript as bM, getSequence as bN, isBatchSignable as bO, isCooperativelyMigratable as bP, isDiscoverable as bQ, isExpired as bR, isRecoverable as bS, isSpendable as bT, isSubdust as bU, isVtxoExpiringSoon as bV, networks as bW, signerSetFromInfo as bX, toXOnlySignerHex as bY, type MigrateDeprecatedSignerOptions as ba, type MigrationLegReport as bb, type MigrationVtxoRef as bc, MultisigTapscript as bd, type Nonces as be, type Output as bf, type PageResponse as bg, type PaginationOptions as bh, PartialSig as bi, type ProviderClass as bj, RestDelegateProvider as bk, RestDelegatorProvider as bl, type ScanContractsOptions as bm, type ScanResult as bn, type ScheduledSession as bo, SettlementEventType as bp, type SignRequest as bq, type SignerClassification as br, type SignerSet as bs, type SubscriptionEvent as bt, type SubscriptionHeartbeat as bu, type TapLeaves as bv, TapTreeCoder as bw, TapscriptType as bx, type TreeNonces as by, type TreePartialSigs as bz, type WalletBalance as c, type ExtendedCoin as d, type IContractManager as e, type IDelegateManager as f, type SettleParams as g, type SettlementEvent as h, type IAssetManager as i, RestArkProvider as j, RestIndexerProvider as k, type SubscriptionResponse as l, type ArkProvider as m, type IndexerProvider as n, type RelativeTimelock as o, type TapLeafScript as p, type VirtualCoin as q, type Contract as r, type TreeSigningStartedEvent as s, TxTree as t, type TreeNoncesEvent as u, type BatchFinalizationEvent as v, type BatchFinalizedEvent as w, type BatchFailedEvent as x, type TreeTxEvent as y, type TreeSignatureEvent as z };
|
|
@@ -4432,4 +4432,4 @@ declare namespace ProtoTypes {
|
|
|
4432
4432
|
export { };
|
|
4433
4433
|
}
|
|
4434
4434
|
|
|
4435
|
-
export {
|
|
4435
|
+
export { type SignerSession as $, type ArkTransaction as A, type BatchStartedEvent as B, type ContractRepository as C, type DescriptorProvider as D, type ExtendedVirtualCoin as E, type IReadonlyWallet as F, type GetVtxosFilter as G, type ReadonlyIdentity as H, type IWallet as I, type DelegateProvider as J, type ReadonlyWalletConfig as K, type IReadonlyAssetManager as L, type NetworkName as M, type Network as N, type OnchainProvider as O, type ArkInfo as P, ArkAddress as Q, type Recipient as R, type SendBitcoinParams as S, type TxNotification as T, type Coin as U, VtxoScript as V, type WalletRepository as W, ContractManager as X, CSVMultisigTapscript as Y, type SettlementConfig as Z, VtxoManager as _, type Identity as a, DigestMismatchError as a$, type SignedIntent as a0, Intent as a1, type VtxoRepositoryKey as a2, type WalletState as a3, type ContractFilter as a4, type DescriptorSigningRequest as a5, Transaction as a6, type IntentFeeConfig as a7, type OffchainInput as a8, FeeAmount as a9, type Outpoint as aA, type ChainTx as aB, type PathContext as aC, type ArkTapscript as aD, type Asset as aE, type AssetMetadata as aF, type BaseWalletConfig as aG, type BatchInfo as aH, type BatchSignableIdentity as aI, CLTVMultisigTapscript as aJ, ChainTxType as aK, type CommitmentTx as aL, ConditionCSVMultisigTapscript as aM, ConditionMultisigTapscript as aN, type ContractBalance as aO, type ContractEventCallback as aP, type ContractHandler as aQ, type ContractManagerConfig as aR, type ContractState as aS, type ContractVtxo as aT, ContractWatcher as aU, DelegateManagerImpl as aV, type DelegateOptions as aW, DelegatorManagerImpl as aX, type DelegatorProvider as aY, type DeprecatedSignerMigrationReport as aZ, type DeprecatedSignerReport as a_, type OnchainInput as aa, type FeeOutput as ab, type ContractWatcherConfig as ac, type FeeInfo as ad, type CreateContractParams as ae, type GetContractsFilter as af, type GetSpendablePathsOptions as ag, type GetAllSpendingPathsOptions as ah, type IssuanceParams as ai, type ReissuanceParams as aj, type BurnParams as ak, type RenewVtxosOptions as al, type ContractWithVtxos as am, type PathSelection as an, type ContractEvent as ao, type AssetDetails as ap, type IssuanceResult as aq, type DelegateInfo as ar, type MigrationGlobalSkipReason as as, type MigrationLegSkipReason as at, type SignerStatus as au, type StorageConfig as av, type IVtxoManager as aw, type ExplorerTransaction as ax, type EncodedVtxoScript as ay, type Status as az, type WalletConfig as b, type Discoverable as b0, type DiscoveredContract as b1, type DiscoveryDeps as b2, ESPLORA_URL as b3, EsploraProvider as b4, type ExtendedContractVtxo as b5, type HandlerError as b6, type IDelegatorManager as b7, IndexerTxType as b8, type KnownMetadata as b9, type Tx as bA, type TxHistoryRecord as bB, type TxKey as bC, type TxTreeNode as bD, TxType as bE, type VirtualStatus as bF, type Vtxo as bG, type VtxoChain as bH, type VtxoType as bI, type WalletMode as bJ, classifyAgainstSignerSet as bK, classifyContractSigner as bL, decodeTapscript as bM, getSequence as bN, isBatchSignable as bO, isCooperativelyMigratable as bP, isDiscoverable as bQ, isExpired as bR, isRecoverable as bS, isSpendable as bT, isSubdust as bU, isVtxoExpiringSoon as bV, networks as bW, signerSetFromInfo as bX, toXOnlySignerHex as bY, type MigrateDeprecatedSignerOptions as ba, type MigrationLegReport as bb, type MigrationVtxoRef as bc, MultisigTapscript as bd, type Nonces as be, type Output as bf, type PageResponse as bg, type PaginationOptions as bh, PartialSig as bi, type ProviderClass as bj, RestDelegateProvider as bk, RestDelegatorProvider as bl, type ScanContractsOptions as bm, type ScanResult as bn, type ScheduledSession as bo, SettlementEventType as bp, type SignRequest as bq, type SignerClassification as br, type SignerSet as bs, type SubscriptionEvent as bt, type SubscriptionHeartbeat as bu, type TapLeaves as bv, TapTreeCoder as bw, TapscriptType as bx, type TreeNonces as by, type TreePartialSigs as bz, type WalletBalance as c, type ExtendedCoin as d, type IContractManager as e, type IDelegateManager as f, type SettleParams as g, type SettlementEvent as h, type IAssetManager as i, RestArkProvider as j, RestIndexerProvider as k, type SubscriptionResponse as l, type ArkProvider as m, type IndexerProvider as n, type RelativeTimelock as o, type TapLeafScript as p, type VirtualCoin as q, type Contract as r, type TreeSigningStartedEvent as s, TxTree as t, type TreeNoncesEvent as u, type BatchFinalizationEvent as v, type BatchFinalizedEvent as w, type BatchFailedEvent as x, type TreeTxEvent as y, type TreeSignatureEvent as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-CVEgBO6d.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Minimal async key-value storage interface.
|
|
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
|
|
|
46
46
|
private writeList;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as TaskQueue, c as TaskItem, d as TaskResult } from './taskRunner-Dfmt7ZPN.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Minimal async key-value storage interface.
|
|
@@ -46,4 +46,4 @@ declare class AsyncStorageTaskQueue implements TaskQueue {
|
|
|
46
46
|
private writeList;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
export {
|
|
49
|
+
export { AsyncStorageTaskQueue as A, type AsyncStorageLike as a };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRandomId, extendVirtualCoinForContract, warnAndFilterVtxosForScript, saveVtxosForContract } from './chunk-
|
|
1
|
+
import { getRandomId, extendVirtualCoinForContract, warnAndFilterVtxosForScript, saveVtxosForContract } from './chunk-CCUUO2GR.js';
|
|
2
2
|
|
|
3
3
|
// src/worker/expo/taskRunner.ts
|
|
4
4
|
async function runTasks(queue, processors, deps) {
|
|
@@ -91,5 +91,5 @@ var contractPollProcessor = {
|
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
export { CONTRACT_POLL_TASK_TYPE, contractPollProcessor, createTaskDependencies, runTasks };
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
95
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-A25NYZT5.js.map
|
|
95
|
+
//# sourceMappingURL=chunk-A25NYZT5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/worker/expo/taskRunner.ts","../src/worker/expo/processors/contractPollProcessor.ts"],"names":[],"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,U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AA,QACT;AAAA,OACJ;AACA,MAAA,MAAM,oBAAA,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-Z2VRVZW4.js","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 { ArkProvider } 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: ArkProvider;\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: ArkProvider;\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 type { TaskItem, TaskResult } from \"../taskQueue\";\nimport type { TaskProcessor, TaskDependencies } from \"../taskRunner\";\nimport type { ExtendedVirtualCoin } from \"../../../wallet\";\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 all contracts 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 const contracts = await contractRepository.getContracts();\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 indexerProvider.getVtxos({\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":[],"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,YA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AAI,MAAM,gBAAgB,QAAA,CAAS;AAAA,UACnD,OAAA,EAAS,CAAC,QAAA,CAAS,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,GAAW,2BAAA;AAAA,QACb,QAAA;AAAA,QACA,QAAA,CAAS,MAAA;AAAA,QACT;AAAA,OACJ;AACA,MAAA,MAAM,oBAAA,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-A25NYZT5.js","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 { ArkProvider } 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: ArkProvider;\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: ArkProvider;\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 type { TaskItem, TaskResult } from \"../taskQueue\";\nimport type { TaskProcessor, TaskDependencies } from \"../taskRunner\";\nimport type { ExtendedVirtualCoin } from \"../../../wallet\";\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 all contracts 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 const contracts = await contractRepository.getContracts();\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 indexerProvider.getVtxos({\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,4 +1,4 @@
|
|
|
1
|
-
import { craftToSpendTx, Transaction, OP_RETURN_EMPTY_PKSCRIPT, baseFetch, Intent, getArkPsbtFields, CosignerPublicKey, setArkPsbtField, VtxoTaprootTree, maybeArkError, AssetRef, AssetId, AssetOutput, AssetGroup, AssetInput, Packet, Metadata, isEventSourceError, RestArkProvider, RestIndexerProvider, ArkError, BufferReader } from './chunk-
|
|
1
|
+
import { craftToSpendTx, Transaction, OP_RETURN_EMPTY_PKSCRIPT, baseFetch, Intent, getArkPsbtFields, CosignerPublicKey, setArkPsbtField, VtxoTaprootTree, maybeArkError, AssetRef, AssetId, AssetOutput, AssetGroup, AssetInput, Packet, Metadata, isEventSourceError, RestArkProvider, RestIndexerProvider, ArkError, BufferReader } from './chunk-ISWKPRX3.js';
|
|
2
2
|
import { isMainnetDescriptor, descriptorIsOurs, contractHandlers, DEFAULT_PAGE_SIZE, DelegateVtxo, WALLET_RECEIVE_SOURCE, deriveDescriptorLeafPubKey, DefaultVtxo, BoardingContractHandler } from './chunk-CUSABEUQ.js';
|
|
3
3
|
import { VtxoScript, timelockToSequence, DEFAULT_NETWORK, DEFAULT_NETWORK_NAME, decodeTapscript, scriptFromTapLeafScript, CLTVMultisigTapscript, ArkAddress, CSVMultisigTapscript, getSequence, getNetwork, MultisigTapscript, networks as networks$1, DEFAULT_ARKADE_SERVER_URL } from './chunk-OUVTG72A.js';
|
|
4
4
|
import { sha256, hash160, sha256x2, concatBytes, randomPrivateKeyBytes, pubECDSA, pubSchnorr, equalBytes as equalBytes$1 } from '@scure/btc-signer/utils.js';
|
|
@@ -8420,7 +8420,7 @@ async function resolveDescriptorProvider(config, walletRepository) {
|
|
|
8420
8420
|
var MissingSigningDescriptorError = class extends Error {
|
|
8421
8421
|
constructor(contractScript, contractType) {
|
|
8422
8422
|
super(
|
|
8423
|
-
`Cannot sign input for ${contractType} contract ${contractScript}: metadata.signingDescriptor is missing.
|
|
8423
|
+
`Cannot sign input for ${contractType} contract ${contractScript}: metadata.signingDescriptor is missing. Possible causes: this wallet was rotated on an earlier build that did not persist signing descriptors, or the contract belongs to a different identity. Manually set metadata.signingDescriptor on the contract record, or restore from a pre-rotation snapshot or delete the contract.`
|
|
8424
8424
|
);
|
|
8425
8425
|
this.contractScript = contractScript;
|
|
8426
8426
|
this.contractType = contractType;
|
|
@@ -8448,9 +8448,8 @@ var InputSignerRouter = class {
|
|
|
8448
8448
|
* here) so the routing rules never live in two places.
|
|
8449
8449
|
*
|
|
8450
8450
|
* Throws {@link MissingSigningDescriptorError} for a non-baseline
|
|
8451
|
-
* default/delegate contract whose `metadata.signingDescriptor` is
|
|
8452
|
-
* missing
|
|
8453
|
-
* here moves the failure earlier, before any PSBT is mutated.
|
|
8451
|
+
* default/delegate/boarding contract whose `metadata.signingDescriptor` is
|
|
8452
|
+
* missing.
|
|
8454
8453
|
*/
|
|
8455
8454
|
async classify(jobs) {
|
|
8456
8455
|
const identityIndexes = [];
|
|
@@ -15849,5 +15848,5 @@ function isArkContract(str) {
|
|
|
15849
15848
|
}
|
|
15850
15849
|
|
|
15851
15850
|
export { ArkNote, AssetManager, BIP322, Batch, ContractManager, ContractRepositoryImpl, ContractWatcher, DB_VERSION, DEFAULT_MESSAGE_TIMEOUTS, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EsploraProvider, Estimator, HDDescriptorProvider, InMemoryContractRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBWalletRepository, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MessageBus, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, P2A, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, Unroll, VtxoManager, Wallet2 as Wallet, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, buildForfeitTx, buildOffchainTx, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, decodeArkContract, deserializeAssets, deserializeUtxo, deserializeVtxo, encodeArkContract, extendVirtualCoinForContract, getMigrationStatus, getRandomId, hasBoardingTxExpired, isArkContract, isBatchSignable, isCooperativelyMigratable, isDiscoverable, isExpired, isRecoverable, isSpendable, isSubdust, isValidArkAddress, isVtxoExpiringSoon, isVtxoForScript, migrateWalletRepository, openDatabase, requiresMigration, rollbackMigration, saveVtxosForContract, scriptFromArkAddress, serializeAssets, serializeUtxo, serializeVtxo, setupServiceWorker, signerSetFromInfo, toXOnlySignerHex, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, warnAndFilterVtxosForScript };
|
|
15852
|
-
//# sourceMappingURL=chunk-
|
|
15853
|
-
//# sourceMappingURL=chunk-
|
|
15851
|
+
//# sourceMappingURL=chunk-CCUUO2GR.js.map
|
|
15852
|
+
//# sourceMappingURL=chunk-CCUUO2GR.js.map
|