@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.
Files changed (532) hide show
  1. package/README.md +45 -116
  2. package/dist/adapters/asyncStorage.cjs +48 -0
  3. package/dist/adapters/asyncStorage.cjs.map +1 -0
  4. package/dist/adapters/asyncStorage.d.cts +16 -0
  5. package/dist/{types/storage → adapters}/asyncStorage.d.ts +5 -2
  6. package/dist/adapters/asyncStorage.js +46 -0
  7. package/dist/adapters/asyncStorage.js.map +1 -0
  8. package/dist/adapters/expo.cjs +19 -0
  9. package/dist/adapters/expo.cjs.map +1 -0
  10. package/dist/adapters/expo.d.cts +48 -0
  11. package/dist/adapters/expo.d.ts +48 -0
  12. package/dist/adapters/expo.js +6 -0
  13. package/dist/adapters/expo.js.map +1 -0
  14. package/dist/adapters/fileSystem.cjs +116 -0
  15. package/dist/adapters/fileSystem.cjs.map +1 -0
  16. package/dist/adapters/fileSystem.d.cts +17 -0
  17. package/dist/{types/storage → adapters}/fileSystem.d.ts +5 -2
  18. package/dist/adapters/fileSystem.js +93 -0
  19. package/dist/adapters/fileSystem.js.map +1 -0
  20. package/dist/adapters/indexedDB.cjs +103 -0
  21. package/dist/adapters/indexedDB.cjs.map +1 -0
  22. package/dist/adapters/indexedDB.d.cts +18 -0
  23. package/dist/{types/storage → adapters}/indexedDB.d.ts +5 -2
  24. package/dist/adapters/indexedDB.js +101 -0
  25. package/dist/adapters/indexedDB.js.map +1 -0
  26. package/dist/adapters/localStorage.cjs +50 -0
  27. package/dist/adapters/localStorage.cjs.map +1 -0
  28. package/dist/{types/storage/inMemory.d.ts → adapters/localStorage.d.cts} +6 -3
  29. package/dist/{types/storage → adapters}/localStorage.d.ts +5 -2
  30. package/dist/adapters/localStorage.js +48 -0
  31. package/dist/adapters/localStorage.js.map +1 -0
  32. package/dist/ark-ChhTwpLf.d.cts +3892 -0
  33. package/dist/ark-ChhTwpLf.d.ts +3892 -0
  34. package/dist/asyncStorageTaskQueue-DW1-BpI7.d.cts +49 -0
  35. package/dist/{types/worker/expo/asyncStorageTaskQueue.d.ts → asyncStorageTaskQueue-DZ0nUuEJ.d.ts} +6 -3
  36. package/dist/chunk-5BLDMQED.cjs +18 -0
  37. package/dist/chunk-5BLDMQED.cjs.map +1 -0
  38. package/dist/chunk-6FLL2Q36.cjs +2701 -0
  39. package/dist/chunk-6FLL2Q36.cjs.map +1 -0
  40. package/dist/chunk-6NWNOLL3.js +2671 -0
  41. package/dist/chunk-6NWNOLL3.js.map +1 -0
  42. package/dist/chunk-ABWRLTX5.js +210 -0
  43. package/dist/chunk-ABWRLTX5.js.map +1 -0
  44. package/dist/chunk-BVP2U66Q.js +13943 -0
  45. package/dist/chunk-BVP2U66Q.js.map +1 -0
  46. package/dist/chunk-GDCTOSMV.cjs +14058 -0
  47. package/dist/chunk-GDCTOSMV.cjs.map +1 -0
  48. package/dist/chunk-GIGILVVP.cjs +213 -0
  49. package/dist/chunk-GIGILVVP.cjs.map +1 -0
  50. package/dist/chunk-IEO3XDKI.cjs +838 -0
  51. package/dist/chunk-IEO3XDKI.cjs.map +1 -0
  52. package/dist/chunk-NSBPE2FW.js +15 -0
  53. package/dist/chunk-NSBPE2FW.js.map +1 -0
  54. package/dist/chunk-PJUFOJ2L.cjs +100 -0
  55. package/dist/chunk-PJUFOJ2L.cjs.map +1 -0
  56. package/dist/chunk-TH6T23XG.js +95 -0
  57. package/dist/chunk-TH6T23XG.js.map +1 -0
  58. package/dist/chunk-TU3LVAPX.js +769 -0
  59. package/dist/chunk-TU3LVAPX.js.map +1 -0
  60. package/dist/chunk-WMIPYZSB.cjs +803 -0
  61. package/dist/chunk-WMIPYZSB.cjs.map +1 -0
  62. package/dist/chunk-YA4G7RFB.js +829 -0
  63. package/dist/chunk-YA4G7RFB.js.map +1 -0
  64. package/dist/contracts/handlers/index.cjs +26 -0
  65. package/dist/contracts/handlers/index.cjs.map +1 -0
  66. package/dist/contracts/handlers/index.d.cts +7 -0
  67. package/dist/contracts/handlers/index.d.ts +7 -0
  68. package/dist/contracts/handlers/index.js +5 -0
  69. package/dist/contracts/handlers/index.js.map +1 -0
  70. package/dist/delegate-4JBUkUhR.d.cts +84 -0
  71. package/dist/delegate-DN7RELL1.d.ts +84 -0
  72. package/dist/{types/storage/index.d.ts → index-C0IanN1m.d.cts} +3 -1
  73. package/dist/index-C0IanN1m.d.ts +11 -0
  74. package/dist/index-Cn82bBUu.d.ts +199 -0
  75. package/dist/index-DfT5xzgY.d.cts +199 -0
  76. package/dist/index.cjs +504 -0
  77. package/dist/index.cjs.map +1 -0
  78. package/dist/index.d.cts +3469 -0
  79. package/dist/index.d.ts +3469 -0
  80. package/dist/index.js +7 -0
  81. package/dist/index.js.map +1 -0
  82. package/dist/repositories/realm/index.cjs +513 -0
  83. package/dist/repositories/realm/index.cjs.map +1 -0
  84. package/dist/repositories/realm/index.d.cts +217 -0
  85. package/dist/{types/repositories/realm/schemas.d.ts → repositories/realm/index.d.ts} +80 -112
  86. package/dist/repositories/realm/index.js +507 -0
  87. package/dist/repositories/realm/index.js.map +1 -0
  88. package/dist/repositories/sqlite/index.cjs +588 -0
  89. package/dist/repositories/sqlite/index.cjs.map +1 -0
  90. package/dist/repositories/sqlite/index.d.cts +118 -0
  91. package/dist/{types/repositories/sqlite/walletRepository.d.ts → repositories/sqlite/index.d.ts} +58 -5
  92. package/dist/repositories/sqlite/index.js +585 -0
  93. package/dist/repositories/sqlite/index.js.map +1 -0
  94. package/dist/taskRunner-B-aPfHhK.d.cts +114 -0
  95. package/dist/taskRunner-B-vG08pX.d.ts +114 -0
  96. package/dist/wallet/expo/background.cjs +93 -0
  97. package/dist/wallet/expo/background.cjs.map +1 -0
  98. package/dist/wallet/expo/background.d.cts +84 -0
  99. package/dist/wallet/expo/background.d.ts +84 -0
  100. package/dist/wallet/expo/background.js +68 -0
  101. package/dist/wallet/expo/background.js.map +1 -0
  102. package/dist/wallet/expo/index.cjs +175 -0
  103. package/dist/wallet/expo/index.cjs.map +1 -0
  104. package/dist/wallet/expo/index.d.cts +124 -0
  105. package/dist/wallet/expo/index.d.ts +124 -0
  106. package/dist/wallet/expo/index.js +173 -0
  107. package/dist/wallet/expo/index.js.map +1 -0
  108. package/dist/wallet-CCtqT2Wb.d.ts +778 -0
  109. package/dist/wallet-DjgFb_4T.d.cts +778 -0
  110. package/dist/worker/expo/index.cjs +140 -0
  111. package/dist/worker/expo/index.cjs.map +1 -0
  112. package/dist/worker/expo/index.d.cts +29 -0
  113. package/dist/worker/expo/index.d.ts +29 -0
  114. package/dist/worker/expo/index.js +121 -0
  115. package/dist/worker/expo/index.js.map +1 -0
  116. package/package.json +110 -76
  117. package/dist/cjs/adapters/asyncStorage.js +0 -5
  118. package/dist/cjs/adapters/expo.js +0 -8
  119. package/dist/cjs/adapters/fileSystem.js +0 -5
  120. package/dist/cjs/adapters/indexedDB.js +0 -5
  121. package/dist/cjs/adapters/localStorage.js +0 -5
  122. package/dist/cjs/arkfee/celenv.js +0 -43
  123. package/dist/cjs/arkfee/estimator.js +0 -143
  124. package/dist/cjs/arkfee/index.js +0 -5
  125. package/dist/cjs/arkfee/types.js +0 -26
  126. package/dist/cjs/arknote/index.js +0 -128
  127. package/dist/cjs/bip322/index.js +0 -270
  128. package/dist/cjs/contracts/arkcontract.js +0 -147
  129. package/dist/cjs/contracts/contractManager.js +0 -649
  130. package/dist/cjs/contracts/contractWatcher.js +0 -598
  131. package/dist/cjs/contracts/handlers/default.js +0 -93
  132. package/dist/cjs/contracts/handlers/delegate.js +0 -90
  133. package/dist/cjs/contracts/handlers/helpers.js +0 -115
  134. package/dist/cjs/contracts/handlers/index.js +0 -19
  135. package/dist/cjs/contracts/handlers/registry.js +0 -89
  136. package/dist/cjs/contracts/handlers/vhtlc.js +0 -194
  137. package/dist/cjs/contracts/index.js +0 -41
  138. package/dist/cjs/contracts/types.js +0 -2
  139. package/dist/cjs/contracts/vtxoOwnership.js +0 -78
  140. package/dist/cjs/extension/asset/assetGroup.js +0 -228
  141. package/dist/cjs/extension/asset/assetId.js +0 -152
  142. package/dist/cjs/extension/asset/assetInput.js +0 -222
  143. package/dist/cjs/extension/asset/assetOutput.js +0 -174
  144. package/dist/cjs/extension/asset/assetRef.js +0 -148
  145. package/dist/cjs/extension/asset/index.js +0 -23
  146. package/dist/cjs/extension/asset/metadata.js +0 -187
  147. package/dist/cjs/extension/asset/packet.js +0 -114
  148. package/dist/cjs/extension/asset/types.js +0 -22
  149. package/dist/cjs/extension/asset/utils.js +0 -105
  150. package/dist/cjs/extension/index.js +0 -254
  151. package/dist/cjs/extension/packet.js +0 -20
  152. package/dist/cjs/forfeit.js +0 -45
  153. package/dist/cjs/identity/descriptor.js +0 -169
  154. package/dist/cjs/identity/descriptorProvider.js +0 -2
  155. package/dist/cjs/identity/hdCapableIdentity.js +0 -20
  156. package/dist/cjs/identity/index.js +0 -40
  157. package/dist/cjs/identity/seedIdentity.js +0 -477
  158. package/dist/cjs/identity/serialize.js +0 -171
  159. package/dist/cjs/identity/singleKey.js +0 -126
  160. package/dist/cjs/identity/staticDescriptorProvider.js +0 -65
  161. package/dist/cjs/index.js +0 -202
  162. package/dist/cjs/intent/index.js +0 -259
  163. package/dist/cjs/musig2/index.js +0 -11
  164. package/dist/cjs/musig2/keys.js +0 -57
  165. package/dist/cjs/musig2/nonces.js +0 -48
  166. package/dist/cjs/musig2/sign.js +0 -102
  167. package/dist/cjs/networks.js +0 -26
  168. package/dist/cjs/package.json +0 -3
  169. package/dist/cjs/providers/ark.js +0 -577
  170. package/dist/cjs/providers/delegator.js +0 -85
  171. package/dist/cjs/providers/electrum.js +0 -869
  172. package/dist/cjs/providers/errors.js +0 -59
  173. package/dist/cjs/providers/expoArk.js +0 -82
  174. package/dist/cjs/providers/expoIndexer.js +0 -111
  175. package/dist/cjs/providers/expoUtils.js +0 -124
  176. package/dist/cjs/providers/indexer.js +0 -630
  177. package/dist/cjs/providers/onchain.js +0 -262
  178. package/dist/cjs/providers/utils.js +0 -121
  179. package/dist/cjs/repositories/contractRepository.js +0 -2
  180. package/dist/cjs/repositories/inMemory/contractRepository.js +0 -55
  181. package/dist/cjs/repositories/inMemory/walletRepository.js +0 -115
  182. package/dist/cjs/repositories/index.js +0 -34
  183. package/dist/cjs/repositories/indexedDB/contractRepository.js +0 -187
  184. package/dist/cjs/repositories/indexedDB/db.js +0 -19
  185. package/dist/cjs/repositories/indexedDB/manager.js +0 -100
  186. package/dist/cjs/repositories/indexedDB/schema.js +0 -204
  187. package/dist/cjs/repositories/indexedDB/walletRepository.js +0 -474
  188. package/dist/cjs/repositories/indexedDB/websqlAdapter.js +0 -144
  189. package/dist/cjs/repositories/migrations/contractRepositoryImpl.js +0 -127
  190. package/dist/cjs/repositories/migrations/fromStorageAdapter.js +0 -66
  191. package/dist/cjs/repositories/migrations/walletRepositoryImpl.js +0 -184
  192. package/dist/cjs/repositories/realm/contractRepository.js +0 -116
  193. package/dist/cjs/repositories/realm/index.js +0 -11
  194. package/dist/cjs/repositories/realm/schemas.js +0 -157
  195. package/dist/cjs/repositories/realm/types.js +0 -7
  196. package/dist/cjs/repositories/realm/walletRepository.js +0 -305
  197. package/dist/cjs/repositories/scriptFromAddress.js +0 -16
  198. package/dist/cjs/repositories/serialization.js +0 -82
  199. package/dist/cjs/repositories/sqlite/contractRepository.js +0 -135
  200. package/dist/cjs/repositories/sqlite/index.js +0 -7
  201. package/dist/cjs/repositories/sqlite/types.js +0 -2
  202. package/dist/cjs/repositories/sqlite/walletRepository.js +0 -441
  203. package/dist/cjs/repositories/walletRepository.js +0 -2
  204. package/dist/cjs/script/address.js +0 -108
  205. package/dist/cjs/script/base.js +0 -185
  206. package/dist/cjs/script/default.js +0 -57
  207. package/dist/cjs/script/delegate.js +0 -53
  208. package/dist/cjs/script/tapscript.js +0 -619
  209. package/dist/cjs/script/vhtlc.js +0 -170
  210. package/dist/cjs/storage/asyncStorage.js +0 -50
  211. package/dist/cjs/storage/fileSystem.js +0 -141
  212. package/dist/cjs/storage/inMemory.js +0 -24
  213. package/dist/cjs/storage/index.js +0 -2
  214. package/dist/cjs/storage/indexedDB.js +0 -101
  215. package/dist/cjs/storage/localStorage.js +0 -51
  216. package/dist/cjs/tree/signingSession.js +0 -229
  217. package/dist/cjs/tree/txTree.js +0 -192
  218. package/dist/cjs/tree/validation.js +0 -107
  219. package/dist/cjs/utils/anchor.js +0 -35
  220. package/dist/cjs/utils/arkTransaction.js +0 -271
  221. package/dist/cjs/utils/bip21.js +0 -127
  222. package/dist/cjs/utils/syncCursors.js +0 -128
  223. package/dist/cjs/utils/timelock.js +0 -59
  224. package/dist/cjs/utils/transaction.js +0 -28
  225. package/dist/cjs/utils/transactionHistory.js +0 -183
  226. package/dist/cjs/utils/txSizeEstimator.js +0 -132
  227. package/dist/cjs/utils/unknownFields.js +0 -174
  228. package/dist/cjs/wallet/asset-manager.js +0 -330
  229. package/dist/cjs/wallet/asset.js +0 -119
  230. package/dist/cjs/wallet/batch.js +0 -183
  231. package/dist/cjs/wallet/delegator.js +0 -308
  232. package/dist/cjs/wallet/expo/background.js +0 -116
  233. package/dist/cjs/wallet/expo/index.js +0 -9
  234. package/dist/cjs/wallet/expo/wallet.js +0 -230
  235. package/dist/cjs/wallet/hdDescriptorProvider.js +0 -188
  236. package/dist/cjs/wallet/index.js +0 -82
  237. package/dist/cjs/wallet/inputSignerRouter.js +0 -98
  238. package/dist/cjs/wallet/onchain.js +0 -290
  239. package/dist/cjs/wallet/ramps.js +0 -216
  240. package/dist/cjs/wallet/serviceWorker/wallet-message-handler.js +0 -953
  241. package/dist/cjs/wallet/serviceWorker/wallet.js +0 -1174
  242. package/dist/cjs/wallet/signingErrors.js +0 -32
  243. package/dist/cjs/wallet/unroll.js +0 -293
  244. package/dist/cjs/wallet/utils.js +0 -111
  245. package/dist/cjs/wallet/validation.js +0 -154
  246. package/dist/cjs/wallet/vtxo-manager.js +0 -1142
  247. package/dist/cjs/wallet/wallet.js +0 -2195
  248. package/dist/cjs/wallet/walletReceiveRotator.js +0 -547
  249. package/dist/cjs/worker/browser/service-worker-manager.js +0 -183
  250. package/dist/cjs/worker/browser/utils.js +0 -67
  251. package/dist/cjs/worker/errors.js +0 -16
  252. package/dist/cjs/worker/expo/asyncStorageTaskQueue.js +0 -78
  253. package/dist/cjs/worker/expo/index.js +0 -13
  254. package/dist/cjs/worker/expo/processors/contractPollProcessor.js +0 -62
  255. package/dist/cjs/worker/expo/processors/index.js +0 -6
  256. package/dist/cjs/worker/expo/taskQueue.js +0 -41
  257. package/dist/cjs/worker/expo/taskRunner.js +0 -73
  258. package/dist/cjs/worker/messageBus.js +0 -474
  259. package/dist/esm/adapters/asyncStorage.js +0 -1
  260. package/dist/esm/adapters/expo.js +0 -3
  261. package/dist/esm/adapters/fileSystem.js +0 -1
  262. package/dist/esm/adapters/indexedDB.js +0 -1
  263. package/dist/esm/adapters/localStorage.js +0 -1
  264. package/dist/esm/arkfee/celenv.js +0 -40
  265. package/dist/esm/arkfee/estimator.js +0 -139
  266. package/dist/esm/arkfee/index.js +0 -1
  267. package/dist/esm/arkfee/types.js +0 -22
  268. package/dist/esm/arknote/index.js +0 -124
  269. package/dist/esm/bip322/index.js +0 -267
  270. package/dist/esm/contracts/arkcontract.js +0 -140
  271. package/dist/esm/contracts/contractManager.js +0 -645
  272. package/dist/esm/contracts/contractWatcher.js +0 -594
  273. package/dist/esm/contracts/handlers/default.js +0 -90
  274. package/dist/esm/contracts/handlers/delegate.js +0 -87
  275. package/dist/esm/contracts/handlers/helpers.js +0 -110
  276. package/dist/esm/contracts/handlers/index.js +0 -12
  277. package/dist/esm/contracts/handlers/registry.js +0 -86
  278. package/dist/esm/contracts/handlers/vhtlc.js +0 -191
  279. package/dist/esm/contracts/index.js +0 -13
  280. package/dist/esm/contracts/types.js +0 -1
  281. package/dist/esm/contracts/vtxoOwnership.js +0 -69
  282. package/dist/esm/extension/asset/assetGroup.js +0 -224
  283. package/dist/esm/extension/asset/assetId.js +0 -148
  284. package/dist/esm/extension/asset/assetInput.js +0 -217
  285. package/dist/esm/extension/asset/assetOutput.js +0 -169
  286. package/dist/esm/extension/asset/assetRef.js +0 -144
  287. package/dist/esm/extension/asset/index.js +0 -8
  288. package/dist/esm/extension/asset/metadata.js +0 -182
  289. package/dist/esm/extension/asset/packet.js +0 -110
  290. package/dist/esm/extension/asset/types.js +0 -19
  291. package/dist/esm/extension/asset/utils.js +0 -99
  292. package/dist/esm/extension/index.js +0 -248
  293. package/dist/esm/extension/packet.js +0 -16
  294. package/dist/esm/forfeit.js +0 -41
  295. package/dist/esm/identity/descriptor.js +0 -161
  296. package/dist/esm/identity/descriptorProvider.js +0 -1
  297. package/dist/esm/identity/hdCapableIdentity.js +0 -17
  298. package/dist/esm/identity/index.js +0 -13
  299. package/dist/esm/identity/seedIdentity.js +0 -469
  300. package/dist/esm/identity/serialize.js +0 -164
  301. package/dist/esm/identity/singleKey.js +0 -121
  302. package/dist/esm/identity/staticDescriptorProvider.js +0 -61
  303. package/dist/esm/index.js +0 -87
  304. package/dist/esm/intent/index.js +0 -255
  305. package/dist/esm/musig2/index.js +0 -3
  306. package/dist/esm/musig2/keys.js +0 -21
  307. package/dist/esm/musig2/nonces.js +0 -11
  308. package/dist/esm/musig2/sign.js +0 -63
  309. package/dist/esm/networks.js +0 -22
  310. package/dist/esm/package.json +0 -3
  311. package/dist/esm/providers/ark.js +0 -572
  312. package/dist/esm/providers/delegator.js +0 -81
  313. package/dist/esm/providers/electrum.js +0 -864
  314. package/dist/esm/providers/errors.js +0 -54
  315. package/dist/esm/providers/expoArk.js +0 -78
  316. package/dist/esm/providers/expoIndexer.js +0 -107
  317. package/dist/esm/providers/expoUtils.js +0 -87
  318. package/dist/esm/providers/indexer.js +0 -626
  319. package/dist/esm/providers/onchain.js +0 -258
  320. package/dist/esm/providers/utils.js +0 -117
  321. package/dist/esm/repositories/contractRepository.js +0 -1
  322. package/dist/esm/repositories/inMemory/contractRepository.js +0 -51
  323. package/dist/esm/repositories/inMemory/walletRepository.js +0 -111
  324. package/dist/esm/repositories/index.js +0 -10
  325. package/dist/esm/repositories/indexedDB/contractRepository.js +0 -183
  326. package/dist/esm/repositories/indexedDB/db.js +0 -4
  327. package/dist/esm/repositories/indexedDB/manager.js +0 -95
  328. package/dist/esm/repositories/indexedDB/schema.js +0 -199
  329. package/dist/esm/repositories/indexedDB/walletRepository.js +0 -470
  330. package/dist/esm/repositories/indexedDB/websqlAdapter.js +0 -138
  331. package/dist/esm/repositories/migrations/contractRepositoryImpl.js +0 -121
  332. package/dist/esm/repositories/migrations/fromStorageAdapter.js +0 -58
  333. package/dist/esm/repositories/migrations/walletRepositoryImpl.js +0 -180
  334. package/dist/esm/repositories/realm/contractRepository.js +0 -112
  335. package/dist/esm/repositories/realm/index.js +0 -3
  336. package/dist/esm/repositories/realm/schemas.js +0 -153
  337. package/dist/esm/repositories/realm/types.js +0 -6
  338. package/dist/esm/repositories/realm/walletRepository.js +0 -301
  339. package/dist/esm/repositories/scriptFromAddress.js +0 -13
  340. package/dist/esm/repositories/serialization.js +0 -67
  341. package/dist/esm/repositories/sqlite/contractRepository.js +0 -131
  342. package/dist/esm/repositories/sqlite/index.js +0 -2
  343. package/dist/esm/repositories/sqlite/types.js +0 -1
  344. package/dist/esm/repositories/sqlite/walletRepository.js +0 -437
  345. package/dist/esm/repositories/walletRepository.js +0 -1
  346. package/dist/esm/script/address.js +0 -104
  347. package/dist/esm/script/base.js +0 -179
  348. package/dist/esm/script/default.js +0 -54
  349. package/dist/esm/script/delegate.js +0 -50
  350. package/dist/esm/script/tapscript.js +0 -615
  351. package/dist/esm/script/vhtlc.js +0 -167
  352. package/dist/esm/storage/asyncStorage.js +0 -46
  353. package/dist/esm/storage/fileSystem.js +0 -104
  354. package/dist/esm/storage/inMemory.js +0 -20
  355. package/dist/esm/storage/index.js +0 -1
  356. package/dist/esm/storage/indexedDB.js +0 -97
  357. package/dist/esm/storage/localStorage.js +0 -47
  358. package/dist/esm/tree/signingSession.js +0 -191
  359. package/dist/esm/tree/txTree.js +0 -188
  360. package/dist/esm/tree/validation.js +0 -101
  361. package/dist/esm/utils/anchor.js +0 -31
  362. package/dist/esm/utils/arkTransaction.js +0 -264
  363. package/dist/esm/utils/bip21.js +0 -123
  364. package/dist/esm/utils/syncCursors.js +0 -119
  365. package/dist/esm/utils/timelock.js +0 -22
  366. package/dist/esm/utils/transaction.js +0 -24
  367. package/dist/esm/utils/transactionHistory.js +0 -180
  368. package/dist/esm/utils/txSizeEstimator.js +0 -128
  369. package/dist/esm/utils/unknownFields.js +0 -169
  370. package/dist/esm/wallet/asset-manager.js +0 -325
  371. package/dist/esm/wallet/asset.js +0 -113
  372. package/dist/esm/wallet/batch.js +0 -180
  373. package/dist/esm/wallet/delegator.js +0 -303
  374. package/dist/esm/wallet/expo/background.js +0 -111
  375. package/dist/esm/wallet/expo/index.js +0 -2
  376. package/dist/esm/wallet/expo/wallet.js +0 -193
  377. package/dist/esm/wallet/hdDescriptorProvider.js +0 -184
  378. package/dist/esm/wallet/index.js +0 -75
  379. package/dist/esm/wallet/inputSignerRouter.js +0 -94
  380. package/dist/esm/wallet/onchain.js +0 -285
  381. package/dist/esm/wallet/ramps.js +0 -212
  382. package/dist/esm/wallet/serviceWorker/wallet-message-handler.js +0 -946
  383. package/dist/esm/wallet/serviceWorker/wallet.js +0 -1169
  384. package/dist/esm/wallet/signingErrors.js +0 -27
  385. package/dist/esm/wallet/unroll.js +0 -289
  386. package/dist/esm/wallet/utils.js +0 -103
  387. package/dist/esm/wallet/validation.js +0 -142
  388. package/dist/esm/wallet/vtxo-manager.js +0 -1136
  389. package/dist/esm/wallet/wallet.js +0 -2186
  390. package/dist/esm/wallet/walletReceiveRotator.js +0 -540
  391. package/dist/esm/worker/browser/service-worker-manager.js +0 -177
  392. package/dist/esm/worker/browser/utils.js +0 -63
  393. package/dist/esm/worker/errors.js +0 -11
  394. package/dist/esm/worker/expo/asyncStorageTaskQueue.js +0 -74
  395. package/dist/esm/worker/expo/index.js +0 -4
  396. package/dist/esm/worker/expo/processors/contractPollProcessor.js +0 -59
  397. package/dist/esm/worker/expo/processors/index.js +0 -1
  398. package/dist/esm/worker/expo/taskQueue.js +0 -37
  399. package/dist/esm/worker/expo/taskRunner.js +0 -69
  400. package/dist/esm/worker/messageBus.js +0 -470
  401. package/dist/types/adapters/asyncStorage.d.ts +0 -2
  402. package/dist/types/adapters/expo.d.ts +0 -4
  403. package/dist/types/adapters/fileSystem.d.ts +0 -2
  404. package/dist/types/adapters/indexedDB.d.ts +0 -2
  405. package/dist/types/adapters/localStorage.d.ts +0 -2
  406. package/dist/types/arkfee/celenv.d.ts +0 -25
  407. package/dist/types/arkfee/estimator.d.ts +0 -49
  408. package/dist/types/arkfee/index.d.ts +0 -2
  409. package/dist/types/arkfee/types.d.ts +0 -38
  410. package/dist/types/arknote/index.d.ts +0 -84
  411. package/dist/types/bip322/index.d.ts +0 -55
  412. package/dist/types/contracts/arkcontract.d.ts +0 -99
  413. package/dist/types/contracts/contractManager.d.ts +0 -411
  414. package/dist/types/contracts/contractWatcher.d.ts +0 -217
  415. package/dist/types/contracts/handlers/default.d.ts +0 -19
  416. package/dist/types/contracts/handlers/delegate.d.ts +0 -21
  417. package/dist/types/contracts/handlers/helpers.d.ts +0 -19
  418. package/dist/types/contracts/handlers/index.d.ts +0 -7
  419. package/dist/types/contracts/handlers/registry.d.ts +0 -65
  420. package/dist/types/contracts/handlers/vhtlc.d.ts +0 -32
  421. package/dist/types/contracts/index.d.ts +0 -14
  422. package/dist/types/contracts/types.d.ts +0 -250
  423. package/dist/types/contracts/vtxoOwnership.d.ts +0 -33
  424. package/dist/types/extension/asset/assetGroup.d.ts +0 -119
  425. package/dist/types/extension/asset/assetId.d.ts +0 -83
  426. package/dist/types/extension/asset/assetInput.d.ts +0 -64
  427. package/dist/types/extension/asset/assetOutput.d.ts +0 -54
  428. package/dist/types/extension/asset/assetRef.d.ts +0 -91
  429. package/dist/types/extension/asset/index.d.ts +0 -8
  430. package/dist/types/extension/asset/metadata.d.ts +0 -52
  431. package/dist/types/extension/asset/packet.d.ts +0 -41
  432. package/dist/types/extension/asset/types.d.ts +0 -16
  433. package/dist/types/extension/asset/utils.d.ts +0 -21
  434. package/dist/types/extension/index.d.ts +0 -56
  435. package/dist/types/extension/packet.d.ts +0 -21
  436. package/dist/types/forfeit.d.ts +0 -18
  437. package/dist/types/identity/descriptor.d.ts +0 -61
  438. package/dist/types/identity/descriptorProvider.d.ts +0 -42
  439. package/dist/types/identity/hdCapableIdentity.d.ts +0 -71
  440. package/dist/types/identity/index.d.ts +0 -57
  441. package/dist/types/identity/seedIdentity.d.ts +0 -270
  442. package/dist/types/identity/serialize.d.ts +0 -96
  443. package/dist/types/identity/singleKey.d.ts +0 -62
  444. package/dist/types/identity/staticDescriptorProvider.d.ts +0 -18
  445. package/dist/types/index.d.ts +0 -59
  446. package/dist/types/intent/index.d.ts +0 -86
  447. package/dist/types/musig2/index.d.ts +0 -4
  448. package/dist/types/musig2/keys.d.ts +0 -9
  449. package/dist/types/musig2/nonces.d.ts +0 -14
  450. package/dist/types/musig2/sign.d.ts +0 -27
  451. package/dist/types/networks.d.ts +0 -16
  452. package/dist/types/providers/ark.d.ts +0 -369
  453. package/dist/types/providers/delegator.d.ts +0 -82
  454. package/dist/types/providers/electrum.d.ts +0 -312
  455. package/dist/types/providers/errors.d.ts +0 -13
  456. package/dist/types/providers/expoArk.d.ts +0 -22
  457. package/dist/types/providers/expoIndexer.d.ts +0 -18
  458. package/dist/types/providers/expoUtils.d.ts +0 -18
  459. package/dist/types/providers/indexer.d.ts +0 -301
  460. package/dist/types/providers/onchain.d.ts +0 -148
  461. package/dist/types/providers/utils.d.ts +0 -12
  462. package/dist/types/repositories/contractRepository.d.ts +0 -32
  463. package/dist/types/repositories/inMemory/contractRepository.d.ts +0 -17
  464. package/dist/types/repositories/inMemory/walletRepository.d.ts +0 -29
  465. package/dist/types/repositories/index.d.ts +0 -9
  466. package/dist/types/repositories/indexedDB/contractRepository.d.ts +0 -21
  467. package/dist/types/repositories/indexedDB/db.d.ts +0 -4
  468. package/dist/types/repositories/indexedDB/manager.d.ts +0 -25
  469. package/dist/types/repositories/indexedDB/schema.d.ts +0 -9
  470. package/dist/types/repositories/indexedDB/walletRepository.d.ts +0 -28
  471. package/dist/types/repositories/indexedDB/websqlAdapter.d.ts +0 -49
  472. package/dist/types/repositories/migrations/contractRepositoryImpl.d.ts +0 -24
  473. package/dist/types/repositories/migrations/fromStorageAdapter.d.ts +0 -19
  474. package/dist/types/repositories/migrations/walletRepositoryImpl.d.ts +0 -27
  475. package/dist/types/repositories/realm/contractRepository.d.ts +0 -24
  476. package/dist/types/repositories/realm/index.d.ts +0 -4
  477. package/dist/types/repositories/realm/types.d.ts +0 -16
  478. package/dist/types/repositories/realm/walletRepository.d.ts +0 -34
  479. package/dist/types/repositories/scriptFromAddress.d.ts +0 -9
  480. package/dist/types/repositories/serialization.d.ts +0 -65
  481. package/dist/types/repositories/sqlite/contractRepository.d.ts +0 -33
  482. package/dist/types/repositories/sqlite/index.d.ts +0 -3
  483. package/dist/types/repositories/sqlite/types.d.ts +0 -18
  484. package/dist/types/repositories/walletRepository.d.ts +0 -72
  485. package/dist/types/script/address.d.ts +0 -67
  486. package/dist/types/script/base.d.ts +0 -105
  487. package/dist/types/script/default.d.ts +0 -44
  488. package/dist/types/script/delegate.d.ts +0 -40
  489. package/dist/types/script/tapscript.d.ts +0 -169
  490. package/dist/types/script/vhtlc.d.ts +0 -66
  491. package/dist/types/tree/signingSession.d.ts +0 -37
  492. package/dist/types/tree/txTree.d.ts +0 -28
  493. package/dist/types/tree/validation.d.ts +0 -15
  494. package/dist/types/utils/anchor.d.ts +0 -19
  495. package/dist/types/utils/arkTransaction.d.ts +0 -49
  496. package/dist/types/utils/bip21.d.ts +0 -38
  497. package/dist/types/utils/syncCursors.d.ts +0 -60
  498. package/dist/types/utils/timelock.d.ts +0 -9
  499. package/dist/types/utils/transaction.d.ts +0 -13
  500. package/dist/types/utils/transactionHistory.d.ts +0 -15
  501. package/dist/types/utils/txSizeEstimator.d.ts +0 -40
  502. package/dist/types/utils/unknownFields.d.ts +0 -83
  503. package/dist/types/wallet/asset-manager.d.ts +0 -69
  504. package/dist/types/wallet/asset.d.ts +0 -21
  505. package/dist/types/wallet/batch.d.ts +0 -107
  506. package/dist/types/wallet/delegator.d.ts +0 -48
  507. package/dist/types/wallet/expo/background.d.ts +0 -66
  508. package/dist/types/wallet/expo/index.d.ts +0 -4
  509. package/dist/types/wallet/expo/wallet.d.ts +0 -99
  510. package/dist/types/wallet/hdDescriptorProvider.d.ts +0 -114
  511. package/dist/types/wallet/index.d.ts +0 -789
  512. package/dist/types/wallet/inputSignerRouter.d.ts +0 -35
  513. package/dist/types/wallet/onchain.d.ts +0 -109
  514. package/dist/types/wallet/ramps.d.ts +0 -64
  515. package/dist/types/wallet/serviceWorker/wallet-message-handler.d.ts +0 -543
  516. package/dist/types/wallet/serviceWorker/wallet.d.ts +0 -248
  517. package/dist/types/wallet/signingErrors.d.ts +0 -19
  518. package/dist/types/wallet/unroll.d.ts +0 -114
  519. package/dist/types/wallet/utils.d.ts +0 -36
  520. package/dist/types/wallet/validation.d.ts +0 -24
  521. package/dist/types/wallet/vtxo-manager.d.ts +0 -476
  522. package/dist/types/wallet/wallet.d.ts +0 -409
  523. package/dist/types/wallet/walletReceiveRotator.d.ts +0 -306
  524. package/dist/types/worker/browser/service-worker-manager.d.ts +0 -32
  525. package/dist/types/worker/browser/utils.d.ts +0 -17
  526. package/dist/types/worker/errors.d.ts +0 -7
  527. package/dist/types/worker/expo/index.d.ts +0 -7
  528. package/dist/types/worker/expo/processors/contractPollProcessor.d.ts +0 -19
  529. package/dist/types/worker/expo/processors/index.d.ts +0 -1
  530. package/dist/types/worker/expo/taskQueue.d.ts +0 -50
  531. package/dist/types/worker/expo/taskRunner.d.ts +0 -66
  532. package/dist/types/worker/messageBus.d.ts +0 -189
