@b3dotfun/sdk 0.1.70-alpha.2 → 0.1.70-alpha.21

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 (355) hide show
  1. package/README.md +3 -3
  2. package/constants/chains/b3Chain.js +3 -1
  3. package/dist/cjs/anyspend/constants/rpc.d.ts +3 -1
  4. package/dist/cjs/anyspend/constants/rpc.js +6 -2
  5. package/dist/cjs/anyspend/react/components/AnySpend.d.ts +9 -1
  6. package/dist/cjs/anyspend/react/components/AnySpend.js +123 -46
  7. package/dist/cjs/anyspend/react/components/AnySpendCustomExactIn.js +8 -10
  8. package/dist/cjs/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
  9. package/dist/cjs/anyspend/react/components/AnySpendDeposit.js +78 -25
  10. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +32 -13
  11. package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +32 -10
  12. package/dist/cjs/anyspend/react/components/QRDeposit.d.ts +22 -3
  13. package/dist/cjs/anyspend/react/components/QRDeposit.js +25 -16
  14. package/dist/cjs/anyspend/react/components/checkout/CryptoPayPanel.js +18 -11
  15. package/dist/cjs/anyspend/react/components/common/PureTransferView.d.ts +30 -0
  16. package/dist/cjs/anyspend/react/components/common/PureTransferView.js +64 -0
  17. package/dist/cjs/anyspend/react/components/common/TokenBalance.js +4 -5
  18. package/dist/cjs/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  19. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +1 -1
  20. package/dist/cjs/anyspend/utils/address.d.ts +2 -1
  21. package/dist/cjs/anyspend/utils/address.js +12 -9
  22. package/dist/cjs/anyspend/utils/chain.d.ts +84 -1
  23. package/dist/cjs/anyspend/utils/chain.js +73 -3
  24. package/dist/cjs/anyspend/utils/token.d.ts +2 -0
  25. package/dist/cjs/anyspend/utils/token.js +15 -1
  26. package/dist/cjs/app.shared.d.ts +9 -1
  27. package/dist/cjs/app.shared.js +19 -0
  28. package/dist/cjs/global-account/app.native.d.ts +1 -1
  29. package/dist/cjs/global-account/better-auth-client.d.ts +3314 -36
  30. package/dist/cjs/global-account/better-auth-client.js +28 -3
  31. package/dist/cjs/global-account/bsmnt.d.ts +2 -2
  32. package/dist/cjs/global-account/bsmnt.native.d.ts +1 -1
  33. package/dist/cjs/global-account/client-manager.d.ts +7 -5
  34. package/dist/cjs/global-account/client-manager.js +51 -4
  35. package/dist/cjs/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
  36. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
  37. package/dist/cjs/global-account/react/components/B3Provider/B3ConfigProvider.js +12 -0
  38. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
  39. package/dist/cjs/global-account/react/components/B3Provider/B3Provider.js +25 -3
  40. package/dist/cjs/global-account/react/components/B3Provider/BetterAuthProvider.js +45 -4
  41. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  42. package/dist/cjs/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
  43. package/dist/cjs/global-account/react/components/ManageAccount/ContentTokens.js +23 -15
  44. package/dist/cjs/global-account/react/components/ManageAccount/NFTContent.js +2 -2
  45. package/dist/cjs/global-account/react/components/ManageAccount/ProfileSection.js +8 -6
  46. package/dist/cjs/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  47. package/dist/cjs/global-account/react/components/ManageAccount/TokenContent.js +17 -8
  48. package/dist/cjs/global-account/react/components/Send/Send.js +15 -11
  49. package/dist/cjs/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
  50. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
  51. package/dist/cjs/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
  52. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
  53. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  54. package/dist/cjs/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
  55. package/dist/cjs/global-account/react/components/index.d.ts +1 -1
  56. package/dist/cjs/global-account/react/components/index.js +3 -3
  57. package/dist/cjs/global-account/react/hooks/index.d.ts +2 -3
  58. package/dist/cjs/global-account/react/hooks/index.js +7 -10
  59. package/dist/cjs/global-account/react/hooks/useAuth.d.ts +5 -4
  60. package/dist/cjs/global-account/react/hooks/useAuth.js +1 -0
  61. package/dist/cjs/global-account/react/hooks/useAuthentication.d.ts +3 -2
  62. package/dist/cjs/global-account/react/hooks/useAuthentication.js +2 -1
  63. package/dist/cjs/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
  64. package/dist/cjs/global-account/react/hooks/useBetterAuth.js +7 -7
  65. package/dist/cjs/global-account/react/hooks/useClient.d.ts +3 -3
  66. package/dist/cjs/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  67. package/dist/cjs/global-account/react/hooks/useFirstEOA.js +1 -0
  68. package/dist/cjs/global-account/react/hooks/useNativeBalance.js +2 -2
  69. package/dist/cjs/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  70. package/dist/cjs/global-account/react/hooks/usePortfolioBalance.js +76 -0
  71. package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  72. package/dist/cjs/global-account/react/hooks/usePortfolioCollectibles.js +178 -0
  73. package/dist/cjs/global-account/react/hooks/useSiwe.d.ts +1 -1
  74. package/dist/cjs/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  75. package/dist/cjs/global-account/react/hooks/useTWAuth.d.ts +1 -1
  76. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
  77. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
  78. package/dist/cjs/global-account/react/stores/useModalStore.d.ts +14 -2
  79. package/dist/cjs/global-account/types/b3-api.types.d.ts +5 -0
  80. package/dist/cjs/global-account/types/feature-flags.d.ts +5 -5
  81. package/dist/cjs/notifications/services/api.js +1 -0
  82. package/dist/cjs/shared/constants/chains/b3Chain.d.ts +30 -54
  83. package/dist/cjs/shared/constants/chains/b3Chain.js +5 -41
  84. package/dist/cjs/shared/constants/chains/supported.d.ts +1 -49
  85. package/dist/cjs/shared/constants/chains/supported.js +8 -36
  86. package/dist/cjs/shared/constants/index.d.ts +4 -0
  87. package/dist/cjs/shared/utils/chain-transformers.d.ts +4 -4
  88. package/dist/cjs/shared/utils/chain-transformers.js +38 -37
  89. package/dist/cjs/shared/utils/thirdweb-insights.js +2 -2
  90. package/dist/cjs/shared/utils/upload.d.ts +9 -0
  91. package/dist/cjs/shared/utils/upload.js +34 -0
  92. package/dist/cjs/shared/utils/zerionPositions.d.ts +96 -0
  93. package/dist/cjs/shared/utils/zerionPositions.js +188 -0
  94. package/dist/esm/anyspend/constants/rpc.d.ts +3 -1
  95. package/dist/esm/anyspend/constants/rpc.js +5 -1
  96. package/dist/esm/anyspend/react/components/AnySpend.d.ts +9 -1
  97. package/dist/esm/anyspend/react/components/AnySpend.js +124 -47
  98. package/dist/esm/anyspend/react/components/AnySpendCustomExactIn.js +9 -11
  99. package/dist/esm/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
  100. package/dist/esm/anyspend/react/components/AnySpendDeposit.js +80 -27
  101. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +33 -14
  102. package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +33 -11
  103. package/dist/esm/anyspend/react/components/QRDeposit.d.ts +22 -3
  104. package/dist/esm/anyspend/react/components/QRDeposit.js +27 -18
  105. package/dist/esm/anyspend/react/components/checkout/CryptoPayPanel.js +21 -14
  106. package/dist/esm/anyspend/react/components/common/PureTransferView.d.ts +30 -0
  107. package/dist/esm/anyspend/react/components/common/PureTransferView.js +61 -0
  108. package/dist/esm/anyspend/react/components/common/TokenBalance.js +6 -7
  109. package/dist/esm/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  110. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +1 -1
  111. package/dist/esm/anyspend/utils/address.d.ts +2 -1
  112. package/dist/esm/anyspend/utils/address.js +9 -6
  113. package/dist/esm/anyspend/utils/chain.d.ts +84 -1
  114. package/dist/esm/anyspend/utils/chain.js +73 -5
  115. package/dist/esm/anyspend/utils/token.d.ts +2 -0
  116. package/dist/esm/anyspend/utils/token.js +13 -0
  117. package/dist/esm/app.shared.d.ts +9 -1
  118. package/dist/esm/app.shared.js +17 -0
  119. package/dist/esm/global-account/app.native.d.ts +1 -1
  120. package/dist/esm/global-account/better-auth-client.d.ts +3314 -36
  121. package/dist/esm/global-account/better-auth-client.js +27 -4
  122. package/dist/esm/global-account/bsmnt.d.ts +2 -2
  123. package/dist/esm/global-account/bsmnt.native.d.ts +1 -1
  124. package/dist/esm/global-account/client-manager.d.ts +7 -5
  125. package/dist/esm/global-account/client-manager.js +51 -5
  126. package/dist/esm/global-account/react/components/AvatarEditor/AvatarEditor.js +6 -11
  127. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
  128. package/dist/esm/global-account/react/components/B3Provider/B3ConfigProvider.js +11 -0
  129. package/dist/esm/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
  130. package/dist/esm/global-account/react/components/B3Provider/B3Provider.js +26 -4
  131. package/dist/esm/global-account/react/components/B3Provider/BetterAuthProvider.js +46 -5
  132. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  133. package/dist/esm/global-account/react/components/B3Provider/RelayKitProviderWrapper.js +11 -5
  134. package/dist/esm/global-account/react/components/ManageAccount/ContentTokens.js +24 -16
  135. package/dist/esm/global-account/react/components/ManageAccount/NFTContent.js +3 -3
  136. package/dist/esm/global-account/react/components/ManageAccount/ProfileSection.js +9 -7
  137. package/dist/esm/global-account/react/components/ManageAccount/SettingsProfileCard.js +1 -1
  138. package/dist/esm/global-account/react/components/ManageAccount/TokenContent.js +18 -9
  139. package/dist/esm/global-account/react/components/Send/Send.js +16 -12
  140. package/dist/esm/global-account/react/components/SignInWithB3/BetterAuthSignIn.js +3 -1
  141. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +1 -5
  142. package/dist/esm/global-account/react/components/SignInWithB3/components/AuthButton.js +2 -1
  143. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.js +1 -0
  144. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  145. package/dist/esm/global-account/react/components/SignInWithB3/utils/signInUtils.js +3 -3
  146. package/dist/esm/global-account/react/components/index.d.ts +1 -1
  147. package/dist/esm/global-account/react/components/index.js +1 -1
  148. package/dist/esm/global-account/react/hooks/index.d.ts +2 -3
  149. package/dist/esm/global-account/react/hooks/index.js +2 -3
  150. package/dist/esm/global-account/react/hooks/useAuth.d.ts +5 -4
  151. package/dist/esm/global-account/react/hooks/useAuth.js +1 -0
  152. package/dist/esm/global-account/react/hooks/useAuthentication.d.ts +3 -2
  153. package/dist/esm/global-account/react/hooks/useAuthentication.js +2 -1
  154. package/dist/esm/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
  155. package/dist/esm/global-account/react/hooks/useBetterAuth.js +8 -8
  156. package/dist/esm/global-account/react/hooks/useClient.d.ts +3 -3
  157. package/dist/esm/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  158. package/dist/esm/global-account/react/hooks/useFirstEOA.js +1 -0
  159. package/dist/esm/global-account/react/hooks/useNativeBalance.js +1 -1
  160. package/dist/esm/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  161. package/dist/esm/global-account/react/hooks/usePortfolioBalance.js +72 -0
  162. package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  163. package/dist/esm/global-account/react/hooks/usePortfolioCollectibles.js +175 -0
  164. package/dist/esm/global-account/react/hooks/useSiwe.d.ts +1 -1
  165. package/dist/esm/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  166. package/dist/esm/global-account/react/hooks/useTWAuth.d.ts +1 -1
  167. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
  168. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +37 -27
  169. package/dist/esm/global-account/react/stores/useModalStore.d.ts +14 -2
  170. package/dist/esm/global-account/types/b3-api.types.d.ts +5 -0
  171. package/dist/esm/global-account/types/feature-flags.d.ts +5 -5
  172. package/dist/esm/notifications/services/api.js +1 -0
  173. package/dist/esm/shared/constants/chains/b3Chain.d.ts +30 -54
  174. package/dist/esm/shared/constants/chains/b3Chain.js +4 -38
  175. package/dist/esm/shared/constants/chains/supported.d.ts +1 -49
  176. package/dist/esm/shared/constants/chains/supported.js +7 -35
  177. package/dist/esm/shared/constants/index.d.ts +4 -0
  178. package/dist/esm/shared/utils/chain-transformers.d.ts +4 -4
  179. package/dist/esm/shared/utils/chain-transformers.js +38 -37
  180. package/dist/esm/shared/utils/thirdweb-insights.js +2 -2
  181. package/dist/esm/shared/utils/upload.d.ts +9 -0
  182. package/dist/esm/shared/utils/upload.js +31 -0
  183. package/dist/esm/shared/utils/zerionPositions.d.ts +96 -0
  184. package/dist/esm/shared/utils/zerionPositions.js +180 -0
  185. package/dist/styles/index.css +1 -1
  186. package/dist/types/anyspend/constants/rpc.d.ts +3 -1
  187. package/dist/types/anyspend/react/components/AnySpend.d.ts +9 -1
  188. package/dist/types/anyspend/react/components/AnySpendDeposit.d.ts +15 -3
  189. package/dist/types/anyspend/react/components/QRDeposit.d.ts +22 -3
  190. package/dist/types/anyspend/react/components/common/PureTransferView.d.ts +30 -0
  191. package/dist/types/anyspend/react/hooks/useCreateDepositFirstOrder.d.ts +3 -3
  192. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +1 -1
  193. package/dist/types/anyspend/utils/address.d.ts +2 -1
  194. package/dist/types/anyspend/utils/chain.d.ts +84 -1
  195. package/dist/types/anyspend/utils/token.d.ts +2 -0
  196. package/dist/types/app.shared.d.ts +9 -1
  197. package/dist/types/global-account/app.native.d.ts +1 -1
  198. package/dist/types/global-account/better-auth-client.d.ts +3314 -36
  199. package/dist/types/global-account/bsmnt.d.ts +2 -2
  200. package/dist/types/global-account/bsmnt.native.d.ts +1 -1
  201. package/dist/types/global-account/client-manager.d.ts +7 -5
  202. package/dist/types/global-account/react/components/B3Provider/B3ConfigProvider.d.ts +11 -0
  203. package/dist/types/global-account/react/components/B3Provider/B3Provider.d.ts +12 -2
  204. package/dist/types/global-account/react/components/B3Provider/RelayKitProviderWrapper.d.ts +1 -2
  205. package/dist/types/global-account/react/components/SignInWithB3/utils/signInUtils.d.ts +3 -2
  206. package/dist/types/global-account/react/components/index.d.ts +1 -1
  207. package/dist/types/global-account/react/hooks/index.d.ts +2 -3
  208. package/dist/types/global-account/react/hooks/useAuth.d.ts +5 -4
  209. package/dist/types/global-account/react/hooks/useAuthentication.d.ts +3 -2
  210. package/dist/types/global-account/react/hooks/useBetterAuth.d.ts +1657 -22
  211. package/dist/types/global-account/react/hooks/useClient.d.ts +3 -3
  212. package/dist/types/global-account/react/hooks/useFirstEOA.d.ts +4 -7666
  213. package/dist/types/global-account/react/hooks/usePortfolioBalance.d.ts +15 -0
  214. package/dist/types/global-account/react/hooks/usePortfolioCollectibles.d.ts +12 -0
  215. package/dist/types/global-account/react/hooks/useSiwe.d.ts +1 -1
  216. package/dist/types/global-account/react/hooks/useSiwe.native.d.ts +1 -1
  217. package/dist/types/global-account/react/hooks/useTWAuth.d.ts +1 -1
  218. package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +1 -0
  219. package/dist/types/global-account/react/stores/useModalStore.d.ts +14 -2
  220. package/dist/types/global-account/types/b3-api.types.d.ts +5 -0
  221. package/dist/types/global-account/types/feature-flags.d.ts +5 -5
  222. package/dist/types/shared/constants/chains/b3Chain.d.ts +30 -54
  223. package/dist/types/shared/constants/chains/supported.d.ts +1 -49
  224. package/dist/types/shared/constants/index.d.ts +4 -0
  225. package/dist/types/shared/utils/chain-transformers.d.ts +4 -4
  226. package/dist/types/shared/utils/upload.d.ts +9 -0
  227. package/dist/types/shared/utils/zerionPositions.d.ts +96 -0
  228. package/node_modules/@b3/chain-registry/chains.json +1225 -0
  229. package/node_modules/@b3/chain-registry/dist/chains.json +1225 -0
  230. package/node_modules/@b3/chain-registry/dist/index.cjs +1676 -0
  231. package/node_modules/@b3/chain-registry/dist/index.d.cts +195 -0
  232. package/node_modules/@b3/chain-registry/dist/index.d.ts +195 -0
  233. package/node_modules/@b3/chain-registry/dist/index.mjs +1604 -0
  234. package/node_modules/@b3/chain-registry/dist/src/index.d.ts +193 -0
  235. package/node_modules/@b3/chain-registry/dist/src/index.js +408 -0
  236. package/node_modules/@b3/chain-registry/package.json +66 -0
  237. package/node_modules/@b3/chain-registry/src/index.test.ts +432 -0
  238. package/node_modules/@b3/chain-registry/src/index.ts +672 -0
  239. package/package.json +81 -30
  240. package/src/anyspend/README.md +2 -2
  241. package/src/anyspend/constants/rpc.ts +5 -2
  242. package/src/anyspend/docs/components.md +6 -6
  243. package/src/anyspend/docs/contributing.md +1 -1
  244. package/src/anyspend/docs/hooks.md +3 -3
  245. package/src/anyspend/docs/installation.md +2 -2
  246. package/src/anyspend/react/components/AnySpend.tsx +163 -47
  247. package/src/anyspend/react/components/AnySpendCustomExactIn.tsx +10 -11
  248. package/src/anyspend/react/components/AnySpendDeposit.tsx +130 -31
  249. package/src/anyspend/react/components/AnySpendStakeB3.tsx +55 -14
  250. package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +55 -11
  251. package/src/anyspend/react/components/QRDeposit.tsx +101 -22
  252. package/src/anyspend/react/components/__tests__/QRDeposit.test.tsx +331 -0
  253. package/src/anyspend/react/components/checkout/CryptoPayPanel.tsx +38 -16
  254. package/src/anyspend/react/components/common/PureTransferView.tsx +212 -0
  255. package/src/anyspend/react/components/common/TokenBalance.tsx +10 -7
  256. package/src/anyspend/react/hooks/useAnyspendQuote.ts +13 -13
  257. package/src/anyspend/react/hooks/useCreateDepositFirstOrder.ts +4 -4
  258. package/src/anyspend/services/gas.test.ts +95 -18
  259. package/src/anyspend/types/api_req_res.ts +10 -5
  260. package/src/anyspend/utils/__tests__/address.test.ts +39 -0
  261. package/src/anyspend/utils/__tests__/deprecatedChains.test.ts +44 -0
  262. package/src/anyspend/utils/__tests__/toRegistryChainId.test.ts +17 -0
  263. package/src/anyspend/utils/address.ts +8 -6
  264. package/src/anyspend/utils/chain.ts +79 -3
  265. package/src/anyspend/utils/token.ts +14 -0
  266. package/src/app.shared.ts +21 -1
  267. package/src/global-account/app.native.ts +5 -1
  268. package/src/global-account/better-auth-client.ts +30 -4
  269. package/src/global-account/bsmnt.native.ts +5 -1
  270. package/src/global-account/bsmnt.ts +9 -2
  271. package/src/global-account/client-manager.ts +74 -9
  272. package/src/global-account/react/components/AvatarEditor/AvatarEditor.tsx +6 -11
  273. package/src/global-account/react/components/B3Provider/B3ConfigProvider.tsx +12 -0
  274. package/src/global-account/react/components/B3Provider/B3Provider.tsx +40 -4
  275. package/src/global-account/react/components/B3Provider/BetterAuthProvider.tsx +51 -5
  276. package/src/global-account/react/components/B3Provider/RelayKitProviderWrapper.tsx +11 -11
  277. package/src/global-account/react/components/ManageAccount/ContentTokens.tsx +50 -21
  278. package/src/global-account/react/components/ManageAccount/NFTContent.tsx +5 -3
  279. package/src/global-account/react/components/ManageAccount/ProfileSection.tsx +10 -6
  280. package/src/global-account/react/components/ManageAccount/SettingsProfileCard.tsx +1 -1
  281. package/src/global-account/react/components/ManageAccount/TokenContent.tsx +22 -9
  282. package/src/global-account/react/components/Send/Send.tsx +39 -15
  283. package/src/global-account/react/components/SignInWithB3/BetterAuthSignIn.tsx +12 -1
  284. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +1 -4
  285. package/src/global-account/react/components/SignInWithB3/components/AuthButton.tsx +9 -1
  286. package/src/global-account/react/components/SignInWithB3/steps/LoginStepBetterAuth.tsx +1 -0
  287. package/src/global-account/react/components/SignInWithB3/utils/signInUtils.ts +4 -4
  288. package/src/global-account/react/components/index.ts +1 -1
  289. package/src/global-account/react/components/ui/button.tsx +1 -2
  290. package/src/global-account/react/hooks/__tests__/useUnifiedChainSwitchAndExecute.test.tsx +156 -0
  291. package/src/global-account/react/hooks/index.ts +2 -3
  292. package/src/global-account/react/hooks/useAuth.ts +5 -4
  293. package/src/global-account/react/hooks/useAuthentication.ts +5 -4
  294. package/src/global-account/react/hooks/useBetterAuth.ts +10 -10
  295. package/src/global-account/react/hooks/useClient.ts +11 -2
  296. package/src/global-account/react/hooks/useFirstEOA.tsx +9 -2
  297. package/src/global-account/react/hooks/useNativeBalance.tsx +1 -1
  298. package/src/global-account/react/hooks/usePortfolioBalance.ts +89 -0
  299. package/src/global-account/react/hooks/usePortfolioCollectibles.ts +212 -0
  300. package/src/global-account/react/hooks/useSiwe.native.tsx +1 -1
  301. package/src/global-account/react/hooks/useSiwe.tsx +1 -1
  302. package/src/global-account/react/hooks/useTWAuth.tsx +1 -1
  303. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +47 -31
  304. package/src/global-account/react/stores/useModalStore.ts +14 -2
  305. package/src/global-account/types/b3-api.types.ts +5 -1
  306. package/src/notifications/services/api.ts +1 -0
  307. package/src/shared/constants/chains/b3Chain.ts +4 -43
  308. package/src/shared/constants/chains/supported.ts +9 -48
  309. package/src/shared/constants/index.ts +8 -0
  310. package/src/shared/react/hooks/__tests__/useCurrencyConversion.test.ts +54 -43
  311. package/src/shared/utils/__tests__/zerionPositions.test.ts +248 -0
  312. package/src/shared/utils/chain-transformers.ts +41 -39
  313. package/src/shared/utils/thirdweb-insights.ts +2 -2
  314. package/src/shared/utils/upload.ts +48 -0
  315. package/src/shared/utils/zerionPositions.ts +247 -0
  316. package/src/styles/index.css +27 -0
  317. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  318. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -46
  319. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  320. package/dist/cjs/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -70
  321. package/dist/cjs/global-account/react/hooks/useSimBalance.d.ts +0 -59
  322. package/dist/cjs/global-account/react/hooks/useSimBalance.js +0 -98
  323. package/dist/cjs/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  324. package/dist/cjs/global-account/react/hooks/useSimCollectibles.js +0 -190
  325. package/dist/cjs/global-account/react/utils/simdune.d.ts +0 -7
  326. package/dist/cjs/global-account/react/utils/simdune.js +0 -21
  327. package/dist/cjs/global-account/types/chain-networks.d.ts +0 -44
  328. package/dist/cjs/global-account/types/chain-networks.js +0 -48
  329. package/dist/cjs/shared/generated/chain-networks.json +0 -684
  330. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  331. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +0 -43
  332. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  333. package/dist/esm/global-account/react/hooks/useHandleConnectWithPrivy.js +0 -67
  334. package/dist/esm/global-account/react/hooks/useSimBalance.d.ts +0 -59
  335. package/dist/esm/global-account/react/hooks/useSimBalance.js +0 -93
  336. package/dist/esm/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  337. package/dist/esm/global-account/react/hooks/useSimCollectibles.js +0 -187
  338. package/dist/esm/global-account/react/utils/simdune.d.ts +0 -7
  339. package/dist/esm/global-account/react/utils/simdune.js +0 -17
  340. package/dist/esm/global-account/types/chain-networks.d.ts +0 -44
  341. package/dist/esm/global-account/types/chain-networks.js +0 -45
  342. package/dist/esm/shared/generated/chain-networks.json +0 -684
  343. package/dist/types/global-account/react/components/SignInWithB3/SignInWithB3Privy.d.ts +0 -10
  344. package/dist/types/global-account/react/hooks/useHandleConnectWithPrivy.d.ts +0 -11
  345. package/dist/types/global-account/react/hooks/useSimBalance.d.ts +0 -59
  346. package/dist/types/global-account/react/hooks/useSimCollectibles.d.ts +0 -45
  347. package/dist/types/global-account/react/utils/simdune.d.ts +0 -7
  348. package/dist/types/global-account/types/chain-networks.d.ts +0 -44
  349. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +0 -63
  350. package/src/global-account/react/hooks/useHandleConnectWithPrivy.tsx +0 -79
  351. package/src/global-account/react/hooks/useSimBalance.ts +0 -164
  352. package/src/global-account/react/hooks/useSimCollectibles.ts +0 -238
  353. package/src/global-account/react/utils/simdune.ts +0 -20
  354. package/src/global-account/types/chain-networks.ts +0 -54
  355. package/src/shared/generated/chain-networks.json +0 -684
