@b3dotfun/sdk 0.0.23 → 0.0.24

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 (252) hide show
  1. package/dist/cjs/anyspend/react/components/AnySpend.js +5 -8
  2. package/dist/cjs/anyspend/react/components/AnySpendBondKit.js +2 -2
  3. package/dist/cjs/anyspend/react/components/AnySpendBuySpin.js +35 -28
  4. package/dist/cjs/anyspend/react/components/AnySpendCustom.js +4 -4
  5. package/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +35 -28
  6. package/dist/cjs/anyspend/react/components/common/Accordion.d.ts +7 -0
  7. package/dist/cjs/anyspend/react/components/common/Accordion.js +53 -0
  8. package/dist/cjs/anyspend/react/components/common/ConnectWalletPayment.js +3 -22
  9. package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  10. package/dist/cjs/anyspend/react/components/common/OrderDetails.js +76 -83
  11. package/dist/cjs/anyspend/react/components/common/OrderStatus.js +1 -1
  12. package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +4 -3
  13. package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +1 -5
  14. package/dist/cjs/anyspend/react/components/common/StepProgress.js +2 -2
  15. package/dist/cjs/anyspend/react/components/common/TokenBalance.js +1 -1
  16. package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +0 -1
  17. package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +2 -4
  18. package/dist/cjs/anyspend/react/hooks/useSigMint.d.ts +2 -2
  19. package/dist/cjs/anyspend/react/hooks/useStripeSupport.d.ts +0 -1
  20. package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +0 -1
  21. package/dist/cjs/anyspend/utils/chain.js +1 -1
  22. package/dist/cjs/bondkit/abis/BondkitTokenABI.d.ts +1020 -0
  23. package/dist/cjs/bondkit/abis/BondkitTokenABI.js +1332 -0
  24. package/dist/cjs/bondkit/abis/BondkitTokenFactoryABI.d.ts +391 -0
  25. package/dist/cjs/bondkit/abis/BondkitTokenFactoryABI.js +514 -0
  26. package/dist/cjs/bondkit/abis/index.d.ts +2 -0
  27. package/dist/cjs/bondkit/abis/index.js +18 -0
  28. package/dist/cjs/bondkit/bondkitToken.d.ts +68 -0
  29. package/dist/cjs/bondkit/bondkitToken.js +456 -0
  30. package/dist/cjs/bondkit/bondkitTokenFactory.d.ts +60 -0
  31. package/dist/cjs/bondkit/bondkitTokenFactory.js +274 -0
  32. package/dist/cjs/bondkit/components/TradingView.d.ts +3 -0
  33. package/dist/cjs/bondkit/components/TradingView.js +296 -0
  34. package/dist/cjs/bondkit/components/config/cdn.d.ts +42 -0
  35. package/dist/cjs/bondkit/components/config/cdn.js +63 -0
  36. package/dist/cjs/bondkit/components/index.d.ts +5 -0
  37. package/dist/cjs/bondkit/components/index.js +25 -0
  38. package/dist/cjs/bondkit/components/types.d.ts +8 -0
  39. package/dist/cjs/bondkit/components/types.js +5 -0
  40. package/dist/cjs/bondkit/components/utils/cdn-loader.d.ts +24 -0
  41. package/dist/cjs/bondkit/components/utils/cdn-loader.js +73 -0
  42. package/dist/cjs/bondkit/components/utils/format.d.ts +4 -0
  43. package/dist/cjs/bondkit/components/utils/format.js +31 -0
  44. package/dist/cjs/bondkit/config.d.ts +10 -0
  45. package/dist/cjs/bondkit/config.js +18 -0
  46. package/dist/cjs/bondkit/constants.d.ts +3 -0
  47. package/dist/cjs/bondkit/constants.js +5 -0
  48. package/dist/cjs/bondkit/index.d.ts +7 -0
  49. package/dist/cjs/bondkit/index.js +33 -0
  50. package/dist/cjs/bondkit/json_abis/BondkitABI.json +1329 -0
  51. package/dist/cjs/bondkit/json_abis/BondkitFactoryABI.json +511 -0
  52. package/dist/cjs/bondkit/json_abis/index.d.ts +3 -0
  53. package/dist/cjs/bondkit/json_abis/index.js +10 -0
  54. package/dist/cjs/bondkit/json_abis/index.ts +4 -0
  55. package/dist/cjs/bondkit/types.d.ts +77 -0
  56. package/dist/cjs/bondkit/types.js +11 -0
  57. package/dist/cjs/global-account/react/components/B3DynamicModal.js +1 -1
  58. package/dist/cjs/global-account/react/components/MintButton/MintButton.js +0 -1
  59. package/dist/cjs/global-account/react/components/SendERC20Button/SendERC20Button.d.ts +13 -0
  60. package/dist/cjs/global-account/react/components/SendERC20Button/SendERC20Button.js +33 -0
  61. package/dist/cjs/global-account/react/components/SendETHButton/SendETHButton.d.ts +12 -0
  62. package/dist/cjs/global-account/react/components/SendETHButton/SendETHButton.js +23 -0
  63. package/dist/cjs/global-account/react/components/SignInWithB3/SignIn.js +4 -2
  64. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
  65. package/dist/cjs/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  66. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  67. package/dist/cjs/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  68. package/dist/cjs/global-account/react/components/index.d.ts +2 -0
  69. package/dist/cjs/global-account/react/components/index.js +8 -2
  70. package/dist/cjs/global-account/react/components/ui/scroll-area.js +1 -1
  71. package/dist/cjs/global-account/react/components/ui/tooltip.d.ts +1 -1
  72. package/dist/cjs/global-account/react/hooks/index.d.ts +2 -1
  73. package/dist/cjs/global-account/react/hooks/index.js +18 -3
  74. package/dist/cjs/global-account/react/hooks/useAccountWallet.js +8 -0
  75. package/dist/cjs/global-account/react/hooks/useAuthentication.js +4 -4
  76. package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.d.ts +1 -2
  77. package/dist/cjs/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
  78. package/dist/cjs/global-account/react/hooks/useFirstEOA.js +9 -7
  79. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +11 -0
  80. package/dist/cjs/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +160 -0
  81. package/dist/cjs/shared/constants/chains/supported.d.ts +4 -0
  82. package/dist/cjs/shared/constants/chains/supported.js +11 -0
  83. package/dist/cjs/shared/generated/chain-networks.json +1 -1
  84. package/dist/esm/anyspend/react/components/AnySpend.js +5 -8
  85. package/dist/esm/anyspend/react/components/AnySpendBondKit.js +2 -2
  86. package/dist/esm/anyspend/react/components/AnySpendBuySpin.js +37 -30
  87. package/dist/esm/anyspend/react/components/AnySpendCustom.js +4 -4
  88. package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +37 -30
  89. package/dist/esm/anyspend/react/components/common/Accordion.d.ts +7 -0
  90. package/dist/esm/anyspend/react/components/common/Accordion.js +14 -0
  91. package/dist/esm/anyspend/react/components/common/ConnectWalletPayment.js +3 -22
  92. package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +2 -2
  93. package/dist/esm/anyspend/react/components/common/OrderDetails.js +79 -86
  94. package/dist/esm/anyspend/react/components/common/OrderStatus.js +1 -1
  95. package/dist/esm/anyspend/react/components/common/PanelOnramp.js +5 -4
  96. package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +1 -5
  97. package/dist/esm/anyspend/react/components/common/StepProgress.js +2 -2
  98. package/dist/esm/anyspend/react/components/common/TokenBalance.js +1 -1
  99. package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +0 -1
  100. package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +2 -4
  101. package/dist/esm/anyspend/react/hooks/useSigMint.d.ts +2 -2
  102. package/dist/esm/anyspend/react/hooks/useStripeSupport.d.ts +0 -1
  103. package/dist/esm/anyspend/react/hooks/useStripeSupport.js +0 -1
  104. package/dist/esm/anyspend/utils/chain.js +1 -1
  105. package/dist/esm/bondkit/abis/BondkitTokenABI.d.ts +1020 -0
  106. package/dist/esm/bondkit/abis/BondkitTokenABI.js +1329 -0
  107. package/dist/esm/bondkit/abis/BondkitTokenFactoryABI.d.ts +391 -0
  108. package/dist/esm/bondkit/abis/BondkitTokenFactoryABI.js +511 -0
  109. package/dist/esm/bondkit/abis/index.d.ts +2 -0
  110. package/dist/esm/bondkit/abis/index.js +2 -0
  111. package/dist/esm/bondkit/bondkitToken.d.ts +68 -0
  112. package/dist/esm/bondkit/bondkitToken.js +452 -0
  113. package/dist/esm/bondkit/bondkitTokenFactory.d.ts +60 -0
  114. package/dist/esm/bondkit/bondkitTokenFactory.js +270 -0
  115. package/dist/esm/bondkit/components/TradingView.d.ts +3 -0
  116. package/dist/esm/bondkit/components/TradingView.js +294 -0
  117. package/dist/esm/bondkit/components/config/cdn.d.ts +42 -0
  118. package/dist/esm/bondkit/components/config/cdn.js +55 -0
  119. package/dist/esm/bondkit/components/index.d.ts +5 -0
  120. package/dist/esm/bondkit/components/index.js +4 -0
  121. package/dist/esm/bondkit/components/types.d.ts +8 -0
  122. package/dist/esm/bondkit/components/types.js +4 -0
  123. package/dist/esm/bondkit/components/utils/cdn-loader.d.ts +24 -0
  124. package/dist/esm/bondkit/components/utils/cdn-loader.js +66 -0
  125. package/dist/esm/bondkit/components/utils/format.d.ts +4 -0
  126. package/dist/esm/bondkit/components/utils/format.js +28 -0
  127. package/dist/esm/bondkit/config.d.ts +10 -0
  128. package/dist/esm/bondkit/config.js +14 -0
  129. package/dist/esm/bondkit/constants.d.ts +3 -0
  130. package/dist/esm/bondkit/constants.js +2 -0
  131. package/dist/esm/bondkit/index.d.ts +7 -0
  132. package/dist/esm/bondkit/index.js +12 -0
  133. package/dist/esm/bondkit/json_abis/BondkitABI.json +1329 -0
  134. package/dist/esm/bondkit/json_abis/BondkitFactoryABI.json +511 -0
  135. package/dist/esm/bondkit/json_abis/index.d.ts +3 -0
  136. package/dist/esm/bondkit/json_abis/index.js +3 -0
  137. package/dist/esm/bondkit/json_abis/index.ts +4 -0
  138. package/dist/esm/bondkit/types.d.ts +77 -0
  139. package/dist/esm/bondkit/types.js +8 -0
  140. package/dist/esm/global-account/react/components/B3DynamicModal.js +1 -1
  141. package/dist/esm/global-account/react/components/MintButton/MintButton.js +0 -1
  142. package/dist/esm/global-account/react/components/SendERC20Button/SendERC20Button.d.ts +13 -0
  143. package/dist/esm/global-account/react/components/SendERC20Button/SendERC20Button.js +30 -0
  144. package/dist/esm/global-account/react/components/SendETHButton/SendETHButton.d.ts +12 -0
  145. package/dist/esm/global-account/react/components/SendETHButton/SendETHButton.js +20 -0
  146. package/dist/esm/global-account/react/components/SignInWithB3/SignIn.js +4 -2
  147. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Flow.js +2 -2
  148. package/dist/esm/global-account/react/components/SignInWithB3/SignInWithB3Privy.js +1 -1
  149. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStep.js +2 -2
  150. package/dist/esm/global-account/react/components/SignInWithB3/steps/LoginStepCustom.js +2 -2
  151. package/dist/esm/global-account/react/components/index.d.ts +2 -0
  152. package/dist/esm/global-account/react/components/index.js +4 -0
  153. package/dist/esm/global-account/react/components/ui/scroll-area.js +1 -1
  154. package/dist/esm/global-account/react/components/ui/tooltip.d.ts +1 -1
  155. package/dist/esm/global-account/react/hooks/index.d.ts +2 -1
  156. package/dist/esm/global-account/react/hooks/index.js +2 -1
  157. package/dist/esm/global-account/react/hooks/useAccountWallet.js +8 -0
  158. package/dist/esm/global-account/react/hooks/useAuthentication.js +4 -4
  159. package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.d.ts +1 -2
  160. package/dist/esm/global-account/react/hooks/useChainSwitchWithAction.js +2 -2
  161. package/dist/esm/global-account/react/hooks/useFirstEOA.js +9 -7
  162. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +11 -0
  163. package/dist/esm/global-account/react/hooks/useUnifiedChainSwitchAndExecute.js +154 -0
  164. package/dist/esm/shared/constants/chains/supported.d.ts +4 -0
  165. package/dist/esm/shared/constants/chains/supported.js +10 -0
  166. package/dist/esm/shared/generated/chain-networks.json +1 -1
  167. package/dist/styles/index.css +1 -1
  168. package/dist/types/anyspend/react/components/common/Accordion.d.ts +7 -0
  169. package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +0 -1
  170. package/dist/types/anyspend/react/hooks/useSigMint.d.ts +2 -2
  171. package/dist/types/anyspend/react/hooks/useStripeSupport.d.ts +0 -1
  172. package/dist/types/bondkit/abis/BondkitTokenABI.d.ts +1020 -0
  173. package/dist/types/bondkit/abis/BondkitTokenFactoryABI.d.ts +391 -0
  174. package/dist/types/bondkit/abis/index.d.ts +2 -0
  175. package/dist/types/bondkit/bondkitToken.d.ts +68 -0
  176. package/dist/types/bondkit/bondkitTokenFactory.d.ts +60 -0
  177. package/dist/types/bondkit/components/TradingView.d.ts +3 -0
  178. package/dist/types/bondkit/components/config/cdn.d.ts +42 -0
  179. package/dist/types/bondkit/components/index.d.ts +5 -0
  180. package/dist/types/bondkit/components/types.d.ts +8 -0
  181. package/dist/types/bondkit/components/utils/cdn-loader.d.ts +24 -0
  182. package/dist/types/bondkit/components/utils/format.d.ts +4 -0
  183. package/dist/types/bondkit/config.d.ts +10 -0
  184. package/dist/types/bondkit/constants.d.ts +3 -0
  185. package/dist/types/bondkit/index.d.ts +7 -0
  186. package/dist/types/bondkit/json_abis/index.d.ts +3 -0
  187. package/dist/types/bondkit/types.d.ts +77 -0
  188. package/dist/types/global-account/react/components/SendERC20Button/SendERC20Button.d.ts +13 -0
  189. package/dist/types/global-account/react/components/SendETHButton/SendETHButton.d.ts +12 -0
  190. package/dist/types/global-account/react/components/index.d.ts +2 -0
  191. package/dist/types/global-account/react/components/ui/tooltip.d.ts +1 -1
  192. package/dist/types/global-account/react/hooks/index.d.ts +2 -1
  193. package/dist/types/global-account/react/hooks/useChainSwitchWithAction.d.ts +1 -2
  194. package/dist/types/global-account/react/hooks/useUnifiedChainSwitchAndExecute.d.ts +11 -0
  195. package/dist/types/shared/constants/chains/supported.d.ts +4 -0
  196. package/package.json +42 -7
  197. package/src/anyspend/react/components/AnySpend.tsx +5 -23
  198. package/src/anyspend/react/components/AnySpendBondKit.tsx +2 -2
  199. package/src/anyspend/react/components/AnySpendBuySpin.tsx +42 -32
  200. package/src/anyspend/react/components/AnySpendCustom.tsx +7 -13
  201. package/src/anyspend/react/components/AnySpendStakeB3.tsx +44 -34
  202. package/src/anyspend/react/components/common/Accordion.tsx +56 -0
  203. package/src/anyspend/react/components/common/ConnectWalletPayment.tsx +0 -25
  204. package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +1 -2
  205. package/src/anyspend/react/components/common/OrderDetails.tsx +292 -260
  206. package/src/anyspend/react/components/common/OrderStatus.tsx +1 -1
  207. package/src/anyspend/react/components/common/PanelOnramp.tsx +7 -7
  208. package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +0 -6
  209. package/src/anyspend/react/components/common/StepProgress.tsx +2 -2
  210. package/src/anyspend/react/components/common/TokenBalance.tsx +3 -3
  211. package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +2 -4
  212. package/src/anyspend/react/hooks/useStripeSupport.ts +0 -1
  213. package/src/anyspend/utils/chain.ts +1 -1
  214. package/src/bondkit/abis/BondkitTokenABI.ts +1329 -0
  215. package/src/bondkit/abis/BondkitTokenFactoryABI.ts +511 -0
  216. package/src/bondkit/abis/index.ts +2 -0
  217. package/src/bondkit/bondkitToken.ts +539 -0
  218. package/src/bondkit/bondkitTokenFactory.ts +336 -0
  219. package/src/bondkit/components/TradingView.tsx +341 -0
  220. package/src/bondkit/components/config/cdn.ts +63 -0
  221. package/src/bondkit/components/index.ts +5 -0
  222. package/src/bondkit/components/types.ts +9 -0
  223. package/src/bondkit/components/utils/cdn-loader.ts +77 -0
  224. package/src/bondkit/components/utils/format.ts +36 -0
  225. package/src/bondkit/config.ts +26 -0
  226. package/src/bondkit/constants.ts +5 -0
  227. package/src/bondkit/index.ts +16 -0
  228. package/src/bondkit/json_abis/BondkitABI.json +1329 -0
  229. package/src/bondkit/json_abis/BondkitFactoryABI.json +511 -0
  230. package/src/bondkit/json_abis/index.ts +4 -0
  231. package/src/bondkit/types.ts +98 -0
  232. package/src/global-account/react/components/B3DynamicModal.tsx +2 -1
  233. package/src/global-account/react/components/MintButton/MintButton.tsx +0 -1
  234. package/src/global-account/react/components/SendERC20Button/SendERC20Button.tsx +57 -0
  235. package/src/global-account/react/components/SendETHButton/SendETHButton.tsx +37 -0
  236. package/src/global-account/react/components/SignInWithB3/SignIn.tsx +21 -22
  237. package/src/global-account/react/components/SignInWithB3/SignInWithB3Flow.tsx +2 -2
  238. package/src/global-account/react/components/SignInWithB3/SignInWithB3Privy.tsx +1 -1
  239. package/src/global-account/react/components/SignInWithB3/steps/LoginStep.tsx +2 -2
  240. package/src/global-account/react/components/SignInWithB3/steps/LoginStepCustom.tsx +2 -2
  241. package/src/global-account/react/components/index.ts +6 -0
  242. package/src/global-account/react/components/ui/scroll-area.tsx +2 -2
  243. package/src/global-account/react/components/ui/tooltip.tsx +1 -1
  244. package/src/global-account/react/hooks/index.ts +2 -1
  245. package/src/global-account/react/hooks/useAccountWallet.tsx +10 -1
  246. package/src/global-account/react/hooks/useAuthentication.ts +4 -4
  247. package/src/global-account/react/hooks/useChainSwitchWithAction.ts +3 -4
  248. package/src/global-account/react/hooks/useFirstEOA.tsx +10 -7
  249. package/src/global-account/react/hooks/useUnifiedChainSwitchAndExecute.ts +186 -0
  250. package/src/shared/constants/chains/supported.ts +11 -0
  251. package/src/shared/generated/chain-networks.json +1 -1
  252. package/src/styles/index.css +27 -0
