@arkade-os/sdk 0.4.78 → 0.4.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/adapters/expo.cjs +5 -5
- package/dist/adapters/expo.d.cts +3 -3
- package/dist/adapters/expo.d.ts +3 -3
- package/dist/adapters/expo.js +3 -3
- package/dist/{asyncStorageTaskQueue-YW2t31_o.d.ts → asyncStorageTaskQueue-C5yQLJhm.d.ts} +1 -1
- package/dist/{asyncStorageTaskQueue-DiXxP-nQ.d.cts → asyncStorageTaskQueue-Shsih-1l.d.cts} +1 -1
- package/dist/{chunk-ZOCJ7E6M.js → chunk-4MXW2NDN.js} +10 -515
- package/dist/chunk-4MXW2NDN.js.map +1 -0
- package/dist/{chunk-KEEZSFLI.cjs → chunk-54FXLZ3T.cjs} +10 -10
- package/dist/{chunk-KEEZSFLI.cjs.map → chunk-54FXLZ3T.cjs.map} +1 -1
- package/dist/{chunk-PWIESIO6.cjs → chunk-DAYCCIRO.cjs} +372 -198
- package/dist/chunk-DAYCCIRO.cjs.map +1 -0
- package/dist/{chunk-Y7BVR6SQ.cjs → chunk-FUW3OM5X.cjs} +76 -561
- package/dist/chunk-FUW3OM5X.cjs.map +1 -0
- package/dist/{chunk-VJ7M6WKB.cjs → chunk-HAM3SHBV.cjs} +587 -532
- package/dist/chunk-HAM3SHBV.cjs.map +1 -0
- package/dist/{chunk-7KIGEOYT.js → chunk-JCPVP7TJ.js} +373 -201
- package/dist/chunk-JCPVP7TJ.js.map +1 -0
- package/dist/{chunk-DFWLP3MD.cjs → chunk-LASRYLMQ.cjs} +17 -17
- package/dist/{chunk-DFWLP3MD.cjs.map → chunk-LASRYLMQ.cjs.map} +1 -1
- package/dist/{chunk-CTFYT24G.js → chunk-QDXOTONI.js} +3 -3
- package/dist/{chunk-CTFYT24G.js.map → chunk-QDXOTONI.js.map} +1 -1
- package/dist/{chunk-IAM5IEVT.cjs → chunk-SJPPBR2V.cjs} +17 -17
- package/dist/{chunk-IAM5IEVT.cjs.map → chunk-SJPPBR2V.cjs.map} +1 -1
- package/dist/{chunk-P766MOPU.js → chunk-SK4OZRMB.js} +4 -4
- package/dist/{chunk-P766MOPU.js.map → chunk-SK4OZRMB.js.map} +1 -1
- package/dist/{chunk-OUHUC26M.js → chunk-VAFNWP3I.js} +4 -4
- package/dist/{chunk-OUHUC26M.js.map → chunk-VAFNWP3I.js.map} +1 -1
- package/dist/{chunk-LKAASQTL.js → chunk-YPQ37P3H.js} +128 -73
- package/dist/chunk-YPQ37P3H.js.map +1 -0
- package/dist/contracts/handlers/index.cjs +9 -9
- package/dist/contracts/handlers/index.d.cts +4 -4
- package/dist/contracts/handlers/index.d.ts +4 -4
- package/dist/contracts/handlers/index.js +2 -2
- package/dist/{delegate-DaNNUI_B.d.cts → delegate-B4bKASut.d.cts} +1 -1
- package/dist/{delegate-b2Wiymoj.d.ts → delegate-C9lpdrb0.d.ts} +1 -1
- package/dist/{hdWalletCapable-B2XVTOvu.d.ts → hdWalletCapable-CUJDKRKO.d.cts} +2 -3
- package/dist/{hdWalletCapable-D6PqWpuW.d.cts → hdWalletCapable-DJClhYMC.d.ts} +2 -3
- package/dist/{index-CAS4GyN-.d.ts → index-Ctul0N3Y.d.cts} +27 -6
- package/dist/{index-CAS4GyN-.d.cts → index-Ctul0N3Y.d.ts} +27 -6
- package/dist/{index-CYsKAXog.d.ts → index-D0qe2qVY.d.ts} +2 -2
- package/dist/{index-BlB97fYl.d.cts → index-YBFmScVS.d.cts} +2 -2
- package/dist/index.cjs +304 -304
- package/dist/index.d.cts +123 -123
- package/dist/index.d.ts +123 -123
- package/dist/index.js +4 -4
- package/dist/repositories/realm/index.cjs +20 -20
- package/dist/repositories/realm/index.d.cts +3 -3
- package/dist/repositories/realm/index.d.ts +3 -3
- package/dist/repositories/realm/index.js +5 -5
- package/dist/repositories/sqlite/index.cjs +19 -19
- package/dist/repositories/sqlite/index.d.cts +3 -3
- package/dist/repositories/sqlite/index.d.ts +3 -3
- package/dist/repositories/sqlite/index.js +5 -5
- package/dist/{taskRunner-BJj7xe35.d.ts → taskRunner-C08egG5a.d.ts} +1 -1
- package/dist/{taskRunner-HS2d2oda.d.cts → taskRunner-DB17db5n.d.cts} +1 -1
- package/dist/wallet/expo/background.cjs +14 -14
- package/dist/wallet/expo/background.d.cts +4 -4
- package/dist/wallet/expo/background.d.ts +4 -4
- package/dist/wallet/expo/background.js +6 -6
- package/dist/wallet/expo/index.cjs +14 -14
- package/dist/wallet/expo/index.d.cts +5 -5
- package/dist/wallet/expo/index.d.ts +5 -5
- package/dist/wallet/expo/index.js +5 -5
- package/dist/worker/expo/index.cjs +9 -9
- package/dist/worker/expo/index.d.cts +5 -5
- package/dist/worker/expo/index.d.ts +5 -5
- package/dist/worker/expo/index.js +5 -5
- package/package.json +6 -5
- package/dist/chunk-7KIGEOYT.js.map +0 -1
- package/dist/chunk-LKAASQTL.js.map +0 -1
- package/dist/chunk-PWIESIO6.cjs.map +0 -1
- package/dist/chunk-VJ7M6WKB.cjs.map +0 -1
- package/dist/chunk-Y7BVR6SQ.cjs.map +0 -1
- package/dist/chunk-ZOCJ7E6M.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, AbortError, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, OversizedChangeError, P2A, PaymentRouter, PrevTxUnavailableError, REGTEST_MIN_BATCH_EXPIRY_SECONDS, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, RestEmulatorProvider, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, arkade_exports as arkade, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, assetsOf, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deleteByIndex, deserializeExitPackage, encodeArkContract, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isContractVtxoEvent, isCooperativelyMigratable, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, logExcludedVtxos, makeHandle, matchServerCheckpoints, migrateWalletRepository, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, promisifyRequest, provisionClaimSecret, provisionRefundKey, registerWalletRestoreHook, requiresMigration, resolveAssetAmount, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, rollbackMigration, selectCoinsWithAsset, selectVirtualCoins, selectionOf, serializeExitPackage, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, walletFeeSource, withPrevTxs } from './chunk-
|
|
2
|
-
export { ChainTxType, DEFAULT_VTXO_PAGE_SIZE, IndexerTxType, RestIndexerProvider, asset_exports as asset } from './chunk-
|
|
3
|
-
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, identityDescriptor, isCltvSatisfied, isCsvSpendable, normalizeToDescriptor, parseHDDescriptor, toXOnly } from './chunk-
|
|
4
|
-
export { ArkAddress, ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, BITCOIN_EMULATOR_PUBKEY, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, ConditionWitness, CosignerPublicKey, DigestMismatchError, EventSourceUnavailableError, FetchError, Intent, MUTINYNET_EMULATOR_PUBKEY, MultisigTapscript, PrevArkTxField, PrevoutTxField, ProviderUnavailableError, READ_TIMEOUT_MS, REGTEST_EMULATOR_PUBKEY, RestArkProvider, ServerResponseMismatchError, SettlementEventType, TapTreeCoder, Transaction, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, assembleBtcdTaprootTree, assertAllowedSighashTypes, buildVersion, canRecoverOnchain, canSpendOffchain, canSweepOnchain, configureEventSource, decodeTapscript, defaultEmulatorPubkey, getArkPsbtFields, getConfiguredEventSource, getNetwork, getSequence, hasTerminalSpend, isArkError, isEventSourceUnavailableError, isExpired, isPastExpiry, isRecoverable, isRetryableProviderError, isSpendable, isVirtualCoin, isVtxoSpent, maybeArkError, networks, resolveEmulatorPubkey, resolveEventSource, scriptFromTapLeafScript, sdkVersion, sequenceToTimelock, setArkPsbtField, timelockToSequence } from './chunk-
|
|
1
|
+
export { ARKADE_MAGIC, ARKADE_SALTED_PREIMAGE_TAG, ARKADE_SWAP_PREIMAGE_TAG, ASSET_CARRIER_SATS, AbortError, ActivityRegistry, AmbiguousRouteError, ArkNote, ArkadeCash, ArkadeCashCreateError, AssetManager, BIP21, BIP21Error, BIP322, BLOCKED_UPGRADE_TIMEOUT_MS, Batch, CachingArkProvider, ChainedTxType, ConnectionDisposedError, ContractManager, ContractRepositoryImpl, ContractWatcher, DEFAULT_MESSAGE_TIMEOUTS, DEFAULT_MIN_BATCH_EXPIRY_SECONDS, DEFAULT_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, DatabaseUpgradeBlockedError, DelegateManagerImpl, DelegateNotConfiguredError, DelegatorManagerImpl, DelegatorNotConfiguredError, DescriptorIdentity, DescriptorSigningProviderMissingError, DustChangeError, ELECTRUM_TCP_HOST, ELECTRUM_WS_URL, ESPLORA_URL, ElectrumOnchainProvider, EmulatorPacket, EsploraProvider, Estimator, Extension, ExtensionNotFoundError, ForeignDescriptorError, HDDescriptorProvider, INTENT_TERMINAL_STATES, InMemoryContractRepository, InMemoryIntentRepository, InMemoryVirtualTxRepository, InMemoryWalletRepository, IndexedDBContractRepository, IndexedDBIntentRepository, IndexedDBVirtualTxRepository, IndexedDBWalletRepository, MAX_USED_SIGNING_DESCRIPTORS_LOOK_AHEAD, MESSAGE_BUS_INITIALIZING, MESSAGE_BUS_NOT_INITIALIZED, MIGRATION_KEY, MUTINYNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, MessageBus, MessageBusInitializingError, MessageBusNotInitializedError, MissingSigningDescriptorError, MnemonicIdentity, OnchainWallet, OversizedChangeError, P2A, PaymentRouter, PrevTxUnavailableError, REGTEST_MIN_BATCH_EXPIRY_SECONDS, REGTEST_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, Ramps, ReadonlyAssetManager, ReadonlyDescriptorIdentity, ReadonlySingleKey, ReadonlyWallet, ReadonlyWalletError, RestDelegateProvider, RestDelegatorProvider, RestEmulatorProvider, SIGNET_MIN_CHECKPOINT_EXIT_DELAY_SECONDS, SeedIdentity, ServiceWorkerReadonlyWallet, ServiceWorkerTimeoutError, ServiceWorkerWallet, SingleKey, TxTree, TxType, TxWeightEstimator, UnannotatableInputError, UnilateralExit, UnknownPacket, Unroll, VtxoManager, Wallet, WalletCannotAllocateAddressError, WalletCannotSignError, WalletMessageHandler, WalletNotInitializedError, WalletRepositoryImpl, WsElectrumChainSource, adoptContractDescriptor, arkAssetRail, arkRail, arkTarget, arkade_exports as arkade, assertFinalCommitmentMatchesValidated, assertNoAssets, assertNoSelection, assertSendableAmount, assertSubmittedArkTxid, assertValidBatchExpiry, assertValidServerUnrollScript, assetMintResolver, assetsOf, attachPrevArkTxs, attachPrevoutTxs, awaitTransaction, boardingResolver, btcTarget, buildForfeitTx, buildOffchainTx, buildPreimageMessage, buildSaltedPreimageMessage, claimWithPreimageIdentity, classifyAgainstSignerSet, classifyContractSigner, closeDatabase, collabExitResolver, combineTapscriptSigs, contractFromArkContract, contractFromArkContractWithAddress, contractPreimage, contractSigner, createAssetPacket, createDefaultActivityRegistry, createDefaultPaymentRouter, createExitChainResolver, createManagedConnection, decodeArkContract, defaultBatchExpiryPolicy, defaultCheckpointExitDelayPolicy, deleteByIndex, deserializeExitPackage, encodeArkContract, exitObserverFor, gateExclusion, gatedContracts, getAllByIndexValues, getMigrationStatus, getRandomId, hasBoardingTxExpired, hasCandidates, invoiceTarget, isAddressAllocationCapable, isArkContract, isBatchSignable, isBtcAddress, isContractGenericallySpendable, isContractVtxoEvent, isCooperativelyMigratable, isDeterministicSigner, isDiscoverable, isHDAllocationCapable, isHDDeterministicSignCapable, isHDWalletCapable, isLightningInvoice, isLnurl, isMessageBusInitializingError, isMessageBusNotInitializedError, isPerArtifactDescriptor, isSigningIdentity, isSubdust, isTerminalIntentState, isValidArkAddress, isVtxoExpiringSoon, logExcludedVtxos, makeHandle, matchServerCheckpoints, migrateWalletRepository, notifyExitObserved, onchainRail, openDatabase, outpointExclusion, outpointReasons, promisifyRequest, provisionClaimSecret, provisionRefundKey, registerWalletRestoreHook, requiresMigration, resolveAssetAmount, resolveBatchExpiryPolicy, resolveCheckpointExitDelayPolicy, resolveDescriptorSigner, resolvePrevTxs, resolveSendAmount, rollbackMigration, selectCoinsWithAsset, selectVirtualCoins, selectionOf, serializeExitPackage, setupServiceWorker, signAndSubmitOffchainTx, signerSetFromInfo, signingDescriptorIndex, strictSigningDescriptorIndex, toXOnlySignerHex, tryResolveSendAmount, validateBatchRecipients, validateConnectorsTxGraph, validateVtxoTxGraph, verifyTapscriptSignatures, waitForIncomingFunds, walletFeeSource, withPrevTxs } from './chunk-YPQ37P3H.js';
|
|
2
|
+
export { ChainTxType, DEFAULT_VTXO_PAGE_SIZE, IndexerTxType, RestIndexerProvider, asset_exports as asset } from './chunk-QDXOTONI.js';
|
|
3
|
+
export { ArkadeContractHandler, BoardingContractHandler, DefaultContractHandler, DefaultVtxo, DelegateContractHandler, DelegateVtxo, VHTLC, VHTLCContractHandler, VHTLCV2ContractHandler, contractHandlers, deriveDescriptorLeafCompressedPubKey, deriveDescriptorLeafPubKey, identityDescriptor, isCltvSatisfied, isCsvSpendable, normalizeToDescriptor, parseHDDescriptor, toXOnly } from './chunk-4MXW2NDN.js';
|
|
4
|
+
export { ArkAddress, ArkError, ArkErrorName, ArkPsbtFieldKey, ArkPsbtFieldKeyType, BITCOIN_EMULATOR_PUBKEY, CLTVMultisigTapscript, CSVMultisigTapscript, ConditionCSVMultisigTapscript, ConditionMultisigTapscript, ConditionWitness, CosignerPublicKey, DigestMismatchError, EventSourceUnavailableError, FetchError, Intent, MUTINYNET_EMULATOR_PUBKEY, MultisigTapscript, PrevArkTxField, PrevoutTxField, ProviderUnavailableError, READ_TIMEOUT_MS, REGTEST_EMULATOR_PUBKEY, RestArkProvider, ServerResponseMismatchError, SettlementEventType, TapTreeCoder, Transaction, VtxoScript, VtxoTaprootTree, VtxoTreeExpiry, assembleBtcdTaprootTree, assertAllowedSighashTypes, buildVersion, canRecoverOnchain, canSpendOffchain, canSweepOnchain, configureEventSource, decodeTapscript, defaultEmulatorPubkey, getArkPsbtFields, getConfiguredEventSource, getNetwork, getSequence, hasTerminalSpend, isArkError, isEventSourceUnavailableError, isExpired, isPastExpiry, isRecoverable, isRetryableProviderError, isSpendable, isVirtualCoin, isVtxoSpent, maybeArkError, networks, resolveEmulatorPubkey, resolveEventSource, scriptFromTapLeafScript, sdkVersion, sequenceToTimelock, setArkPsbtField, timelockToSequence } from './chunk-JCPVP7TJ.js';
|
|
5
5
|
import './chunk-NSBPE2FW.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
var
|
|
3
|
+
var chunkHAM3SHBV_cjs = require('../../chunk-HAM3SHBV.cjs');
|
|
4
|
+
require('../../chunk-SJPPBR2V.cjs');
|
|
5
|
+
require('../../chunk-FUW3OM5X.cjs');
|
|
6
|
+
var chunkDAYCCIRO_cjs = require('../../chunk-DAYCCIRO.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
9
9
|
// src/repositories/realm/walletRepository.ts
|
|
@@ -38,7 +38,7 @@ var RealmWalletRepository = class {
|
|
|
38
38
|
await this.ensureInit();
|
|
39
39
|
this.realm.write(() => {
|
|
40
40
|
for (const vtxo of vtxos) {
|
|
41
|
-
const s =
|
|
41
|
+
const s = chunkHAM3SHBV_cjs.serializeVtxo(vtxo);
|
|
42
42
|
this.realm.create(
|
|
43
43
|
"ArkVtxo",
|
|
44
44
|
{
|
|
@@ -93,7 +93,7 @@ var RealmWalletRepository = class {
|
|
|
93
93
|
const results = this.realm.objects("ArkVtxo").filtered(query, ...chunk, false, "");
|
|
94
94
|
for (const row of results) {
|
|
95
95
|
const vtxo = vtxoObjectToDomain(row);
|
|
96
|
-
if (!options?.unspentOnly || !
|
|
96
|
+
if (!options?.unspentOnly || !chunkDAYCCIRO_cjs.isVtxoSpent(vtxo)) rows.push(vtxo);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return rows;
|
|
@@ -103,7 +103,7 @@ var RealmWalletRepository = class {
|
|
|
103
103
|
throw new Error("RealmWalletRepository requires an address");
|
|
104
104
|
}
|
|
105
105
|
for (const vtxo of vtxos) {
|
|
106
|
-
if (!
|
|
106
|
+
if (!chunkHAM3SHBV_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
107
107
|
throw new Error(
|
|
108
108
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
109
109
|
);
|
|
@@ -128,7 +128,7 @@ var RealmWalletRepository = class {
|
|
|
128
128
|
await this.ensureInit();
|
|
129
129
|
this.realm.write(() => {
|
|
130
130
|
for (const utxo of utxos) {
|
|
131
|
-
const s =
|
|
131
|
+
const s = chunkHAM3SHBV_cjs.serializeUtxo(utxo);
|
|
132
132
|
this.realm.create(
|
|
133
133
|
"ArkUtxo",
|
|
134
134
|
{
|
|
@@ -181,7 +181,7 @@ var RealmWalletRepository = class {
|
|
|
181
181
|
amount: tx.amount,
|
|
182
182
|
settled: tx.settled,
|
|
183
183
|
createdAt: tx.createdAt,
|
|
184
|
-
assetsJson: tx.assets ? JSON.stringify(
|
|
184
|
+
assetsJson: tx.assets ? JSON.stringify(chunkHAM3SHBV_cjs.serializeAssets(tx.assets)) : null
|
|
185
185
|
},
|
|
186
186
|
"modified"
|
|
187
187
|
);
|
|
@@ -251,9 +251,9 @@ function vtxoObjectToDomain(obj) {
|
|
|
251
251
|
// Post-migration every row has `script`, but the backfill is
|
|
252
252
|
// idempotent: derive from `address` if the legacy column is still
|
|
253
253
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
254
|
-
script: obj.script ??
|
|
254
|
+
script: obj.script ?? chunkHAM3SHBV_cjs.scriptFromArkAddress(obj.address)
|
|
255
255
|
};
|
|
256
|
-
return
|
|
256
|
+
return chunkHAM3SHBV_cjs.deserializeVtxo(serialized);
|
|
257
257
|
}
|
|
258
258
|
function utxoObjectToDomain(obj) {
|
|
259
259
|
const serialized = {
|
|
@@ -272,7 +272,7 @@ function utxoObjectToDomain(obj) {
|
|
|
272
272
|
status: JSON.parse(obj.statusJson),
|
|
273
273
|
extraWitness: obj.extraWitnessJson ? JSON.parse(obj.extraWitnessJson) : void 0
|
|
274
274
|
};
|
|
275
|
-
return
|
|
275
|
+
return chunkHAM3SHBV_cjs.deserializeUtxo(serialized);
|
|
276
276
|
}
|
|
277
277
|
function txObjectToDomain(obj) {
|
|
278
278
|
const tx = {
|
|
@@ -287,7 +287,7 @@ function txObjectToDomain(obj) {
|
|
|
287
287
|
createdAt: obj.createdAt
|
|
288
288
|
};
|
|
289
289
|
if (obj.assetsJson) {
|
|
290
|
-
tx.assets =
|
|
290
|
+
tx.assets = chunkHAM3SHBV_cjs.deserializeAssets(JSON.parse(obj.assetsJson));
|
|
291
291
|
}
|
|
292
292
|
return tx;
|
|
293
293
|
}
|
|
@@ -467,7 +467,7 @@ var RealmIntentRepository = class {
|
|
|
467
467
|
const clashes = [
|
|
468
468
|
...this.realm.objects("ArkIntent").filtered("intentId == $0", intent.intentId)
|
|
469
469
|
].map(toIntent);
|
|
470
|
-
|
|
470
|
+
chunkHAM3SHBV_cjs.assertIntentIdUnique(intent, clashes);
|
|
471
471
|
}
|
|
472
472
|
this.realm.create(
|
|
473
473
|
"ArkIntent",
|
|
@@ -496,14 +496,14 @@ var RealmIntentRepository = class {
|
|
|
496
496
|
}
|
|
497
497
|
async getIntents(filter) {
|
|
498
498
|
const all = [...this.realm.objects("ArkIntent")].map(toIntent).sort((a, b) => a.createdAt - b.createdAt || a.intentTxId.localeCompare(b.intentTxId));
|
|
499
|
-
const out = filter ? all.filter((i) =>
|
|
500
|
-
const { skip, end } =
|
|
499
|
+
const out = filter ? all.filter((i) => chunkHAM3SHBV_cjs.intentMatchesFilter(i, filter)) : all;
|
|
500
|
+
const { skip, end } = chunkHAM3SHBV_cjs.intentPageBounds(filter, out.length);
|
|
501
501
|
return out.slice(skip, end);
|
|
502
502
|
}
|
|
503
503
|
async getLockedVtxoOutpoints() {
|
|
504
504
|
const out = [];
|
|
505
505
|
for (const o of [...this.realm.objects("ArkIntent")].map(toIntent))
|
|
506
|
-
if (!
|
|
506
|
+
if (!chunkHAM3SHBV_cjs.isTerminalIntentState(o.state)) out.push(...o.intentVtxos);
|
|
507
507
|
return out;
|
|
508
508
|
}
|
|
509
509
|
async [Symbol.asyncDispose]() {
|
|
@@ -545,7 +545,7 @@ var RealmVirtualTxRepository = class {
|
|
|
545
545
|
txid: t.txid,
|
|
546
546
|
psbt: t.psbt ?? prev?.psbt ?? null,
|
|
547
547
|
expiresAt: t.expiresAt ?? prev?.expiresAt ?? null,
|
|
548
|
-
type:
|
|
548
|
+
type: chunkHAM3SHBV_cjs.mergeChainedTxType(t.type, prev?.type)
|
|
549
549
|
},
|
|
550
550
|
"modified"
|
|
551
551
|
);
|
|
@@ -779,7 +779,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
779
779
|
for (let i = 0; i < newVtxos.length; i++) {
|
|
780
780
|
const newVtxo = newVtxos[i];
|
|
781
781
|
if (!newVtxo.script) {
|
|
782
|
-
newVtxo.script =
|
|
782
|
+
newVtxo.script = chunkHAM3SHBV_cjs.scriptFromArkAddress(newVtxo.address);
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
const oldHasVirtualTx = Array.isArray(oldRealm?.schema) && oldRealm.schema.some((s) => s.name === "ArkVirtualTx");
|
|
@@ -796,7 +796,7 @@ function runArkRealmMigrations(oldRealm, newRealm) {
|
|
|
796
796
|
|
|
797
797
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
798
798
|
enumerable: true,
|
|
799
|
-
get: function () { return
|
|
799
|
+
get: function () { return chunkHAM3SHBV_cjs.ChainedTxType; }
|
|
800
800
|
});
|
|
801
801
|
exports.ARK_REALM_SCHEMA_VERSION = ARK_REALM_SCHEMA_VERSION;
|
|
802
802
|
exports.ArkExperimentalRealmSchemas = ArkExperimentalRealmSchemas;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-
|
|
2
|
-
export { M as ChainedTxType } from '../../index-
|
|
1
|
+
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-Ctul0N3Y.cjs';
|
|
2
|
+
export { M as ChainedTxType } from '../../index-Ctul0N3Y.cjs';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/transaction.js';
|
|
5
4
|
import '@scure/btc-signer';
|
|
5
|
+
import '@scure/btc-signer/transaction.js';
|
|
6
6
|
import '@scure/btc-signer/psbt.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-
|
|
2
|
-
export { M as ChainedTxType } from '../../index-
|
|
1
|
+
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-Ctul0N3Y.js';
|
|
2
|
+
export { M as ChainedTxType } from '../../index-Ctul0N3Y.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/transaction.js';
|
|
5
4
|
import '@scure/btc-signer';
|
|
5
|
+
import '@scure/btc-signer/transaction.js';
|
|
6
6
|
import '@scure/btc-signer/psbt.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import { isVtxoSpent } from '../../chunk-
|
|
1
|
+
import { serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, scriptFromArkAddress, deserializeVtxo, deserializeUtxo, deserializeAssets, assertIntentIdUnique, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-YPQ37P3H.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-YPQ37P3H.js';
|
|
3
|
+
import '../../chunk-QDXOTONI.js';
|
|
4
|
+
import '../../chunk-4MXW2NDN.js';
|
|
5
|
+
import { isVtxoSpent } from '../../chunk-JCPVP7TJ.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
|
|
8
8
|
// src/repositories/realm/walletRepository.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
var
|
|
3
|
+
var chunkHAM3SHBV_cjs = require('../../chunk-HAM3SHBV.cjs');
|
|
4
|
+
require('../../chunk-SJPPBR2V.cjs');
|
|
5
|
+
require('../../chunk-FUW3OM5X.cjs');
|
|
6
|
+
var chunkDAYCCIRO_cjs = require('../../chunk-DAYCCIRO.cjs');
|
|
7
7
|
require('../../chunk-5BLDMQED.cjs');
|
|
8
8
|
|
|
9
9
|
// src/repositories/sqlite/transaction.ts
|
|
@@ -160,7 +160,7 @@ var SQLiteWalletRepository = class {
|
|
|
160
160
|
for (const row of nullRows) {
|
|
161
161
|
await this.db.run(
|
|
162
162
|
`UPDATE ${this.tables.vtxos} SET script = ? WHERE txid = ? AND vout = ?`,
|
|
163
|
-
[
|
|
163
|
+
[chunkHAM3SHBV_cjs.scriptFromArkAddress(row.address), row.txid, row.vout]
|
|
164
164
|
);
|
|
165
165
|
}
|
|
166
166
|
const tempName = `${this.tables.vtxos}__migrate_tmp`;
|
|
@@ -231,7 +231,7 @@ var SQLiteWalletRepository = class {
|
|
|
231
231
|
async saveVtxos(address, vtxos) {
|
|
232
232
|
await this.ensureInit();
|
|
233
233
|
for (const vtxo of vtxos) {
|
|
234
|
-
const s =
|
|
234
|
+
const s = chunkHAM3SHBV_cjs.serializeVtxo(vtxo);
|
|
235
235
|
await this.db.run(
|
|
236
236
|
`INSERT OR REPLACE INTO ${this.tables.vtxos}
|
|
237
237
|
(txid, vout, value, address,
|
|
@@ -294,7 +294,7 @@ var SQLiteWalletRepository = class {
|
|
|
294
294
|
);
|
|
295
295
|
const decoded = rows.map(vtxoRowToDomain);
|
|
296
296
|
result.push(
|
|
297
|
-
...options?.unspentOnly ? decoded.filter((vtxo) => !
|
|
297
|
+
...options?.unspentOnly ? decoded.filter((vtxo) => !chunkDAYCCIRO_cjs.isVtxoSpent(vtxo)) : decoded
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
300
|
return result;
|
|
@@ -304,7 +304,7 @@ var SQLiteWalletRepository = class {
|
|
|
304
304
|
throw new Error("SQLiteWalletRepository requires an address");
|
|
305
305
|
}
|
|
306
306
|
for (const vtxo of vtxos) {
|
|
307
|
-
if (!
|
|
307
|
+
if (!chunkHAM3SHBV_cjs.isVtxoForScript(vtxo, key.script)) {
|
|
308
308
|
throw new Error(
|
|
309
309
|
`VTXO ${vtxo.txid}:${vtxo.vout} script mismatch: expected ${key.script}, got ${vtxo.script}`
|
|
310
310
|
);
|
|
@@ -328,7 +328,7 @@ var SQLiteWalletRepository = class {
|
|
|
328
328
|
async saveUtxos(address, utxos) {
|
|
329
329
|
await this.ensureInit();
|
|
330
330
|
for (const utxo of utxos) {
|
|
331
|
-
const s =
|
|
331
|
+
const s = chunkHAM3SHBV_cjs.serializeUtxo(utxo);
|
|
332
332
|
await this.db.run(
|
|
333
333
|
`INSERT OR REPLACE INTO ${this.tables.utxos}
|
|
334
334
|
(txid, vout, value, address,
|
|
@@ -384,7 +384,7 @@ var SQLiteWalletRepository = class {
|
|
|
384
384
|
tx.amount,
|
|
385
385
|
tx.settled ? 1 : 0,
|
|
386
386
|
tx.createdAt,
|
|
387
|
-
tx.assets ? JSON.stringify(
|
|
387
|
+
tx.assets ? JSON.stringify(chunkHAM3SHBV_cjs.serializeAssets(tx.assets)) : null
|
|
388
388
|
]
|
|
389
389
|
);
|
|
390
390
|
}
|
|
@@ -458,9 +458,9 @@ function vtxoRowToDomain(row) {
|
|
|
458
458
|
// Post-migration every row has `script`, but the backfill is
|
|
459
459
|
// idempotent: derive from `address` if the legacy column is still
|
|
460
460
|
// null (e.g. the migration hasn't run yet on this handle).
|
|
461
|
-
script: row.script ??
|
|
461
|
+
script: row.script ?? chunkHAM3SHBV_cjs.scriptFromArkAddress(row.address)
|
|
462
462
|
};
|
|
463
|
-
return
|
|
463
|
+
return chunkHAM3SHBV_cjs.deserializeVtxo(serialized);
|
|
464
464
|
}
|
|
465
465
|
function utxoRowToDomain(row) {
|
|
466
466
|
const serialized = {
|
|
@@ -479,7 +479,7 @@ function utxoRowToDomain(row) {
|
|
|
479
479
|
status: JSON.parse(row.status_json),
|
|
480
480
|
extraWitness: row.extra_witness_json ? JSON.parse(row.extra_witness_json) : void 0
|
|
481
481
|
};
|
|
482
|
-
return
|
|
482
|
+
return chunkHAM3SHBV_cjs.deserializeUtxo(serialized);
|
|
483
483
|
}
|
|
484
484
|
function txRowToDomain(row) {
|
|
485
485
|
const tx = {
|
|
@@ -494,7 +494,7 @@ function txRowToDomain(row) {
|
|
|
494
494
|
createdAt: row.created_at
|
|
495
495
|
};
|
|
496
496
|
if (row.assets_json) {
|
|
497
|
-
tx.assets =
|
|
497
|
+
tx.assets = chunkHAM3SHBV_cjs.deserializeAssets(JSON.parse(row.assets_json));
|
|
498
498
|
}
|
|
499
499
|
return tx;
|
|
500
500
|
}
|
|
@@ -767,8 +767,8 @@ var SQLiteIntentRepository = class {
|
|
|
767
767
|
`SELECT * FROM ${this.t} ORDER BY created_at ASC, intent_tx_id ASC`
|
|
768
768
|
);
|
|
769
769
|
let out = rows.map(rowToIntent);
|
|
770
|
-
if (filter) out = out.filter((i) =>
|
|
771
|
-
const { skip, end } =
|
|
770
|
+
if (filter) out = out.filter((i) => chunkHAM3SHBV_cjs.intentMatchesFilter(i, filter));
|
|
771
|
+
const { skip, end } = chunkHAM3SHBV_cjs.intentPageBounds(filter, out.length);
|
|
772
772
|
return out.slice(skip, end);
|
|
773
773
|
}
|
|
774
774
|
async getLockedVtxoOutpoints() {
|
|
@@ -776,7 +776,7 @@ var SQLiteIntentRepository = class {
|
|
|
776
776
|
const rows = await this.db.all(`SELECT * FROM ${this.t}`);
|
|
777
777
|
const out = [];
|
|
778
778
|
for (const r of rows) {
|
|
779
|
-
if (
|
|
779
|
+
if (chunkHAM3SHBV_cjs.isTerminalIntentState(r.state)) continue;
|
|
780
780
|
for (const o of JSON.parse(r.intent_vtxos_json)) out.push(o);
|
|
781
781
|
}
|
|
782
782
|
return out;
|
|
@@ -871,7 +871,7 @@ var SQLiteVirtualTxRepository = class {
|
|
|
871
871
|
const prev = prevByTxid.get(t.txid);
|
|
872
872
|
const psbt = t.psbt ?? prev?.psbt ?? null;
|
|
873
873
|
const expires = t.expiresAt ?? prev?.expires_at ?? null;
|
|
874
|
-
const type =
|
|
874
|
+
const type = chunkHAM3SHBV_cjs.mergeChainedTxType(t.type, prev?.type);
|
|
875
875
|
await this.db.run(
|
|
876
876
|
`INSERT OR REPLACE INTO ${this.tTx} (txid, psbt, expires_at, type) VALUES (?, ?, ?, ?)`,
|
|
877
877
|
[t.txid, psbt, expires, type]
|
|
@@ -964,7 +964,7 @@ function sanitizeTablePrefix(p) {
|
|
|
964
964
|
|
|
965
965
|
Object.defineProperty(exports, "ChainedTxType", {
|
|
966
966
|
enumerable: true,
|
|
967
|
-
get: function () { return
|
|
967
|
+
get: function () { return chunkHAM3SHBV_cjs.ChainedTxType; }
|
|
968
968
|
});
|
|
969
969
|
exports.SQLiteContractRepository = SQLiteContractRepository;
|
|
970
970
|
exports.SQLiteIntentRepository = SQLiteIntentRepository;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-
|
|
2
|
-
export { M as ChainedTxType } from '../../index-
|
|
1
|
+
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-Ctul0N3Y.cjs';
|
|
2
|
+
export { M as ChainedTxType } from '../../index-Ctul0N3Y.cjs';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/transaction.js';
|
|
5
4
|
import '@scure/btc-signer';
|
|
5
|
+
import '@scure/btc-signer/transaction.js';
|
|
6
6
|
import '@scure/btc-signer/psbt.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-
|
|
2
|
-
export { M as ChainedTxType } from '../../index-
|
|
1
|
+
import { W as WalletRepository, x as ExtendedVirtualCoin, y as VtxoRepositoryKey, E as ExtendedCoin, A as ArkTransaction, z as WalletState, C as ContractRepository, B as ContractFilter, w as Contract, D as IntentRepository, F as ArkIntent, H as IntentFilter, O as Outpoint, J as VirtualTxRepository, K as VirtualTx, L as VtxoBranch } from '../../index-Ctul0N3Y.js';
|
|
2
|
+
export { M as ChainedTxType } from '../../index-Ctul0N3Y.js';
|
|
3
3
|
import '@scure/btc-signer/utils.js';
|
|
4
|
-
import '@scure/btc-signer/transaction.js';
|
|
5
4
|
import '@scure/btc-signer';
|
|
5
|
+
import '@scure/btc-signer/transaction.js';
|
|
6
6
|
import '@scure/btc-signer/psbt.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { scriptFromArkAddress, serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-
|
|
2
|
-
export { ChainedTxType } from '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import { isVtxoSpent } from '../../chunk-
|
|
1
|
+
import { scriptFromArkAddress, serializeVtxo, isVtxoForScript, serializeUtxo, serializeAssets, deserializeVtxo, deserializeUtxo, deserializeAssets, intentMatchesFilter, intentPageBounds, isTerminalIntentState, mergeChainedTxType } from '../../chunk-YPQ37P3H.js';
|
|
2
|
+
export { ChainedTxType } from '../../chunk-YPQ37P3H.js';
|
|
3
|
+
import '../../chunk-QDXOTONI.js';
|
|
4
|
+
import '../../chunk-4MXW2NDN.js';
|
|
5
|
+
import { isVtxoSpent } from '../../chunk-JCPVP7TJ.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
|
|
8
8
|
// src/repositories/sqlite/transaction.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository, s as IndexerProvider, r as ArkProvider, v as VirtualCoin, w as Contract, x as ExtendedVirtualCoin } from './index-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository, s as IndexerProvider, r as ArkProvider, v as VirtualCoin, w as Contract, x as ExtendedVirtualCoin } from './index-Ctul0N3Y.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A task item represents a unit of work in the inbox.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository, s as IndexerProvider, r as ArkProvider, v as VirtualCoin, w as Contract, x as ExtendedVirtualCoin } from './index-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository, s as IndexerProvider, r as ArkProvider, v as VirtualCoin, w as Contract, x as ExtendedVirtualCoin } from './index-Ctul0N3Y.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A task item represents a unit of work in the inbox.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
8
|
-
require('../../chunk-
|
|
3
|
+
var chunk54FXLZ3T_cjs = require('../../chunk-54FXLZ3T.cjs');
|
|
4
|
+
var chunkLASRYLMQ_cjs = require('../../chunk-LASRYLMQ.cjs');
|
|
5
|
+
var chunkHAM3SHBV_cjs = require('../../chunk-HAM3SHBV.cjs');
|
|
6
|
+
require('../../chunk-SJPPBR2V.cjs');
|
|
7
|
+
require('../../chunk-FUW3OM5X.cjs');
|
|
8
|
+
require('../../chunk-DAYCCIRO.cjs');
|
|
9
9
|
require('../../chunk-5BLDMQED.cjs');
|
|
10
10
|
var TaskManager = require('expo-task-manager');
|
|
11
11
|
var BackgroundTask = require('expo-background-task');
|
|
@@ -36,7 +36,7 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
36
36
|
taskQueue,
|
|
37
37
|
walletRepository,
|
|
38
38
|
contractRepository,
|
|
39
|
-
processors = [
|
|
39
|
+
processors = [chunk54FXLZ3T_cjs.contractPollProcessor]
|
|
40
40
|
} = options;
|
|
41
41
|
TaskManager__namespace.defineTask(taskName, async () => {
|
|
42
42
|
try {
|
|
@@ -44,24 +44,24 @@ function defineExpoBackgroundTask(taskName, options) {
|
|
|
44
44
|
if (!config) {
|
|
45
45
|
return BackgroundTask__namespace.BackgroundTaskResult.Success;
|
|
46
46
|
}
|
|
47
|
-
const indexerProvider = new
|
|
48
|
-
const arkProvider = new
|
|
49
|
-
const deps =
|
|
47
|
+
const indexerProvider = new chunkLASRYLMQ_cjs.ExpoIndexerProvider(config.arkServerUrl);
|
|
48
|
+
const arkProvider = new chunkLASRYLMQ_cjs.ExpoArkProvider(config.arkServerUrl);
|
|
49
|
+
const deps = chunk54FXLZ3T_cjs.createTaskDependencies({
|
|
50
50
|
walletRepository,
|
|
51
51
|
contractRepository,
|
|
52
52
|
indexerProvider,
|
|
53
53
|
arkProvider
|
|
54
54
|
});
|
|
55
|
-
await
|
|
55
|
+
await chunk54FXLZ3T_cjs.runTasks(taskQueue, processors, deps);
|
|
56
56
|
const results = await taskQueue.getResults();
|
|
57
57
|
if (results.length > 0) {
|
|
58
58
|
await taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
59
59
|
}
|
|
60
|
-
const existing = await taskQueue.getTasks(
|
|
60
|
+
const existing = await taskQueue.getTasks(chunk54FXLZ3T_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
61
61
|
if (existing.length === 0) {
|
|
62
62
|
const task = {
|
|
63
|
-
id:
|
|
64
|
-
type:
|
|
63
|
+
id: chunkHAM3SHBV_cjs.getRandomId(),
|
|
64
|
+
type: chunk54FXLZ3T_cjs.CONTRACT_POLL_TASK_TYPE,
|
|
65
65
|
data: {},
|
|
66
66
|
createdAt: Date.now()
|
|
67
67
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository } from '../../index-
|
|
2
|
-
import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-
|
|
3
|
-
import { T as TaskProcessor } from '../../taskRunner-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository } from '../../index-Ctul0N3Y.cjs';
|
|
2
|
+
import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-Shsih-1l.cjs';
|
|
3
|
+
import { T as TaskProcessor } from '../../taskRunner-DB17db5n.cjs';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
|
-
import '@scure/btc-signer/transaction.js';
|
|
6
5
|
import '@scure/btc-signer';
|
|
6
|
+
import '@scure/btc-signer/transaction.js';
|
|
7
7
|
import '@scure/btc-signer/psbt.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { W as WalletRepository, C as ContractRepository } from '../../index-
|
|
2
|
-
import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-
|
|
3
|
-
import { T as TaskProcessor } from '../../taskRunner-
|
|
1
|
+
import { W as WalletRepository, C as ContractRepository } from '../../index-Ctul0N3Y.js';
|
|
2
|
+
import { a as AsyncStorageTaskQueue } from '../../asyncStorageTaskQueue-C5yQLJhm.js';
|
|
3
|
+
import { T as TaskProcessor } from '../../taskRunner-C08egG5a.js';
|
|
4
4
|
import '@scure/btc-signer/utils.js';
|
|
5
|
-
import '@scure/btc-signer/transaction.js';
|
|
6
5
|
import '@scure/btc-signer';
|
|
6
|
+
import '@scure/btc-signer/transaction.js';
|
|
7
7
|
import '@scure/btc-signer/psbt.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getRandomId } from '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
1
|
+
import { contractPollProcessor, createTaskDependencies, runTasks, CONTRACT_POLL_TASK_TYPE } from '../../chunk-SK4OZRMB.js';
|
|
2
|
+
import { ExpoIndexerProvider, ExpoArkProvider } from '../../chunk-VAFNWP3I.js';
|
|
3
|
+
import { getRandomId } from '../../chunk-YPQ37P3H.js';
|
|
4
|
+
import '../../chunk-QDXOTONI.js';
|
|
5
|
+
import '../../chunk-4MXW2NDN.js';
|
|
6
|
+
import '../../chunk-JCPVP7TJ.js';
|
|
7
7
|
import '../../chunk-NSBPE2FW.js';
|
|
8
8
|
import * as TaskManager from 'expo-task-manager';
|
|
9
9
|
import * as BackgroundTask from 'expo-background-task';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
3
|
+
var chunk54FXLZ3T_cjs = require('../../chunk-54FXLZ3T.cjs');
|
|
4
|
+
var chunkHAM3SHBV_cjs = require('../../chunk-HAM3SHBV.cjs');
|
|
5
|
+
require('../../chunk-SJPPBR2V.cjs');
|
|
6
|
+
require('../../chunk-FUW3OM5X.cjs');
|
|
7
|
+
require('../../chunk-DAYCCIRO.cjs');
|
|
8
8
|
require('../../chunk-5BLDMQED.cjs');
|
|
9
9
|
var base = require('@scure/base');
|
|
10
10
|
|
|
@@ -58,18 +58,18 @@ var ExpoWallet = class _ExpoWallet {
|
|
|
58
58
|
*/
|
|
59
59
|
static async setup(config) {
|
|
60
60
|
warnOnRemovedBackgroundFields(config.background);
|
|
61
|
-
const wallet = await
|
|
62
|
-
const processors = config.background.processors ?? [
|
|
61
|
+
const wallet = await chunkHAM3SHBV_cjs.Wallet.create(config);
|
|
62
|
+
const processors = config.background.processors ?? [chunk54FXLZ3T_cjs.contractPollProcessor];
|
|
63
63
|
const deps = {
|
|
64
64
|
walletRepository: wallet.walletRepository,
|
|
65
65
|
contractRepository: wallet.contractRepository,
|
|
66
66
|
indexerProvider: wallet.indexerProvider,
|
|
67
67
|
arkProvider: wallet.arkProvider,
|
|
68
|
-
extendVtxo: (vtxo, contract) =>
|
|
68
|
+
extendVtxo: (vtxo, contract) => chunkHAM3SHBV_cjs.extendVirtualCoinForContract(vtxo, contract)
|
|
69
69
|
};
|
|
70
70
|
const { taskQueue } = config.background;
|
|
71
71
|
if ("persistConfig" in taskQueue) {
|
|
72
|
-
const arkServerUrl = config.arkServerUrl ||
|
|
72
|
+
const arkServerUrl = config.arkServerUrl || chunkHAM3SHBV_cjs.extractArkProviderUrl(wallet.arkProvider);
|
|
73
73
|
if (arkServerUrl) {
|
|
74
74
|
const timelock = wallet.offchainTapscript.options.csvTimelock;
|
|
75
75
|
const bgConfig = {
|
|
@@ -100,7 +100,7 @@ var ExpoWallet = class _ExpoWallet {
|
|
|
100
100
|
}
|
|
101
101
|
async runForegroundPoll() {
|
|
102
102
|
if (this.cleared) return;
|
|
103
|
-
await
|
|
103
|
+
await chunk54FXLZ3T_cjs.runTasks(this.taskQueue, this.processors, this.deps);
|
|
104
104
|
const results = await this.taskQueue.getResults();
|
|
105
105
|
if (results.length > 0) {
|
|
106
106
|
await this.taskQueue.acknowledgeResults(results.map((r) => r.id));
|
|
@@ -109,18 +109,18 @@ var ExpoWallet = class _ExpoWallet {
|
|
|
109
109
|
await this.seedContractPollTask();
|
|
110
110
|
}
|
|
111
111
|
async seedContractPollTask() {
|
|
112
|
-
const existing = await this.taskQueue.getTasks(
|
|
112
|
+
const existing = await this.taskQueue.getTasks(chunk54FXLZ3T_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
113
113
|
if (existing.length > 0) return;
|
|
114
114
|
const task = {
|
|
115
|
-
id:
|
|
116
|
-
type:
|
|
115
|
+
id: chunkHAM3SHBV_cjs.getRandomId(),
|
|
116
|
+
type: chunk54FXLZ3T_cjs.CONTRACT_POLL_TASK_TYPE,
|
|
117
117
|
data: {},
|
|
118
118
|
createdAt: Date.now()
|
|
119
119
|
};
|
|
120
120
|
await this.taskQueue.addTask(task);
|
|
121
121
|
}
|
|
122
122
|
async removeContractPollTasks() {
|
|
123
|
-
const tasks = await this.taskQueue.getTasks(
|
|
123
|
+
const tasks = await this.taskQueue.getTasks(chunk54FXLZ3T_cjs.CONTRACT_POLL_TASK_TYPE);
|
|
124
124
|
for (const task of tasks) {
|
|
125
125
|
await this.taskQueue.removeTask(task.id);
|
|
126
126
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, W as Wallet, P as ProviderConnectionState } from '../../hdWalletCapable-
|
|
2
|
-
import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, d as GetSpendableVtxosFilter, E as ExtendedCoin, A as ArkTransaction, e as ActivityRegistry, f as Activity, g as IContractManager, h as GetNewAddressesOptions, i as NewAddress, j as IDelegateManager, S as SendBitcoinParams, k as SettleParams, l as SettlementEvent, m as SendParams, R as Recipient, n as IAssetManager } from '../../index-
|
|
3
|
-
import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-
|
|
4
|
-
import '@scure/btc-signer';
|
|
1
|
+
import { H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, W as Wallet, P as ProviderConnectionState } from '../../hdWalletCapable-CUJDKRKO.cjs';
|
|
2
|
+
import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, d as GetSpendableVtxosFilter, E as ExtendedCoin, A as ArkTransaction, e as ActivityRegistry, f as Activity, g as IContractManager, h as GetNewAddressesOptions, i as NewAddress, j as IDelegateManager, S as SendBitcoinParams, k as SettleParams, l as SettlementEvent, m as SendParams, R as Recipient, n as IAssetManager } from '../../index-Ctul0N3Y.cjs';
|
|
3
|
+
import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-DB17db5n.cjs';
|
|
5
4
|
import '@scure/btc-signer/psbt.js';
|
|
6
5
|
import '@scure/btc-signer/utils.js';
|
|
7
|
-
import '../../delegate-
|
|
6
|
+
import '../../delegate-B4bKASut.cjs';
|
|
7
|
+
import '@scure/btc-signer';
|
|
8
8
|
import '@scure/btc-signer/transaction.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, W as Wallet, P as ProviderConnectionState } from '../../hdWalletCapable-
|
|
2
|
-
import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, d as GetSpendableVtxosFilter, E as ExtendedCoin, A as ArkTransaction, e as ActivityRegistry, f as Activity, g as IContractManager, h as GetNewAddressesOptions, i as NewAddress, j as IDelegateManager, S as SendBitcoinParams, k as SettleParams, l as SettlementEvent, m as SendParams, R as Recipient, n as IAssetManager } from '../../index-
|
|
3
|
-
import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-
|
|
4
|
-
import '@scure/btc-signer';
|
|
1
|
+
import { H as HDWalletCapable, a as HDAllocationCapable, A as AddressAllocationCapable, W as Wallet, P as ProviderConnectionState } from '../../hdWalletCapable-DJClhYMC.js';
|
|
2
|
+
import { I as IWallet, a as Identity, b as WalletConfig, c as WalletBalance, G as GetVtxosFilter, N as NormalizedExtendedVirtualCoin, d as GetSpendableVtxosFilter, E as ExtendedCoin, A as ArkTransaction, e as ActivityRegistry, f as Activity, g as IContractManager, h as GetNewAddressesOptions, i as NewAddress, j as IDelegateManager, S as SendBitcoinParams, k as SettleParams, l as SettlementEvent, m as SendParams, R as Recipient, n as IAssetManager } from '../../index-Ctul0N3Y.js';
|
|
3
|
+
import { c as TaskQueue, T as TaskProcessor } from '../../taskRunner-C08egG5a.js';
|
|
5
4
|
import '@scure/btc-signer/psbt.js';
|
|
6
5
|
import '@scure/btc-signer/utils.js';
|
|
7
|
-
import '../../delegate-
|
|
6
|
+
import '../../delegate-C9lpdrb0.js';
|
|
7
|
+
import '@scure/btc-signer';
|
|
8
8
|
import '@scure/btc-signer/transaction.js';
|
|
9
9
|
|
|
10
10
|
/**
|