@reown/appkit-common-react-native 2.0.0 → 2.0.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 (312) hide show
  1. package/lib/commonjs/adapters/BitcoinBaseAdapter.js +10 -0
  2. package/lib/commonjs/adapters/BitcoinBaseAdapter.js.map +1 -0
  3. package/lib/commonjs/adapters/BlockchainAdapter.js +38 -14
  4. package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -1
  5. package/lib/commonjs/adapters/EvmAdapter.js +126 -16
  6. package/lib/commonjs/adapters/EvmAdapter.js.map +1 -1
  7. package/lib/commonjs/adapters/SolanaBaseAdapter.js +1 -3
  8. package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -1
  9. package/lib/commonjs/contracts/erc20.js.map +1 -1
  10. package/lib/commonjs/contracts/usdt.js.map +1 -1
  11. package/lib/commonjs/index.js +13 -5
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/networks/bitcoin.js.map +1 -1
  14. package/lib/commonjs/networks/solana.js.map +1 -1
  15. package/lib/commonjs/package.json +1 -0
  16. package/lib/commonjs/types/api/blockchain-api.js +15 -0
  17. package/lib/commonjs/types/api/blockchain-api.js.map +1 -0
  18. package/lib/commonjs/types/api/events.js +6 -0
  19. package/lib/commonjs/types/api/events.js.map +1 -0
  20. package/lib/commonjs/types/api/index.js +39 -0
  21. package/lib/commonjs/types/api/index.js.map +1 -0
  22. package/lib/commonjs/types/api/wallet-api.js +6 -0
  23. package/lib/commonjs/types/api/wallet-api.js.map +1 -0
  24. package/lib/commonjs/types/blockchain/adapter.js +6 -0
  25. package/lib/commonjs/types/blockchain/adapter.js.map +1 -0
  26. package/lib/commonjs/types/blockchain/balance.js +6 -0
  27. package/lib/commonjs/types/blockchain/balance.js.map +1 -0
  28. package/lib/commonjs/types/blockchain/index.js +50 -0
  29. package/lib/commonjs/types/blockchain/index.js.map +1 -0
  30. package/lib/commonjs/types/blockchain/network.js +6 -0
  31. package/lib/commonjs/types/blockchain/network.js.map +1 -0
  32. package/lib/commonjs/types/blockchain/transaction.js +2 -0
  33. package/lib/commonjs/types/blockchain/transaction.js.map +1 -0
  34. package/lib/commonjs/types/common.js +2 -0
  35. package/lib/commonjs/types/common.js.map +1 -0
  36. package/lib/commonjs/types/index.js +105 -0
  37. package/lib/commonjs/types/index.js.map +1 -0
  38. package/lib/commonjs/types/onramp/countries.js +2 -0
  39. package/lib/commonjs/types/onramp/countries.js.map +1 -0
  40. package/lib/commonjs/types/onramp/currencies.js +2 -0
  41. package/lib/commonjs/types/onramp/currencies.js.map +1 -0
  42. package/lib/commonjs/types/onramp/errors.js +22 -0
  43. package/lib/commonjs/types/onramp/errors.js.map +1 -0
  44. package/lib/commonjs/types/onramp/index.js +50 -0
  45. package/lib/commonjs/types/onramp/index.js.map +1 -0
  46. package/lib/commonjs/types/onramp/quotes.js +2 -0
  47. package/lib/commonjs/types/onramp/quotes.js.map +1 -0
  48. package/lib/commonjs/types/siwx/config.js +6 -0
  49. package/lib/commonjs/types/siwx/config.js.map +1 -0
  50. package/lib/commonjs/types/siwx/index.js +50 -0
  51. package/lib/commonjs/types/siwx/index.js.map +1 -0
  52. package/lib/commonjs/types/siwx/message.js +6 -0
  53. package/lib/commonjs/types/siwx/message.js.map +1 -0
  54. package/lib/commonjs/types/siwx/storage.js +6 -0
  55. package/lib/commonjs/types/siwx/storage.js.map +1 -0
  56. package/lib/commonjs/types/siwx/verifier.js +35 -0
  57. package/lib/commonjs/types/siwx/verifier.js.map +1 -0
  58. package/lib/commonjs/types/storage.js +24 -0
  59. package/lib/commonjs/types/storage.js.map +1 -0
  60. package/lib/commonjs/types/swap/index.js +17 -0
  61. package/lib/commonjs/types/swap/index.js.map +1 -0
  62. package/lib/commonjs/types/swap/tokens.js +6 -0
  63. package/lib/commonjs/types/swap/tokens.js.map +1 -0
  64. package/lib/commonjs/types/ui.js +6 -0
  65. package/lib/commonjs/types/ui.js.map +1 -0
  66. package/lib/commonjs/types/wallet/connection.js +6 -0
  67. package/lib/commonjs/types/wallet/connection.js.map +1 -0
  68. package/lib/commonjs/{utils/TypeUtil.js → types/wallet/connector.js} +7 -13
  69. package/lib/commonjs/types/wallet/connector.js.map +1 -0
  70. package/lib/commonjs/types/wallet/index.js +39 -0
  71. package/lib/commonjs/types/wallet/index.js.map +1 -0
  72. package/lib/commonjs/types/wallet/wallet-info.js +6 -0
  73. package/lib/commonjs/types/wallet/wallet-info.js.map +1 -0
  74. package/lib/commonjs/utils/ConstantsUtil.js +45 -6
  75. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  76. package/lib/commonjs/utils/ContractUtil.js.map +1 -1
  77. package/lib/commonjs/utils/DateUtil.js.map +1 -1
  78. package/lib/commonjs/utils/ErrorUtil.js +2 -2
  79. package/lib/commonjs/utils/ErrorUtil.js.map +1 -1
  80. package/lib/commonjs/utils/NamesUtil.js.map +1 -1
  81. package/lib/commonjs/utils/NetworkUtil.js +3 -0
  82. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  83. package/lib/commonjs/utils/NumberUtil.js +1 -2
  84. package/lib/commonjs/utils/NumberUtil.js.map +1 -1
  85. package/lib/commonjs/utils/PresetsUtil.js +0 -18
  86. package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
  87. package/lib/commonjs/utils/StringUtil.js +7 -0
  88. package/lib/commonjs/utils/StringUtil.js.map +1 -1
  89. package/lib/module/adapters/BitcoinBaseAdapter.js +5 -0
  90. package/lib/module/adapters/BitcoinBaseAdapter.js.map +1 -0
  91. package/lib/module/adapters/BlockchainAdapter.js +40 -14
  92. package/lib/module/adapters/BlockchainAdapter.js.map +1 -1
  93. package/lib/module/adapters/EvmAdapter.js +129 -16
  94. package/lib/module/adapters/EvmAdapter.js.map +1 -1
  95. package/lib/module/adapters/SolanaBaseAdapter.js +3 -3
  96. package/lib/module/adapters/SolanaBaseAdapter.js.map +1 -1
  97. package/lib/module/contracts/erc20.js +2 -0
  98. package/lib/module/contracts/erc20.js.map +1 -1
  99. package/lib/module/contracts/usdt.js +2 -0
  100. package/lib/module/contracts/usdt.js.map +1 -1
  101. package/lib/module/index.js +4 -1
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/networks/bitcoin.js +2 -0
  104. package/lib/module/networks/bitcoin.js.map +1 -1
  105. package/lib/module/networks/solana.js +2 -0
  106. package/lib/module/networks/solana.js.map +1 -1
  107. package/lib/module/types/api/blockchain-api.js +10 -0
  108. package/lib/module/types/api/blockchain-api.js.map +1 -0
  109. package/lib/module/types/api/events.js +4 -0
  110. package/lib/module/types/api/events.js.map +1 -0
  111. package/lib/module/types/api/index.js +7 -0
  112. package/lib/module/types/api/index.js.map +1 -0
  113. package/lib/module/types/api/wallet-api.js +4 -0
  114. package/lib/module/types/api/wallet-api.js.map +1 -0
  115. package/lib/module/types/blockchain/adapter.js +4 -0
  116. package/lib/module/types/blockchain/adapter.js.map +1 -0
  117. package/lib/module/types/blockchain/balance.js +4 -0
  118. package/lib/module/types/blockchain/balance.js.map +1 -0
  119. package/lib/module/types/blockchain/index.js +8 -0
  120. package/lib/module/types/blockchain/index.js.map +1 -0
  121. package/lib/module/types/blockchain/network.js +4 -0
  122. package/lib/module/types/blockchain/network.js.map +1 -0
  123. package/lib/module/types/blockchain/transaction.js +2 -0
  124. package/lib/module/types/blockchain/transaction.js.map +1 -0
  125. package/lib/module/types/common.js +2 -0
  126. package/lib/module/types/common.js.map +1 -0
  127. package/lib/module/types/index.js +31 -0
  128. package/lib/module/types/index.js.map +1 -0
  129. package/lib/module/types/onramp/countries.js +2 -0
  130. package/lib/module/types/onramp/countries.js.map +1 -0
  131. package/lib/module/types/onramp/currencies.js +2 -0
  132. package/lib/module/types/onramp/currencies.js.map +1 -0
  133. package/lib/module/types/onramp/errors.js +18 -0
  134. package/lib/module/types/onramp/errors.js.map +1 -0
  135. package/lib/module/types/onramp/index.js +8 -0
  136. package/lib/module/types/onramp/index.js.map +1 -0
  137. package/lib/module/types/onramp/quotes.js +2 -0
  138. package/lib/module/types/onramp/quotes.js.map +1 -0
  139. package/lib/module/types/siwx/config.js +4 -0
  140. package/lib/module/types/siwx/config.js.map +1 -0
  141. package/lib/module/types/siwx/index.js +7 -0
  142. package/lib/module/types/siwx/index.js.map +1 -0
  143. package/lib/module/types/siwx/message.js +4 -0
  144. package/lib/module/types/siwx/message.js.map +1 -0
  145. package/lib/module/types/siwx/storage.js +4 -0
  146. package/lib/module/types/siwx/storage.js.map +1 -0
  147. package/lib/module/types/siwx/verifier.js +30 -0
  148. package/lib/module/types/siwx/verifier.js.map +1 -0
  149. package/lib/module/types/storage.js +20 -0
  150. package/lib/module/types/storage.js.map +1 -0
  151. package/lib/module/types/swap/index.js +5 -0
  152. package/lib/module/types/swap/index.js.map +1 -0
  153. package/lib/module/types/swap/tokens.js +4 -0
  154. package/lib/module/types/swap/tokens.js.map +1 -0
  155. package/lib/module/types/ui.js +4 -0
  156. package/lib/module/types/ui.js.map +1 -0
  157. package/lib/module/types/wallet/connection.js +4 -0
  158. package/lib/module/types/wallet/connection.js.map +1 -0
  159. package/lib/module/{utils/TypeUtil.js → types/wallet/connector.js} +9 -14
  160. package/lib/module/types/wallet/connector.js.map +1 -0
  161. package/lib/module/types/wallet/index.js +7 -0
  162. package/lib/module/types/wallet/index.js.map +1 -0
  163. package/lib/module/types/wallet/wallet-info.js +4 -0
  164. package/lib/module/types/wallet/wallet-info.js.map +1 -0
  165. package/lib/module/utils/ConstantsUtil.js +47 -6
  166. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  167. package/lib/module/utils/ContractUtil.js +2 -0
  168. package/lib/module/utils/ContractUtil.js.map +1 -1
  169. package/lib/module/utils/DateUtil.js +2 -0
  170. package/lib/module/utils/DateUtil.js.map +1 -1
  171. package/lib/module/utils/ErrorUtil.js +4 -2
  172. package/lib/module/utils/ErrorUtil.js.map +1 -1
  173. package/lib/module/utils/NamesUtil.js +2 -0
  174. package/lib/module/utils/NamesUtil.js.map +1 -1
  175. package/lib/module/utils/NetworkUtil.js +5 -0
  176. package/lib/module/utils/NetworkUtil.js.map +1 -1
  177. package/lib/module/utils/NumberUtil.js +2 -0
  178. package/lib/module/utils/NumberUtil.js.map +1 -1
  179. package/lib/module/utils/PresetsUtil.js +2 -18
  180. package/lib/module/utils/PresetsUtil.js.map +1 -1
  181. package/lib/module/utils/StringUtil.js +9 -0
  182. package/lib/module/utils/StringUtil.js.map +1 -1
  183. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts +5 -0
  184. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts.map +1 -0
  185. package/lib/typescript/adapters/BlockchainAdapter.d.ts +6 -7
  186. package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -1
  187. package/lib/typescript/adapters/EvmAdapter.d.ts +21 -1
  188. package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -1
  189. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +3 -0
  190. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -1
  191. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts +2 -0
  192. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts.map +1 -0
  193. package/lib/typescript/index.d.ts +2 -1
  194. package/lib/typescript/index.d.ts.map +1 -1
  195. package/lib/typescript/networks/bitcoin.d.ts +1 -1
  196. package/lib/typescript/networks/bitcoin.d.ts.map +1 -1
  197. package/lib/typescript/networks/solana.d.ts +1 -1
  198. package/lib/typescript/networks/solana.d.ts.map +1 -1
  199. package/lib/typescript/types/api/blockchain-api.d.ts +183 -0
  200. package/lib/typescript/types/api/blockchain-api.d.ts.map +1 -0
  201. package/lib/typescript/types/api/events.d.ts +357 -0
  202. package/lib/typescript/types/api/events.d.ts.map +1 -0
  203. package/lib/typescript/types/api/index.d.ts +4 -0
  204. package/lib/typescript/types/api/index.d.ts.map +1 -0
  205. package/lib/typescript/types/api/wallet-api.d.ts +51 -0
  206. package/lib/typescript/types/api/wallet-api.d.ts.map +1 -0
  207. package/lib/typescript/types/blockchain/adapter.d.ts +40 -0
  208. package/lib/typescript/types/blockchain/adapter.d.ts.map +1 -0
  209. package/lib/typescript/types/blockchain/balance.d.ts +28 -0
  210. package/lib/typescript/types/blockchain/balance.d.ts.map +1 -0
  211. package/lib/typescript/types/blockchain/index.d.ts +5 -0
  212. package/lib/typescript/types/blockchain/index.d.ts.map +1 -0
  213. package/lib/typescript/types/blockchain/network.d.ts +47 -0
  214. package/lib/typescript/types/blockchain/network.d.ts.map +1 -0
  215. package/lib/typescript/types/blockchain/transaction.d.ts +63 -0
  216. package/lib/typescript/types/blockchain/transaction.d.ts.map +1 -0
  217. package/lib/typescript/types/common.d.ts +24 -0
  218. package/lib/typescript/types/common.d.ts.map +1 -0
  219. package/lib/typescript/types/index.d.ts +10 -0
  220. package/lib/typescript/types/index.d.ts.map +1 -0
  221. package/lib/typescript/types/onramp/countries.d.ts +11 -0
  222. package/lib/typescript/types/onramp/countries.d.ts.map +1 -0
  223. package/lib/typescript/types/onramp/currencies.d.ts +30 -0
  224. package/lib/typescript/types/onramp/currencies.d.ts.map +1 -0
  225. package/lib/typescript/types/onramp/errors.d.ts +21 -0
  226. package/lib/typescript/types/onramp/errors.d.ts.map +1 -0
  227. package/lib/typescript/types/onramp/index.d.ts +5 -0
  228. package/lib/typescript/types/onramp/index.d.ts.map +1 -0
  229. package/lib/typescript/types/onramp/quotes.d.ts +45 -0
  230. package/lib/typescript/types/onramp/quotes.d.ts.map +1 -0
  231. package/lib/typescript/types/siwx/config.d.ts +73 -0
  232. package/lib/typescript/types/siwx/config.d.ts.map +1 -0
  233. package/lib/typescript/types/siwx/index.d.ts +5 -0
  234. package/lib/typescript/types/siwx/index.d.ts.map +1 -0
  235. package/lib/typescript/types/siwx/message.d.ts +92 -0
  236. package/lib/typescript/types/siwx/message.d.ts.map +1 -0
  237. package/lib/typescript/types/siwx/storage.d.ts +41 -0
  238. package/lib/typescript/types/siwx/storage.d.ts.map +1 -0
  239. package/lib/typescript/types/siwx/verifier.d.ts +28 -0
  240. package/lib/typescript/types/siwx/verifier.d.ts.map +1 -0
  241. package/lib/typescript/types/storage.d.ts +59 -0
  242. package/lib/typescript/types/storage.d.ts.map +1 -0
  243. package/lib/typescript/types/swap/index.d.ts +2 -0
  244. package/lib/typescript/types/swap/index.d.ts.map +1 -0
  245. package/lib/typescript/types/swap/tokens.d.ts +19 -0
  246. package/lib/typescript/types/swap/tokens.d.ts.map +1 -0
  247. package/lib/typescript/types/ui.d.ts +26 -0
  248. package/lib/typescript/types/ui.d.ts.map +1 -0
  249. package/lib/typescript/types/wallet/connection.d.ts +31 -0
  250. package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
  251. package/lib/typescript/types/wallet/connector.d.ts +59 -0
  252. package/lib/typescript/types/wallet/connector.d.ts.map +1 -0
  253. package/lib/typescript/types/wallet/index.d.ts +4 -0
  254. package/lib/typescript/types/wallet/index.d.ts.map +1 -0
  255. package/lib/typescript/types/wallet/wallet-info.d.ts +37 -0
  256. package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -0
  257. package/lib/typescript/utils/ConstantsUtil.d.ts +43 -4
  258. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  259. package/lib/typescript/utils/NetworkUtil.d.ts +2 -0
  260. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  261. package/lib/typescript/utils/PresetsUtil.d.ts +0 -5
  262. package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
  263. package/lib/typescript/utils/StringUtil.d.ts +1 -0
  264. package/lib/typescript/utils/StringUtil.d.ts.map +1 -1
  265. package/package.json +10 -19
  266. package/src/adapters/BitcoinBaseAdapter.ts +5 -0
  267. package/src/adapters/BlockchainAdapter.ts +48 -21
  268. package/src/adapters/EvmAdapter.ts +186 -18
  269. package/src/adapters/SolanaBaseAdapter.ts +3 -1
  270. package/src/adapters/__tests__/EvmAdapter.test.ts +126 -0
  271. package/src/index.ts +3 -1
  272. package/src/networks/bitcoin.ts +1 -1
  273. package/src/networks/solana.ts +1 -1
  274. package/src/types/api/blockchain-api.ts +213 -0
  275. package/src/types/api/events.ts +462 -0
  276. package/src/types/api/index.ts +4 -0
  277. package/src/types/api/wallet-api.ts +71 -0
  278. package/src/types/blockchain/adapter.ts +52 -0
  279. package/src/types/blockchain/balance.ts +31 -0
  280. package/src/types/blockchain/index.ts +5 -0
  281. package/src/types/blockchain/network.ts +39 -0
  282. package/src/types/blockchain/transaction.ts +71 -0
  283. package/src/types/common.ts +56 -0
  284. package/src/types/index.ts +28 -0
  285. package/src/types/onramp/countries.ts +11 -0
  286. package/src/types/onramp/currencies.ts +32 -0
  287. package/src/types/onramp/errors.ts +22 -0
  288. package/src/types/onramp/index.ts +5 -0
  289. package/src/types/onramp/quotes.ts +46 -0
  290. package/src/types/siwx/config.ts +73 -0
  291. package/src/types/siwx/index.ts +4 -0
  292. package/src/types/siwx/message.ts +92 -0
  293. package/src/types/siwx/storage.ts +44 -0
  294. package/src/types/siwx/verifier.ts +32 -0
  295. package/src/types/storage.ts +64 -0
  296. package/src/types/swap/index.ts +2 -0
  297. package/src/types/swap/tokens.ts +21 -0
  298. package/src/types/ui.ts +26 -0
  299. package/src/types/wallet/connection.ts +34 -0
  300. package/src/types/wallet/connector.ts +83 -0
  301. package/src/types/wallet/index.ts +4 -0
  302. package/src/types/wallet/wallet-info.ts +42 -0
  303. package/src/utils/ConstantsUtil.ts +48 -7
  304. package/src/utils/ErrorUtil.ts +2 -2
  305. package/src/utils/NetworkUtil.ts +5 -0
  306. package/src/utils/PresetsUtil.ts +0 -25
  307. package/src/utils/StringUtil.ts +7 -0
  308. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  309. package/lib/module/utils/TypeUtil.js.map +0 -1
  310. package/lib/typescript/utils/TypeUtil.d.ts +0 -276
  311. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  312. package/src/utils/TypeUtil.ts +0 -336
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/common.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5D,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEjF,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,cAAc,CAAC;AAEjD,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,GAAG,GACH,SAAS,GACT,OAAO,GACP,WAAW,CAAC;AAEhB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;AAE7E,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC;AAE/B,MAAM,MAAM,UAAU,GAAG,gBAAgB,MAAM,IAAI,MAAM,EAAE,CAAC;AAE5D,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,aAAa,GACb,UAAU,GACV,UAAU,GACV,gBAAgB,GAChB,QAAQ,CAAC;AAEb,MAAM,MAAM,cAAc,GAAG,MAAM,CACjC,MAAM,EACN;IACE,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from './common';
2
+ export * from './blockchain';
3
+ export * from './wallet';
4
+ export * from './api';
5
+ export * from './swap';
6
+ export * from './onramp';
7
+ export * from './siwx';
8
+ export * from './storage';
9
+ export * from './ui';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAGA,cAAc,UAAU,CAAC;AAGzB,cAAc,cAAc,CAAC;AAG7B,cAAc,UAAU,CAAC;AAGzB,cAAc,OAAO,CAAC;AAGtB,cAAc,QAAQ,CAAC;AAGvB,cAAc,UAAU,CAAC;AAGzB,cAAc,QAAQ,CAAC;AAGvB,cAAc,WAAW,CAAC;AAG1B,cAAc,MAAM,CAAC"}
@@ -0,0 +1,11 @@
1
+ export type OnRampCountry = {
2
+ countryCode: string;
3
+ flagImageUrl: string;
4
+ name: string;
5
+ };
6
+ export type OnRampCountryDefaults = {
7
+ countryCode: string;
8
+ defaultCurrencyCode: string;
9
+ defaultPaymentMethods: string[];
10
+ };
11
+ //# sourceMappingURL=countries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countries.d.ts","sourceRoot":"","sources":["../../../../src/types/onramp/countries.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,EAAE,CAAC;CACjC,CAAC"}
@@ -0,0 +1,30 @@
1
+ export type OnRampFiatCurrency = {
2
+ currencyCode: string;
3
+ name: string;
4
+ symbolImageUrl: string;
5
+ };
6
+ export type OnRampCryptoCurrency = {
7
+ currencyCode: string;
8
+ name: string;
9
+ chainCode: string;
10
+ chainName: string;
11
+ chainId: string;
12
+ contractAddress: string | null;
13
+ symbolImageUrl: string;
14
+ };
15
+ export type OnRampFiatLimit = {
16
+ currencyCode: string;
17
+ defaultAmount: number | null;
18
+ minimumAmount: number;
19
+ maximumAmount: number;
20
+ };
21
+ export type OnRampTransactionResult = {
22
+ purchaseCurrency: string | null;
23
+ purchaseAmount: string | null;
24
+ purchaseImageUrl: string | null;
25
+ paymentCurrency: string | null;
26
+ paymentAmount: string | null;
27
+ status: string | null;
28
+ network: string | null;
29
+ };
30
+ //# sourceMappingURL=currencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currencies.d.ts","sourceRoot":"","sources":["../../../../src/types/onramp/currencies.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare const OnRampErrorType: {
2
+ readonly AMOUNT_TOO_LOW: "INVALID_AMOUNT_TOO_LOW";
3
+ readonly AMOUNT_TOO_HIGH: "INVALID_AMOUNT_TOO_HIGH";
4
+ readonly INVALID_AMOUNT: "INVALID_AMOUNT";
5
+ readonly INCOMPATIBLE_REQUEST: "INCOMPATIBLE_REQUEST";
6
+ readonly BAD_REQUEST: "BAD_REQUEST";
7
+ readonly NO_VALID_QUOTES: "NO_VALID_QUOTES";
8
+ readonly FAILED_TO_LOAD: "FAILED_TO_LOAD";
9
+ readonly FAILED_TO_LOAD_COUNTRIES: "FAILED_TO_LOAD_COUNTRIES";
10
+ readonly FAILED_TO_LOAD_PROVIDERS: "FAILED_TO_LOAD_PROVIDERS";
11
+ readonly FAILED_TO_LOAD_METHODS: "FAILED_TO_LOAD_METHODS";
12
+ readonly FAILED_TO_LOAD_CURRENCIES: "FAILED_TO_LOAD_CURRENCIES";
13
+ readonly FAILED_TO_LOAD_LIMITS: "FAILED_TO_LOAD_LIMITS";
14
+ readonly UNKNOWN: "UNKNOWN_ERROR";
15
+ };
16
+ export type OnRampErrorTypeValues = (typeof OnRampErrorType)[keyof typeof OnRampErrorType];
17
+ export interface OnRampError {
18
+ type: OnRampErrorTypeValues;
19
+ message: string;
20
+ }
21
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/types/onramp/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAclB,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAE3F,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,5 @@
1
+ export * from './countries';
2
+ export * from './currencies';
3
+ export * from './quotes';
4
+ export * from './errors';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/onramp/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,45 @@
1
+ export type OnRampPaymentMethod = {
2
+ logos: {
3
+ dark: string;
4
+ light: string;
5
+ };
6
+ name: string;
7
+ paymentMethod: string;
8
+ paymentType: string;
9
+ };
10
+ export type OnRampQuote = {
11
+ countryCode: string;
12
+ customerScore: number;
13
+ destinationAmount: number;
14
+ destinationAmountWithoutFees: number;
15
+ destinationCurrencyCode: string;
16
+ exchangeRate: number;
17
+ fiatAmountWithoutFees: number;
18
+ lowKyc: boolean;
19
+ networkFee: number;
20
+ paymentMethodType: string;
21
+ serviceProvider: string;
22
+ sourceAmount: number;
23
+ sourceAmountWithoutFees: number;
24
+ sourceCurrencyCode: string;
25
+ totalFee: number;
26
+ transactionFee: number;
27
+ transactionType: string;
28
+ };
29
+ export type OnRampServiceProvider = {
30
+ categories: string[];
31
+ categoryStatuses: {
32
+ additionalProp: string;
33
+ };
34
+ logos: {
35
+ dark: string;
36
+ darkShort: string;
37
+ light: string;
38
+ lightShort: string;
39
+ };
40
+ name: string;
41
+ serviceProvider: string;
42
+ status: string;
43
+ websiteUrl: string;
44
+ };
45
+ //# sourceMappingURL=quotes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotes.d.ts","sourceRoot":"","sources":["../../../../src/types/onramp/quotes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IAChC,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,4BAA4B,EAAE,MAAM,CAAC;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,EAAE,MAAM,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,EAAE;QAChB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -0,0 +1,73 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ import type { SIWXSession, SIWXMessage } from './message';
3
+ /**
4
+ * This interface represents the SIWX configuration plugin, which is used to create and manage SIWX messages and sessions.
5
+ * You may use it to create a custom implementation following your needs, but watch close for the methods requirements.
6
+ */
7
+ export interface SIWXConfig {
8
+ /**
9
+ * This method will be called to create a new message to be signed by the user.
10
+ *
11
+ * Constraints:
12
+ * - The message MUST be unique and contain all the necessary information to verify the user's identity.
13
+ * - SIWXMessage.toString() method MUST be implemented to return the message string.
14
+ *
15
+ * @param input SIWXMessage.Input
16
+ * @returns SIWXMessage
17
+ */
18
+ createMessage: (input: SIWXMessage.Input) => Promise<SIWXMessage>;
19
+ /**
20
+ * This method will be called to store a new single session.
21
+ *
22
+ * Constraints:
23
+ * - This method MUST verify if the session is valid and store it in the storage successfully.
24
+ *
25
+ * @param session SIWXSession
26
+ */
27
+ addSession: (session: SIWXSession) => Promise<void>;
28
+ /**
29
+ * This method will be called to revoke all the sessions stored for a specific chain and address.
30
+ *
31
+ * Constraints:
32
+ * - This method MUST delete all the sessions stored for the specific chain and address successfully.
33
+ *
34
+ * @param chainId CaipNetworkId
35
+ * @param address string
36
+ */
37
+ revokeSession: (chainId: CaipNetworkId, address: string) => Promise<void>;
38
+ /**
39
+ * This method will be called to replace all the sessions in the storage with the new ones.
40
+ *
41
+ * Constraints:
42
+ * - This method MUST verify all the sessions before storing them in the storage;
43
+ * - This method MUST replace all the sessions in the storage with the new ones succesfully otherwise it MUST throw an error.
44
+ *
45
+ * @param sessions SIWXSession[]
46
+ */
47
+ setSessions: (sessions: SIWXSession[]) => Promise<void>;
48
+ /**
49
+ * This method will be called to get all the sessions stored for a specific chain and address.
50
+ *
51
+ * Constraints:
52
+ * - This method MUST return only sessions that are verified and valid;
53
+ * - This method MUST NOT return expired sessions.
54
+ *
55
+ * @param chainId CaipNetworkId
56
+ * @param address string
57
+ * @returns
58
+ */
59
+ getSessions: (chainId: CaipNetworkId, address: string) => Promise<SIWXSession[]>;
60
+ /**
61
+ * This method determines whether the wallet stays connected when the user denies the signature request.
62
+ *
63
+ * @returns {boolean}
64
+ */
65
+ getRequired?: () => boolean;
66
+ /**
67
+ * This flag determines whether the session should be cleared when the user disconnects.
68
+ *
69
+ * @default true
70
+ */
71
+ signOutOnDisconnect?: boolean;
72
+ }
73
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;;;;;;;OASG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAClE;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD;;;;;;;;OAQG;IACH,aAAa,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E;;;;;;;;OAQG;IACH,WAAW,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD;;;;;;;;;;OAUG;IACH,WAAW,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACjF;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B"}
@@ -0,0 +1,5 @@
1
+ export * from './config';
2
+ export * from './message';
3
+ export * from './verifier';
4
+ export * from './storage';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,92 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ /**
3
+ * This interface represents a SIWX session, which is used to store the user's identity information.
4
+ */
5
+ export interface SIWXSession {
6
+ data: SIWXMessage.Data;
7
+ message: string;
8
+ signature: string;
9
+ cacao?: Cacao;
10
+ }
11
+ /**
12
+ * This interface represents a SIWX message, which is used to create a message to be signed by the user.
13
+ * This must contain the necessary information to verify the user's identity and how to generate the string message.
14
+ */
15
+ export interface SIWXMessage extends SIWXMessage.Data, SIWXMessage.Methods {
16
+ }
17
+ export declare namespace SIWXMessage {
18
+ /**
19
+ * This interface represents the SIWX message data, which is used to create a message to be signed by the user.
20
+ */
21
+ interface Data extends Input, Metadata, Identifier {
22
+ }
23
+ /**
24
+ * This interface represents the SIWX message input.
25
+ * Here must contain what is different for each user of the application.
26
+ */
27
+ interface Input {
28
+ accountAddress: string;
29
+ chainId: CaipNetworkId;
30
+ notBefore?: Timestamp;
31
+ }
32
+ /**
33
+ * This interface represents the SIWX message metadata.
34
+ * Here must contain the main data related to the app.
35
+ */
36
+ interface Metadata {
37
+ domain: string;
38
+ uri: string;
39
+ version: string;
40
+ nonce: string;
41
+ statement?: string;
42
+ resources?: string[];
43
+ }
44
+ /**
45
+ * This interface represents the SIWX message identifier.
46
+ * Here must contain the request id and the timestamps.
47
+ */
48
+ interface Identifier {
49
+ requestId?: string;
50
+ issuedAt?: Timestamp;
51
+ expirationTime?: Timestamp;
52
+ }
53
+ /**
54
+ * This interface represents the SIWX message methods.
55
+ * Here must contain the method to generate the message string and any other method performed by the SIWX message.
56
+ */
57
+ interface Methods {
58
+ toString: () => string;
59
+ }
60
+ /**
61
+ * The timestamp is a UTC string representing the time in ISO 8601 format.
62
+ */
63
+ type Timestamp = string;
64
+ }
65
+ interface CacaoHeader {
66
+ t: 'caip122';
67
+ }
68
+ interface CacaoPayload {
69
+ domain: string;
70
+ aud: string;
71
+ nonce: string;
72
+ iss: string;
73
+ version?: string;
74
+ iat?: string;
75
+ nbf?: string;
76
+ exp?: string;
77
+ statement?: string;
78
+ requestId?: string;
79
+ resources?: string[];
80
+ type?: string;
81
+ }
82
+ interface Cacao {
83
+ h: CacaoHeader;
84
+ p: CacaoPayload;
85
+ s: {
86
+ t: 'eip191' | 'eip1271';
87
+ s: string;
88
+ m?: string;
89
+ };
90
+ }
91
+ export {};
92
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AACD;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO;CAAG;AAC7E,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC;;OAEG;IACH,UAAU,IAAK,SAAQ,KAAK,EAAE,QAAQ,EAAE,UAAU;KAAG;IACrD;;;OAGG;IACH,UAAU,KAAK;QACb,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,aAAa,CAAC;QACvB,SAAS,CAAC,EAAE,SAAS,CAAC;KACvB;IACD;;;OAGG;IACH,UAAU,QAAQ;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB;IACD;;;OAGG;IACH,UAAU,UAAU;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;QACrB,cAAc,CAAC,EAAE,SAAS,CAAC;KAC5B;IACD;;;OAGG;IACH,UAAU,OAAO;QACf,QAAQ,EAAE,MAAM,MAAM,CAAC;KACxB;IACD;;OAEG;IACH,KAAK,SAAS,GAAG,MAAM,CAAC;CACzB;AAED,UAAU,WAAW;IACnB,CAAC,EAAE,SAAS,CAAC;CACd;AAED,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,KAAK;IACb,CAAC,EAAE,WAAW,CAAC;IACf,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE;QACD,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QACxB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ,CAAC;CACH"}
@@ -0,0 +1,41 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ import type { SIWXSession } from './message';
3
+ /**
4
+ * This is the interface for a SIWX storage.
5
+ */
6
+ export interface SIWXStorage {
7
+ /**
8
+ * Adds a new session for the storage.
9
+ * This method should not verify the session, only store it.
10
+ *
11
+ * @param session SIWXSession
12
+ * @returns Promise<void>
13
+ */
14
+ add(session: SIWXSession): Promise<void>;
15
+ /**
16
+ * Deletes a session from the storage.
17
+ *
18
+ * @param chainId CaipNetworkId
19
+ * @param address string
20
+ * @returns Promise<void>
21
+ */
22
+ delete(chainId: CaipNetworkId, address: string): Promise<void>;
23
+ /**
24
+ * Gets a list of sessions for a given chainId and address.
25
+ * This method should not verify sessions, only return the sessions that are stored.
26
+ *
27
+ * @param chainId CaipNetworkId
28
+ * @param address string
29
+ * @returns Promise<SIWXSession[]>
30
+ */
31
+ get(chainId: CaipNetworkId, address: string): Promise<SIWXSession[]>;
32
+ /**
33
+ * Replaces the current sessions with the new list of sessions.
34
+ * This method should not verify sessions, only store them.
35
+ *
36
+ * @param sessions SIWXSession[]
37
+ * @returns Promise<void>
38
+ */
39
+ set(sessions: SIWXSession[]): Promise<void>;
40
+ }
41
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;;;;;;OAOG;IACH,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAErE;;;;;;OAMG;IACH,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C"}
@@ -0,0 +1,28 @@
1
+ import type { ChainNamespace } from '../common';
2
+ import type { SIWXSession } from './message';
3
+ /**
4
+ * This is the base class for a SIWX verifier.
5
+ */
6
+ export declare abstract class SIWXVerifier {
7
+ /**
8
+ * The chain namespace that this verifier should verify.
9
+ */
10
+ abstract readonly chainNamespace: ChainNamespace;
11
+ /**
12
+ * This method should return true if the verifier should verify the session.
13
+ * By default it will check by the chain namespace, but you may override it for a specific requirement.
14
+ *
15
+ * @param session SIWXSession
16
+ * @returns boolean
17
+ */
18
+ shouldVerify(session: SIWXSession): boolean;
19
+ /**
20
+ * This method should verify the session.
21
+ * You must implement this method with the verification logic.
22
+ *
23
+ * @param session SIWXSession
24
+ * @returns Promise<boolean> - If `true` means the session is valid.
25
+ */
26
+ abstract verify(session: SIWXSession): Promise<boolean>;
27
+ }
28
+ //# sourceMappingURL=verifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,8BAAsB,YAAY;IAChC;;OAEG;IACH,kBAAyB,cAAc,EAAE,cAAc,CAAC;IAExD;;;;;;OAMG;IACI,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAIlD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CACxD"}
@@ -0,0 +1,59 @@
1
+ export interface Storage {
2
+ /**
3
+ * Returns all keys in storage.
4
+ */
5
+ getKeys(): Promise<string[]>;
6
+ /**
7
+ * Returns all key-value entries in storage.
8
+ */
9
+ getEntries<T = any>(): Promise<[string, T][]>;
10
+ /**
11
+ * Get an item from storage for a given key.
12
+ * @param key The key to retrieve.
13
+ */
14
+ getItem<T = any>(key: string): Promise<T | undefined>;
15
+ /**
16
+ * Set an item in storage for a given key.
17
+ * @param key The key to set.
18
+ * @param value The value to set.
19
+ */
20
+ setItem<T = any>(key: string, value: T): Promise<void>;
21
+ /**
22
+ * Remove an item from storage for a given key.
23
+ * @param key The key to remove.
24
+ */
25
+ removeItem(key: string): Promise<void>;
26
+ }
27
+ export interface SafeStorageItems {
28
+ 'WALLETCONNECT_DEEPLINK_CHOICE': string;
29
+ '@appkit/recent_wallet': string;
30
+ '@appkit/connected_connectors': string;
31
+ '@appkit/onramp_preferred_country': string;
32
+ '@appkit/onramp_countries': string;
33
+ '@appkit/onramp_service_providers': string;
34
+ '@appkit/onramp_fiat_limits': string;
35
+ '@appkit/onramp_fiat_currencies': string;
36
+ '@appkit/onramp_preferred_fiat_currency': string;
37
+ '@appkit/onramp_countries_defaults': string;
38
+ '@appkit/active_namespace': string;
39
+ '@appkit/coinbase_connector/session': string;
40
+ '@appkit/siwx-auth-token': string;
41
+ '@appkit/siwx-nonce-token': string;
42
+ }
43
+ export declare const SafeStorageKeys: {
44
+ readonly WC_DEEPLINK: "WALLETCONNECT_DEEPLINK_CHOICE";
45
+ readonly RECENT_WALLET: "@appkit/recent_wallet";
46
+ readonly CONNECTED_CONNECTORS: "@appkit/connected_connectors";
47
+ readonly ONRAMP_PREFERRED_COUNTRY: "@appkit/onramp_preferred_country";
48
+ readonly ONRAMP_COUNTRIES: "@appkit/onramp_countries";
49
+ readonly ONRAMP_SERVICE_PROVIDERS: "@appkit/onramp_service_providers";
50
+ readonly ONRAMP_FIAT_LIMITS: "@appkit/onramp_fiat_limits";
51
+ readonly ONRAMP_FIAT_CURRENCIES: "@appkit/onramp_fiat_currencies";
52
+ readonly ONRAMP_PREFERRED_FIAT_CURRENCY: "@appkit/onramp_preferred_fiat_currency";
53
+ readonly ONRAMP_COUNTRIES_DEFAULTS: "@appkit/onramp_countries_defaults";
54
+ readonly ACTIVE_NAMESPACE: "@appkit/active_namespace";
55
+ readonly COINBASE_CONNECTOR_SESSION: "@appkit/coinbase_connector/session";
56
+ readonly SIWX_AUTH_TOKEN: "@appkit/siwx-auth-token";
57
+ readonly SIWX_NONCE_TOKEN: "@appkit/siwx-nonce-token";
58
+ };
59
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/types/storage.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,CAAC,GAAG,GAAG,KAAK,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9C;;;OAGG;IACH,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAEtD;;;;OAIG;IACH,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B,EAAE,MAAM,CAAC;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,8BAA8B,EAAE,MAAM,CAAC;IACvC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,4BAA4B,EAAE,MAAM,CAAC;IACrC,gCAAgC,EAAE,MAAM,CAAC;IACzC,wCAAwC,EAAE,MAAM,CAAC;IACjD,mCAAmC,EAAE,MAAM,CAAC;IAC5C,0BAA0B,EAAE,MAAM,CAAC;IACnC,oCAAoC,EAAE,MAAM,CAAC;IAC7C,yBAAyB,EAAE,MAAM,CAAC;IAClC,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAelB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './tokens';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/swap/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { CaipAddress } from '../common';
2
+ export type SwapToken = {
3
+ name: string;
4
+ symbol: string;
5
+ address: CaipAddress;
6
+ decimals: number;
7
+ logoUri: string;
8
+ eip2612?: boolean;
9
+ };
10
+ export type SwapTokenWithBalance = SwapToken & {
11
+ quantity: {
12
+ decimals: string;
13
+ numeric: string;
14
+ };
15
+ price: number;
16
+ value: number;
17
+ };
18
+ export type SwapInputTarget = 'sourceToken' | 'toToken';
19
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/types/swap/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG;IAC7C,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { SocialProvider } from './common';
2
+ type EnabledSocials = SocialProvider;
3
+ export type Features = {
4
+ /**
5
+ * @description Enable or disable the swaps feature. Enabled by default.
6
+ * @type {boolean}
7
+ */
8
+ swaps?: boolean;
9
+ /**
10
+ * @description Enable or disable the onramp feature. Enabled by default.
11
+ * @type {boolean}
12
+ */
13
+ onramp?: boolean;
14
+ /**
15
+ * @description Show or hide the regular wallet options when socials are enabled. Enabled by default.
16
+ * @type {boolean}
17
+ */
18
+ showWallets?: boolean;
19
+ /**
20
+ * @description Enable or disable the socials feature. Enabled by default.
21
+ * @type {EnabledSocials[]}
22
+ */
23
+ socials?: EnabledSocials[] | false;
24
+ };
25
+ export {};
26
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/types/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,KAAK,cAAc,GAAG,cAAc,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;CACpC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { CaipAddress, CaipNetworkId, SocialProvider, AccountType } from '../common';
2
+ import type { Balance } from '../blockchain/balance';
3
+ import type { WalletInfo, Identity } from './wallet-info';
4
+ import type { BlockchainAdapter } from '../../adapters/BlockchainAdapter';
5
+ export interface Connection {
6
+ accounts: CaipAddress[];
7
+ balances: Map<CaipAddress, Balance[]>;
8
+ adapter: BlockchainAdapter;
9
+ caipNetwork: CaipNetworkId;
10
+ wallet?: WalletInfo;
11
+ properties?: ConnectionProperties;
12
+ type?: AccountType;
13
+ identities?: Map<CaipAddress, Identity>;
14
+ }
15
+ export interface ConnectionProperties {
16
+ email?: string;
17
+ username?: string;
18
+ smartAccounts?: CaipAddress[];
19
+ provider?: SocialProvider;
20
+ sessionTopic?: string;
21
+ canAddEvmChain?: boolean;
22
+ }
23
+ export interface LinkingRecord {
24
+ redirect: string;
25
+ href: string;
26
+ }
27
+ export interface WalletDeepLink {
28
+ href: string;
29
+ name: string;
30
+ }
31
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../src/types/wallet/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,59 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import type { ChainNamespace, CaipAddress, CaipNetworkId } from '../common';
4
+ import type { AppKitNetwork } from '../blockchain/network';
5
+ import type { Provider } from '../blockchain/adapter';
6
+ import type { WalletInfo, Metadata } from './wallet-info';
7
+ import type { ConnectionProperties } from './connection';
8
+ import type { Storage } from '../storage';
9
+ import type { WcWallet } from '../api/wallet-api';
10
+ export type ConnectorType = 'walletconnect' | 'coinbase' | 'phantom' | 'solflare';
11
+ export interface BaseNamespace {
12
+ chains?: CaipNetworkId[];
13
+ accounts: CaipAddress[];
14
+ methods: string[];
15
+ events: string[];
16
+ }
17
+ type Namespace = BaseNamespace;
18
+ export type Namespaces = Record<string, Namespace>;
19
+ export type ProposalNamespaces = Record<string, Omit<Namespace, 'accounts'> & Required<Pick<Namespace, 'chains'>> & {
20
+ rpcMap: Record<string, string>;
21
+ }>;
22
+ export type ConnectOptions = {
23
+ namespaces?: ProposalNamespaces;
24
+ defaultNetwork?: AppKitNetwork;
25
+ universalLink?: string;
26
+ };
27
+ export type ConnectorInitOptions = {
28
+ storage: Storage;
29
+ metadata: Metadata;
30
+ };
31
+ export declare abstract class WalletConnector extends EventEmitter {
32
+ type: ConnectorType;
33
+ protected provider?: Provider;
34
+ protected namespaces?: Namespaces;
35
+ protected wallet?: WalletInfo;
36
+ protected storage?: Storage;
37
+ protected metadata?: Metadata;
38
+ protected properties?: ConnectionProperties;
39
+ constructor({ type }: {
40
+ type: ConnectorType;
41
+ });
42
+ init(ops: ConnectorInitOptions): Promise<void>;
43
+ setProvider(provider: Provider): void;
44
+ disconnect(): Promise<void>;
45
+ abstract connect(opts: ConnectOptions): Promise<Namespaces | undefined>;
46
+ abstract getProvider(namespace?: ChainNamespace): Provider;
47
+ abstract getNamespaces(): Namespaces;
48
+ abstract getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
49
+ abstract getWalletInfo(): WalletInfo | undefined;
50
+ abstract getProperties(): ConnectionProperties | undefined;
51
+ abstract switchNetwork(network: AppKitNetwork): Promise<void>;
52
+ abstract restoreSession(): Promise<boolean>;
53
+ }
54
+ export type AppKitConnectOptions = {
55
+ walletId?: string;
56
+ wallet?: WcWallet;
57
+ };
58
+ export {};
59
+ //# sourceMappingURL=connector.d.ts.map