@@ -0,0 +1,274 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BondkitTokenFactory = void 0;
4
+ const viem_1 = require("viem");
5
+ const accounts_1 = require("viem/accounts");
6
+ const abis_1 = require("./abis");
7
+ const config_1 = require("./config");
8
+ // Define the event ABI snippet for BondkitTokenCreated specifically for decoding
9
+ const bondkitTokenCreatedEventAbi = abis_1.BondkitTokenFactoryABI.find(item => item.type === "event" && item.name === "BondkitTokenCreated");
10
+ class BondkitTokenFactory {
11
+ constructor(chainId, walletKey) {
12
+ if (walletKey && !walletKey.startsWith("0x")) {
13
+ this.walletKey = `0x${walletKey}`;
14
+ }
15
+ else if (walletKey) {
16
+ this.walletKey = walletKey;
17
+ }
18
+ const config = (0, config_1.getConfig)(chainId);
19
+ this.chain = config.chain;
20
+ this.contractAddress = config.factoryAddress;
21
+ this.rpcUrl = config.rpcUrl;
22
+ this.publicClient = (0, viem_1.createPublicClient)({
23
+ chain: this.chain,
24
+ transport: (0, viem_1.http)(this.rpcUrl),
25
+ });
26
+ this.walletClientInstance = (0, viem_1.createWalletClient)({
27
+ chain: this.chain,
28
+ transport: (0, viem_1.http)(this.rpcUrl),
29
+ account: this.walletKey ? (0, accounts_1.privateKeyToAccount)(this.walletKey) : undefined,
30
+ });
31
+ this.contract = (0, viem_1.getContract)({
32
+ address: this.contractAddress,
33
+ abi: abis_1.BondkitTokenFactoryABI,
34
+ client: this.walletClientInstance,
35
+ });
36
+ }
37
+ connect(provider) {
38
+ try {
39
+ const transport = provider ? (0, viem_1.custom)(provider) : (0, viem_1.http)(this.rpcUrl);
40
+ this.connectedProvider = provider;
41
+ this.walletClientInstance = (0, viem_1.createWalletClient)({
42
+ chain: this.chain,
43
+ transport,
44
+ account: this.walletKey ? (0, accounts_1.privateKeyToAccount)(this.walletKey) : undefined,
45
+ });
46
+ this.contract = (0, viem_1.getContract)({
47
+ address: this.contractAddress,
48
+ abi: abis_1.BondkitTokenFactoryABI,
49
+ client: this.walletClientInstance,
50
+ });
51
+ this.publicClient = (0, viem_1.createPublicClient)({
52
+ chain: this.chain,
53
+ transport,
54
+ });
55
+ return true;
56
+ }
57
+ catch (error) {
58
+ console.error("Connection failed:", error);
59
+ return false;
60
+ }
61
+ }
62
+ /**
63
+ * Connects using an EIP-1193 provider and requests accounts, selecting the first one.
64
+ * Enables frontend wallet flows without requiring a private key.
65
+ */
66
+ async connectWithProvider(provider) {
67
+ try {
68
+ const transport = (0, viem_1.custom)(provider);
69
+ this.connectedProvider = provider;
70
+ // Request accounts; fall back to eth_accounts if user already connected
71
+ let addresses = [];
72
+ try {
73
+ const result = await provider.request({ method: "eth_requestAccounts" });
74
+ if (Array.isArray(result))
75
+ addresses = result;
76
+ }
77
+ catch (requestErr) {
78
+ try {
79
+ const result = await provider.request({ method: "eth_accounts" });
80
+ if (Array.isArray(result))
81
+ addresses = result;
82
+ }
83
+ catch (_) { }
84
+ }
85
+ const selectedAccount = (addresses?.[0] ?? undefined);
86
+ this.walletClientInstance = (0, viem_1.createWalletClient)({
87
+ chain: this.chain,
88
+ transport,
89
+ account: selectedAccount,
90
+ });
91
+ this.publicClient = (0, viem_1.createPublicClient)({
92
+ chain: this.chain,
93
+ transport,
94
+ });
95
+ this.contract = (0, viem_1.getContract)({
96
+ address: this.contractAddress,
97
+ abi: abis_1.BondkitTokenFactoryABI,
98
+ client: this.walletClientInstance,
99
+ });
100
+ return true;
101
+ }
102
+ catch (error) {
103
+ console.error("Connection failed:", error);
104
+ return false;
105
+ }
106
+ }
107
+ /**
108
+ * Ensure we have an account set for write operations.
109
+ * If not, try to resolve from a connected provider and reinitialize the client.
110
+ */
111
+ async ensureWriteAccount() {
112
+ if (this.walletClientInstance.account || this.walletKey)
113
+ return;
114
+ if (!this.connectedProvider)
115
+ return;
116
+ try {
117
+ const addresses = (await this.connectedProvider.request({ method: "eth_accounts" }));
118
+ const selectedAccount = (addresses?.[0] ?? undefined);
119
+ if (selectedAccount) {
120
+ const transport = (0, viem_1.custom)(this.connectedProvider);
121
+ this.walletClientInstance = (0, viem_1.createWalletClient)({
122
+ chain: this.chain,
123
+ transport,
124
+ account: selectedAccount,
125
+ });
126
+ this.contract = (0, viem_1.getContract)({
127
+ address: this.contractAddress,
128
+ abi: abis_1.BondkitTokenFactoryABI,
129
+ client: this.walletClientInstance,
130
+ });
131
+ }
132
+ }
133
+ catch (_) { }
134
+ }
135
+ // TODO: Implement a more generic handleError based on leaderboards-sdk style if common errors are identified
136
+ async handleError(error, context) {
137
+ const defaultMessage = context ? `Error in ${context}:` : "An error occurred:";
138
+ console.error(defaultMessage, error);
139
+ // You could check for common error signatures here if needed
140
+ // e.g. if (error.data === "0xsomeErrorCode") throw new Error("Specific known error");
141
+ throw error;
142
+ }
143
+ /**
144
+ * Deploys a new Bondkit token using the factory.
145
+ * @param config The configuration for the token to be deployed.
146
+ * @returns The address of the newly created BondkitToken.
147
+ */
148
+ async deployBondkitToken(configArg) {
149
+ if (!this.walletClientInstance.account && !this.walletKey) {
150
+ await this.ensureWriteAccount();
151
+ if (!this.walletClientInstance.account && !this.walletKey) {
152
+ throw new Error("Wallet key not set or client not connected with an account.");
153
+ }
154
+ }
155
+ if (!bondkitTokenCreatedEventAbi) {
156
+ throw new Error("BondkitTokenCreated event ABI not found.");
157
+ }
158
+ try {
159
+ const accountToUse = this.walletKey ? (0, accounts_1.privateKeyToAccount)(this.walletKey) : this.walletClientInstance.account;
160
+ if (!accountToUse) {
161
+ throw new Error("Account for transaction could not be determined.");
162
+ }
163
+ const hash = await this.contract.write.deployBondkitToken([configArg], {
164
+ account: accountToUse,
165
+ chain: this.chain,
166
+ });
167
+ console.log("hash", hash);
168
+ const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
169
+ for (const log of receipt.logs) {
170
+ try {
171
+ if (log.topics[0] !== "0x75b2d0aabe689b83d7eb7920447b5ae7bef7f28da01d0beb3e197899392eb0d6") {
172
+ continue;
173
+ }
174
+ const decodedEvent = (0, viem_1.decodeEventLog)({
175
+ abi: abis_1.BondkitTokenFactoryABI,
176
+ data: log.data,
177
+ topics: log.topics,
178
+ });
179
+ return decodedEvent.args.tokenAddress;
180
+ }
181
+ catch (e) { }
182
+ }
183
+ throw new Error("BondkitTokenCreated event not found in transaction logs.");
184
+ }
185
+ catch (error) {
186
+ return this.handleError(error, "deployBondkitToken");
187
+ }
188
+ }
189
+ /**
190
+ * Gets the configuration of a deployed Bondkit token.
191
+ * @param tokenAddress The address of the Bondkit token.
192
+ * @returns The configuration object for the token.
193
+ */
194
+ async getBondkitTokenConfig(tokenAddress) {
195
+ try {
196
+ const result = await this.contract.read.getBondkitTokenConfig([tokenAddress]);
197
+ return result;
198
+ }
199
+ catch (error) {
200
+ console.error(`Error getting config for token ${tokenAddress}:`, error);
201
+ return undefined;
202
+ }
203
+ }
204
+ /**
205
+ * Gets a list of all Bondkit tokens deployed by this factory.
206
+ * @returns An array of token addresses.
207
+ */
208
+ async getDeployedBondkitTokens() {
209
+ // ABI returns address[] which viem treats as readonly Address[]
210
+ try {
211
+ return await this.contract.read.getDeployedBondkitTokens(); // No arguments if function takes none
212
+ }
213
+ catch (error) {
214
+ console.error("Error getting all deployed tokens:", error);
215
+ return [];
216
+ }
217
+ }
218
+ /**
219
+ * Gets the owner of the factory contract.
220
+ * @returns The address of the owner.
221
+ */
222
+ async getOwner() {
223
+ try {
224
+ return await this.contract.read.owner(); // No arguments if function takes none
225
+ }
226
+ catch (error) {
227
+ console.error("Error getting factory owner:", error);
228
+ return undefined;
229
+ }
230
+ }
231
+ /**
232
+ * Gets the implementation address used for new Bondkit token clones.
233
+ * @returns The address of the BondkitToken implementation contract.
234
+ */
235
+ async getBondkitTokenImplementation() {
236
+ try {
237
+ return await this.contract.read.bondkitTokenImplementation(); // No arguments if function takes none
238
+ }
239
+ catch (error) {
240
+ console.error("Error getting Bondkit token implementation address:", error);
241
+ return undefined;
242
+ }
243
+ }
244
+ // --- Write Methods (Ownership, etc.) --- //
245
+ /**
246
+ * Transfers ownership of the factory contract to a new owner.
247
+ * Requires the current owner to call this method.
248
+ * @param newOwner The address of the new owner.
249
+ * @returns A promise that resolves with the transaction hash.
250
+ */
251
+ async transferOwnership(newOwner) {
252
+ if (!this.walletClientInstance.account && !this.walletKey) {
253
+ await this.ensureWriteAccount();
254
+ if (!this.walletClientInstance.account && !this.walletKey) {
255
+ throw new Error("Wallet key not set or client not connected with an account for write operation.");
256
+ }
257
+ }
258
+ try {
259
+ const accountToUse = this.walletKey ? (0, accounts_1.privateKeyToAccount)(this.walletKey) : this.walletClientInstance.account;
260
+ if (!accountToUse) {
261
+ throw new Error("Account for transaction could not be determined.");
262
+ }
263
+ const hash = await this.contract.write.transferOwnership([newOwner], {
264
+ account: accountToUse,
265
+ chain: this.chain,
266
+ });
267
+ return hash;
268
+ }
269
+ catch (error) {
270
+ return this.handleError(error, "transferOwnership");
271
+ }
272
+ }
273
+ }
274
+ exports.BondkitTokenFactory = BondkitTokenFactory;
@@ -0,0 +1,3 @@
1
+ import { TradingViewProps } from "./types";
2
+ declare const TradingView: ({ className, tokenAddress, tokenSymbol }: TradingViewProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default TradingView;
@@ -0,0 +1,296 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const cdn_loader_1 = require("./utils/cdn-loader");
6
+ const format_1 = require("./utils/format");
7
+ const lucide_react_1 = require("lucide-react");
8
+ const react_1 = require("react");
9
+ // TradingView will be available on window after loading from CDN
10
+ // Datafeed will be implemented inline
11
+ // Mock loading overlay - replace with your actual loading component
12
+ const GifLoadingOverlay = ({ className }) => ((0, jsx_runtime_1.jsx)("div", { className: `absolute inset-0 flex items-center justify-center bg-white/50 backdrop-blur-sm ${className || ""}`, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-secondary-grey h-8 w-8 animate-spin" }) }));
13
+ const TradingView = ({ className, tokenAddress, tokenSymbol }) => {
14
+ const theme = "light";
15
+ // Use token info for the current trade
16
+ const currentTrade = {
17
+ product_id: tokenAddress && tokenSymbol ? `${tokenSymbol}-${tokenAddress}` : "BONDKIT",
18
+ };
19
+ const [tradingViewDefaultInterval, setTradingViewDefaultInterval] = (0, react_1.useState)("60");
20
+ const [tradingViewTimezone, setTradingViewTimezone] = (0, react_1.useState)("");
21
+ const chartContainerRef = (0, react_1.useRef)(null);
22
+ const tvWidgetRef = (0, react_1.useRef)(null);
23
+ const [chartLoaded, setChartLoaded] = (0, react_1.useState)(false);
24
+ const [showLoading, setShowLoading] = (0, react_1.useState)(true);
25
+ const [librariesLoaded, setLibrariesLoaded] = (0, react_1.useState)(false);
26
+ const isChangingInterval = (0, react_1.useRef)(false);
27
+ // Load TradingView libraries from CDN
28
+ (0, react_1.useEffect)(() => {
29
+ const loadLibraries = async () => {
30
+ try {
31
+ // Load TradingView charting library
32
+ await (0, cdn_loader_1.loadScriptFromCDN)("/static/charting_library/charting_library.js");
33
+ setLibrariesLoaded(true);
34
+ }
35
+ catch (error) {
36
+ console.error("Failed to load TradingView libraries:", error);
37
+ }
38
+ };
39
+ loadLibraries();
40
+ }, []);
41
+ (0, react_1.useEffect)(() => {
42
+ if (!chartContainerRef.current || !librariesLoaded)
43
+ return;
44
+ // Create UDF-compatible datafeed that mimics the original UDFCompatibleDatafeed
45
+ const createUDFDatafeed = (baseUrl) => {
46
+ return {
47
+ onReady: (callback) => {
48
+ // Fetch configuration from UDF config endpoint
49
+ fetch(`${baseUrl}/config`)
50
+ .then(response => response.json())
51
+ .then(config => callback(config))
52
+ .catch(() => {
53
+ // Fallback configuration if config endpoint fails
54
+ callback({
55
+ supported_resolutions: ["1", "5", "15", "30", "60", "1D", "1W", "1M"],
56
+ supports_group_request: false,
57
+ supports_marks: false,
58
+ supports_search: false,
59
+ supports_timescale_marks: false,
60
+ });
61
+ });
62
+ },
63
+ searchSymbols: () => { },
64
+ resolveSymbol: (symbolName, onSymbolResolvedCallback) => {
65
+ // Try to fetch symbol info from UDF endpoint
66
+ fetch(`${baseUrl}/symbols?symbol=${symbolName}`)
67
+ .then(response => response.json())
68
+ .then(symbolInfo => onSymbolResolvedCallback(symbolInfo))
69
+ .catch(() => {
70
+ // Fallback symbol info
71
+ onSymbolResolvedCallback({
72
+ name: symbolName,
73
+ ticker: symbolName,
74
+ description: symbolName,
75
+ type: "crypto",
76
+ session: "24x7",
77
+ timezone: "Etc/UTC",
78
+ exchange: "BONDKIT",
79
+ minmov: 1,
80
+ pricescale: 10000,
81
+ has_intraday: true,
82
+ supported_resolutions: ["1", "5", "15", "30", "60", "1D", "1W", "1M"],
83
+ });
84
+ });
85
+ },
86
+ getBars: async (symbolInfo, resolution, periodParams, onHistoryCallback) => {
87
+ try {
88
+ const { from, to, countback } = periodParams;
89
+ // Build URL with parameters matching production
90
+ const params = new URLSearchParams({
91
+ symbol: symbolInfo.ticker,
92
+ resolution: resolution,
93
+ from: from.toString(),
94
+ to: to.toString(),
95
+ currencyCode: "ETH",
96
+ });
97
+ // Add countback if provided
98
+ if (countback) {
99
+ params.append("countback", countback.toString());
100
+ }
101
+ const response = await fetch(`${baseUrl}/history?${params}`);
102
+ if (!response.ok) {
103
+ throw new Error(`HTTP error! status: ${response.status}`);
104
+ }
105
+ const data = await response.json();
106
+ if (data.s === "ok" && data.t && data.t.length > 0) {
107
+ const bars = data.t.map((time, index) => ({
108
+ time: parseInt(time) * 1000, // Convert string to number, then to milliseconds
109
+ open: parseFloat(data.o[index]), // Parse string to number
110
+ high: parseFloat(data.h[index]),
111
+ low: parseFloat(data.l[index]),
112
+ close: parseFloat(data.c[index]),
113
+ volume: data.v ? parseFloat(data.v[index]) : 0, // Parse volume string to number
114
+ }));
115
+ onHistoryCallback(bars, { noData: false });
116
+ }
117
+ else {
118
+ onHistoryCallback([], { noData: true });
119
+ }
120
+ }
121
+ catch (error) {
122
+ console.error("Error fetching bars:", error);
123
+ onHistoryCallback([], { noData: true });
124
+ }
125
+ },
126
+ subscribeBars: () => { },
127
+ unsubscribeBars: () => { },
128
+ };
129
+ };
130
+ const datafeed = createUDFDatafeed("https://b3-udf-worker.sean-430.workers.dev/bondkit/udf");
131
+ // Calculate timeframe for last 2 days
132
+ const currentTime = Math.floor(Date.now() / 1000);
133
+ const twoDaysAgo = currentTime - 2 * 24 * 60 * 60; // 2 days in seconds
134
+ const widgetOptions = {
135
+ timeframe: { from: twoDaysAgo, to: currentTime }, // Show last 2 days
136
+ symbol: currentTrade?.product_id || "BONDKIT",
137
+ datafeed: datafeed,
138
+ interval: tradingViewDefaultInterval,
139
+ container: chartContainerRef.current,
140
+ library_path: "https://cdn.b3.fun/static/charting_library/",
141
+ locale: "en",
142
+ disabled_features: [
143
+ "use_localstorage_for_settings",
144
+ "header_symbol_search",
145
+ "save_chart_properties_to_local_storage",
146
+ "header_compare",
147
+ "vert_touch_drag_scroll",
148
+ ],
149
+ enabled_features: ["study_templates", "hide_left_toolbar_by_default"],
150
+ charts_storage_url: "https://saveload.tradingview.com",
151
+ charts_storage_api_version: "1.1",
152
+ client_id: "tradingview.com",
153
+ user_id: "public_user_id",
154
+ fullscreen: false,
155
+ autosize: true,
156
+ timezone: (tradingViewTimezone || getTimezone()),
157
+ debug: true,
158
+ // Configure time frame buttons in the bottom left
159
+ time_frames: [
160
+ {
161
+ text: "5m",
162
+ resolution: "5",
163
+ description: "5 days in 5 minute intervals",
164
+ title: "5m",
165
+ },
166
+ {
167
+ text: "1h",
168
+ resolution: "60",
169
+ description: "1 week in 1 hour intervals",
170
+ title: "1h",
171
+ },
172
+ {
173
+ text: "1d",
174
+ resolution: "1D",
175
+ description: "1 month in 1 day intervals",
176
+ title: "1d",
177
+ },
178
+ {
179
+ text: "1w",
180
+ resolution: "1W",
181
+ description: "6 months in 1 week intervals",
182
+ title: "1w",
183
+ },
184
+ ],
185
+ overrides: {
186
+ "paneProperties.background": "#FFFFFF",
187
+ "paneProperties.backgroundType": "solid",
188
+ "mainSeriesProperties.candleStyle.upColor": "#4AD50D",
189
+ "mainSeriesProperties.candleStyle.borderUpColor": "#4AD50D",
190
+ "mainSeriesProperties.candleStyle.downColor": "#F04438",
191
+ "mainSeriesProperties.candleStyle.borderDownColor": "#F04438",
192
+ "scalesProperties.fontSize": 10,
193
+ },
194
+ studies_overrides: {
195
+ "volume.volume.color.0": "#80231C",
196
+ "volume.volume.color.1": "#215611",
197
+ },
198
+ loading_screen: {
199
+ backgroundColor: "transparent",
200
+ },
201
+ custom_css_url: "/custom-css/tradingview.css",
202
+ custom_font_family: "'Roboto', sans-serif",
203
+ toolbar_bg: "#FFFFFF",
204
+ theme: "light",
205
+ custom_formatters: {
206
+ priceFormatterFactory: () => {
207
+ return {
208
+ format: (price) => {
209
+ if (price < 0.0001) {
210
+ return (0, format_1.formatNumberSmall)(price, true);
211
+ }
212
+ return price.toFixed(4);
213
+ },
214
+ };
215
+ },
216
+ },
217
+ };
218
+ const tvWidget = new window.TradingView.widget(widgetOptions);
219
+ tvWidgetRef.current = tvWidget;
220
+ tvWidget.onChartReady(() => {
221
+ setShowLoading(false);
222
+ setChartLoaded(true);
223
+ // Subscribe to interval changes
224
+ tvWidget
225
+ .activeChart()
226
+ .onIntervalChanged()
227
+ .subscribe(null, (interval) => {
228
+ isChangingInterval.current = true;
229
+ setTradingViewDefaultInterval(interval);
230
+ // Reset the flag after a short delay
231
+ setTimeout(() => {
232
+ isChangingInterval.current = false;
233
+ }, 300);
234
+ });
235
+ // Subscribe to timezone changes
236
+ tvWidget
237
+ .activeChart()
238
+ .getTimezoneApi()
239
+ .onTimezoneChanged()
240
+ .subscribe(null, (timezone) => {
241
+ setTradingViewTimezone(timezone);
242
+ });
243
+ });
244
+ return () => {
245
+ if (tvWidgetRef.current) {
246
+ tvWidgetRef.current.remove();
247
+ tvWidgetRef.current = null;
248
+ }
249
+ };
250
+ }, [theme, librariesLoaded]);
251
+ (0, react_1.useEffect)(() => {
252
+ if (chartLoaded &&
253
+ currentTrade?.product_id &&
254
+ tvWidgetRef.current &&
255
+ !isChangingInterval.current // Only check symbol if we're not changing interval
256
+ ) {
257
+ try {
258
+ const currentSymbol = tvWidgetRef.current.symbolInterval()?.symbol;
259
+ const targetSymbol = currentTrade.product_id;
260
+ // Check if symbols are different (handle both normal and contract address formats)
261
+ const isSameSymbol = currentSymbol === targetSymbol ||
262
+ (currentSymbol && targetSymbol && currentSymbol.split("-")[1] === targetSymbol.split("-")[1]); // Compare contract addresses
263
+ if (!isSameSymbol) {
264
+ setShowLoading(true);
265
+ try {
266
+ tvWidgetRef.current?.setSymbol?.(targetSymbol, tradingViewDefaultInterval, () => {
267
+ setShowLoading(false);
268
+ });
269
+ }
270
+ catch (e) {
271
+ console.error("Error setting symbol:", e);
272
+ setShowLoading(false);
273
+ }
274
+ }
275
+ }
276
+ catch (error) {
277
+ console.error("Error checking symbol:", error);
278
+ }
279
+ }
280
+ }, [chartLoaded, currentTrade?.product_id, tradingViewDefaultInterval]);
281
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `relative h-[600px] w-full ${className || ""}`, children: [(0, jsx_runtime_1.jsx)("div", { className: "h-full w-full", ref: chartContainerRef }), showLoading && !isChangingInterval.current && (0, jsx_runtime_1.jsx)(GifLoadingOverlay, {})] }));
282
+ };
283
+ exports.default = TradingView;
284
+ const getTimezone = () => {
285
+ // Simple timezone detection
286
+ try {
287
+ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
288
+ if (timezone === "Asia/Saigon") {
289
+ return "Asia/Ho_Chi_Minh";
290
+ }
291
+ return timezone;
292
+ }
293
+ catch (e) {
294
+ return "UTC";
295
+ }
296
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * CDN Configuration
3
+ * Configure your CDN URLs here
4
+ */
5
+ export declare const CDN_CONFIG: {
6
+ readonly baseUrl: string;
7
+ readonly chartingLibrary: {
8
+ readonly basePath: "/static/charting_library";
9
+ readonly files: {
10
+ readonly main: "/charting_library.js";
11
+ readonly esm: "/charting_library.esm.js";
12
+ readonly cjs: "/charting_library.cjs.js";
13
+ readonly standalone: "/charting_library.standalone.js";
14
+ readonly types: "/charting_library.d.ts";
15
+ readonly bundles: "/bundles";
16
+ };
17
+ };
18
+ readonly datafeeds: {
19
+ readonly basePath: "/static/datafeeds";
20
+ readonly udf: "/udf/src/udf-compatible-datafeed.js";
21
+ };
22
+ };
23
+ /**
24
+ * Get full CDN URL for a resource
25
+ */
26
+ export declare function getCDNUrl(path: string): string;
27
+ /**
28
+ * Get TradingView library path for widget configuration
29
+ */
30
+ export declare function getTradingViewLibraryPath(): string;
31
+ /**
32
+ * Check if CDN is enabled (useful for development)
33
+ */
34
+ export declare function isCDNEnabled(): boolean;
35
+ /**
36
+ * Check if we're using a custom CDN domain vs the default R2 URL
37
+ */
38
+ export declare function isUsingCustomDomain(): boolean;
39
+ /**
40
+ * Get library path - Always use CDN since static files are removed
41
+ */
42
+ export declare function getLibraryPath(): string;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ /**
3
+ * CDN Configuration
4
+ * Configure your CDN URLs here
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CDN_CONFIG = void 0;
8
+ exports.getCDNUrl = getCDNUrl;
9
+ exports.getTradingViewLibraryPath = getTradingViewLibraryPath;
10
+ exports.isCDNEnabled = isCDNEnabled;
11
+ exports.isUsingCustomDomain = isUsingCustomDomain;
12
+ exports.getLibraryPath = getLibraryPath;
13
+ exports.CDN_CONFIG = {
14
+ // Base CDN URL - will use your custom domain or R2 public URL
15
+ baseUrl: process.env.NEXT_PUBLIC_CDN_URL || "https://cdn.b3.fun",
16
+ // TradingView charting library paths
17
+ chartingLibrary: {
18
+ basePath: "/static/charting_library",
19
+ files: {
20
+ main: "/charting_library.js",
21
+ esm: "/charting_library.esm.js",
22
+ cjs: "/charting_library.cjs.js",
23
+ standalone: "/charting_library.standalone.js",
24
+ types: "/charting_library.d.ts",
25
+ bundles: "/bundles",
26
+ },
27
+ },
28
+ // Datafeeds paths
29
+ datafeeds: {
30
+ basePath: "/static/datafeeds",
31
+ udf: "/udf/src/udf-compatible-datafeed.js",
32
+ },
33
+ };
34
+ /**
35
+ * Get full CDN URL for a resource
36
+ */
37
+ function getCDNUrl(path) {
38
+ return `${exports.CDN_CONFIG.baseUrl}${path}`;
39
+ }
40
+ /**
41
+ * Get TradingView library path for widget configuration
42
+ */
43
+ function getTradingViewLibraryPath() {
44
+ return getCDNUrl(exports.CDN_CONFIG.chartingLibrary.basePath + "/");
45
+ }
46
+ /**
47
+ * Check if CDN is enabled (useful for development)
48
+ */
49
+ function isCDNEnabled() {
50
+ return process.env.NODE_ENV === "production" || process.env.NEXT_PUBLIC_FORCE_CDN === "true";
51
+ }
52
+ /**
53
+ * Check if we're using a custom CDN domain vs the default R2 URL
54
+ */
55
+ function isUsingCustomDomain() {
56
+ return !!process.env.NEXT_PUBLIC_CDN_URL;
57
+ }
58
+ /**
59
+ * Get library path - Always use CDN since static files are removed
60
+ */
61
+ function getLibraryPath() {
62
+ return getTradingViewLibraryPath();
63
+ }
@@ -0,0 +1,5 @@
1
+ export { default as TradingView } from "./TradingView";
2
+ export type { TradingViewProps } from "./types";
3
+ export * from "./utils/cdn-loader";
4
+ export * from "./utils/format";
5
+ export * from "./config/cdn";