@@ -1,43 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Loading, useAuthentication, useAuthStore, useB3Config, useHandleConnectWithPrivy, } from "../../../../global-account/react/index.js";
3
- import { debugB3React } from "../../../../shared/utils/debug.js";
4
- import { useEffect } from "react";
5
- const debug = debugB3React("SignInWithB3Privy");
6
- export function SignInWithB3Privy({ onSuccess, onError, chain }) {
7
- const { partnerId } = useB3Config();
8
- const { isLoading, connectTw, fullToken } = useHandleConnectWithPrivy(chain, onSuccess);
9
- const setIsAuthenticating = useAuthStore(state => state.setIsAuthenticating);
10
- const setIsAuthenticated = useAuthStore(state => state.setIsAuthenticated);
11
- const { logout } = useAuthentication(partnerId, { skipAutoConnect: true });
12
- debug("@@SignInWithB3Privy", {
13
- isLoading,
14
- fullToken,
15
- });
16
- useEffect(() => {
17
- async function autoConnect() {
18
- try {
19
- const connectResult = await connectTw();
20
- const account = connectResult?.getAccount();
21
- if (!account) {
22
- setIsAuthenticated(false);
23
- return;
24
- }
25
- await onSuccess(account);
26
- setIsAuthenticated(true);
27
- }
28
- catch (error) {
29
- console.error("Failed to connect:", error);
30
- await onError?.(error);
31
- await logout();
32
- setIsAuthenticated(false);
33
- }
34
- finally {
35
- debug("setIsAuthenticating:false:7");
36
- setIsAuthenticating(false);
37
- }
38
- }
39
- autoConnect();
40
- }, [connectTw, onSuccess, onError, setIsAuthenticated, logout, setIsAuthenticating]);
41
- // Currently we auto login, so we can show loading immediately and the onSuccess will proceed to the next modal
42
- return (_jsx("div", { className: "flex aspect-square items-center justify-center p-6", children: _jsx(Loading, { variant: "white", size: "lg" }) }));
43
- }
@@ -1,11 +0,0 @@
1
- import { Chain } from "thirdweb";
2
- import { Account } from "thirdweb/wallets";
3
- /**
4
- * This essentially wraps our useConnect hook to handle the Privy auth flow.
5
- * Currently, this is for the basement-privy strategy
6
- */
7
- export declare function useHandleConnectWithPrivy(chain?: Chain, onSuccess?: (account: Account) => void): {
8
- connectTw: () => Promise<import("thirdweb/wallets").Wallet | null | undefined>;
9
- isLoading: boolean;
10
- fullToken: string | null;
11
- };
@@ -1,67 +0,0 @@
1
- import { useB3Config, useConnect } from "../../../global-account/react/index.js";
2
- import { debugB3React } from "../../../shared/utils/debug.js";
3
- import { useIdentityToken, usePrivy } from "@privy-io/react-auth";
4
- import { useCallback, useRef, useState } from "react";
5
- const debug = debugB3React("@@b3:useHandleConnectWithPrivy");
6
- /**
7
- * This essentially wraps our useConnect hook to handle the Privy auth flow.
8
- * Currently, this is for the basement-privy strategy
9
- */
10
- export function useHandleConnectWithPrivy(chain, onSuccess) {
11
- const { partnerId } = useB3Config();
12
- if (!chain) {
13
- throw new Error("Chain is required");
14
- }
15
- const { connect } = useConnect(partnerId, chain);
16
- const [isLoading, setIsLoading] = useState(true);
17
- const isConnecting = useRef(false);
18
- const { identityToken } = useIdentityToken();
19
- const { getAccessToken } = usePrivy();
20
- const [fullToken, setFullToken] = useState(null);
21
- const connectTw = useCallback(async () => {
22
- if (isConnecting.current) {
23
- debug("@@connectTw:skipping:isConnecting", isConnecting.current);
24
- return;
25
- }
26
- setIsLoading(true);
27
- isConnecting.current = true;
28
- // Form token
29
- const accessToken = await getAccessToken();
30
- const fullToken = `${accessToken}+${identityToken}`;
31
- setFullToken(fullToken);
32
- debug("@@connectTw:fullToken", fullToken);
33
- if (!fullToken)
34
- throw new Error("Token is not set");
35
- // Connect to TW via privy
36
- const wallet = await connect({
37
- strategy: "auth_endpoint",
38
- payload: JSON.stringify({
39
- strategy: "basement",
40
- accessToken: fullToken,
41
- }),
42
- });
43
- debug("@@useHandleConnectWithPrivy:connect:return", wallet);
44
- setIsLoading(false);
45
- // Handle onsuccess & more
46
- try {
47
- debug("@@autoLogin:starting", fullToken);
48
- const account = wallet?.getAccount();
49
- if (!account) {
50
- throw new Error("Failed to connect");
51
- }
52
- onSuccess?.(account);
53
- if (!account) {
54
- throw new Error("Failed to connect");
55
- }
56
- }
57
- catch (error) {
58
- console.error("@@Error signing in with Privy", error);
59
- }
60
- finally {
61
- isConnecting.current = false;
62
- setIsLoading(false);
63
- }
64
- return wallet;
65
- }, [connect, getAccessToken, identityToken, onSuccess]);
66
- return { connectTw, isLoading, fullToken };
67
- }
@@ -1,59 +0,0 @@
1
- export interface SimTokenMetadata {
2
- logo?: string;
3
- }
4
- export interface SimBalanceItem {
5
- chain: string;
6
- chain_id: number;
7
- address: string;
8
- amount: string;
9
- symbol: string;
10
- decimals: number;
11
- price_usd?: number;
12
- value_usd?: number;
13
- name?: string;
14
- token_metadata?: SimTokenMetadata;
15
- pool_size?: number;
16
- low_liquidity?: boolean;
17
- }
18
- export interface SimBalanceResponse {
19
- request_time: string;
20
- response_time: string;
21
- wallet_address: string;
22
- balances: SimBalanceItem[];
23
- }
24
- export interface SvmBalanceItem {
25
- chain: string;
26
- address: string;
27
- amount: string;
28
- balance: string;
29
- raw_balance: string;
30
- value_usd?: number;
31
- program_id: string | null;
32
- decimals: number;
33
- total_supply: string;
34
- metadata_address?: string;
35
- name?: string;
36
- symbol: string;
37
- uri?: string | null;
38
- price_usd?: number;
39
- liquidity_usd?: number;
40
- pool_type?: string | null;
41
- pool_address?: string | null;
42
- mint_authority?: string | null;
43
- }
44
- export interface SvmBalanceResponse {
45
- processing_time_ms?: number;
46
- wallet_address: string;
47
- next_offset?: string;
48
- balances_count?: number;
49
- balances: SvmBalanceItem[];
50
- }
51
- export declare function useSimBalance(address?: string, chainIdsParam?: number[]): import("@tanstack/react-query").UseQueryResult<SimBalanceResponse, Error>;
52
- export declare function useSimSvmBalance(address?: string, chains?: ("solana" | "eclipse")[], limit?: number): import("@tanstack/react-query").UseQueryResult<SvmBalanceResponse, Error>;
53
- /**
54
- * Hook to fetch a single token balance for a wallet.
55
- * @param walletAddress - The wallet address to fetch balance for
56
- * @param tokenAddress - The token contract address, or "native" for native token (ETH, etc.)
57
- * @param chainId - Chain ID to query (defaults to 1 for Ethereum mainnet)
58
- */
59
- export declare function useSimTokenBalance(walletAddress?: string, tokenAddress?: string, chainId?: number): import("@tanstack/react-query").UseQueryResult<SimBalanceResponse, Error>;
@@ -1,93 +0,0 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import { buildSimduneUrl } from "../utils/simdune.js";
3
- async function fetchSimBalance(address, chainIdsParam) {
4
- if (!address)
5
- throw new Error("Address is required");
6
- const chainIds = chainIdsParam.length === 0 ? "mainnet" : chainIdsParam.join(",");
7
- const queryParams = new URLSearchParams();
8
- queryParams.append("metadata", "logo");
9
- queryParams.append("chain_ids", chainIds);
10
- queryParams.append("exclude_spam_tokens", "true");
11
- const url = buildSimduneUrl(`/v1/evm/balances/${address}`, queryParams);
12
- const response = await fetch(url);
13
- if (!response.ok) {
14
- throw new Error(`Failed to fetch balance: ${response.statusText}`);
15
- }
16
- const balanceData = await response.json();
17
- return balanceData;
18
- }
19
- async function fetchSimTokenBalance(walletAddress, tokenAddress, chainId) {
20
- if (!walletAddress)
21
- throw new Error("Wallet address is required");
22
- if (!tokenAddress)
23
- throw new Error("Token address is required");
24
- if (!chainId)
25
- throw new Error("Chain ID is required");
26
- const queryParams = new URLSearchParams();
27
- queryParams.append("chain_ids", chainId.toString());
28
- const url = buildSimduneUrl(`/v1/evm/balances/${walletAddress}/token/${tokenAddress}`, queryParams);
29
- const response = await fetch(url);
30
- if (!response.ok) {
31
- throw new Error(`Failed to fetch token balance: ${response.statusText}`);
32
- }
33
- const balanceData = await response.json();
34
- return balanceData;
35
- }
36
- async function fetchSimSvmBalance(address, chains, limit) {
37
- if (!address)
38
- throw new Error("Address is required");
39
- const queryParams = new URLSearchParams();
40
- if (chains && chains.length > 0) {
41
- queryParams.append("chains", chains.join(","));
42
- }
43
- if (limit) {
44
- queryParams.append("limit", limit.toString());
45
- }
46
- const url = buildSimduneUrl(`/beta/svm/balances/${address}`, queryParams.toString() ? queryParams : undefined);
47
- const response = await fetch(url);
48
- if (!response.ok) {
49
- throw new Error(`Failed to fetch SVM balance: ${response.statusText}`);
50
- }
51
- const balanceData = await response.json();
52
- return balanceData;
53
- }
54
- export function useSimBalance(address, chainIdsParam) {
55
- return useQuery({
56
- queryKey: ["simBalance", address, chainIdsParam],
57
- queryFn: () => {
58
- if (!address)
59
- throw new Error("Address is required");
60
- return fetchSimBalance(address, chainIdsParam || []);
61
- },
62
- enabled: Boolean(address),
63
- });
64
- }
65
- export function useSimSvmBalance(address, chains, limit) {
66
- return useQuery({
67
- queryKey: ["svmBalance", address, chains, limit],
68
- queryFn: () => {
69
- if (!address)
70
- throw new Error("Address is required");
71
- return fetchSimSvmBalance(address, chains, limit);
72
- },
73
- enabled: Boolean(address),
74
- });
75
- }
76
- /**
77
- * Hook to fetch a single token balance for a wallet.
78
- * @param walletAddress - The wallet address to fetch balance for
79
- * @param tokenAddress - The token contract address, or "native" for native token (ETH, etc.)
80
- * @param chainId - Chain ID to query (defaults to 1 for Ethereum mainnet)
81
- */
82
- export function useSimTokenBalance(walletAddress, tokenAddress, chainId) {
83
- return useQuery({
84
- queryKey: ["simTokenBalance", walletAddress, tokenAddress, chainId],
85
- queryFn: () => {
86
- if (!walletAddress || !tokenAddress || !chainId) {
87
- throw new Error("Missing required parameters");
88
- }
89
- return fetchSimTokenBalance(walletAddress, tokenAddress, chainId);
90
- },
91
- enabled: Boolean(walletAddress) && Boolean(tokenAddress),
92
- });
93
- }
@@ -1,45 +0,0 @@
1
- import type { SimpleHashNFTResponse } from "../../../global-account/types/simplehash.types";
2
- export interface SimCollectibleMetadata {
3
- uri: string;
4
- attributes?: Array<{
5
- trait_type: string;
6
- value: string;
7
- display_type?: string | null;
8
- }>;
9
- }
10
- export interface SimCollectibleEntry {
11
- contract_address: string;
12
- token_standard: "ERC721" | "ERC1155";
13
- token_id: string;
14
- chain: string;
15
- chain_id: number;
16
- name?: string;
17
- description?: string;
18
- symbol?: string;
19
- image_url?: string;
20
- last_sale_price?: string;
21
- metadata?: SimCollectibleMetadata;
22
- is_spam?: boolean;
23
- spam_score?: number;
24
- explanations?: string[];
25
- balance?: string;
26
- last_acquired?: string;
27
- }
28
- export interface SimCollectiblesResponse {
29
- address: string;
30
- entries: SimCollectibleEntry[];
31
- next_offset?: string;
32
- request_time: string;
33
- response_time: string;
34
- }
35
- /**
36
- * Hook to fetch NFT collectibles from Simdune API.
37
- * Returns data in SimpleHash format for compatibility with AccountAssets component.
38
- * @param address - Wallet address to fetch collectibles for
39
- * @param chainIdsParam - Optional array of chain IDs to filter by
40
- * @param options - Optional parameters (limit, filterSpam)
41
- */
42
- export declare function useSimCollectibles(address?: string, chainIdsParam?: number[], options?: {
43
- limit?: number;
44
- filterSpam?: boolean;
45
- }): import("@tanstack/react-query").UseQueryResult<SimpleHashNFTResponse, Error>;
@@ -1,187 +0,0 @@
1
- import { useQuery } from "@tanstack/react-query";
2
- import { buildSimduneUrl } from "../utils/simdune.js";
3
- /**
4
- * Safely parse a balance string to a number, capping at MAX_SAFE_INTEGER
5
- * to prevent overflow issues with large ERC1155 balances.
6
- */
7
- function safeParseBalance(balance) {
8
- if (!balance)
9
- return 1;
10
- const parsed = parseInt(balance, 10);
11
- if (Number.isNaN(parsed))
12
- return 1;
13
- return Math.min(parsed, Number.MAX_SAFE_INTEGER);
14
- }
15
- async function fetchSimCollectibles(address, chainIdsParam, options) {
16
- if (!address)
17
- throw new Error("Address is required");
18
- const queryParams = new URLSearchParams();
19
- if (chainIdsParam && chainIdsParam.length > 0) {
20
- queryParams.append("chain_ids", chainIdsParam.join(","));
21
- }
22
- if (options?.limit) {
23
- queryParams.append("limit", options.limit.toString());
24
- }
25
- if (options?.filterSpam !== undefined) {
26
- queryParams.append("filter_spam", options.filterSpam.toString());
27
- }
28
- const url = buildSimduneUrl(`/v1/evm/collectibles/${address}`, queryParams);
29
- const response = await fetch(url);
30
- if (!response.ok) {
31
- throw new Error(`Failed to fetch collectibles: ${response.statusText}`);
32
- }
33
- const data = await response.json();
34
- return data;
35
- }
36
- /**
37
- * Transforms Simdune collectibles response to SimpleHash NFT format
38
- * for compatibility with existing AccountAssets component
39
- */
40
- function transformToSimpleHashFormat(data) {
41
- const nfts = data.entries.map(entry => ({
42
- nft_id: `${entry.chain}.${entry.contract_address}.${entry.token_id}`,
43
- chain: entry.chain,
44
- contract_address: entry.contract_address,
45
- token_id: entry.token_id,
46
- name: entry.name || "",
47
- description: entry.description || "",
48
- previews: {
49
- image_small_url: entry.image_url || "",
50
- image_medium_url: entry.image_url || "",
51
- image_large_url: entry.image_url || "",
52
- image_opengraph_url: entry.image_url || "",
53
- blurhash: "",
54
- predominant_color: "",
55
- },
56
- image_url: entry.image_url || "",
57
- image_properties: {
58
- width: 0,
59
- height: 0,
60
- size: 0,
61
- mime_type: "",
62
- exif_orientation: null,
63
- },
64
- video_url: null,
65
- video_properties: null,
66
- audio_url: null,
67
- audio_properties: null,
68
- model_url: null,
69
- model_properties: null,
70
- other_url: null,
71
- other_properties: null,
72
- background_color: null,
73
- external_url: null,
74
- created_date: "",
75
- status: "minted",
76
- token_count: 1,
77
- owner_count: 1,
78
- owners: [
79
- {
80
- owner_address: data.address,
81
- quantity: safeParseBalance(entry.balance),
82
- quantity_string: entry.balance || "1",
83
- first_acquired_date: entry.last_acquired || "",
84
- last_acquired_date: entry.last_acquired || "",
85
- },
86
- ],
87
- contract: {
88
- type: entry.token_standard,
89
- name: entry.name || "",
90
- symbol: entry.symbol || null,
91
- deployed_by: "",
92
- deployed_via_contract: "",
93
- owned_by: "",
94
- has_multiple_collections: false,
95
- },
96
- collection: {
97
- collection_id: entry.contract_address,
98
- name: entry.symbol || "Unknown Collection",
99
- description: null,
100
- image_url: entry.image_url || "",
101
- image_properties: {
102
- width: 0,
103
- height: 0,
104
- mime_type: "",
105
- },
106
- banner_image_url: null,
107
- category: null,
108
- is_nsfw: null,
109
- external_url: null,
110
- twitter_username: null,
111
- discord_url: null,
112
- instagram_username: null,
113
- medium_username: null,
114
- telegram_url: null,
115
- marketplace_pages: [],
116
- metaplex_mint: null,
117
- metaplex_candy_machine: null,
118
- metaplex_first_verified_creator: null,
119
- floor_prices: [],
120
- top_bids: [],
121
- distinct_owner_count: 0,
122
- distinct_nft_count: 0,
123
- total_quantity: 0,
124
- chains: [entry.chain],
125
- top_contracts: [entry.contract_address],
126
- collection_royalties: [],
127
- },
128
- last_sale: entry.last_sale_price
129
- ? {
130
- price: entry.last_sale_price,
131
- }
132
- : null,
133
- primary_sale: null,
134
- first_created: {
135
- minted_to: data.address,
136
- quantity: 1,
137
- quantity_string: "1",
138
- timestamp: "",
139
- block_number: 0,
140
- transaction: "",
141
- transaction_initiator: "",
142
- },
143
- rarity: {
144
- rank: null,
145
- score: null,
146
- unique_attributes: null,
147
- },
148
- royalty: [],
149
- extra_metadata: {
150
- attributes: (entry.metadata?.attributes || []).map(attr => ({
151
- trait_type: attr.trait_type,
152
- value: attr.value,
153
- display_type: attr.display_type ?? null,
154
- })),
155
- image_original_url: entry.image_url || "",
156
- animation_original_url: null,
157
- metadata_original_url: entry.metadata?.uri || "",
158
- },
159
- }));
160
- return {
161
- next_cursor: data.next_offset || null,
162
- next: null,
163
- previous: null,
164
- nfts,
165
- };
166
- }
167
- /**
168
- * Hook to fetch NFT collectibles from Simdune API.
169
- * Returns data in SimpleHash format for compatibility with AccountAssets component.
170
- * @param address - Wallet address to fetch collectibles for
171
- * @param chainIdsParam - Optional array of chain IDs to filter by
172
- * @param options - Optional parameters (limit, filterSpam)
173
- */
174
- export function useSimCollectibles(address, chainIdsParam, options) {
175
- return useQuery({
176
- queryKey: ["simCollectibles", address, chainIdsParam, options],
177
- queryFn: async () => {
178
- if (!address)
179
- throw new Error("Address is required");
180
- const data = await fetchSimCollectibles(address, chainIdsParam, options);
181
- return transformToSimpleHashFormat(data);
182
- },
183
- enabled: Boolean(address),
184
- staleTime: 30 * 1000,
185
- gcTime: 5 * 60 * 1000,
186
- });
187
- }
@@ -1,7 +0,0 @@
1
- export declare const SIMDUNE_API_HOST = "https://simdune-api.sean-430.workers.dev";
2
- /**
3
- * Builds a Simdune API URL with the proxy wrapper and optional dev mode key.
4
- * @param endpoint - The Simdune API endpoint (e.g., "/v1/evm/balances/0x...")
5
- * @param queryParams - Optional URLSearchParams to append
6
- */
7
- export declare function buildSimduneUrl(endpoint: string, queryParams?: URLSearchParams): string;
@@ -1,17 +0,0 @@
1
- export const SIMDUNE_API_HOST = "https://simdune-api.sean-430.workers.dev";
2
- /**
3
- * Builds a Simdune API URL with the proxy wrapper and optional dev mode key.
4
- * @param endpoint - The Simdune API endpoint (e.g., "/v1/evm/balances/0x...")
5
- * @param queryParams - Optional URLSearchParams to append
6
- */
7
- export function buildSimduneUrl(endpoint, queryParams) {
8
- const baseUrl = `${SIMDUNE_API_HOST}/?url=https://api.sim.dune.com${endpoint}`;
9
- let url = baseUrl;
10
- if (queryParams && queryParams.toString()) {
11
- url += `?${queryParams.toString()}`;
12
- }
13
- if (process.env.NEXT_PUBLIC_DEVMODE_SHARED_SECRET) {
14
- url += `${queryParams?.toString() ? "&" : "?"}localkey=${process.env.NEXT_PUBLIC_DEVMODE_SHARED_SECRET}`;
15
- }
16
- return url;
17
- }
@@ -1,44 +0,0 @@
1
- import { Static } from "@feathersjs/typebox";
2
- export declare const chainNetworksSchema: import("@feathersjs/typebox").TObject<{
3
- _id: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{}>]>;
4
- id: import("@feathersjs/typebox").TInteger;
5
- name: import("@feathersjs/typebox").TString<string>;
6
- rpcUrls: import("@feathersjs/typebox").TObject<{
7
- default: import("@feathersjs/typebox").TObject<{
8
- http: import("@feathersjs/typebox").TString<"uri">;
9
- ws: import("@feathersjs/typebox").TString<"uri">;
10
- }>;
11
- backups: import("@feathersjs/typebox").TArray<import("@feathersjs/typebox").TObject<{
12
- type: import("@feathersjs/typebox").TUnion<[import("@feathersjs/typebox").TLiteral<"http">, import("@feathersjs/typebox").TLiteral<"ws">]>;
13
- uri: import("@feathersjs/typebox").TString<string>;
14
- }>>;
15
- }>;
16
- icon: import("@feathersjs/typebox").TObject<{
17
- url: import("@feathersjs/typebox").TString<"uri">;
18
- width: import("@feathersjs/typebox").TInteger;
19
- height: import("@feathersjs/typebox").TInteger;
20
- format: import("@feathersjs/typebox").TString<string>;
21
- }>;
22
- blockExplorers: import("@feathersjs/typebox").TObject<{
23
- explorerTitle: import("@feathersjs/typebox").TString<string>;
24
- default: import("@feathersjs/typebox").TString<"uri">;
25
- }>;
26
- nativeCurrency: import("@feathersjs/typebox").TObject<{
27
- name: import("@feathersjs/typebox").TString<string>;
28
- symbol: import("@feathersjs/typebox").TString<string>;
29
- decimals: import("@feathersjs/typebox").TInteger;
30
- }>;
31
- testnet: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TBoolean>;
32
- testnetConfigID: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
33
- sourceId: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
34
- contracts: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TObject<{
35
- address: import("@feathersjs/typebox").TString<string>;
36
- blockCreated: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TInteger>;
37
- }>>>;
38
- formatters: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TAny>>;
39
- fees: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TRecord<import("@feathersjs/typebox").TString<string>, import("@feathersjs/typebox").TAny>>;
40
- badge: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TString<"uri">>;
41
- color: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TString<string>>;
42
- enabledFeatures: import("@feathersjs/typebox").TOptional<import("@feathersjs/typebox").TArray<import("@feathersjs/typebox").TString<string>>>;
43
- }>;
44
- export type ChainNetworks = Static<typeof chainNetworksSchema>;
@@ -1,45 +0,0 @@
1
- import { ObjectIdSchema, Type } from "@feathersjs/typebox";
2
- const ChainContractSchema = Type.Object({
3
- address: Type.String(),
4
- blockCreated: Type.Optional(Type.Integer()),
5
- });
6
- export const chainNetworksSchema = Type.Object({
7
- _id: ObjectIdSchema(),
8
- id: Type.Integer(),
9
- name: Type.String(),
10
- rpcUrls: Type.Object({
11
- default: Type.Object({
12
- http: Type.String({ format: "uri" }),
13
- ws: Type.String({ format: "uri" }),
14
- }),
15
- backups: Type.Array(Type.Object({
16
- type: Type.Union([Type.Literal("http"), Type.Literal("ws")]),
17
- uri: Type.String(),
18
- })),
19
- }),
20
- icon: Type.Object({
21
- url: Type.String({ format: "uri" }),
22
- width: Type.Integer(),
23
- height: Type.Integer(),
24
- format: Type.String(),
25
- }),
26
- blockExplorers: Type.Object({
27
- explorerTitle: Type.String(),
28
- default: Type.String({ format: "uri" }),
29
- }),
30
- nativeCurrency: Type.Object({
31
- name: Type.String(),
32
- symbol: Type.String(),
33
- decimals: Type.Integer(),
34
- }),
35
- testnet: Type.Optional(Type.Boolean()),
36
- testnetConfigID: Type.Optional(Type.Integer()),
37
- // Additional required Viem fields that can't be derived
38
- sourceId: Type.Optional(Type.Integer()),
39
- contracts: Type.Optional(Type.Record(Type.String(), ChainContractSchema)),
40
- formatters: Type.Optional(Type.Record(Type.String(), Type.Any())),
41
- fees: Type.Optional(Type.Record(Type.String(), Type.Any())),
42
- badge: Type.Optional(Type.String({ format: "uri" })),
43
- color: Type.Optional(Type.String()),
44
- enabledFeatures: Type.Optional(Type.Array(Type.String())),
45
- }, { $id: "ChainNetworks", additionalProperties: false });