@arkade-os/sdk 0.5.10 → 0.5.11
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.js +3 -3
- package/dist/{asyncStorageTaskQueue-BSUY0Lz8.d.cts → asyncStorageTaskQueue-B6rFkXzW.d.cts} +2 -2
- package/dist/{asyncStorageTaskQueue-CXKwLEgC.d.ts → asyncStorageTaskQueue-C0irgPwJ.d.ts} +2 -2
- package/dist/{chunk-UWPYUDO4.cjs → chunk-5HCDXBBG.cjs} +3 -3
- package/dist/{chunk-UWPYUDO4.cjs.map → chunk-5HCDXBBG.cjs.map} +1 -1
- package/dist/{chunk-6GEVB7AN.cjs → chunk-DMYHAUTA.cjs} +438 -438
- package/dist/{chunk-6GEVB7AN.cjs.map → chunk-DMYHAUTA.cjs.map} +1 -1
- package/dist/{chunk-SJBQW6P4.cjs → chunk-GEK6QBSY.cjs} +18 -18
- package/dist/{chunk-SJBQW6P4.cjs.map → chunk-GEK6QBSY.cjs.map} +1 -1
- package/dist/{chunk-QEREPVKU.js → chunk-HRFWODLP.js} +3 -3
- package/dist/{chunk-QEREPVKU.js.map → chunk-HRFWODLP.js.map} +1 -1
- package/dist/{chunk-4MC7NHQT.js → chunk-KRKREYKT.js} +3 -3
- package/dist/{chunk-4MC7NHQT.js.map → chunk-KRKREYKT.js.map} +1 -1
- package/dist/{chunk-ZTZH4KEF.js → chunk-LKVVWCIW.js} +4 -4
- package/dist/{chunk-ZTZH4KEF.js.map → chunk-LKVVWCIW.js.map} +1 -1
- package/dist/{chunk-XWKQEAZE.cjs → chunk-NC6TEEHZ.cjs} +11 -11
- package/dist/{chunk-XWKQEAZE.cjs.map → chunk-NC6TEEHZ.cjs.map} +1 -1
- package/dist/{chunk-MPE7FTKE.js → chunk-SS5BPVQL.js} +3 -3
- package/dist/{chunk-MPE7FTKE.js.map → chunk-SS5BPVQL.js.map} +1 -1
- package/dist/{chunk-FMX2FMYH.js → chunk-VJQMUKPZ.js} +4 -4
- package/dist/{chunk-FMX2FMYH.js.map → chunk-VJQMUKPZ.js.map} +1 -1
- package/dist/{chunk-KOXW2WGD.cjs → chunk-VLO3JAP3.cjs} +8 -8
- package/dist/{chunk-KOXW2WGD.cjs.map → chunk-VLO3JAP3.cjs.map} +1 -1
- package/dist/{chunk-4HCV67LR.js → chunk-W2C3KDQA.js} +5 -5
- package/dist/{chunk-4HCV67LR.js.map → chunk-W2C3KDQA.js.map} +1 -1
- package/dist/{chunk-UU6GNWEC.cjs → chunk-WZ2UHHQ7.cjs} +17 -17
- package/dist/{chunk-UU6GNWEC.cjs.map → chunk-WZ2UHHQ7.cjs.map} +1 -1
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/index.cjs +321 -321
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +37 -37
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +35 -35
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-C1maPp-c.d.ts → taskRunner-BYxEgwM5.d.ts} +1 -1
- package/dist/{taskRunner-1wolHThW.d.cts → taskRunner-Z3LnHfgs.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +2 -2
- package/dist/wallet/expo/background.d.ts +2 -2
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +15 -15
- package/dist/wallet/expo/index.d.cts +1 -1
- package/dist/wallet/expo/index.d.ts +1 -1
- package/dist/wallet/expo/index.js +5 -5
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +3 -3
- package/dist/worker/expo/index.d.ts +3 -3
- package/dist/worker/expo/index.js +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, AbortError, ActivityRegistry, AmbiguousRouteError, ArkNote, Arkade, ArkadeCash, ArkadeCashCreateError, ArkadeCashOperatorMismatchError, AssetManager, BATCH_REGISTRATION_TERMINAL_STATES, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, CachingOperatorProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_PASSKEY_LABEL, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryBatchRegistrationRepository, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBBatchRegistrationRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBVtxoReservationRepository, IndexedDBWalletRepository, KeyringDescriptorProvider, MAX_PAGE_SIZE, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainCosignPreflightError, OnchainWallet, OversizedChangeError, P2A, PasskeyCancelled, PasskeyUnconfirmed, PaymentRouter, PrevTxUnavailableError, PrfUnavailable, REGTEST_MIN_BATCH_EXPIRY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestEmulatorProvider, SeedIdentity, SendDeadlineExceededError, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, StaticDescriptorProvider, TreeSignerSession, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, VtxoReservedError, Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WsElectrumChainSource, addArkadeCashRecord, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, arkade_exports as arkade, arkadeCashId, arkadeCashResolver, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertPageRequest, assertRecipientArkadeAddress, assertSendDeadline, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, assetsOf, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, captureSendDeadline, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyBoardingExpiry, classifyContractSigner, closeDatabase, collabExitResolver, collectBatchRegistrations, collectContracts, collectIntents, collectPages, collectScriptVtxos, collectTransactionHistory, collectUtxos, collectVtxos, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createArkadeCashTracker, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, createPrfPasskey, decodeArkContract, decodeBoardingExit, defaultBatchExpiryPolicy, deleteByIndex, deserializeExitPackage, encodeArkContract, evaluatePrf, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getRandomId, hasBoardingTxExpired, hasCandidates, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isContractVtxoEvent, isCooperativelyMigratable, isCosignFallback, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalBatchRegistrationState, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, iteratePages, logExcludedVtxos, makeHandle, matchServerCheckpoints, mergeArkadeCashRecord, mnemonicFromPrf, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, pageResult, prfSupport, promisifyRequest, provisionClaimSecret, provisionRefundKey, readArkadeCash, registerWalletRestoreHook, resolveAssetAmount, resolveBatchExpiryPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, selectCoinsWithAsset, selectVirtualCoins, selectionOf, serializeExitPackage, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, submitViaEmulator, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, walletFeeSource, withPrevTxs } from './chunk-
|
|
1
|
+
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, AbortError, ActivityRegistry, AmbiguousRouteError, ArkNote, Arkade, ArkadeCash, ArkadeCashCreateError, ArkadeCashOperatorMismatchError, AssetManager, BATCH_REGISTRATION_TERMINAL_STATES, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, CachingOperatorProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_PASSKEY_LABEL, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryBatchRegistrationRepository, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBBatchRegistrationRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBVtxoReservationRepository, IndexedDBWalletRepository, KeyringDescriptorProvider, MAX_PAGE_SIZE, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainCosignPreflightError, OnchainWallet, OversizedChangeError, P2A, PasskeyCancelled, PasskeyUnconfirmed, PaymentRouter, PrevTxUnavailableError, PrfUnavailable, REGTEST_MIN_BATCH_EXPIRY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestEmulatorProvider, SeedIdentity, SendDeadlineExceededError, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, StaticDescriptorProvider, TreeSignerSession, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, VtxoReservedError, Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WsElectrumChainSource, addArkadeCashRecord, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, arkade_exports as arkade, arkadeCashId, arkadeCashResolver, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertPageRequest, assertRecipientArkadeAddress, assertSendDeadline, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, assetsOf, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, captureSendDeadline, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyBoardingExpiry, classifyContractSigner, closeDatabase, collabExitResolver, collectBatchRegistrations, collectContracts, collectIntents, collectPages, collectScriptVtxos, collectTransactionHistory, collectUtxos, collectVtxos, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createArkadeCashTracker, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, createPrfPasskey, decodeArkContract, decodeBoardingExit, defaultBatchExpiryPolicy, deleteByIndex, deserializeExitPackage, encodeArkContract, evaluatePrf, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getRandomId, hasBoardingTxExpired, hasCandidates, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isContractVtxoEvent, isCooperativelyMigratable, isCosignFallback, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalBatchRegistrationState, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, iteratePages, logExcludedVtxos, makeHandle, matchServerCheckpoints, mergeArkadeCashRecord, mnemonicFromPrf, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, pageResult, prfSupport, promisifyRequest, provisionClaimSecret, provisionRefundKey, readArkadeCash, registerWalletRestoreHook, resolveAssetAmount, resolveBatchExpiryPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, selectCoinsWithAsset, selectVirtualCoins, selectionOf, serializeExitPackage, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, submitViaEmulator, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, walletFeeSource, withPrevTxs } from './chunk-W2C3KDQA.js';
|
|
2
2
|
import './chunk-PXEFYEKL.js';
|
|
3
|
-
export { ChainTxType, DEFAULT_VTXO_PAGE_SIZE, IndexerTxType, IndexerUtxosUnsupportedError, RestIndexerProvider, asset_exports as asset } from './chunk-
|
|
4
|
-
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, identityDescriptor, isCltvSatisfied, isCsvSpendable, normalizeToDescriptor, parseHDDescriptor } from './chunk-
|
|
3
|
+
export { ChainTxType, DEFAULT_VTXO_PAGE_SIZE, IndexerTxType, IndexerUtxosUnsupportedError, RestIndexerProvider, asset_exports as asset } from './chunk-KRKREYKT.js';
|
|
4
|
+
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, identityDescriptor, isCltvSatisfied, isCsvSpendable, normalizeToDescriptor, parseHDDescriptor } from './chunk-HRFWODLP.js';
|
|
5
5
|
export { UnsupportedProgramVersionError, toXOnly } from './chunk-4DUTRRXF.js';
|
|
6
|
-
export { ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ConditionWitness, CosignerPublicKey, DigestMismatchError, EventSourceUnavailableError, FetchError, HttpResponseError, Intent, OnchainCosignAmbiguousError, OnchainCosignRejectedError, OnchainCosignUnsupportedError, PrevArkTxField, PrevoutTxField, Proof, ProviderUnavailableError, READ_TIMEOUT_MS, RestArkProvider, RestOperatorProvider, ServerResponseMismatchError, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, assertAllowedSighashTypes, assertNonNegativeMs, assertTimerMs, buildVersion, canRecoverOnchain, canSpendOffchain, canSweepOnchain, configureEventSource, getAllNormalizedVtxos, getArkPsbtFields, getConfiguredEventSource, getNormalizedVtxos, isArkError, isEventSourceUnavailableError, isPastExpiry, isRetryableProviderError, isVirtualCoin, isVtxoSpent, maybeArkError, resolveEventSource, sdkVersion, setArkPsbtField, toOffchainInputFeeParams } from './chunk-
|
|
6
|
+
export { ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, ConditionWitness, CosignerPublicKey, DigestMismatchError, EventSourceUnavailableError, FetchError, HttpResponseError, Intent, OnchainCosignAmbiguousError, OnchainCosignRejectedError, OnchainCosignUnsupportedError, PrevArkTxField, PrevoutTxField, Proof, ProviderUnavailableError, READ_TIMEOUT_MS, RestArkProvider, RestOperatorProvider, ServerResponseMismatchError, SettlementEventType, Transaction, VtxoTaprootTree, VtxoTreeExpiry, assertAllowedSighashTypes, assertNonNegativeMs, assertTimerMs, buildVersion, canRecoverOnchain, canSpendOffchain, canSweepOnchain, configureEventSource, getAllNormalizedVtxos, getArkPsbtFields, getConfiguredEventSource, getNormalizedVtxos, isArkError, isEventSourceUnavailableError, isPastExpiry, isRetryableProviderError, isVirtualCoin, isVtxoSpent, maybeArkError, resolveEventSource, sdkVersion, setArkPsbtField, toOffchainInputFeeParams } from './chunk-SS5BPVQL.js';
|
|
7
7
|
export { ArkAddress, BITCOIN_EMULATOR_PUBKEY, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, DEFAULT_ARKADE_EMULATOR_URL, MUTINYNET_EMULATOR_PUBKEY, MultisigTapscript, REGTEST_EMULATOR_PUBKEY, TapTreeCoder, VtxoScript, assembleBtcdTaprootTree, decodeTapscript, defaultEmulatorPubkey, getNetwork, getSequence, networkFromArkadeInfo, networkFromOperatorInfo, networks, resolveEmulatorPubkey, scriptFromTapLeafScript, sequenceToTimelock, timelockToSequence } from './chunk-DPFD5KBK.js';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDMYHAUTA_cjs = require('../../chunk-DMYHAUTA.cjs');
|
|
4
4
|
require('../../chunk-OMZZQTDM.cjs');
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
5
|
+
require('../../chunk-GEK6QBSY.cjs');
|
|
6
|
+
require('../../chunk-VLO3JAP3.cjs');
|
|
7
7
|
require('../../chunk-UPIQZRNJ.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk5HCDXBBG_cjs = require('../../chunk-5HCDXBBG.cjs');
|
|
9
9
|
require('../../chunk-WIZCF5IX.cjs');
|
|
10
10
|
|
|
11
11
|
// src/repositories/realm/walletRepository.ts
|
|
@@ -42,7 +42,7 @@ var RealmWalletRepository = class {
|
|
|
42
42
|
await this.ensureInit();
|
|
43
43
|
this.realm.write(() => {
|
|
44
44
|
for (const vtxo of vtxos) {
|
|
45
|
-
const s =
|
|
45
|
+
const s = chunkDMYHAUTA_cjs.serializeVtxo(vtxo);
|
|
46
46
|
this.realm.create(
|
|
47
47
|
"ArkVtxo",
|
|
48
48
|
{
|
|
@@ -57,7 +57,7 @@ var RealmWalletRepository = class {
|
|
|
57
57
|
intentCb: s.intentTapLeafScript.cb,
|
|
58
58
|
intentS: s.intentTapLeafScript.s,
|
|
59
59
|
statusJson: JSON.stringify(s.status),
|
|
60
|
-
createdAt:
|
|
60
|
+
createdAt: chunkDMYHAUTA_cjs.createdAtToIso(s.createdAt),
|
|
61
61
|
isUnrolled: s.isUnrolled ?? false,
|
|
62
62
|
isSpent: s.isSpent === void 0 ? null : s.isSpent,
|
|
63
63
|
isSwept: s.isSwept === void 0 ? null : s.isSwept,
|
|
@@ -81,7 +81,7 @@ var RealmWalletRepository = class {
|
|
|
81
81
|
return this.deleteWhere("ArkVtxo", "address", address);
|
|
82
82
|
}
|
|
83
83
|
async getVtxosForScriptPage(script, page, options) {
|
|
84
|
-
|
|
84
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
85
85
|
await this.ensureInit();
|
|
86
86
|
let results = this.realm.objects("ArkVtxo").filtered("script == $0", script);
|
|
87
87
|
if (options?.unspentOnly) {
|
|
@@ -108,15 +108,15 @@ var RealmWalletRepository = class {
|
|
|
108
108
|
rows.push({ address: row.address, vtxo: vtxoObjectToDomain(row) });
|
|
109
109
|
if (rows.length > page.limit) break;
|
|
110
110
|
}
|
|
111
|
-
const result =
|
|
111
|
+
const result = chunkDMYHAUTA_cjs.pageResult(rows, page.limit, (row) => ({
|
|
112
112
|
address: row.address,
|
|
113
113
|
txid: row.vtxo.txid,
|
|
114
114
|
vout: row.vtxo.vout
|
|
115
115
|
}));
|
|
116
|
-
return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !
|
|
116
|
+
return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !chunk5HCDXBBG_cjs.isVtxoSpent(row.vtxo)) } : result;
|
|
117
117
|
}
|
|
118
118
|
async saveVtxosForScript(key, vtxos) {
|
|
119
|
-
return this.saveVtxos(
|
|
119
|
+
return this.saveVtxos(chunkDMYHAUTA_cjs.checkSaveVtxosForScript("RealmWalletRepository", key, vtxos), vtxos);
|
|
120
120
|
}
|
|
121
121
|
async deleteVtxosForScript(script) {
|
|
122
122
|
return this.deleteWhere("ArkVtxo", "script", script);
|
|
@@ -126,7 +126,7 @@ var RealmWalletRepository = class {
|
|
|
126
126
|
return this.pageByAddress("ArkUtxo", address, page, utxoObjectToDomain);
|
|
127
127
|
}
|
|
128
128
|
async pageByAddress(schema, address, page, deserialize) {
|
|
129
|
-
|
|
129
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
130
130
|
await this.ensureInit();
|
|
131
131
|
let results = this.realm.objects(schema).filtered("address == $0", address);
|
|
132
132
|
if (page.after) {
|
|
@@ -144,18 +144,18 @@ var RealmWalletRepository = class {
|
|
|
144
144
|
rows.push({ key: { txid: row.txid, vout: row.vout }, item: deserialize(row) });
|
|
145
145
|
if (rows.length > page.limit) break;
|
|
146
146
|
}
|
|
147
|
-
const result =
|
|
147
|
+
const result = chunkDMYHAUTA_cjs.pageResult(rows, page.limit, (row) => row.key);
|
|
148
148
|
return { items: result.items.map((row) => row.item), nextCursor: result.nextCursor };
|
|
149
149
|
}
|
|
150
150
|
async saveUtxos(addressOrBatch, utxos) {
|
|
151
151
|
await this.ensureInit();
|
|
152
|
-
const rows =
|
|
152
|
+
const rows = chunkDMYHAUTA_cjs.utxoEntries(addressOrBatch, utxos).flatMap(
|
|
153
153
|
([address, list]) => list.map((utxo) => ({ address, utxo }))
|
|
154
154
|
);
|
|
155
155
|
if (rows.length === 0) return;
|
|
156
156
|
this.realm.write(() => {
|
|
157
157
|
for (const { address, utxo } of rows) {
|
|
158
|
-
const s =
|
|
158
|
+
const s = chunkDMYHAUTA_cjs.serializeUtxo(utxo);
|
|
159
159
|
this.realm.create(
|
|
160
160
|
"ArkUtxo",
|
|
161
161
|
{
|
|
@@ -182,8 +182,8 @@ var RealmWalletRepository = class {
|
|
|
182
182
|
}
|
|
183
183
|
// ── Transaction history ────────────────────────────────────────────
|
|
184
184
|
async getTransactionHistoryPage(filter, page) {
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
186
|
+
chunkDMYHAUTA_cjs.assertHistoryPageFilter(filter);
|
|
187
187
|
let results = this.realm.objects("ArkTransaction").filtered("address == $0", filter.address);
|
|
188
188
|
results = results.filtered(
|
|
189
189
|
"createdAt >= $0",
|
|
@@ -197,12 +197,12 @@ var RealmWalletRepository = class {
|
|
|
197
197
|
["arkTxid", false]
|
|
198
198
|
])) {
|
|
199
199
|
const tx = txObjectToDomain(row);
|
|
200
|
-
if (page.after !== void 0 &&
|
|
200
|
+
if (page.after !== void 0 && chunkDMYHAUTA_cjs.compareHistoryCursors({ createdAt: tx.createdAt, key: tx.key }, page.after) <= 0)
|
|
201
201
|
continue;
|
|
202
202
|
rows.push(tx);
|
|
203
203
|
if (rows.length > page.limit) break;
|
|
204
204
|
}
|
|
205
|
-
return
|
|
205
|
+
return chunkDMYHAUTA_cjs.pageResult(rows, page.limit, (tx) => ({ createdAt: tx.createdAt, key: tx.key }));
|
|
206
206
|
}
|
|
207
207
|
async saveTransactions(address, txs) {
|
|
208
208
|
await this.ensureInit();
|
|
@@ -220,7 +220,7 @@ var RealmWalletRepository = class {
|
|
|
220
220
|
amount: tx.amount,
|
|
221
221
|
settled: tx.settled,
|
|
222
222
|
createdAt: tx.createdAt,
|
|
223
|
-
assetsJson: tx.assets ? JSON.stringify(
|
|
223
|
+
assetsJson: tx.assets ? JSON.stringify(chunkDMYHAUTA_cjs.serializeAssets(tx.assets)) : null
|
|
224
224
|
},
|
|
225
225
|
"modified"
|
|
226
226
|
);
|
|
@@ -250,7 +250,7 @@ var RealmWalletRepository = class {
|
|
|
250
250
|
settings: row.settingsJson ? JSON.parse(row.settingsJson) : void 0,
|
|
251
251
|
lastSyncTime: row.lastSyncTime ?? void 0
|
|
252
252
|
} : {};
|
|
253
|
-
const state =
|
|
253
|
+
const state = chunkDMYHAUTA_cjs.applyWalletStateUpdate(current, updater);
|
|
254
254
|
this.realm.create(
|
|
255
255
|
"ArkWalletState",
|
|
256
256
|
{
|
|
@@ -322,9 +322,9 @@ function vtxoObjectToDomain(obj) {
|
|
|
322
322
|
// Post-migration every row has `script`, but the backfill is
|
|
323
323
|
// idempotent: derive from `address` if the legacy column is still
|
|
324
324
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
325
|
-
script: obj.script ??
|
|
325
|
+
script: obj.script ?? chunkDMYHAUTA_cjs.scriptFromArkAddress(obj.address)
|
|
326
326
|
};
|
|
327
|
-
return
|
|
327
|
+
return chunkDMYHAUTA_cjs.deserializeVtxo(serialized);
|
|
328
328
|
}
|
|
329
329
|
function utxoObjectToDomain(obj) {
|
|
330
330
|
const serialized = {
|
|
@@ -343,7 +343,7 @@ function utxoObjectToDomain(obj) {
|
|
|
343
343
|
status: JSON.parse(obj.statusJson),
|
|
344
344
|
extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
|
|
345
345
|
};
|
|
346
|
-
return
|
|
346
|
+
return chunkDMYHAUTA_cjs.deserializeUtxo(serialized);
|
|
347
347
|
}
|
|
348
348
|
function txObjectToDomain(obj) {
|
|
349
349
|
const tx = {
|
|
@@ -358,7 +358,7 @@ function txObjectToDomain(obj) {
|
|
|
358
358
|
createdAt: obj.createdAt
|
|
359
359
|
};
|
|
360
360
|
if (obj.assetsJson) {
|
|
361
|
-
tx.assets =
|
|
361
|
+
tx.assets = chunkDMYHAUTA_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
|
|
362
362
|
}
|
|
363
363
|
return tx;
|
|
364
364
|
}
|
|
@@ -384,9 +384,9 @@ var RealmContractRepository = class {
|
|
|
384
384
|
}
|
|
385
385
|
// ── Contract management ────────────────────────────────────────────
|
|
386
386
|
async getContractsPage(filter, page) {
|
|
387
|
-
|
|
388
|
-
if (
|
|
389
|
-
const toPage = (rows) =>
|
|
387
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
388
|
+
if (chunkDMYHAUTA_cjs.contractFilterMatchesNothing(filter)) return { items: [] };
|
|
389
|
+
const toPage = (rows) => chunkDMYHAUTA_cjs.pageResult(rows.map(contractObjectToDomain), page.limit, (contract) => contract.script);
|
|
390
390
|
if (filter?.watch === void 0 || filter.script !== void 0) {
|
|
391
391
|
return toPage(this.readRows(filter, page));
|
|
392
392
|
}
|
|
@@ -420,7 +420,7 @@ var RealmContractRepository = class {
|
|
|
420
420
|
if (query) results = results.filtered(query, ...args);
|
|
421
421
|
const rows = [];
|
|
422
422
|
for (const row of results.sorted("script")) {
|
|
423
|
-
if (filter?.scope !== void 0 && ![filter.scope].flat().includes(
|
|
423
|
+
if (filter?.scope !== void 0 && ![filter.scope].flat().includes(chunkDMYHAUTA_cjs.scopeOf(contractObjectToDomain(row))))
|
|
424
424
|
continue;
|
|
425
425
|
rows.push(row);
|
|
426
426
|
if (rows.length > page.limit) break;
|
|
@@ -550,7 +550,7 @@ var RealmBatchRegistrationRepository = class {
|
|
|
550
550
|
const clashes = [
|
|
551
551
|
...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.registrationId)
|
|
552
552
|
].map(toIntent);
|
|
553
|
-
|
|
553
|
+
chunkDMYHAUTA_cjs.assertIntentIdUnique(intent, clashes);
|
|
554
554
|
}
|
|
555
555
|
this.realm.create(
|
|
556
556
|
"ArkIntent",
|
|
@@ -578,22 +578,22 @@ var RealmBatchRegistrationRepository = class {
|
|
|
578
578
|
});
|
|
579
579
|
}
|
|
580
580
|
async getBatchRegistrationsPage(filter, page) {
|
|
581
|
-
|
|
581
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
582
582
|
let results = this.realm.objects("ArkIntent");
|
|
583
583
|
if (page.after !== void 0) results = results.filtered("intentTxId > $0", page.after);
|
|
584
584
|
const rows = [];
|
|
585
585
|
for (const row of results.sorted("intentTxId")) {
|
|
586
586
|
const intent = toIntent(row);
|
|
587
|
-
if (filter && !
|
|
587
|
+
if (filter && !chunkDMYHAUTA_cjs.intentMatchesFilter(intent, filter)) continue;
|
|
588
588
|
rows.push(intent);
|
|
589
589
|
if (rows.length > page.limit) break;
|
|
590
590
|
}
|
|
591
|
-
return
|
|
591
|
+
return chunkDMYHAUTA_cjs.pageResult(rows, page.limit, (intent) => intent.proofTxId);
|
|
592
592
|
}
|
|
593
593
|
async getLockedVtxoOutpoints() {
|
|
594
594
|
const out = [];
|
|
595
595
|
for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
|
|
596
|
-
if (!
|
|
596
|
+
if (!chunkDMYHAUTA_cjs.isTerminalBatchRegistrationState(o.state)) out.push(...o.proofInputs);
|
|
597
597
|
return out;
|
|
598
598
|
}
|
|
599
599
|
/** @deprecated Use {@link saveBatchRegistration}. */
|
|
@@ -644,7 +644,7 @@ var RealmVirtualTxRepository = class {
|
|
|
644
644
|
txid: t.txid,
|
|
645
645
|
psbt: t.psbt ?? prev?.psbt ?? null,
|
|
646
646
|
expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
|
|
647
|
-
type:
|
|
647
|
+
type: chunkDMYHAUTA_cjs.mergeChainedTxType(t.type, prev?.type)
|
|
648
648
|
},
|
|
649
649
|
"modified"
|
|
650
650
|
);
|
|
@@ -890,9 +890,9 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
890
890
|
for (let i = 0; i < newVtxos.length; i++) {
|
|
891
891
|
const newVtxo = newVtxos[i];
|
|
892
892
|
if (!newVtxo.script) {
|
|
893
|
-
newVtxo.script =
|
|
893
|
+
newVtxo.script = chunkDMYHAUTA_cjs.scriptFromArkAddress(newVtxo.address);
|
|
894
894
|
}
|
|
895
|
-
const facts =
|
|
895
|
+
const facts = chunkDMYHAUTA_cjs.legacyVtxoFacts(legacyByPk.get(newVtxo.pk));
|
|
896
896
|
if (facts) {
|
|
897
897
|
if (newVtxo.isSpent == null) newVtxo.isSpent = facts.isSpent;
|
|
898
898
|
if (newVtxo.isSwept == null) newVtxo.isSwept = facts.isSwept;
|
|
@@ -922,7 +922,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
922
922
|
|
|
923
923
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
924
924
|
enumerable: true,
|
|
925
|
-
get: function () { return
|
|
925
|
+
get: function () { return chunkDMYHAUTA_cjs.ChainedTxType; }
|
|
926
926
|
});
|
|
927
927
|
exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
|
|
928
928
|
exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { serializeVtxo, createdAtToIso, assertPageRequest, pageResult, checkSaveVtxosForScript, utxoEntries, serializeUtxo, assertHistoryPageFilter, compareHistoryCursors, serializeAssets, applyWalletStateUpdate, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, contractFilterMatchesNothing, scopeOf, assertIntentIdUnique, intentMatchesFilter, isTerminalBatchRegistrationState, mergeChainedTxType, legacyVtxoFacts } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
1
|
+
import { serializeVtxo, createdAtToIso, assertPageRequest, pageResult, checkSaveVtxosForScript, utxoEntries, serializeUtxo, assertHistoryPageFilter, compareHistoryCursors, serializeAssets, applyWalletStateUpdate, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, contractFilterMatchesNothing, scopeOf, assertIntentIdUnique, intentMatchesFilter, isTerminalBatchRegistrationState, mergeChainedTxType, legacyVtxoFacts } from '../../chunk-W2C3KDQA.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-W2C3KDQA.js';
|
|
3
3
|
import '../../chunk-PXEFYEKL.js';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-KRKREYKT.js';
|
|
5
|
+
import '../../chunk-HRFWODLP.js';
|
|
6
6
|
import '../../chunk-4DUTRRXF.js';
|
|
7
|
-
import { isVtxoSpent } from '../../chunk-
|
|
7
|
+
import { isVtxoSpent } from '../../chunk-SS5BPVQL.js';
|
|
8
8
|
import '../../chunk-DPFD5KBK.js';
|
|
9
9
|
|
|
10
10
|
// src/repositories/realm/walletRepository.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkDMYHAUTA_cjs = require('../../chunk-DMYHAUTA.cjs');
|
|
4
4
|
require('../../chunk-OMZZQTDM.cjs');
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
5
|
+
require('../../chunk-GEK6QBSY.cjs');
|
|
6
|
+
require('../../chunk-VLO3JAP3.cjs');
|
|
7
7
|
require('../../chunk-UPIQZRNJ.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk5HCDXBBG_cjs = require('../../chunk-5HCDXBBG.cjs');
|
|
9
9
|
require('../../chunk-WIZCF5IX.cjs');
|
|
10
10
|
|
|
11
11
|
// src/repositories/sqlite/transaction.ts
|
|
@@ -242,7 +242,7 @@ var SQLiteWalletRepository = class {
|
|
|
242
242
|
for (const row of nullRows) {
|
|
243
243
|
await tx.run(
|
|
244
244
|
`UPDATE ${this.tables.vtxos} SET script = ? WHERE txid = ? AND vout = ?`,
|
|
245
|
-
[
|
|
245
|
+
[chunkDMYHAUTA_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
248
|
const tempName = `${this.tables.vtxos}__migrate_tmp`;
|
|
@@ -283,7 +283,7 @@ var SQLiteWalletRepository = class {
|
|
|
283
283
|
WHERE virtual_status_json IS NOT NULL AND is_swept IS NULL`
|
|
284
284
|
);
|
|
285
285
|
for (const row of rows) {
|
|
286
|
-
const facts =
|
|
286
|
+
const facts = chunkDMYHAUTA_cjs.legacyVtxoFacts(row.virtual_status_json);
|
|
287
287
|
if (!facts) continue;
|
|
288
288
|
await tx.run(
|
|
289
289
|
`UPDATE ${this.tables.vtxos}
|
|
@@ -375,7 +375,7 @@ var SQLiteWalletRepository = class {
|
|
|
375
375
|
expires_at, expires_at_height,
|
|
376
376
|
spent_by, settled_by, ark_tx_id, extra_witness_json, assets_json, script`,
|
|
377
377
|
vtxos.map((vtxo) => {
|
|
378
|
-
const s =
|
|
378
|
+
const s = chunkDMYHAUTA_cjs.serializeVtxo(vtxo);
|
|
379
379
|
return [
|
|
380
380
|
s.txid,
|
|
381
381
|
s.vout,
|
|
@@ -387,7 +387,7 @@ var SQLiteWalletRepository = class {
|
|
|
387
387
|
s.intentTapLeafScript.cb,
|
|
388
388
|
s.intentTapLeafScript.s,
|
|
389
389
|
JSON.stringify(s.status),
|
|
390
|
-
|
|
390
|
+
chunkDMYHAUTA_cjs.createdAtToIso(s.createdAt),
|
|
391
391
|
s.isUnrolled ? 1 : 0,
|
|
392
392
|
s.isSpent === void 0 ? null : s.isSpent ? 1 : 0,
|
|
393
393
|
s.isSwept === void 0 ? null : s.isSwept ? 1 : 0,
|
|
@@ -410,7 +410,7 @@ var SQLiteWalletRepository = class {
|
|
|
410
410
|
await this.db.run(`DELETE FROM ${this.tables.vtxos} WHERE address = ?`, [address]);
|
|
411
411
|
}
|
|
412
412
|
async getVtxosForScriptPage(script, page, options) {
|
|
413
|
-
|
|
413
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
414
414
|
await this.ensureInit();
|
|
415
415
|
const after = page.after;
|
|
416
416
|
const rows = await this.db.all(
|
|
@@ -428,15 +428,15 @@ var SQLiteWalletRepository = class {
|
|
|
428
428
|
page.limit + 1
|
|
429
429
|
] : [script, page.limit + 1]
|
|
430
430
|
);
|
|
431
|
-
const result =
|
|
431
|
+
const result = chunkDMYHAUTA_cjs.pageResult(
|
|
432
432
|
rows.map((row) => ({ address: row.address, vtxo: vtxoRowToDomain(row) })),
|
|
433
433
|
page.limit,
|
|
434
434
|
(row) => ({ address: row.address, txid: row.vtxo.txid, vout: row.vtxo.vout })
|
|
435
435
|
);
|
|
436
|
-
return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !
|
|
436
|
+
return options?.unspentOnly ? { ...result, items: result.items.filter((row) => !chunk5HCDXBBG_cjs.isVtxoSpent(row.vtxo)) } : result;
|
|
437
437
|
}
|
|
438
438
|
async saveVtxosForScript(key, vtxos) {
|
|
439
|
-
return this.saveVtxos(
|
|
439
|
+
return this.saveVtxos(chunkDMYHAUTA_cjs.checkSaveVtxosForScript("SQLiteWalletRepository", key, vtxos), vtxos);
|
|
440
440
|
}
|
|
441
441
|
async deleteVtxosForScript(script) {
|
|
442
442
|
await this.ensureInit();
|
|
@@ -447,21 +447,21 @@ var SQLiteWalletRepository = class {
|
|
|
447
447
|
return this.pageByAddress(this.tables.utxos, address, page, utxoRowToDomain);
|
|
448
448
|
}
|
|
449
449
|
async pageByAddress(table, address, page, deserialize) {
|
|
450
|
-
|
|
450
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
451
451
|
await this.ensureInit();
|
|
452
452
|
const rows = await this.db.all(
|
|
453
453
|
`SELECT * FROM ${table} WHERE address = ? AND (txid, vout) > (?, ?)
|
|
454
454
|
ORDER BY txid, vout LIMIT ?`,
|
|
455
455
|
[address, page.after?.txid ?? "", page.after?.vout ?? -1, page.limit + 1]
|
|
456
456
|
);
|
|
457
|
-
const result =
|
|
457
|
+
const result = chunkDMYHAUTA_cjs.pageResult(rows, page.limit, ({ txid, vout }) => ({ txid, vout }));
|
|
458
458
|
return { items: result.items.map(deserialize), nextCursor: result.nextCursor };
|
|
459
459
|
}
|
|
460
460
|
async saveUtxos(addressOrBatch, utxos) {
|
|
461
461
|
await this.ensureInit();
|
|
462
|
-
const rows =
|
|
462
|
+
const rows = chunkDMYHAUTA_cjs.utxoEntries(addressOrBatch, utxos).flatMap(
|
|
463
463
|
([address, list]) => list.map((utxo) => {
|
|
464
|
-
const s =
|
|
464
|
+
const s = chunkDMYHAUTA_cjs.serializeUtxo(utxo);
|
|
465
465
|
return [
|
|
466
466
|
s.txid,
|
|
467
467
|
s.vout,
|
|
@@ -491,8 +491,8 @@ var SQLiteWalletRepository = class {
|
|
|
491
491
|
}
|
|
492
492
|
// ── Transaction history ────────────────────────────────────────────
|
|
493
493
|
async getTransactionHistoryPage(filter, page) {
|
|
494
|
-
|
|
495
|
-
|
|
494
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
495
|
+
chunkDMYHAUTA_cjs.assertHistoryPageFilter(filter);
|
|
496
496
|
await this.ensureInit();
|
|
497
497
|
const conditions = ["address = ?"];
|
|
498
498
|
const params = [filter.address];
|
|
@@ -516,7 +516,7 @@ var SQLiteWalletRepository = class {
|
|
|
516
516
|
ORDER BY created_at, boarding_txid, commitment_txid, ark_txid LIMIT ?`,
|
|
517
517
|
[...params, page.limit + 1]
|
|
518
518
|
);
|
|
519
|
-
return
|
|
519
|
+
return chunkDMYHAUTA_cjs.pageResult(rows.map(txRowToDomain), page.limit, (tx) => ({
|
|
520
520
|
createdAt: tx.createdAt,
|
|
521
521
|
key: tx.key
|
|
522
522
|
}));
|
|
@@ -536,7 +536,7 @@ var SQLiteWalletRepository = class {
|
|
|
536
536
|
tx.amount,
|
|
537
537
|
tx.settled ? 1 : 0,
|
|
538
538
|
tx.createdAt,
|
|
539
|
-
tx.assets ? JSON.stringify(
|
|
539
|
+
tx.assets ? JSON.stringify(chunkDMYHAUTA_cjs.serializeAssets(tx.assets)) : null
|
|
540
540
|
])
|
|
541
541
|
);
|
|
542
542
|
}
|
|
@@ -558,7 +558,7 @@ var SQLiteWalletRepository = class {
|
|
|
558
558
|
settings: row.settings_json ? JSON.parse(row.settings_json) : void 0,
|
|
559
559
|
lastSyncTime: row.last_sync_time ?? void 0
|
|
560
560
|
} : {};
|
|
561
|
-
const state =
|
|
561
|
+
const state = chunkDMYHAUTA_cjs.applyWalletStateUpdate(current, updater);
|
|
562
562
|
await tx.run(
|
|
563
563
|
`INSERT OR REPLACE INTO ${this.tables.walletState}
|
|
564
564
|
(key, settings_json, last_sync_time) VALUES (?, ?, ?)`,
|
|
@@ -631,9 +631,9 @@ function vtxoRowToDomain(row) {
|
|
|
631
631
|
// Post-migration every row has `script`, but the backfill is
|
|
632
632
|
// idempotent: derive from `address` if the legacy column is still
|
|
633
633
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
634
|
-
script: row.script ??
|
|
634
|
+
script: row.script ?? chunkDMYHAUTA_cjs.scriptFromArkAddress(row.address)
|
|
635
635
|
};
|
|
636
|
-
return
|
|
636
|
+
return chunkDMYHAUTA_cjs.deserializeVtxo(serialized);
|
|
637
637
|
}
|
|
638
638
|
function utxoRowToDomain(row) {
|
|
639
639
|
const serialized = {
|
|
@@ -652,7 +652,7 @@ function utxoRowToDomain(row) {
|
|
|
652
652
|
status: JSON.parse(row.status_json),
|
|
653
653
|
extraWitness: row.extra_witness_json ? JSON.parse(row.extra_witness_json) : void 0
|
|
654
654
|
};
|
|
655
|
-
return
|
|
655
|
+
return chunkDMYHAUTA_cjs.deserializeUtxo(serialized);
|
|
656
656
|
}
|
|
657
657
|
function txRowToDomain(row) {
|
|
658
658
|
const tx = {
|
|
@@ -667,7 +667,7 @@ function txRowToDomain(row) {
|
|
|
667
667
|
createdAt: row.created_at
|
|
668
668
|
};
|
|
669
669
|
if (row.assets_json) {
|
|
670
|
-
tx.assets =
|
|
670
|
+
tx.assets = chunkDMYHAUTA_cjs.deserializeAssets(JSON.parse(row.assets_json));
|
|
671
671
|
}
|
|
672
672
|
return tx;
|
|
673
673
|
}
|
|
@@ -737,9 +737,9 @@ var SQLiteContractRepository = class {
|
|
|
737
737
|
}
|
|
738
738
|
// ── Contract management ────────────────────────────────────────────
|
|
739
739
|
async getContractsPage(filter, page) {
|
|
740
|
-
|
|
740
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
741
741
|
await this.ensureInit();
|
|
742
|
-
if (
|
|
742
|
+
if (chunkDMYHAUTA_cjs.contractFilterMatchesNothing(filter)) return { items: [] };
|
|
743
743
|
const conditions = [];
|
|
744
744
|
const params = [];
|
|
745
745
|
if (filter) {
|
|
@@ -758,12 +758,12 @@ var SQLiteContractRepository = class {
|
|
|
758
758
|
[...params, ...after === void 0 ? [] : [after], page.limit + 1]
|
|
759
759
|
);
|
|
760
760
|
for (const contract of rows.map(contractRowToDomain)) {
|
|
761
|
-
if (!wanted || wanted.includes(
|
|
761
|
+
if (!wanted || wanted.includes(chunkDMYHAUTA_cjs.scopeOf(contract))) matches.push(contract);
|
|
762
762
|
}
|
|
763
763
|
if (!wanted || rows.length <= page.limit || matches.length > page.limit) break;
|
|
764
764
|
after = rows[rows.length - 1].script;
|
|
765
765
|
}
|
|
766
|
-
return
|
|
766
|
+
return chunkDMYHAUTA_cjs.pageResult(matches, page.limit, (contract) => contract.script);
|
|
767
767
|
}
|
|
768
768
|
async saveContract(contract) {
|
|
769
769
|
await this.ensureInit();
|
|
@@ -930,7 +930,7 @@ var SQLiteBatchRegistrationRepository = class {
|
|
|
930
930
|
});
|
|
931
931
|
}
|
|
932
932
|
async getBatchRegistrationsPage(filter, page) {
|
|
933
|
-
|
|
933
|
+
chunkDMYHAUTA_cjs.assertPageRequest(page);
|
|
934
934
|
await this.ensureInit();
|
|
935
935
|
if (filter?.states?.length === 0) return { items: [] };
|
|
936
936
|
const stateSql = filter?.states ? ` AND state IN (${filter.states.map(() => "?").join(", ")})` : "";
|
|
@@ -947,19 +947,19 @@ var SQLiteBatchRegistrationRepository = class {
|
|
|
947
947
|
for (const row of batch) {
|
|
948
948
|
after = row.intent_tx_id;
|
|
949
949
|
const intent = rowToIntent(row);
|
|
950
|
-
if (!filter ||
|
|
950
|
+
if (!filter || chunkDMYHAUTA_cjs.intentMatchesFilter(intent, filter)) rows.push(intent);
|
|
951
951
|
if (rows.length > page.limit) break;
|
|
952
952
|
}
|
|
953
953
|
if (batch.length < batchSize) break;
|
|
954
954
|
}
|
|
955
|
-
return
|
|
955
|
+
return chunkDMYHAUTA_cjs.pageResult(rows, page.limit, (intent) => intent.proofTxId);
|
|
956
956
|
}
|
|
957
957
|
async getLockedVtxoOutpoints() {
|
|
958
958
|
await this.ensureInit();
|
|
959
959
|
const rows = await this.db.all(`SELECT * FROM ${this.t}`);
|
|
960
960
|
const out = [];
|
|
961
961
|
for (const r of rows) {
|
|
962
|
-
if (
|
|
962
|
+
if (chunkDMYHAUTA_cjs.isTerminalBatchRegistrationState(r.state)) continue;
|
|
963
963
|
for (const o of JSON.parse(r.intent_vtxos_json)) out.push(o);
|
|
964
964
|
}
|
|
965
965
|
return out;
|
|
@@ -1055,7 +1055,7 @@ var SQLiteVirtualTxRepository = class {
|
|
|
1055
1055
|
const prev = prevByTxid.get(t.txid);
|
|
1056
1056
|
const psbt = t.psbt ?? prev?.psbt ?? null;
|
|
1057
1057
|
const expires = t.expiresAt ?? prev?.expires_at ?? null;
|
|
1058
|
-
const type =
|
|
1058
|
+
const type = chunkDMYHAUTA_cjs.mergeChainedTxType(t.type, prev?.type);
|
|
1059
1059
|
await tx.run(
|
|
1060
1060
|
`INSERT OR REPLACE INTO ${this.tTx} (txid, psbt, expires_at, type) VALUES (?, ?, ?, ?)`,
|
|
1061
1061
|
[t.txid, psbt, expires, type]
|
|
@@ -1141,7 +1141,7 @@ function rowToTx(r) {
|
|
|
1141
1141
|
|
|
1142
1142
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
1143
1143
|
enumerable: true,
|
|
1144
|
-
get: function () { return
|
|
1144
|
+
get: function () { return chunkDMYHAUTA_cjs.ChainedTxType; }
|
|
1145
1145
|
});
|
|
1146
1146
|
exports.SQLiteBatchRegistrationRepository = SQLiteBatchRegistrationRepository;
|
|
1147
1147
|
exports.SQLiteContractRepository = SQLiteContractRepository;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { legacyVtxoFacts, serializeVtxo, createdAtToIso, assertPageRequest, pageResult, checkSaveVtxosForScript, utxoEntries, serializeUtxo, assertHistoryPageFilter, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, contractFilterMatchesNothing, scopeOf, intentMatchesFilter, isTerminalBatchRegistrationState, applyWalletStateUpdate, mergeChainedTxType } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
1
|
+
import { legacyVtxoFacts, serializeVtxo, createdAtToIso, assertPageRequest, pageResult, checkSaveVtxosForScript, utxoEntries, serializeUtxo, assertHistoryPageFilter, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, contractFilterMatchesNothing, scopeOf, intentMatchesFilter, isTerminalBatchRegistrationState, applyWalletStateUpdate, mergeChainedTxType } from '../../chunk-W2C3KDQA.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-W2C3KDQA.js';
|
|
3
3
|
import '../../chunk-PXEFYEKL.js';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-KRKREYKT.js';
|
|
5
|
+
import '../../chunk-HRFWODLP.js';
|
|
6
6
|
import '../../chunk-4DUTRRXF.js';
|
|
7
|
-
import { isVtxoSpent } from '../../chunk-
|
|
7
|
+
import { isVtxoSpent } from '../../chunk-SS5BPVQL.js';
|
|
8
8
|
import '../../chunk-DPFD5KBK.js';
|
|
9
9
|
|
|
10
10
|
// src/repositories/sqlite/transaction.ts
|
|
@@ -111,4 +111,4 @@ interface CreateTaskDependenciesOptions {
|
|
|
111
111
|
*/
|
|
112
112
|
declare function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies;
|
|
113
113
|
|
|
114
|
-
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type
|
|
114
|
+
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
|
|
@@ -111,4 +111,4 @@ interface CreateTaskDependenciesOptions {
|
|
|
111
111
|
*/
|
|
112
112
|
declare function createTaskDependencies(options: CreateTaskDependenciesOptions): TaskDependencies;
|
|
113
113
|
|
|
114
|
-
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type
|
|
114
|
+
export { type CreateTaskDependenciesOptions as C, InMemoryTaskQueue as I, type TaskProcessor as T, type TaskDependencies as a, type TaskItem as b, type TaskQueue as c, type TaskResult as d, createTaskDependencies as e, runTasks as r };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkWZ2UHHQ7_cjs = require('../../chunk-WZ2UHHQ7.cjs');
|
|
4
|
+
var chunkNC6TEEHZ_cjs = require('../../chunk-NC6TEEHZ.cjs');
|
|
5
|
+
var chunkDMYHAUTA_cjs = require('../../chunk-DMYHAUTA.cjs');
|
|
6
6
|
require('../../chunk-OMZZQTDM.cjs');
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
7
|
+
require('../../chunk-GEK6QBSY.cjs');
|
|
8
|
+
require('../../chunk-VLO3JAP3.cjs');
|
|
9
9
|
require('../../chunk-UPIQZRNJ.cjs');
|
|
10
|
-
require('../../chunk-
|
|
10
|
+
require('../../chunk-5HCDXBBG.cjs');
|
|
11
11
|
require('../../chunk-WIZCF5IX.cjs');
|
|
12
12
|
var TaskManager = require('expo-task-manager');
|
|
13
13
|
var BackgroundTask = require('expo-background-task');
|
|
@@ -38,7 +38,7 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
38
38
|
taskQueue,
|
|
39
39
|
walletRepository,
|
|
40
40
|
contractRepository,
|
|
41
|
-
processors = [
|
|
41
|
+
processors = [chunkNC6TEEHZ_cjs.contractPollProcessor]
|
|
42
42
|
} = options;
|
|
43
43
|
TaskManager__namespace.defineTask(taskName, async () => {
|
|
44
44
|
try {
|
|
@@ -46,24 +46,24 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
46
46
|
if (!config) {
|
|
47
47
|
return BackgroundTask__namespace.BackgroundTaskResult.Success;
|
|
48
48
|
}
|
|
49
|
-
const indexerProvider = new
|
|
50
|
-
const arkProvider = new
|
|
51
|
-
const deps =
|
|
49
|
+
const indexerProvider = new chunkWZ2UHHQ7_cjs.ExpoIndexerProvider(config.arkServerUrl);
|
|
50
|
+
const arkProvider = new chunkWZ2UHHQ7_cjs.ExpoOperatorProvider(config.arkServerUrl);
|
|
51
|
+
const deps = chunkNC6TEEHZ_cjs.createTaskDependencies({
|
|
52
52
|
walletRepository,
|
|
53
53
|
contractRepository,
|
|
54
54
|
indexerProvider,
|
|
55
55
|
arkProvider
|
|
56
56
|
});
|
|
57
|
-
await
|
|
57
|
+
await chunkNC6TEEHZ_cjs.runTasks(taskQueue, processors, deps);
|
|
58
58
|
const results = await taskQueue.getResults();
|
|
59
59
|
if (results.length > 0) {
|
|
60
60
|
await taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
61
61
|
}
|
|
62
|
-
const existing = await taskQueue.getTasks(
|
|
62
|
+
const existing = await taskQueue.getTasks(chunkNC6TEEHZ_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
63
63
|
if (existing.length === 0) {
|
|
64
64
|
const task = {
|
|
65
|
-
id:
|
|
66
|
-
type:
|
|
65
|
+
id: chunkDMYHAUTA_cjs.getRandomId(),
|
|
66
|
+
type: chunkNC6TEEHZ_cjs.CONTRACT_POLL_TASK_TYPE,
|
|
67
67
|
data: {},
|
|
68
68
|
createdAt: Date.now()
|
|
69
69
|
};
|