@reown/appkit-common-react-native 2.0.0-alpha.1 → 2.0.0-alpha.3

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 (291) hide show
  1. package/lib/commonjs/adapters/BlockchainAdapter.js +28 -13
  2. package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -1
  3. package/lib/commonjs/adapters/EvmAdapter.js +126 -16
  4. package/lib/commonjs/adapters/EvmAdapter.js.map +1 -1
  5. package/lib/commonjs/adapters/SolanaBaseAdapter.js +1 -3
  6. package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -1
  7. package/lib/commonjs/contracts/erc20.js.map +1 -1
  8. package/lib/commonjs/contracts/usdt.js.map +1 -1
  9. package/lib/commonjs/index.js +4 -4
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/networks/bitcoin.js.map +1 -1
  12. package/lib/commonjs/networks/solana.js.map +1 -1
  13. package/lib/commonjs/package.json +1 -0
  14. package/lib/commonjs/types/api/blockchain-api.js +15 -0
  15. package/lib/commonjs/types/api/blockchain-api.js.map +1 -0
  16. package/lib/commonjs/types/api/events.js +6 -0
  17. package/lib/commonjs/types/api/events.js.map +1 -0
  18. package/lib/commonjs/types/api/index.js +39 -0
  19. package/lib/commonjs/types/api/index.js.map +1 -0
  20. package/lib/commonjs/types/api/wallet-api.js +2 -0
  21. package/lib/commonjs/types/api/wallet-api.js.map +1 -0
  22. package/lib/commonjs/types/blockchain/adapter.js +6 -0
  23. package/lib/commonjs/types/blockchain/adapter.js.map +1 -0
  24. package/lib/commonjs/types/blockchain/balance.js +6 -0
  25. package/lib/commonjs/types/blockchain/balance.js.map +1 -0
  26. package/lib/commonjs/types/blockchain/index.js +50 -0
  27. package/lib/commonjs/types/blockchain/index.js.map +1 -0
  28. package/lib/commonjs/types/blockchain/network.js +6 -0
  29. package/lib/commonjs/types/blockchain/network.js.map +1 -0
  30. package/lib/commonjs/types/blockchain/transaction.js +2 -0
  31. package/lib/commonjs/types/blockchain/transaction.js.map +1 -0
  32. package/lib/commonjs/types/common.js +2 -0
  33. package/lib/commonjs/types/common.js.map +1 -0
  34. package/lib/commonjs/types/index.js +105 -0
  35. package/lib/commonjs/types/index.js.map +1 -0
  36. package/lib/commonjs/types/onramp/countries.js +2 -0
  37. package/lib/commonjs/types/onramp/countries.js.map +1 -0
  38. package/lib/commonjs/types/onramp/currencies.js +2 -0
  39. package/lib/commonjs/types/onramp/currencies.js.map +1 -0
  40. package/lib/commonjs/types/onramp/errors.js +22 -0
  41. package/lib/commonjs/types/onramp/errors.js.map +1 -0
  42. package/lib/commonjs/types/onramp/index.js +50 -0
  43. package/lib/commonjs/types/onramp/index.js.map +1 -0
  44. package/lib/commonjs/types/onramp/quotes.js +2 -0
  45. package/lib/commonjs/types/onramp/quotes.js.map +1 -0
  46. package/lib/commonjs/types/siwe/config.js +6 -0
  47. package/lib/commonjs/types/siwe/config.js.map +1 -0
  48. package/lib/commonjs/types/siwe/index.js +28 -0
  49. package/lib/commonjs/types/siwe/index.js.map +1 -0
  50. package/lib/commonjs/types/siwe/message.js +6 -0
  51. package/lib/commonjs/types/siwe/message.js.map +1 -0
  52. package/lib/commonjs/types/storage.js +2 -0
  53. package/lib/commonjs/types/storage.js.map +1 -0
  54. package/lib/commonjs/types/swap/index.js +17 -0
  55. package/lib/commonjs/types/swap/index.js.map +1 -0
  56. package/lib/commonjs/types/swap/tokens.js +6 -0
  57. package/lib/commonjs/types/swap/tokens.js.map +1 -0
  58. package/lib/commonjs/types/ui.js +6 -0
  59. package/lib/commonjs/types/ui.js.map +1 -0
  60. package/lib/commonjs/types/wallet/connection.js +6 -0
  61. package/lib/commonjs/types/wallet/connection.js.map +1 -0
  62. package/lib/commonjs/{utils/TypeUtil.js → types/wallet/connector.js} +7 -13
  63. package/lib/commonjs/types/wallet/connector.js.map +1 -0
  64. package/lib/commonjs/types/wallet/index.js +39 -0
  65. package/lib/commonjs/types/wallet/index.js.map +1 -0
  66. package/lib/commonjs/types/wallet/wallet-info.js +6 -0
  67. package/lib/commonjs/types/wallet/wallet-info.js.map +1 -0
  68. package/lib/commonjs/utils/ConstantsUtil.js +34 -6
  69. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  70. package/lib/commonjs/utils/ContractUtil.js.map +1 -1
  71. package/lib/commonjs/utils/DateUtil.js.map +1 -1
  72. package/lib/commonjs/utils/ErrorUtil.js +2 -2
  73. package/lib/commonjs/utils/ErrorUtil.js.map +1 -1
  74. package/lib/commonjs/utils/NamesUtil.js.map +1 -1
  75. package/lib/commonjs/utils/NetworkUtil.js +3 -0
  76. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  77. package/lib/commonjs/utils/NumberUtil.js +1 -2
  78. package/lib/commonjs/utils/NumberUtil.js.map +1 -1
  79. package/lib/commonjs/utils/PresetsUtil.js +0 -18
  80. package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
  81. package/lib/commonjs/utils/StringUtil.js +7 -0
  82. package/lib/commonjs/utils/StringUtil.js.map +1 -1
  83. package/lib/module/adapters/BlockchainAdapter.js +30 -13
  84. package/lib/module/adapters/BlockchainAdapter.js.map +1 -1
  85. package/lib/module/adapters/EvmAdapter.js +129 -16
  86. package/lib/module/adapters/EvmAdapter.js.map +1 -1
  87. package/lib/module/adapters/SolanaBaseAdapter.js +3 -3
  88. package/lib/module/adapters/SolanaBaseAdapter.js.map +1 -1
  89. package/lib/module/contracts/erc20.js +2 -0
  90. package/lib/module/contracts/erc20.js.map +1 -1
  91. package/lib/module/contracts/usdt.js +2 -0
  92. package/lib/module/contracts/usdt.js.map +1 -1
  93. package/lib/module/index.js +3 -1
  94. package/lib/module/index.js.map +1 -1
  95. package/lib/module/networks/bitcoin.js +2 -0
  96. package/lib/module/networks/bitcoin.js.map +1 -1
  97. package/lib/module/networks/solana.js +2 -0
  98. package/lib/module/networks/solana.js.map +1 -1
  99. package/lib/module/types/api/blockchain-api.js +10 -0
  100. package/lib/module/types/api/blockchain-api.js.map +1 -0
  101. package/lib/module/types/api/events.js +4 -0
  102. package/lib/module/types/api/events.js.map +1 -0
  103. package/lib/module/types/api/index.js +7 -0
  104. package/lib/module/types/api/index.js.map +1 -0
  105. package/lib/module/types/api/wallet-api.js +2 -0
  106. package/lib/module/types/api/wallet-api.js.map +1 -0
  107. package/lib/module/types/blockchain/adapter.js +4 -0
  108. package/lib/module/types/blockchain/adapter.js.map +1 -0
  109. package/lib/module/types/blockchain/balance.js +4 -0
  110. package/lib/module/types/blockchain/balance.js.map +1 -0
  111. package/lib/module/types/blockchain/index.js +8 -0
  112. package/lib/module/types/blockchain/index.js.map +1 -0
  113. package/lib/module/types/blockchain/network.js +4 -0
  114. package/lib/module/types/blockchain/network.js.map +1 -0
  115. package/lib/module/types/blockchain/transaction.js +2 -0
  116. package/lib/module/types/blockchain/transaction.js.map +1 -0
  117. package/lib/module/types/common.js +2 -0
  118. package/lib/module/types/common.js.map +1 -0
  119. package/lib/module/types/index.js +31 -0
  120. package/lib/module/types/index.js.map +1 -0
  121. package/lib/module/types/onramp/countries.js +2 -0
  122. package/lib/module/types/onramp/countries.js.map +1 -0
  123. package/lib/module/types/onramp/currencies.js +2 -0
  124. package/lib/module/types/onramp/currencies.js.map +1 -0
  125. package/lib/module/types/onramp/errors.js +18 -0
  126. package/lib/module/types/onramp/errors.js.map +1 -0
  127. package/lib/module/types/onramp/index.js +8 -0
  128. package/lib/module/types/onramp/index.js.map +1 -0
  129. package/lib/module/types/onramp/quotes.js +2 -0
  130. package/lib/module/types/onramp/quotes.js.map +1 -0
  131. package/lib/module/types/siwe/config.js +4 -0
  132. package/lib/module/types/siwe/config.js.map +1 -0
  133. package/lib/module/types/siwe/index.js +6 -0
  134. package/lib/module/types/siwe/index.js.map +1 -0
  135. package/lib/module/types/siwe/message.js +4 -0
  136. package/lib/module/types/siwe/message.js.map +1 -0
  137. package/lib/module/types/storage.js +2 -0
  138. package/lib/module/types/storage.js.map +1 -0
  139. package/lib/module/types/swap/index.js +5 -0
  140. package/lib/module/types/swap/index.js.map +1 -0
  141. package/lib/module/types/swap/tokens.js +4 -0
  142. package/lib/module/types/swap/tokens.js.map +1 -0
  143. package/lib/module/types/ui.js +4 -0
  144. package/lib/module/types/ui.js.map +1 -0
  145. package/lib/module/types/wallet/connection.js +4 -0
  146. package/lib/module/types/wallet/connection.js.map +1 -0
  147. package/lib/module/{utils/TypeUtil.js → types/wallet/connector.js} +9 -14
  148. package/lib/module/types/wallet/connector.js.map +1 -0
  149. package/lib/module/types/wallet/index.js +7 -0
  150. package/lib/module/types/wallet/index.js.map +1 -0
  151. package/lib/module/types/wallet/wallet-info.js +4 -0
  152. package/lib/module/types/wallet/wallet-info.js.map +1 -0
  153. package/lib/module/utils/ConstantsUtil.js +36 -6
  154. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  155. package/lib/module/utils/ContractUtil.js +2 -0
  156. package/lib/module/utils/ContractUtil.js.map +1 -1
  157. package/lib/module/utils/DateUtil.js +2 -0
  158. package/lib/module/utils/DateUtil.js.map +1 -1
  159. package/lib/module/utils/ErrorUtil.js +4 -2
  160. package/lib/module/utils/ErrorUtil.js.map +1 -1
  161. package/lib/module/utils/NamesUtil.js +2 -0
  162. package/lib/module/utils/NamesUtil.js.map +1 -1
  163. package/lib/module/utils/NetworkUtil.js +5 -0
  164. package/lib/module/utils/NetworkUtil.js.map +1 -1
  165. package/lib/module/utils/NumberUtil.js +2 -0
  166. package/lib/module/utils/NumberUtil.js.map +1 -1
  167. package/lib/module/utils/PresetsUtil.js +2 -18
  168. package/lib/module/utils/PresetsUtil.js.map +1 -1
  169. package/lib/module/utils/StringUtil.js +9 -0
  170. package/lib/module/utils/StringUtil.js.map +1 -1
  171. package/lib/typescript/adapters/BlockchainAdapter.d.ts +6 -7
  172. package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -1
  173. package/lib/typescript/adapters/EvmAdapter.d.ts +21 -1
  174. package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -1
  175. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +2 -0
  176. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -1
  177. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts +2 -0
  178. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts.map +1 -0
  179. package/lib/typescript/index.d.ts +1 -1
  180. package/lib/typescript/index.d.ts.map +1 -1
  181. package/lib/typescript/networks/bitcoin.d.ts +1 -1
  182. package/lib/typescript/networks/bitcoin.d.ts.map +1 -1
  183. package/lib/typescript/networks/solana.d.ts +1 -1
  184. package/lib/typescript/networks/solana.d.ts.map +1 -1
  185. package/lib/typescript/types/api/blockchain-api.d.ts +183 -0
  186. package/lib/typescript/types/api/blockchain-api.d.ts.map +1 -0
  187. package/lib/typescript/types/api/events.d.ts +304 -0
  188. package/lib/typescript/types/api/events.d.ts.map +1 -0
  189. package/lib/typescript/types/api/index.d.ts +4 -0
  190. package/lib/typescript/types/api/index.d.ts.map +1 -0
  191. package/lib/typescript/types/api/wallet-api.d.ts +45 -0
  192. package/lib/typescript/types/api/wallet-api.d.ts.map +1 -0
  193. package/lib/typescript/types/blockchain/adapter.d.ts +40 -0
  194. package/lib/typescript/types/blockchain/adapter.d.ts.map +1 -0
  195. package/lib/typescript/types/blockchain/balance.d.ts +28 -0
  196. package/lib/typescript/types/blockchain/balance.d.ts.map +1 -0
  197. package/lib/typescript/types/blockchain/index.d.ts +5 -0
  198. package/lib/typescript/types/blockchain/index.d.ts.map +1 -0
  199. package/lib/typescript/types/blockchain/network.d.ts +47 -0
  200. package/lib/typescript/types/blockchain/network.d.ts.map +1 -0
  201. package/lib/typescript/types/blockchain/transaction.d.ts +63 -0
  202. package/lib/typescript/types/blockchain/transaction.d.ts.map +1 -0
  203. package/lib/typescript/types/common.d.ts +24 -0
  204. package/lib/typescript/types/common.d.ts.map +1 -0
  205. package/lib/typescript/types/index.d.ts +10 -0
  206. package/lib/typescript/types/index.d.ts.map +1 -0
  207. package/lib/typescript/types/onramp/countries.d.ts +11 -0
  208. package/lib/typescript/types/onramp/countries.d.ts.map +1 -0
  209. package/lib/typescript/types/onramp/currencies.d.ts +30 -0
  210. package/lib/typescript/types/onramp/currencies.d.ts.map +1 -0
  211. package/lib/typescript/types/onramp/errors.d.ts +21 -0
  212. package/lib/typescript/types/onramp/errors.d.ts.map +1 -0
  213. package/lib/typescript/types/onramp/index.d.ts +5 -0
  214. package/lib/typescript/types/onramp/index.d.ts.map +1 -0
  215. package/lib/typescript/types/onramp/quotes.d.ts +45 -0
  216. package/lib/typescript/types/onramp/quotes.d.ts.map +1 -0
  217. package/lib/typescript/types/siwe/config.d.ts +31 -0
  218. package/lib/typescript/types/siwe/config.d.ts.map +1 -0
  219. package/lib/typescript/types/siwe/index.d.ts +3 -0
  220. package/lib/typescript/types/siwe/index.d.ts.map +1 -0
  221. package/lib/typescript/types/siwe/message.d.ts +57 -0
  222. package/lib/typescript/types/siwe/message.d.ts.map +1 -0
  223. package/lib/typescript/types/storage.d.ts +27 -0
  224. package/lib/typescript/types/storage.d.ts.map +1 -0
  225. package/lib/typescript/types/swap/index.d.ts +2 -0
  226. package/lib/typescript/types/swap/index.d.ts.map +1 -0
  227. package/lib/typescript/types/swap/tokens.d.ts +19 -0
  228. package/lib/typescript/types/swap/tokens.d.ts.map +1 -0
  229. package/lib/typescript/types/ui.d.ts +26 -0
  230. package/lib/typescript/types/ui.d.ts.map +1 -0
  231. package/lib/typescript/types/wallet/connection.d.ts +30 -0
  232. package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
  233. package/lib/typescript/types/wallet/connector.d.ts +57 -0
  234. package/lib/typescript/types/wallet/connector.d.ts.map +1 -0
  235. package/lib/typescript/types/wallet/index.d.ts +4 -0
  236. package/lib/typescript/types/wallet/index.d.ts.map +1 -0
  237. package/lib/typescript/types/wallet/wallet-info.d.ts +36 -0
  238. package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -0
  239. package/lib/typescript/utils/ConstantsUtil.d.ts +30 -4
  240. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  241. package/lib/typescript/utils/NetworkUtil.d.ts +2 -0
  242. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  243. package/lib/typescript/utils/PresetsUtil.d.ts +0 -5
  244. package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
  245. package/lib/typescript/utils/StringUtil.d.ts +1 -0
  246. package/lib/typescript/utils/StringUtil.d.ts.map +1 -1
  247. package/package.json +7 -17
  248. package/src/adapters/BlockchainAdapter.ts +38 -21
  249. package/src/adapters/EvmAdapter.ts +186 -18
  250. package/src/adapters/SolanaBaseAdapter.ts +2 -1
  251. package/src/adapters/__tests__/EvmAdapter.test.ts +126 -0
  252. package/src/index.ts +2 -1
  253. package/src/networks/bitcoin.ts +1 -1
  254. package/src/networks/solana.ts +1 -1
  255. package/src/types/api/blockchain-api.ts +213 -0
  256. package/src/types/api/events.ts +394 -0
  257. package/src/types/api/index.ts +4 -0
  258. package/src/types/api/wallet-api.ts +64 -0
  259. package/src/types/blockchain/adapter.ts +52 -0
  260. package/src/types/blockchain/balance.ts +31 -0
  261. package/src/types/blockchain/index.ts +5 -0
  262. package/src/types/blockchain/network.ts +39 -0
  263. package/src/types/blockchain/transaction.ts +71 -0
  264. package/src/types/common.ts +56 -0
  265. package/src/types/index.ts +28 -0
  266. package/src/types/onramp/countries.ts +11 -0
  267. package/src/types/onramp/currencies.ts +32 -0
  268. package/src/types/onramp/errors.ts +22 -0
  269. package/src/types/onramp/index.ts +5 -0
  270. package/src/types/onramp/quotes.ts +46 -0
  271. package/src/types/siwe/config.ts +44 -0
  272. package/src/types/siwe/index.ts +3 -0
  273. package/src/types/siwe/message.ts +62 -0
  274. package/src/types/storage.ts +30 -0
  275. package/src/types/swap/index.ts +2 -0
  276. package/src/types/swap/tokens.ts +21 -0
  277. package/src/types/ui.ts +26 -0
  278. package/src/types/wallet/connection.ts +33 -0
  279. package/src/types/wallet/connector.ts +84 -0
  280. package/src/types/wallet/index.ts +4 -0
  281. package/src/types/wallet/wallet-info.ts +41 -0
  282. package/src/utils/ConstantsUtil.ts +36 -8
  283. package/src/utils/ErrorUtil.ts +2 -2
  284. package/src/utils/NetworkUtil.ts +5 -0
  285. package/src/utils/PresetsUtil.ts +0 -25
  286. package/src/utils/StringUtil.ts +7 -0
  287. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  288. package/lib/module/utils/TypeUtil.js.map +0 -1
  289. package/lib/typescript/utils/TypeUtil.d.ts +0 -276
  290. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  291. package/src/utils/TypeUtil.ts +0 -336
