@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,49 +0,0 @@
1
- /**
2
- * WebSQL adapter over expo-sqlite.
3
- *
4
- * Bridges the WebSQL API surface that indexeddbshim expects to the
5
- * synchronous expo-sqlite driver. Only the subset actually called by
6
- * the shim is implemented:
7
- *
8
- * openDatabase(name, version, displayName, estimatedSize) → WebSQLDatabase
9
- * db.transaction(cb, errCb?, successCb?)
10
- * tx.executeSql(sql, args?, successCb?, errorCb?)
11
- * resultSet = { insertId, rowsAffected, rows: { length, item(i) } }
12
- */
13
- import { type SQLiteDatabase } from "expo-sqlite";
14
- export interface SQLResultSetRowList {
15
- length: number;
16
- item(index: number): any;
17
- }
18
- export interface SQLResultSet {
19
- insertId: number;
20
- rowsAffected: number;
21
- rows: SQLResultSetRowList;
22
- }
23
- export interface SQLError {
24
- code: number;
25
- message: string;
26
- }
27
- type ExecuteSqlSuccessCb = (tx: WebSQLTransaction, resultSet: SQLResultSet) => void;
28
- type ExecuteSqlErrorCb = (tx: WebSQLTransaction, error: SQLError) => boolean | void;
29
- interface QueuedStatement {
30
- sql: string;
31
- args: any[];
32
- successCb?: ExecuteSqlSuccessCb;
33
- errorCb?: ExecuteSqlErrorCb;
34
- }
35
- export declare class WebSQLTransaction {
36
- /** @internal */
37
- _queue: QueuedStatement[];
38
- executeSql(sql: string, args?: any[], successCb?: ExecuteSqlSuccessCb, errorCb?: ExecuteSqlErrorCb): void;
39
- }
40
- export declare class WebSQLDatabase {
41
- /** @internal */
42
- _db: SQLiteDatabase;
43
- version: string;
44
- constructor(db: SQLiteDatabase, version: string);
45
- transaction(callback: (tx: WebSQLTransaction) => void, errorCb?: (error: SQLError) => void, successCb?: () => void): void;
46
- readTransaction(callback: (tx: WebSQLTransaction) => void, errorCb?: (error: SQLError) => void, successCb?: () => void): void;
47
- }
48
- export declare function openDatabase(name: string, version: string, _displayName: string, _estimatedSize: number, _creationCallback?: (db: WebSQLDatabase) => void): WebSQLDatabase;
49
- export {};
@@ -1,24 +0,0 @@
1
- import { StorageAdapter } from "../../storage/index.js";
2
- import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
- import { Contract } from "../../contracts/types.js";
4
- export declare const getContractStorageKey: (id: string, key: string) => string;
5
- export declare const getCollectionStorageKey: (type: string) => string;
6
- /**
7
- * @deprecated This is only to be used in migration from storage V1
8
- */
9
- export declare class ContractRepositoryImpl implements ContractRepository {
10
- readonly version: 1;
11
- private storage;
12
- constructor(storage: StorageAdapter);
13
- getContractData<T>(contractId: string, key: string): Promise<T | null>;
14
- setContractData<T>(contractId: string, key: string, data: T): Promise<void>;
15
- deleteContractData(contractId: string, key: string): Promise<void>;
16
- getContractCollection<T>(contractType: string): Promise<ReadonlyArray<T>>;
17
- saveToContractCollection<T, K extends keyof T>(contractType: string, item: T, idField: K): Promise<void>;
18
- removeFromContractCollection<T, K extends keyof T>(contractType: string, id: T[K], idField: K): Promise<void>;
19
- getContracts(_?: ContractFilter): Promise<Contract[]>;
20
- saveContract(_: Contract): Promise<void>;
21
- deleteContract(_: string): Promise<void>;
22
- clear(): Promise<void>;
23
- [Symbol.asyncDispose](): Promise<void>;
24
- }
@@ -1,19 +0,0 @@
1
- import { StorageAdapter } from "../../storage/index.js";
2
- import { WalletRepository } from "../walletRepository.js";
3
- export declare const MIGRATION_KEY: (repoType: "wallet" | "contract") => string;
4
- export type MigrationStatus = "pending" | "in-progress" | "done" | "not-needed";
5
- export declare function getMigrationStatus(repoType: "wallet" | "contract", storageAdapter: StorageAdapter): Promise<MigrationStatus>;
6
- export declare function requiresMigration(repoType: "wallet" | "contract", storageAdapter: StorageAdapter): Promise<boolean>;
7
- export declare function rollbackMigration(repoType: "wallet" | "contract", storageAdapter: StorageAdapter): Promise<void>;
8
- /**
9
- * Migrate wallet data from the legacy storage adapter to the new one.
10
- * It accepts both onchain and offchain addresses, make sure to pass both.
11
- *
12
- * @param storageAdapter
13
- * @param fresh
14
- * @param addresses
15
- */
16
- export declare function migrateWalletRepository(storageAdapter: StorageAdapter, fresh: WalletRepository, addresses: {
17
- onchain: string[];
18
- offchain: string[];
19
- }): Promise<void>;
@@ -1,27 +0,0 @@
1
- import { WalletRepository, WalletState } from "../walletRepository.js";
2
- import { StorageAdapter } from "../../storage/index.js";
3
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet/index.js";
4
- /**
5
- * @deprecated This is only to be used in migration from storage V1
6
- */
7
- export declare class WalletRepositoryImpl implements WalletRepository {
8
- readonly version: 1;
9
- private storage;
10
- constructor(storage: StorageAdapter);
11
- getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
12
- saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
13
- clearVtxos(address: string): Promise<void>;
14
- deleteVtxos(address: string): Promise<void>;
15
- getUtxos(address: string): Promise<ExtendedCoin[]>;
16
- saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
17
- clearUtxos(address: string): Promise<void>;
18
- deleteUtxos(address: string): Promise<void>;
19
- getTransactionHistory(address: string): Promise<ArkTransaction[]>;
20
- saveTransactions(address: string, txs: ArkTransaction[]): Promise<void>;
21
- clearTransactions(address: string): Promise<void>;
22
- deleteTransactions(address: string): Promise<void>;
23
- getWalletState(): Promise<WalletState | null>;
24
- saveWalletState(state: WalletState): Promise<void>;
25
- clear(): Promise<void>;
26
- [Symbol.asyncDispose](): Promise<void>;
27
- }
@@ -1,24 +0,0 @@
1
- import { Contract } from "../../contracts/types.js";
2
- import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
- import { RealmLike } from "./types.js";
4
- /**
5
- * Realm-based implementation of ContractRepository.
6
- *
7
- * Consumers must open Realm with the schemas from `./schemas.ts` and pass
8
- * the instance to the constructor.
9
- *
10
- * Realm handles schema creation on open, so `ensureInit()` is a no-op.
11
- * The consumer owns the Realm lifecycle — `[Symbol.asyncDispose]` is a no-op.
12
- */
13
- export declare class RealmContractRepository implements ContractRepository {
14
- private readonly realm;
15
- readonly version: 1;
16
- constructor(realm: RealmLike);
17
- private ensureInit;
18
- [Symbol.asyncDispose](): Promise<void>;
19
- clear(): Promise<void>;
20
- getContracts(filter?: ContractFilter): Promise<Contract[]>;
21
- saveContract(contract: Contract): Promise<void>;
22
- deleteContract(script: string): Promise<void>;
23
- private addFilterCondition;
24
- }
@@ -1,4 +0,0 @@
1
- export { RealmWalletRepository } from "./walletRepository.js";
2
- export { RealmContractRepository } from "./contractRepository.js";
3
- export { ArkRealmSchemas, ARK_REALM_SCHEMA_VERSION, runArkRealmMigrations, } from "./schemas.js";
4
- export type { RealmLike, RealmResults } from "./types.js";
@@ -1,16 +0,0 @@
1
- /**
2
- * Minimal interface for the subset of the Realm API used by the
3
- * Arkade repositories. Consumers pass their real Realm instance and
4
- * the compiler validates it satisfies this shape.
5
- */
6
- /** Result set returned by `realm.objects()`. */
7
- export interface RealmResults<T = Record<string, unknown>> extends Iterable<T> {
8
- filtered(query: string, ...args: unknown[]): RealmResults<T>;
9
- }
10
- /** The Realm API surface used by Arkade repositories. */
11
- export interface RealmLike {
12
- write(callback: () => void): void;
13
- objects<T = Record<string, unknown>>(schemaName: string): RealmResults<T>;
14
- create(schemaName: string, values: Record<string, any>, mode?: string): void;
15
- delete(objects: unknown): void;
16
- }
@@ -1,34 +0,0 @@
1
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../../wallet/index.js";
2
- import { WalletRepository, WalletState, VtxoRepositoryKey } from "../walletRepository.js";
3
- import { RealmLike } from "./types.js";
4
- /**
5
- * Realm-based implementation of WalletRepository.
6
- *
7
- * Consumers must open Realm with the schemas from `./schemas.ts` and pass
8
- * the instance to the constructor.
9
- *
10
- * Realm handles schema creation on open, so `ensureInit()` is a no-op.
11
- * The consumer owns the Realm lifecycle — `[Symbol.asyncDispose]` is a no-op.
12
- */
13
- export declare class RealmWalletRepository implements WalletRepository {
14
- private readonly realm;
15
- readonly version: 1;
16
- constructor(realm: RealmLike);
17
- private ensureInit;
18
- [Symbol.asyncDispose](): Promise<void>;
19
- clear(): Promise<void>;
20
- getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
21
- saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
22
- deleteVtxos(address: string): Promise<void>;
23
- getVtxosForScript(script: string): Promise<ExtendedVirtualCoin[]>;
24
- saveVtxosForScript(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
25
- deleteVtxosForScript(script: string): Promise<void>;
26
- getUtxos(address: string): Promise<ExtendedCoin[]>;
27
- saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
28
- deleteUtxos(address: string): Promise<void>;
29
- getTransactionHistory(address: string): Promise<ArkTransaction[]>;
30
- saveTransactions(address: string, txs: ArkTransaction[]): Promise<void>;
31
- deleteTransactions(address: string): Promise<void>;
32
- getWalletState(): Promise<WalletState | null>;
33
- saveWalletState(state: WalletState): Promise<void>;
34
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Compute the hex-encoded `scriptPubKey` locking a VTXO from its owning Ark
3
- * address. Used by repository-layer migrations to backfill `script` on legacy
4
- * rows that pre-date the column (the indexer now guarantees the field, so new
5
- * rows never go through this path). The `script` field is required by the
6
- * domain type, so backfill must produce the same value the indexer would
7
- * have returned — which is the hex of the address's `pkScript`.
8
- */
9
- export declare function scriptFromArkAddress(address: string): string;
@@ -1,65 +0,0 @@
1
- import { TapLeafScript } from "../script/base.js";
2
- import { ArkTransaction, Asset, ExtendedCoin, ExtendedVirtualCoin } from "../wallet/index.js";
3
- export type SerializedTapLeaf = {
4
- cb: string;
5
- s: string;
6
- };
7
- export type SerializedVtxo = ReturnType<typeof serializeVtxo>;
8
- export type SerializedUtxo = ReturnType<typeof serializeUtxo>;
9
- export type SerializedTransaction = ReturnType<typeof serializeTransaction>;
10
- export type SerializedAsset = {
11
- assetId: string;
12
- amount: string;
13
- };
14
- export declare const serializeTapLeaf: ([cb, s,]: TapLeafScript) => SerializedTapLeaf;
15
- export declare const serializeAsset: (a: Asset) => SerializedAsset;
16
- export declare const deserializeAsset: (a: {
17
- assetId: string;
18
- amount: string | number | bigint;
19
- }) => Asset;
20
- export declare const serializeAssets: (assets: Asset[] | undefined) => SerializedAsset[] | undefined;
21
- export declare const deserializeAssets: (assets: Array<{
22
- assetId: string;
23
- amount: string | number | bigint;
24
- }> | undefined) => Asset[] | undefined;
25
- export declare const serializeVtxo: (v: ExtendedVirtualCoin) => {
26
- tapTree: string;
27
- forfeitTapLeafScript: SerializedTapLeaf;
28
- intentTapLeafScript: SerializedTapLeaf;
29
- extraWitness: string[] | undefined;
30
- assets: SerializedAsset[] | undefined;
31
- createdAt: Date;
32
- script: string;
33
- isUnrolled: boolean;
34
- isSpent?: boolean;
35
- settledBy?: string;
36
- spentBy?: string;
37
- arkTxId?: string;
38
- virtualStatus: import("../wallet/index.js").VirtualStatus;
39
- value: number;
40
- status: import("../wallet/index.js").Status;
41
- txid: string;
42
- vout: number;
43
- };
44
- export declare const serializeUtxo: (u: ExtendedCoin) => {
45
- tapTree: string;
46
- forfeitTapLeafScript: SerializedTapLeaf;
47
- intentTapLeafScript: SerializedTapLeaf;
48
- extraWitness: string[] | undefined;
49
- value: number;
50
- status: import("../wallet/index.js").Status;
51
- txid: string;
52
- vout: number;
53
- };
54
- export declare const serializeTransaction: (t: ArkTransaction) => {
55
- assets: SerializedAsset[] | undefined;
56
- key: import("../wallet/index.js").TxKey;
57
- type: import("../wallet/index.js").TxType;
58
- amount: number;
59
- settled: boolean;
60
- createdAt: number;
61
- };
62
- export declare const deserializeTapLeaf: (t: SerializedTapLeaf) => TapLeafScript;
63
- export declare const deserializeVtxo: (o: SerializedVtxo) => ExtendedVirtualCoin;
64
- export declare const deserializeUtxo: (o: SerializedUtxo) => ExtendedCoin;
65
- export declare const deserializeTransaction: (o: SerializedTransaction) => ArkTransaction;
@@ -1,33 +0,0 @@
1
- import { Contract } from "../../contracts/types.js";
2
- import { ContractFilter, ContractRepository } from "../contractRepository.js";
3
- import { SQLExecutor } from "./types.js";
4
- interface SQLiteContractRepositoryOptions {
5
- /** Table name prefix (default: "ark_") */
6
- prefix?: string;
7
- }
8
- /**
9
- * SQLite-based implementation of ContractRepository.
10
- *
11
- * Uses the SQLExecutor interface so consumers can plug in any SQLite driver
12
- * (expo-sqlite, better-sqlite3, etc.).
13
- *
14
- * Tables are created lazily on first operation via `ensureInit()`.
15
- * The consumer owns the SQLExecutor lifecycle — `[Symbol.asyncDispose]` is a no-op.
16
- */
17
- export declare class SQLiteContractRepository implements ContractRepository {
18
- private readonly db;
19
- readonly version: 1;
20
- private initPromise;
21
- private readonly prefix;
22
- private readonly table;
23
- constructor(db: SQLExecutor, options?: SQLiteContractRepositoryOptions);
24
- private ensureInit;
25
- private init;
26
- [Symbol.asyncDispose](): Promise<void>;
27
- clear(): Promise<void>;
28
- getContracts(filter?: ContractFilter): Promise<Contract[]>;
29
- saveContract(contract: Contract): Promise<void>;
30
- deleteContract(script: string): Promise<void>;
31
- private addFilterCondition;
32
- }
33
- export {};
@@ -1,3 +0,0 @@
1
- export { SQLiteWalletRepository } from "./walletRepository.js";
2
- export { SQLiteContractRepository } from "./contractRepository.js";
3
- export type { SQLExecutor } from "./types.js";
@@ -1,18 +0,0 @@
1
- /**
2
- * Minimal SQL execution interface that consumers implement
3
- * to connect their SQLite (or any SQL) database to the SDK.
4
- *
5
- * Example for expo-sqlite:
6
- * ```
7
- * const executor: SQLExecutor = {
8
- * run: (sql, params) => db.runAsync(sql, params ?? []),
9
- * get: (sql, params) => db.getFirstAsync(sql, params ?? []),
10
- * all: (sql, params) => db.getAllAsync(sql, params ?? []),
11
- * };
12
- * ```
13
- */
14
- export interface SQLExecutor {
15
- run(sql: string, params?: unknown[]): Promise<void>;
16
- get<T = Record<string, unknown>>(sql: string, params?: unknown[]): Promise<T | undefined>;
17
- all<T = Record<string, unknown>>(sql: string, params?: unknown[]): Promise<T[]>;
18
- }
@@ -1,72 +0,0 @@
1
- import { ArkTransaction, ExtendedCoin, ExtendedVirtualCoin } from "../wallet/index.js";
2
- export interface WalletState {
3
- /** Arbitrary stored wallet settings. */
4
- settings?: Record<string, any>;
5
- /**
6
- * High-water mark for VTXO indexer syncs, in milliseconds.
7
- *
8
- * Reused the legacy `lastSyncTime` column name to avoid an
9
- * `ALTER TABLE` migration; the value is interpreted as the new
10
- * "max indexer `updatedAt`" cursor only after `settings.vtxoCursorMigrated`
11
- * is set, so pre-existing values written by the buggy pre-PR sync
12
- * are ignored and force a one-shot re-bootstrap on upgrade.
13
- */
14
- lastSyncTime?: number;
15
- }
16
- /** Stored commitment transaction metadata. */
17
- export type CommitmentTxRecord = {
18
- /** Commitment transaction id. */
19
- txid: string;
20
- /** Creation timestamp in milliseconds. */
21
- createdAt: number;
22
- };
23
- export interface VtxoRepositoryKey {
24
- /** Authoritative ownership key. */
25
- script: string;
26
- /** Legacy storage bucket. Required by all current backends; throw if absent. */
27
- address?: string;
28
- }
29
- export interface WalletRepository extends AsyncDisposable {
30
- readonly version: 1;
31
- /**
32
- * Clear all data from storage.
33
- */
34
- clear(): Promise<void>;
35
- /** Fetch stored virtual outputs for an address. */
36
- getVtxos(address: string): Promise<ExtendedVirtualCoin[]>;
37
- /** Save virtual outputs for an address. */
38
- saveVtxos(address: string, vtxos: ExtendedVirtualCoin[]): Promise<void>;
39
- /** Delete stored virtual outputs for an address. */
40
- deleteVtxos(address: string): Promise<void>;
41
- /**
42
- * Fetch stored virtual outputs for a script.
43
- * @optional SDK backends implement this; custom backends fall back to Tier 1.
44
- */
45
- getVtxosForScript?(script: string): Promise<ExtendedVirtualCoin[]>;
46
- /**
47
- * Save virtual outputs for a script.
48
- * @optional SDK backends implement this; custom backends fall back to Tier 1.
49
- */
50
- saveVtxosForScript?(key: VtxoRepositoryKey, vtxos: ExtendedVirtualCoin[]): Promise<void>;
51
- /**
52
- * Delete stored virtual outputs for a script.
53
- * @optional SDK backends implement this; custom backends fall back to Tier 1.
54
- */
55
- deleteVtxosForScript?(script: string): Promise<void>;
56
- /** Fetch stored boarding inputs for an address. */
57
- getUtxos(address: string): Promise<ExtendedCoin[]>;
58
- /** Save boarding inputs for an address. */
59
- saveUtxos(address: string, utxos: ExtendedCoin[]): Promise<void>;
60
- /** Delete stored boarding inputs for an address. */
61
- deleteUtxos(address: string): Promise<void>;
62
- /** Fetch stored transaction history for an address. */
63
- getTransactionHistory(address: string): Promise<ArkTransaction[]>;
64
- /** Save transaction history for an address. */
65
- saveTransactions(address: string, txs: ArkTransaction[]): Promise<void>;
66
- /** Delete stored transaction history for an address. */
67
- deleteTransactions(address: string): Promise<void>;
68
- /** Fetch stored wallet state. */
69
- getWalletState(): Promise<WalletState | null>;
70
- /** Save wallet state. */
71
- saveWalletState(state: WalletState): Promise<void>;
72
- }
@@ -1,67 +0,0 @@
1
- import { Bytes } from "@scure/btc-signer/utils.js";
2
- /**
3
- * ArkAddress allows creating and decoding bech32m-encoded Arkade addresses.
4
- *
5
- * An Arkade address is composed of:
6
- * - a human readable prefix (hrp)
7
- * - a version byte (1 byte)
8
- * - a server public key (32 bytes)
9
- * - a vtxo taproot public key (32 bytes)
10
- *
11
- * @remarks
12
- * This is an Arkade-specific address format.
13
- * It is distinct from the Taproot onchain address returned by `VtxoScript.onchainAddress`.
14
- *
15
- * @see VtxoScript
16
- *
17
- * @example
18
- * ```typescript
19
- * const address = new ArkAddress(
20
- * new Uint8Array(32), // server public key
21
- * new Uint8Array(32), // vtxo taproot public key
22
- * "ark"
23
- * );
24
- *
25
- * const encoded = address.encode();
26
- * console.log("address: ", encoded);
27
- *
28
- * const decoded = ArkAddress.decode(encoded);
29
- * ```
30
- */
31
- export declare class ArkAddress {
32
- readonly serverPubKey: Bytes;
33
- readonly vtxoTaprootKey: Bytes;
34
- readonly hrp: string;
35
- readonly version: number;
36
- /**
37
- * Create an Arkade address from its server public key, Taproot output key, and prefix.
38
- *
39
- * @param serverPubKey - 32-byte Arkade server public key
40
- * @param vtxoTaprootKey - 32-byte Taproot output key (a.k.a. tweaked public key)
41
- * @param hrp - Bech32 human-readable prefix
42
- * @param version - Address version byte
43
- * @defaultValue `version = 0`
44
- * @throws Error if either public key is not 32 bytes long
45
- */
46
- constructor(serverPubKey: Bytes, vtxoTaprootKey: Bytes, hrp?: string, version?: number);
47
- /**
48
- * Decode an Arkade address from its bech32m string form.
49
- *
50
- * @param address - Bech32m-encoded Arkade address
51
- * @returns Decoded Arkade address
52
- * @throws Error if the address is malformed or has an invalid payload length
53
- * @see encode
54
- */
55
- static decode(address: string): ArkAddress;
56
- /**
57
- * Encode the address to its bech32m string form.
58
- *
59
- * @returns Bech32m-encoded Arkade address
60
- * @see decode
61
- */
62
- encode(): string;
63
- /** ScriptPubKey used to send non-dust funds to the address. */
64
- get pkScript(): Bytes;
65
- /** ScriptPubKey used to send sub-dust funds to the address. */
66
- get subdustPkScript(): Bytes;
67
- }
@@ -1,105 +0,0 @@
1
- import { NETWORK } from "@scure/btc-signer";
2
- import { PSBTOutput } from "@scure/btc-signer/psbt.js";
3
- import { Bytes } from "@scure/btc-signer/utils.js";
4
- import { ArkAddress } from "./address.js";
5
- import { ConditionCSVMultisigTapscript, CSVMultisigTapscript } from "./tapscript.js";
6
- export type TapLeafScript = [
7
- {
8
- version: number;
9
- internalKey: Bytes;
10
- merklePath: Bytes[];
11
- },
12
- Bytes
13
- ];
14
- export declare const TapTreeCoder: (typeof PSBTOutput.tapTree)[2];
15
- export declare function scriptFromTapLeafScript(leaf: TapLeafScript): Bytes;
16
- /**
17
- * VtxoScript is a script that contains a list of tapleaf scripts.
18
- * It is used to create virtual output scripts.
19
- *
20
- * @see ArkAddress
21
- *
22
- * @example
23
- * ```typescript
24
- * const vtxoScript = new VtxoScript([new Uint8Array(32), new Uint8Array(32)]);
25
- * ```
26
- */
27
- export declare class VtxoScript {
28
- readonly scripts: Bytes[];
29
- readonly leaves: TapLeafScript[];
30
- readonly tweakedPublicKey: Bytes;
31
- /**
32
- * Decode a virtual output script from an encoded TapTree.
33
- *
34
- * @param tapTree - Encoded TapTree bytes
35
- * @returns Decoded virtual output script
36
- * @throws Error if the TapTree cannot be decoded into a valid script set
37
- * @see encode
38
- */
39
- static decode(tapTree: Bytes): VtxoScript;
40
- /**
41
- * Create a virtual output script from its tapleaf scripts.
42
- *
43
- * @param scripts - Raw tapscript bytes for each leaf
44
- * @throws Error if the provided leaves cannot produce a valid Taproot tree
45
- */
46
- constructor(scripts: Bytes[]);
47
- /**
48
- * Encode the virtual output script to a TapTree byte representation.
49
- *
50
- * @returns Encoded TapTree bytes
51
- * @see decode
52
- */
53
- encode(): Bytes;
54
- /**
55
- * Build the Arkade address corresponding to this virtual output script.
56
- *
57
- * @param prefix - Bech32 human-readable prefix
58
- * @param serverPubKey - 32-byte Arkade server public key
59
- * @returns Arkade address for this script
60
- * @see ArkAddress
61
- */
62
- address(prefix: string, serverPubKey: Bytes): ArkAddress;
63
- get pkScript(): Bytes;
64
- /**
65
- * Build the Taproot onchain address corresponding to this virtual output script.
66
- *
67
- * @param network - Bitcoin network descriptor
68
- * @returns Taproot onchain address
69
- * @see address
70
- */
71
- onchainAddress(network: typeof NETWORK): string;
72
- /**
73
- * Look up a tapleaf script by its hex-encoded tapscript body.
74
- *
75
- * @param scriptHex - Hex-encoded tapscript body without the leaf version byte
76
- * @returns Matching tapleaf script
77
- * @throws Error if no matching leaf exists
78
- */
79
- findLeaf(scriptHex: string): TapLeafScript;
80
- /**
81
- * Return all unilateral exit paths embedded in the virtual output script.
82
- *
83
- * @returns CSV-based exit paths found in the leaves
84
- * @see getSequence
85
- */
86
- exitPaths(): Array<CSVMultisigTapscript.Type | ConditionCSVMultisigTapscript.Type>;
87
- }
88
- export type EncodedVtxoScript = {
89
- tapTree: Bytes;
90
- };
91
- /**
92
- * Extract the timelock value encoded in a timelocked tapleaf, if any.
93
- *
94
- * The return value is unit-ambiguous: for a CSV leaf it is a BIP-68
95
- * nSequence (relative timelock); for a CLTV leaf it is an absolute
96
- * nLockTime. Callers must know which leaf shape they are inspecting to
97
- * interpret the number correctly, and must not copy a CSV result into
98
- * `Transaction.lockTime` (or vice versa).
99
- *
100
- * @param tapLeafScript - Tapleaf script to inspect
101
- * @returns The encoded timelock value, or `undefined` when neither a CSV
102
- * nor CLTV path is present
103
- * @see VtxoScript.exitPaths
104
- */
105
- export declare function getSequence(tapLeafScript: TapLeafScript): number | undefined;
@@ -1,44 +0,0 @@
1
- import { Bytes } from "@scure/btc-signer/utils.js";
2
- import { TapLeafScript, VtxoScript } from "./base.js";
3
- import { RelativeTimelock } from "./tapscript.js";
4
- /**
5
- * DefaultVtxo is the default implementation of a VtxoScript.
6
- * It contains 1 forfeit path and 1 exit path.
7
- * - forfeit = (Alice + Server)
8
- * - exit = (Alice) after csvTimelock
9
- */
10
- export declare namespace DefaultVtxo {
11
- /**
12
- * Options is the options for the DefaultVtxo.Script class.
13
- * csvTimelock is the exit path timelock, default is 144 blocks (1 day).
14
- */
15
- interface Options {
16
- pubKey: Bytes;
17
- serverPubKey: Bytes;
18
- csvTimelock?: RelativeTimelock;
19
- }
20
- /**
21
- * DefaultVtxo.Script is the class letting to create the vtxo script.
22
- * @example
23
- * ```typescript
24
- * const vtxoScript = new DefaultVtxo.Script({
25
- * pubKey: new Uint8Array(32),
26
- * serverPubKey: new Uint8Array(32),
27
- * });
28
- *
29
- * console.log("script pub key:", vtxoScript.pkScript)
30
- * ```
31
- */
32
- class Script extends VtxoScript {
33
- readonly options: Options;
34
- static readonly DEFAULT_TIMELOCK: RelativeTimelock;
35
- readonly forfeitScript: string;
36
- readonly exitScript: string;
37
- /** Create the default virtual output script with one forfeit path and one exit path. */
38
- constructor(options: Options);
39
- /** Return the forfeit tapleaf script. */
40
- forfeit(): TapLeafScript;
41
- /** Return the unilateral exit tapleaf script. */
42
- exit(): TapLeafScript;
43
- }
44
- }