@paimaexample/wallets 0.3.117 → 0.3.120

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 (440) hide show
  1. package/esm/concise/src/batcher.d.ts.map +1 -1
  2. package/esm/concise/src/batcher.js +7 -25
  3. package/esm/concise/src/delegate.d.ts.map +1 -1
  4. package/esm/concise/src/delegate.js +14 -38
  5. package/esm/concise/src/v2/builtins/batcher.d.ts +2 -2
  6. package/esm/crypto/src/CryptoManager.d.ts +24 -0
  7. package/esm/crypto/src/CryptoManager.d.ts.map +1 -0
  8. package/esm/crypto/src/CryptoManager.js +72 -0
  9. package/esm/crypto/src/IVerify.d.ts +7 -0
  10. package/esm/crypto/src/IVerify.d.ts.map +1 -0
  11. package/esm/crypto/src/Prando.d.ts +59 -0
  12. package/esm/crypto/src/Prando.d.ts.map +1 -0
  13. package/esm/crypto/src/Prando.js +123 -0
  14. package/esm/crypto/src/chains/algorand.d.ts +11 -0
  15. package/esm/crypto/src/chains/algorand.d.ts.map +1 -0
  16. package/esm/crypto/src/chains/algorand.js +86 -0
  17. package/esm/crypto/src/chains/cardano.d.ts +8 -0
  18. package/esm/crypto/src/chains/cardano.d.ts.map +1 -0
  19. package/esm/crypto/src/chains/cardano.js +30 -0
  20. package/esm/crypto/src/chains/evm.d.ts +9 -0
  21. package/esm/crypto/src/chains/evm.d.ts.map +1 -0
  22. package/esm/crypto/src/chains/evm.js +29 -0
  23. package/esm/crypto/src/chains/midnight.d.ts +9 -0
  24. package/esm/crypto/src/chains/midnight.d.ts.map +1 -0
  25. package/esm/crypto/src/chains/midnight.js +25 -0
  26. package/esm/crypto/src/chains/mina.d.ts +8 -0
  27. package/esm/crypto/src/chains/mina.d.ts.map +1 -0
  28. package/esm/crypto/src/chains/mina.js +32 -0
  29. package/esm/crypto/src/chains/polkadot.d.ts +9 -0
  30. package/esm/crypto/src/chains/polkadot.d.ts.map +1 -0
  31. package/esm/crypto/src/chains/polkadot.js +28 -0
  32. package/esm/crypto/src/mod.d.ts +5 -0
  33. package/esm/crypto/src/mod.d.ts.map +1 -0
  34. package/esm/crypto/src/mod.js +4 -0
  35. package/esm/crypto/src/paima-hash.d.ts +14 -0
  36. package/esm/crypto/src/paima-hash.d.ts.map +1 -0
  37. package/esm/crypto/src/paima-hash.js +13 -0
  38. package/esm/utils/src/types/nominal.d.ts +5 -1
  39. package/esm/utils/src/types/nominal.d.ts.map +1 -1
  40. package/esm/utils/src/types/typebox-helpers.d.ts +7 -6
  41. package/esm/utils/src/types/typebox-helpers.d.ts.map +1 -1
  42. package/esm/utils/src/types/typebox-helpers.js +8 -5
  43. package/esm/wallets/src/algorand/algorand.d.ts +26 -0
  44. package/esm/wallets/src/algorand/algorand.d.ts.map +1 -0
  45. package/esm/wallets/src/algorand/algorand.js +133 -0
  46. package/esm/wallets/src/algorand/wrapper.d.ts +6 -0
  47. package/esm/wallets/src/algorand/wrapper.d.ts.map +1 -0
  48. package/esm/wallets/src/algorand/wrapper.js +12 -0
  49. package/esm/wallets/src/cardano/cardano.js +1 -1
  50. package/esm/wallets/src/midnight/midnight.js +1 -1
  51. package/esm/wallets/src/mina/mina.js +1 -1
  52. package/esm/wallets/src/mod.d.ts +1 -0
  53. package/esm/wallets/src/mod.d.ts.map +1 -1
  54. package/esm/wallets/src/mod.js +1 -0
  55. package/esm/wallets/src/polkadot/polkadot.d.ts +26 -0
  56. package/esm/wallets/src/polkadot/polkadot.d.ts.map +1 -0
  57. package/esm/wallets/src/polkadot/polkadot.js +133 -0
  58. package/esm/wallets/src/polkadot/wrapper.d.ts +6 -0
  59. package/esm/wallets/src/polkadot/wrapper.d.ts.map +1 -0
  60. package/esm/wallets/src/polkadot/wrapper.js +19 -0
  61. package/esm/wallets/src/utils.d.ts +12 -4
  62. package/esm/wallets/src/utils.d.ts.map +1 -1
  63. package/esm/wallets/src/utils.js +12 -12
  64. package/esm/wallets/src/wallet-modes.d.ts +7 -1
  65. package/esm/wallets/src/wallet-modes.d.ts.map +1 -1
  66. package/esm/wallets/src/wallet-modes.js +26 -2
  67. package/esm/wallets/src/wallets.js +8 -9
  68. package/package.json +8 -3
  69. package/script/concise/src/batcher.d.ts.map +1 -1
  70. package/script/concise/src/batcher.js +7 -25
  71. package/script/concise/src/delegate.d.ts.map +1 -1
  72. package/script/concise/src/delegate.js +13 -37
  73. package/script/concise/src/v2/builtins/batcher.d.ts +2 -2
  74. package/script/crypto/src/CryptoManager.d.ts +24 -0
  75. package/script/crypto/src/CryptoManager.d.ts.map +1 -0
  76. package/script/crypto/src/CryptoManager.js +76 -0
  77. package/script/crypto/src/IVerify.d.ts +7 -0
  78. package/script/crypto/src/IVerify.d.ts.map +1 -0
  79. package/script/crypto/src/Prando.d.ts +59 -0
  80. package/script/crypto/src/Prando.d.ts.map +1 -0
  81. package/script/crypto/src/Prando.js +127 -0
  82. package/script/crypto/src/chains/algorand.d.ts +11 -0
  83. package/script/crypto/src/chains/algorand.d.ts.map +1 -0
  84. package/script/crypto/src/chains/algorand.js +90 -0
  85. package/script/crypto/src/chains/cardano.d.ts +8 -0
  86. package/script/crypto/src/chains/cardano.d.ts.map +1 -0
  87. package/script/crypto/src/chains/cardano.js +37 -0
  88. package/script/crypto/src/chains/evm.d.ts +9 -0
  89. package/script/crypto/src/chains/evm.d.ts.map +1 -0
  90. package/script/crypto/src/chains/evm.js +33 -0
  91. package/script/crypto/src/chains/midnight.d.ts +9 -0
  92. package/script/crypto/src/chains/midnight.d.ts.map +1 -0
  93. package/script/crypto/src/chains/midnight.js +29 -0
  94. package/script/crypto/src/chains/mina.d.ts +8 -0
  95. package/script/crypto/src/chains/mina.d.ts.map +1 -0
  96. package/script/crypto/src/chains/mina.js +39 -0
  97. package/script/crypto/src/chains/polkadot.d.ts +9 -0
  98. package/script/crypto/src/chains/polkadot.d.ts.map +1 -0
  99. package/script/crypto/src/chains/polkadot.js +32 -0
  100. package/script/crypto/src/mod.d.ts +5 -0
  101. package/script/crypto/src/mod.d.ts.map +1 -0
  102. package/script/{config → crypto}/src/mod.js +7 -2
  103. package/script/crypto/src/paima-hash.d.ts +14 -0
  104. package/script/crypto/src/paima-hash.d.ts.map +1 -0
  105. package/script/crypto/src/paima-hash.js +19 -0
  106. package/script/utils/src/types/nominal.d.ts +5 -1
  107. package/script/utils/src/types/nominal.d.ts.map +1 -1
  108. package/script/utils/src/types/typebox-helpers.d.ts +7 -6
  109. package/script/utils/src/types/typebox-helpers.d.ts.map +1 -1
  110. package/script/utils/src/types/typebox-helpers.js +8 -5
  111. package/script/wallets/src/algorand/algorand.d.ts +26 -0
  112. package/script/wallets/src/algorand/algorand.d.ts.map +1 -0
  113. package/script/wallets/src/algorand/algorand.js +138 -0
  114. package/script/wallets/src/algorand/wrapper.d.ts +6 -0
  115. package/script/wallets/src/algorand/wrapper.d.ts.map +1 -0
  116. package/script/wallets/src/algorand/wrapper.js +15 -0
  117. package/script/wallets/src/cardano/cardano.js +1 -1
  118. package/script/wallets/src/midnight/midnight.js +1 -1
  119. package/script/wallets/src/mina/mina.js +1 -1
  120. package/script/wallets/src/mod.d.ts +1 -0
  121. package/script/wallets/src/mod.d.ts.map +1 -1
  122. package/script/wallets/src/mod.js +3 -1
  123. package/script/wallets/src/polkadot/polkadot.d.ts +26 -0
  124. package/script/wallets/src/polkadot/polkadot.d.ts.map +1 -0
  125. package/script/wallets/src/polkadot/polkadot.js +138 -0
  126. package/script/wallets/src/polkadot/wrapper.d.ts +6 -0
  127. package/script/wallets/src/polkadot/wrapper.d.ts.map +1 -0
  128. package/script/wallets/src/polkadot/wrapper.js +22 -0
  129. package/script/wallets/src/utils.d.ts +12 -4
  130. package/script/wallets/src/utils.d.ts.map +1 -1
  131. package/script/wallets/src/utils.js +12 -12
  132. package/script/wallets/src/wallet-modes.d.ts +7 -1
  133. package/script/wallets/src/wallet-modes.d.ts.map +1 -1
  134. package/script/wallets/src/wallet-modes.js +26 -1
  135. package/script/wallets/src/wallets.js +17 -18
  136. package/esm/chain-types/src/hash.d.ts +0 -28
  137. package/esm/chain-types/src/hash.d.ts.map +0 -1
  138. package/esm/chain-types/src/hash.js +0 -29
  139. package/esm/chain-types/src/mod.d.ts +0 -3
  140. package/esm/chain-types/src/mod.d.ts.map +0 -1
  141. package/esm/chain-types/src/mod.js +0 -2
  142. package/esm/chain-types/src/types.d.ts +0 -70
  143. package/esm/chain-types/src/types.d.ts.map +0 -1
  144. package/esm/config/src/config/builder.d.ts +0 -33
  145. package/esm/config/src/config/builder.d.ts.map +0 -1
  146. package/esm/config/src/config/builder.js +0 -82
  147. package/esm/config/src/config/configCheck.d.ts +0 -32
  148. package/esm/config/src/config/configCheck.d.ts.map +0 -1
  149. package/esm/config/src/config/configCheck.js +0 -67
  150. package/esm/config/src/config/context.d.ts +0 -23
  151. package/esm/config/src/config/context.d.ts.map +0 -1
  152. package/esm/config/src/config/context.js +0 -25
  153. package/esm/config/src/config/mod.d.ts +0 -7
  154. package/esm/config/src/config/mod.d.ts.map +0 -1
  155. package/esm/config/src/config/mod.js +0 -4
  156. package/esm/config/src/config/parts/deployedAddresses.d.ts +0 -17
  157. package/esm/config/src/config/parts/deployedAddresses.d.ts.map +0 -1
  158. package/esm/config/src/config/parts/deployedAddresses.js +0 -24
  159. package/esm/config/src/config/parts/network.d.ts +0 -19
  160. package/esm/config/src/config/parts/network.d.ts.map +0 -1
  161. package/esm/config/src/config/parts/network.js +0 -29
  162. package/esm/config/src/config/parts/primitive.d.ts +0 -31
  163. package/esm/config/src/config/parts/primitive.d.ts.map +0 -1
  164. package/esm/config/src/config/parts/primitive.js +0 -28
  165. package/esm/config/src/config/parts/securityNamespace.d.ts +0 -14
  166. package/esm/config/src/config/parts/securityNamespace.d.ts.map +0 -1
  167. package/esm/config/src/config/parts/securityNamespace.js +0 -26
  168. package/esm/config/src/config/parts/syncProtocols.d.ts +0 -43
  169. package/esm/config/src/config/parts/syncProtocols.d.ts.map +0 -1
  170. package/esm/config/src/config/parts/syncProtocols.js +0 -66
  171. package/esm/config/src/config/utils.d.ts +0 -40
  172. package/esm/config/src/config/utils.d.ts.map +0 -1
  173. package/esm/config/src/config/utils.js +0 -55
  174. package/esm/config/src/mod.d.ts +0 -3
  175. package/esm/config/src/mod.d.ts.map +0 -1
  176. package/esm/config/src/mod.js +0 -2
  177. package/esm/config/src/schema/common.d.ts +0 -26
  178. package/esm/config/src/schema/common.d.ts.map +0 -1
  179. package/esm/config/src/schema/common.js +0 -51
  180. package/esm/config/src/schema/mod.d.ts +0 -7
  181. package/esm/config/src/schema/mod.d.ts.map +0 -1
  182. package/esm/config/src/schema/mod.js +0 -6
  183. package/esm/config/src/schema/namespace.d.ts +0 -39
  184. package/esm/config/src/schema/namespace.d.ts.map +0 -1
  185. package/esm/config/src/schema/namespace.js +0 -34
  186. package/esm/config/src/schema/network/algorand.d.ts +0 -12
  187. package/esm/config/src/schema/network/algorand.d.ts.map +0 -1
  188. package/esm/config/src/schema/network/algorand.js +0 -23
  189. package/esm/config/src/schema/network/all.d.ts +0 -175
  190. package/esm/config/src/schema/network/all.d.ts.map +0 -1
  191. package/esm/config/src/schema/network/all.js +0 -24
  192. package/esm/config/src/schema/network/bitcoin.d.ts +0 -19
  193. package/esm/config/src/schema/network/bitcoin.d.ts.map +0 -1
  194. package/esm/config/src/schema/network/bitcoin.js +0 -21
  195. package/esm/config/src/schema/network/cardano.d.ts +0 -12
  196. package/esm/config/src/schema/network/cardano.d.ts.map +0 -1
  197. package/esm/config/src/schema/network/cardano.js +0 -27
  198. package/esm/config/src/schema/network/evm.d.ts +0 -68
  199. package/esm/config/src/schema/network/evm.d.ts.map +0 -1
  200. package/esm/config/src/schema/network/evm.js +0 -70
  201. package/esm/config/src/schema/network/mina.d.ts +0 -14
  202. package/esm/config/src/schema/network/mina.d.ts.map +0 -1
  203. package/esm/config/src/schema/network/mina.js +0 -25
  204. package/esm/config/src/schema/network/mod.d.ts +0 -9
  205. package/esm/config/src/schema/network/mod.d.ts.map +0 -1
  206. package/esm/config/src/schema/network/mod.js +0 -8
  207. package/esm/config/src/schema/network/ntp.d.ts +0 -32
  208. package/esm/config/src/schema/network/ntp.d.ts.map +0 -1
  209. package/esm/config/src/schema/network/ntp.js +0 -39
  210. package/esm/config/src/schema/network/substrate/avail.d.ts +0 -14
  211. package/esm/config/src/schema/network/substrate/avail.d.ts.map +0 -1
  212. package/esm/config/src/schema/network/substrate/avail.js +0 -26
  213. package/esm/config/src/schema/network/substrate/common.d.ts +0 -18
  214. package/esm/config/src/schema/network/substrate/common.d.ts.map +0 -1
  215. package/esm/config/src/schema/network/substrate/common.js +0 -32
  216. package/esm/config/src/schema/network/substrate/midnight.d.ts +0 -20
  217. package/esm/config/src/schema/network/substrate/midnight.d.ts.map +0 -1
  218. package/esm/config/src/schema/network/substrate/midnight.js +0 -32
  219. package/esm/config/src/schema/network/substrate/mod.d.ts +0 -4
  220. package/esm/config/src/schema/network/substrate/mod.d.ts.map +0 -1
  221. package/esm/config/src/schema/network/substrate/mod.js +0 -3
  222. package/esm/config/src/schema/network/types.d.ts +0 -13
  223. package/esm/config/src/schema/network/types.d.ts.map +0 -1
  224. package/esm/config/src/schema/network/types.js +0 -13
  225. package/esm/config/src/schema/network/utils.d.ts +0 -5
  226. package/esm/config/src/schema/network/utils.d.ts.map +0 -1
  227. package/esm/config/src/schema/network/utils.js +0 -73
  228. package/esm/config/src/schema/primitive/mod.d.ts +0 -2
  229. package/esm/config/src/schema/primitive/mod.d.ts.map +0 -1
  230. package/esm/config/src/schema/primitive/mod.js +0 -1
  231. package/esm/config/src/schema/primitive/types.d.ts +0 -58
  232. package/esm/config/src/schema/primitive/types.d.ts.map +0 -1
  233. package/esm/config/src/schema/primitive/types.js +0 -1
  234. package/esm/config/src/schema/sync-protocols/all.d.ts +0 -583
  235. package/esm/config/src/schema/sync-protocols/all.d.ts.map +0 -1
  236. package/esm/config/src/schema/sync-protocols/all.js +0 -55
  237. package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts +0 -76
  238. package/esm/config/src/schema/sync-protocols/avail/rpc.d.ts.map +0 -1
  239. package/esm/config/src/schema/sync-protocols/avail/rpc.js +0 -56
  240. package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +0 -76
  241. package/esm/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +0 -1
  242. package/esm/config/src/schema/sync-protocols/bitcoin/rpc.js +0 -47
  243. package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts +0 -80
  244. package/esm/config/src/schema/sync-protocols/cardano/carp.d.ts.map +0 -1
  245. package/esm/config/src/schema/sync-protocols/cardano/carp.js +0 -62
  246. package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts +0 -2
  247. package/esm/config/src/schema/sync-protocols/cardano/mod.d.ts.map +0 -1
  248. package/esm/config/src/schema/sync-protocols/cardano/mod.js +0 -1
  249. package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +0 -56
  250. package/esm/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +0 -1
  251. package/esm/config/src/schema/sync-protocols/cardano/utxorpc.js +0 -56
  252. package/esm/config/src/schema/sync-protocols/common.d.ts +0 -60
  253. package/esm/config/src/schema/sync-protocols/common.d.ts.map +0 -1
  254. package/esm/config/src/schema/sync-protocols/common.js +0 -54
  255. package/esm/config/src/schema/sync-protocols/decorators/all.d.ts +0 -17
  256. package/esm/config/src/schema/sync-protocols/decorators/all.d.ts.map +0 -1
  257. package/esm/config/src/schema/sync-protocols/decorators/all.js +0 -8
  258. package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts +0 -8
  259. package/esm/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +0 -1
  260. package/esm/config/src/schema/sync-protocols/decorators/emulated.js +0 -12
  261. package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts +0 -4
  262. package/esm/config/src/schema/sync-protocols/decorators/mod.d.ts.map +0 -1
  263. package/esm/config/src/schema/sync-protocols/decorators/mod.js +0 -3
  264. package/esm/config/src/schema/sync-protocols/decorators/types.d.ts +0 -4
  265. package/esm/config/src/schema/sync-protocols/decorators/types.d.ts.map +0 -1
  266. package/esm/config/src/schema/sync-protocols/decorators/types.js +0 -4
  267. package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts +0 -68
  268. package/esm/config/src/schema/sync-protocols/evm/rpc.d.ts.map +0 -1
  269. package/esm/config/src/schema/sync-protocols/evm/rpc.js +0 -44
  270. package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts +0 -66
  271. package/esm/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +0 -1
  272. package/esm/config/src/schema/sync-protocols/midnight/graphql.js +0 -50
  273. package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts +0 -73
  274. package/esm/config/src/schema/sync-protocols/mina/graphql.d.ts.map +0 -1
  275. package/esm/config/src/schema/sync-protocols/mina/graphql.js +0 -59
  276. package/esm/config/src/schema/sync-protocols/mod.d.ts +0 -10
  277. package/esm/config/src/schema/sync-protocols/mod.d.ts.map +0 -1
  278. package/esm/config/src/schema/sync-protocols/mod.js +0 -9
  279. package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts +0 -45
  280. package/esm/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +0 -1
  281. package/esm/config/src/schema/sync-protocols/ntp/rpc.js +0 -33
  282. package/esm/config/src/schema/sync-protocols/types.d.ts +0 -125
  283. package/esm/config/src/schema/sync-protocols/types.d.ts.map +0 -1
  284. package/esm/config/src/schema/sync-protocols/types.js +0 -22
  285. package/esm/config/src/schema/utils.d.ts +0 -53
  286. package/esm/config/src/schema/utils.d.ts.map +0 -1
  287. package/esm/config/src/schema/utils.js +0 -58
  288. package/script/chain-types/src/hash.d.ts +0 -28
  289. package/script/chain-types/src/hash.d.ts.map +0 -1
  290. package/script/chain-types/src/hash.js +0 -36
  291. package/script/chain-types/src/mod.d.ts +0 -3
  292. package/script/chain-types/src/mod.d.ts.map +0 -1
  293. package/script/chain-types/src/mod.js +0 -18
  294. package/script/chain-types/src/types.d.ts +0 -70
  295. package/script/chain-types/src/types.d.ts.map +0 -1
  296. package/script/config/src/config/builder.d.ts +0 -33
  297. package/script/config/src/config/builder.d.ts.map +0 -1
  298. package/script/config/src/config/builder.js +0 -86
  299. package/script/config/src/config/configCheck.d.ts +0 -32
  300. package/script/config/src/config/configCheck.d.ts.map +0 -1
  301. package/script/config/src/config/configCheck.js +0 -70
  302. package/script/config/src/config/context.d.ts +0 -23
  303. package/script/config/src/config/context.d.ts.map +0 -1
  304. package/script/config/src/config/context.js +0 -31
  305. package/script/config/src/config/mod.d.ts +0 -7
  306. package/script/config/src/config/mod.d.ts.map +0 -1
  307. package/script/config/src/config/mod.js +0 -22
  308. package/script/config/src/config/parts/deployedAddresses.d.ts +0 -17
  309. package/script/config/src/config/parts/deployedAddresses.d.ts.map +0 -1
  310. package/script/config/src/config/parts/deployedAddresses.js +0 -28
  311. package/script/config/src/config/parts/network.d.ts +0 -19
  312. package/script/config/src/config/parts/network.d.ts.map +0 -1
  313. package/script/config/src/config/parts/network.js +0 -33
  314. package/script/config/src/config/parts/primitive.d.ts +0 -31
  315. package/script/config/src/config/parts/primitive.d.ts.map +0 -1
  316. package/script/config/src/config/parts/primitive.js +0 -32
  317. package/script/config/src/config/parts/securityNamespace.d.ts +0 -14
  318. package/script/config/src/config/parts/securityNamespace.d.ts.map +0 -1
  319. package/script/config/src/config/parts/securityNamespace.js +0 -30
  320. package/script/config/src/config/parts/syncProtocols.d.ts +0 -43
  321. package/script/config/src/config/parts/syncProtocols.d.ts.map +0 -1
  322. package/script/config/src/config/parts/syncProtocols.js +0 -70
  323. package/script/config/src/config/utils.d.ts +0 -40
  324. package/script/config/src/config/utils.d.ts.map +0 -1
  325. package/script/config/src/config/utils.js +0 -62
  326. package/script/config/src/mod.d.ts +0 -3
  327. package/script/config/src/mod.d.ts.map +0 -1
  328. package/script/config/src/schema/common.d.ts +0 -26
  329. package/script/config/src/schema/common.d.ts.map +0 -1
  330. package/script/config/src/schema/common.js +0 -54
  331. package/script/config/src/schema/mod.d.ts +0 -7
  332. package/script/config/src/schema/mod.d.ts.map +0 -1
  333. package/script/config/src/schema/mod.js +0 -22
  334. package/script/config/src/schema/namespace.d.ts +0 -39
  335. package/script/config/src/schema/namespace.d.ts.map +0 -1
  336. package/script/config/src/schema/namespace.js +0 -38
  337. package/script/config/src/schema/network/algorand.d.ts +0 -12
  338. package/script/config/src/schema/network/algorand.d.ts.map +0 -1
  339. package/script/config/src/schema/network/algorand.js +0 -26
  340. package/script/config/src/schema/network/all.d.ts +0 -175
  341. package/script/config/src/schema/network/all.d.ts.map +0 -1
  342. package/script/config/src/schema/network/all.js +0 -28
  343. package/script/config/src/schema/network/bitcoin.d.ts +0 -19
  344. package/script/config/src/schema/network/bitcoin.d.ts.map +0 -1
  345. package/script/config/src/schema/network/bitcoin.js +0 -24
  346. package/script/config/src/schema/network/cardano.d.ts +0 -12
  347. package/script/config/src/schema/network/cardano.d.ts.map +0 -1
  348. package/script/config/src/schema/network/cardano.js +0 -30
  349. package/script/config/src/schema/network/evm.d.ts +0 -68
  350. package/script/config/src/schema/network/evm.d.ts.map +0 -1
  351. package/script/config/src/schema/network/evm.js +0 -75
  352. package/script/config/src/schema/network/mina.d.ts +0 -14
  353. package/script/config/src/schema/network/mina.d.ts.map +0 -1
  354. package/script/config/src/schema/network/mina.js +0 -28
  355. package/script/config/src/schema/network/mod.d.ts +0 -9
  356. package/script/config/src/schema/network/mod.d.ts.map +0 -1
  357. package/script/config/src/schema/network/mod.js +0 -24
  358. package/script/config/src/schema/network/ntp.d.ts +0 -32
  359. package/script/config/src/schema/network/ntp.d.ts.map +0 -1
  360. package/script/config/src/schema/network/ntp.js +0 -42
  361. package/script/config/src/schema/network/substrate/avail.d.ts +0 -14
  362. package/script/config/src/schema/network/substrate/avail.d.ts.map +0 -1
  363. package/script/config/src/schema/network/substrate/avail.js +0 -29
  364. package/script/config/src/schema/network/substrate/common.d.ts +0 -18
  365. package/script/config/src/schema/network/substrate/common.d.ts.map +0 -1
  366. package/script/config/src/schema/network/substrate/common.js +0 -35
  367. package/script/config/src/schema/network/substrate/midnight.d.ts +0 -20
  368. package/script/config/src/schema/network/substrate/midnight.d.ts.map +0 -1
  369. package/script/config/src/schema/network/substrate/midnight.js +0 -35
  370. package/script/config/src/schema/network/substrate/mod.d.ts +0 -4
  371. package/script/config/src/schema/network/substrate/mod.d.ts.map +0 -1
  372. package/script/config/src/schema/network/substrate/mod.js +0 -19
  373. package/script/config/src/schema/network/types.d.ts +0 -13
  374. package/script/config/src/schema/network/types.d.ts.map +0 -1
  375. package/script/config/src/schema/network/types.js +0 -16
  376. package/script/config/src/schema/network/utils.d.ts +0 -5
  377. package/script/config/src/schema/network/utils.d.ts.map +0 -1
  378. package/script/config/src/schema/network/utils.js +0 -76
  379. package/script/config/src/schema/primitive/mod.d.ts +0 -2
  380. package/script/config/src/schema/primitive/mod.d.ts.map +0 -1
  381. package/script/config/src/schema/primitive/mod.js +0 -17
  382. package/script/config/src/schema/primitive/types.d.ts +0 -58
  383. package/script/config/src/schema/primitive/types.d.ts.map +0 -1
  384. package/script/config/src/schema/primitive/types.js +0 -2
  385. package/script/config/src/schema/sync-protocols/all.d.ts +0 -583
  386. package/script/config/src/schema/sync-protocols/all.d.ts.map +0 -1
  387. package/script/config/src/schema/sync-protocols/all.js +0 -62
  388. package/script/config/src/schema/sync-protocols/avail/rpc.d.ts +0 -76
  389. package/script/config/src/schema/sync-protocols/avail/rpc.d.ts.map +0 -1
  390. package/script/config/src/schema/sync-protocols/avail/rpc.js +0 -59
  391. package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts +0 -76
  392. package/script/config/src/schema/sync-protocols/bitcoin/rpc.d.ts.map +0 -1
  393. package/script/config/src/schema/sync-protocols/bitcoin/rpc.js +0 -50
  394. package/script/config/src/schema/sync-protocols/cardano/carp.d.ts +0 -80
  395. package/script/config/src/schema/sync-protocols/cardano/carp.d.ts.map +0 -1
  396. package/script/config/src/schema/sync-protocols/cardano/carp.js +0 -65
  397. package/script/config/src/schema/sync-protocols/cardano/mod.d.ts +0 -2
  398. package/script/config/src/schema/sync-protocols/cardano/mod.d.ts.map +0 -1
  399. package/script/config/src/schema/sync-protocols/cardano/mod.js +0 -17
  400. package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts +0 -56
  401. package/script/config/src/schema/sync-protocols/cardano/utxorpc.d.ts.map +0 -1
  402. package/script/config/src/schema/sync-protocols/cardano/utxorpc.js +0 -59
  403. package/script/config/src/schema/sync-protocols/common.d.ts +0 -60
  404. package/script/config/src/schema/sync-protocols/common.d.ts.map +0 -1
  405. package/script/config/src/schema/sync-protocols/common.js +0 -61
  406. package/script/config/src/schema/sync-protocols/decorators/all.d.ts +0 -17
  407. package/script/config/src/schema/sync-protocols/decorators/all.d.ts.map +0 -1
  408. package/script/config/src/schema/sync-protocols/decorators/all.js +0 -12
  409. package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts +0 -8
  410. package/script/config/src/schema/sync-protocols/decorators/emulated.d.ts.map +0 -1
  411. package/script/config/src/schema/sync-protocols/decorators/emulated.js +0 -15
  412. package/script/config/src/schema/sync-protocols/decorators/mod.d.ts +0 -4
  413. package/script/config/src/schema/sync-protocols/decorators/mod.d.ts.map +0 -1
  414. package/script/config/src/schema/sync-protocols/decorators/mod.js +0 -19
  415. package/script/config/src/schema/sync-protocols/decorators/types.d.ts +0 -4
  416. package/script/config/src/schema/sync-protocols/decorators/types.d.ts.map +0 -1
  417. package/script/config/src/schema/sync-protocols/decorators/types.js +0 -7
  418. package/script/config/src/schema/sync-protocols/evm/rpc.d.ts +0 -68
  419. package/script/config/src/schema/sync-protocols/evm/rpc.d.ts.map +0 -1
  420. package/script/config/src/schema/sync-protocols/evm/rpc.js +0 -47
  421. package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts +0 -66
  422. package/script/config/src/schema/sync-protocols/midnight/graphql.d.ts.map +0 -1
  423. package/script/config/src/schema/sync-protocols/midnight/graphql.js +0 -53
  424. package/script/config/src/schema/sync-protocols/mina/graphql.d.ts +0 -73
  425. package/script/config/src/schema/sync-protocols/mina/graphql.d.ts.map +0 -1
  426. package/script/config/src/schema/sync-protocols/mina/graphql.js +0 -62
  427. package/script/config/src/schema/sync-protocols/mod.d.ts +0 -10
  428. package/script/config/src/schema/sync-protocols/mod.d.ts.map +0 -1
  429. package/script/config/src/schema/sync-protocols/mod.js +0 -25
  430. package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts +0 -45
  431. package/script/config/src/schema/sync-protocols/ntp/rpc.d.ts.map +0 -1
  432. package/script/config/src/schema/sync-protocols/ntp/rpc.js +0 -36
  433. package/script/config/src/schema/sync-protocols/types.d.ts +0 -125
  434. package/script/config/src/schema/sync-protocols/types.d.ts.map +0 -1
  435. package/script/config/src/schema/sync-protocols/types.js +0 -25
  436. package/script/config/src/schema/utils.d.ts +0 -53
  437. package/script/config/src/schema/utils.d.ts.map +0 -1
  438. package/script/config/src/schema/utils.js +0 -62
  439. /package/esm/{chain-types/src/types.js → crypto/src/IVerify.js} +0 -0
  440. /package/script/{chain-types/src/types.js → crypto/src/IVerify.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polkadot.d.ts","sourceRoot":"","sources":["../../../../src/wallets/src/polkadot/polkadot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAErB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAC;AAMzB,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AACrC,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAQ5C,qBAAa,iBACX,YAAW,UAAU,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC;IAEnE,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA4C;WAEtD,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,EAAE,CAAC;IAkBzE,MAAM,CAAC,QAAQ,IAAI,iBAAiB;IAOpC,aAAa,QAAa,OAAO,CAAC,gBAAgB,CAAC,CA0BjD;IACF,eAAe,GACb,MAAM,gBAAgB,CAAC,WAAW,CAAC,KAClC,OAAO,CAAC,gBAAgB,CAAC,CAM1B;IACF,YAAY,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,gBAAgB,CAAC,CAW5D;IACF,WAAW,QAAO,SAAS,GAAG,gBAAgB,CAE5C;IACF,kBAAkB,QAAO,gBAAgB,CAKvC;IACF,WAAW,QAAO,OAAO,CAEvB;CACH;AAED,qBAAa,gBAAiB,YAAW,SAAS,CAAC,WAAW,CAAC;IAE3D,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,QAAQ,CAAC,OAAO,EAAE,eAAe;gBADhB,IAAI,EAAE,gBAAgB,CAAC,WAAW,CAAC,EAC3C,OAAO,EAAE,eAAe;IAEnC,MAAM,CAAC,IAAI,GACT,MAAM,gBAAgB,CAAC,WAAW,CAAC,KAClC,OAAO,CAAC,gBAAgB,CAAC,CAS1B;IACF,aAAa,QAAO,gBAAgB,CAAC,WAAW,CAAC,CAE/C;IACF,UAAU,QAAO,cAAc,CAK7B;IACF,WAAW,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,aAAa,CAAC,CAa3D;CACH"}
@@ -0,0 +1,133 @@
1
+ import { AddressType } from "../../../utils/src/mod.js";
2
+ import { optionToActive, } from "../IProvider.js";
3
+ import { web3Enable, web3FromSource } from "@polkadot/extension-dapp";
4
+ import { utf8ToHex } from "web3-utils";
5
+ import { getWindow } from "../windows.js";
6
+ import { web3Accounts, web3FromAddress } from "@polkadot/extension-dapp";
7
+ // declare global {
8
+ // interface Window {
9
+ // injectedWeb3?: Record<string, InjectedWindowProvider>;
10
+ // }
11
+ // }
12
+ export class PolkadotConnector {
13
+ provider;
14
+ static INSTANCE = undefined;
15
+ static async getWalletOptions() {
16
+ const injectedWeb3 = getWindow()?.injectedWeb3;
17
+ if (injectedWeb3 == null)
18
+ return [];
19
+ return Object.keys(injectedWeb3).map((wallet) => ({
20
+ metadata: {
21
+ name: wallet,
22
+ // polkadot provides no way to get a human-friendly name or icon for wallets
23
+ displayName: wallet,
24
+ },
25
+ api: async () => {
26
+ // const { web3Enable, web3FromSource } = await import('@polkadot/extension-dapp');
27
+ await web3Enable(/*gameName*/ "paima");
28
+ const injector = await web3FromSource(wallet);
29
+ return injector;
30
+ },
31
+ }));
32
+ }
33
+ static instance() {
34
+ if (PolkadotConnector.INSTANCE == null) {
35
+ const newInstance = new PolkadotConnector();
36
+ PolkadotConnector.INSTANCE = newInstance;
37
+ }
38
+ return PolkadotConnector.INSTANCE;
39
+ }
40
+ connectSimple = async () => {
41
+ if (this.provider != null) {
42
+ return this.provider;
43
+ }
44
+ const extensions = await web3Enable(/*gameName*/ "paima");
45
+ if (extensions.length === 0) {
46
+ throw new Error(`[polkadot] no extension detected`);
47
+ }
48
+ // we get all accounts instead of picking a specific extension
49
+ // because some extensions could have no accounts in them
50
+ const allAccounts = await web3Accounts();
51
+ for (const account of allAccounts) {
52
+ const injector = await web3FromAddress(account.address);
53
+ if (injector.signer.signRaw == null)
54
+ continue;
55
+ return await this.connectExternal({
56
+ metadata: {
57
+ name: account.meta.source,
58
+ // polkadot provides no way to get a human-friendly name or icon for wallets
59
+ displayName: account.meta.source,
60
+ },
61
+ api: injector,
62
+ });
63
+ }
64
+ throw new Error("[polkadot] No account detected that supports signing! Found extensions: " + extensions.map(e => e.name).join(", "));
65
+ };
66
+ connectExternal = async (conn) => {
67
+ if (this.provider?.getConnection().metadata?.name === conn.metadata.name) {
68
+ return this.provider;
69
+ }
70
+ this.provider = await PolkadotProvider.init(conn);
71
+ return this.provider;
72
+ };
73
+ connectNamed = async (name) => {
74
+ if (this.provider?.getConnection().metadata?.name === name) {
75
+ return this.provider;
76
+ }
77
+ const provider = (await PolkadotConnector.getWalletOptions()).find((entry) => entry.metadata.name === name);
78
+ if (provider == null) {
79
+ throw new Error(`Polkadot wallet ${name} not found`);
80
+ }
81
+ return await this.connectExternal(await optionToActive(provider));
82
+ };
83
+ getProvider = () => {
84
+ return this.provider;
85
+ };
86
+ getOrThrowProvider = () => {
87
+ if (this.provider == null) {
88
+ throw new Error(`PolkadotConnector not initialized yet`);
89
+ }
90
+ return this.provider;
91
+ };
92
+ isConnected = () => {
93
+ return this.provider != null;
94
+ };
95
+ }
96
+ export class PolkadotProvider {
97
+ conn;
98
+ address;
99
+ constructor(conn, address) {
100
+ this.conn = conn;
101
+ this.address = address;
102
+ }
103
+ static init = async (conn) => {
104
+ // { address, name, type: "sr25519" }
105
+ const addresses = await conn.api.accounts.get(true);
106
+ const account = addresses.filter(a => a.type === "sr25519")[0]?.address;
107
+ if (account == null) {
108
+ throw new Error("Unknown error while receiving Polkadot accounts");
109
+ }
110
+ return new PolkadotProvider(conn, account);
111
+ };
112
+ getConnection = () => {
113
+ return this.conn;
114
+ };
115
+ getAddress = () => {
116
+ return {
117
+ type: AddressType.POLKADOT,
118
+ address: this.address,
119
+ };
120
+ };
121
+ signMessage = async (message) => {
122
+ if (this.conn.api.signer.signRaw == null) {
123
+ throw new Error(`[polkadot] extension ${this.conn.metadata.name} does not support signRaw`);
124
+ }
125
+ const hexMessage = utf8ToHex(message);
126
+ const { signature } = await this.conn.api.signer.signRaw({
127
+ address: this.getAddress().address,
128
+ data: hexMessage,
129
+ type: "bytes",
130
+ });
131
+ return signature;
132
+ };
133
+ }
@@ -0,0 +1,6 @@
1
+ import type { Result } from "../../../utils/src/mod.js";
2
+ import type { IProvider } from "../IProvider.js";
3
+ import type { WalletMode, ApiForMode } from "../utils.js";
4
+ import { type LoginInfoMap } from "../wallet-modes.js";
5
+ export declare function polkadotLoginWrapper(loginInfo: LoginInfoMap[WalletMode.Polkadot]): Promise<Result<IProvider<ApiForMode<WalletMode.Polkadot>>>>;
6
+ //# sourceMappingURL=wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../../src/wallets/src/polkadot/wrapper.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,oBAAoB,CAAC;AAGxE,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,GAC3C,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAa7D"}
@@ -0,0 +1,19 @@
1
+ // import { buildEndpointErrorFxn, PaimaMiddlewareErrorCode } from '../errors.js';
2
+ // import { getGameName } from '../state.js';
3
+ // import type { LoginInfoMap } from '../types.js';
4
+ // import { PolkadotConnector } from '@paimaexample/providers';
5
+ // import type { ApiForMode, IProvider, WalletMode } from '@paimaexample/providers';
6
+ // import { connectInjected } from './wallet-modes.js';
7
+ // import type { Result } from '@paimaexample/utils';
8
+ import { connectInjected } from "../wallet-modes.js";
9
+ import { PolkadotConnector } from "./polkadot.js";
10
+ export async function polkadotLoginWrapper(loginInfo) {
11
+ const loginResult = await connectInjected('polkadotLoginWrapper', loginInfo, PolkadotConnector.instance());
12
+ if (loginResult.success === false) {
13
+ return loginResult;
14
+ }
15
+ return {
16
+ success: true,
17
+ result: loginResult.result,
18
+ };
19
+ }
@@ -1,7 +1,9 @@
1
1
  import type { ActiveConnection, IConnector, IInjectedConnector, IProvider } from "./IProvider.js";
2
+ import { AlgorandConnector } from "./algorand/algorand.js";
2
3
  import { EthersConnector } from "./evm/ethers.js";
3
4
  import { EvmInjectedConnector } from "./evm/injected.js";
4
5
  import { CardanoConnector } from "./cardano/cardano.js";
6
+ import { PolkadotConnector } from "./polkadot/polkadot.js";
5
7
  import { MinaConnector } from "./mina/mina.js";
6
8
  import { AvailConnector } from "./avail/avail.js";
7
9
  import { MidnightConnector } from "./midnight/midnight.js";
@@ -10,8 +12,10 @@ export declare const enum WalletMode {
10
12
  EvmEthers = 1,
11
13
  Midnight = 2,
12
14
  Cardano = 3,
13
- Mina = 4,
14
- AvailJs = 5
15
+ Polkadot = 4,
16
+ Algorand = 5,
17
+ Mina = 6,
18
+ AvailJs = 7
15
19
  }
16
20
  export declare const WalletNameMap: Record<WalletMode, string>;
17
21
  export declare const WalletModeMap: {
@@ -19,8 +23,10 @@ export declare const WalletModeMap: {
19
23
  1: EthersConnector;
20
24
  2: MidnightConnector;
21
25
  3: CardanoConnector;
22
- 4: MinaConnector;
23
- 5: AvailConnector;
26
+ 4: PolkadotConnector;
27
+ 5: AlgorandConnector;
28
+ 6: MinaConnector;
29
+ 7: AvailConnector;
24
30
  };
25
31
  type ExtractGeneric<T> = T extends IConnector<infer U> ? U : never;
26
32
  export type ApiForMode<Mode extends WalletMode> = ExtractGeneric<(typeof WalletModeMap)[Mode]>;
@@ -32,6 +38,8 @@ export type InjectionPreference<T> = {
32
38
  export declare function allInjectedWallets(): Promise<{
33
39
  [WalletMode.EvmInjected]: ReturnType<typeof EvmInjectedConnector.getWalletOptions>;
34
40
  [WalletMode.Cardano]: ReturnType<typeof CardanoConnector.getWalletOptions>;
41
+ [WalletMode.Polkadot]: Awaited<ReturnType<typeof PolkadotConnector.getWalletOptions>>;
42
+ [WalletMode.Algorand]: ReturnType<typeof AlgorandConnector.getWalletOptions>;
35
43
  [WalletMode.Mina]: ReturnType<typeof MinaConnector.getWalletOptions>;
36
44
  [WalletMode.Midnight]: ReturnType<typeof MidnightConnector.getWalletOptions>;
37
45
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"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C,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC7E,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACrE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CAC9E,CAAC,CASD;AACD,wBAAsB,qBAAqB,CAAC,GAAG,EAC7C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,EAChD,SAAS,EAAE,kBAAkB,CAAC,GAAG,CAAC,GACjC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAiBzB;AAED,wBAAgB,YAAY,CAC1B,IAAI,SAAS,UAAU,EACvB,GAAG,SAAS,UAAU,CAAC,IAAI,CAAC,EAC5B,IAAI,SAAS,MAAM,SAAS,CAAC,GAAG,CAAC,EAEjC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,IAAI,EACd,GAAG,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GACxC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAKlC"}
@@ -1,8 +1,8 @@
1
- // import { AlgorandConnector } from "./algorand/algorand.ts";
1
+ import { AlgorandConnector } from "./algorand/algorand.js";
2
2
  import { EthersConnector } from "./evm/ethers.js";
3
3
  import { EvmInjectedConnector } from "./evm/injected.js";
4
4
  import { CardanoConnector } from "./cardano/cardano.js";
5
- // import { PolkadotConnector } from "./polkadot/polkadot.ts";
5
+ import { PolkadotConnector } from "./polkadot/polkadot.js";
6
6
  import { MinaConnector } from "./mina/mina.js";
7
7
  import { AvailConnector } from "./avail/avail.js";
8
8
  import { MidnightConnector } from "./midnight/midnight.js";
@@ -12,18 +12,18 @@ export var WalletMode;
12
12
  WalletMode[WalletMode["EvmEthers"] = 1] = "EvmEthers";
13
13
  WalletMode[WalletMode["Midnight"] = 2] = "Midnight";
14
14
  WalletMode[WalletMode["Cardano"] = 3] = "Cardano";
15
- // Polkadot,
16
- // Algorand,
17
- WalletMode[WalletMode["Mina"] = 4] = "Mina";
18
- WalletMode[WalletMode["AvailJs"] = 5] = "AvailJs";
15
+ WalletMode[WalletMode["Polkadot"] = 4] = "Polkadot";
16
+ WalletMode[WalletMode["Algorand"] = 5] = "Algorand";
17
+ WalletMode[WalletMode["Mina"] = 6] = "Mina";
18
+ WalletMode[WalletMode["AvailJs"] = 7] = "AvailJs";
19
19
  })(WalletMode || (WalletMode = {}));
20
20
  export const WalletNameMap = {
21
21
  [WalletMode.EvmInjected]: "EVM",
22
22
  [WalletMode.EvmEthers]: "EVM",
23
23
  [WalletMode.Midnight]: "Midnight",
24
24
  [WalletMode.Cardano]: "Cardano",
25
- // [WalletMode.Polkadot]: 'Polkadot',
26
- // [WalletMode.Algorand]: 'Algorand',
25
+ [WalletMode.Polkadot]: 'Polkadot',
26
+ [WalletMode.Algorand]: 'Algorand',
27
27
  [WalletMode.Mina]: "Mina",
28
28
  [WalletMode.AvailJs]: "Avail",
29
29
  };
@@ -32,8 +32,8 @@ export const WalletModeMap = {
32
32
  [WalletMode.EvmEthers]: EthersConnector.instance(),
33
33
  [WalletMode.Midnight]: MidnightConnector.instance(),
34
34
  [WalletMode.Cardano]: CardanoConnector.instance(),
35
- // [WalletMode.Polkadot]: PolkadotConnector.instance(),
36
- // [WalletMode.Algorand]: AlgorandConnector.instance(),
35
+ [WalletMode.Polkadot]: PolkadotConnector.instance(),
36
+ [WalletMode.Algorand]: AlgorandConnector.instance(),
37
37
  [WalletMode.Mina]: MinaConnector.instance(),
38
38
  [WalletMode.AvailJs]: AvailConnector.instance(),
39
39
  };
@@ -41,8 +41,8 @@ export async function allInjectedWallets() {
41
41
  return {
42
42
  [WalletMode.EvmInjected]: EvmInjectedConnector.getWalletOptions(),
43
43
  [WalletMode.Cardano]: CardanoConnector.getWalletOptions(),
44
- // [WalletMode.Polkadot]: await PolkadotConnector.getWalletOptions(),
45
- // [WalletMode.Algorand]: AlgorandConnector.getWalletOptions(),
44
+ [WalletMode.Polkadot]: await PolkadotConnector.getWalletOptions(),
45
+ [WalletMode.Algorand]: AlgorandConnector.getWalletOptions(),
46
46
  [WalletMode.Mina]: MinaConnector.getWalletOptions(),
47
47
  [WalletMode.Midnight]: MidnightConnector.getWalletOptions(),
48
48
  };
@@ -1,11 +1,14 @@
1
1
  import type { ApiPromise } from "avail-js-sdk";
2
2
  import type { Result } from "../../utils/src/mod.js";
3
+ import type { AlgorandApi } from "./algorand/algorand.js";
3
4
  import type { CardanoApi } from "./cardano/cardano.js";
4
5
  import type { EthersApi } from "./evm/ethers.js";
5
6
  import type { EvmApi } from "./evm/injected.js";
6
7
  import type { ActiveConnection, IInjectedConnector, IProvider } from "./IProvider.js";
7
8
  import type { MinaApi } from "./mina/mina.js";
8
- import { type InjectionPreference, type WalletMode } from "./utils.js";
9
+ import type { PolkadotApi } from "./polkadot/polkadot.js";
10
+ import { type InjectionPreference, WalletMode } from "./utils.js";
11
+ import { AddressType } from "../../utils/src/mod.js";
9
12
  import type { MidnightApi } from "./midnight/midnight.js";
10
13
  import type { Chain } from "viem/chains";
11
14
  export type BaseLoginInfo<Api> = {
@@ -30,6 +33,8 @@ export type LoginInfoMap = {
30
33
  preferBatchedMode: boolean;
31
34
  };
32
35
  [WalletMode.Cardano]: BaseLoginInfo<CardanoApi>;
36
+ [WalletMode.Polkadot]: BaseLoginInfo<PolkadotApi>;
37
+ [WalletMode.Algorand]: BaseLoginInfo<AlgorandApi>;
33
38
  [WalletMode.Mina]: BaseLoginInfo<MinaApi>;
34
39
  [WalletMode.AvailJs]: {
35
40
  connection: ActiveConnection<ApiPromise>;
@@ -45,5 +50,6 @@ type ToUnion<T> = {
45
50
  }[keyof T];
46
51
  export type LoginInfo = ToUnion<LoginInfoMap>;
47
52
  export declare function connectInjected<Api>(typeName: string, loginInfo: BaseLoginInfo<Api>, connector: IInjectedConnector<Api>): Promise<Result<IProvider<Api>>>;
53
+ export declare function getAddressType(mode: WalletMode): AddressType;
48
54
  export {};
49
55
  //# sourceMappingURL=wallet-modes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-modes.d.ts","sourceRoot":"","sources":["../../../src/wallets/src/wallet-modes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,aAAa,CAAC,GAAG,IAAI;IAC/B,UAAU,CAAC,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IACzB,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG;QAChD,yFAAyF;QACzF,iBAAiB,EAAE,OAAO,CAAC;QAC3B;;;;;;WAMG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,KAAK,CAAC,EA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C,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IAClD,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;QACpB,UAAU,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzC,iBAAiB,EAAE,OAAO,CAAC;QAC3B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACnD,CAAC;AAEF,KAAK,OAAO,CAAC,CAAC,IAAI;KACf,CAAC,IAAI,MAAM,CAAC,GAAG;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CACnC,CAAC,MAAM,CAAC,CAAC,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAS9C,wBAAsB,eAAe,CAAC,GAAG,EACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,EAC7B,SAAS,EAAE,kBAAkB,CAAC,GAAG,CAAC,GACjC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,CAuBjC;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,CAuB5D"}
@@ -1,5 +1,5 @@
1
- // import type { PolkadotApi } from "./polkadot/polkadot.ts";
2
- import { connectInjectedWallet, } from "./utils.js";
1
+ import { connectInjectedWallet, WalletMode, } from "./utils.js";
2
+ import { AddressType } from "../../utils/src/mod.js";
3
3
  function getWalletName(info) {
4
4
  if (info.preference == null)
5
5
  return undefined;
@@ -24,3 +24,27 @@ export async function connectInjected(typeName, loginInfo, connector) {
24
24
  };
25
25
  }
26
26
  }
27
+ export function getAddressType(mode) {
28
+ switch (mode) {
29
+ case WalletMode.EvmInjected:
30
+ case WalletMode.EvmEthers:
31
+ return AddressType.EVM;
32
+ case WalletMode.Cardano:
33
+ return AddressType.CARDANO;
34
+ case WalletMode.Polkadot:
35
+ return AddressType.POLKADOT;
36
+ case WalletMode.Algorand:
37
+ return AddressType.ALGORAND;
38
+ case WalletMode.Mina:
39
+ return AddressType.MINA;
40
+ case WalletMode.Midnight:
41
+ return AddressType.MIDNIGHT;
42
+ case WalletMode.AvailJs:
43
+ return AddressType.AVAIL;
44
+ case WalletMode.Polkadot:
45
+ return AddressType.POLKADOT;
46
+ default:
47
+ throw new Error(`Unsupported wallet mode: ${mode}`);
48
+ }
49
+ }
50
+ ;
@@ -1,7 +1,7 @@
1
- // import { algorandLoginWrapper } from "./algorand/wrapper.ts";
1
+ import { algorandLoginWrapper } from "./algorand/wrapper.js";
2
2
  import { cardanoLoginWrapper } from "./cardano/wrapper.js";
3
3
  import { evmLoginWrapper } from "./evm/wrapper-injected.js";
4
- // import { polkadotLoginWrapper } from "./polkadot/wrapper.ts";
4
+ import { polkadotLoginWrapper } from "./polkadot/wrapper.js";
5
5
  import { ethersLoginWrapper } from "./evm/wrapper-ethers.js";
6
6
  import { minaLoginWrapper } from "./mina/wrapper.js";
7
7
  import { availJsLoginWrapper } from "./avail/wrapper.js";
@@ -32,13 +32,12 @@ async function login(loginInfo) {
32
32
  case WalletMode.Cardano: {
33
33
  return await cardanoLoginWrapper(loginInfo);
34
34
  }
35
- // TODO: Disabled as these did not compile with deno-vite or deno-fresh
36
- // case WalletMode.Polkadot: {
37
- // return await polkadotLoginWrapper(loginInfo);
38
- // }
39
- // case WalletMode.Algorand: {
40
- // return await algorandLoginWrapper(loginInfo);
41
- // }
35
+ case WalletMode.Polkadot: {
36
+ return await polkadotLoginWrapper(loginInfo);
37
+ }
38
+ case WalletMode.Algorand: {
39
+ return await algorandLoginWrapper(loginInfo);
40
+ }
42
41
  case WalletMode.Mina: {
43
42
  return await minaLoginWrapper(loginInfo);
44
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paimaexample/wallets",
3
- "version": "0.3.117",
3
+ "version": "0.3.120",
4
4
  "description": "Your package.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,15 +21,19 @@
21
21
  "scripts": {},
22
22
  "dependencies": {
23
23
  "@aurowallet/mina-provider": "^1.0.12",
24
+ "@cardano-foundation/cardano-verify-datasignature": "1.0.11",
24
25
  "@coderspirit/nominal": "^4.1.1",
25
- "@dcspark/cip34-js": "3.0.1",
26
26
  "@foxglove/crc": "^1.0.1",
27
27
  "@metamask/providers": "^22.1.0",
28
- "@midnight-ntwrk/onchain-runtime": "^0.3.0",
28
+ "@perawallet/connect": "^1.4.2",
29
+ "@polkadot/extension-dapp": "^0.58.10",
30
+ "@polkadot/extension-inject": "^0.58.10",
29
31
  "@polkadot/util": "^13.4.3",
32
+ "@polkadot/util-crypto": "^13.4.3",
30
33
  "@sinclair/typebox": "0.34.41",
31
34
  "@subsquid/ss58-codec": "^1.2.3",
32
35
  "abitype": "1.1.0",
36
+ "algosdk": "^3.4.0",
33
37
  "assert-never": "^1.4.0",
34
38
  "avail-js-sdk": "^0.4.2",
35
39
  "bech32": "^2.0.0",
@@ -41,6 +45,7 @@
41
45
  "js-base64": "^3.7.7",
42
46
  "js-sha3": "^0.9.3",
43
47
  "js-sha512": "^0.9.0",
48
+ "mina-signer": "^3.0.7",
44
49
  "mqtt": "^5.14.0",
45
50
  "mqtt-pattern": "^2.1.0",
46
51
  "viem": "2.37.3",
@@ -1 +1 @@
1
- {"version":3,"file":"batcher.d.ts","sourceRoot":"","sources":["../../../src/concise/src/batcher.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,SAAS,EACd,KAAK,cAAc,EAEnB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAmBhC,MAAM,WAAW,mBAAmB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BAAqB,EAAE,CA8BzE"}
@@ -8,20 +8,14 @@ exports.createMessageForBatcher = createMessageForBatcher;
8
8
  exports.hashBatchSubunit = hashBatchSubunit;
9
9
  exports.buildBatchData = buildBatchData;
10
10
  exports.extractBatches = extractBatches;
11
- const mod_js_1 = require("../../utils/src/mod.js");
11
+ const mod_js_1 = require("../../crypto/src/mod.js");
12
12
  const mod_js_2 = require("./v2/mod.js");
13
13
  const js_sha3_1 = __importDefault(require("js-sha3"));
14
- const value_1 = require("@sinclair/typebox/value");
15
14
  const { keccak_256 } = js_sha3_1.default;
16
15
  function createBatcherSubunit(millisecondTimestamp, _walletAddress, walletAddressType, signature, inputData) {
17
16
  let walletAddress;
18
- switch (walletAddressType) {
19
- case mod_js_1.AddressType.EVM:
20
- walletAddress = value_1.Value.Decode(mod_js_1.TypeboxHelpers.Evm.Address, _walletAddress);
21
- break;
22
- default:
23
- throw new Error("NYI: Unsupported wallet address type: " + walletAddressType);
24
- }
17
+ const cryptoManager = mod_js_1.CryptoManager.getCryptoManager(walletAddressType);
18
+ walletAddress = cryptoManager.decodeAddress(_walletAddress);
25
19
  return {
26
20
  addressType: walletAddressType,
27
21
  address: walletAddress,
@@ -32,14 +26,8 @@ function createBatcherSubunit(millisecondTimestamp, _walletAddress, walletAddres
32
26
  }
33
27
  /** This is what wallets sign when submitting a batch */
34
28
  function createMessageForBatcher(namespace, millisecondTimestamp, _walletAddress, walletAddressType, inputData, target = undefined) {
35
- let walletAddress;
36
- switch (walletAddressType) {
37
- case mod_js_1.AddressType.EVM:
38
- walletAddress = value_1.Value.Decode(mod_js_1.TypeboxHelpers.Evm.Address, _walletAddress);
39
- break;
40
- default:
41
- throw new Error("NYI: Unsupported wallet address type: " + walletAddressType);
42
- }
29
+ const cryptoManager = mod_js_1.CryptoManager.getCryptoManager(walletAddressType);
30
+ const walletAddress = cryptoManager.decodeAddress(_walletAddress);
43
31
  return ((namespace ?? "") + (target ?? "") + millisecondTimestamp +
44
32
  walletAddress + inputData)
45
33
  .replace(/[^a-zA-Z0-9]/g, "-")
@@ -53,14 +41,8 @@ function createMessageForBatcher(namespace, millisecondTimestamp, _walletAddress
53
41
  * So it contains the address indirectly
54
42
  */
55
43
  function hashBatchSubunit(input) {
56
- let walletAddress;
57
- switch (input.addressType) {
58
- case mod_js_1.AddressType.EVM:
59
- walletAddress = value_1.Value.Decode(mod_js_1.TypeboxHelpers.Evm.Address, input.address);
60
- break;
61
- default:
62
- throw new Error("NYI: Unsupported wallet address type: " + input.addressType);
63
- }
44
+ const cryptoManager = mod_js_1.CryptoManager.getCryptoManager(input.addressType);
45
+ const walletAddress = cryptoManager.decodeAddress(input.address);
64
46
  return "0x" +
65
47
  keccak_256(walletAddress + input.input + input.timestamp);
66
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/concise/src/delegate.ts"],"names":[],"mappings":"AAQA,OAAO,EACP,WAAW,EAGT,KAAK,UAAU,EAEf,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAGhC,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM;;;;yDAYtD;AAED,eAAO,MAAM,eAAe;8BAEZ,MAAM,iBACH,aAAa,kBACZ,OAAO;2CAOX,MAAM,iBACH,aAAa,gBACd,aAAa,GAAG,IAAI;CAIrC,CAAC;AAWF,eAAO,MAAM,WAAW,GACtB,SAAS,MAAM,EACf,YAAY,UAAU,2BAcvB,CAAC;AAEF,eAAO,MAAM,cAAc;yBACA,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC;4CAKxB,UAAU,6BACT,WAAW,wBAChB,UAAU,yBACT,WAAW,mBACjB,aAAa,eACjB,aAAa,aACf,MAAM,gBACH,OAAO,KACpB,OAAO,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;4BAmDxE,MAAM,KAChB,OAAO,CAAC,CAA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1D,UAAU,6BACT,WAAW,aAC3B,MAAM,kBACD,aAAa,qBACV,WAAW,eACjB,aAAa,GAAG,IAAI,kBACjB,WAAW,GAAG,IAAI,KACjC,OAAO,CAAC,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CA4BvF,CAAC"}
@@ -7,6 +7,7 @@ const accounts_1 = require("viem/accounts");
7
7
  const viem_1 = require("viem");
8
8
  const mod_js_2 = require("../../utils/src/mod.js");
9
9
  const value_1 = require("@sinclair/typebox/value");
10
+ const mod_js_3 = require("../../crypto/src/mod.js");
10
11
  function extractDelegateWallet(inputData) {
11
12
  const parsed = (0, mod_js_1.parseStmInput)(inputData, mod_js_1.BuiltinGrammar, mod_js_1.KeyedBuiltinGrammar);
12
13
  return parsed;
@@ -45,23 +46,10 @@ exports.accountPayload = {
45
46
  },
46
47
  // TODO This should use the Wallet connector to sign the message
47
48
  linkAddress: async (primaryAccountPrivateKey, primaryAccountAddressType, newAccountPrivateKey, newAccountAddressType, _primaryAddress, _newAddress, accountId, isNewPrimary) => {
48
- // TODO Unify for any wallet type.
49
- let primaryAddress;
50
- switch (primaryAccountAddressType) {
51
- case mod_js_2.AddressType.EVM:
52
- primaryAddress = value_1.Value.Decode(mod_js_2.TypeboxHelpers.Evm.Address, _primaryAddress);
53
- break;
54
- default:
55
- throw new Error("NYI: Primary account address type is not EVM");
56
- }
57
- let newAddress;
58
- switch (newAccountAddressType) {
59
- case mod_js_2.AddressType.EVM:
60
- newAddress = value_1.Value.Decode(mod_js_2.TypeboxHelpers.Evm.Address, _newAddress);
61
- break;
62
- default:
63
- throw new Error("NYI: New account address type is not EVM");
64
- }
49
+ const primaryCryptoManager = mod_js_3.CryptoManager.getCryptoManager(primaryAccountAddressType);
50
+ const primaryAddress = primaryCryptoManager.decodeAddress(_primaryAddress);
51
+ const newCryptoManager = mod_js_3.CryptoManager.getCryptoManager(newAccountAddressType);
52
+ const newAddress = newCryptoManager.decodeAddress(_newAddress);
65
53
  const signatureFromPrimary = await (0, exports.signMessage)(exports.accountMessages.linkAccount(accountId, newAddress, isNewPrimary), primaryAccountPrivateKey);
66
54
  const signatureFromNewAddress = await (0, exports.signMessage)(exports.accountMessages.linkAccount(accountId, primaryAddress, isNewPrimary), newAccountPrivateKey);
67
55
  return [
@@ -89,26 +77,14 @@ exports.accountPayload = {
89
77
  },
90
78
  // TODO This should use the Wallet connector to sign the message
91
79
  unlinkAddress: async (primaryAccountPrivateKey, primaryAccountAddressType, accountId, _targetAddress, targetAddressType, _newPrimary, newPrimaryType) => {
92
- // TODO Unify for any wallet type.
93
- let targetAddress;
94
- switch (targetAddressType) {
95
- case mod_js_2.AddressType.EVM:
96
- targetAddress = value_1.Value.Decode(mod_js_2.TypeboxHelpers.Evm.Address, _targetAddress);
97
- break;
98
- default:
99
- throw new Error("NYI: Target address type is not EVM");
100
- }
101
- let newPrimary = null;
102
- if (_newPrimary) {
103
- switch (newPrimaryType) {
104
- case mod_js_2.AddressType.EVM:
105
- newPrimary = value_1.Value.Decode(mod_js_2.TypeboxHelpers.Evm.Address, _newPrimary);
106
- break;
107
- default:
108
- throw new Error("NYI: New primary address type is not EVM");
109
- }
80
+ const targetCryptoManager = mod_js_3.CryptoManager.getCryptoManager(targetAddressType);
81
+ const targetAddress = targetCryptoManager.decodeAddress(_targetAddress);
82
+ let newPrimaryAddress = null;
83
+ if (_newPrimary && newPrimaryType !== null) {
84
+ const newPrimaryCryptoManager = mod_js_3.CryptoManager.getCryptoManager(newPrimaryType);
85
+ newPrimaryAddress = newPrimaryCryptoManager.decodeAddress(_newPrimary);
110
86
  }
111
- const signatureFromPrimary = await (0, exports.signMessage)(exports.accountMessages.unlinkAccountWithPrimary(accountId, targetAddress, newPrimary), primaryAccountPrivateKey);
87
+ const signatureFromPrimary = await (0, exports.signMessage)(exports.accountMessages.unlinkAccountWithPrimary(accountId, targetAddress, newPrimaryAddress), primaryAccountPrivateKey);
112
88
  return [
113
89
  mod_js_1.BuiltinGrammarPrefix.unlinkAddress,
114
90
  accountId,
@@ -116,7 +92,7 @@ exports.accountPayload = {
116
92
  primaryAccountAddressType,
117
93
  targetAddress,
118
94
  targetAddressType,
119
- newPrimary ?? "",
95
+ newPrimaryAddress ?? "",
120
96
  newPrimaryType ?? -1,
121
97
  ];
122
98
  },
@@ -11,7 +11,7 @@ export declare const BatcherInnerGrammar: {
11
11
  readonly "3": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").AlgorandAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
12
12
  readonly "4": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").MinaAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
13
13
  readonly "5": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").MidnightAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
14
- readonly "7": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").MinaAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
14
+ readonly "7": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").SubstrateAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
15
15
  };
16
16
  export declare const KeyedBuiltinBatcherInnerGrammar: import("../types.js").CommandTuples<{
17
17
  readonly "-1": readonly [["userAddress", import("@sinclair/typebox").TLiteral<"0x0">], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
@@ -22,6 +22,6 @@ export declare const KeyedBuiltinBatcherInnerGrammar: import("../types.js").Comm
22
22
  readonly "3": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").AlgorandAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
23
23
  readonly "4": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").MinaAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
24
24
  readonly "5": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").MidnightAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
25
- readonly "7": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").MinaAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
25
+ readonly "7": readonly [["userAddress", import("@sinclair/typebox").TUnsafe<import("../../../../utils/src/mod.js").SubstrateAddress>], readonly ["userSignature", import("@sinclair/typebox").TString], readonly ["conciseInput", import("@sinclair/typebox").TString], readonly ["millisecondTimestamp", import("@sinclair/typebox").TString]];
26
26
  }>;
27
27
  //# sourceMappingURL=batcher.d.ts.map