@@ -0,0 +1,36 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ export interface WalletInfo {
3
+ name?: string;
4
+ icon?: string;
5
+ description?: string;
6
+ url?: string;
7
+ icons?: string[];
8
+ redirect?: {
9
+ native?: string;
10
+ universal?: string;
11
+ linkMode?: boolean;
12
+ };
13
+ [key: string]: unknown;
14
+ }
15
+ export type Metadata = {
16
+ name: string;
17
+ description: string;
18
+ url: string;
19
+ icons: string[];
20
+ redirect?: {
21
+ native?: string;
22
+ universal?: string;
23
+ linkMode?: boolean;
24
+ };
25
+ };
26
+ export interface Token {
27
+ address: string;
28
+ image?: string;
29
+ }
30
+ export type Tokens = Record<CaipNetworkId, Token>;
31
+ export interface Identity {
32
+ name: string;
33
+ avatar?: string;
34
+ }
35
+ export type ConnectedWalletInfo = WalletInfo | undefined;
36
+ //# sourceMappingURL=wallet-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallet-info.d.ts","sourceRoot":"","sources":["../../../../src/types/wallet/wallet-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAElD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,CAAC"}
@@ -8,10 +8,36 @@ export declare const ConstantsUtil: {
8
8
  BLOCKCHAIN_API_RPC_URL_STAGING: string;
9
9
  PULSE_API_URL: string;
10
10
  API_URL: string;
11
- WALLET_CONNECT_CONNECTOR_ID: string;
12
- COINBASE_CONNECTOR_ID: string;
13
- AUTH_CONNECTOR_ID: string;
14
- COINBASE_EXPLORER_ID: string;
11
+ WEB_WALLET_URL: string;
12
+ SECURE_SITE_DASHBOARD: string;
13
+ SECURE_SITE_ICON: string;
14
+ REOWN_URL: string;
15
15
  USDT_CONTRACT_ADDRESSES: string[];
16
+ PHANTOM_CUSTOM_WALLET: {
17
+ id: string;
18
+ name: string;
19
+ image_id: string;
20
+ mobile_link: string;
21
+ };
22
+ COINBASE_CUSTOM_WALLET: {
23
+ id: string;
24
+ name: string;
25
+ image_id: string;
26
+ mobile_link: string;
27
+ };
28
+ STORAGE_KEYS: {
29
+ WC_DEEPLINK: string;
30
+ RECENT_WALLET: string;
31
+ CONNECTED_CONNECTORS: string;
32
+ ONRAMP_PREFERRED_COUNTRY: string;
33
+ ONRAMP_COUNTRIES: string;
34
+ ONRAMP_SERVICE_PROVIDERS: string;
35
+ ONRAMP_FIAT_LIMITS: string;
36
+ ONRAMP_FIAT_CURRENCIES: string;
37
+ ONRAMP_PREFERRED_FIAT_CURRENCY: string;
38
+ ONRAMP_COUNTRIES_DEFAULTS: string;
39
+ ACTIVE_NAMESPACE: string;
40
+ COINBASE_CONNECTOR_SESSION: string;
41
+ };
16
42
  };
