@arkade-os/sdk 0.4.27 → 0.4.28
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 +31 -100
- package/dist/adapters/asyncStorage.cjs +48 -0
- package/dist/adapters/asyncStorage.cjs.map +1 -0
- package/dist/adapters/asyncStorage.d.cts +16 -0
- package/dist/{types/storage → adapters}/asyncStorage.d.ts +5 -2
- package/dist/adapters/asyncStorage.js +46 -0
- package/dist/adapters/asyncStorage.js.map +1 -0
- package/dist/adapters/expo.cjs +19 -0
- package/dist/adapters/expo.cjs.map +1 -0
- package/dist/adapters/expo.d.cts +48 -0
- package/dist/adapters/expo.d.ts +48 -0
- package/dist/adapters/expo.js +6 -0
- package/dist/adapters/expo.js.map +1 -0
- package/dist/adapters/fileSystem.cjs +116 -0
- package/dist/adapters/fileSystem.cjs.map +1 -0
- package/dist/adapters/fileSystem.d.cts +17 -0
- package/dist/{types/storage → adapters}/fileSystem.d.ts +5 -2
- package/dist/adapters/fileSystem.js +93 -0
- package/dist/adapters/fileSystem.js.map +1 -0
- package/dist/adapters/indexedDB.cjs +103 -0
- package/dist/adapters/indexedDB.cjs.map +1 -0
- package/dist/adapters/indexedDB.d.cts +18 -0
- package/dist/{types/storage → adapters}/indexedDB.d.ts +5 -2
- package/dist/adapters/indexedDB.js +101 -0
- package/dist/adapters/indexedDB.js.map +1 -0
- package/dist/adapters/localStorage.cjs +50 -0
- package/dist/adapters/localStorage.cjs.map +1 -0
- package/dist/{types/storage/inMemory.d.ts → adapters/localStorage.d.cts} +6 -3
- package/dist/{types/storage → adapters}/localStorage.d.ts +5 -2
- package/dist/adapters/localStorage.js +48 -0
- package/dist/adapters/localStorage.js.map +1 -0
- package/dist/ark-TZ1gXAXU.d.cts +3880 -0
- package/dist/ark-TZ1gXAXU.d.ts +3880 -0
- package/dist/{types/worker/expo/asyncStorageTaskQueue.d.ts → asyncStorageTaskQueue-Cb1F_Z9s.d.ts} +6 -3
- package/dist/asyncStorageTaskQueue-EFqSmYTg.d.cts +49 -0
- package/dist/chunk-5BLDMQED.cjs +18 -0
- package/dist/chunk-5BLDMQED.cjs.map +1 -0
- package/dist/chunk-5PG7DV7A.cjs +805 -0
- package/dist/chunk-5PG7DV7A.cjs.map +1 -0
- package/dist/chunk-A3EMF7RN.js +95 -0
- package/dist/chunk-A3EMF7RN.js.map +1 -0
- package/dist/chunk-ADV27S4N.cjs +2701 -0
- package/dist/chunk-ADV27S4N.cjs.map +1 -0
- package/dist/chunk-BQLHADL7.js +13805 -0
- package/dist/chunk-BQLHADL7.js.map +1 -0
- package/dist/chunk-CFZMTDWI.js +209 -0
- package/dist/chunk-CFZMTDWI.js.map +1 -0
- package/dist/chunk-FG5ACJJW.cjs +212 -0
- package/dist/chunk-FG5ACJJW.cjs.map +1 -0
- package/dist/chunk-HW3JJ323.js +768 -0
- package/dist/chunk-HW3JJ323.js.map +1 -0
- package/dist/chunk-I3DGUUCT.cjs +838 -0
- package/dist/chunk-I3DGUUCT.cjs.map +1 -0
- package/dist/chunk-IPX2R7FR.cjs +100 -0
- package/dist/chunk-IPX2R7FR.cjs.map +1 -0
- package/dist/chunk-NSBPE2FW.js +15 -0
- package/dist/chunk-NSBPE2FW.js.map +1 -0
- package/dist/chunk-T64LAI7L.js +829 -0
- package/dist/chunk-T64LAI7L.js.map +1 -0
- package/dist/chunk-ZBUDLTBO.js +2671 -0
- package/dist/chunk-ZBUDLTBO.js.map +1 -0
- package/dist/chunk-ZLO6NETT.cjs +13910 -0
- package/dist/chunk-ZLO6NETT.cjs.map +1 -0
- package/dist/contracts/handlers/index.cjs +26 -0
- package/dist/contracts/handlers/index.cjs.map +1 -0
- package/dist/contracts/handlers/index.d.cts +7 -0
- package/dist/contracts/handlers/index.d.ts +7 -0
- package/dist/contracts/handlers/index.js +5 -0
- package/dist/contracts/handlers/index.js.map +1 -0
- package/dist/delegate-BFZs69hp.d.cts +84 -0
- package/dist/delegate-aaVGfWsV.d.ts +84 -0
- package/dist/index-B22cA64m.d.cts +199 -0
- package/dist/{types/storage/index.d.ts → index-C0IanN1m.d.cts} +3 -1
- package/dist/index-C0IanN1m.d.ts +11 -0
- package/dist/index-NDla_UoJ.d.ts +199 -0
- package/dist/index.cjs +480 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3343 -0
- package/dist/index.d.ts +3343 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/repositories/realm/index.cjs +513 -0
- package/dist/repositories/realm/index.cjs.map +1 -0
- package/dist/repositories/realm/index.d.cts +217 -0
- package/dist/{types/repositories/realm/schemas.d.ts → repositories/realm/index.d.ts} +80 -112
- package/dist/repositories/realm/index.js +507 -0
- package/dist/repositories/realm/index.js.map +1 -0
- package/dist/repositories/sqlite/index.cjs +588 -0
- package/dist/repositories/sqlite/index.cjs.map +1 -0
- package/dist/repositories/sqlite/index.d.cts +118 -0
- package/dist/{types/repositories/sqlite/walletRepository.d.ts → repositories/sqlite/index.d.ts} +58 -5
- package/dist/repositories/sqlite/index.js +585 -0
- package/dist/repositories/sqlite/index.js.map +1 -0
- package/dist/taskRunner-C6Ff4OaU.d.cts +114 -0
- package/dist/taskRunner-yvPN8Z0K.d.ts +114 -0
- package/dist/wallet/expo/background.cjs +93 -0
- package/dist/wallet/expo/background.cjs.map +1 -0
- package/dist/wallet/expo/background.d.cts +84 -0
- package/dist/wallet/expo/background.d.ts +84 -0
- package/dist/wallet/expo/background.js +68 -0
- package/dist/wallet/expo/background.js.map +1 -0
- package/dist/wallet/expo/index.cjs +171 -0
- package/dist/wallet/expo/index.cjs.map +1 -0
- package/dist/wallet/expo/index.d.cts +122 -0
- package/dist/{types/wallet/expo/wallet.d.ts → wallet/expo/index.d.ts} +45 -22
- package/dist/wallet/expo/index.js +169 -0
- package/dist/wallet/expo/index.js.map +1 -0
- package/dist/wallet-AF-p-OWj.d.cts +774 -0
- package/dist/wallet-D9NBRqvC.d.ts +774 -0
- package/dist/worker/expo/index.cjs +140 -0
- package/dist/worker/expo/index.cjs.map +1 -0
- package/dist/worker/expo/index.d.cts +29 -0
- package/dist/worker/expo/index.d.ts +29 -0
- package/dist/worker/expo/index.js +121 -0
- package/dist/worker/expo/index.js.map +1 -0
- package/package.json +110 -76
- package/dist/cjs/adapters/asyncStorage.js +0 -5
- package/dist/cjs/adapters/expo.js +0 -8
- package/dist/cjs/adapters/fileSystem.js +0 -5
- package/dist/cjs/adapters/indexedDB.js +0 -5
- package/dist/cjs/adapters/localStorage.js +0 -5
- package/dist/cjs/arkfee/celenv.js +0 -43
- package/dist/cjs/arkfee/estimator.js +0 -143
- package/dist/cjs/arkfee/index.js +0 -5
- package/dist/cjs/arkfee/types.js +0 -26
- package/dist/cjs/arknote/index.js +0 -128
- package/dist/cjs/bip322/index.js +0 -270
- package/dist/cjs/contracts/arkcontract.js +0 -147
- package/dist/cjs/contracts/contractManager.js +0 -649
- package/dist/cjs/contracts/contractWatcher.js +0 -598
- package/dist/cjs/contracts/handlers/default.js +0 -93
- package/dist/cjs/contracts/handlers/delegate.js +0 -90
- package/dist/cjs/contracts/handlers/helpers.js +0 -115
- package/dist/cjs/contracts/handlers/index.js +0 -19
- package/dist/cjs/contracts/handlers/registry.js +0 -89
- package/dist/cjs/contracts/handlers/vhtlc.js +0 -194
- package/dist/cjs/contracts/index.js +0 -41
- package/dist/cjs/contracts/types.js +0 -2
- package/dist/cjs/contracts/vtxoOwnership.js +0 -78
- package/dist/cjs/extension/asset/assetGroup.js +0 -228
- package/dist/cjs/extension/asset/assetId.js +0 -152
- package/dist/cjs/extension/asset/assetInput.js +0 -222
- package/dist/cjs/extension/asset/assetOutput.js +0 -174
- package/dist/cjs/extension/asset/assetRef.js +0 -148
- package/dist/cjs/extension/asset/index.js +0 -23
- package/dist/cjs/extension/asset/metadata.js +0 -187
- package/dist/cjs/extension/asset/packet.js +0 -114
- package/dist/cjs/extension/asset/types.js +0 -22
- package/dist/cjs/extension/asset/utils.js +0 -105
- package/dist/cjs/extension/index.js +0 -254
- package/dist/cjs/extension/packet.js +0 -20
- package/dist/cjs/forfeit.js +0 -45
- package/dist/cjs/identity/descriptor.js +0 -169
- package/dist/cjs/identity/descriptorProvider.js +0 -2
- package/dist/cjs/identity/hdCapableIdentity.js +0 -20
- package/dist/cjs/identity/index.js +0 -40
- package/dist/cjs/identity/seedIdentity.js +0 -477
- package/dist/cjs/identity/serialize.js +0 -171
- package/dist/cjs/identity/singleKey.js +0 -126
- package/dist/cjs/identity/staticDescriptorProvider.js +0 -65
- package/dist/cjs/index.js +0 -202
- package/dist/cjs/intent/index.js +0 -259
- package/dist/cjs/musig2/index.js +0 -11
- package/dist/cjs/musig2/keys.js +0 -57
- package/dist/cjs/musig2/nonces.js +0 -48
- package/dist/cjs/musig2/sign.js +0 -102
- package/dist/cjs/networks.js +0 -26
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/providers/ark.js +0 -577
- package/dist/cjs/providers/delegator.js +0 -85
- package/dist/cjs/providers/electrum.js +0 -869
- package/dist/cjs/providers/errors.js +0 -59
- package/dist/cjs/providers/expoArk.js +0 -82
- package/dist/cjs/providers/expoIndexer.js +0 -111
- package/dist/cjs/providers/expoUtils.js +0 -124
- package/dist/cjs/providers/indexer.js +0 -630
- package/dist/cjs/providers/onchain.js +0 -262
- package/dist/cjs/providers/utils.js +0 -121
- package/dist/cjs/repositories/contractRepository.js +0 -2
- package/dist/cjs/repositories/inMemory/contractRepository.js +0 -55
- package/dist/cjs/repositories/inMemory/walletRepository.js +0 -115
- package/dist/cjs/repositories/index.js +0 -34
- package/dist/cjs/repositories/indexedDB/contractRepository.js +0 -187
- package/dist/cjs/repositories/indexedDB/db.js +0 -19
- package/dist/cjs/repositories/indexedDB/manager.js +0 -100
- package/dist/cjs/repositories/indexedDB/schema.js +0 -204
- package/dist/cjs/repositories/indexedDB/walletRepository.js +0 -474
- package/dist/cjs/repositories/indexedDB/websqlAdapter.js +0 -144
- package/dist/cjs/repositories/migrations/contractRepositoryImpl.js +0 -127
- package/dist/cjs/repositories/migrations/fromStorageAdapter.js +0 -66
- package/dist/cjs/repositories/migrations/walletRepositoryImpl.js +0 -184
- package/dist/cjs/repositories/realm/contractRepository.js +0 -116
- package/dist/cjs/repositories/realm/index.js +0 -11
- package/dist/cjs/repositories/realm/schemas.js +0 -157
- package/dist/cjs/repositories/realm/types.js +0 -7
- package/dist/cjs/repositories/realm/walletRepository.js +0 -305
- package/dist/cjs/repositories/scriptFromAddress.js +0 -16
- package/dist/cjs/repositories/serialization.js +0 -82
- package/dist/cjs/repositories/sqlite/contractRepository.js +0 -135
- package/dist/cjs/repositories/sqlite/index.js +0 -7
- package/dist/cjs/repositories/sqlite/types.js +0 -2
- package/dist/cjs/repositories/sqlite/walletRepository.js +0 -441
- package/dist/cjs/repositories/walletRepository.js +0 -2
- package/dist/cjs/script/address.js +0 -108
- package/dist/cjs/script/base.js +0 -185
- package/dist/cjs/script/default.js +0 -57
- package/dist/cjs/script/delegate.js +0 -53
- package/dist/cjs/script/tapscript.js +0 -619
- package/dist/cjs/script/vhtlc.js +0 -170
- package/dist/cjs/storage/asyncStorage.js +0 -50
- package/dist/cjs/storage/fileSystem.js +0 -141
- package/dist/cjs/storage/inMemory.js +0 -24
- package/dist/cjs/storage/index.js +0 -2
- package/dist/cjs/storage/indexedDB.js +0 -101
- package/dist/cjs/storage/localStorage.js +0 -51
- package/dist/cjs/tree/signingSession.js +0 -229
- package/dist/cjs/tree/txTree.js +0 -192
- package/dist/cjs/tree/validation.js +0 -107
- package/dist/cjs/utils/anchor.js +0 -35
- package/dist/cjs/utils/arkTransaction.js +0 -271
- package/dist/cjs/utils/bip21.js +0 -127
- package/dist/cjs/utils/syncCursors.js +0 -128
- package/dist/cjs/utils/timelock.js +0 -59
- package/dist/cjs/utils/transaction.js +0 -28
- package/dist/cjs/utils/transactionHistory.js +0 -183
- package/dist/cjs/utils/txSizeEstimator.js +0 -132
- package/dist/cjs/utils/unknownFields.js +0 -174
- package/dist/cjs/wallet/asset-manager.js +0 -330
- package/dist/cjs/wallet/asset.js +0 -119
- package/dist/cjs/wallet/batch.js +0 -183
- package/dist/cjs/wallet/delegator.js +0 -308
- package/dist/cjs/wallet/expo/background.js +0 -116
- package/dist/cjs/wallet/expo/index.js +0 -9
- package/dist/cjs/wallet/expo/wallet.js +0 -230
- package/dist/cjs/wallet/hdDescriptorProvider.js +0 -188
- package/dist/cjs/wallet/index.js +0 -82
- package/dist/cjs/wallet/inputSignerRouter.js +0 -98
- package/dist/cjs/wallet/onchain.js +0 -290
- package/dist/cjs/wallet/ramps.js +0 -216
- package/dist/cjs/wallet/serviceWorker/wallet-message-handler.js +0 -953
- package/dist/cjs/wallet/serviceWorker/wallet.js +0 -1174
- package/dist/cjs/wallet/signingErrors.js +0 -32
- package/dist/cjs/wallet/unroll.js +0 -293
- package/dist/cjs/wallet/utils.js +0 -111
- package/dist/cjs/wallet/validation.js +0 -154
- package/dist/cjs/wallet/vtxo-manager.js +0 -1142
- package/dist/cjs/wallet/wallet.js +0 -2195
- package/dist/cjs/wallet/walletReceiveRotator.js +0 -547
- package/dist/cjs/worker/browser/service-worker-manager.js +0 -183
- package/dist/cjs/worker/browser/utils.js +0 -67
- package/dist/cjs/worker/errors.js +0 -16
- package/dist/cjs/worker/expo/asyncStorageTaskQueue.js +0 -78
- package/dist/cjs/worker/expo/index.js +0 -13
- package/dist/cjs/worker/expo/processors/contractPollProcessor.js +0 -62
- package/dist/cjs/worker/expo/processors/index.js +0 -6
- package/dist/cjs/worker/expo/taskQueue.js +0 -41
- package/dist/cjs/worker/expo/taskRunner.js +0 -73
- package/dist/cjs/worker/messageBus.js +0 -474
- package/dist/esm/adapters/asyncStorage.js +0 -1
- package/dist/esm/adapters/expo.js +0 -3
- package/dist/esm/adapters/fileSystem.js +0 -1
- package/dist/esm/adapters/indexedDB.js +0 -1
- package/dist/esm/adapters/localStorage.js +0 -1
- package/dist/esm/arkfee/celenv.js +0 -40
- package/dist/esm/arkfee/estimator.js +0 -139
- package/dist/esm/arkfee/index.js +0 -1
- package/dist/esm/arkfee/types.js +0 -22
- package/dist/esm/arknote/index.js +0 -124
- package/dist/esm/bip322/index.js +0 -267
- package/dist/esm/contracts/arkcontract.js +0 -140
- package/dist/esm/contracts/contractManager.js +0 -645
- package/dist/esm/contracts/contractWatcher.js +0 -594
- package/dist/esm/contracts/handlers/default.js +0 -90
- package/dist/esm/contracts/handlers/delegate.js +0 -87
- package/dist/esm/contracts/handlers/helpers.js +0 -110
- package/dist/esm/contracts/handlers/index.js +0 -12
- package/dist/esm/contracts/handlers/registry.js +0 -86
- package/dist/esm/contracts/handlers/vhtlc.js +0 -191
- package/dist/esm/contracts/index.js +0 -13
- package/dist/esm/contracts/types.js +0 -1
- package/dist/esm/contracts/vtxoOwnership.js +0 -69
- package/dist/esm/extension/asset/assetGroup.js +0 -224
- package/dist/esm/extension/asset/assetId.js +0 -148
- package/dist/esm/extension/asset/assetInput.js +0 -217
- package/dist/esm/extension/asset/assetOutput.js +0 -169
- package/dist/esm/extension/asset/assetRef.js +0 -144
- package/dist/esm/extension/asset/index.js +0 -8
- package/dist/esm/extension/asset/metadata.js +0 -182
- package/dist/esm/extension/asset/packet.js +0 -110
- package/dist/esm/extension/asset/types.js +0 -19
- package/dist/esm/extension/asset/utils.js +0 -99
- package/dist/esm/extension/index.js +0 -248
- package/dist/esm/extension/packet.js +0 -16
- package/dist/esm/forfeit.js +0 -41
- package/dist/esm/identity/descriptor.js +0 -161
- package/dist/esm/identity/descriptorProvider.js +0 -1
- package/dist/esm/identity/hdCapableIdentity.js +0 -17
- package/dist/esm/identity/index.js +0 -13
- package/dist/esm/identity/seedIdentity.js +0 -469
- package/dist/esm/identity/serialize.js +0 -164
- package/dist/esm/identity/singleKey.js +0 -121
- package/dist/esm/identity/staticDescriptorProvider.js +0 -61
- package/dist/esm/index.js +0 -87
- package/dist/esm/intent/index.js +0 -255
- package/dist/esm/musig2/index.js +0 -3
- package/dist/esm/musig2/keys.js +0 -21
- package/dist/esm/musig2/nonces.js +0 -11
- package/dist/esm/musig2/sign.js +0 -63
- package/dist/esm/networks.js +0 -22
- package/dist/esm/package.json +0 -3
- package/dist/esm/providers/ark.js +0 -572
- package/dist/esm/providers/delegator.js +0 -81
- package/dist/esm/providers/electrum.js +0 -864
- package/dist/esm/providers/errors.js +0 -54
- package/dist/esm/providers/expoArk.js +0 -78
- package/dist/esm/providers/expoIndexer.js +0 -107
- package/dist/esm/providers/expoUtils.js +0 -87
- package/dist/esm/providers/indexer.js +0 -626
- package/dist/esm/providers/onchain.js +0 -258
- package/dist/esm/providers/utils.js +0 -117
- package/dist/esm/repositories/contractRepository.js +0 -1
- package/dist/esm/repositories/inMemory/contractRepository.js +0 -51
- package/dist/esm/repositories/inMemory/walletRepository.js +0 -111
- package/dist/esm/repositories/index.js +0 -10
- package/dist/esm/repositories/indexedDB/contractRepository.js +0 -183
- package/dist/esm/repositories/indexedDB/db.js +0 -4
- package/dist/esm/repositories/indexedDB/manager.js +0 -95
- package/dist/esm/repositories/indexedDB/schema.js +0 -199
- package/dist/esm/repositories/indexedDB/walletRepository.js +0 -470
- package/dist/esm/repositories/indexedDB/websqlAdapter.js +0 -138
- package/dist/esm/repositories/migrations/contractRepositoryImpl.js +0 -121
- package/dist/esm/repositories/migrations/fromStorageAdapter.js +0 -58
- package/dist/esm/repositories/migrations/walletRepositoryImpl.js +0 -180
- package/dist/esm/repositories/realm/contractRepository.js +0 -112
- package/dist/esm/repositories/realm/index.js +0 -3
- package/dist/esm/repositories/realm/schemas.js +0 -153
- package/dist/esm/repositories/realm/types.js +0 -6
- package/dist/esm/repositories/realm/walletRepository.js +0 -301
- package/dist/esm/repositories/scriptFromAddress.js +0 -13
- package/dist/esm/repositories/serialization.js +0 -67
- package/dist/esm/repositories/sqlite/contractRepository.js +0 -131
- package/dist/esm/repositories/sqlite/index.js +0 -2
- package/dist/esm/repositories/sqlite/types.js +0 -1
- package/dist/esm/repositories/sqlite/walletRepository.js +0 -437
- package/dist/esm/repositories/walletRepository.js +0 -1
- package/dist/esm/script/address.js +0 -104
- package/dist/esm/script/base.js +0 -179
- package/dist/esm/script/default.js +0 -54
- package/dist/esm/script/delegate.js +0 -50
- package/dist/esm/script/tapscript.js +0 -615
- package/dist/esm/script/vhtlc.js +0 -167
- package/dist/esm/storage/asyncStorage.js +0 -46
- package/dist/esm/storage/fileSystem.js +0 -104
- package/dist/esm/storage/inMemory.js +0 -20
- package/dist/esm/storage/index.js +0 -1
- package/dist/esm/storage/indexedDB.js +0 -97
- package/dist/esm/storage/localStorage.js +0 -47
- package/dist/esm/tree/signingSession.js +0 -191
- package/dist/esm/tree/txTree.js +0 -188
- package/dist/esm/tree/validation.js +0 -101
- package/dist/esm/utils/anchor.js +0 -31
- package/dist/esm/utils/arkTransaction.js +0 -264
- package/dist/esm/utils/bip21.js +0 -123
- package/dist/esm/utils/syncCursors.js +0 -119
- package/dist/esm/utils/timelock.js +0 -22
- package/dist/esm/utils/transaction.js +0 -24
- package/dist/esm/utils/transactionHistory.js +0 -180
- package/dist/esm/utils/txSizeEstimator.js +0 -128
- package/dist/esm/utils/unknownFields.js +0 -169
- package/dist/esm/wallet/asset-manager.js +0 -325
- package/dist/esm/wallet/asset.js +0 -113
- package/dist/esm/wallet/batch.js +0 -180
- package/dist/esm/wallet/delegator.js +0 -303
- package/dist/esm/wallet/expo/background.js +0 -111
- package/dist/esm/wallet/expo/index.js +0 -2
- package/dist/esm/wallet/expo/wallet.js +0 -193
- package/dist/esm/wallet/hdDescriptorProvider.js +0 -184
- package/dist/esm/wallet/index.js +0 -75
- package/dist/esm/wallet/inputSignerRouter.js +0 -94
- package/dist/esm/wallet/onchain.js +0 -285
- package/dist/esm/wallet/ramps.js +0 -212
- package/dist/esm/wallet/serviceWorker/wallet-message-handler.js +0 -946
- package/dist/esm/wallet/serviceWorker/wallet.js +0 -1169
- package/dist/esm/wallet/signingErrors.js +0 -27
- package/dist/esm/wallet/unroll.js +0 -289
- package/dist/esm/wallet/utils.js +0 -103
- package/dist/esm/wallet/validation.js +0 -142
- package/dist/esm/wallet/vtxo-manager.js +0 -1136
- package/dist/esm/wallet/wallet.js +0 -2186
- package/dist/esm/wallet/walletReceiveRotator.js +0 -540
- package/dist/esm/worker/browser/service-worker-manager.js +0 -177
- package/dist/esm/worker/browser/utils.js +0 -63
- package/dist/esm/worker/errors.js +0 -11
- package/dist/esm/worker/expo/asyncStorageTaskQueue.js +0 -74
- package/dist/esm/worker/expo/index.js +0 -4
- package/dist/esm/worker/expo/processors/contractPollProcessor.js +0 -59
- package/dist/esm/worker/expo/processors/index.js +0 -1
- package/dist/esm/worker/expo/taskQueue.js +0 -37
- package/dist/esm/worker/expo/taskRunner.js +0 -69
- package/dist/esm/worker/messageBus.js +0 -470
- package/dist/types/adapters/asyncStorage.d.ts +0 -2
- package/dist/types/adapters/expo.d.ts +0 -4
- package/dist/types/adapters/fileSystem.d.ts +0 -2
- package/dist/types/adapters/indexedDB.d.ts +0 -2
- package/dist/types/adapters/localStorage.d.ts +0 -2
- package/dist/types/arkfee/celenv.d.ts +0 -25
- package/dist/types/arkfee/estimator.d.ts +0 -49
- package/dist/types/arkfee/index.d.ts +0 -2
- package/dist/types/arkfee/types.d.ts +0 -38
- package/dist/types/arknote/index.d.ts +0 -84
- package/dist/types/bip322/index.d.ts +0 -55
- package/dist/types/contracts/arkcontract.d.ts +0 -99
- package/dist/types/contracts/contractManager.d.ts +0 -411
- package/dist/types/contracts/contractWatcher.d.ts +0 -217
- package/dist/types/contracts/handlers/default.d.ts +0 -19
- package/dist/types/contracts/handlers/delegate.d.ts +0 -21
- package/dist/types/contracts/handlers/helpers.d.ts +0 -19
- package/dist/types/contracts/handlers/index.d.ts +0 -7
- package/dist/types/contracts/handlers/registry.d.ts +0 -65
- package/dist/types/contracts/handlers/vhtlc.d.ts +0 -32
- package/dist/types/contracts/index.d.ts +0 -14
- package/dist/types/contracts/types.d.ts +0 -250
- package/dist/types/contracts/vtxoOwnership.d.ts +0 -33
- package/dist/types/extension/asset/assetGroup.d.ts +0 -119
- package/dist/types/extension/asset/assetId.d.ts +0 -83
- package/dist/types/extension/asset/assetInput.d.ts +0 -64
- package/dist/types/extension/asset/assetOutput.d.ts +0 -54
- package/dist/types/extension/asset/assetRef.d.ts +0 -91
- package/dist/types/extension/asset/index.d.ts +0 -8
- package/dist/types/extension/asset/metadata.d.ts +0 -52
- package/dist/types/extension/asset/packet.d.ts +0 -41
- package/dist/types/extension/asset/types.d.ts +0 -16
- package/dist/types/extension/asset/utils.d.ts +0 -21
- package/dist/types/extension/index.d.ts +0 -56
- package/dist/types/extension/packet.d.ts +0 -21
- package/dist/types/forfeit.d.ts +0 -18
- package/dist/types/identity/descriptor.d.ts +0 -61
- package/dist/types/identity/descriptorProvider.d.ts +0 -42
- package/dist/types/identity/hdCapableIdentity.d.ts +0 -71
- package/dist/types/identity/index.d.ts +0 -57
- package/dist/types/identity/seedIdentity.d.ts +0 -270
- package/dist/types/identity/serialize.d.ts +0 -96
- package/dist/types/identity/singleKey.d.ts +0 -62
- package/dist/types/identity/staticDescriptorProvider.d.ts +0 -18
- package/dist/types/index.d.ts +0 -59
- package/dist/types/intent/index.d.ts +0 -86
- package/dist/types/musig2/index.d.ts +0 -4
- package/dist/types/musig2/keys.d.ts +0 -9
- package/dist/types/musig2/nonces.d.ts +0 -14
- package/dist/types/musig2/sign.d.ts +0 -27
- package/dist/types/networks.d.ts +0 -16
- package/dist/types/providers/ark.d.ts +0 -369
- package/dist/types/providers/delegator.d.ts +0 -82
- package/dist/types/providers/electrum.d.ts +0 -312
- package/dist/types/providers/errors.d.ts +0 -13
- package/dist/types/providers/expoArk.d.ts +0 -22
- package/dist/types/providers/expoIndexer.d.ts +0 -18
- package/dist/types/providers/expoUtils.d.ts +0 -18
- package/dist/types/providers/indexer.d.ts +0 -301
- package/dist/types/providers/onchain.d.ts +0 -148
- package/dist/types/providers/utils.d.ts +0 -12
- package/dist/types/repositories/contractRepository.d.ts +0 -32
- package/dist/types/repositories/inMemory/contractRepository.d.ts +0 -17
- package/dist/types/repositories/inMemory/walletRepository.d.ts +0 -29
- package/dist/types/repositories/index.d.ts +0 -9
- package/dist/types/repositories/indexedDB/contractRepository.d.ts +0 -21
- package/dist/types/repositories/indexedDB/db.d.ts +0 -4
- package/dist/types/repositories/indexedDB/manager.d.ts +0 -25
- package/dist/types/repositories/indexedDB/schema.d.ts +0 -9
- package/dist/types/repositories/indexedDB/walletRepository.d.ts +0 -28
- package/dist/types/repositories/indexedDB/websqlAdapter.d.ts +0 -49
- package/dist/types/repositories/migrations/contractRepositoryImpl.d.ts +0 -24
- package/dist/types/repositories/migrations/fromStorageAdapter.d.ts +0 -19
- package/dist/types/repositories/migrations/walletRepositoryImpl.d.ts +0 -27
- package/dist/types/repositories/realm/contractRepository.d.ts +0 -24
- package/dist/types/repositories/realm/index.d.ts +0 -4
- package/dist/types/repositories/realm/types.d.ts +0 -16
- package/dist/types/repositories/realm/walletRepository.d.ts +0 -34
- package/dist/types/repositories/scriptFromAddress.d.ts +0 -9
- package/dist/types/repositories/serialization.d.ts +0 -65
- package/dist/types/repositories/sqlite/contractRepository.d.ts +0 -33
- package/dist/types/repositories/sqlite/index.d.ts +0 -3
- package/dist/types/repositories/sqlite/types.d.ts +0 -18
- package/dist/types/repositories/walletRepository.d.ts +0 -72
- package/dist/types/script/address.d.ts +0 -67
- package/dist/types/script/base.d.ts +0 -105
- package/dist/types/script/default.d.ts +0 -44
- package/dist/types/script/delegate.d.ts +0 -40
- package/dist/types/script/tapscript.d.ts +0 -169
- package/dist/types/script/vhtlc.d.ts +0 -66
- package/dist/types/tree/signingSession.d.ts +0 -37
- package/dist/types/tree/txTree.d.ts +0 -28
- package/dist/types/tree/validation.d.ts +0 -15
- package/dist/types/utils/anchor.d.ts +0 -19
- package/dist/types/utils/arkTransaction.d.ts +0 -49
- package/dist/types/utils/bip21.d.ts +0 -38
- package/dist/types/utils/syncCursors.d.ts +0 -60
- package/dist/types/utils/timelock.d.ts +0 -9
- package/dist/types/utils/transaction.d.ts +0 -13
- package/dist/types/utils/transactionHistory.d.ts +0 -15
- package/dist/types/utils/txSizeEstimator.d.ts +0 -40
- package/dist/types/utils/unknownFields.d.ts +0 -83
- package/dist/types/wallet/asset-manager.d.ts +0 -69
- package/dist/types/wallet/asset.d.ts +0 -21
- package/dist/types/wallet/batch.d.ts +0 -107
- package/dist/types/wallet/delegator.d.ts +0 -48
- package/dist/types/wallet/expo/background.d.ts +0 -66
- package/dist/types/wallet/expo/index.d.ts +0 -4
- package/dist/types/wallet/hdDescriptorProvider.d.ts +0 -114
- package/dist/types/wallet/index.d.ts +0 -789
- package/dist/types/wallet/inputSignerRouter.d.ts +0 -35
- package/dist/types/wallet/onchain.d.ts +0 -109
- package/dist/types/wallet/ramps.d.ts +0 -64
- package/dist/types/wallet/serviceWorker/wallet-message-handler.d.ts +0 -543
- package/dist/types/wallet/serviceWorker/wallet.d.ts +0 -248
- package/dist/types/wallet/signingErrors.d.ts +0 -19
- package/dist/types/wallet/unroll.d.ts +0 -114
- package/dist/types/wallet/utils.d.ts +0 -36
- package/dist/types/wallet/validation.d.ts +0 -24
- package/dist/types/wallet/vtxo-manager.d.ts +0 -476
- package/dist/types/wallet/wallet.d.ts +0 -409
- package/dist/types/wallet/walletReceiveRotator.d.ts +0 -306
- package/dist/types/worker/browser/service-worker-manager.d.ts +0 -32
- package/dist/types/worker/browser/utils.d.ts +0 -17
- package/dist/types/worker/errors.d.ts +0 -7
- package/dist/types/worker/expo/index.d.ts +0 -7
- package/dist/types/worker/expo/processors/contractPollProcessor.d.ts +0 -19
- package/dist/types/worker/expo/processors/index.d.ts +0 -1
- package/dist/types/worker/expo/taskQueue.d.ts +0 -50
- package/dist/types/worker/expo/taskRunner.d.ts +0 -66
- package/dist/types/worker/messageBus.d.ts +0 -189
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
2
|
-
import { DefaultVtxo } from "./default.js";
|
|
3
|
-
import { TapLeafScript, VtxoScript } from "./base.js";
|
|
4
|
-
/**
|
|
5
|
-
* DelegateVtxo extends DefaultVtxo with an extra delegator path
|
|
6
|
-
*/
|
|
7
|
-
export declare namespace DelegateVtxo {
|
|
8
|
-
/**
|
|
9
|
-
* Options extends DefaultVtxo.Options and adds a delegatePubKey
|
|
10
|
-
*/
|
|
11
|
-
interface Options extends DefaultVtxo.Options {
|
|
12
|
-
delegatePubKey: Bytes;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* DelegateVtxo.Script extends DefaultVtxo.Script and adds a delegate path.
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* const vtxoScript = new DelegateVtxo.Script({
|
|
19
|
-
* pubKey: new Uint8Array(32),
|
|
20
|
-
* serverPubKey: new Uint8Array(32),
|
|
21
|
-
* delegatePubKey: new Uint8Array(32),
|
|
22
|
-
* });
|
|
23
|
-
*
|
|
24
|
-
* console.log("script pub key:", vtxoScript.pkScript)
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
class Script extends VtxoScript {
|
|
28
|
-
readonly options: Options;
|
|
29
|
-
readonly defaultVtxo: DefaultVtxo.Script;
|
|
30
|
-
readonly delegateScript: string;
|
|
31
|
-
/** Create a delegated virtual output script with forfeit, exit, and delegate paths. */
|
|
32
|
-
constructor(options: Options);
|
|
33
|
-
/** Return the forfeit tapleaf script. */
|
|
34
|
-
forfeit(): TapLeafScript;
|
|
35
|
-
/** Return the unilateral exit tapleaf script. */
|
|
36
|
-
exit(): TapLeafScript;
|
|
37
|
-
/** Return the delegate tapleaf script. */
|
|
38
|
-
delegate(): TapLeafScript;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
2
|
-
/**
|
|
3
|
-
* RelativeTimelock lets to create timelocked with CHECKSEQUENCEVERIFY script.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```typescript
|
|
7
|
-
* const timelock = { value: 144n, type: "blocks" }; // 1 day in blocks
|
|
8
|
-
* const timelock = { value: 512n, type: "seconds" }; // 8 minutes in seconds
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export type RelativeTimelock = {
|
|
12
|
-
value: bigint;
|
|
13
|
-
type: "seconds" | "blocks";
|
|
14
|
-
};
|
|
15
|
-
export declare enum TapscriptType {
|
|
16
|
-
Multisig = "multisig",
|
|
17
|
-
CSVMultisig = "csv-multisig",
|
|
18
|
-
ConditionCSVMultisig = "condition-csv-multisig",
|
|
19
|
-
ConditionMultisig = "condition-multisig",
|
|
20
|
-
CLTVMultisig = "cltv-multisig"
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* ArkTapscript is the base element of vtxo scripts.
|
|
24
|
-
* It is used to encode and decode the different types of vtxo scripts.
|
|
25
|
-
*/
|
|
26
|
-
export interface ArkTapscript<T extends TapscriptType, Params> {
|
|
27
|
-
type: T;
|
|
28
|
-
params: Params;
|
|
29
|
-
script: Uint8Array;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* decodeTapscript is a function that decodes an Arkade tapscript from a raw script.
|
|
33
|
-
*
|
|
34
|
-
* @throws {Error} if the script is not a valid Arkade tapscript
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const arkTapscript = decodeTapscript(new Uint8Array(32));
|
|
38
|
-
* console.log("type:", arkTapscript.type);
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export declare function decodeTapscript(script: Uint8Array): ArkTapscript<TapscriptType, any>;
|
|
42
|
-
/**
|
|
43
|
-
* Implements a multi-signature tapscript.
|
|
44
|
-
*
|
|
45
|
-
* <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const multisigTapscript = MultisigTapscript.encode({ pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
export declare namespace MultisigTapscript {
|
|
53
|
-
type Type = ArkTapscript<TapscriptType.Multisig, Params>;
|
|
54
|
-
enum MultisigType {
|
|
55
|
-
CHECKSIG = 0,
|
|
56
|
-
CHECKSIGADD = 1
|
|
57
|
-
}
|
|
58
|
-
type Params = {
|
|
59
|
-
pubkeys: Bytes[];
|
|
60
|
-
type?: MultisigType;
|
|
61
|
-
};
|
|
62
|
-
/** Encode a plain multisig tapscript. */
|
|
63
|
-
function encode(params: Params): Type;
|
|
64
|
-
/** Decode a plain multisig tapscript from raw script bytes. */
|
|
65
|
-
function decode(script: Uint8Array): Type;
|
|
66
|
-
/** Return true when the tapscript is a plain multisig tapscript. */
|
|
67
|
-
function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Implements a relative timelock script that requires all specified pubkeys to sign
|
|
71
|
-
* after the relative timelock has expired. The timelock can be specified in blocks or seconds.
|
|
72
|
-
*
|
|
73
|
-
* This is the standard exit closure and it is also used for the sweep closure in vtxo trees.
|
|
74
|
-
*
|
|
75
|
-
* <sequence> CHECKSEQUENCEVERIFY DROP <pubkey> CHECKSIG
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```typescript
|
|
79
|
-
* const csvMultisigTapscript = CSVMultisigTapscript.encode({ timelock: { type: "blocks", value: 144 }, pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
export declare namespace CSVMultisigTapscript {
|
|
83
|
-
type Type = ArkTapscript<TapscriptType.CSVMultisig, Params>;
|
|
84
|
-
type Params = {
|
|
85
|
-
timelock: RelativeTimelock;
|
|
86
|
-
} & MultisigTapscript.Params;
|
|
87
|
-
/** Encode a CSV multisig tapscript. */
|
|
88
|
-
function encode(params: Params): Type;
|
|
89
|
-
/** Decode a CSV multisig tapscript from raw script bytes. */
|
|
90
|
-
function decode(script: Uint8Array): Type;
|
|
91
|
-
/** Return true when the tapscript is a CSV multisig tapscript. */
|
|
92
|
-
function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
|
|
93
|
-
function isScriptValid(script: Uint8Array): true | Error;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Combines a condition script with an exit closure. The resulting script requires
|
|
97
|
-
* the condition to be met, followed by the standard exit closure requirements
|
|
98
|
-
* (timelock and signatures).
|
|
99
|
-
*
|
|
100
|
-
* <conditionScript> VERIFY <sequence> CHECKSEQUENCEVERIFY DROP <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```typescript
|
|
104
|
-
* const conditionCSVMultisigTapscript = ConditionCSVMultisigTapscript.encode({ conditionScript: new Uint8Array(32), pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
export declare namespace ConditionCSVMultisigTapscript {
|
|
108
|
-
type Type = ArkTapscript<TapscriptType.ConditionCSVMultisig, Params>;
|
|
109
|
-
type Params = {
|
|
110
|
-
conditionScript: Bytes;
|
|
111
|
-
} & CSVMultisigTapscript.Params;
|
|
112
|
-
/** Encode a condition + CSV multisig tapscript. */
|
|
113
|
-
function encode(params: Params): Type;
|
|
114
|
-
/** Decode a condition + CSV multisig tapscript from raw script bytes. */
|
|
115
|
-
function decode(script: Uint8Array): Type;
|
|
116
|
-
/** Return true when the tapscript is a condition + CSV multisig tapscript. */
|
|
117
|
-
function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
|
|
118
|
-
function isScriptValid(script: Uint8Array): true | Error;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Combines a condition script with a forfeit closure. The resulting script requires
|
|
122
|
-
* the condition to be met, followed by the standard forfeit closure requirements
|
|
123
|
-
* (multi-signature).
|
|
124
|
-
*
|
|
125
|
-
* <conditionScript> VERIFY <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
|
|
126
|
-
*
|
|
127
|
-
* @example
|
|
128
|
-
* ```typescript
|
|
129
|
-
* const conditionMultisigTapscript = ConditionMultisigTapscript.encode({ conditionScript: new Uint8Array(32), pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
|
|
130
|
-
* ```
|
|
131
|
-
*/
|
|
132
|
-
export declare namespace ConditionMultisigTapscript {
|
|
133
|
-
type Type = ArkTapscript<TapscriptType.ConditionMultisig, Params>;
|
|
134
|
-
type Params = {
|
|
135
|
-
conditionScript: Bytes;
|
|
136
|
-
} & MultisigTapscript.Params;
|
|
137
|
-
/** Encode a condition + multisig tapscript. */
|
|
138
|
-
function encode(params: Params): Type;
|
|
139
|
-
/** Decode a condition + multisig tapscript from raw script bytes. */
|
|
140
|
-
function decode(script: Uint8Array): Type;
|
|
141
|
-
/** Return true when the tapscript is a condition + multisig tapscript. */
|
|
142
|
-
function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
|
|
143
|
-
function isScriptValid(script: Uint8Array): true | Error;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Implements an absolute timelock (CLTV) script combined with a forfeit closure.
|
|
147
|
-
* The script requires waiting until a specific block height/timestamp before the
|
|
148
|
-
* forfeit closure conditions can be met.
|
|
149
|
-
*
|
|
150
|
-
* <locktime> CHECKLOCKTIMEVERIFY DROP <pubkey> CHECKSIGVERIFY <pubkey> CHECKSIG
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```typescript
|
|
154
|
-
* const cltvMultisigTapscript = CLTVMultisigTapscript.encode({ absoluteTimelock: 144, pubkeys: [new Uint8Array(32), new Uint8Array(32)] });
|
|
155
|
-
* ```
|
|
156
|
-
*/
|
|
157
|
-
export declare namespace CLTVMultisigTapscript {
|
|
158
|
-
type Type = ArkTapscript<TapscriptType.CLTVMultisig, Params>;
|
|
159
|
-
type Params = {
|
|
160
|
-
absoluteTimelock: bigint;
|
|
161
|
-
} & MultisigTapscript.Params;
|
|
162
|
-
/** Encode a CLTV multisig tapscript. */
|
|
163
|
-
function encode(params: Params): Type;
|
|
164
|
-
/** Decode a CLTV multisig tapscript from raw script bytes. */
|
|
165
|
-
function decode(script: Uint8Array): Type;
|
|
166
|
-
/** Return true when the tapscript is a CLTV multisig tapscript. */
|
|
167
|
-
function is(tapscript: ArkTapscript<any, any>): tapscript is Type;
|
|
168
|
-
function isScriptValid(script: Uint8Array): true | Error;
|
|
169
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
2
|
-
import { RelativeTimelock } from "./tapscript.js";
|
|
3
|
-
import { TapLeafScript, VtxoScript } from "./base.js";
|
|
4
|
-
/** Virtual Hash Time Lock Contract (VHTLC) namespace. */
|
|
5
|
-
export declare namespace VHTLC {
|
|
6
|
-
interface Options {
|
|
7
|
-
sender: Bytes;
|
|
8
|
-
receiver: Bytes;
|
|
9
|
-
server: Bytes;
|
|
10
|
-
preimageHash: Bytes;
|
|
11
|
-
refundLocktime: bigint;
|
|
12
|
-
unilateralClaimDelay: RelativeTimelock;
|
|
13
|
-
unilateralRefundDelay: RelativeTimelock;
|
|
14
|
-
unilateralRefundWithoutReceiverDelay: RelativeTimelock;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Virtual Hash Time Lock Contract (VHTLC) script implementation.
|
|
18
|
-
*
|
|
19
|
-
* VHTLC enables atomic swaps and conditional payments in the Arkade protocol.
|
|
20
|
-
* It provides multiple spending paths:
|
|
21
|
-
*
|
|
22
|
-
* - **claim**: Receiver can claim funds by revealing the preimage
|
|
23
|
-
* - **refund**: Sender and receiver can collaboratively refund
|
|
24
|
-
* - **refundWithoutReceiver**: Sender can refund after locktime expires
|
|
25
|
-
* - **unilateralClaim**: Receiver can claim unilaterally after delay
|
|
26
|
-
* - **unilateralRefund**: Sender and receiver can refund unilaterally after delay
|
|
27
|
-
* - **unilateralRefundWithoutReceiver**: Sender can refund unilaterally after delay
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* const vhtlc = new VHTLC.Script({
|
|
32
|
-
* sender: alicePubKey,
|
|
33
|
-
* receiver: bobPubKey,
|
|
34
|
-
* server: serverPubKey,
|
|
35
|
-
* preimageHash: hash160(secret),
|
|
36
|
-
* refundLocktime: BigInt(chainTip + 10),
|
|
37
|
-
* unilateralClaimDelay: { type: 'blocks', value: 100n },
|
|
38
|
-
* unilateralRefundDelay: { type: 'blocks', value: 102n },
|
|
39
|
-
* unilateralRefundWithoutReceiverDelay: { type: 'blocks', value: 103n }
|
|
40
|
-
* });
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
class Script extends VtxoScript {
|
|
44
|
-
readonly options: Options;
|
|
45
|
-
readonly claimScript: string;
|
|
46
|
-
readonly refundScript: string;
|
|
47
|
-
readonly refundWithoutReceiverScript: string;
|
|
48
|
-
readonly unilateralClaimScript: string;
|
|
49
|
-
readonly unilateralRefundScript: string;
|
|
50
|
-
readonly unilateralRefundWithoutReceiverScript: string;
|
|
51
|
-
/** Create a VHTLC script from the supplied participant keys, hash, and timelocks. */
|
|
52
|
-
constructor(options: Options);
|
|
53
|
-
/** Return the collaborative claim tapleaf script. */
|
|
54
|
-
claim(): TapLeafScript;
|
|
55
|
-
/** Return the collaborative refund tapleaf script. */
|
|
56
|
-
refund(): TapLeafScript;
|
|
57
|
-
/** Return the refund-without-receiver tapleaf script. */
|
|
58
|
-
refundWithoutReceiver(): TapLeafScript;
|
|
59
|
-
/** Return the unilateral claim tapleaf script. */
|
|
60
|
-
unilateralClaim(): TapLeafScript;
|
|
61
|
-
/** Return the unilateral refund tapleaf script. */
|
|
62
|
-
unilateralRefund(): TapLeafScript;
|
|
63
|
-
/** Return the unilateral refund-without-receiver tapleaf script. */
|
|
64
|
-
unilateralRefundWithoutReceiver(): TapLeafScript;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as musig2 from "../musig2/index.js";
|
|
2
|
-
import { TxTree } from "./txTree.js";
|
|
3
|
-
export declare const ErrMissingVtxoGraph: Error;
|
|
4
|
-
export declare const ErrMissingAggregateKey: Error;
|
|
5
|
-
export type Musig2PublicNonce = Pick<musig2.Nonces, "pubNonce">;
|
|
6
|
-
export type TreeNonces = Map<string, Musig2PublicNonce>;
|
|
7
|
-
export type TreePartialSigs = Map<string, musig2.PartialSig>;
|
|
8
|
-
export interface SignerSession {
|
|
9
|
-
getPublicKey(): Promise<Uint8Array>;
|
|
10
|
-
init(tree: TxTree, scriptRoot: Uint8Array, rootInputAmount: bigint): Promise<void>;
|
|
11
|
-
getNonces(): Promise<TreeNonces>;
|
|
12
|
-
aggregatedNonces(txid: string, noncesByPubkey: TreeNonces): Promise<{
|
|
13
|
-
hasAllNonces: boolean;
|
|
14
|
-
}>;
|
|
15
|
-
sign(): Promise<TreePartialSigs>;
|
|
16
|
-
}
|
|
17
|
-
export declare class TreeSignerSession implements SignerSession {
|
|
18
|
-
private secretKey;
|
|
19
|
-
static NOT_INITIALIZED: Error;
|
|
20
|
-
private myNonces;
|
|
21
|
-
private aggregateNonces;
|
|
22
|
-
private graph;
|
|
23
|
-
private scriptRoot;
|
|
24
|
-
private rootSharedOutputAmount;
|
|
25
|
-
constructor(secretKey: Uint8Array);
|
|
26
|
-
static random(): TreeSignerSession;
|
|
27
|
-
init(tree: TxTree, scriptRoot: Uint8Array, rootInputAmount: bigint): Promise<void>;
|
|
28
|
-
getPublicKey(): Promise<Uint8Array>;
|
|
29
|
-
getNonces(): Promise<TreeNonces>;
|
|
30
|
-
aggregatedNonces(txid: string, noncesByPubkey: TreeNonces): Promise<{
|
|
31
|
-
hasAllNonces: boolean;
|
|
32
|
-
}>;
|
|
33
|
-
sign(): Promise<TreePartialSigs>;
|
|
34
|
-
private generateNonces;
|
|
35
|
-
private signPartial;
|
|
36
|
-
}
|
|
37
|
-
export declare function validateTreeSigs(finalAggregatedKey: Uint8Array, sharedOutputAmount: bigint, vtxoTree: TxTree): Promise<void>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
|
-
/**
|
|
3
|
-
* TxTreeNode is a node of the tree.
|
|
4
|
-
* It contains the transaction id, the transaction and the children.
|
|
5
|
-
* any TxTree can be serialized as a list of TxTreeNode.
|
|
6
|
-
*/
|
|
7
|
-
export type TxTreeNode = {
|
|
8
|
-
txid: string;
|
|
9
|
-
tx: string;
|
|
10
|
-
children: Record<number, string>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* TxTree is a graph of bitcoin transactions.
|
|
14
|
-
* It is used to represent batch tree created during settlement session
|
|
15
|
-
*/
|
|
16
|
-
export declare class TxTree {
|
|
17
|
-
readonly root: Transaction;
|
|
18
|
-
readonly children: Map<number, TxTree>;
|
|
19
|
-
constructor(root: Transaction, children?: Map<number, TxTree>);
|
|
20
|
-
static create(chunks: TxTreeNode[]): TxTree;
|
|
21
|
-
nbOfNodes(): number;
|
|
22
|
-
validate(): void;
|
|
23
|
-
leaves(): Transaction[];
|
|
24
|
-
get txid(): string;
|
|
25
|
-
find(txid: string): TxTree | null;
|
|
26
|
-
update(txid: string, fn: (tx: Transaction) => void): void;
|
|
27
|
-
iterator(): Generator<TxTree, void, unknown>;
|
|
28
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer/transaction.js";
|
|
2
|
-
import { TxTree } from "./txTree.js";
|
|
3
|
-
export declare const ErrInvalidSettlementTx: (tx: string) => Error;
|
|
4
|
-
export declare const ErrInvalidSettlementTxOutputs: Error;
|
|
5
|
-
export declare const ErrEmptyTree: Error;
|
|
6
|
-
export declare const ErrNumberOfInputs: Error;
|
|
7
|
-
export declare const ErrWrongSettlementTxid: Error;
|
|
8
|
-
export declare const ErrInvalidAmount: Error;
|
|
9
|
-
export declare const ErrNoLeaves: Error;
|
|
10
|
-
export declare const ErrInvalidTaprootScript: Error;
|
|
11
|
-
export declare const ErrInvalidRoundTxOutputs: Error;
|
|
12
|
-
export declare const ErrWrongCommitmentTxid: Error;
|
|
13
|
-
export declare const ErrMissingCosignersPublicKeys: Error;
|
|
14
|
-
export declare function validateConnectorsTxGraph(settlementTxB64: string, connectorsGraph: TxTree): void;
|
|
15
|
-
export declare function validateVtxoTxGraph(graph: TxTree, roundTransaction: Transaction, sweepTapTreeRoot: Uint8Array): void;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "@scure/btc-signer";
|
|
2
|
-
import { TransactionInputUpdate } from "@scure/btc-signer/psbt.js";
|
|
3
|
-
export declare const ANCHOR_VALUE = 0n;
|
|
4
|
-
export declare const ANCHOR_PKSCRIPT: Uint8Array<ArrayBuffer>;
|
|
5
|
-
/**
|
|
6
|
-
* A zero-value anchor output.
|
|
7
|
-
*/
|
|
8
|
-
export declare const P2A: {
|
|
9
|
-
script: Uint8Array<ArrayBuffer>;
|
|
10
|
-
amount: bigint;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* search for anchor in the given transaction.
|
|
14
|
-
* @throws {Error} if the anchor is not found or has the wrong amount
|
|
15
|
-
*/
|
|
16
|
-
export declare function findP2AOutput(tx: Transaction): TransactionInputUpdate;
|
|
17
|
-
export interface AnchorBumper {
|
|
18
|
-
bumpP2A(parent: Transaction): Promise<[string, string]>;
|
|
19
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { TransactionOutput } from "@scure/btc-signer/psbt.js";
|
|
2
|
-
import { ExtendedCoin, VirtualCoin } from "../wallet/index.js";
|
|
3
|
-
import { RelativeTimelock } from "../script/tapscript.js";
|
|
4
|
-
import { EncodedVtxoScript, TapLeafScript } from "../script/base.js";
|
|
5
|
-
import { CSVMultisigTapscript } from "../script/tapscript.js";
|
|
6
|
-
import { Transaction } from "./transaction.js";
|
|
7
|
-
export type ArkTxInput = {
|
|
8
|
-
tapLeafScript: TapLeafScript;
|
|
9
|
-
} & EncodedVtxoScript & Pick<VirtualCoin, "txid" | "vout" | "value">;
|
|
10
|
-
export type OffchainTx = {
|
|
11
|
-
arkTx: Transaction;
|
|
12
|
-
checkpoints: Transaction[];
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Builds an offchain transaction with checkpoint transactions.
|
|
16
|
-
*
|
|
17
|
-
* Creates one checkpoint transaction per input and a virtual transaction that
|
|
18
|
-
* combines all the checkpoints, sending to the specified outputs. This is the
|
|
19
|
-
* core function for creating Arkade transactions.
|
|
20
|
-
*
|
|
21
|
-
* @param inputs - Array of virtual transaction inputs
|
|
22
|
-
* @param outputs - Array of transaction outputs
|
|
23
|
-
* @param serverUnrollScript - Server unroll script for checkpoint transactions
|
|
24
|
-
* @returns Object containing the virtual transaction and checkpoint transactions
|
|
25
|
-
*/
|
|
26
|
-
export declare function buildOffchainTx(inputs: ArkTxInput[], outputs: TransactionOutput[], serverUnrollScript: CSVMultisigTapscript.Type): OffchainTx;
|
|
27
|
-
export declare function hasBoardingTxExpired(coin: ExtendedCoin, boardingTimelock: RelativeTimelock, chainTipHeight?: number): boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Verify tapscript signatures on a transaction input
|
|
30
|
-
* @param tx Transaction to verify
|
|
31
|
-
* @param inputIndex Index of the input to verify
|
|
32
|
-
* @param requiredSigners List of required signer pubkeys (hex encoded)
|
|
33
|
-
* @param excludePubkeys List of pubkeys to exclude from verification (hex encoded, e.g., server key not yet signed)
|
|
34
|
-
* @param allowedSighashTypes List of allowed sighash types (defaults to [SigHash.DEFAULT])
|
|
35
|
-
* @throws Error if verification fails
|
|
36
|
-
*/
|
|
37
|
-
export declare function verifyTapscriptSignatures(tx: Transaction, inputIndex: number, requiredSigners: string[], excludePubkeys?: string[], allowedSighashTypes?: number[]): void;
|
|
38
|
-
/**
|
|
39
|
-
* Merges the signed transaction with the original transaction
|
|
40
|
-
* @param signedTx signed transaction
|
|
41
|
-
* @param originalTx original transaction
|
|
42
|
-
*/
|
|
43
|
-
export declare function combineTapscriptSigs(signedTx: Transaction, originalTx: Transaction): Transaction;
|
|
44
|
-
/**
|
|
45
|
-
* Validates if a given string is a valid Arkade address by attempting to decode it.
|
|
46
|
-
* @param address The Arkade address to validate.
|
|
47
|
-
* @returns True if the address is valid, false otherwise.
|
|
48
|
-
*/
|
|
49
|
-
export declare function isValidArkAddress(address: string): boolean;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/** Known BIP21 parameters including Arkade-specific extensions. */
|
|
2
|
-
export interface BIP21Params {
|
|
3
|
-
address?: string;
|
|
4
|
-
amount?: number;
|
|
5
|
-
label?: string;
|
|
6
|
-
message?: string;
|
|
7
|
-
/** Optional Arkade address parameter. */
|
|
8
|
-
ark?: string;
|
|
9
|
-
/** Optional Silent Payment address parameter. */
|
|
10
|
-
sp?: string;
|
|
11
|
-
[key: string]: string | number | undefined;
|
|
12
|
-
}
|
|
13
|
-
/** Result returned by `BIP21.parse`. */
|
|
14
|
-
export interface BIP21ParseResult {
|
|
15
|
-
originalString: string;
|
|
16
|
-
params: BIP21Params;
|
|
17
|
-
}
|
|
18
|
-
export declare enum BIP21Error {
|
|
19
|
-
INVALID_URI = "Invalid BIP21 URI",
|
|
20
|
-
INVALID_ADDRESS = "Invalid address"
|
|
21
|
-
}
|
|
22
|
-
export declare class BIP21 {
|
|
23
|
-
/**
|
|
24
|
-
* Create a BIP21 URI from the provided parameters.
|
|
25
|
-
*
|
|
26
|
-
* @param params - BIP21 parameters to encode
|
|
27
|
-
* @returns Encoded BIP21 URI
|
|
28
|
-
*/
|
|
29
|
-
static create(params: BIP21Params): string;
|
|
30
|
-
/**
|
|
31
|
-
* Parse a BIP21 URI and return its decoded parameters.
|
|
32
|
-
*
|
|
33
|
-
* @param uri - BIP21 URI to parse
|
|
34
|
-
* @returns Parsed BIP21 URI data
|
|
35
|
-
* @throws Error if the URI does not start with the `bitcoin:` scheme
|
|
36
|
-
*/
|
|
37
|
-
static parse(uri: string): BIP21ParseResult;
|
|
38
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { WalletRepository, WalletState } from "../repositories/walletRepository.js";
|
|
2
|
-
/** Lag behind real-time to avoid racing with indexer writes. */
|
|
3
|
-
export declare const SAFETY_LAG_MS = 30000;
|
|
4
|
-
/** Overlap window so boundary virtual outputs are never missed. */
|
|
5
|
-
export declare const OVERLAP_MS: number;
|
|
6
|
-
/**
|
|
7
|
-
* Atomically read, mutate, and persist wallet state.
|
|
8
|
-
* All callers that modify wallet state should go through this helper
|
|
9
|
-
* to avoid lost-update races between interleaved async operations.
|
|
10
|
-
*/
|
|
11
|
-
export declare function updateWalletState(repo: WalletRepository, updater: (state: WalletState) => WalletState): Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Read the global high-water mark for VTXO indexer syncs.
|
|
14
|
-
*
|
|
15
|
-
* Returns `0` when:
|
|
16
|
-
* - the wallet has never been synced (bootstrap case), or
|
|
17
|
-
* - the stored `lastSyncTime` was written by pre-PR code and is not
|
|
18
|
-
* safe to reuse under the new semantics (see {@link CURSOR_MIGRATED_KEY}).
|
|
19
|
-
*/
|
|
20
|
-
export declare function getSyncCursor(repo: WalletRepository): Promise<number>;
|
|
21
|
-
/**
|
|
22
|
-
* Advance the global cursor after a successful full-scope delta sync.
|
|
23
|
-
*
|
|
24
|
-
* Clamped with `Math.max` against the current value so concurrent syncs
|
|
25
|
-
* that finish out of order can't rewind the cursor: `lastUpdatedAt` is
|
|
26
|
-
* captured before each sync enters the `updateWalletState` mutex, and
|
|
27
|
-
* the later-started sync would otherwise overwrite the earlier-captured
|
|
28
|
-
* one with a smaller value. The legacy value is discarded on the first
|
|
29
|
-
* advance if the migration marker is absent so pre-PR data doesn't
|
|
30
|
-
* survive the upgrade.
|
|
31
|
-
*/
|
|
32
|
-
export declare function advanceSyncCursor(repo: WalletRepository, lastUpdatedAt: number): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Remove the sync cursor, forcing a full re-bootstrap on next sync.
|
|
35
|
-
*
|
|
36
|
-
* Also clears the migration marker so any stored `lastSyncTime` is
|
|
37
|
-
* treated as untrusted on the next read.
|
|
38
|
-
*/
|
|
39
|
-
export declare function clearSyncCursor(repo: WalletRepository): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Compute the `after` lower-bound for a delta sync query.
|
|
42
|
-
*
|
|
43
|
-
* No upper bound (`before`) is applied to the query so that freshly
|
|
44
|
-
* created virtual outputs are never excluded. The safety lag is applied only
|
|
45
|
-
* when advancing the cursor (see @see cursorCutoff).
|
|
46
|
-
*/
|
|
47
|
-
export declare function computeSyncWindow(cursor: number): {
|
|
48
|
-
after: number;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* The safe high-water mark for cursor advancement.
|
|
52
|
-
* Lags behind real-time by @see SAFETY_LAG_MS so that virtual outputs still
|
|
53
|
-
* being indexed are re-queried on the next sync.
|
|
54
|
-
*
|
|
55
|
-
* When `requestStartedAt` is provided the cutoff is frozen to the
|
|
56
|
-
* request start rather than wall-clock at commit time, preventing
|
|
57
|
-
* long-running paginated fetches from advancing the cursor past the
|
|
58
|
-
* data they actually observed.
|
|
59
|
-
*/
|
|
60
|
-
export declare function cursorCutoff(requestStartedAt?: number): number;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RelativeTimelock } from "../script/tapscript.js";
|
|
2
|
-
/**
|
|
3
|
-
* Convert RelativeTimelock to BIP68 sequence number.
|
|
4
|
-
*/
|
|
5
|
-
export declare function timelockToSequence(timelock: RelativeTimelock): number;
|
|
6
|
-
/**
|
|
7
|
-
* Convert BIP68 sequence number back to RelativeTimelock.
|
|
8
|
-
*/
|
|
9
|
-
export declare function sequenceToTimelock(sequence: number): RelativeTimelock;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Transaction as BtcSignerTransaction } from "@scure/btc-signer";
|
|
2
|
-
import { TxOpts } from "@scure/btc-signer/transaction.js";
|
|
3
|
-
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
4
|
-
/**
|
|
5
|
-
* Transaction is a wrapper around the @scure/btc-signer Transaction class.
|
|
6
|
-
* It adds the Arkade protocol specific options to the transaction.
|
|
7
|
-
*/
|
|
8
|
-
export declare class Transaction extends BtcSignerTransaction {
|
|
9
|
-
static ARK_TX_OPTS: TxOpts;
|
|
10
|
-
constructor(opts?: TxOpts);
|
|
11
|
-
static fromPSBT(psbt_: Bytes, opts?: TxOpts): Transaction;
|
|
12
|
-
static fromRaw(raw: Bytes, opts?: TxOpts): Transaction;
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ArkTransaction, VirtualCoin } from "../wallet/index.js";
|
|
2
|
-
type ExtendedArkTransaction = ArkTransaction & {
|
|
3
|
-
tag: "offchain" | "boarding" | "exit" | "batch";
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Builds the transaction history by analyzing virtual outputs, boarding transactions, and ignored commitments.
|
|
7
|
-
* History is sorted from newest to oldest and is composed only of SENT and RECEIVED transactions.
|
|
8
|
-
*
|
|
9
|
-
* @param {VirtualCoin[]} vtxos - An array of virtual outputs representing the user's transactions and balances.
|
|
10
|
-
* @param {ArkTransaction[]} allBoardingTxs - An array of boarding transactions to include in the history.
|
|
11
|
-
* @param {Set<string>} commitmentsToIgnore - A set of commitment IDs that should be excluded from processing.
|
|
12
|
-
* @return {ExtendedArkTransaction[]} A sorted array of extended Arkade transactions, representing the transaction history.
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildTransactionHistory(vtxos: VirtualCoin[], allBoardingTxs: ArkTransaction[], commitmentsToIgnore: Set<string>, getTxCreatedAt?: (txid: string) => Promise<number | undefined>): Promise<ExtendedArkTransaction[]>;
|
|
15
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Network } from "../networks.js";
|
|
2
|
-
export type VSize = {
|
|
3
|
-
value: bigint;
|
|
4
|
-
fee(feeRate: bigint): bigint;
|
|
5
|
-
};
|
|
6
|
-
export declare class TxWeightEstimator {
|
|
7
|
-
static readonly P2PKH_SCRIPT_SIG_SIZE: number;
|
|
8
|
-
static readonly INPUT_SIZE: number;
|
|
9
|
-
static readonly BASE_CONTROL_BLOCK_SIZE: number;
|
|
10
|
-
static readonly OUTPUT_SIZE: number;
|
|
11
|
-
static readonly P2WPKH_OUTPUT_SIZE: number;
|
|
12
|
-
static readonly BASE_TX_SIZE: number;
|
|
13
|
-
static readonly WITNESS_HEADER_SIZE = 2;
|
|
14
|
-
static readonly WITNESS_SCALE_FACTOR = 4;
|
|
15
|
-
static readonly P2TR_OUTPUT_SIZE: number;
|
|
16
|
-
hasWitness: boolean;
|
|
17
|
-
inputCount: number;
|
|
18
|
-
outputCount: number;
|
|
19
|
-
inputSize: number;
|
|
20
|
-
inputWitnessSize: number;
|
|
21
|
-
outputSize: number;
|
|
22
|
-
private constructor();
|
|
23
|
-
static create(): TxWeightEstimator;
|
|
24
|
-
addP2AInput(): TxWeightEstimator;
|
|
25
|
-
addKeySpendInput(isDefault?: boolean): TxWeightEstimator;
|
|
26
|
-
addP2PKHInput(): TxWeightEstimator;
|
|
27
|
-
addTapscriptInput(leafWitnessSize: number, leafScriptSize: number, leafControlBlockSize: number): TxWeightEstimator;
|
|
28
|
-
addP2WPKHOutput(): TxWeightEstimator;
|
|
29
|
-
addP2TROutput(): TxWeightEstimator;
|
|
30
|
-
/**
|
|
31
|
-
* Adds an output given a raw script.
|
|
32
|
-
* Cost = 8 bytes (amount) + varint(scriptLen) + scriptLen
|
|
33
|
-
*/
|
|
34
|
-
addOutputScript(script: Uint8Array): TxWeightEstimator;
|
|
35
|
-
/**
|
|
36
|
-
* Adds an output by decoding the address to get the exact script size.
|
|
37
|
-
*/
|
|
38
|
-
addOutputAddress(address: string, network: Network): TxWeightEstimator;
|
|
39
|
-
vsize(): VSize;
|
|
40
|
-
}
|