@reown/appkit-common-react-native 0.0.0-develop-20250728153935 → 0.0.0-develop-20251030154825

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 (313) 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 +103 -0
  4. package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -0
  5. package/lib/commonjs/adapters/EvmAdapter.js +193 -0
  6. package/lib/commonjs/adapters/EvmAdapter.js.map +1 -0
  7. package/lib/commonjs/adapters/SolanaBaseAdapter.js +10 -0
  8. package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -0
  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 +74 -5
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/networks/bitcoin.js +40 -0
  14. package/lib/commonjs/networks/bitcoin.js.map +1 -0
  15. package/lib/commonjs/networks/solana.js +78 -0
  16. package/lib/commonjs/networks/solana.js.map +1 -0
  17. package/lib/commonjs/package.json +1 -0
  18. package/lib/commonjs/types/api/blockchain-api.js +15 -0
  19. package/lib/commonjs/types/api/blockchain-api.js.map +1 -0
  20. package/lib/commonjs/types/api/events.js +6 -0
  21. package/lib/commonjs/types/api/events.js.map +1 -0
  22. package/lib/commonjs/types/api/index.js +39 -0
  23. package/lib/commonjs/types/api/index.js.map +1 -0
  24. package/lib/commonjs/types/api/wallet-api.js +6 -0
  25. package/lib/commonjs/types/api/wallet-api.js.map +1 -0
  26. package/lib/commonjs/types/blockchain/adapter.js +6 -0
  27. package/lib/commonjs/types/blockchain/adapter.js.map +1 -0
  28. package/lib/commonjs/types/blockchain/balance.js +6 -0
  29. package/lib/commonjs/types/blockchain/balance.js.map +1 -0
  30. package/lib/commonjs/types/blockchain/index.js +50 -0
  31. package/lib/commonjs/types/blockchain/index.js.map +1 -0
  32. package/lib/commonjs/types/blockchain/network.js +6 -0
  33. package/lib/commonjs/types/blockchain/network.js.map +1 -0
  34. package/lib/commonjs/types/blockchain/transaction.js +2 -0
  35. package/lib/commonjs/types/blockchain/transaction.js.map +1 -0
  36. package/lib/commonjs/types/common.js +2 -0
  37. package/lib/commonjs/types/common.js.map +1 -0
  38. package/lib/commonjs/types/index.js +105 -0
  39. package/lib/commonjs/types/index.js.map +1 -0
  40. package/lib/commonjs/types/onramp/countries.js +2 -0
  41. package/lib/commonjs/types/onramp/countries.js.map +1 -0
  42. package/lib/commonjs/types/onramp/currencies.js +2 -0
  43. package/lib/commonjs/types/onramp/currencies.js.map +1 -0
  44. package/lib/commonjs/types/onramp/errors.js +22 -0
  45. package/lib/commonjs/types/onramp/errors.js.map +1 -0
  46. package/lib/commonjs/types/onramp/index.js +50 -0
  47. package/lib/commonjs/types/onramp/index.js.map +1 -0
  48. package/lib/commonjs/types/onramp/quotes.js +2 -0
  49. package/lib/commonjs/types/onramp/quotes.js.map +1 -0
  50. package/lib/commonjs/types/siwx/config.js +6 -0
  51. package/lib/commonjs/types/siwx/config.js.map +1 -0
  52. package/lib/commonjs/types/siwx/index.js +50 -0
  53. package/lib/commonjs/types/siwx/index.js.map +1 -0
  54. package/lib/commonjs/types/siwx/message.js +6 -0
  55. package/lib/commonjs/types/siwx/message.js.map +1 -0
  56. package/lib/commonjs/types/siwx/storage.js +6 -0
  57. package/lib/commonjs/types/siwx/storage.js.map +1 -0
  58. package/lib/commonjs/types/siwx/verifier.js +35 -0
  59. package/lib/commonjs/types/siwx/verifier.js.map +1 -0
  60. package/lib/commonjs/types/storage.js +24 -0
  61. package/lib/commonjs/types/storage.js.map +1 -0
  62. package/lib/commonjs/types/swap/index.js +17 -0
  63. package/lib/commonjs/types/swap/index.js.map +1 -0
  64. package/lib/commonjs/types/swap/tokens.js +6 -0
  65. package/lib/commonjs/types/swap/tokens.js.map +1 -0
  66. package/lib/commonjs/types/ui.js +6 -0
  67. package/lib/commonjs/{utils/TypeUtil.js.map → types/ui.js.map} +1 -1
  68. package/lib/commonjs/types/wallet/connection.js +6 -0
  69. package/lib/commonjs/types/wallet/connection.js.map +1 -0
  70. package/lib/commonjs/types/wallet/connector.js +30 -0
  71. package/lib/commonjs/types/wallet/connector.js.map +1 -0
  72. package/lib/commonjs/types/wallet/index.js +39 -0
  73. package/lib/commonjs/types/wallet/index.js.map +1 -0
  74. package/lib/commonjs/types/wallet/wallet-info.js +6 -0
  75. package/lib/commonjs/types/wallet/wallet-info.js.map +1 -0
  76. package/lib/commonjs/utils/ConstantsUtil.js +45 -6
  77. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  78. package/lib/commonjs/utils/ContractUtil.js.map +1 -1
  79. package/lib/commonjs/utils/DateUtil.js.map +1 -1
  80. package/lib/commonjs/utils/ErrorUtil.js.map +1 -1
  81. package/lib/commonjs/utils/NamesUtil.js.map +1 -1
  82. package/lib/commonjs/utils/NetworkUtil.js +3 -0
  83. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  84. package/lib/commonjs/utils/NumberUtil.js +53 -13
  85. package/lib/commonjs/utils/NumberUtil.js.map +1 -1
  86. package/lib/commonjs/utils/PresetsUtil.js +34 -21
  87. package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
  88. package/lib/commonjs/utils/StringUtil.js +7 -0
  89. package/lib/commonjs/utils/StringUtil.js.map +1 -1
  90. package/lib/module/adapters/BitcoinBaseAdapter.js +5 -0
  91. package/lib/module/adapters/BitcoinBaseAdapter.js.map +1 -0
  92. package/lib/module/adapters/BlockchainAdapter.js +98 -0
  93. package/lib/module/adapters/BlockchainAdapter.js.map +1 -0
  94. package/lib/module/adapters/EvmAdapter.js +189 -0
  95. package/lib/module/adapters/EvmAdapter.js.map +1 -0
  96. package/lib/module/adapters/SolanaBaseAdapter.js +5 -0
  97. package/lib/module/adapters/SolanaBaseAdapter.js.map +1 -0
  98. package/lib/module/contracts/erc20.js +2 -0
  99. package/lib/module/contracts/erc20.js.map +1 -1
  100. package/lib/module/contracts/usdt.js +2 -0
  101. package/lib/module/contracts/usdt.js.map +1 -1
  102. package/lib/module/index.js +9 -1
  103. package/lib/module/index.js.map +1 -1
  104. package/lib/module/networks/bitcoin.js +36 -0
  105. package/lib/module/networks/bitcoin.js.map +1 -0
  106. package/lib/module/networks/solana.js +74 -0
  107. package/lib/module/networks/solana.js.map +1 -0
  108. package/lib/module/types/api/blockchain-api.js +10 -0
  109. package/lib/module/types/api/blockchain-api.js.map +1 -0
  110. package/lib/module/types/api/events.js +4 -0
  111. package/lib/module/types/api/events.js.map +1 -0
  112. package/lib/module/types/api/index.js +7 -0
  113. package/lib/module/types/api/index.js.map +1 -0
  114. package/lib/module/types/api/wallet-api.js +4 -0
  115. package/lib/module/types/api/wallet-api.js.map +1 -0
  116. package/lib/module/types/blockchain/adapter.js +4 -0
  117. package/lib/module/types/blockchain/adapter.js.map +1 -0
  118. package/lib/module/types/blockchain/balance.js +4 -0
  119. package/lib/module/types/blockchain/balance.js.map +1 -0
  120. package/lib/module/types/blockchain/index.js +8 -0
  121. package/lib/module/types/blockchain/index.js.map +1 -0
  122. package/lib/module/types/blockchain/network.js +4 -0
  123. package/lib/module/types/blockchain/network.js.map +1 -0
  124. package/lib/module/types/blockchain/transaction.js +2 -0
  125. package/lib/module/types/blockchain/transaction.js.map +1 -0
  126. package/lib/module/types/common.js +2 -0
  127. package/lib/module/types/common.js.map +1 -0
  128. package/lib/module/types/index.js +31 -0
  129. package/lib/module/types/index.js.map +1 -0
  130. package/lib/module/types/onramp/countries.js +2 -0
  131. package/lib/module/types/onramp/countries.js.map +1 -0
  132. package/lib/module/types/onramp/currencies.js +2 -0
  133. package/lib/module/types/onramp/currencies.js.map +1 -0
  134. package/lib/module/types/onramp/errors.js +18 -0
  135. package/lib/module/types/onramp/errors.js.map +1 -0
  136. package/lib/module/types/onramp/index.js +8 -0
  137. package/lib/module/types/onramp/index.js.map +1 -0
  138. package/lib/module/types/onramp/quotes.js +2 -0
  139. package/lib/module/types/onramp/quotes.js.map +1 -0
  140. package/lib/module/types/siwx/config.js +4 -0
  141. package/lib/module/types/siwx/config.js.map +1 -0
  142. package/lib/module/types/siwx/index.js +7 -0
  143. package/lib/module/types/siwx/index.js.map +1 -0
  144. package/lib/module/types/siwx/message.js +4 -0
  145. package/lib/module/types/siwx/message.js.map +1 -0
  146. package/lib/module/types/siwx/storage.js +4 -0
  147. package/lib/module/types/siwx/storage.js.map +1 -0
  148. package/lib/module/types/siwx/verifier.js +30 -0
  149. package/lib/module/types/siwx/verifier.js.map +1 -0
  150. package/lib/module/types/storage.js +20 -0
  151. package/lib/module/types/storage.js.map +1 -0
  152. package/lib/module/types/swap/index.js +5 -0
  153. package/lib/module/types/swap/index.js.map +1 -0
  154. package/lib/module/types/swap/tokens.js +4 -0
  155. package/lib/module/types/swap/tokens.js.map +1 -0
  156. package/lib/module/types/ui.js +4 -0
  157. package/lib/module/{utils/TypeUtil.js.map → types/ui.js.map} +1 -1
  158. package/lib/module/types/wallet/connection.js +4 -0
  159. package/lib/module/types/wallet/connection.js.map +1 -0
  160. package/lib/module/types/wallet/connector.js +25 -0
  161. package/lib/module/types/wallet/connector.js.map +1 -0
  162. package/lib/module/types/wallet/index.js +7 -0
  163. package/lib/module/types/wallet/index.js.map +1 -0
  164. package/lib/module/types/wallet/wallet-info.js +4 -0
  165. package/lib/module/types/wallet/wallet-info.js.map +1 -0
  166. package/lib/module/utils/ConstantsUtil.js +47 -6
  167. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  168. package/lib/module/utils/ContractUtil.js +2 -0
  169. package/lib/module/utils/ContractUtil.js.map +1 -1
  170. package/lib/module/utils/DateUtil.js +2 -0
  171. package/lib/module/utils/DateUtil.js.map +1 -1
  172. package/lib/module/utils/ErrorUtil.js +2 -0
  173. package/lib/module/utils/ErrorUtil.js.map +1 -1
  174. package/lib/module/utils/NamesUtil.js +2 -0
  175. package/lib/module/utils/NamesUtil.js.map +1 -1
  176. package/lib/module/utils/NetworkUtil.js +5 -0
  177. package/lib/module/utils/NetworkUtil.js.map +1 -1
  178. package/lib/module/utils/NumberUtil.js +54 -11
  179. package/lib/module/utils/NumberUtil.js.map +1 -1
  180. package/lib/module/utils/PresetsUtil.js +36 -21
  181. package/lib/module/utils/PresetsUtil.js.map +1 -1
  182. package/lib/module/utils/StringUtil.js +9 -0
  183. package/lib/module/utils/StringUtil.js.map +1 -1
  184. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts +5 -0
  185. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts.map +1 -0
  186. package/lib/typescript/adapters/BlockchainAdapter.d.ts +26 -0
  187. package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -0
  188. package/lib/typescript/adapters/EvmAdapter.d.ts +26 -0
  189. package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -0
  190. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +7 -0
  191. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -0
  192. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts +2 -0
  193. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts.map +1 -0
  194. package/lib/typescript/index.d.ts +7 -1
  195. package/lib/typescript/index.d.ts.map +1 -1
  196. package/lib/typescript/networks/bitcoin.d.ts +4 -0
  197. package/lib/typescript/networks/bitcoin.d.ts.map +1 -0
  198. package/lib/typescript/networks/solana.d.ts +5 -0
  199. package/lib/typescript/networks/solana.d.ts.map +1 -0
  200. package/lib/typescript/types/api/blockchain-api.d.ts +183 -0
  201. package/lib/typescript/types/api/blockchain-api.d.ts.map +1 -0
  202. package/lib/typescript/types/api/events.d.ts +357 -0
  203. package/lib/typescript/types/api/events.d.ts.map +1 -0
  204. package/lib/typescript/types/api/index.d.ts +4 -0
  205. package/lib/typescript/types/api/index.d.ts.map +1 -0
  206. package/lib/typescript/types/api/wallet-api.d.ts +51 -0
  207. package/lib/typescript/types/api/wallet-api.d.ts.map +1 -0
  208. package/lib/typescript/types/blockchain/adapter.d.ts +40 -0
  209. package/lib/typescript/types/blockchain/adapter.d.ts.map +1 -0
  210. package/lib/typescript/types/blockchain/balance.d.ts +28 -0
  211. package/lib/typescript/types/blockchain/balance.d.ts.map +1 -0
  212. package/lib/typescript/types/blockchain/index.d.ts +5 -0
  213. package/lib/typescript/types/blockchain/index.d.ts.map +1 -0
  214. package/lib/typescript/types/blockchain/network.d.ts +47 -0
  215. package/lib/typescript/types/blockchain/network.d.ts.map +1 -0
  216. package/lib/typescript/{utils/TypeUtil.d.ts → types/blockchain/transaction.d.ts} +1 -22
  217. package/lib/typescript/types/blockchain/transaction.d.ts.map +1 -0
  218. package/lib/typescript/types/common.d.ts +24 -0
  219. package/lib/typescript/types/common.d.ts.map +1 -0
  220. package/lib/typescript/types/index.d.ts +10 -0
  221. package/lib/typescript/types/index.d.ts.map +1 -0
  222. package/lib/typescript/types/onramp/countries.d.ts +11 -0
  223. package/lib/typescript/types/onramp/countries.d.ts.map +1 -0
  224. package/lib/typescript/types/onramp/currencies.d.ts +30 -0
  225. package/lib/typescript/types/onramp/currencies.d.ts.map +1 -0
  226. package/lib/typescript/types/onramp/errors.d.ts +21 -0
  227. package/lib/typescript/types/onramp/errors.d.ts.map +1 -0
  228. package/lib/typescript/types/onramp/index.d.ts +5 -0
  229. package/lib/typescript/types/onramp/index.d.ts.map +1 -0
  230. package/lib/typescript/types/onramp/quotes.d.ts +45 -0
  231. package/lib/typescript/types/onramp/quotes.d.ts.map +1 -0
  232. package/lib/typescript/types/siwx/config.d.ts +73 -0
  233. package/lib/typescript/types/siwx/config.d.ts.map +1 -0
  234. package/lib/typescript/types/siwx/index.d.ts +5 -0
  235. package/lib/typescript/types/siwx/index.d.ts.map +1 -0
  236. package/lib/typescript/types/siwx/message.d.ts +92 -0
  237. package/lib/typescript/types/siwx/message.d.ts.map +1 -0
  238. package/lib/typescript/types/siwx/storage.d.ts +41 -0
  239. package/lib/typescript/types/siwx/storage.d.ts.map +1 -0
  240. package/lib/typescript/types/siwx/verifier.d.ts +28 -0
  241. package/lib/typescript/types/siwx/verifier.d.ts.map +1 -0
  242. package/lib/typescript/types/storage.d.ts +59 -0
  243. package/lib/typescript/types/storage.d.ts.map +1 -0
  244. package/lib/typescript/types/swap/index.d.ts +2 -0
  245. package/lib/typescript/types/swap/index.d.ts.map +1 -0
  246. package/lib/typescript/types/swap/tokens.d.ts +19 -0
  247. package/lib/typescript/types/swap/tokens.d.ts.map +1 -0
  248. package/lib/typescript/types/ui.d.ts +26 -0
  249. package/lib/typescript/types/ui.d.ts.map +1 -0
  250. package/lib/typescript/types/wallet/connection.d.ts +31 -0
  251. package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
  252. package/lib/typescript/types/wallet/connector.d.ts +59 -0
  253. package/lib/typescript/types/wallet/connector.d.ts.map +1 -0
  254. package/lib/typescript/types/wallet/index.d.ts +4 -0
  255. package/lib/typescript/types/wallet/index.d.ts.map +1 -0
  256. package/lib/typescript/types/wallet/wallet-info.d.ts +37 -0
  257. package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -0
  258. package/lib/typescript/utils/ConstantsUtil.d.ts +43 -4
  259. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  260. package/lib/typescript/utils/NetworkUtil.d.ts +2 -0
  261. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  262. package/lib/typescript/utils/NumberUtil.d.ts +39 -11
  263. package/lib/typescript/utils/NumberUtil.d.ts.map +1 -1
  264. package/lib/typescript/utils/PresetsUtil.d.ts +1 -6
  265. package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
  266. package/lib/typescript/utils/StringUtil.d.ts +1 -0
  267. package/lib/typescript/utils/StringUtil.d.ts.map +1 -1
  268. package/package.json +9 -18
  269. package/src/adapters/BitcoinBaseAdapter.ts +5 -0
  270. package/src/adapters/BlockchainAdapter.ts +136 -0
  271. package/src/adapters/EvmAdapter.ts +247 -0
  272. package/src/adapters/SolanaBaseAdapter.ts +7 -0
  273. package/src/adapters/__tests__/EvmAdapter.test.ts +126 -0
  274. package/src/index.ts +8 -1
  275. package/src/networks/bitcoin.ts +32 -0
  276. package/src/networks/solana.ts +44 -0
  277. package/src/types/api/blockchain-api.ts +213 -0
  278. package/src/types/api/events.ts +462 -0
  279. package/src/types/api/index.ts +4 -0
  280. package/src/types/api/wallet-api.ts +71 -0
  281. package/src/types/blockchain/adapter.ts +52 -0
  282. package/src/types/blockchain/balance.ts +31 -0
  283. package/src/types/blockchain/index.ts +5 -0
  284. package/src/types/blockchain/network.ts +39 -0
  285. package/src/{utils/TypeUtil.ts → types/blockchain/transaction.ts} +0 -26
  286. package/src/types/common.ts +56 -0
  287. package/src/types/index.ts +28 -0
  288. package/src/types/onramp/countries.ts +11 -0
  289. package/src/types/onramp/currencies.ts +32 -0
  290. package/src/types/onramp/errors.ts +22 -0
  291. package/src/types/onramp/index.ts +5 -0
  292. package/src/types/onramp/quotes.ts +46 -0
  293. package/src/types/siwx/config.ts +73 -0
  294. package/src/types/siwx/index.ts +4 -0
  295. package/src/types/siwx/message.ts +92 -0
  296. package/src/types/siwx/storage.ts +44 -0
  297. package/src/types/siwx/verifier.ts +32 -0
  298. package/src/types/storage.ts +64 -0
  299. package/src/types/swap/index.ts +2 -0
  300. package/src/types/swap/tokens.ts +21 -0
  301. package/src/types/ui.ts +26 -0
  302. package/src/types/wallet/connection.ts +34 -0
  303. package/src/types/wallet/connector.ts +83 -0
  304. package/src/types/wallet/index.ts +4 -0
  305. package/src/types/wallet/wallet-info.ts +42 -0
  306. package/src/utils/ConstantsUtil.ts +48 -7
  307. package/src/utils/NetworkUtil.ts +5 -0
  308. package/src/utils/NumberUtil.ts +54 -11
  309. package/src/utils/PresetsUtil.ts +34 -26
  310. package/src/utils/StringUtil.ts +7 -0
  311. package/lib/commonjs/utils/TypeUtil.js +0 -2
  312. package/lib/module/utils/TypeUtil.js +0 -2
  313. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