17
43
  //# sourceMappingURL=ConstantsUtil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;CAoCzB,CAAC"}
1
+ {"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEzB,CAAC"}
@@ -1,4 +1,6 @@
1
+ import type { CaipAddress } from '../types';
1
2
  export declare const NetworkUtil: {
2
3
  caipNetworkIdToNumber(caipnetworkId?: `${string}:${string}`): number | undefined;
4
+ getPlainAddress(caipAddress?: CaipAddress): string | undefined;
3
5
  };
4
6
  //# sourceMappingURL=NetworkUtil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NetworkUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;0CACgB,GAAG,MAAM,IAAI,MAAM,EAAE;CAG5D,CAAC"}
1
+ {"version":3,"file":"NetworkUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,WAAW;0CACgB,GAAG,MAAM,IAAI,MAAM,EAAE;kCAG7B,WAAW;CAG1C,CAAC"}
@@ -1,10 +1,5 @@
1
- import type { ConnectorType } from './TypeUtil';
2
1
  export declare const PresetsUtil: {
3
- ConnectorExplorerIds: Record<string, string>;
4
2
  NetworkImageIds: Record<string, string>;
5
- ConnectorNamesMap: Record<string, string>;
6
- ConnectorImageIds: Record<string, string>;
7
- ConnectorTypesMap: Record<string, ConnectorType>;
8
3
  RpcChainIds: number[];
9
4
  };
