viem 2.53.1 → 2.54.1

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 (471) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/_cjs/actions/index.js +3 -2
  3. package/_cjs/actions/index.js.map +1 -1
  4. package/_cjs/actions/token/approve.js +62 -0
  5. package/_cjs/actions/token/approve.js.map +1 -0
  6. package/_cjs/actions/token/approveSync.js +25 -0
  7. package/_cjs/actions/token/approveSync.js.map +1 -0
  8. package/_cjs/actions/token/getAllowance.js +32 -0
  9. package/_cjs/actions/token/getAllowance.js.map +1 -0
  10. package/_cjs/actions/token/getBalance.js +41 -0
  11. package/_cjs/actions/token/getBalance.js.map +1 -0
  12. package/_cjs/actions/token/getMetadata.js +40 -0
  13. package/_cjs/actions/token/getMetadata.js.map +1 -0
  14. package/_cjs/actions/token/getTotalSupply.js +32 -0
  15. package/_cjs/actions/token/getTotalSupply.js.map +1 -0
  16. package/_cjs/actions/token/index.js +20 -0
  17. package/_cjs/actions/token/index.js.map +1 -0
  18. package/_cjs/actions/token/internal.js +125 -0
  19. package/_cjs/actions/token/internal.js.map +1 -0
  20. package/_cjs/actions/token/transfer.js +70 -0
  21. package/_cjs/actions/token/transfer.js.map +1 -0
  22. package/_cjs/actions/token/transferSync.js +25 -0
  23. package/_cjs/actions/token/transferSync.js.map +1 -0
  24. package/_cjs/chains/definitions/battlechain.js +31 -0
  25. package/_cjs/chains/definitions/battlechain.js.map +1 -0
  26. package/_cjs/chains/definitions/marooTestnet.js +30 -0
  27. package/_cjs/chains/definitions/marooTestnet.js.map +1 -0
  28. package/_cjs/chains/index.js +18 -14
  29. package/_cjs/chains/index.js.map +1 -1
  30. package/_cjs/clients/createClient.js +39 -1
  31. package/_cjs/clients/createClient.js.map +1 -1
  32. package/_cjs/clients/createPublicClient.js.map +1 -1
  33. package/_cjs/clients/createWalletClient.js.map +1 -1
  34. package/_cjs/clients/decorators/public.js +11 -0
  35. package/_cjs/clients/decorators/public.js.map +1 -1
  36. package/_cjs/clients/decorators/wallet.js +8 -0
  37. package/_cjs/clients/decorators/wallet.js.map +1 -1
  38. package/_cjs/clients/transports/http.js +2 -1
  39. package/_cjs/clients/transports/http.js.map +1 -1
  40. package/_cjs/errors/encoding.js +9 -1
  41. package/_cjs/errors/encoding.js.map +1 -1
  42. package/_cjs/errors/request.js +24 -1
  43. package/_cjs/errors/request.js.map +1 -1
  44. package/_cjs/errors/transaction.js +9 -1
  45. package/_cjs/errors/transaction.js.map +1 -1
  46. package/_cjs/errors/version.js +1 -1
  47. package/_cjs/index.js +9 -6
  48. package/_cjs/index.js.map +1 -1
  49. package/_cjs/tempo/Client.js +3 -1
  50. package/_cjs/tempo/Client.js.map +1 -1
  51. package/_cjs/tempo/Decorator.js +234 -215
  52. package/_cjs/tempo/Decorator.js.map +1 -1
  53. package/_cjs/tempo/actions/token.js +210 -112
  54. package/_cjs/tempo/actions/token.js.map +1 -1
  55. package/_cjs/tempo/internal/utils.js +108 -0
  56. package/_cjs/tempo/internal/utils.js.map +1 -1
  57. package/_cjs/tokens/defineToken.js +21 -0
  58. package/_cjs/tokens/defineToken.js.map +1 -0
  59. package/_cjs/tokens/definitions/alphausd.js +14 -0
  60. package/_cjs/tokens/definitions/alphausd.js.map +1 -0
  61. package/_cjs/tokens/definitions/betausd.js +14 -0
  62. package/_cjs/tokens/definitions/betausd.js.map +1 -0
  63. package/_cjs/tokens/definitions/brla.js +14 -0
  64. package/_cjs/tokens/definitions/brla.js.map +1 -0
  65. package/_cjs/tokens/definitions/cbbtc.js +14 -0
  66. package/_cjs/tokens/definitions/cbbtc.js.map +1 -0
  67. package/_cjs/tokens/definitions/chfau.js +14 -0
  68. package/_cjs/tokens/definitions/chfau.js.map +1 -0
  69. package/_cjs/tokens/definitions/cirbtc.js +16 -0
  70. package/_cjs/tokens/definitions/cirbtc.js.map +1 -0
  71. package/_cjs/tokens/definitions/cusd.js +14 -0
  72. package/_cjs/tokens/definitions/cusd.js.map +1 -0
  73. package/_cjs/tokens/definitions/dlusd.js +14 -0
  74. package/_cjs/tokens/definitions/dlusd.js.map +1 -0
  75. package/_cjs/tokens/definitions/eurau.js +14 -0
  76. package/_cjs/tokens/definitions/eurau.js.map +1 -0
  77. package/_cjs/tokens/definitions/eurc.js +24 -0
  78. package/_cjs/tokens/definitions/eurc.js.map +1 -0
  79. package/_cjs/tokens/definitions/eurce.js +15 -0
  80. package/_cjs/tokens/definitions/eurce.js.map +1 -0
  81. package/_cjs/tokens/definitions/frxusd.js +14 -0
  82. package/_cjs/tokens/definitions/frxusd.js.map +1 -0
  83. package/_cjs/tokens/definitions/gbpa.js +14 -0
  84. package/_cjs/tokens/definitions/gbpa.js.map +1 -0
  85. package/_cjs/tokens/definitions/gusd.js +14 -0
  86. package/_cjs/tokens/definitions/gusd.js.map +1 -0
  87. package/_cjs/tokens/definitions/iusd.js +14 -0
  88. package/_cjs/tokens/definitions/iusd.js.map +1 -0
  89. package/_cjs/tokens/definitions/pathusd.js +15 -0
  90. package/_cjs/tokens/definitions/pathusd.js.map +1 -0
  91. package/_cjs/tokens/definitions/reusd.js +14 -0
  92. package/_cjs/tokens/definitions/reusd.js.map +1 -0
  93. package/_cjs/tokens/definitions/rusd.js +14 -0
  94. package/_cjs/tokens/definitions/rusd.js.map +1 -0
  95. package/_cjs/tokens/definitions/sbc.js +14 -0
  96. package/_cjs/tokens/definitions/sbc.js.map +1 -0
  97. package/_cjs/tokens/definitions/siusd.js +14 -0
  98. package/_cjs/tokens/definitions/siusd.js.map +1 -0
  99. package/_cjs/tokens/definitions/stcusd.js +14 -0
  100. package/_cjs/tokens/definitions/stcusd.js.map +1 -0
  101. package/_cjs/tokens/definitions/susde.js +14 -0
  102. package/_cjs/tokens/definitions/susde.js.map +1 -0
  103. package/_cjs/tokens/definitions/syrupusdc.js +14 -0
  104. package/_cjs/tokens/definitions/syrupusdc.js.map +1 -0
  105. package/_cjs/tokens/definitions/thetausd.js +14 -0
  106. package/_cjs/tokens/definitions/thetausd.js.map +1 -0
  107. package/_cjs/tokens/definitions/usd1.js +14 -0
  108. package/_cjs/tokens/definitions/usd1.js.map +1 -0
  109. package/_cjs/tokens/definitions/usdb.js +14 -0
  110. package/_cjs/tokens/definitions/usdb.js.map +1 -0
  111. package/_cjs/tokens/definitions/usdc.js +59 -0
  112. package/_cjs/tokens/definitions/usdc.js.map +1 -0
  113. package/_cjs/tokens/definitions/usdce.js +15 -0
  114. package/_cjs/tokens/definitions/usdce.js.map +1 -0
  115. package/_cjs/tokens/definitions/usde.js +14 -0
  116. package/_cjs/tokens/definitions/usde.js.map +1 -0
  117. package/_cjs/tokens/definitions/usdt0.js +14 -0
  118. package/_cjs/tokens/definitions/usdt0.js.map +1 -0
  119. package/_cjs/tokens/definitions/usyc.js +18 -0
  120. package/_cjs/tokens/definitions/usyc.js.map +1 -0
  121. package/_cjs/tokens/definitions/wsrusd.js +14 -0
  122. package/_cjs/tokens/definitions/wsrusd.js.map +1 -0
  123. package/_cjs/tokens/index.js +72 -0
  124. package/_cjs/tokens/index.js.map +1 -0
  125. package/_cjs/tokens/sets.js +102 -0
  126. package/_cjs/tokens/sets.js.map +1 -0
  127. package/_cjs/utils/encoding/fromRlp.js +7 -4
  128. package/_cjs/utils/encoding/fromRlp.js.map +1 -1
  129. package/_cjs/utils/rpc/http.js +58 -3
  130. package/_cjs/utils/rpc/http.js.map +1 -1
  131. package/_cjs/utils/transaction/parseTransaction.js +4 -1
  132. package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
  133. package/_esm/actions/index.js +1 -0
  134. package/_esm/actions/index.js.map +1 -1
  135. package/_esm/actions/token/approve.js +123 -0
  136. package/_esm/actions/token/approve.js.map +1 -0
  137. package/_esm/actions/token/approveSync.js +50 -0
  138. package/_esm/actions/token/approveSync.js.map +1 -0
  139. package/_esm/actions/token/getAllowance.js +62 -0
  140. package/_esm/actions/token/getAllowance.js.map +1 -0
  141. package/_esm/actions/token/getBalance.js +70 -0
  142. package/_esm/actions/token/getBalance.js.map +1 -0
  143. package/_esm/actions/token/getMetadata.js +60 -0
  144. package/_esm/actions/token/getMetadata.js.map +1 -0
  145. package/_esm/actions/token/getTotalSupply.js +60 -0
  146. package/_esm/actions/token/getTotalSupply.js.map +1 -0
  147. package/_esm/actions/token/index.js +10 -0
  148. package/_esm/actions/token/index.js.map +1 -0
  149. package/_esm/actions/token/internal.js +188 -0
  150. package/_esm/actions/token/internal.js.map +1 -0
  151. package/_esm/actions/token/transfer.js +147 -0
  152. package/_esm/actions/token/transfer.js.map +1 -0
  153. package/_esm/actions/token/transferSync.js +54 -0
  154. package/_esm/actions/token/transferSync.js.map +1 -0
  155. package/_esm/chains/definitions/battlechain.js +28 -0
  156. package/_esm/chains/definitions/battlechain.js.map +1 -0
  157. package/_esm/chains/definitions/marooTestnet.js +27 -0
  158. package/_esm/chains/definitions/marooTestnet.js.map +1 -0
  159. package/_esm/chains/index.js +2 -0
  160. package/_esm/chains/index.js.map +1 -1
  161. package/_esm/clients/createClient.js +53 -1
  162. package/_esm/clients/createClient.js.map +1 -1
  163. package/_esm/clients/createPublicClient.js.map +1 -1
  164. package/_esm/clients/createWalletClient.js.map +1 -1
  165. package/_esm/clients/decorators/public.js +17 -0
  166. package/_esm/clients/decorators/public.js.map +1 -1
  167. package/_esm/clients/decorators/wallet.js +8 -0
  168. package/_esm/clients/decorators/wallet.js.map +1 -1
  169. package/_esm/clients/transports/http.js +2 -1
  170. package/_esm/clients/transports/http.js.map +1 -1
  171. package/_esm/errors/encoding.js +7 -0
  172. package/_esm/errors/encoding.js.map +1 -1
  173. package/_esm/errors/request.js +22 -0
  174. package/_esm/errors/request.js.map +1 -1
  175. package/_esm/errors/transaction.js +7 -0
  176. package/_esm/errors/transaction.js.map +1 -1
  177. package/_esm/errors/version.js +1 -1
  178. package/_esm/index.js +3 -3
  179. package/_esm/index.js.map +1 -1
  180. package/_esm/tempo/Client.js +3 -1
  181. package/_esm/tempo/Client.js.map +1 -1
  182. package/_esm/tempo/Decorator.js +234 -218
  183. package/_esm/tempo/Decorator.js.map +1 -1
  184. package/_esm/tempo/actions/token.js +335 -186
  185. package/_esm/tempo/actions/token.js.map +1 -1
  186. package/_esm/tempo/actions/wallet.js +1 -1
  187. package/_esm/tempo/internal/utils.js +154 -0
  188. package/_esm/tempo/internal/utils.js.map +1 -1
  189. package/_esm/tokens/defineToken.js +57 -0
  190. package/_esm/tokens/defineToken.js.map +1 -0
  191. package/_esm/tokens/definitions/alphausd.js +12 -0
  192. package/_esm/tokens/definitions/alphausd.js.map +1 -0
  193. package/_esm/tokens/definitions/betausd.js +12 -0
  194. package/_esm/tokens/definitions/betausd.js.map +1 -0
  195. package/_esm/tokens/definitions/brla.js +12 -0
  196. package/_esm/tokens/definitions/brla.js.map +1 -0
  197. package/_esm/tokens/definitions/cbbtc.js +12 -0
  198. package/_esm/tokens/definitions/cbbtc.js.map +1 -0
  199. package/_esm/tokens/definitions/chfau.js +12 -0
  200. package/_esm/tokens/definitions/chfau.js.map +1 -0
  201. package/_esm/tokens/definitions/cirbtc.js +21 -0
  202. package/_esm/tokens/definitions/cirbtc.js.map +1 -0
  203. package/_esm/tokens/definitions/cusd.js +12 -0
  204. package/_esm/tokens/definitions/cusd.js.map +1 -0
  205. package/_esm/tokens/definitions/dlusd.js +12 -0
  206. package/_esm/tokens/definitions/dlusd.js.map +1 -0
  207. package/_esm/tokens/definitions/eurau.js +12 -0
  208. package/_esm/tokens/definitions/eurau.js.map +1 -0
  209. package/_esm/tokens/definitions/eurc.js +29 -0
  210. package/_esm/tokens/definitions/eurc.js.map +1 -0
  211. package/_esm/tokens/definitions/eurce.js +13 -0
  212. package/_esm/tokens/definitions/eurce.js.map +1 -0
  213. package/_esm/tokens/definitions/frxusd.js +12 -0
  214. package/_esm/tokens/definitions/frxusd.js.map +1 -0
  215. package/_esm/tokens/definitions/gbpa.js +12 -0
  216. package/_esm/tokens/definitions/gbpa.js.map +1 -0
  217. package/_esm/tokens/definitions/gusd.js +12 -0
  218. package/_esm/tokens/definitions/gusd.js.map +1 -0
  219. package/_esm/tokens/definitions/iusd.js +12 -0
  220. package/_esm/tokens/definitions/iusd.js.map +1 -0
  221. package/_esm/tokens/definitions/pathusd.js +13 -0
  222. package/_esm/tokens/definitions/pathusd.js.map +1 -0
  223. package/_esm/tokens/definitions/reusd.js +12 -0
  224. package/_esm/tokens/definitions/reusd.js.map +1 -0
  225. package/_esm/tokens/definitions/rusd.js +12 -0
  226. package/_esm/tokens/definitions/rusd.js.map +1 -0
  227. package/_esm/tokens/definitions/sbc.js +12 -0
  228. package/_esm/tokens/definitions/sbc.js.map +1 -0
  229. package/_esm/tokens/definitions/siusd.js +12 -0
  230. package/_esm/tokens/definitions/siusd.js.map +1 -0
  231. package/_esm/tokens/definitions/stcusd.js +12 -0
  232. package/_esm/tokens/definitions/stcusd.js.map +1 -0
  233. package/_esm/tokens/definitions/susde.js +12 -0
  234. package/_esm/tokens/definitions/susde.js.map +1 -0
  235. package/_esm/tokens/definitions/syrupusdc.js +12 -0
  236. package/_esm/tokens/definitions/syrupusdc.js.map +1 -0
  237. package/_esm/tokens/definitions/thetausd.js +12 -0
  238. package/_esm/tokens/definitions/thetausd.js.map +1 -0
  239. package/_esm/tokens/definitions/usd1.js +12 -0
  240. package/_esm/tokens/definitions/usd1.js.map +1 -0
  241. package/_esm/tokens/definitions/usdb.js +12 -0
  242. package/_esm/tokens/definitions/usdb.js.map +1 -0
  243. package/_esm/tokens/definitions/usdc.js +85 -0
  244. package/_esm/tokens/definitions/usdc.js.map +1 -0
  245. package/_esm/tokens/definitions/usdce.js +13 -0
  246. package/_esm/tokens/definitions/usdce.js.map +1 -0
  247. package/_esm/tokens/definitions/usde.js +12 -0
  248. package/_esm/tokens/definitions/usde.js.map +1 -0
  249. package/_esm/tokens/definitions/usdt0.js +12 -0
  250. package/_esm/tokens/definitions/usdt0.js.map +1 -0
  251. package/_esm/tokens/definitions/usyc.js +23 -0
  252. package/_esm/tokens/definitions/usyc.js.map +1 -0
  253. package/_esm/tokens/definitions/wsrusd.js +12 -0
  254. package/_esm/tokens/definitions/wsrusd.js.map +1 -0
  255. package/_esm/tokens/index.js +36 -0
  256. package/_esm/tokens/index.js.map +1 -0
  257. package/_esm/tokens/sets.js +104 -0
  258. package/_esm/tokens/sets.js.map +1 -0
  259. package/_esm/utils/encoding/fromRlp.js +8 -5
  260. package/_esm/utils/encoding/fromRlp.js.map +1 -1
  261. package/_esm/utils/rpc/http.js +59 -4
  262. package/_esm/utils/rpc/http.js.map +1 -1
  263. package/_esm/utils/transaction/parseTransaction.js +5 -2
  264. package/_esm/utils/transaction/parseTransaction.js.map +1 -1
  265. package/_types/actions/index.d.ts +1 -0
  266. package/_types/actions/index.d.ts.map +1 -1
  267. package/_types/actions/token/approve.d.ts +253 -0
  268. package/_types/actions/token/approve.d.ts.map +1 -0
  269. package/_types/actions/token/approveSync.d.ts +57 -0
  270. package/_types/actions/token/approveSync.d.ts.map +1 -0
  271. package/_types/actions/token/getAllowance.d.ts +77 -0
  272. package/_types/actions/token/getAllowance.d.ts.map +1 -0
  273. package/_types/actions/token/getBalance.d.ts +69 -0
  274. package/_types/actions/token/getBalance.d.ts.map +1 -0
  275. package/_types/actions/token/getMetadata.d.ts +43 -0
  276. package/_types/actions/token/getMetadata.d.ts.map +1 -0
  277. package/_types/actions/token/getTotalSupply.d.ts +63 -0
  278. package/_types/actions/token/getTotalSupply.d.ts.map +1 -0
  279. package/_types/actions/token/index.d.ts +9 -0
  280. package/_types/actions/token/index.d.ts.map +1 -0
  281. package/_types/actions/token/internal.d.ts +168 -0
  282. package/_types/actions/token/internal.d.ts.map +1 -0
  283. package/_types/actions/token/transfer.d.ts +288 -0
  284. package/_types/actions/token/transfer.d.ts.map +1 -0
  285. package/_types/actions/token/transferSync.d.ts +61 -0
  286. package/_types/actions/token/transferSync.d.ts.map +1 -0
  287. package/_types/chains/definitions/battlechain.d.ts +447 -0
  288. package/_types/chains/definitions/battlechain.d.ts.map +1 -0
  289. package/_types/chains/definitions/marooTestnet.d.ts +49 -0
  290. package/_types/chains/definitions/marooTestnet.d.ts.map +1 -0
  291. package/_types/chains/index.d.ts +2 -0
  292. package/_types/chains/index.d.ts.map +1 -1
  293. package/_types/clients/createClient.d.ts +24 -6
  294. package/_types/clients/createClient.d.ts.map +1 -1
  295. package/_types/clients/createPublicClient.d.ts +4 -3
  296. package/_types/clients/createPublicClient.d.ts.map +1 -1
  297. package/_types/clients/createWalletClient.d.ts +4 -3
  298. package/_types/clients/createWalletClient.d.ts.map +1 -1
  299. package/_types/clients/decorators/public.d.ts +128 -3
  300. package/_types/clients/decorators/public.d.ts.map +1 -1
  301. package/_types/clients/decorators/wallet.d.ts +208 -3
  302. package/_types/clients/decorators/wallet.d.ts.map +1 -1
  303. package/_types/clients/transports/http.d.ts +2 -0
  304. package/_types/clients/transports/http.d.ts.map +1 -1
  305. package/_types/errors/encoding.d.ts +8 -0
  306. package/_types/errors/encoding.d.ts.map +1 -1
  307. package/_types/errors/request.d.ts +11 -0
  308. package/_types/errors/request.d.ts.map +1 -1
  309. package/_types/errors/transaction.d.ts +8 -0
  310. package/_types/errors/transaction.d.ts.map +1 -1
  311. package/_types/errors/version.d.ts +1 -1
  312. package/_types/index.d.ts +4 -3
  313. package/_types/index.d.ts.map +1 -1
  314. package/_types/tempo/Client.d.ts +1 -1
  315. package/_types/tempo/Client.d.ts.map +1 -1
  316. package/_types/tempo/Decorator.d.ts +88 -5
  317. package/_types/tempo/Decorator.d.ts.map +1 -1
  318. package/_types/tempo/actions/token.d.ts +223 -151
  319. package/_types/tempo/actions/token.d.ts.map +1 -1
  320. package/_types/tempo/actions/wallet.d.ts +3 -3
  321. package/_types/tempo/internal/types.d.ts +17 -0
  322. package/_types/tempo/internal/types.d.ts.map +1 -1
  323. package/_types/tempo/internal/utils.d.ts +73 -0
  324. package/_types/tempo/internal/utils.d.ts.map +1 -1
  325. package/_types/tokens/defineToken.d.ts +112 -0
  326. package/_types/tokens/defineToken.d.ts.map +1 -0
  327. package/_types/tokens/definitions/alphausd.d.ts +11 -0
  328. package/_types/tokens/definitions/alphausd.d.ts.map +1 -0
  329. package/_types/tokens/definitions/betausd.d.ts +11 -0
  330. package/_types/tokens/definitions/betausd.d.ts.map +1 -0
  331. package/_types/tokens/definitions/brla.d.ts +11 -0
  332. package/_types/tokens/definitions/brla.d.ts.map +1 -0
  333. package/_types/tokens/definitions/cbbtc.d.ts +11 -0
  334. package/_types/tokens/definitions/cbbtc.d.ts.map +1 -0
  335. package/_types/tokens/definitions/chfau.d.ts +11 -0
  336. package/_types/tokens/definitions/chfau.d.ts.map +1 -0
  337. package/_types/tokens/definitions/cirbtc.d.ts +21 -0
  338. package/_types/tokens/definitions/cirbtc.d.ts.map +1 -0
  339. package/_types/tokens/definitions/cusd.d.ts +11 -0
  340. package/_types/tokens/definitions/cusd.d.ts.map +1 -0
  341. package/_types/tokens/definitions/dlusd.d.ts +11 -0
  342. package/_types/tokens/definitions/dlusd.d.ts.map +1 -0
  343. package/_types/tokens/definitions/eurau.d.ts +11 -0
  344. package/_types/tokens/definitions/eurau.d.ts.map +1 -0
  345. package/_types/tokens/definitions/eurc.d.ts +29 -0
  346. package/_types/tokens/definitions/eurc.d.ts.map +1 -0
  347. package/_types/tokens/definitions/eurce.d.ts +12 -0
  348. package/_types/tokens/definitions/eurce.d.ts.map +1 -0
  349. package/_types/tokens/definitions/frxusd.d.ts +11 -0
  350. package/_types/tokens/definitions/frxusd.d.ts.map +1 -0
  351. package/_types/tokens/definitions/gbpa.d.ts +11 -0
  352. package/_types/tokens/definitions/gbpa.d.ts.map +1 -0
  353. package/_types/tokens/definitions/gusd.d.ts +11 -0
  354. package/_types/tokens/definitions/gusd.d.ts.map +1 -0
  355. package/_types/tokens/definitions/iusd.d.ts +11 -0
  356. package/_types/tokens/definitions/iusd.d.ts.map +1 -0
  357. package/_types/tokens/definitions/pathusd.d.ts +12 -0
  358. package/_types/tokens/definitions/pathusd.d.ts.map +1 -0
  359. package/_types/tokens/definitions/reusd.d.ts +11 -0
  360. package/_types/tokens/definitions/reusd.d.ts.map +1 -0
  361. package/_types/tokens/definitions/rusd.d.ts +11 -0
  362. package/_types/tokens/definitions/rusd.d.ts.map +1 -0
  363. package/_types/tokens/definitions/sbc.d.ts +11 -0
  364. package/_types/tokens/definitions/sbc.d.ts.map +1 -0
  365. package/_types/tokens/definitions/siusd.d.ts +11 -0
  366. package/_types/tokens/definitions/siusd.d.ts.map +1 -0
  367. package/_types/tokens/definitions/stcusd.d.ts +11 -0
  368. package/_types/tokens/definitions/stcusd.d.ts.map +1 -0
  369. package/_types/tokens/definitions/susde.d.ts +11 -0
  370. package/_types/tokens/definitions/susde.d.ts.map +1 -0
  371. package/_types/tokens/definitions/syrupusdc.d.ts +11 -0
  372. package/_types/tokens/definitions/syrupusdc.d.ts.map +1 -0
  373. package/_types/tokens/definitions/thetausd.d.ts +11 -0
  374. package/_types/tokens/definitions/thetausd.d.ts.map +1 -0
  375. package/_types/tokens/definitions/usd1.d.ts +11 -0
  376. package/_types/tokens/definitions/usd1.d.ts.map +1 -0
  377. package/_types/tokens/definitions/usdb.d.ts +11 -0
  378. package/_types/tokens/definitions/usdb.d.ts.map +1 -0
  379. package/_types/tokens/definitions/usdc.d.ts +85 -0
  380. package/_types/tokens/definitions/usdc.d.ts.map +1 -0
  381. package/_types/tokens/definitions/usdce.d.ts +12 -0
  382. package/_types/tokens/definitions/usdce.d.ts.map +1 -0
  383. package/_types/tokens/definitions/usde.d.ts +11 -0
  384. package/_types/tokens/definitions/usde.d.ts.map +1 -0
  385. package/_types/tokens/definitions/usdt0.d.ts +11 -0
  386. package/_types/tokens/definitions/usdt0.d.ts.map +1 -0
  387. package/_types/tokens/definitions/usyc.d.ts +23 -0
  388. package/_types/tokens/definitions/usyc.d.ts.map +1 -0
  389. package/_types/tokens/definitions/wsrusd.d.ts +11 -0
  390. package/_types/tokens/definitions/wsrusd.d.ts.map +1 -0
  391. package/_types/tokens/index.d.ts +35 -0
  392. package/_types/tokens/index.d.ts.map +1 -0
  393. package/_types/tokens/sets.d.ts +607 -0
  394. package/_types/tokens/sets.d.ts.map +1 -0
  395. package/_types/utils/encoding/fromRlp.d.ts +2 -2
  396. package/_types/utils/encoding/fromRlp.d.ts.map +1 -1
  397. package/_types/utils/rpc/http.d.ts +6 -2
  398. package/_types/utils/rpc/http.d.ts.map +1 -1
  399. package/_types/utils/transaction/parseTransaction.d.ts +2 -2
  400. package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
  401. package/actions/index.ts +1 -0
  402. package/actions/token/approve.ts +202 -0
  403. package/actions/token/approveSync.ts +95 -0
  404. package/actions/token/getAllowance.ts +105 -0
  405. package/actions/token/getBalance.ts +115 -0
  406. package/actions/token/getMetadata.ts +98 -0
  407. package/actions/token/getTotalSupply.ts +97 -0
  408. package/actions/token/index.ts +9 -0
  409. package/actions/token/internal.ts +367 -0
  410. package/actions/token/transfer.ts +230 -0
  411. package/actions/token/transferSync.ts +99 -0
  412. package/chains/definitions/battlechain.ts +28 -0
  413. package/chains/definitions/marooTestnet.ts +27 -0
  414. package/chains/index.ts +2 -0
  415. package/clients/createClient.ts +90 -8
  416. package/clients/createPublicClient.ts +22 -4
  417. package/clients/createWalletClient.ts +22 -4
  418. package/clients/decorators/public.ts +166 -4
  419. package/clients/decorators/wallet.ts +242 -3
  420. package/clients/transports/http.ts +4 -0
  421. package/errors/encoding.ts +11 -0
  422. package/errors/request.ts +17 -0
  423. package/errors/transaction.ts +11 -0
  424. package/errors/version.ts +1 -1
  425. package/index.ts +7 -0
  426. package/package.json +6 -1
  427. package/tempo/Client.ts +7 -3
  428. package/tempo/Decorator.ts +398 -337
  429. package/tempo/actions/token.ts +519 -296
  430. package/tempo/actions/wallet.ts +3 -3
  431. package/tempo/internal/types.ts +19 -0
  432. package/tempo/internal/utils.ts +204 -0
  433. package/tokens/defineToken.ts +142 -0
  434. package/tokens/definitions/alphausd.ts +13 -0
  435. package/tokens/definitions/betausd.ts +13 -0
  436. package/tokens/definitions/brla.ts +13 -0
  437. package/tokens/definitions/cbbtc.ts +13 -0
  438. package/tokens/definitions/chfau.ts +13 -0
  439. package/tokens/definitions/cirbtc.ts +21 -0
  440. package/tokens/definitions/cusd.ts +13 -0
  441. package/tokens/definitions/dlusd.ts +13 -0
  442. package/tokens/definitions/eurau.ts +13 -0
  443. package/tokens/definitions/eurc.ts +29 -0
  444. package/tokens/definitions/eurce.ts +14 -0
  445. package/tokens/definitions/frxusd.ts +13 -0
  446. package/tokens/definitions/gbpa.ts +13 -0
  447. package/tokens/definitions/gusd.ts +13 -0
  448. package/tokens/definitions/iusd.ts +13 -0
  449. package/tokens/definitions/pathusd.ts +14 -0
  450. package/tokens/definitions/reusd.ts +13 -0
  451. package/tokens/definitions/rusd.ts +13 -0
  452. package/tokens/definitions/sbc.ts +13 -0
  453. package/tokens/definitions/siusd.ts +13 -0
  454. package/tokens/definitions/stcusd.ts +13 -0
  455. package/tokens/definitions/susde.ts +13 -0
  456. package/tokens/definitions/syrupusdc.ts +13 -0
  457. package/tokens/definitions/thetausd.ts +13 -0
  458. package/tokens/definitions/usd1.ts +13 -0
  459. package/tokens/definitions/usdb.ts +13 -0
  460. package/tokens/definitions/usdc.ts +85 -0
  461. package/tokens/definitions/usdce.ts +14 -0
  462. package/tokens/definitions/usde.ts +13 -0
  463. package/tokens/definitions/usdt0.ts +13 -0
  464. package/tokens/definitions/usyc.ts +23 -0
  465. package/tokens/definitions/wsrusd.ts +13 -0
  466. package/tokens/index.ts +35 -0
  467. package/tokens/package.json +6 -0
  468. package/tokens/sets.ts +109 -0
  469. package/utils/encoding/fromRlp.ts +22 -3
  470. package/utils/rpc/http.ts +70 -2
  471. package/utils/transaction/parseTransaction.ts +7 -2