@@ -0,0 +1,71 @@
1
+ import type { CaipNetworkId } from '../common';
2
+
3
+ export interface WcWallet {
4
+ id: string;
5
+ name: string;
6
+ homepage?: string;
7
+ image_id?: string;
8
+ image_url?: string;
9
+ order?: number;
10
+ mobile_link?: string | null;
11
+ desktop_link?: string | null;
12
+ webapp_link?: string | null;
13
+ link_mode?: string | null;
14
+ app_store?: string | null;
15
+ play_store?: string | null;
16
+ chains?: readonly CaipNetworkId[];
17
+ badge_type?: 'certified' | 'none';
18
+ }
19
+
20
+ export interface DataWallet {
21
+ id: string;
22
+ ios_schema?: string;
23
+ android_app_id?: string;
24
+ }
25
+
26
+ export interface ApiGetWalletsRequest {
27
+ page: number;
28
+ entries: number;
29
+ search?: string;
30
+ include?: string[];
31
+ exclude?: string[];
32
+ }
33
+
34
+ export interface ApiGetWalletsResponse {
35
+ data: WcWallet[];
36
+ count: number;
37
+ }
38
+
39
+ export interface ApiGetDataWalletsResponse {
40
+ data: DataWallet[];
41
+ count: number;
42
+ }
43
+
44
+ export interface ApiGetAnalyticsConfigResponse {
45
+ isAnalyticsEnabled: boolean;
46
+ }
47
+
48
+ export type CustomWallet = Pick<
49
+ WcWallet,
50
+ | 'id'
51
+ | 'name'
52
+ | 'homepage'
53
+ | 'image_url'
54
+ | 'image_id'
55
+ | 'mobile_link'
56
+ | 'desktop_link'
57
+ | 'webapp_link'
58
+ | 'link_mode'
59
+ | 'app_store'
60
+ | 'play_store'
61
+ > & {
62
+ android_app_id?: string;
63
+ ios_schema?: string;
64
+ };
65
+
66
+ export type UniversalProviderConfigOverride = {
67
+ methods?: Record<string, string[]>;
68
+ chains?: Record<string, string[]>;
69
+ events?: Record<string, string[]>;
70
+ rpcMap?: Record<string, string>;
71
+ };
@@ -0,0 +1,52 @@
1
+ import type { ChainNamespace, CaipAddress, AdapterType } from '../common';
2
+ import type { WalletConnector } from '../wallet';
3
+ import type { BalanceChangedEvent } from './balance';
4
+
5
+ export interface BlockchainAdapterConfig {
6
+ supportedNamespace: ChainNamespace;
7
+ adapterType: AdapterType;
8
+ }
9
+
10
+ export interface BlockchainAdapterInitParams {
11
+ connector: WalletConnector;
12
+ }
13
+
14
+ export interface AdapterEvents {
15
+ accountsChanged: (event: AccountsChangedEvent) => void;
16
+ chainChanged: (event: ChainChangedEvent) => void;
17
+ disconnect: (event: DisconnectEvent) => void;
18
+ balanceChanged: (event: BalanceChangedEvent) => void;
19
+ }
20
+
21
+ export type AccountsChangedEvent = {
22
+ accounts: CaipAddress[];
23
+ };
24
+
25
+ export type ChainChangedEvent = {
26
+ chainId: string;
27
+ };
28
+
29
+ export type DisconnectEvent = undefined;
30
+
31
+ export interface Provider {
32
+ connect<T>(params?: any): Promise<T>;
33
+ disconnect(): Promise<void>;
34
+ request<T = unknown>(
35
+ args: RequestArguments,
36
+ chain?: string | undefined,
37
+ expiry?: number | undefined
38
+ ): Promise<T>;
39
+ on(event: string, listener: (args?: any) => void): any;
40
+ off(event: string, listener: (args?: any) => void): any;
41
+ }
42
+
43
+ export interface RequestArguments {
44
+ method: string;
45
+ params?: unknown[] | Record<string, unknown> | object | undefined;
46
+ }
47
+
48
+ export interface ConnectionResponse {
49
+ accounts: string[];
50
+ chainId: string;
51
+ [key: string]: any;
52
+ }
@@ -0,0 +1,31 @@
1
+ import type { CaipAddress } from '../common';
2
+ import type { Tokens } from '../wallet';
3
+ import type { AppKitNetwork } from './network';
4
+
5
+ export interface Balance {
6
+ name?: string;
7
+ amount: string;
8
+ symbol: string;
9
+ quantity?: {
10
+ decimals: string;
11
+ numeric: string;
12
+ };
13
+ chainId?: string;
14
+ address?: CaipAddress | string; // contract address
15
+ value?: number; //total value of the amount in currency
16
+ price?: number; //price of the token in currency
17
+ iconUrl?: string;
18
+ }
19
+
20
+ export interface GetBalanceParams {
21
+ network: AppKitNetwork;
22
+ address?: CaipAddress;
23
+ tokens?: Tokens;
24
+ }
25
+
26
+ export type GetBalanceResponse = Balance;
27
+
28
+ export type BalanceChangedEvent = {
29
+ address: CaipAddress;
30
+ balance: Balance;
31
+ };
@@ -0,0 +1,5 @@
1
+ // Blockchain types barrel export
2
+ export * from './adapter';
3
+ export * from './balance';
4
+ export * from './network';
5
+ export * from './transaction';
@@ -0,0 +1,39 @@
1
+ import type { ChainNamespace, CaipNetworkId } from '../common';
2
+
3
+ export type Network = {
4
+ // Core viem/chain properties
5
+ id: number | string;
6
+ name: string;
7
+ nativeCurrency: { name: string; symbol: string; decimals: number };
8
+ rpcUrls: {
9
+ default: { http: readonly string[] };
10
+ [key: string]: { http: readonly string[] } | undefined;
11
+ };
12
+ blockExplorers?: {
13
+ default: { name: string; url: string };
14
+ [key: string]: { name: string; url: string } | undefined;
15
+ };
16
+
17
+ // AppKit specific / CAIP properties (Optional in type, but needed in practice)
18
+ chainNamespace?: ChainNamespace; // e.g., 'eip155'
19
+ caipNetworkId?: CaipNetworkId; // e.g., 'eip155:1'
20
+ testnet?: boolean;
21
+ deprecatedCaipNetworkId?: CaipNetworkId; // for Solana deprecated id
22
+ imageUrl?: string;
23
+ };
24
+
25
+ export type AppKitNetwork = Network & {
26
+ chainNamespace: ChainNamespace; // mandatory for AppKitNetwork
27
+ caipNetworkId: CaipNetworkId; // mandatory for AppKitNetwork
28
+ };
29
+
30
+ export interface CaipNetwork {
31
+ id: CaipNetworkId;
32
+ name?: string;
33
+ imageId?: string;
34
+ imageUrl?: string;
35
+ }
36
+
37
+ export interface AppKitOpenOptions {
38
+ view: 'Account' | 'Connect' | 'WalletConnect' | 'Networks' | 'Swap' | 'OnRamp';
39
+ }
@@ -1,19 +1,3 @@
1
- export interface Balance {
2
- name: string;
3
- symbol: string;
4
- chainId: string;
5
- address?: string;
6
- value?: number;
7
- price: number;
8
- quantity: BalanceQuantity;
9
- iconUrl: string;
10
- }
11
-
12
- type BalanceQuantity = {
13
- decimals: string;
14
- numeric: string;
15
- };
16
-
17
1
  export type TransactionStatus = 'confirmed' | 'failed' | 'pending';