10
5
  //# sourceMappingURL=PresetsUtil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PresetsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/PresetsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,eAAO,MAAM,WAAW;;;;;;;CAiJvB,CAAC"}
1
+ {"version":3,"file":"PresetsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/PresetsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CA2HvB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export declare const StringUtil: {
2
2
  capitalize(value?: string): string;
3
+ hexToString(hexValue: string): string;
3
4
  };
4
5
  //# sourceMappingURL=StringUtil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;uBACF,MAAM;CAO1B,CAAC"}
1
+ {"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;uBACF,MAAM;0BAOH,MAAM;CAO7B,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@reown/appkit-common-react-native",
3
- "version": "2.0.0-alpha.1",
3
+ "version": "2.0.0-alpha.3",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "types": "lib/typescript/index.d.ts",
6
6
  "module": "lib/module/index.js",
7
+ "react-native": "src/index.ts",
7
8
  "source": "src/index.ts",
8
9
  "scripts": {
9
10
  "build": "bob build",
@@ -15,6 +16,10 @@
15
16
  "bignumber.js": "9.1.2",
16
17
  "dayjs": "1.11.10"
17
18
  },
19
+ "peerDependencies": {
20
+ "react": ">=18",
21
+ "react-native": ">=0.72"
22
+ },
18
23
  "files": [
19
24
  "src",
20
25
  "lib"
@@ -28,7 +33,7 @@
28
33
  "react-native"
29
34
  ],
30
35
  "repository": "https://github.com/reown-com/appkit-react-native",
31
- "author": "Reown <support@reown.com> (https://reown.com)",
36
+ "author": "Reown (https://discord.gg/reown)",
32
37
  "homepage": "https://reown.com/appkit",
33
38
  "license": "Apache-2.0",
34
39
  "bugs": {
@@ -38,21 +43,6 @@
38
43
  "registry": "https://registry.npmjs.org/",
39
44
  "access": "public"
40
45
  },
41
- "react-native": "src/index.ts",
42
- "react-native-builder-bob": {
43
- "source": "src",
44
- "output": "lib",
45
- "targets": [
46
- "commonjs",
47
- "module",
48
- [
49
- "typescript",
50
- {
51
- "tsc": "../../node_modules/.bin/tsc"
52
- }
53
- ]
54
- ]
55
- },
56
46
  "eslintIgnore": [
57
47
  "node_modules/",
58
48
  "lib/"
@@ -1,19 +1,23 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import type {
3
3
  AdapterEvents,
4
+ AdapterType,
4
5
  AppKitNetwork,
6
+ BlockchainAdapterConfig,
7
+ BlockchainAdapterInitParams,
5
8
  CaipAddress,
6
9
  ChainNamespace,
7
10
  GetBalanceParams,
8
11
  GetBalanceResponse,
9
12
  Provider,
10
13
  WalletConnector
11
- } from '../utils/TypeUtil';
14
+ } from '../types';
15
+ import { NetworkUtil } from '../utils/NetworkUtil';
12
16
 
13
17
  export abstract class BlockchainAdapter extends EventEmitter {
14
- public projectId: string;
15
18
  public connector?: WalletConnector;
16
19
  public supportedNamespace: ChainNamespace;
20
+ public adapterType: AdapterType;
17
21
 
18
22
  // Typed emit method
19
23
  override emit<K extends keyof AdapterEvents>(
@@ -23,20 +27,25 @@ export abstract class BlockchainAdapter extends EventEmitter {
23
27
  return super.emit(event, payload);
24
28
  }
25
29
 
26
- constructor({
27
- projectId,
28
- supportedNamespace
29
- }: {
30
- projectId: string;
31
- supportedNamespace: ChainNamespace;
32
- }) {
30
+ // Typed on method
31
+ override on<K extends keyof AdapterEvents>(event: K, listener: AdapterEvents[K]): this {
32
+ return super.on(event, listener);
33
+ }
34
+
35
+ // Typed off method for consistency
36
+ override off<K extends keyof AdapterEvents>(event: K, listener: AdapterEvents[K]): this {
37
+ return super.off(event, listener);
38
+ }
39
+
40
+ constructor({ supportedNamespace, adapterType }: BlockchainAdapterConfig) {
33
41
  super();
34
- this.projectId = projectId;
35
42
  this.supportedNamespace = supportedNamespace;
43
+ this.adapterType = adapterType;
36
44
  }
37
45
 
38
- setConnector(connector: WalletConnector) {
46
+ init({ connector }: BlockchainAdapterInitParams) {
39
47
  this.connector = connector;
48
+
40
49
  this.subscribeToEvents();
41
50
  }
42
51
 
@@ -47,7 +56,7 @@ export abstract class BlockchainAdapter extends EventEmitter {
47
56
  getProvider(): Provider {
48
57
  if (!this.connector) throw new Error('No active connector');
49
58
 
50
- return this.connector.getProvider();
59
+ return this.connector.getProvider(this.getSupportedNamespace());
51
60
  }
52
61
 
53
62
  subscribeToEvents(): void {
@@ -70,19 +79,27 @@ export abstract class BlockchainAdapter extends EventEmitter {
70
79
 
71
80
  onAccountsChanged(accounts: string[]): void {
72
81
  const _accounts = this.getAccounts();
73
- const shouldEmit = _accounts?.some(account => {
74
- const accountAddress = account.split(':')[2];
75
-
76
- return accountAddress !== undefined && accounts.includes(accountAddress);
77
- });
78
-
79
- if (shouldEmit) {
80
- this.emit('accountsChanged', { accounts });
82
+ const updatedAccounts =
83
+ _accounts
84
+ ?.filter(account => {
85
+ const accountAddress = NetworkUtil.getPlainAddress(account);
86
+
87
+ return accountAddress !== undefined && accounts.includes(accountAddress);
88
+ })
89
+ ?.sort((a, b) => {
90
+ const aIndex = accounts.indexOf(NetworkUtil.getPlainAddress(a) ?? '');
91
+ const bIndex = accounts.indexOf(NetworkUtil.getPlainAddress(b) ?? '');
92
+
93
+ return aIndex - bIndex;
94
+ }) ?? [];
95
+
96
+ if (updatedAccounts.length > 0) {
97
+ this.emit('accountsChanged', { accounts: updatedAccounts });
81
98
  }
82
99
  }
83
100
 
84
101
  onDisconnect(): void {
85
- this.emit('disconnect', { namespace: this.getSupportedNamespace() });
102
+ this.emit('disconnect', undefined);
86
103
 
87
104
  const provider = this.connector?.getProvider();
88
105
  if (provider) {
@@ -1,7 +1,93 @@
1
1
  import { BlockchainAdapter } from './BlockchainAdapter';
2
2
  import { NumberUtil } from '../utils/NumberUtil';
3
+ import type { AppKitNetwork } from '../types';
4
+
5
+ // Type definitions for writeContract
6
+ export interface WriteContractData {
7
+ tokenAddress: `0x${string}`;
8
+ receiverAddress: `0x${string}`;
9
+ tokenAmount: bigint;
10
+ fromAddress: `0x${string}`;
11
+ method: 'transfer' | 'transferFrom' | 'approve';
12
+ abi?: any; // Optional ABI for future extensibility
13
+ spenderAddress?: `0x${string}`; // Required for transferFrom and approve
14
+ network: AppKitNetwork;
15
+ }
16
+
17
+ export interface SendTransactionData {
18
+ address: `0x${string}`;
19
+ network: AppKitNetwork;
20
+ to: `0x${string}`;
21
+ value: string;
22
+ data: string;
23
+ }
24
+
25
+ // Simple ABI encoder for ERC20 functions
26
+ function encodeERC20Function(method: string, params: any[]): string {
27
+ const functionSelectors = {
28
+ transfer: '0xa9059cbb', // transfer(address,uint256)
29
+ transferFrom: '0x23b872dd', // transferFrom(address,address,uint256)
30
+ approve: '0x095ea7b3' // approve(address,uint256)
31
+ };
32
+
33
+ const selector = functionSelectors[method as keyof typeof functionSelectors];
34
+ if (!selector) {
35
+ throw new Error(`EVMAdapter:encodeERC20Function - unsupported method: ${method}`);
36
+ }
37
+
38
+ let encodedParams = '';
39
+
40
+ switch (method) {
41
+ case 'transfer':
42
+ if (params.length !== 2) throw new Error('transfer requires 2 parameters: to, amount');
43
+ const [to, amount] = params;
44
+ encodedParams =
45
+ to.toLowerCase().slice(2).padStart(64, '0') + amount.toString(16).padStart(64, '0');
46
+ break;
47
+
48
+ case 'transferFrom':
49
+ if (params.length !== 3)
50
+ throw new Error('transferFrom requires 3 parameters: from, to, amount');
51
+ const [from, toTransferFrom, amountTransferFrom] = params;
52
+ encodedParams =
53
+ from.toLowerCase().slice(2).padStart(64, '0') +
54
+ toTransferFrom.toLowerCase().slice(2).padStart(64, '0') +
55
+ amountTransferFrom.toString(16).padStart(64, '0');
56
+ break;
57
+
58
+ case 'approve':
59
+ if (params.length !== 2) throw new Error('approve requires 2 parameters: spender, amount');
60
+ const [spender, amountApprove] = params;
61
+ encodedParams =
62
+ spender.toLowerCase().slice(2).padStart(64, '0') +
63
+ amountApprove.toString(16).padStart(64, '0');
64
+ break;
65
+
66
+ default:
67
+ throw new Error(`EVMAdapter:encodeERC20Function - unsupported method: ${method}`);
68
+ }
69
+
70
+ return selector + encodedParams;
71
+ }
3
72
 
4
73
  export abstract class EVMAdapter extends BlockchainAdapter {
74
+ async signMessage(address: string, message: string, chain?: string): Promise<string> {
75
+ const provider = this.getProvider();
76
+
77
+ if (!provider) {
78
+ throw new Error('EVMAdapter:signMessage - provider is undefined');
79
+ }
80
+
81
+ const signature = await provider.request(
82
+ {
83
+ method: 'personal_sign',
84
+ params: [message, address]
85
+ },
86
+ `eip155:${chain}`
87
+ );
88
+
89
+ return signature as string;
90
+ }
5
91
  async estimateGas({ address, to, data, chainNamespace }: any): Promise<bigint> {
6
92
  const provider = this.getProvider();
7
93
 
@@ -36,8 +122,8 @@ export abstract class EVMAdapter extends BlockchainAdapter {
36
122
  }
37
123
  }
38
124
 
39
- async sendTransaction(data: any) {
40
- const { address } = data || {};
125
+ async sendTransaction(data: SendTransactionData): Promise<`0x${string}` | null> {
126
+ const { address, network } = data || {};
41
127
 
42
128
  if (!this.getProvider()) {
43
129
  throw new Error('EVMAdapter:sendTransaction - provider is undefined');
@@ -47,33 +133,115 @@ export abstract class EVMAdapter extends BlockchainAdapter {
47
133
  throw new Error('EVMAdapter:sendTransaction - address is undefined');
48
134
  }
49
135
 
136
+ if (!network) {
137
+ throw new Error('EVMAdapter:sendTransaction - network is undefined');
138
+ }
139
+
50
140
  const txParams = {
51
141
  from: address,
52
142
  to: data.to,
53
143
  value: NumberUtil.convertNumericToHexString(data.value),
54
- gas: NumberUtil.convertNumericToHexString(data.gas),
55
- gasPrice: NumberUtil.convertNumericToHexString(data.gasPrice),
56
144
  data: data.data, // hex-encoded bytecode
57
145
  type: '0x0' // optional: legacy transaction type
58
146
  };
59
147
 
60
- const txHash = await this.getProvider().request({
61
- method: 'eth_sendTransaction',
62
- params: [txParams]
63
- });
148
+ const txHash = await this.getProvider().request(
149
+ {
150
+ method: 'eth_sendTransaction',
151
+ params: [txParams]
152
+ },
153
+ network.caipNetworkId
154
+ );
155
+
156
+ return txHash as `0x${string}` | null;
157
+ }
64
158
 
65
- let receipt = null;
66
- while (!receipt) {
67
- receipt = (await this.getProvider().request({
68
- method: 'eth_getTransactionReceipt',
69
- params: [txHash]
70
- })) as { blockHash?: `0x${string}` };
159
+ async writeContract(data: WriteContractData): Promise<`0x${string}` | null> {
160
+ const {
161
+ tokenAddress,
162
+ receiverAddress,
163
+ tokenAmount,
164
+ method,
165
+ fromAddress,
166
+ spenderAddress,
167
+ network
168
+ } = data;
71
169
 
72
- if (!receipt) {
73
- await new Promise(r => setTimeout(r, 1000)); // wait 1s
74
- }
170
+ if (!this.getProvider()) {
171
+ throw new Error('EVMAdapter:writeContract - provider is undefined');
172
+ }
173
+
174
+ if (!fromAddress) {
175
+ throw new Error('EVMAdapter:writeContract - fromAddress is undefined');
176
+ }
177
+
178
+ if (!tokenAddress) {
179
+ throw new Error('EVMAdapter:writeContract - tokenAddress is undefined');
180
+ }
181
+
182
+ if (!tokenAmount) {
183
+ throw new Error('EVMAdapter:writeContract - tokenAmount is undefined');
184
+ }
185
+
186
+ if (!method) {
187
+ throw new Error('EVMAdapter:writeContract - method is undefined');
188
+ }
189
+
190
+ // Validate method-specific parameters
191
+ if (method === 'transfer' && !receiverAddress) {
192
+ throw new Error('EVMAdapter:writeContract - receiverAddress is required for transfer method');
75
193
  }
76
194
 
77
- return receipt?.blockHash || null;
195
+ if ((method === 'transferFrom' || method === 'approve') && !spenderAddress) {
196
+ throw new Error(`EVMAdapter:writeContract - spenderAddress is required for ${method} method`);
197
+ }
198
+
199
+ // Encode the function call data based on method
200
+ let encodedData: string;
201
+
202
+ switch (method) {
203
+ case 'transfer':
204
+ encodedData = encodeERC20Function('transfer', [receiverAddress, tokenAmount]);
205
+ break;
206
+ case 'transferFrom':
207
+ encodedData = encodeERC20Function('transferFrom', [
208
+ fromAddress,
209
+ receiverAddress,
210
+ tokenAmount
211
+ ]);
212
+ break;
213
+ case 'approve':
214
+ encodedData = encodeERC20Function('approve', [spenderAddress, tokenAmount]);
215
+ break;
216
+ default:
217
+ throw new Error(`EVMAdapter:writeContract - method '${method}' is not supported`);
218
+ }
219
+
220
+ // Create transaction parameters
221
+ const txParams = {
222
+ from: fromAddress,
223
+ to: tokenAddress,
224
+ data: encodedData,
225
+ value: '0x0', // No ETH value for token operations
226
+ type: '0x0' // legacy transaction type
227
+ };
228
+
229
+ try {
230
+ // Send the transaction
231
+ const txHash = await this.getProvider().request(
232
+ {
233
+ method: 'eth_sendTransaction',
234
+ params: [txParams]
235
+ },
236
+ network.caipNetworkId
237
+ );
238
+
239
+ return txHash as `0x${string}` | null;
240
+ } catch (error) {
241
+ if (error instanceof Error) {
242
+ throw new Error(`EVMAdapter:writeContract - ${error.message}`);
243
+ }
244
+ throw new Error('EVMAdapter:writeContract - unknown error occurred');
245
+ }
78
246
  }
79
247
  }
@@ -1,5 +1,6 @@
1
1
  import { BlockchainAdapter } from './BlockchainAdapter';
2
2
 
3
3
  export abstract class SolanaBaseAdapter extends BlockchainAdapter {
4
- // solana logic
4
+ abstract signTransaction(data: any): Promise<string | null>;
5
+ abstract sendTransaction(data: any): Promise<string | null>;
5
6
  }
@@ -0,0 +1,126 @@
1
+ import { EVMAdapter } from '../EvmAdapter';
2
+ import type { AppKitNetwork, CaipAddress } from '../../types';
3
+
4
+ const network: AppKitNetwork = {
5
+ id: 1,
6
+ name: 'Ethereum',
7
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
8
+ rpcUrls: {
9
+ default: {
10
+ http: ['https://eth.merkle.io']
11
+ }
12
+ },
13
+ blockExplorers: {
14
+ default: {
15
+ name: 'Etherscan',
16
+ url: 'https://etherscan.io'
17
+ }
18
+ },
19
+ chainNamespace: 'eip155',
20
+ caipNetworkId: 'eip155:1'
21
+ };
22
+
23
+ // Mock implementation for testing
24
+ class MockEVMAdapter extends EVMAdapter {
25
+ private mockProvider: any;
26
+
27
+ constructor() {
28
+ super({ supportedNamespace: 'eip155', adapterType: 'ethers' });
29
+ this.mockProvider = {
30
+ request: jest.fn(),
31
+ on: jest.fn(),
32
+ off: jest.fn()
33
+ };
34
+ }
35
+
36
+ setMockProvider(provider: any) {
37
+ this.mockProvider = provider;
38
+ }
39
+
40
+ override getProvider() {
41
+ return this.mockProvider;
42
+ }
43
+
44
+ async disconnect(): Promise<void> {}
45
+ getSupportedNamespace() {
46
+ return 'eip155' as const;
47
+ }
48
+ async getBalance() {
49
+ return { amount: '0', symbol: 'ETH' };
50
+ }
51
+ getAccounts(): CaipAddress[] | undefined {
52
+ return ['eip155:1:0x1234567890123456789012345678901234567890'];
53
+ }
54
+ async switchNetwork() {}
55
+ }
56
+
57
+ describe('EVMAdapter', () => {
58
+ let adapter: MockEVMAdapter;
59
+
60
+ beforeEach(() => {
61
+ adapter = new MockEVMAdapter();
62
+ });
63
+
64
+ describe('writeContract', () => {
65
+ it('should encode transfer function correctly', async () => {
66
+ const mockProvider = {
67
+ request: jest.fn().mockResolvedValueOnce('0x1234567890abcdef') // eth_sendTransaction
68
+ };
69
+ adapter.setMockProvider(mockProvider);
70
+
71
+ const result = await adapter.writeContract({
72
+ tokenAddress: '0x1234567890123456789012345678901234567890',
73
+ receiverAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
74
+ tokenAmount: BigInt(1000000000000000000), // 1 token with 18 decimals
75
+ fromAddress: '0x1234567890123456789012345678901234567890',
76
+ method: 'transfer',
77
+ network
78
+ });
79
+
80
+ expect(result).toBe('0x1234567890abcdef');
81
+ expect(mockProvider.request).toHaveBeenCalledWith(
82
+ {
83
+ method: 'eth_sendTransaction',
84
+ params: [
85
+ {
86
+ from: '0x1234567890123456789012345678901234567890',
87
+ to: '0x1234567890123456789012345678901234567890',
88
+ data: '0xa9059cbb000000000000000000000000abcdefabcdefabcdefabcdefabcdefabcdefabcd0000000000000000000000000000000000000000000000000de0b6b3a7640000',
89
+ value: '0x0',
90
+ type: '0x0'
91
+ }
92
+ ]
93
+ },
94
+ 'eip155:1'
95
+ );
96
+ });
97
+
98
+ it('should throw error for unsupported method', async () => {
99
+ await expect(
100
+ adapter.writeContract({
101
+ tokenAddress: '0x1234567890123456789012345678901234567890',
102
+ receiverAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
103
+ tokenAmount: BigInt(1000000000000000000),
104
+ fromAddress: '0x1234567890123456789012345678901234567890',
105
+ method: 'unsupported' as any,
106
+ network
107
+ })
108
+ ).rejects.toThrow("method 'unsupported' is not supported");
109
+ });
110
+
111
+ it('should throw error when provider is undefined', async () => {
112
+ adapter.setMockProvider(undefined);
113
+
114
+ await expect(
115
+ adapter.writeContract({
116
+ tokenAddress: '0x1234567890123456789012345678901234567890',
117
+ receiverAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcd',
118
+ tokenAmount: BigInt(1000000000000000000),
119
+ fromAddress: '0x1234567890123456789012345678901234567890',
120
+ method: 'transfer',
121
+ network
122
+ })
123
+ ).rejects.toThrow('provider is undefined');
124
+ });
125
+ });
126
+ });
package/src/index.ts CHANGED
@@ -13,4 +13,5 @@ export { bitcoin, bitcoinTestnet } from './networks/bitcoin';
13
13
  export { BlockchainAdapter } from './adapters/BlockchainAdapter';
14
14
  export { EVMAdapter } from './adapters/EvmAdapter';
15
15
  export { SolanaBaseAdapter } from './adapters/SolanaBaseAdapter';
16
- export * from './utils/TypeUtil';
16
+
17
+ export * from './types';
@@ -1,4 +1,4 @@
1
- import type { AppKitNetwork } from '../utils/TypeUtil';
1
+ import type { AppKitNetwork } from '../types';
2
2
 
3
3
  export const bitcoin: AppKitNetwork = {
4
4
  id: '000000000019d6689c085ae165831e93',