@@ -0,0 +1,288 @@
1
+ import type { Address } from 'abitype';
2
+ import type { Account } from '../../accounts/types.js';
3
+ import type { Client } from '../../clients/createClient.js';
4
+ import type { Transport } from '../../clients/transports/createTransport.js';
5
+ import { erc20Abi } from '../../constants/abis.js';
6
+ import type { BaseErrorType } from '../../errors/base.js';
7
+ import type { Tokens } from '../../tokens/defineToken.js';
8
+ import type { Chain } from '../../types/chain.js';
9
+ import type { Log } from '../../types/log.js';
10
+ import { type SimulateContractReturnType } from '../public/simulateContract.js';
11
+ import type { WriteContractReturnType } from '../wallet/writeContract.js';
12
+ import { writeContract } from '../wallet/writeContract.js';
13
+ import type { writeContractSync } from '../wallet/writeContractSync.js';
14
+ import { type AmountInput, type TokenParameter, type WriteParameters } from './internal.js';
15
+ /**
16
+ * Transfers ERC-20 tokens to another address.
17
+ *
18
+ * Pass `from` to transfer on behalf of another address using an allowance
19
+ * (calls `transferFrom`); otherwise transfers from the caller (calls
20
+ * `transfer`).
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { createClient, http } from 'viem'
25
+ * import { mainnet } from 'viem/chains'
26
+ * import { privateKeyToAccount } from 'viem/accounts'
27
+ * import { token } from 'viem/actions'
28
+ *
29
+ * const client = createClient({
30
+ * account: privateKeyToAccount('0x...'),
31
+ * chain: mainnet,
32
+ * transport: http(),
33
+ * })
34
+ *
35
+ * const hash = await token.transfer(client, {
36
+ * amount: 100000000n,
37
+ * to: '0x...',
38
+ * token: '0x...',
39
+ * })
40
+ * ```
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * // Transfer on behalf of another address (via an allowance).
45
+ * const hash = await token.transfer(client, {
46
+ * amount: 100000000n,
47
+ * from: '0x...',
48
+ * to: '0x...',
49
+ * token: '0x...',
50
+ * })
51
+ * ```
52
+ *
53
+ * @param client - Client.
54
+ * @param parameters - Parameters.
55
+ * @returns The transaction hash.
56
+ */
57
+ export declare function transfer<chain extends Chain | undefined, account extends Account | undefined, tokens extends Tokens | undefined = undefined>(client: Client<Transport, chain, account, undefined, undefined, tokens>, parameters: transfer.Parameters<chain, account, tokens>): Promise<transfer.ReturnValue>;
58
+ export declare namespace transfer {
59
+ type Args<chain extends Chain | undefined = Chain | undefined, tokens extends Tokens | undefined = Tokens | undefined> = {
60
+ /** Amount to transfer in base units, or as a formatted helper. */
61
+ amount: AmountInput;
62
+ /** Address to transfer tokens from (uses an allowance via `transferFrom`). */
63
+ from?: Address | undefined;
64
+ /** Address to transfer tokens to. */
65
+ to: Address;
66
+ } & TokenParameter<chain, tokens>;
67
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, tokens extends Tokens | undefined = Tokens | undefined> = WriteParameters<chain, account> & Args<chain, tokens>;
68
+ type ReturnValue = WriteContractReturnType;
69
+ type ErrorType = BaseErrorType;
70
+ /** @internal */
71
+ function inner<action extends typeof writeContract | typeof writeContractSync, chain extends Chain | undefined, account extends Account | undefined, tokens extends Tokens | undefined = undefined>(action: action, client: Client<Transport, chain, account, undefined, undefined, tokens>, parameters: transfer.Parameters<chain, account, tokens>): Promise<ReturnType<action>>;
72
+ /**
73
+ * Defines a call to the `transfer` (or `transferFrom`, when `from` is given)
74
+ * function.
75
+ *
76
+ * Can be passed as a parameter to `estimateContractGas`, `simulateContract`,
77
+ * `sendCalls`, `sendTransaction` (`calls`), or `multicall`. The token is
78
+ * selected by `token`, which is either a token symbol (resolved from the
79
+ * client's `tokens` array) or a contract `address`; `amount.decimals`
80
+ * is inferred from declared client tokens when omitted.
81
+ *
82
+ * @param client - Client.
83
+ * @param parameters - Parameters.
84
+ * @returns The call.
85
+ */
86
+ function call<chain extends Chain | undefined, account extends Account | undefined, tokens extends Tokens | undefined = undefined>(client: Client<Transport, chain, account, undefined, undefined, tokens>, parameters: Args<chain, tokens>): {
87
+ abi: [{
88
+ readonly type: "function";
89
+ readonly name: "transfer";
90
+ readonly stateMutability: "nonpayable";
91
+ readonly inputs: readonly [{
92
+ readonly name: "recipient";
93
+ readonly type: "address";
94
+ }, {
95
+ readonly name: "amount";
96
+ readonly type: "uint256";
97
+ }];
98
+ readonly outputs: readonly [{
99
+ readonly type: "bool";
100
+ }];
101
+ } | {
102
+ readonly type: "function";
103
+ readonly name: "transferFrom";
104
+ readonly stateMutability: "nonpayable";
105
+ readonly inputs: readonly [{
106
+ readonly name: "sender";
107
+ readonly type: "address";
108
+ }, {
109
+ readonly name: "recipient";
110
+ readonly type: "address";
111
+ }, {
112
+ readonly name: "amount";
113
+ readonly type: "uint256";
114
+ }];
115
+ readonly outputs: readonly [{
116
+ readonly type: "bool";
117
+ }];
118
+ }];
119
+ functionName: "transfer" | "transferFrom";
120
+ } & {
121
+ args: readonly [recipient: `0x${string}`, amount: bigint] | readonly [sender: `0x${string}`, recipient: `0x${string}`, amount: bigint];
122
+ } & {
123
+ address: Address;
124
+ } & {
125
+ data: import("../../index.js").Hex;
126
+ to: Address;
127
+ };
128
+ /**
129
+ * Estimates the gas required to transfer ERC-20 tokens. `amount.decimals` is
130
+ * inferred from declared client tokens when omitted.
131
+ *
132
+ * @param client - Client.
133
+ * @param parameters - Parameters.
134
+ * @returns The gas estimate.
135
+ */
136
+ function estimateGas<chain extends Chain | undefined, account extends Account | undefined, tokens extends Tokens | undefined = undefined>(client: Client<Transport, chain, account, undefined, undefined, tokens>, parameters: transfer.Parameters<chain, account, tokens>): Promise<bigint>;
137
+ /**
138
+ * Simulates a transfer of ERC-20 tokens. `amount.decimals` is inferred from
139
+ * declared client tokens when omitted.
140
+ *
141
+ * @param client - Client.
142
+ * @param parameters - Parameters.
143
+ * @returns The simulation result and write request.
144
+ */
145
+ function simulate<chain extends Chain | undefined, account extends Account | undefined, tokens extends Tokens | undefined = undefined>(client: Client<Transport, chain, account, undefined, undefined, tokens>, parameters: transfer.Parameters<chain, account, tokens>): Promise<SimulateContractReturnType<typeof erc20Abi, 'transfer' | 'transferFrom'>>;
146
+ /**
147
+ * Extracts the `Transfer` event from logs.
148
+ *
149
+ * @param logs - The logs.
150
+ * @returns The `Transfer` event.
151
+ */
152
+ function extractEvent(logs: Log[]): Log<bigint, number, false, undefined, true, readonly [{
153
+ readonly type: "event";
154
+ readonly name: "Approval";
155
+ readonly inputs: readonly [{
156
+ readonly indexed: true;
157
+ readonly name: "owner";
158
+ readonly type: "address";
159
+ }, {
160
+ readonly indexed: true;
161
+ readonly name: "spender";
162
+ readonly type: "address";
163
+ }, {
164
+ readonly indexed: false;
165
+ readonly name: "value";
166
+ readonly type: "uint256";
167
+ }];
168
+ }, {
169
+ readonly type: "event";
170
+ readonly name: "Transfer";
171
+ readonly inputs: readonly [{
172
+ readonly indexed: true;
173
+ readonly name: "from";
174
+ readonly type: "address";
175
+ }, {
176
+ readonly indexed: true;
177
+ readonly name: "to";
178
+ readonly type: "address";
179
+ }, {
180
+ readonly indexed: false;
181
+ readonly name: "value";
182
+ readonly type: "uint256";
183
+ }];
184
+ }, {
185
+ readonly type: "function";
186
+ readonly name: "allowance";
187
+ readonly stateMutability: "view";
188
+ readonly inputs: readonly [{
189
+ readonly name: "owner";
190
+ readonly type: "address";
191
+ }, {
192
+ readonly name: "spender";
193
+ readonly type: "address";
194
+ }];
195
+ readonly outputs: readonly [{
196
+ readonly type: "uint256";
197
+ }];
198
+ }, {
199
+ readonly type: "function";
200
+ readonly name: "approve";
201
+ readonly stateMutability: "nonpayable";
202
+ readonly inputs: readonly [{
203
+ readonly name: "spender";
204
+ readonly type: "address";
205
+ }, {
206
+ readonly name: "amount";
207
+ readonly type: "uint256";
208
+ }];
209
+ readonly outputs: readonly [{
210
+ readonly type: "bool";
211
+ }];
212
+ }, {
213
+ readonly type: "function";
214
+ readonly name: "balanceOf";
215
+ readonly stateMutability: "view";
216
+ readonly inputs: readonly [{
217
+ readonly name: "account";
218
+ readonly type: "address";
219
+ }];
220
+ readonly outputs: readonly [{
221
+ readonly type: "uint256";
222
+ }];
223
+ }, {
224
+ readonly type: "function";
225
+ readonly name: "decimals";
226
+ readonly stateMutability: "view";
227
+ readonly inputs: readonly [];
228
+ readonly outputs: readonly [{
229
+ readonly type: "uint8";
230
+ }];
231
+ }, {
232
+ readonly type: "function";
233
+ readonly name: "name";
234
+ readonly stateMutability: "view";
235
+ readonly inputs: readonly [];
236
+ readonly outputs: readonly [{
237
+ readonly type: "string";
238
+ }];
239
+ }, {
240
+ readonly type: "function";
241
+ readonly name: "symbol";
242
+ readonly stateMutability: "view";
243
+ readonly inputs: readonly [];
244
+ readonly outputs: readonly [{
245
+ readonly type: "string";
246
+ }];
247
+ }, {
248
+ readonly type: "function";
249
+ readonly name: "totalSupply";
250
+ readonly stateMutability: "view";
251
+ readonly inputs: readonly [];
252
+ readonly outputs: readonly [{
253
+ readonly type: "uint256";
254
+ }];
255
+ }, {
256
+ readonly type: "function";
257
+ readonly name: "transfer";
258
+ readonly stateMutability: "nonpayable";
259
+ readonly inputs: readonly [{
260
+ readonly name: "recipient";
261
+ readonly type: "address";
262
+ }, {
263
+ readonly name: "amount";
264
+ readonly type: "uint256";
265
+ }];
266
+ readonly outputs: readonly [{
267
+ readonly type: "bool";
268
+ }];
269
+ }, {
270
+ readonly type: "function";
271
+ readonly name: "transferFrom";
272
+ readonly stateMutability: "nonpayable";
273
+ readonly inputs: readonly [{
274
+ readonly name: "sender";
275
+ readonly type: "address";
276
+ }, {
277
+ readonly name: "recipient";
278
+ readonly type: "address";
279
+ }, {
280
+ readonly name: "amount";
281
+ readonly type: "uint256";
282
+ }];
283
+ readonly outputs: readonly [{
284
+ readonly type: "bool";
285
+ }];
286
+ }], "Transfer">;
287
+ }
288
+ //# sourceMappingURL=transfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../actions/token/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAGhC;IAED;;;;;;;OAOG;IACH,SAAsB,WAAW,CAC/B,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,EACnC,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAE7C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EACvE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GACtD,OAAO,CAAC,MAAM,CAAC,CAKjB;IAED;;;;;;;OAOG;IACH,SAAsB,QAAQ,CAC5B,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,EACnC,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAE7C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EACvE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,GACtD,OAAO,CACR,0BAA0B,CAAC,OAAO,QAAQ,EAAE,UAAU,GAAG,cAAc,CAAC,CACzE,CAKA;IAED;;;;;OAKG;IACH,SAAgB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBASvC;CACF"}
@@ -0,0 +1,61 @@
1
+ import type { Account } from '../../accounts/types.js';
2
+ import type { Client } from '../../clients/createClient.js';
3
+ import type { Transport } from '../../clients/transports/createTransport.js';
4
+ import type { erc20Abi } from '../../constants/abis.js';
5
+ import type { BaseErrorType } from '../../errors/base.js';
6
+ import type { Tokens } from '../../tokens/defineToken.js';
7
+ import type { Chain } from '../../types/chain.js';
8
+ import type { GetEventArgs } from '../../types/contract.js';
9
+ import type { TransactionReceipt } from '../../types/transaction.js';
10
+ import type { Compute } from '../../types/utils.js';
11
+ import { transfer } from './transfer.js';
12
+ /**
13
+ * Transfers ERC-20 tokens to another address, and waits for the transaction to
14
+ * be confirmed.
15
+ *
16
+ * Pass `from` to transfer on behalf of another address using an allowance
17
+ * (calls `transferFrom`); otherwise transfers from the caller (calls
18
+ * `transfer`).
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import { createClient, http } from 'viem'
23
+ * import { mainnet } from 'viem/chains'
24
+ * import { privateKeyToAccount } from 'viem/accounts'
25
+ * import { token } from 'viem/actions'
26
+ *
27
+ * const client = createClient({
28
+ * account: privateKeyToAccount('0x...'),
29
+ * chain: mainnet,
30
+ * transport: http(),
31
+ * })
32
+ *
33
+ * const { receipt, ...event } = await token.transferSync(client, {
34
+ * amount: 100000000n,
35
+ * to: '0x...',
36
+ * token: '0x...',
37
+ * })
38
+ * ```
39
+ *
40
+ * @param client - Client.
41
+ * @param parameters - Parameters.
42
+ * @returns The transaction receipt and event data.
43
+ */
44
+ export declare function transferSync<chain extends Chain | undefined, account extends Account | undefined, tokens extends Tokens | undefined = undefined>(client: Client<Transport, chain, account, undefined, undefined, tokens>, parameters: transferSync.Parameters<chain, account, tokens>): Promise<transferSync.ReturnValue>;
45
+ export declare namespace transferSync {
46
+ type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, tokens extends Tokens | undefined = Tokens | undefined> = transfer.Parameters<chain, account, tokens>;
47
+ type Args<chain extends Chain | undefined = Chain | undefined, tokens extends Tokens | undefined = Tokens | undefined> = transfer.Args<chain, tokens>;
48
+ type ReturnValue = Compute<GetEventArgs<typeof erc20Abi, 'Transfer', {
49
+ IndexedOnly: false;
50
+ Required: true;
51
+ }> & {
52
+ /** Token decimals used to derive `formatted`, if known. */
53
+ decimals?: number | undefined;
54
+ /** Transferred amount formatted with the token's `decimals`, if known. */
55
+ formatted?: string | undefined;
56
+ /** Transaction receipt. */
57
+ receipt: TransactionReceipt;
58
+ }>;
59
+ type ErrorType = BaseErrorType;
60
+ }
61
+ //# sourceMappingURL=transferSync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transferSync.d.ts","sourceRoot":"","sources":["../../../actions/token/transferSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAInD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAsB,YAAY,CAChC,KAAK,SAAS,KAAK,GAAG,SAAS,EAC/B,OAAO,SAAS,OAAO,GAAG,SAAS,EACnC,MAAM,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAE7C,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CA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