18
2
  export type TransactionDirection = 'in' | 'out' | 'self';
19
3
  export type TransactionImage = {
@@ -85,13 +69,3 @@ export interface TransactionDetail {
85
69
  export interface TransactionQuantity {
86
70
  numeric: string;
87
71
  }
88
-
89
- export type SocialProvider = 'apple' | 'x' | 'discord' | 'farcaster';
90
-
91
- export type ThemeMode = 'dark' | 'light';
92
-
93
- export interface ThemeVariables {
94
- accent?: string;
95
- }
96
-
97
- export type ConnectorType = 'WALLET_CONNECT' | 'COINBASE' | 'AUTH' | 'EXTERNAL';
@@ -0,0 +1,56 @@
1
+ // Common types used across the AppKit ecosystem
2
+
3
+ export type CaipAddress = `${string}:${string}:${string}`;
4
+
5
+ export type CaipNetworkId = `${string}:${string}`;
6
+
7
+ export type ChainNamespace = 'eip155' | 'solana' | 'bip122';
8
+
9
+ export type AdapterType = 'solana' | 'wagmi' | 'ethers' | 'universal' | 'bip122';
10
+
11
+ export type AccountType = 'eoa' | 'smartAccount';
12
+
13
+ export type SocialProvider =
14
+ | 'google'
15
+ | 'facebook'
16
+ | 'github'
17
+ | 'apple'
18
+ | 'x'
19
+ | 'discord'
20
+ | 'email'
21
+ | 'farcaster';
22
+
23
+ export type ThemeMode = 'dark' | 'light';
24
+
25
+ export interface ThemeVariables {
26
+ accent?: string;
27
+ }
28
+
29
+ export interface BaseError {
30
+ message?: string;
31
+ }
32
+
33
+ export type ProjectId = string;
34
+
35
+ export type Platform = 'mobile' | 'web' | 'qrcode' | 'email' | 'unsupported';
36
+
37
+ export type SdkType = 'appkit';
38
+
39
+ export type SdkVersion = `react-native-${string}-${string}`;
40
+
41
+ export type RequestCache =
42
+ | 'default'
43
+ | 'force-cache'
44
+ | 'no-cache'
45
+ | 'no-store'
46
+ | 'only-if-cached'
47
+ | 'reload';
48
+
49
+ export type CaipNamespaces = Record<
50
+ string,
51
+ {
52
+ chains: CaipNetworkId[];
53
+ methods: string[];
54
+ events: string[];
55
+ }
56
+ >;
@@ -0,0 +1,28 @@
1
+ // Main types barrel export - re-exports all types from all domains
2
+
3
+ // Common types
4
+ export * from './common';
5
+
6
+ // Blockchain types
7
+ export * from './blockchain';
8
+
9
+ // Wallet types
10
+ export * from './wallet';
11
+
12
+ // API types
13
+ export * from './api';
14
+
15
+ // Swap types
16
+ export * from './swap';
17
+
18
+ // OnRamp types
19
+ export * from './onramp';
20
+
21
+ // SIWX types
22
+ export * from './siwx';
23
+
24
+ // Storage types
25
+ export * from './storage';
26
+
27
+ // UI types
28
+ export * from './ui';
@@ -0,0 +1,11 @@
1
+ export type OnRampCountry = {
2
+ countryCode: string;
3
+ flagImageUrl: string;
4
+ name: string;
5
+ };
6
+
7
+ export type OnRampCountryDefaults = {
8
+ countryCode: string;
9
+ defaultCurrencyCode: string;
10
+ defaultPaymentMethods: string[];
11
+ };
@@ -0,0 +1,32 @@
1
+ export type OnRampFiatCurrency = {
2
+ currencyCode: string;
3
+ name: string;
4
+ symbolImageUrl: string;
5
+ };
6
+
7
+ export type OnRampCryptoCurrency = {
8
+ currencyCode: string;
9
+ name: string;
10
+ chainCode: string;
11
+ chainName: string;
12
+ chainId: string;
13
+ contractAddress: string | null;
14
+ symbolImageUrl: string;
15
+ };
16
+
17
+ export type OnRampFiatLimit = {
18
+ currencyCode: string;
19
+ defaultAmount: number | null;
20
+ minimumAmount: number;
21
+ maximumAmount: number;
22
+ };
23
+
24
+ export type OnRampTransactionResult = {
25
+ purchaseCurrency: string | null;
26
+ purchaseAmount: string | null;
27
+ purchaseImageUrl: string | null;
28
+ paymentCurrency: string | null;
29
+ paymentAmount: string | null;
30
+ status: string | null;
31
+ network: string | null;
32
+ };
@@ -0,0 +1,22 @@
1
+ export const OnRampErrorType = {
2
+ AMOUNT_TOO_LOW: 'INVALID_AMOUNT_TOO_LOW',
3
+ AMOUNT_TOO_HIGH: 'INVALID_AMOUNT_TOO_HIGH',
4
+ INVALID_AMOUNT: 'INVALID_AMOUNT',
5
+ INCOMPATIBLE_REQUEST: 'INCOMPATIBLE_REQUEST',
6
+ BAD_REQUEST: 'BAD_REQUEST',
7
+ NO_VALID_QUOTES: 'NO_VALID_QUOTES',
8
+ FAILED_TO_LOAD: 'FAILED_TO_LOAD',
9
+ FAILED_TO_LOAD_COUNTRIES: 'FAILED_TO_LOAD_COUNTRIES',
10
+ FAILED_TO_LOAD_PROVIDERS: 'FAILED_TO_LOAD_PROVIDERS',
11
+ FAILED_TO_LOAD_METHODS: 'FAILED_TO_LOAD_METHODS',
12
+ FAILED_TO_LOAD_CURRENCIES: 'FAILED_TO_LOAD_CURRENCIES',
13
+ FAILED_TO_LOAD_LIMITS: 'FAILED_TO_LOAD_LIMITS',
14
+ UNKNOWN: 'UNKNOWN_ERROR'
15
+ } as const;
16
+
17
+ export type OnRampErrorTypeValues = (typeof OnRampErrorType)[keyof typeof OnRampErrorType];
18
+
19
+ export interface OnRampError {
20
+ type: OnRampErrorTypeValues;
21
+ message: string;
22
+ }
@@ -0,0 +1,5 @@
1
+ // OnRamp types barrel export
2
+ export * from './countries';
3
+ export * from './currencies';
4
+ export * from './quotes';
5
+ export * from './errors';
@@ -0,0 +1,46 @@
1
+ export type OnRampPaymentMethod = {
2
+ logos: {
3
+ dark: string;
4
+ light: string;
5
+ };
6
+ name: string;
7
+ paymentMethod: string;
8
+ paymentType: string;
9
+ };
10
+
11
+ export type OnRampQuote = {
12
+ countryCode: string;
13
+ customerScore: number;
14
+ destinationAmount: number;
15
+ destinationAmountWithoutFees: number;
16
+ destinationCurrencyCode: string;
17
+ exchangeRate: number;
18
+ fiatAmountWithoutFees: number;
19
+ lowKyc: boolean;
20
+ networkFee: number;
21
+ paymentMethodType: string;
22
+ serviceProvider: string;
23
+ sourceAmount: number;
24
+ sourceAmountWithoutFees: number;
25
+ sourceCurrencyCode: string;
26
+ totalFee: number;
27
+ transactionFee: number;
28
+ transactionType: string;
29
+ };
30
+
31
+ export type OnRampServiceProvider = {
32
+ categories: string[];
33
+ categoryStatuses: {
34
+ additionalProp: string;
35
+ };
36
+ logos: {
37
+ dark: string;
38
+ darkShort: string;
39
+ light: string;
40
+ lightShort: string;
41
+ };
42
+ name: string;
43
+ serviceProvider: string;
44
+ status: string;
45
+ websiteUrl: string;
46
+ };
@@ -0,0 +1,73 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ import type { SIWXSession, SIWXMessage } from './message';
3
+
4
+ /**
5
+ * This interface represents the SIWX configuration plugin, which is used to create and manage SIWX messages and sessions.
6
+ * You may use it to create a custom implementation following your needs, but watch close for the methods requirements.
7
+ */
8
+ export interface SIWXConfig {
9
+ /**
10
+ * This method will be called to create a new message to be signed by the user.
11
+ *
12
+ * Constraints:
13
+ * - The message MUST be unique and contain all the necessary information to verify the user's identity.
14
+ * - SIWXMessage.toString() method MUST be implemented to return the message string.
15
+ *
16
+ * @param input SIWXMessage.Input
17
+ * @returns SIWXMessage
18
+ */
19
+ createMessage: (input: SIWXMessage.Input) => Promise<SIWXMessage>;
20
+ /**
21
+ * This method will be called to store a new single session.
22
+ *
23
+ * Constraints:
24
+ * - This method MUST verify if the session is valid and store it in the storage successfully.
25
+ *
26
+ * @param session SIWXSession
27
+ */
28
+ addSession: (session: SIWXSession) => Promise<void>;
29
+ /**
30
+ * This method will be called to revoke all the sessions stored for a specific chain and address.
31
+ *
32
+ * Constraints:
33
+ * - This method MUST delete all the sessions stored for the specific chain and address successfully.
34
+ *
35
+ * @param chainId CaipNetworkId
36
+ * @param address string
37
+ */
38
+ revokeSession: (chainId: CaipNetworkId, address: string) => Promise<void>;
39
+ /**
40
+ * This method will be called to replace all the sessions in the storage with the new ones.
41
+ *
42
+ * Constraints:
43
+ * - This method MUST verify all the sessions before storing them in the storage;
44
+ * - This method MUST replace all the sessions in the storage with the new ones succesfully otherwise it MUST throw an error.
45
+ *
46
+ * @param sessions SIWXSession[]
47
+ */
48
+ setSessions: (sessions: SIWXSession[]) => Promise<void>;
49
+ /**
50
+ * This method will be called to get all the sessions stored for a specific chain and address.
51
+ *
52
+ * Constraints:
53
+ * - This method MUST return only sessions that are verified and valid;
54
+ * - This method MUST NOT return expired sessions.
55
+ *
56
+ * @param chainId CaipNetworkId
57
+ * @param address string
58
+ * @returns
59
+ */
60
+ getSessions: (chainId: CaipNetworkId, address: string) => Promise<SIWXSession[]>;
61
+ /**
62
+ * This method determines whether the wallet stays connected when the user denies the signature request.
63
+ *
64
+ * @returns {boolean}
65
+ */
66
+ getRequired?: () => boolean;
67
+ /**
68
+ * This flag determines whether the session should be cleared when the user disconnects.
69
+ *
70
+ * @default true
71
+ */
72
+ signOutOnDisconnect?: boolean;
73
+ }
@@ -0,0 +1,4 @@
1
+ export * from './config';
2
+ export * from './message';
3
+ export * from './verifier';
4
+ export * from './storage';
@@ -0,0 +1,92 @@
1
+ import type { CaipNetworkId } from '../common';
2
+
3
+ /**
4
+ * This interface represents a SIWX session, which is used to store the user's identity information.
5
+ */
6
+ export interface SIWXSession {
7
+ data: SIWXMessage.Data;
8
+ message: string;
9
+ signature: string;
10
+ cacao?: Cacao;
11
+ }
12
+ /**
13
+ * This interface represents a SIWX message, which is used to create a message to be signed by the user.
14
+ * This must contain the necessary information to verify the user's identity and how to generate the string message.
15
+ */
16
+ export interface SIWXMessage extends SIWXMessage.Data, SIWXMessage.Methods {}
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
+ * This interface represents the SIWX message input.
24
+ * Here must contain what is different for each user of the application.
25
+ */
26
+ interface Input {
27
+ accountAddress: string;
28
+ chainId: CaipNetworkId;
29
+ notBefore?: Timestamp;
30
+ }
31
+ /**
32
+ * This interface represents the SIWX message metadata.
33
+ * Here must contain the main data related to the app.
34
+ */
35
+ interface Metadata {
36
+ domain: string;
37
+ uri: string;
38
+ version: string;
39
+ nonce: string;
40
+ statement?: string;
41
+ resources?: string[];
42
+ }
43
+ /**
44
+ * This interface represents the SIWX message identifier.
45
+ * Here must contain the request id and the timestamps.
46
+ */
47
+ interface Identifier {
48
+ requestId?: string;
49
+ issuedAt?: Timestamp;
50
+ expirationTime?: Timestamp;
51
+ }
52
+ /**
53
+ * This interface represents the SIWX message methods.
54
+ * Here must contain the method to generate the message string and any other method performed by the SIWX message.
55
+ */
56
+ interface Methods {
57
+ toString: () => string;
58
+ }
59
+ /**
60
+ * The timestamp is a UTC string representing the time in ISO 8601 format.
61
+ */
62
+ type Timestamp = string;
63
+ }
64
+
65
+ interface CacaoHeader {
66
+ t: 'caip122';
67
+ }
68
+
69
+ interface CacaoPayload {
70
+ domain: string;
71
+ aud: string;
72
+ nonce: string;
73
+ iss: string;
74
+ version?: string;
75
+ iat?: string;
76
+ nbf?: string;
77
+ exp?: string;
78
+ statement?: string;
79
+ requestId?: string;
80
+ resources?: string[];
81
+ type?: string;
82
+ }
83
+
84
+ interface Cacao {
85
+ h: CacaoHeader;
86
+ p: CacaoPayload;
87
+ s: {
88
+ t: 'eip191' | 'eip1271';
89
+ s: string;
90
+ m?: string;
91
+ };
92
+ }
@@ -0,0 +1,44 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ import type { SIWXSession } from './message';
3
+
4
+ /**
5
+ * This is the interface for a SIWX storage.
6
+ */
7
+ export interface SIWXStorage {
8
+ /**
9
+ * Adds a new session for the storage.
10
+ * This method should not verify the session, only store it.
11
+ *
12
+ * @param session SIWXSession
13
+ * @returns Promise<void>
14
+ */
15
+ add(session: SIWXSession): Promise<void>;
16
+
17
+ /**
18
+ * Deletes a session from the storage.
19
+ *
20
+ * @param chainId CaipNetworkId
21
+ * @param address string
22
+ * @returns Promise<void>
23
+ */
24
+ delete(chainId: CaipNetworkId, address: string): Promise<void>;
25
+
26
+ /**
27
+ * Gets a list of sessions for a given chainId and address.
28
+ * This method should not verify sessions, only return the sessions that are stored.
29
+ *
30
+ * @param chainId CaipNetworkId
31
+ * @param address string
32
+ * @returns Promise<SIWXSession[]>
33
+ */
34
+ get(chainId: CaipNetworkId, address: string): Promise<SIWXSession[]>;
35
+
36
+ /**
37
+ * Replaces the current sessions with the new list of sessions.
38
+ * This method should not verify sessions, only store them.
39
+ *
40
+ * @param sessions SIWXSession[]
41
+ * @returns Promise<void>
42
+ */
43
+ set(sessions: SIWXSession[]): Promise<void>;
44
+ }
@@ -0,0 +1,32 @@
1
+ import type { ChainNamespace } from '../common';
2
+ import type { SIWXSession } from './message';
3
+
4
+ /**
5
+ * This is the base class for a SIWX verifier.
6
+ */
7
+ export abstract class SIWXVerifier {
8
+ /**
9
+ * The chain namespace that this verifier should verify.
10
+ */
11
+ public abstract readonly chainNamespace: ChainNamespace;
12
+
13
+ /**
14
+ * This method should return true if the verifier should verify the session.
15
+ * By default it will check by the chain namespace, but you may override it for a specific requirement.
16
+ *
17
+ * @param session SIWXSession
18
+ * @returns boolean
19
+ */
20
+ public shouldVerify(session: SIWXSession): boolean {
21
+ return session.data.chainId.startsWith(this.chainNamespace);
22
+ }
23
+
24
+ /**
25
+ * This method should verify the session.
26
+ * You must implement this method with the verification logic.
27
+ *
28
+ * @param session SIWXSession
29
+ * @returns Promise<boolean> - If `true` means the session is valid.
30
+ */
31
+ abstract verify(session: SIWXSession): Promise<boolean>;
32
+ }