@arkade-os/sdk 0.4.27 → 0.4.29
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 +45 -116
- 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-ChhTwpLf.d.cts +3892 -0
- package/dist/ark-ChhTwpLf.d.ts +3892 -0
- package/dist/asyncStorageTaskQueue-DW1-BpI7.d.cts +49 -0
- package/dist/{types/worker/expo/asyncStorageTaskQueue.d.ts → asyncStorageTaskQueue-DZ0nUuEJ.d.ts} +6 -3
- package/dist/chunk-5BLDMQED.cjs +18 -0
- package/dist/chunk-5BLDMQED.cjs.map +1 -0
- package/dist/chunk-6FLL2Q36.cjs +2701 -0
- package/dist/chunk-6FLL2Q36.cjs.map +1 -0
- package/dist/chunk-6NWNOLL3.js +2671 -0
- package/dist/chunk-6NWNOLL3.js.map +1 -0
- package/dist/chunk-ABWRLTX5.js +210 -0
- package/dist/chunk-ABWRLTX5.js.map +1 -0
- package/dist/chunk-BVP2U66Q.js +13943 -0
- package/dist/chunk-BVP2U66Q.js.map +1 -0
- package/dist/chunk-GDCTOSMV.cjs +14058 -0
- package/dist/chunk-GDCTOSMV.cjs.map +1 -0
- package/dist/chunk-GIGILVVP.cjs +213 -0
- package/dist/chunk-GIGILVVP.cjs.map +1 -0
- package/dist/chunk-IEO3XDKI.cjs +838 -0
- package/dist/chunk-IEO3XDKI.cjs.map +1 -0
- package/dist/chunk-NSBPE2FW.js +15 -0
- package/dist/chunk-NSBPE2FW.js.map +1 -0
- package/dist/chunk-PJUFOJ2L.cjs +100 -0
- package/dist/chunk-PJUFOJ2L.cjs.map +1 -0
- package/dist/chunk-TH6T23XG.js +95 -0
- package/dist/chunk-TH6T23XG.js.map +1 -0
- package/dist/chunk-TU3LVAPX.js +769 -0
- package/dist/chunk-TU3LVAPX.js.map +1 -0
- package/dist/chunk-WMIPYZSB.cjs +803 -0
- package/dist/chunk-WMIPYZSB.cjs.map +1 -0
- package/dist/chunk-YA4G7RFB.js +829 -0
- package/dist/chunk-YA4G7RFB.js.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-4JBUkUhR.d.cts +84 -0
- package/dist/delegate-DN7RELL1.d.ts +84 -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-Cn82bBUu.d.ts +199 -0
- package/dist/index-DfT5xzgY.d.cts +199 -0
- package/dist/index.cjs +504 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3469 -0
- package/dist/index.d.ts +3469 -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-B-aPfHhK.d.cts +114 -0
- package/dist/taskRunner-B-vG08pX.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 +175 -0
- package/dist/wallet/expo/index.cjs.map +1 -0
- package/dist/wallet/expo/index.d.cts +124 -0
- package/dist/wallet/expo/index.d.ts +124 -0
- package/dist/wallet/expo/index.js +173 -0
- package/dist/wallet/expo/index.js.map +1 -0
- package/dist/wallet-CCtqT2Wb.d.ts +778 -0
- package/dist/wallet-DjgFb_4T.d.cts +778 -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/expo/wallet.d.ts +0 -99
- 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,119 +0,0 @@
|
|
|
1
|
-
import { AssetId } from "./assetId.js";
|
|
2
|
-
import { AssetRef } from "./assetRef.js";
|
|
3
|
-
import { AssetInput } from "./assetInput.js";
|
|
4
|
-
import { AssetOutput } from "./assetOutput.js";
|
|
5
|
-
import { Metadata } from "./metadata.js";
|
|
6
|
-
import { BufferReader, BufferWriter } from "./utils.js";
|
|
7
|
-
/**
|
|
8
|
-
* An asset group contains inputs, outputs, and all data related to a given asset id.
|
|
9
|
-
*
|
|
10
|
-
* @see Packet
|
|
11
|
-
* @see AssetId
|
|
12
|
-
* @see AssetRef
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* const group = AssetGroup.create(
|
|
17
|
-
* null, // asset ID: null for new issuance
|
|
18
|
-
* null, // control asset ID: null when reissuance not needed
|
|
19
|
-
* [], // asset inputs: empty for new issuance
|
|
20
|
-
* [AssetOutput.create(0, 1000)], // asset outputs: 1000 units at vout index 0
|
|
21
|
-
* [] // metadata: can be empty
|
|
22
|
-
* )
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
export declare class AssetGroup {
|
|
26
|
-
readonly assetId: AssetId | null;
|
|
27
|
-
readonly controlAsset: AssetRef | null;
|
|
28
|
-
readonly inputs: AssetInput[];
|
|
29
|
-
readonly outputs: AssetOutput[];
|
|
30
|
-
private readonly metadataList;
|
|
31
|
-
/** @see create */
|
|
32
|
-
constructor(assetId: AssetId | null, controlAsset: AssetRef | null, inputs: AssetInput[], outputs: AssetOutput[], metadata: Metadata[]);
|
|
33
|
-
/**
|
|
34
|
-
* Create and validate an asset group.
|
|
35
|
-
*
|
|
36
|
-
* @param assetId - Asset id for this group, or `null` for fresh issuance
|
|
37
|
-
* @param controlAsset - Optional control asset reference for (re) issuance
|
|
38
|
-
* @param inputs - Asset inputs in the group
|
|
39
|
-
* @param outputs - Asset outputs in the group
|
|
40
|
-
* @param metadata - Metadata entries associated with the group
|
|
41
|
-
* @returns A validated asset group
|
|
42
|
-
* @throws Error if the group fails validation
|
|
43
|
-
* @see validate
|
|
44
|
-
*/
|
|
45
|
-
static create(assetId: AssetId | null, controlAsset: AssetRef | null, inputs: AssetInput[], outputs: AssetOutput[], metadata: Metadata[]): AssetGroup;
|
|
46
|
-
/**
|
|
47
|
-
* Decode an asset group from its hex string form.
|
|
48
|
-
*
|
|
49
|
-
* @param s - Hex-encoded asset group
|
|
50
|
-
* @returns Decoded asset group
|
|
51
|
-
* @throws Error if the string is not valid hex or does not encode a valid asset group
|
|
52
|
-
* @see toString
|
|
53
|
-
*/
|
|
54
|
-
static fromString(s: string): AssetGroup;
|
|
55
|
-
/**
|
|
56
|
-
* Decode an asset group from its serialized bytes.
|
|
57
|
-
*
|
|
58
|
-
* @param buf - Serialized asset group bytes
|
|
59
|
-
* @returns Decoded asset group
|
|
60
|
-
* @throws Error if the buffer is empty or malformed
|
|
61
|
-
*/
|
|
62
|
-
static fromBytes(buf: Uint8Array): AssetGroup;
|
|
63
|
-
/**
|
|
64
|
-
* Return true when the group represents an issuance.
|
|
65
|
-
*
|
|
66
|
-
* @returns `true` when the group has no asset id
|
|
67
|
-
*/
|
|
68
|
-
isIssuance(): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Return true when the group represents a reissuance.
|
|
71
|
-
*
|
|
72
|
-
* @returns `true` when the group has an asset id and outputs exceed local inputs
|
|
73
|
-
* @remarks
|
|
74
|
-
* Only local inputs contribute to the comparison; intent-backed inputs contribute `0` here.
|
|
75
|
-
*/
|
|
76
|
-
isReissuance(): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Serialize the asset group to raw bytes.
|
|
79
|
-
*
|
|
80
|
-
* @returns Serialized asset group bytes
|
|
81
|
-
* @see fromBytes
|
|
82
|
-
*/
|
|
83
|
-
serialize(): Uint8Array;
|
|
84
|
-
/**
|
|
85
|
-
* Validate the asset group and its child structures.
|
|
86
|
-
*
|
|
87
|
-
* @throws Error if the group is empty or violates issuance invariants
|
|
88
|
-
*/
|
|
89
|
-
validate(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Convert the group into its batch-leaf representation for the given intent txid.
|
|
92
|
-
*
|
|
93
|
-
* @param intentTxid - Intent transaction id used to build the leaf input reference
|
|
94
|
-
* @returns Batch-leaf asset group
|
|
95
|
-
* @see AssetInput.createIntent
|
|
96
|
-
*/
|
|
97
|
-
toBatchLeafAssetGroup(intentTxid: Uint8Array): AssetGroup;
|
|
98
|
-
/**
|
|
99
|
-
* Encode the asset group to a hex string.
|
|
100
|
-
*
|
|
101
|
-
* @returns Hex-encoded asset group
|
|
102
|
-
* @see fromString
|
|
103
|
-
*/
|
|
104
|
-
toString(): string;
|
|
105
|
-
/**
|
|
106
|
-
* Decode an asset group from a binary reader.
|
|
107
|
-
*
|
|
108
|
-
* @param reader - Reader positioned at an asset group
|
|
109
|
-
* @returns Decoded asset group
|
|
110
|
-
* @throws Error if the encoded group is malformed
|
|
111
|
-
*/
|
|
112
|
-
static fromReader(reader: BufferReader): AssetGroup;
|
|
113
|
-
/**
|
|
114
|
-
* Serialize the asset group into an existing binary writer.
|
|
115
|
-
*
|
|
116
|
-
* @param writer - Writer to append the asset group to
|
|
117
|
-
*/
|
|
118
|
-
serializeTo(writer: BufferWriter): void;
|
|
119
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { BufferReader, BufferWriter } from "./utils.js";
|
|
2
|
-
/**
|
|
3
|
-
* AssetId identifies a specific asset.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Asset ids are derived from the genesis transaction id plus the asset group index.
|
|
7
|
-
*
|
|
8
|
-
* @see AssetRef
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const assetId = AssetId.create('00'.repeat(32), 0)
|
|
13
|
-
* const encoded = assetId.toString()
|
|
14
|
-
* const decoded = AssetId.fromString(encoded)
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare class AssetId {
|
|
18
|
-
readonly txid: Uint8Array;
|
|
19
|
-
readonly groupIndex: number;
|
|
20
|
-
private constructor();
|
|
21
|
-
/**
|
|
22
|
-
* Create an asset id from a genesis transaction id and group index.
|
|
23
|
-
*
|
|
24
|
-
* @param txid - Hex-encoded genesis transaction id
|
|
25
|
-
* @param groupIndex - Asset group index within the genesis transaction
|
|
26
|
-
* @returns A validated asset id
|
|
27
|
-
* @throws Error if the txid is missing, malformed, or not 32 bytes long
|
|
28
|
-
* @see fromString
|
|
29
|
-
*/
|
|
30
|
-
static create(txid: string, groupIndex: number): AssetId;
|
|
31
|
-
/**
|
|
32
|
-
* Decode an asset id from its hex string representation.
|
|
33
|
-
*
|
|
34
|
-
* @param s - Hex-encoded asset id
|
|
35
|
-
* @returns Decoded asset id
|
|
36
|
-
* @throws Error if the string is not valid hex or does not encode a valid asset id
|
|
37
|
-
* @see toString
|
|
38
|
-
*/
|
|
39
|
-
static fromString(s: string): AssetId;
|
|
40
|
-
/**
|
|
41
|
-
* Decode an asset id from its serialized bytes.
|
|
42
|
-
*
|
|
43
|
-
* @param buf - Serialized asset id bytes
|
|
44
|
-
* @returns Decoded asset id
|
|
45
|
-
* @throws Error if the buffer length is invalid
|
|
46
|
-
*/
|
|
47
|
-
static fromBytes(buf: Uint8Array): AssetId;
|
|
48
|
-
/**
|
|
49
|
-
* Serialize the asset id to raw bytes.
|
|
50
|
-
*
|
|
51
|
-
* @returns Serialized asset id bytes
|
|
52
|
-
* @see fromBytes
|
|
53
|
-
*/
|
|
54
|
-
serialize(): Uint8Array;
|
|
55
|
-
/**
|
|
56
|
-
* Encode the asset id to a hex string.
|
|
57
|
-
*
|
|
58
|
-
* @returns Hex-encoded asset id
|
|
59
|
-
* @see fromString
|
|
60
|
-
*/
|
|
61
|
-
toString(): string;
|
|
62
|
-
/**
|
|
63
|
-
* Validate the asset id fields.
|
|
64
|
-
*
|
|
65
|
-
* @throws Error if the txid is empty or the group index is out of range
|
|
66
|
-
*/
|
|
67
|
-
validate(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Decode an asset id from a binary reader.
|
|
70
|
-
*
|
|
71
|
-
* @param reader - Reader positioned at an asset id
|
|
72
|
-
* @returns Decoded asset id
|
|
73
|
-
* @throws Error if the reader does not contain enough bytes
|
|
74
|
-
*/
|
|
75
|
-
static fromReader(reader: BufferReader): AssetId;
|
|
76
|
-
/**
|
|
77
|
-
* Serialize the asset id into an existing binary writer.
|
|
78
|
-
*
|
|
79
|
-
* @param writer - Writer to append the asset id to
|
|
80
|
-
* @see serialize
|
|
81
|
-
*/
|
|
82
|
-
serializeTo(writer: BufferWriter): void;
|
|
83
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { AssetInputType } from "./types.js";
|
|
2
|
-
import { BufferReader, BufferWriter } from "./utils.js";
|
|
3
|
-
type AssetInputLocal = {
|
|
4
|
-
type: AssetInputType.Local;
|
|
5
|
-
vin: number;
|
|
6
|
-
amount: bigint;
|
|
7
|
-
};
|
|
8
|
-
type AssetInputIntent = Pick<AssetInputLocal, "vin" | "amount"> & {
|
|
9
|
-
type: AssetInputType.Intent;
|
|
10
|
-
txid: Uint8Array;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* AssetInput represents an input of an asset group.
|
|
14
|
-
* a local input references a real transaction input and specify the amount in satoshis.
|
|
15
|
-
* an intent input references an external intent transaction. It is created by the server to handle batch leaf transaction.
|
|
16
|
-
*/
|
|
17
|
-
export declare class AssetInput {
|
|
18
|
-
readonly input: AssetInputLocal | AssetInputIntent;
|
|
19
|
-
private constructor();
|
|
20
|
-
/** Gets the transaction input index for an asset input, e.g. 0 */
|
|
21
|
-
get vin(): number;
|
|
22
|
-
/** Gets the amount for an input (in most cases, 330 sats) */
|
|
23
|
-
get amount(): bigint;
|
|
24
|
-
/** Create a local asset input that points at a transaction input index. */
|
|
25
|
-
static create(vin: number, amount: bigint | number): AssetInput;
|
|
26
|
-
/** Create an intent-backed asset input referencing an external intent transaction. */
|
|
27
|
-
static createIntent(txid: string, vin: number, amount: bigint | number): AssetInput;
|
|
28
|
-
/** Decode an asset input from its hex string form. */
|
|
29
|
-
static fromString(s: string): AssetInput;
|
|
30
|
-
/** Decode an asset input from its serialized bytes. */
|
|
31
|
-
static fromBytes(buf: Uint8Array): AssetInput;
|
|
32
|
-
/** Serialize the asset input to raw bytes. */
|
|
33
|
-
serialize(): Uint8Array;
|
|
34
|
-
/** Encode the asset input to a hex string. */
|
|
35
|
-
toString(): string;
|
|
36
|
-
/** Validate the asset input fields. */
|
|
37
|
-
validate(): void;
|
|
38
|
-
/** Decode an asset input from a buffer reader. */
|
|
39
|
-
static fromReader(reader: BufferReader): AssetInput;
|
|
40
|
-
/** Serialize the asset input into an existing buffer writer. */
|
|
41
|
-
serializeTo(writer: BufferWriter): void;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* AssetInputs represents a list of asset inputs.
|
|
45
|
-
*/
|
|
46
|
-
export declare class AssetInputs {
|
|
47
|
-
readonly inputs: AssetInput[];
|
|
48
|
-
private constructor();
|
|
49
|
-
/** Create a validated list of asset inputs. */
|
|
50
|
-
static create(inputs: AssetInput[]): AssetInputs;
|
|
51
|
-
/** Decode an asset input list from its hex string form. */
|
|
52
|
-
static fromString(s: string): AssetInputs;
|
|
53
|
-
/** Serialize the asset input list to raw bytes. */
|
|
54
|
-
serialize(): Uint8Array;
|
|
55
|
-
/** Encode the asset input list to a hex string. */
|
|
56
|
-
toString(): string;
|
|
57
|
-
/** Validate the asset input list. */
|
|
58
|
-
validate(): void;
|
|
59
|
-
/** Decode an asset input list from a buffer reader. */
|
|
60
|
-
static fromReader(reader: BufferReader): AssetInputs;
|
|
61
|
-
/** Serialize the asset input list into an existing buffer writer. */
|
|
62
|
-
serializeTo(writer: BufferWriter): void;
|
|
63
|
-
}
|
|
64
|
-
export {};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { BufferReader, BufferWriter } from "./utils.js";
|
|
2
|
-
/**
|
|
3
|
-
* AssetOutput references a real transaction output and specify the amount in satoshis.
|
|
4
|
-
* it must be present in an AssetGroup.
|
|
5
|
-
*
|
|
6
|
-
* @param vout - the output index in the transaction
|
|
7
|
-
* @param amount - asset amount in satoshis
|
|
8
|
-
*/
|
|
9
|
-
export declare class AssetOutput {
|
|
10
|
-
readonly vout: number;
|
|
11
|
-
readonly amount: bigint;
|
|
12
|
-
static readonly TYPE_LOCAL = 1;
|
|
13
|
-
private constructor();
|
|
14
|
-
/** Create a local asset output referencing a transaction output index. */
|
|
15
|
-
static create(vout: number, amount: bigint | number): AssetOutput;
|
|
16
|
-
/** Decode an asset output from its hex string form. */
|
|
17
|
-
static fromString(s: string): AssetOutput;
|
|
18
|
-
/** Decode an asset output from its serialized bytes. */
|
|
19
|
-
static fromBytes(buf: Uint8Array): AssetOutput;
|
|
20
|
-
/** Serialize the asset output to raw bytes. */
|
|
21
|
-
serialize(): Uint8Array;
|
|
22
|
-
/** Encode the asset output to a hex string. */
|
|
23
|
-
toString(): string;
|
|
24
|
-
/** Validate the asset output fields. */
|
|
25
|
-
validate(): void;
|
|
26
|
-
/** Decode an asset output from a buffer reader. */
|
|
27
|
-
static fromReader(reader: BufferReader): AssetOutput;
|
|
28
|
-
/** Serialize the asset output into an existing buffer writer. */
|
|
29
|
-
serializeTo(writer: BufferWriter): void;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* AssetOutputs is a list of AssetOutput references.
|
|
33
|
-
* it must be present in an AssetGroup.
|
|
34
|
-
*
|
|
35
|
-
* @param outputs - the list of asset outputs
|
|
36
|
-
*/
|
|
37
|
-
export declare class AssetOutputs {
|
|
38
|
-
readonly outputs: AssetOutput[];
|
|
39
|
-
private constructor();
|
|
40
|
-
/** Create a validated list of asset outputs. */
|
|
41
|
-
static create(outputs: AssetOutput[]): AssetOutputs;
|
|
42
|
-
/** Decode an asset output list from its hex string form. */
|
|
43
|
-
static fromString(s: string): AssetOutputs;
|
|
44
|
-
/** Serialize the asset output list to raw bytes. */
|
|
45
|
-
serialize(): Uint8Array;
|
|
46
|
-
/** Encode the asset output list to a hex string. */
|
|
47
|
-
toString(): string;
|
|
48
|
-
/** Validate the asset output list. */
|
|
49
|
-
validate(): void;
|
|
50
|
-
/** Decode an asset output list from a buffer reader. */
|
|
51
|
-
static fromReader(reader: BufferReader): AssetOutputs;
|
|
52
|
-
/** Serialize the asset output list into an existing buffer writer. */
|
|
53
|
-
serializeTo(writer: BufferWriter): void;
|
|
54
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { AssetRefType } from "./types.js";
|
|
2
|
-
import { AssetId } from "./assetId.js";
|
|
3
|
-
import { BufferReader, BufferWriter } from "./utils.js";
|
|
4
|
-
type AssetRefByID = {
|
|
5
|
-
type: AssetRefType.ByID;
|
|
6
|
-
assetId: AssetId;
|
|
7
|
-
};
|
|
8
|
-
type AssetRefByGroup = {
|
|
9
|
-
type: AssetRefType.ByGroup;
|
|
10
|
-
groupIndex: number;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Reference to either an explicit asset id or another asset group in the same packet.
|
|
14
|
-
*
|
|
15
|
-
* @see AssetId
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const refById = AssetRef.fromId(assetId)
|
|
20
|
-
* const refByGroup = AssetRef.fromGroupIndex(0)
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare class AssetRef {
|
|
24
|
-
readonly ref: AssetRefByID | AssetRefByGroup;
|
|
25
|
-
private constructor();
|
|
26
|
-
/** Reference type discriminator. */
|
|
27
|
-
get type(): AssetRefType;
|
|
28
|
-
/**
|
|
29
|
-
* Create an asset reference that points to a specific asset id.
|
|
30
|
-
*
|
|
31
|
-
* @param assetId - Asset id referenced by this pointer
|
|
32
|
-
* @returns Asset reference by id
|
|
33
|
-
* @see fromGroupIndex
|
|
34
|
-
*/
|
|
35
|
-
static fromId(assetId: AssetId): AssetRef;
|
|
36
|
-
/**
|
|
37
|
-
* Create an asset reference that points to another asset group by index.
|
|
38
|
-
*
|
|
39
|
-
* @param groupIndex - Zero-based asset group index in the packet
|
|
40
|
-
* @returns Asset reference by group index
|
|
41
|
-
* @see fromId
|
|
42
|
-
*/
|
|
43
|
-
static fromGroupIndex(groupIndex: number): AssetRef;
|
|
44
|
-
/**
|
|
45
|
-
* Decode an asset reference from its hex string form.
|
|
46
|
-
*
|
|
47
|
-
* @param s - Hex-encoded asset reference
|
|
48
|
-
* @returns Decoded asset reference
|
|
49
|
-
* @throws Error if the string is not valid hex or does not encode a valid asset reference
|
|
50
|
-
* @see toString
|
|
51
|
-
*/
|
|
52
|
-
static fromString(s: string): AssetRef;
|
|
53
|
-
/**
|
|
54
|
-
* Decode an asset reference from its serialized bytes.
|
|
55
|
-
*
|
|
56
|
-
* @param buf - Serialized asset reference bytes
|
|
57
|
-
* @returns Decoded asset reference
|
|
58
|
-
* @throws Error if the buffer is empty or malformed
|
|
59
|
-
*/
|
|
60
|
-
static fromBytes(buf: Uint8Array): AssetRef;
|
|
61
|
-
/**
|
|
62
|
-
* Serialize the asset reference to raw bytes.
|
|
63
|
-
*
|
|
64
|
-
* @returns Serialized asset reference bytes
|
|
65
|
-
* @see fromBytes
|
|
66
|
-
*/
|
|
67
|
-
serialize(): Uint8Array;
|
|
68
|
-
/**
|
|
69
|
-
* Encode the asset reference to a hex string.
|
|
70
|
-
*
|
|
71
|
-
* @returns Hex-encoded asset reference
|
|
72
|
-
* @see fromString
|
|
73
|
-
*/
|
|
74
|
-
toString(): string;
|
|
75
|
-
/**
|
|
76
|
-
* Decode an asset reference from a binary reader.
|
|
77
|
-
*
|
|
78
|
-
* @param reader - Reader positioned at an asset reference
|
|
79
|
-
* @returns Decoded asset reference
|
|
80
|
-
* @throws Error if the type is unknown or the reader does not contain enough bytes
|
|
81
|
-
*/
|
|
82
|
-
static fromReader(reader: BufferReader): AssetRef;
|
|
83
|
-
/**
|
|
84
|
-
* Serialize the asset reference into an existing binary writer.
|
|
85
|
-
*
|
|
86
|
-
* @param writer - Writer to append the asset reference to
|
|
87
|
-
* @see serialize
|
|
88
|
-
*/
|
|
89
|
-
serializeTo(writer: BufferWriter): void;
|
|
90
|
-
}
|
|
91
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { AssetInputType, AssetRefType } from "./types.js";
|
|
2
|
-
export { AssetId } from "./assetId.js";
|
|
3
|
-
export { AssetRef } from "./assetRef.js";
|
|
4
|
-
export { AssetInput, AssetInputs } from "./assetInput.js";
|
|
5
|
-
export { AssetOutput, AssetOutputs } from "./assetOutput.js";
|
|
6
|
-
export { Metadata, MetadataList } from "./metadata.js";
|
|
7
|
-
export { AssetGroup } from "./assetGroup.js";
|
|
8
|
-
export { Packet } from "./packet.js";
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Bytes } from "@scure/btc-signer/utils.js";
|
|
2
|
-
import { BufferReader, BufferWriter } from "./utils.js";
|
|
3
|
-
/**
|
|
4
|
-
* Metadata represents a key-value pair.
|
|
5
|
-
* @param key - the key
|
|
6
|
-
* @param value - the value
|
|
7
|
-
*/
|
|
8
|
-
export declare class Metadata {
|
|
9
|
-
readonly key: Uint8Array;
|
|
10
|
-
readonly value: Uint8Array;
|
|
11
|
-
private constructor();
|
|
12
|
-
/** Create a metadata entry from raw key and value bytes. */
|
|
13
|
-
static create(key: Bytes, value: Bytes): Metadata;
|
|
14
|
-
/** Decode metadata from its hex string form. */
|
|
15
|
-
static fromString(s: string): Metadata;
|
|
16
|
-
/** Decode metadata from its serialized bytes. */
|
|
17
|
-
static fromBytes(buf: Uint8Array): Metadata;
|
|
18
|
-
/** Serialize metadata to raw bytes. */
|
|
19
|
-
serialize(): Uint8Array;
|
|
20
|
-
/** Encode metadata to a hex string. */
|
|
21
|
-
toString(): string;
|
|
22
|
-
get keyString(): string;
|
|
23
|
-
get valueString(): string;
|
|
24
|
-
/** Validate the metadata key and value. */
|
|
25
|
-
validate(): void;
|
|
26
|
-
/** Decode metadata from a buffer reader. */
|
|
27
|
-
static fromReader(reader: BufferReader): Metadata;
|
|
28
|
-
/** Serialize metadata into an existing buffer writer. */
|
|
29
|
-
serializeTo(writer: BufferWriter): void;
|
|
30
|
-
}
|
|
31
|
-
export declare class MetadataList {
|
|
32
|
-
readonly items: Metadata[];
|
|
33
|
-
static readonly ARK_LEAF_TAG = "ArkadeAssetLeaf";
|
|
34
|
-
static readonly ARK_BRANCH_TAG = "ArkadeAssetBranch";
|
|
35
|
-
static readonly ARK_LEAF_VERSION = 0;
|
|
36
|
-
constructor(items: Metadata[]);
|
|
37
|
-
/** Create a metadata list from its hex string form. */
|
|
38
|
-
static fromString(s: string): MetadataList;
|
|
39
|
-
/** Decode a metadata list from its serialized bytes. */
|
|
40
|
-
static fromBytes(buf: Uint8Array): MetadataList;
|
|
41
|
-
/** Decode a metadata list from a buffer reader. */
|
|
42
|
-
static fromReader(reader: BufferReader): MetadataList;
|
|
43
|
-
/** Serialize the metadata list into an existing buffer writer. */
|
|
44
|
-
serializeTo(writer: BufferWriter): void;
|
|
45
|
-
/** Serialize the metadata list to raw bytes. */
|
|
46
|
-
serialize(): Uint8Array;
|
|
47
|
-
/** Iterate through metadata entries in insertion order. */
|
|
48
|
-
[Symbol.iterator](): Iterator<Metadata>;
|
|
49
|
-
get length(): number;
|
|
50
|
-
/** Compute the tagged Merkle root for the metadata list. */
|
|
51
|
-
hash(): Uint8Array;
|
|
52
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ExtensionPacket } from "../packet.js";
|
|
2
|
-
import { AssetGroup } from "./assetGroup.js";
|
|
3
|
-
/**
|
|
4
|
-
* Packet represents a collection of asset groups.
|
|
5
|
-
* It encodes/decodes as raw bytes only — OP_RETURN framing is handled by the Extension module.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Packet implements ExtensionPacket {
|
|
8
|
-
readonly groups: AssetGroup[];
|
|
9
|
-
/** PACKET_TYPE is the 1-byte TLV type tag used in the Extension envelope. */
|
|
10
|
-
static readonly PACKET_TYPE = 0;
|
|
11
|
-
private constructor();
|
|
12
|
-
/** Create a validated asset packet from a list of asset groups. */
|
|
13
|
-
static create(groups: AssetGroup[]): Packet;
|
|
14
|
-
/**
|
|
15
|
-
* fromBytes parses a Packet from raw bytes.
|
|
16
|
-
*/
|
|
17
|
-
static fromBytes(buf: Uint8Array): Packet;
|
|
18
|
-
/**
|
|
19
|
-
* fromString parses a Packet from a raw hex string (not an OP_RETURN script).
|
|
20
|
-
*/
|
|
21
|
-
static fromString(s: string): Packet;
|
|
22
|
-
/**
|
|
23
|
-
* type returns the TLV packet type tag. Implements ExtensionPacket interface.
|
|
24
|
-
*/
|
|
25
|
-
type(): number;
|
|
26
|
-
/** Convert the packet into the batch-leaf form for a specific intent transaction id. */
|
|
27
|
-
leafTxPacket(intentTxid: Uint8Array): Packet;
|
|
28
|
-
/**
|
|
29
|
-
* serialize encodes the packet as raw bytes (varint group count + group data).
|
|
30
|
-
* Does NOT include OP_RETURN, Arkade magic bytes (`ARK`), or TLV type/length; those are
|
|
31
|
-
* added by the Extension module.
|
|
32
|
-
*/
|
|
33
|
-
serialize(): Uint8Array;
|
|
34
|
-
/**
|
|
35
|
-
* toString returns the hex-encoded raw packet bytes.
|
|
36
|
-
*/
|
|
37
|
-
toString(): string;
|
|
38
|
-
/** Validate packet structure and cross-group references. */
|
|
39
|
-
validate(): void;
|
|
40
|
-
private static fromReader;
|
|
41
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const TX_HASH_SIZE = 32;
|
|
2
|
-
export declare const ASSET_ID_SIZE = 34;
|
|
3
|
-
export declare const ASSET_VERSION = 1;
|
|
4
|
-
export declare enum AssetInputType {
|
|
5
|
-
Unspecified = 0,
|
|
6
|
-
Local = 1,
|
|
7
|
-
Intent = 2
|
|
8
|
-
}
|
|
9
|
-
export declare enum AssetRefType {
|
|
10
|
-
Unspecified = 0,
|
|
11
|
-
ByID = 1,
|
|
12
|
-
ByGroup = 2
|
|
13
|
-
}
|
|
14
|
-
export declare const MASK_ASSET_ID = 1;
|
|
15
|
-
export declare const MASK_CONTROL_ASSET = 2;
|
|
16
|
-
export declare const MASK_METADATA = 4;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare class BufferWriter {
|
|
2
|
-
private buffer;
|
|
3
|
-
write(data: Uint8Array): void;
|
|
4
|
-
writeByte(byte: number): void;
|
|
5
|
-
writeUint16LE(value: number): void;
|
|
6
|
-
writeVarUint(value: bigint | number): void;
|
|
7
|
-
writeVarSlice(data: Uint8Array): void;
|
|
8
|
-
toBytes(): Uint8Array;
|
|
9
|
-
}
|
|
10
|
-
export declare class BufferReader {
|
|
11
|
-
private view;
|
|
12
|
-
private offset;
|
|
13
|
-
constructor(data: Uint8Array);
|
|
14
|
-
remaining(): number;
|
|
15
|
-
readByte(): number;
|
|
16
|
-
readSlice(size: number): Uint8Array;
|
|
17
|
-
readUint16LE(): number;
|
|
18
|
-
readVarUint(): bigint;
|
|
19
|
-
readVarSlice(): Uint8Array;
|
|
20
|
-
}
|
|
21
|
-
export declare function isZeroBytes(bytes: Uint8Array): boolean;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Packet } from "./asset/packet.js";
|
|
2
|
-
import { ExtensionPacket } from "./packet.js";
|
|
3
|
-
import type { TransactionOutput } from "@scure/btc-signer/psbt.js";
|
|
4
|
-
import type { Transaction } from "../utils/transaction.js";
|
|
5
|
-
export type { ExtensionPacket } from "./packet.js";
|
|
6
|
-
export { UnknownPacket } from "./packet.js";
|
|
7
|
-
/**
|
|
8
|
-
* ArkadeMagic is the 3-byte magic prefix ("ARK") that identifies an OP_RETURN
|
|
9
|
-
* output as an Arkade extension blob.
|
|
10
|
-
*/
|
|
11
|
-
export declare const ARKADE_MAGIC: Uint8Array<ArrayBuffer>;
|
|
12
|
-
/**
|
|
13
|
-
* ErrExtensionNotFound is thrown when no extension output is found in a transaction.
|
|
14
|
-
*/
|
|
15
|
-
export declare class ExtensionNotFoundError extends Error {
|
|
16
|
-
constructor();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Extension is a set of typed packets encoded in an OP_RETURN output.
|
|
20
|
-
*
|
|
21
|
-
* Wire format:
|
|
22
|
-
* OP_RETURN | <push> | ARK(3B) | [type(1B) | varint_len | data]...
|
|
23
|
-
*/
|
|
24
|
-
export declare class Extension {
|
|
25
|
-
private readonly packets;
|
|
26
|
-
private constructor();
|
|
27
|
-
static create(packets: ExtensionPacket[]): Extension;
|
|
28
|
-
/**
|
|
29
|
-
* isExtension returns true if the script is an OP_RETURN whose push data
|
|
30
|
-
* begins with the ARK magic bytes.
|
|
31
|
-
*/
|
|
32
|
-
static isExtension(script: Uint8Array): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* fromBytes parses an Extension from a raw OP_RETURN script.
|
|
35
|
-
*/
|
|
36
|
-
static fromBytes(script: Uint8Array): Extension;
|
|
37
|
-
/**
|
|
38
|
-
* fromTx searches the transaction outputs for an extension blob and parses it.
|
|
39
|
-
* Throws ExtensionNotFoundError if none is found.
|
|
40
|
-
*/
|
|
41
|
-
static fromTx(tx: Transaction): Extension;
|
|
42
|
-
/**
|
|
43
|
-
* serialize encodes the extension as an OP_RETURN script.
|
|
44
|
-
*
|
|
45
|
-
* Layout: OP_RETURN | <push> | ARK | [type | varint_len | data]...
|
|
46
|
-
*/
|
|
47
|
-
serialize(): Uint8Array;
|
|
48
|
-
/**
|
|
49
|
-
* txOut returns the extension as a zero-value OP_RETURN transaction output.
|
|
50
|
-
*/
|
|
51
|
-
txOut(): Required<Pick<TransactionOutput, "script" | "amount">>;
|
|
52
|
-
/**
|
|
53
|
-
* getAssetPacket returns the embedded Packet, or null if not present.
|
|
54
|
-
*/
|
|
55
|
-
getAssetPacket(): Packet | null;
|
|
56
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ExtensionPacket is the interface that all extension packets must implement.
|
|
3
|
-
* It mirrors the Go extension.Packet interface.
|
|
4
|
-
*/
|
|
5
|
-
export interface ExtensionPacket {
|
|
6
|
-
/** type returns the 1-byte packet type tag */
|
|
7
|
-
type(): number;
|
|
8
|
-
/** serialize returns the raw bytes of the packet (without type or length prefix) */
|
|
9
|
-
serialize(): Uint8Array;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* UnknownPacket holds a packet whose type is not recognized by this implementation.
|
|
13
|
-
* It round-trips opaquely: the raw bytes are preserved as-is.
|
|
14
|
-
*/
|
|
15
|
-
export declare class UnknownPacket implements ExtensionPacket {
|
|
16
|
-
private readonly packetType;
|
|
17
|
-
private readonly data;
|
|
18
|
-
constructor(packetType: number, data: Uint8Array);
|
|
19
|
-
type(): number;
|
|
20
|
-
serialize(): Uint8Array;
|
|
21
|
-
}
|
package/dist/types/forfeit.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Transaction } from "./utils/transaction.js";
|
|
2
|
-
import { TransactionInputUpdate, TransactionOutput } from "@scure/btc-signer/psbt.js";
|
|
3
|
-
/**
|
|
4
|
-
* Build a forfeit transaction that spends the provided inputs to a single forfeit output.
|
|
5
|
-
*
|
|
6
|
-
* @param inputs - Inputs to include in the forfeit transaction
|
|
7
|
-
* @param forfeitPkScript - ScriptPubKey for the forfeit output
|
|
8
|
-
* @param txLocktime - Optional locktime to apply to the transaction
|
|
9
|
-
*/
|
|
10
|
-
export declare function buildForfeitTx(inputs: TransactionInputUpdate[], forfeitPkScript: Uint8Array, txLocktime?: number): Transaction;
|
|
11
|
-
/**
|
|
12
|
-
* Build a forfeit transaction using an explicit output descriptor (used for delegated renewals)
|
|
13
|
-
*
|
|
14
|
-
* @param inputs - Inputs to include in the forfeit transaction
|
|
15
|
-
* @param output - Primary transaction output
|
|
16
|
-
* @param txLocktime - Optional locktime to apply to the transaction
|
|
17
|
-
*/
|
|
18
|
-
export declare function buildForfeitTxWithOutput(inputs: TransactionInputUpdate[], output: TransactionOutput, txLocktime?: number): Transaction;
|