@@ -1,789 +0,0 @@
1
- import { Bytes } from "@scure/btc-signer/utils.js";
2
- import { ArkProvider, Output, SettlementEvent } from "../providers/ark.js";
3
- import { Identity, ReadonlyIdentity } from "../identity/index.js";
4
- import { DescriptorProvider } from "../identity/descriptorProvider.js";
5
- import { RelativeTimelock } from "../script/tapscript.js";
6
- import { EncodedVtxoScript, TapLeafScript } from "../script/base.js";
7
- import { RenewalConfig, SettlementConfig } from "./vtxo-manager.js";
8
- import { IndexerProvider } from "../providers/indexer.js";
9
- import { OnchainProvider } from "../providers/onchain.js";
10
- import { ContractWatcherConfig } from "../contracts/contractWatcher.js";
11
- import { ContractRepository, WalletRepository } from "../repositories/index.js";
12
- import { IContractManager } from "../contracts/contractManager.js";
13
- import { IDelegatorManager } from "./delegator.js";
14
- import { DelegatorProvider } from "../providers/delegator.js";
15
- /** Defaults */
16
- export declare const DEFAULT_ARKADE_SERVER_URL: "https://arkade.computer";
17
- export declare const DEFAULT_ARKADE_HRP: "ark";
18
- export declare const DEFAULT_NETWORK_NAME: "bitcoin";
19
- /**
20
- * Wallet receive-address strategy.
21
- *
22
- * - `'auto'` *(default)*: **short-term** — currently identical to
23
- * `'static'`. The `'auto'` name is reserved for a future change that
24
- * will re-enable identity-probing once HD rotation has matured in
25
- * the field. Until then, opt into HD explicitly via `'hd'` or a
26
- * {@link DescriptorProvider}.
27
- * *(See `TODO(hd-maturation)` in
28
- * `src/wallet/walletReceiveRotator.ts:resolveDescriptorProvider` for
29
- * the flip-back criteria.)*
30
- * - `'static'`: never rotate. The wallet uses one receive address derived
31
- * from `identity.xOnlyPublicKey()`.
32
- * - `'hd'`: must rotate, using the built-in HD provider derived from the
33
- * identity. Throws at `Wallet.create` if the identity isn't HD-capable
34
- * or its descriptor isn't rangeable — no silent fallback.
35
- * - A {@link DescriptorProvider} instance: rotate via the supplied
36
- * provider on every incoming VTXO. The wallet does not probe the
37
- * identity; the caller is responsible for ensuring the identity can
38
- * sign for whatever pubkey the provider returns. Errors thrown by the
39
- * provider propagate — there is no silent fallback for an explicit
40
- * provider.
41
- */
42
- export type WalletMode = "auto" | "static" | "hd" | DescriptorProvider;
43
- /**
44
- * Base configuration options shared by all wallet types.
45
- *
46
- * Supports URL-based and provider-based configuration.
47
- *
48
- * URL-based configuration starts from `arkServerUrl` and can optionally override
49
- * derived service URLs such as `indexerUrl` and `esploraUrl`.
50
- *
51
- * Provider-based configuration supplies concrete provider instances directly,
52
- * including the ArkProvider, IndexerProvider, OnchainProvider, and DelegatorProvider.
53
- *
54
- * The wallet will use provided URLs to create default providers if custom provider
55
- * instances are not supplied. If optional parameters are not provided, the wallet
56
- * will fetch configuration from the Arkade server.
57
- *
58
- * @remarks
59
- * URL-based and provider-based configuration can be mixed, but provider instances
60
- * always take precedence over URLs for the corresponding service.
61
- *
62
- * @see WalletConfig
63
- * @see ReadonlyWalletConfig
64
- * @see StorageConfig
65
- */
66
- export interface BaseWalletConfig {
67
- /** Base URL of the Arkade server. */
68
- arkServerUrl?: string;
69
- /** Optional override for the indexer URL. */
70
- indexerUrl?: string;
71
- /** Optional override for the Esplora API URL. */
72
- esploraUrl?: string;
73
- /** Optional Arkade server public key used to construct and validate Arkade addresses. */
74
- arkServerPublicKey?: string;
75
- /** Relative timelock applied to boarding scripts. */
76
- boardingTimelock?: RelativeTimelock;
77
- /** Relative timelock applied to unilateral exit paths. */
78
- exitTimelock?: RelativeTimelock;
79
- /**
80
- * Repository-backed storage configuration overrides.
81
- * Defaults to IndexedDB if unset.
82
- */
83
- storage?: StorageConfig;
84
- /** Optional Arkade provider instance. */
85
- arkProvider?: ArkProvider;
86
- /** Optional indexer provider instance. */
87
- indexerProvider?: IndexerProvider;
88
- /** Optional onchain provider instance. */
89
- onchainProvider?: OnchainProvider;
90
- /** Optional delegation service instance. */
91
- delegatorProvider?: DelegatorProvider;
92
- }
93
- /**
94
- * Configuration options for readonly wallet initialization.
95
- *
96
- * Use this config when you only need to query wallet state (balance, addresses, transactions)
97
- * without the ability to send transactions. This is useful for:
98
- * - Watch-only wallets
99
- * - Monitoring addresses
100
- * - Safe sharing of wallet state without private key exposure
101
- *
102
- * @see BaseWalletConfig
103
- * @see IReadonlyWallet
104
- *
105
- * @example
106
- * ```typescript
107
- * // URL-based configuration
108
- * const wallet = await ReadonlyWallet.create({
109
- * identity: ReadonlySingleKey.fromPublicKey(pubkey),
110
- * arkServerUrl: 'https://arkade.computer',
111
- * esploraUrl: 'https://mempool.space/api'
112
- * });
113
- *
114
- * // Provider-based configuration (e.g., for Expo/React Native)
115
- * const wallet = await ReadonlyWallet.create({
116
- * identity: ReadonlySingleKey.fromPublicKey(pubkey),
117
- * arkProvider: new ExpoArkProvider('https://arkade.computer'),
118
- * indexerProvider: new ExpoIndexerProvider('https://arkade.computer'),
119
- * onchainProvider: new EsploraProvider('https://mempool.space/api')
120
- * });
121
- * ```
122
- */
123
- export interface ReadonlyWalletConfig extends BaseWalletConfig {
124
- /** Readonly identity used to derive wallet addresses. */
125
- identity: ReadonlyIdentity;
126
- /**
127
- * Configuration for the ContractManager's watcher.
128
- * Controls reconnection behavior and failsafe polling.
129
- *
130
- * @see ContractWatcherConfig
131
- */
132
- watcherConfig?: Partial<Omit<ContractWatcherConfig, "indexerProvider">>;
133
- }
134
- /**
135
- * Configuration options for full wallet initialization.
136
- *
137
- * This config provides full wallet capabilities including sending transactions,
138
- * settling virtual outputs, and all readonly operations.
139
- *
140
- * @see ReadonlyWalletConfig
141
- * @see IWallet
142
- *
143
- * @example
144
- * ```typescript
145
- * // URL-based configuration
146
- * const wallet = await Wallet.create({
147
- * identity: MnemonicIdentity.fromMnemonic('abandon abandon...'),
148
- * arkServerUrl: 'https://arkade.computer',
149
- * esploraUrl: 'https://mempool.space/api'
150
- * });
151
- *
152
- * // Provider-based configuration (e.g., for Expo/React Native)
153
- * const wallet = await Wallet.create({
154
- * identity: MnemonicIdentity.fromMnemonic('abandon abandon...'),
155
- * arkProvider: new ExpoArkProvider('https://arkade.computer'),
156
- * indexerProvider: new ExpoIndexerProvider('https://arkade.computer'),
157
- * onchainProvider: new EsploraProvider('https://mempool.space/api')
158
- * });
159
- *
160
- * // With settlement configuration
161
- * const wallet = await Wallet.create({
162
- * identity: MnemonicIdentity.fromMnemonic('abandon abandon...'),
163
- * arkServerUrl: 'https://arkade.computer',
164
- * settlementConfig: {
165
- * vtxoThreshold: 60 * 60 * 24, // 24 hours in seconds
166
- * boardingUtxoSweep: true,
167
- * },
168
- * });
169
- * ```
170
- */
171
- export interface WalletConfig extends ReadonlyWalletConfig {
172
- /** Signing identity used to authorize transactions. */
173
- identity: Identity;
174
- /**
175
- * Legacy renewal configuration.
176
- *
177
- * @remarks
178
- * This field is still accepted for backwards compatibility, but `settlementConfig`
179
- * is the source of truth for new code.
180
- *
181
- * @deprecated Use `settlementConfig` instead.
182
- */
183
- renewalConfig?: RenewalConfig;
184
- /**
185
- * Configuration for automatic settlement and renewal.
186
- * `false` = explicitly disabled, `undefined` or `{}` = enabled with defaults.
187
- *
188
- * @defaultValue `undefined` (enabled with defaults)
189
- * @see SettlementConfig
190
- */
191
- settlementConfig?: SettlementConfig | false;
192
- /**
193
- * Receive-address strategy. Pass `'static'`, `'hd'`, or a
194
- * {@link DescriptorProvider} instance to drive rotation; omit (or
195
- * pass `'auto'`) for the built-in auto-detect behaviour. See
196
- * {@link WalletMode}.
197
- *
198
- * @defaultValue `'auto'`
199
- */
200
- walletMode?: WalletMode;
201
- }
202
- /**
203
- * Repository implementations used to store wallet and contract state.
204
- *
205
- * @see BaseWalletConfig
206
- * @see WalletRepository
207
- * @see ContractRepository
208
- */
209
- export type StorageConfig = {
210
- /** Wallet-state repository implementation. */
211
- walletRepository: WalletRepository;
212
- /** Contract-state repository implementation. */
213
- contractRepository: ContractRepository;
214
- };
215
- /**
216
- * Provider class constructor interface for dependency injection.
217
- * Ensures provider classes follow the consistent constructor pattern.
218
- */
219
- export interface ProviderClass<T> {
220
- /**
221
- * Create a provider instance for the given server URL.
222
- *
223
- * @param serverUrl - Base server URL used by the provider
224
- */
225
- new (serverUrl: string): T;
226
- }
227
- /**
228
- * Balance summary returned by `IWallet.getBalance`.
229
- *
230
- * @see IWallet.getBalance
231
- *
232
- * @example
233
- * ```typescript
234
- * const balance = await wallet.getBalance()
235
- * console.log(balance.available, balance.boarding.total)
236
- * ```
237
- */
238
- export interface WalletBalance {
239
- /** Boarding funds */
240
- boarding: {
241
- /** Confirmed funds ready to swap for virtual outputs. */
242
- confirmed: number;
243
- /** Pending funds awaiting confirmation on mainnet */
244
- unconfirmed: number;
245
- /** Combined boarding balance (`confirmed` + `unconfirmed`) */
246
- total: number;
247
- };
248
- /** Spendable settled (finalized) balance. */
249
- settled: number;
250
- /** Spendable preconfirmed (unfinalized) balance. */
251
- preconfirmed: number;
252
- /** Spendable offchain balance (`settled + preconfirmed`). */
253
- available: number;
254
- /** Recoverable balance from subdust or expired (swept) virtual outputs. */
255
- recoverable: number;
256
- /** Total balance across offchain, recoverable, and boarding funds. */
257
- total: number;
258
- /** Asset balance entries (`assetId` & `amount`) */
259
- assets: Asset[];
260
- }
261
- /**
262
- * Parameters accepted by `OnchainWallet.send`.
263
- *
264
- * @remarks
265
- * This shape was also used by the deprecated `Wallet.sendBitcoin` method.
266
- * New wallet sends should use `Recipient` via `IWallet.send`.
267
- *
268
- * @see Recipient
269
- */
270
- export interface SendBitcoinParams {
271
- /** Destination address. */
272
- address: string;
273
- /** Amount to send in satoshis. */
274
- amount: number;
275
- /** Optional fee rate override in sats/vB. */
276
- feeRate?: number;
277
- /**
278
- * Optional memo associated with the transaction.
279
- * @deprecated Does not appear to have ever been used.
280
- */
281
- memo?: string;
282
- /** Optional explicit virtual output selection used by `Wallet.sendBitcoin`. */
283
- selectedVtxos?: ExtendedVirtualCoin[];
284
- }
285
- /**
286
- * Asset amount paired with an asset id.
287
- *
288
- * @see AssetDetails
289
- */
290
- export interface Asset {
291
- /** Asset identifier. */
292
- assetId: string;
293
- /**
294
- * Asset amount in base units. Typed as `bigint` because asset
295
- * supplies routinely exceed `Number.MAX_SAFE_INTEGER` (2^53 - 1)
296
- * and silently truncating in arithmetic would corrupt balances.
297
- */
298
- amount: bigint;
299
- }
300
- /**
301
- * Recipient accepted by `IWallet.send`.
302
- *
303
- * @see IWallet.send
304
- */
305
- export interface Recipient {
306
- address: string;
307
- /**
308
- * BTC amount in satoshis.
309
- *
310
- * @defaultValue Dust amount (`330`).
311
- */
312
- amount?: number;
313
- /** Assets to send to the same recipient (`assetId` & `amount`) */
314
- assets?: Asset[];
315
- }
316
- /**
317
- * Known asset metadata fields.
318
- *
319
- * @remarks
320
- * Additional metadata keys are allowed through `AssetMetadata`.
321
- *
322
- * @see AssetMetadata
323
- */
324
- export type KnownMetadata = Partial<{
325
- /** Asset name, e.g. "Tether USD" */
326
- name: string;
327
- /** Asset symbol, e.g. "USDT" */
328
- ticker: string;
329
- /**
330
- * Amount of decimal places to adjust the `amount` for
331
- * (e.g. `1_000_000` adjusted for `6` decimals = `1`)
332
- */
333
- decimals: number;
334
- /** Image source that can be passed to an `<img src>` attribute. */
335
- icon: string;
336
- }>;
337
- /**
338
- * Asset metadata including known fields and arbitrary extension keys.
339
- *
340
- * @see KnownMetadata
341
- */
342
- export type AssetMetadata = KnownMetadata & Record<string, unknown>;
343
- /**
344
- * Asset details returned by `IAssetManager.getAssetDetails`.
345
- *
346
- * @see IAssetManager.getAssetDetails
347
- * @see AssetMetadata
348
- */
349
- export type AssetDetails = {
350
- /** Asset identifier. */
351
- assetId: string;
352
- /**
353
- * Total issued supply in base units. Typed as `bigint` for the
354
- * same reason as {@link Asset.amount} — supplies often exceed
355
- * `Number.MAX_SAFE_INTEGER`.
356
- */
357
- supply: bigint;
358
- /** Optional immutable metadata associated with the asset. */
359
- metadata?: AssetMetadata;
360
- /** Optional control asset id required for future reissuance. */
361
- controlAssetId?: string;
362
- };
363
- /**
364
- * Parameters accepted by `IAssetManager.issue`.
365
- *
366
- * @see IAssetManager.issue
367
- * @see IssuanceResult
368
- */
369
- export interface IssuanceParams {
370
- /** Initial amount of asset to issue */
371
- amount: bigint;
372
- /** Optional control asset ID that can be used for future reissuance */
373
- controlAssetId?: string;
374
- /** Immutable asset metadata including `ticker`, `decimals`, `icon` */
375
- metadata?: AssetMetadata;
376
- }
377
- /**
378
- * Result returned by `IAssetManager.issue`.
379
- *
380
- * @see IAssetManager.issue
381
- * @see IssuanceParams
382
- */
383
- export interface IssuanceResult {
384
- /** Arkade transaction ID where the asset was issued */
385
- arkTxId: string;
386
- /** Permanent asset ID, made up of above `arkTxId` and zero-based asset group index */
387
- assetId: string;
388
- }
389
- /**
390
- * Parameters accepted by `IAssetManager.reissue`.
391
- *
392
- * @see IAssetManager.reissue
393
- */
394
- export interface ReissuanceParams {
395
- /** Existing asset ID, made up of genesis (Arkade) transaction ID and zero-based asset group index */
396
- assetId: string;
397
- /** Amount of asset to issue */
398
- amount: bigint;
399
- }
400
- /**
401
- * Parameters accepted by `IAssetManager.burn`.
402
- *
403
- * @see IAssetManager.burn
404
- */
405
- export interface BurnParams {
406
- /** Existing asset ID, made up of genesis (Arkade) transaction ID and zero-based asset group index */
407
- assetId: string;
408
- /** Amount of asset to burn */
409
- amount: bigint;
410
- }
411
- /**
412
- * Explicit inputs and outputs accepted by `IWallet.settle`.
413
- *
414
- * @remarks
415
- * Inputs can include both offchain virtual outputs and onchain boarding inputs.
416
- *
417
- * @see IWallet.settle
418
- * @see Output
419
- */
420
- export interface SettleParams {
421
- /** Offchain virtual outputs and/or onchain boarding inputs to settle. */
422
- inputs: ExtendedCoin[];
423
- /** Optional onchain outputs to create (i.e., exit to). */
424
- outputs: Output[];
425
- }
426
- /**
427
- * Onchain output status
428
- */
429
- export interface Status {
430
- /** Whether the output is confirmed */
431
- confirmed: boolean;
432
- /**
433
- * Whether the output exists as a finalized batch leaf.
434
- * In the current mapping this is `true` for settled and swept virtual outputs,
435
- * and `false` for preconfirmed virtual outputs.
436
- *
437
- * @remarks
438
- * `isLeaf` is currently derived from `!isPreconfirmed` in the indexer mapping.
439
- * It is used primarily by transaction history classification to distinguish
440
- * finalized batch outputs from preconfirmed offchain outputs.
441
- */
442
- isLeaf?: boolean;
443
- /** Block height where the output was confirmed, when known. */
444
- block_height?: number;
445
- /** Block hash where the output was confirmed, when known. */
446
- block_hash?: string;
447
- /** Block time where the output was confirmed, when known. */
448
- block_time?: number;
449
- }
450
- /**
451
- * Virtual output status
452
- */
453
- export interface VirtualStatus {
454
- /**
455
- * Extended output status.
456
- *
457
- * - `preconfirmed`: not yet finalized in a batch
458
- * - `settled`: finalized in a batch
459
- * - `swept`: expired/swept and recoverable in a new batch
460
- * - `spent`: destroyed by a later transaction
461
- *
462
- * @remarks
463
- * `state` is the high-level lifecycle summary used throughout wallet balance,
464
- * recovery, and transaction history logic.
465
- */
466
- state: "preconfirmed" | "settled" | "swept" | "spent";
467
- /**
468
- * Which batch commitment transaction(s) this virtual output depends on.
469
- *
470
- * @remarks
471
- * The history builder uses these ids to group received batch transactions and
472
- * relate refreshed or forfeited virtual outputs back to the same batch.
473
- */
474
- commitmentTxIds?: string[];
475
- /**
476
- * The earliest point at which this virtual output stops being safely preconfirmed.
477
- *
478
- * @remarks
479
- * The value is stored in milliseconds in the wallet model and is used by expiry
480
- * and recovery logic to decide when a virtual output can be swept or renewed.
481
- */
482
- batchExpiry?: number;
483
- }
484
- /** Onchain output location data. */
485
- export interface Outpoint {
486
- /** Transaction ID where the output was created */
487
- txid: string;
488
- /** Transaction output index for this output */
489
- vout: number;
490
- }
491
- /**
492
- * Onchain output data.
493
- *
494
- * @see Outpoint
495
- */
496
- export interface Coin extends Outpoint {
497
- /** Value of the output in satoshis */
498
- value: number;
499
- /** Onchain output status */
500
- status: Status;
501
- }
502
- /**
503
- * Virtual output data.
504
- *
505
- * @see Coin
506
- * @see VirtualStatus
507
- */
508
- export interface VirtualCoin extends Coin {
509
- /** Creation time of the virtual output. */
510
- createdAt: Date;
511
- /** The scriptPubKey (hex) locking this virtual output, as returned by the indexer. */
512
- script: string;
513
- /** Whether this virtual output has been broadcasted onchain via an unroll (unilateral exit). */
514
- isUnrolled: boolean;
515
- /**
516
- * Whether this virtual output is already spent (boolean helper for `spentBy`).
517
- * This is not set to true if the virtual output is unrolled or swept, only when it's spent offchain.
518
- */
519
- isSpent?: boolean;
520
- /** ID of the onchain commitment transaction that settled this output, if applicable. */
521
- settledBy?: string;
522
- /** ID of the offchain checkpoint transaction that spent this output, if applicable. */
523
- spentBy?: string;
524
- /** ID of the offchain Arkade transaction that spent the above checkpoint output, if applicable. */
525
- arkTxId?: string;
526
- /** Virtual output status */
527
- virtualStatus: VirtualStatus;
528
- /** Assets carried by this virtual output, if any. */
529
- assets?: Asset[];
530
- }
531
- /** Wallet transaction direction. */
532
- export declare enum TxType {
533
- TxSent = "SENT",
534
- TxReceived = "RECEIVED"
535
- }
536
- /**
537
- * Composite key used to correlate a wallet transaction across layers.
538
- *
539
- * @see ArkTransaction
540
- */
541
- export interface TxKey {
542
- /** Boarding transaction id, when applicable. */
543
- boardingTxid: string;
544
- /** Batch commitment transaction id, when applicable. */
545
- commitmentTxid: string;
546
- /** Arkade transaction id, when applicable. */
547
- arkTxid: string;
548
- }
549
- /**
550
- * Wallet transaction history entry.
551
- *
552
- * @see TxKey
553
- * @see TxType
554
- */
555
- export interface ArkTransaction {
556
- /** Composite key referencing the related transaction ids. */
557
- key: TxKey;
558
- /** Transaction direction. */
559
- type: TxType;
560
- /** Net transaction amount in satoshis. */
561
- amount: number;
562
- /** Whether the transaction is finalized. */
563
- settled: boolean;
564
- /** Creation timestamp in milliseconds since epoch. */
565
- createdAt: number;
566
- /** Assets sent or received by this transaction, if any. */
567
- assets?: Asset[];
568
- }
569
- /**
570
- * Tapleaves required to spend or settle a wallet output.
571
- *
572
- * @see ExtendedCoin
573
- * @see ExtendedVirtualCoin
574
- */
575
- export type TapLeaves = {
576
- /** Tapleaf script used for the forfeit path. */
577
- forfeitTapLeafScript: TapLeafScript;
578
- /** Tapleaf script used for the intent path. */
579
- intentTapLeafScript: TapLeafScript;
580
- };
581
- /**
582
- * Onchain output data enriched with tapscript and witness data.
583
- *
584
- * @see Coin
585
- * @see TapLeaves
586
- */
587
- export type ExtendedCoin = TapLeaves & EncodedVtxoScript & Coin & {
588
- extraWitness?: Bytes[];
589
- };
590
- /**
591
- * Virtual output data enriched with tapscript and witness data.
592
- *
593
- * @see VirtualCoin
594
- * @see TapLeaves
595
- */
596
- export type ExtendedVirtualCoin = TapLeaves & EncodedVtxoScript & VirtualCoin & {
597
- extraWitness?: Bytes[];
598
- };
599
- /**
600
- * Return whether a virtual output is still spendable.
601
- *
602
- * @param vtxo - virtual output to inspect
603
- * @returns `true` when the virtual output is not marked as spent
604
- *
605
- * @see isRecoverable
606
- * @see isExpired
607
- */
608
- export declare function isSpendable(vtxo: VirtualCoin): boolean;
609
- /**
610
- * Return whether a virtual output is recoverable.
611
- *
612
- * @param vtxo - virtual output to inspect
613
- * @returns `true` when the virtual output is swept but still spendable
614
- *
615
- * @remarks
616
- * Recoverable virtual outputs are typically re-settled into fresh virtual outputs by the virtual output manager.
617
- *
618
- * @see isSpendable
619
- * @see isExpired
620
- */
621
- export declare function isRecoverable(vtxo: VirtualCoin): boolean;
622
- /**
623
- * Return whether a virtual output should be treated as expired.
624
- *
625
- * @param vtxo - virtual output to inspect
626
- * @returns `true` when the virtual output is swept or its batch expiry has passed
627
- * @remarks
628
- * On regtest-like environments the upstream expiry value may be expressed as a block
629
- * height instead of a timestamp. This helper intentionally ignores obviously non-time
630
- * values to avoid false positives.
631
- *
632
- * @see VirtualStatus.batchExpiry
633
- */
634
- export declare function isExpired(vtxo: VirtualCoin): boolean;
635
- /**
636
- * Return whether a virtual output is below the dust threshold.
637
- *
638
- * @param vtxo - virtual output to inspect
639
- * @param dust - dust threshold in satoshis
640
- * @returns `true` when the virtual output value is below `dust`
641
- *
642
- * @see isRecoverable
643
- */
644
- export declare function isSubdust(vtxo: VirtualCoin, dust: bigint): boolean;
645
- /**
646
- * Filtering options for `IWallet.getVtxos`.
647
- *
648
- * @see IWallet.getVtxos
649
- */
650
- export type GetVtxosFilter = {
651
- /** Include swept but still unspent virtual outputs. */
652
- withRecoverable?: boolean;
653
- /** Include virtual outputs that have been unrolled onchain. */
654
- withUnrolled?: boolean;
655
- };
656
- /**
657
- * Readonly asset manager interface for asset operations that do not require wallet identity.
658
- *
659
- * @see IAssetManager
660
- */
661
- export interface IReadonlyAssetManager {
662
- /**
663
- * Fetch metadata and supply data for an asset.
664
- *
665
- * @param assetId - Asset identifier
666
- * @returns Asset details
667
- * @see AssetDetails
668
- */
669
- getAssetDetails(assetId: string): Promise<AssetDetails>;
670
- }
671
- /**
672
- * Asset manager interface for asset operations that require wallet identity.
673
- *
674
- * @see IReadonlyAssetManager
675
- */
676
- export interface IAssetManager extends IReadonlyAssetManager {
677
- /**
678
- * Issue a new asset.
679
- *
680
- * @param params - Asset issuance parameters
681
- * @returns Asset issuance result
682
- * @see IssuanceParams
683
- * @see IssuanceResult
684
- */
685
- issue(params: IssuanceParams): Promise<IssuanceResult>;
686
- /**
687
- * Reissue an existing asset.
688
- *
689
- * @param params - Asset reissuance parameters
690
- * @returns Arkade transaction id
691
- * @see ReissuanceParams
692
- */
693
- reissue(params: ReissuanceParams): Promise<string>;
694
- /**
695
- * Burn an existing asset.
696
- *
697
- * @param params - Asset burn parameters
698
- * @returns Arkade transaction id
699
- * @see BurnParams
700
- */
701
- burn(params: BurnParams): Promise<string>;
702
- }
703
- /**
704
- * Core wallet interface for Bitcoin transactions with Arkade protocol support.
705
- *
706
- * This interface defines the contract that all wallet implementations must follow.
707
- * It provides methods for address management, balance checking, virtual output
708
- * operations, and transaction management including sending, settling, and unrolling.
709
- *
710
- * @see IReadonlyWallet
711
- */
712
- export interface IWallet extends IReadonlyWallet {
713
- /** Signing identity associated with the wallet. */
714
- identity: Identity;
715
- /**
716
- * Send bitcoin to a single Arkade address.
717
- *
718
- * @param params - Destination, amount, fee rate override, etc
719
- * @returns Arkade transaction id
720
- * @deprecated Use `send`
721
- * @see send
722
- * @see Recipient
723
- */
724
- sendBitcoin(params: SendBitcoinParams): Promise<string>;
725
- /**
726
- * Settle boarding inputs and/or preconfirmed virtual outputs into settled virtual outputs.
727
- *
728
- * @param params - Optional explicit settlement inputs and outputs
729
- * @param eventCallback - Optional callback that receives settlement events
730
- * @returns Arkade transaction id
731
- * @see SettleParams
732
- */
733
- settle(params?: SettleParams, eventCallback?: (event: SettlementEvent) => void): Promise<string>;
734
- /**
735
- * Send bitcoin and/or assets to one or more Arkade recipients.
736
- *
737
- * @param recipients - One or more recipients
738
- * @returns Arkade transaction id
739
- * @example
740
- * ```typescript
741
- * await wallet.send({ address: 'ark1q...', amount: 1000 })
742
- * ```
743
- */
744
- send(...recipients: [Recipient, ...Recipient[]]): Promise<string>;
745
- /** Asset manager bound to this wallet instance. */
746
- assetManager: IAssetManager;
747
- /** @returns Delegation manager, when configured. */
748
- getDelegatorManager(): Promise<IDelegatorManager | undefined>;
749
- }
750
- /**
751
- * Readonly wallet interface for Bitcoin transactions with Arkade protocol support.
752
- *
753
- * This interface defines the contract that all wallet implementations must follow.
754
- * It provides methods for address management, balance checking, virtual output
755
- * operations, and transaction management including sending, settling, and unrolling.
756
- *
757
- * @see IWallet
758
- */
759
- export interface IReadonlyWallet {
760
- /** Readonly identity associated with the wallet. */
761
- identity: ReadonlyIdentity;
762
- /** @returns Arkade address used for offchain funds. */
763
- getAddress(): Promise<string>;
764
- /** @returns Onchain boarding address used to move funds into Arkade. */
765
- getBoardingAddress(): Promise<string>;
766
- /** @returns The wallet's combined onchain and offchain balance. */
767
- getBalance(): Promise<WalletBalance>;
768
- /**
769
- * Get virtual outputs tracked by the wallet.
770
- *
771
- * @param filter - Optional filtering flags
772
- * @returns virtual outputs with tapscript and witness data
773
- * @see GetVtxosFilter
774
- */
775
- getVtxos(filter?: GetVtxosFilter): Promise<ExtendedVirtualCoin[]>;
776
- /** @returns Onchain boarding inputs tracked by the wallet. */
777
- getBoardingUtxos(): Promise<ExtendedCoin[]>;
778
- /** @returns Wallet transaction history derived from boarding and Arkade activity. */
779
- getTransactionHistory(): Promise<ArkTransaction[]>;
780
- /**
781
- * Get the contract manager associated with this wallet.
782
- * This is useful for querying contract state and watching for contract events.
783
- *
784
- * @returns Contract manager instance
785
- */
786
- getContractManager(): Promise<IContractManager>;
787
- /** Readonly asset manager bound to this wallet instance. */
788
- assetManager: IReadonlyAssetManager;
789
- }