@ape.swap/bonds-sdk 7.0.0-test.4 → 7.0.0-test.6

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 (57) hide show
  1. package/README.md +59 -31
  2. package/dist/components/ApeBondSDK/index.d.ts +13 -0
  3. package/dist/components/ApeBondSDK/index.js +20 -0
  4. package/dist/components/ApeBondSDK/index.js.map +1 -0
  5. package/dist/components/uikit-sdk/Svg/Icons/CoinGecko.js +3 -1
  6. package/dist/components/uikit-sdk/Svg/Icons/CoinGecko.js.map +1 -1
  7. package/dist/components/uikit-sdk/Svg/Icons/GiftBox.js +3 -1
  8. package/dist/components/uikit-sdk/Svg/Icons/GiftBox.js.map +1 -1
  9. package/dist/components/uikit-sdk/Svg/Icons/L1X.js +3 -1
  10. package/dist/components/uikit-sdk/Svg/Icons/L1X.js.map +1 -1
  11. package/dist/components/uikit-sdk/Svg/Icons/Success.js +3 -1
  12. package/dist/components/uikit-sdk/Svg/Icons/Success.js.map +1 -1
  13. package/dist/components/uikit-sdk/Svg/tokens/AVAX.js +3 -1
  14. package/dist/components/uikit-sdk/Svg/tokens/AVAX.js.map +1 -1
  15. package/dist/components/uikit-sdk/Svg/tokens/BLAST.js +3 -1
  16. package/dist/components/uikit-sdk/Svg/tokens/BLAST.js.map +1 -1
  17. package/dist/components/uikit-sdk/Svg/tokens/GraphLinq.js +3 -1
  18. package/dist/components/uikit-sdk/Svg/tokens/GraphLinq.js.map +1 -1
  19. package/dist/components/uikit-sdk/Svg/tokens/INEVM.js +3 -1
  20. package/dist/components/uikit-sdk/Svg/tokens/INEVM.js.map +1 -1
  21. package/dist/components/uikit-sdk/Svg/tokens/IOTA.js +3 -1
  22. package/dist/components/uikit-sdk/Svg/tokens/IOTA.js.map +1 -1
  23. package/dist/components/uikit-sdk/Svg/tokens/SOL.js +3 -1
  24. package/dist/components/uikit-sdk/Svg/tokens/SOL.js.map +1 -1
  25. package/dist/components/uikit-sdk/Svg/tokens/TLOS.js +3 -1
  26. package/dist/components/uikit-sdk/Svg/tokens/TLOS.js.map +1 -1
  27. package/dist/main.d.ts +4 -4
  28. package/dist/main.js +4 -4
  29. package/dist/main.js.map +1 -1
  30. package/dist/providers/index.d.ts +3 -0
  31. package/dist/providers/index.js +7 -3
  32. package/dist/providers/index.js.map +1 -1
  33. package/dist/state/chainAccount/useChainAccount.d.ts +5 -1
  34. package/dist/state/chainAccount/useChainAccount.js +19 -1
  35. package/dist/state/chainAccount/useChainAccount.js.map +1 -1
  36. package/dist/state/useSDKConfig.d.ts +12 -1
  37. package/dist/state/useSDKConfig.js +76 -56
  38. package/dist/state/useSDKConfig.js.map +1 -1
  39. package/dist/views/Bonds/index.d.ts +1 -3
  40. package/dist/views/Bonds/index.js +1 -5
  41. package/dist/views/Bonds/index.js.map +1 -1
  42. package/dist/views/BuyBond/index.d.ts +1 -4
  43. package/dist/views/BuyBond/index.js +1 -5
  44. package/dist/views/BuyBond/index.js.map +1 -1
  45. package/dist/views/FullBondsView/index.d.ts +1 -3
  46. package/dist/views/FullBondsView/index.js +1 -5
  47. package/dist/views/FullBondsView/index.js.map +1 -1
  48. package/dist/views/ProjectView/index.d.ts +1 -4
  49. package/dist/views/ProjectView/index.js +1 -5
  50. package/dist/views/ProjectView/index.js.map +1 -1
  51. package/dist/views/SingleBond/index.d.ts +1 -4
  52. package/dist/views/SingleBond/index.js +1 -5
  53. package/dist/views/SingleBond/index.js.map +1 -1
  54. package/dist/views/YourBonds/index.d.ts +1 -3
  55. package/dist/views/YourBonds/index.js +1 -5
  56. package/dist/views/YourBonds/index.js.map +1 -1
  57. package/package.json +5 -5
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":["../src/main.ts"],"sourcesContent":["/**\n * @ape.swap/bonds-sdk - Main Entry Point\n *\n * This barrel export provides backward compatibility.\n * For optimal bundle size, use granular imports:\n *\n * @example Tree-shakeable imports (RECOMMENDED for bundle optimization)\n * ```typescript\n * // Import only what you need - reduces bundle by ~90%\n * import Bonds from '@ape.swap/bonds-sdk/views/Bonds'\n * import TokenImage from '@ape.swap/bonds-sdk/components/TokenImage'\n * import { useTokenPrices } from '@ape.swap/bonds-sdk/hooks/useTokenPrices'\n * ```\n *\n * @example Barrel imports (backward compatible, larger bundle)\n * ```typescript\n * // Works but includes more code in bundle\n * import { Bonds, TokenImage, useTokenPrices } from '@ape.swap/bonds-sdk'\n * ```\n *\n * @see https://vercel.com/docs/concepts/functions/edge-functions/best-practices\n * Rule: bundle-barrel-imports - Avoid barrel imports for optimal tree-shaking\n */\n\n// Components\nimport Bonds from './views/Bonds'\nimport YourBonds from './views/YourBonds'\nimport BuyBondModal from './views/BuyBond'\nimport FullBondsView from './views/FullBondsView'\nimport ProjectView from './views/ProjectView'\nimport { generateImageFromTemplate } from './views/YourBondsModal/components/LinkShare/utils'\nimport { ChainId } from '@ape.swap/apeswap-lists'\nimport SingleBond from './views/SingleBond'\nimport useTokenPrices from './state/tokenPrices/useTokenPrices'\nimport { useSDKConfig } from './state/useSDKConfig'\nimport { BLOCK_EXPLORER } from './config/constants/chains'\nimport useCurrencyBalance from './state/balance/useCurrencyBalance'\nimport useUserTokensBalance from './state/balance/useUserTokensBalance'\nimport TokenImage from './components/uikit-sdk/TokenImage'\n// The legacy barrel keeps re-exporting useApproval, so it requires the EVM peers (wagmi, viem); partners without EVM\n// use the subpath imports instead. See docs/PLAN_CHAIN_ADAPTERS.md, section 3.7.\n// eslint-disable-next-line no-restricted-imports\nimport { useApproval } from './adapters/evm/state/useAllowance'\nimport useBondsData from './state/bonds/useBondsData'\n\n/** @deprecated Use granular import: `import Bonds from '@ape.swap/bonds-sdk/views/Bonds'` */\nconst _Bonds: typeof Bonds = Bonds\n/** @deprecated Use granular import: `import BuyBondModal from '@ape.swap/bonds-sdk/views/BuyBondModal'` */\nconst _BuyBondModal: typeof BuyBondModal = BuyBondModal\n/** @deprecated Use granular import: `import YourBonds from '@ape.swap/bonds-sdk/views/YourBonds'` */\nconst _YourBonds: typeof YourBonds = YourBonds\n/** @deprecated Use granular import: `import FullBondsView from '@ape.swap/bonds-sdk/views/FullBondsView'` */\nconst _FullBondsView: typeof FullBondsView = FullBondsView\n/** @deprecated Use granular import: `import ProjectView from '@ape.swap/bonds-sdk/views/ProjectView'` */\nconst _ProjectView: typeof ProjectView = ProjectView\n/** @deprecated Use granular import: `import { generateImageFromTemplate } from '@ape.swap/bonds-sdk/utils/generateImageFromTemplate'` */\nconst _generateImageFromTemplate: typeof generateImageFromTemplate = generateImageFromTemplate\n/** @deprecated Use granular import: `import { ChainId } from '@ape.swap/apeswap-lists'` */\nconst _ChainId: typeof ChainId = ChainId\n/** @deprecated Use granular import: `import SingleBond from '@ape.swap/bonds-sdk/views/SingleBond'` */\nconst _SingleBond: typeof SingleBond = SingleBond\n/** @deprecated Use granular import: `import useTokenPrices from '@ape.swap/bonds-sdk/hooks/useTokenPrices'` */\nconst _useTokenPrices: typeof useTokenPrices = useTokenPrices\n/** @deprecated Use granular import: `import useBondsData from '@ape.swap/bonds-sdk/hooks/useBondsData'` */\nconst _useBondsData: typeof useBondsData = useBondsData\n/** @deprecated Use granular import: `import { useSDKConfig } from '@ape.swap/bonds-sdk/hooks/useSDKConfig'` */\nconst _useSDKConfig: typeof useSDKConfig = useSDKConfig\n/** @deprecated Use granular import: `import { BLOCK_EXPLORER } from '@ape.swap/bonds-sdk/constants/chains'` */\nconst _BLOCK_EXPLORER: typeof BLOCK_EXPLORER = BLOCK_EXPLORER\n/** @deprecated Use granular import: `import useCurrencyBalance from '@ape.swap/bonds-sdk/hooks/useCurrencyBalance'` */\nconst _useCurrencyBalance: typeof useCurrencyBalance = useCurrencyBalance\n/** @deprecated Use granular import: `import useUserTokensBalance from '@ape.swap/bonds-sdk/hooks/useUserTokensBalance'` */\nconst _useUserTokensBalance: typeof useUserTokensBalance = useUserTokensBalance\n/** @deprecated Use granular import: `import TokenImage from '@ape.swap/bonds-sdk/components/TokenImage'` */\nconst _TokenImage: typeof TokenImage = TokenImage\n/** @deprecated Use granular import: `import { useApproval } from '@ape.swap/bonds-sdk/hooks/useApproval'` */\nconst _useApproval: typeof useApproval = useApproval\n\nexport {\n _Bonds as Bonds,\n _BuyBondModal as BuyBondModal,\n _YourBonds as YourBonds,\n _FullBondsView as FullBondsView,\n _ProjectView as ProjectView,\n _generateImageFromTemplate as generateImageFromTemplate,\n _ChainId as ChainId,\n _SingleBond as SingleBond,\n _useTokenPrices as useTokenPrices,\n _useBondsData as useBondsData,\n _useSDKConfig as useSDKConfig,\n _BLOCK_EXPLORER as BLOCK_EXPLORER,\n _useCurrencyBalance as useCurrencyBalance,\n _useUserTokensBalance as useUserTokensBalance,\n _TokenImage as TokenImage,\n _useApproval as useApproval,\n}\n"],"names":["Bonds","BuyBondModal","YourBonds","FullBondsView","ProjectView","SingleBond"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAEH;AAqBA;AACA,MAAM,MAAM,GAAiBA;AAC7B;AACA,MAAM,aAAa,GAAwBC;AAC3C;AACA,MAAM,UAAU,GAAqBC;AACrC;AACA,MAAM,cAAc,GAAyBC;AAC7C;AACA,MAAM,YAAY,GAAuBC;AACzC;AACA,MAAM,0BAA0B,GAAqC;AACrE;AACA,MAAM,QAAQ,GAAmB;AACjC;AACA,MAAM,WAAW,GAAsBC;AACvC;AACA,MAAM,eAAe,GAA0B;AAC/C;AACA,MAAM,aAAa,GAAwB;AAC3C;AACA,MAAM,aAAa,GAAwB;AAC3C;AACA,MAAM,eAAe,GAA0B;AAC/C;AACA,MAAM,mBAAmB,GAA8B;AACvD;AACA,MAAM,qBAAqB,GAAgC;AAC3D;AACA,MAAM,WAAW,GAAsB;AACvC;AACA,MAAM,YAAY,GAAuB;;;;"}
1
+ {"version":3,"file":"main.js","sources":["../src/main.ts"],"sourcesContent":["/**\n * @ape.swap/bonds-sdk - Main Entry Point\n *\n * This barrel export provides backward compatibility.\n * For optimal bundle size, use granular imports:\n *\n * @example Tree-shakeable imports (RECOMMENDED for bundle optimization)\n * ```typescript\n * // Import only what you need - reduces bundle by ~90%\n * import Bonds from '@ape.swap/bonds-sdk/views/Bonds'\n * import TokenImage from '@ape.swap/bonds-sdk/components/TokenImage'\n * import { useTokenPrices } from '@ape.swap/bonds-sdk/hooks/useTokenPrices'\n * ```\n *\n * @example Barrel imports (backward compatible, larger bundle)\n * ```typescript\n * // Works but includes more code in bundle\n * import { Bonds, TokenImage, useTokenPrices } from '@ape.swap/bonds-sdk'\n * ```\n *\n * @see https://vercel.com/docs/concepts/functions/edge-functions/best-practices\n * Rule: bundle-barrel-imports - Avoid barrel imports for optimal tree-shaking\n */\n\n// Components\nimport Bonds from './views/Bonds'\nimport YourBonds from './views/YourBonds'\nimport BuyBondModal from './views/BuyBond'\nimport FullBondsView from './views/FullBondsView'\nimport ProjectView from './views/ProjectView'\nimport { generateImageFromTemplate } from './views/YourBondsModal/components/LinkShare/utils'\nimport { ChainId } from '@ape.swap/apeswap-lists'\nimport SingleBond from './views/SingleBond'\nimport useTokenPrices from './state/tokenPrices/useTokenPrices'\nimport { BLOCK_EXPLORER } from './config/constants/chains'\nimport useCurrencyBalance from './state/balance/useCurrencyBalance'\nimport useUserTokensBalance from './state/balance/useUserTokensBalance'\nimport TokenImage from './components/uikit-sdk/TokenImage'\nimport ApeBondSDK from './components/ApeBondSDK'\n// The legacy barrel keeps re-exporting useApproval, so it requires the EVM peers (wagmi, viem); partners without EVM\n// use the subpath imports instead. See docs/PLAN_CHAIN_ADAPTERS.md, section 3.7.\n// eslint-disable-next-line no-restricted-imports\nimport { useApproval } from './adapters/evm/state/useAllowance'\nimport useBondsData from './state/bonds/useBondsData'\n\n/** @deprecated Use granular import: `import Bonds from '@ape.swap/bonds-sdk/views/Bonds'` */\nconst _Bonds: typeof Bonds = Bonds\n/** @deprecated Use granular import: `import BuyBondModal from '@ape.swap/bonds-sdk/views/BuyBondModal'` */\nconst _BuyBondModal: typeof BuyBondModal = BuyBondModal\n/** @deprecated Use granular import: `import YourBonds from '@ape.swap/bonds-sdk/views/YourBonds'` */\nconst _YourBonds: typeof YourBonds = YourBonds\n/** @deprecated Use granular import: `import FullBondsView from '@ape.swap/bonds-sdk/views/FullBondsView'` */\nconst _FullBondsView: typeof FullBondsView = FullBondsView\n/** @deprecated Use granular import: `import ProjectView from '@ape.swap/bonds-sdk/views/ProjectView'` */\nconst _ProjectView: typeof ProjectView = ProjectView\n/** @deprecated Use granular import: `import { generateImageFromTemplate } from '@ape.swap/bonds-sdk/utils/generateImageFromTemplate'` */\nconst _generateImageFromTemplate: typeof generateImageFromTemplate = generateImageFromTemplate\n/** @deprecated Use granular import: `import { ChainId } from '@ape.swap/apeswap-lists'` */\nconst _ChainId: typeof ChainId = ChainId\n/** @deprecated Use granular import: `import SingleBond from '@ape.swap/bonds-sdk/views/SingleBond'` */\nconst _SingleBond: typeof SingleBond = SingleBond\n/** @deprecated Use granular import: `import useTokenPrices from '@ape.swap/bonds-sdk/hooks/useTokenPrices'` */\nconst _useTokenPrices: typeof useTokenPrices = useTokenPrices\n/** @deprecated Use granular import: `import useBondsData from '@ape.swap/bonds-sdk/hooks/useBondsData'` */\nconst _useBondsData: typeof useBondsData = useBondsData\n/** @deprecated Use granular import: `import { BLOCK_EXPLORER } from '@ape.swap/bonds-sdk/constants/chains'` */\nconst _BLOCK_EXPLORER: typeof BLOCK_EXPLORER = BLOCK_EXPLORER\n/** @deprecated Use granular import: `import useCurrencyBalance from '@ape.swap/bonds-sdk/hooks/useCurrencyBalance'` */\nconst _useCurrencyBalance: typeof useCurrencyBalance = useCurrencyBalance\n/** @deprecated Use granular import: `import useUserTokensBalance from '@ape.swap/bonds-sdk/hooks/useUserTokensBalance'` */\nconst _useUserTokensBalance: typeof useUserTokensBalance = useUserTokensBalance\n/** @deprecated Use granular import: `import TokenImage from '@ape.swap/bonds-sdk/components/TokenImage'` */\nconst _TokenImage: typeof TokenImage = TokenImage\n/** @deprecated Use granular import: `import { useApproval } from '@ape.swap/bonds-sdk/hooks/useApproval'` */\nconst _useApproval: typeof useApproval = useApproval\n/** @deprecated Use granular import: `import ApeBondSDK from '@ape.swap/bonds-sdk/components/ApeBondSDK'` */\nconst _ApeBondSDK: typeof ApeBondSDK = ApeBondSDK\n\nexport {\n _Bonds as Bonds,\n _BuyBondModal as BuyBondModal,\n _YourBonds as YourBonds,\n _FullBondsView as FullBondsView,\n _ProjectView as ProjectView,\n _generateImageFromTemplate as generateImageFromTemplate,\n _ChainId as ChainId,\n _SingleBond as SingleBond,\n _useTokenPrices as useTokenPrices,\n _useBondsData as useBondsData,\n _BLOCK_EXPLORER as BLOCK_EXPLORER,\n _useCurrencyBalance as useCurrencyBalance,\n _useUserTokensBalance as useUserTokensBalance,\n _TokenImage as TokenImage,\n _useApproval as useApproval,\n _ApeBondSDK as ApeBondSDK,\n}\n"],"names":["Bonds","BuyBondModal","YourBonds","FullBondsView","ProjectView","SingleBond"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAEH;AAqBA;AACA,MAAM,MAAM,GAAiBA;AAC7B;AACA,MAAM,aAAa,GAAwBC;AAC3C;AACA,MAAM,UAAU,GAAqBC;AACrC;AACA,MAAM,cAAc,GAAyBC;AAC7C;AACA,MAAM,YAAY,GAAuBC;AACzC;AACA,MAAM,0BAA0B,GAAqC;AACrE;AACA,MAAM,QAAQ,GAAmB;AACjC;AACA,MAAM,WAAW,GAAsBC;AACvC;AACA,MAAM,eAAe,GAA0B;AAC/C;AACA,MAAM,aAAa,GAAwB;AAC3C;AACA,MAAM,eAAe,GAA0B;AAC/C;AACA,MAAM,mBAAmB,GAA8B;AACvD;AACA,MAAM,qBAAqB,GAAgC;AAC3D;AACA,MAAM,WAAW,GAAsB;AACvC;AACA,MAAM,YAAY,GAAuB;AACzC;AACA,MAAM,WAAW,GAAsB;;;;"}
@@ -9,6 +9,9 @@ import React from 'react';
9
9
  * The components exported from the src/main.ts file are all wrapped with this Provider component. Though the FullBondsView
10
10
  * component that imports the Bonds and YourBonds views, does NOT import the Bonds and YourBonds with providers, it imports
11
11
  * the component directly without providers. This is important to understand.
12
+ *
13
+ * The config and the adapters' AccountBridges come from <ApeBondSDK /> (components/ApeBondSDK), which consumers mount
14
+ * once at the app root; the views don't mount bridges themselves.
12
15
  */
13
16
  declare const Providers: ({ children }: {
14
17
  children: React.ReactNode;
@@ -1,7 +1,7 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
1
+ import { jsx } from 'react/jsx-runtime';
2
2
  import ModalProvider from '../contexts/ModalContext.js';
3
3
  import Popups from '../contexts/Popups.js';
4
- import { getRegisteredAdapters } from '../adapters/registry.js';
4
+ import { useWarnIfNotConfigured } from '../state/useSDKConfig.js';
5
5
 
6
6
  /**
7
7
  * This is the list of local providers that will be used internally by the SDK
@@ -13,9 +13,13 @@ import { getRegisteredAdapters } from '../adapters/registry.js';
13
13
  * The components exported from the src/main.ts file are all wrapped with this Provider component. Though the FullBondsView
14
14
  * component that imports the Bonds and YourBonds views, does NOT import the Bonds and YourBonds with providers, it imports
15
15
  * the component directly without providers. This is important to understand.
16
+ *
17
+ * The config and the adapters' AccountBridges come from <ApeBondSDK /> (components/ApeBondSDK), which consumers mount
18
+ * once at the app root; the views don't mount bridges themselves.
16
19
  */
17
20
  const Providers = ({ children }) => {
18
- return (jsxs("div", { className: "ape-root", children: [getRegisteredAdapters().map((adapter) => (jsx(adapter.AccountBridge, {}, adapter.ecosystem))), jsx(ModalProvider, { children: jsx(Popups, { children: children }) })] }));
21
+ useWarnIfNotConfigured();
22
+ return (jsx("div", { className: "ape-root", children: jsx(ModalProvider, { children: jsx(Popups, { children: children }) }) }));
19
23
  };
20
24
 
21
25
  export { Providers as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/providers/index.tsx"],"sourcesContent":["import React from 'react'\nimport ModalProvider from '../contexts/ModalContext'\nimport Popups from '../contexts/Popups'\nimport { getRegisteredAdapters } from '../adapters/registry'\n\n/**\n * This is the list of local providers that will be used internally by the SDK\n *\n * It is important to understand the difference between this component and the one located on the dev directory,\n * which aims to simulate the providers required to be installed by the consumer of the SDK.\n *\n * Finally, it is important to note that this Providers component should NOT be used multiple times, so for instance:\n * The components exported from the src/main.ts file are all wrapped with this Provider component. Though the FullBondsView\n * component that imports the Bonds and YourBonds views, does NOT import the Bonds and YourBonds with providers, it imports\n * the component directly without providers. This is important to understand.\n */\n\nconst Providers = ({ children }: { children: React.ReactNode }) => {\n return (\n <div className=\"ape-root\">\n {getRegisteredAdapters().map((adapter) => (\n <adapter.AccountBridge key={adapter.ecosystem} />\n ))}\n <ModalProvider>\n <Popups>{children}</Popups>\n </ModalProvider>\n </div>\n )\n}\n\nexport default Providers\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAKA;;;;;;;;;;AAUG;AAEH,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAiC,KAAI;AAChE,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,UAAU,EAAA,QAAA,EAAA,CACtB,qBAAqB,EAAE,CAAC,GAAG,CAAC,CAAC,OAAO,MACnCC,IAAC,OAAO,CAAC,aAAa,EAAA,EAAA,EAAM,OAAO,CAAC,SAAS,CAAI,CAClD,CAAC,EACFA,GAAA,CAAC,aAAa,EAAA,EAAA,QAAA,EACZA,GAAA,CAAC,MAAM,EAAA,EAAA,QAAA,EAAE,QAAQ,GAAU,EAAA,CACb,CAAA,EAAA,CACZ;AAEV;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/providers/index.tsx"],"sourcesContent":["import React from 'react'\nimport ModalProvider from '../contexts/ModalContext'\nimport Popups from '../contexts/Popups'\nimport { useWarnIfNotConfigured } from '../state/useSDKConfig'\n\n/**\n * This is the list of local providers that will be used internally by the SDK\n *\n * It is important to understand the difference between this component and the one located on the dev directory,\n * which aims to simulate the providers required to be installed by the consumer of the SDK.\n *\n * Finally, it is important to note that this Providers component should NOT be used multiple times, so for instance:\n * The components exported from the src/main.ts file are all wrapped with this Provider component. Though the FullBondsView\n * component that imports the Bonds and YourBonds views, does NOT import the Bonds and YourBonds with providers, it imports\n * the component directly without providers. This is important to understand.\n *\n * The config and the adapters' AccountBridges come from <ApeBondSDK /> (components/ApeBondSDK), which consumers mount\n * once at the app root; the views don't mount bridges themselves.\n */\n\nconst Providers = ({ children }: { children: React.ReactNode }) => {\n useWarnIfNotConfigured()\n return (\n <div className=\"ape-root\">\n <ModalProvider>\n <Popups>{children}</Popups>\n </ModalProvider>\n </div>\n )\n}\n\nexport default Providers\n"],"names":["_jsx"],"mappings":";;;;;AAKA;;;;;;;;;;;;;AAaG;AAEH,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAiC,KAAI;AAChE,IAAA,sBAAsB,EAAE;AACxB,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,UAAU,YACvBA,GAAA,CAAC,aAAa,EAAA,EAAA,QAAA,EACZA,GAAA,CAAC,MAAM,EAAA,EAAA,QAAA,EAAE,QAAQ,GAAU,EAAA,CACb,EAAA,CACZ;AAEV;;;;"}
@@ -9,5 +9,9 @@ export interface ChainAccount {
9
9
  * disconnected account when the family's adapter isn't registered. Chain-agnostic: safe to call from core code.
10
10
  */
11
11
  export default function useChainAccount(ecosystem: Ecosystem): ChainAccount;
12
- /** For adapter `AccountBridge`s: keeps the family's account in the query cache in sync with its wallet library. */
12
+ /**
13
+ * For adapter `AccountBridge`s: keeps the family's account in the query cache in sync with its wallet library. When
14
+ * the family's last bridge unmounts, the account is reset to disconnected: nothing would keep it in sync anymore, so
15
+ * keeping the last address would show stale (or another wallet's) data after a disconnect or wallet switch.
16
+ */
13
17
  export declare const usePublishChainAccount: (ecosystem: Ecosystem, { address, connected, chainId }: ChainAccount) => void;
@@ -18,12 +18,30 @@ function useChainAccount(ecosystem) {
18
18
  });
19
19
  return data;
20
20
  }
21
- /** For adapter `AccountBridge`s: keeps the family's account in the query cache in sync with its wallet library. */
21
+ // Mounted AccountBridges per family. <ApeBondSDK /> normally mounts one per family, but more can be mounted at once
22
+ // (e.g. two <ApeBondSDK /> while one unmounts); they read the same wallet, so they publish the same account.
23
+ const mountedBridges = new WeakMap();
24
+ /**
25
+ * For adapter `AccountBridge`s: keeps the family's account in the query cache in sync with its wallet library. When
26
+ * the family's last bridge unmounts, the account is reset to disconnected: nothing would keep it in sync anymore, so
27
+ * keeping the last address would show stale (or another wallet's) data after a disconnect or wallet switch.
28
+ */
22
29
  const usePublishChainAccount = (ecosystem, { address, connected, chainId }) => {
23
30
  const queryClient = useQueryClient();
24
31
  useEffect(() => {
25
32
  queryClient.setQueryData(chainAccountQueryKey(ecosystem), { address, connected, chainId });
26
33
  }, [queryClient, ecosystem, address, connected, chainId]);
34
+ useEffect(() => {
35
+ const counts = mountedBridges.get(queryClient) ?? new Map();
36
+ mountedBridges.set(queryClient, counts);
37
+ counts.set(ecosystem, (counts.get(ecosystem) ?? 0) + 1);
38
+ return () => {
39
+ const left = (counts.get(ecosystem) ?? 1) - 1;
40
+ counts.set(ecosystem, left);
41
+ if (left === 0)
42
+ queryClient.setQueryData(chainAccountQueryKey(ecosystem), DISCONNECTED);
43
+ };
44
+ }, [queryClient, ecosystem]);
27
45
  };
28
46
 
29
47
  export { useChainAccount as default, usePublishChainAccount };
@@ -1 +1 @@
1
- {"version":3,"file":"useChainAccount.js","sources":["../../../src/state/chainAccount/useChainAccount.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { QUERY_KEYS } from '../../config/constants/queryKeys'\nimport type { Ecosystem } from '../../adapters/types'\n\nexport interface ChainAccount {\n address: string | null\n connected: boolean\n chainId?: number\n}\n\nconst DISCONNECTED: ChainAccount = { address: null, connected: false }\n\nconst chainAccountQueryKey = (ecosystem: Ecosystem) => [QUERY_KEYS.CHAIN_ACCOUNT, ecosystem]\n\n/**\n * The connected account of a chain family, as published by that family's adapter `AccountBridge`. Returns a\n * disconnected account when the family's adapter isn't registered. Chain-agnostic: safe to call from core code.\n */\nexport default function useChainAccount(ecosystem: Ecosystem): ChainAccount {\n const { data } = useQuery({\n queryKey: chainAccountQueryKey(ecosystem),\n // Written by usePublishChainAccount; the query is only used as a store.\n queryFn: ({ client }) => client.getQueryData<ChainAccount>(chainAccountQueryKey(ecosystem)) ?? DISCONNECTED,\n initialData: DISCONNECTED,\n staleTime: Infinity,\n })\n return data\n}\n\n/** For adapter `AccountBridge`s: keeps the family's account in the query cache in sync with its wallet library. */\nexport const usePublishChainAccount = (ecosystem: Ecosystem, { address, connected, chainId }: ChainAccount) => {\n const queryClient = useQueryClient()\n\n useEffect(() => {\n queryClient.setQueryData<ChainAccount>(chainAccountQueryKey(ecosystem), { address, connected, chainId })\n }, [queryClient, ecosystem, address, connected, chainId])\n}\n"],"names":[],"mappings":";;;;AAWA,MAAM,YAAY,GAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;AAEtE,MAAM,oBAAoB,GAAG,CAAC,SAAoB,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC;AAE5F;;;AAGG;AACW,SAAU,eAAe,CAAC,SAAoB,EAAA;AAC1D,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;AACxB,QAAA,QAAQ,EAAE,oBAAoB,CAAC,SAAS,CAAC;;AAEzC,QAAA,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,YAAY,CAAe,oBAAoB,CAAC,SAAS,CAAC,CAAC,IAAI,YAAY;AAC3G,QAAA,WAAW,EAAE,YAAY;AACzB,QAAA,SAAS,EAAE,QAAQ;AACpB,KAAA,CAAC;AACF,IAAA,OAAO,IAAI;AACb;AAEA;AACO,MAAM,sBAAsB,GAAG,CAAC,SAAoB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAgB,KAAI;AAC5G,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;IAEpC,SAAS,CAAC,MAAK;AACb,QAAA,WAAW,CAAC,YAAY,CAAe,oBAAoB,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC1G,IAAA,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAC3D;;;;"}
1
+ {"version":3,"file":"useChainAccount.js","sources":["../../../src/state/chainAccount/useChainAccount.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { QueryClient, useQuery, useQueryClient } from '@tanstack/react-query'\nimport { QUERY_KEYS } from '../../config/constants/queryKeys'\nimport type { Ecosystem } from '../../adapters/types'\n\nexport interface ChainAccount {\n address: string | null\n connected: boolean\n chainId?: number\n}\n\nconst DISCONNECTED: ChainAccount = { address: null, connected: false }\n\nconst chainAccountQueryKey = (ecosystem: Ecosystem) => [QUERY_KEYS.CHAIN_ACCOUNT, ecosystem]\n\n/**\n * The connected account of a chain family, as published by that family's adapter `AccountBridge`. Returns a\n * disconnected account when the family's adapter isn't registered. Chain-agnostic: safe to call from core code.\n */\nexport default function useChainAccount(ecosystem: Ecosystem): ChainAccount {\n const { data } = useQuery({\n queryKey: chainAccountQueryKey(ecosystem),\n // Written by usePublishChainAccount; the query is only used as a store.\n queryFn: ({ client }) => client.getQueryData<ChainAccount>(chainAccountQueryKey(ecosystem)) ?? DISCONNECTED,\n initialData: DISCONNECTED,\n staleTime: Infinity,\n })\n return data\n}\n\n// Mounted AccountBridges per family. <ApeBondSDK /> normally mounts one per family, but more can be mounted at once\n// (e.g. two <ApeBondSDK /> while one unmounts); they read the same wallet, so they publish the same account.\nconst mountedBridges = new WeakMap<QueryClient, Map<Ecosystem, number>>()\n\n/**\n * For adapter `AccountBridge`s: keeps the family's account in the query cache in sync with its wallet library. When\n * the family's last bridge unmounts, the account is reset to disconnected: nothing would keep it in sync anymore, so\n * keeping the last address would show stale (or another wallet's) data after a disconnect or wallet switch.\n */\nexport const usePublishChainAccount = (ecosystem: Ecosystem, { address, connected, chainId }: ChainAccount) => {\n const queryClient = useQueryClient()\n\n useEffect(() => {\n queryClient.setQueryData<ChainAccount>(chainAccountQueryKey(ecosystem), { address, connected, chainId })\n }, [queryClient, ecosystem, address, connected, chainId])\n\n useEffect(() => {\n const counts = mountedBridges.get(queryClient) ?? new Map<Ecosystem, number>()\n mountedBridges.set(queryClient, counts)\n counts.set(ecosystem, (counts.get(ecosystem) ?? 0) + 1)\n return () => {\n const left = (counts.get(ecosystem) ?? 1) - 1\n counts.set(ecosystem, left)\n if (left === 0) queryClient.setQueryData<ChainAccount>(chainAccountQueryKey(ecosystem), DISCONNECTED)\n }\n }, [queryClient, ecosystem])\n}\n"],"names":[],"mappings":";;;;AAWA,MAAM,YAAY,GAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE;AAEtE,MAAM,oBAAoB,GAAG,CAAC,SAAoB,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC;AAE5F;;;AAGG;AACW,SAAU,eAAe,CAAC,SAAoB,EAAA;AAC1D,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;AACxB,QAAA,QAAQ,EAAE,oBAAoB,CAAC,SAAS,CAAC;;AAEzC,QAAA,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,YAAY,CAAe,oBAAoB,CAAC,SAAS,CAAC,CAAC,IAAI,YAAY;AAC3G,QAAA,WAAW,EAAE,YAAY;AACzB,QAAA,SAAS,EAAE,QAAQ;AACpB,KAAA,CAAC;AACF,IAAA,OAAO,IAAI;AACb;AAEA;AACA;AACA,MAAM,cAAc,GAAG,IAAI,OAAO,EAAuC;AAEzE;;;;AAIG;AACI,MAAM,sBAAsB,GAAG,CAAC,SAAoB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAgB,KAAI;AAC5G,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;IAEpC,SAAS,CAAC,MAAK;AACb,QAAA,WAAW,CAAC,YAAY,CAAe,oBAAoB,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;AAC1G,IAAA,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAEzD,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,GAAG,EAAqB;AAC9E,QAAA,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC;AACvC,QAAA,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvD,QAAA,OAAO,MAAK;AACV,YAAA,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7C,YAAA,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC;YAC3B,IAAI,IAAI,KAAK,CAAC;gBAAE,WAAW,CAAC,YAAY,CAAe,oBAAoB,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;AACvG,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAC9B;;;;"}
@@ -57,6 +57,17 @@ export interface SDKProps {
57
57
  customBranch?: string;
58
58
  highlightedBond?: string;
59
59
  }
60
- export declare const useSDKConfig: (config?: SDKPropsDTO) => SDKProps;
60
+ /**
61
+ * Reads the SDK config set by <ApeBondSDK />. Reading never stores anything, so <ApeBondSDK /> wins whenever it
62
+ * renders, even after the components that read the config.
63
+ */
64
+ export declare const useSDKConfig: () => SDKProps;
65
+ /**
66
+ * Sets the SDK config. Only <ApeBondSDK /> calls it. The config is stored the first time (later prop changes don't
67
+ * rewrite it); the registries (custom RPCs, adapters, wallet openers) follow the props.
68
+ */
69
+ export declare const useConfigureSDK: (config: SDKPropsDTO) => void;
70
+ /** For the views: logs once if they render without <ApeBondSDK /> (they'd show no bonds). */
71
+ export declare const useWarnIfNotConfigured: () => void;
61
72
  export type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl';
62
73
  export declare const useURLByEnvironment: (key: URLKeys) => string;
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- import { useQuery } from '@tanstack/react-query';
2
+ import { useQuery, useQueryClient } from '@tanstack/react-query';
3
3
  import { QUERY_KEYS } from '../config/constants/queryKeys.js';
4
4
  import { ChainId } from '@ape.swap/apeswap-lists';
5
5
  import { setCustomRPCS } from '../config/constants/networks.js';
@@ -38,8 +38,8 @@ const logOnce = (message) => {
38
38
  const getSupportedChains = (chains) => {
39
39
  if (getRegisteredAdapters().length === 0) {
40
40
  logOnce('[ApeBond SDK] No chain adapters registered, so no chains are shown. Since v7, pass the adapters of the chain ' +
41
- 'families you use, e.g. adapters={[evmAdapter]} from "@ape.swap/bonds-sdk/adapters/evm". See the README ' +
42
- '("Upgrading from v6").');
41
+ 'families you use to <ApeBondSDK />, e.g. adapters={[evmAdapter]} from "@ape.swap/bonds-sdk/adapters/evm". ' +
42
+ 'See the README ("Upgrading from v6").');
43
43
  return [];
44
44
  }
45
45
  const missing = new Map();
@@ -53,76 +53,96 @@ const getSupportedChains = (chains) => {
53
53
  missing.forEach((chainIds, hint) => logOnce(`[ApeBond SDK] Chains ${chainIds.join(', ')} are configured but not supported without ${hint}; they're hidden.`));
54
54
  return supported;
55
55
  };
56
- const useSDKConfig = (config) => {
57
- const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
56
+ const urlsByEnvironment = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
57
+ const configQueryKey = [QUERY_KEYS.SDK_CONFIG];
58
+ // The config query is only a store: <ApeBondSDK /> fills it through `initialData`, and it is never fetched.
59
+ const noFetch = () => {
60
+ throw new Error('[ApeBond SDK] The SDK config is set by <ApeBondSDK />, never fetched');
61
+ };
62
+ // What readers get before <ApeBondSDK /> has configured the SDK. Not stored, so it can't shadow the real config.
63
+ const UNCONFIGURED = {
64
+ referenceId: '',
65
+ chains: [],
66
+ hotBondChains: [ChainId.BSC, ChainId.MATIC],
67
+ openWalletConnectors: { evm: false, sol: false, sui: false, aptos: false },
68
+ useHotBonds: true,
69
+ useTiers: false,
70
+ useTGEBonds: false,
71
+ showLowValueBonds: false,
72
+ namingPreference: 'Bonus',
73
+ useCardsView: false,
74
+ blockSales: false,
75
+ customBranch: '',
76
+ urls: urlsByEnvironment,
77
+ highestCompatibleVersion: '2.2.0',
78
+ };
79
+ /**
80
+ * Reads the SDK config set by <ApeBondSDK />. Reading never stores anything, so <ApeBondSDK /> wins whenever it
81
+ * renders, even after the components that read the config.
82
+ */
83
+ const useSDKConfig = () => {
84
+ const { data } = useQuery({ queryKey: configQueryKey, queryFn: noFetch, enabled: false, staleTime: Infinity });
85
+ return data ?? UNCONFIGURED;
86
+ };
87
+ /**
88
+ * Sets the SDK config. Only <ApeBondSDK /> calls it. The config is stored the first time (later prop changes don't
89
+ * rewrite it); the registries (custom RPCs, adapters, wallet openers) follow the props.
90
+ */
91
+ const useConfigureSDK = (config) => {
58
92
  // Adapters hold components and functions, so they live in the adapter registry, not in the cached config.
59
- const { adapters, ...configProps } = (config ?? {});
60
- const hasConfig = config !== undefined;
61
- const customRPCS = config?.customRPCS;
93
+ const { adapters, ...configProps } = config;
62
94
  // Registries read by query functions are filled synchronously during render, not in an effect, so the first
63
- // render and the first queries already see them. Both calls are idempotent. Calls without config only read
64
- // shared settings and must not overwrite the registries.
65
- if (hasConfig) {
66
- setCustomRPCS(customRPCS ?? {});
67
- if (adapters)
68
- registerAdapters(adapters);
69
- }
95
+ // render and the first queries already see them. Both calls are idempotent.
96
+ if (config.customRPCS)
97
+ setCustomRPCS(config.customRPCS);
98
+ if (adapters)
99
+ registerAdapters(adapters);
70
100
  const initialData = {
71
- referenceId: '',
72
- hotBondChains: [ChainId.BSC, ChainId.MATIC],
73
- useHotBonds: true,
74
- useTGEBonds: false,
75
- showLowValueBonds: false,
101
+ ...UNCONFIGURED,
76
102
  bondPartner: undefined,
77
- namingPreference: 'Bonus',
78
- useCardsView: false,
79
- blockSales: false,
80
- customBranch: '',
81
103
  ...configProps,
82
104
  // Chains without a registered adapter are unsupported: drop them (with a console error) instead of rendering
83
105
  // empty sections.
84
- chains: hasConfig ? getSupportedChains(config.chains ?? []) : [],
106
+ chains: getSupportedChains(config.chains ?? []),
85
107
  openWalletConnectors: {
86
- evm: !!config?.openWalletConnectors?.evm,
87
- sol: !!config?.openWalletConnectors?.sol,
88
- sui: !!config?.openWalletConnectors?.sui,
89
- aptos: !!config?.openWalletConnectors?.aptos,
108
+ evm: !!config.openWalletConnectors?.evm,
109
+ sol: !!config.openWalletConnectors?.sol,
110
+ sui: !!config.openWalletConnectors?.sui,
111
+ aptos: !!config.openWalletConnectors?.aptos,
90
112
  },
91
- useTiers: config?.namingPreference === 'Discount' ? false : (config?.useTiers ?? false), // for the time being we'll assume discount preference does not want to useTiers
92
- urls: { ...urls, ...config?.urls },
113
+ useTiers: config.namingPreference === 'Discount' ? false : (config.useTiers ?? false), // for the time being we'll assume discount preference does not want to useTiers
114
+ urls: { ...urlsByEnvironment, ...config.urls },
93
115
  highestCompatibleVersion: '2.2.0',
94
116
  };
95
- const evmConnectorOpener = config?.openWalletConnectors?.evm;
96
- const solConnectorOpener = config?.openWalletConnectors?.sol;
97
- const suiConnectorOpener = config?.openWalletConnectors?.sui;
98
- const aptosConnectorOpener = config?.openWalletConnectors?.aptos;
117
+ const { evm, sol, sui, aptos } = config.openWalletConnectors ?? {};
99
118
  useEffect(() => {
100
- // Calls without config only read shared settings and must not overwrite their registries.
101
- if (!hasConfig) {
102
- return;
119
+ if (evm)
120
+ setWalletConnectorOpener('evm', evm);
121
+ if (sol)
122
+ setWalletConnectorOpener('sol', sol);
123
+ if (sui)
124
+ setWalletConnectorOpener('sui', sui);
125
+ if (aptos)
126
+ setWalletConnectorOpener('aptos', aptos);
127
+ }, [evm, sol, sui, aptos]);
128
+ // Also fills the query when a reader created it first (without data).
129
+ useQuery({ queryKey: configQueryKey, queryFn: noFetch, enabled: false, staleTime: Infinity, initialData });
130
+ };
131
+ /** For the views: logs once if they render without <ApeBondSDK /> (they'd show no bonds). */
132
+ const useWarnIfNotConfigured = () => {
133
+ const queryClient = useQueryClient();
134
+ useEffect(() => {
135
+ // In an effect: <ApeBondSDK /> may render after the view in the same commit.
136
+ if (queryClient.getQueryData(configQueryKey) === undefined) {
137
+ logOnce('[ApeBond SDK] The SDK views need <ApeBondSDK /> (@ape.swap/bonds-sdk/components/ApeBondSDK) mounted with your ' +
138
+ 'config (referenceId, chains, adapters…); without it components and hooks will not work properly');
103
139
  }
104
- if (evmConnectorOpener)
105
- setWalletConnectorOpener('evm', evmConnectorOpener);
106
- if (solConnectorOpener)
107
- setWalletConnectorOpener('sol', solConnectorOpener);
108
- if (suiConnectorOpener)
109
- setWalletConnectorOpener('sui', suiConnectorOpener);
110
- if (aptosConnectorOpener)
111
- setWalletConnectorOpener('aptos', aptosConnectorOpener);
112
- }, [hasConfig, evmConnectorOpener, solConnectorOpener, suiConnectorOpener, aptosConnectorOpener]);
113
- const { data } = useQuery({
114
- queryKey: [QUERY_KEYS.SDK_CONFIG],
115
- queryFn: () => {
116
- throw new Error('Just a hotfix for latest versions of react-query that make queryFn a required prop');
117
- },
118
- initialData,
119
- });
120
- return data;
140
+ }, [queryClient]);
121
141
  };
122
142
  const useURLByEnvironment = (key) => {
123
143
  const config = useSDKConfig();
124
144
  return config?.urls?.[key];
125
145
  };
126
146
 
127
- export { useSDKConfig, useURLByEnvironment };
147
+ export { useConfigureSDK, useSDKConfig, useURLByEnvironment, useWarnIfNotConfigured };
128
148
  //# sourceMappingURL=useSDKConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSDKConfig.js","sources":["../../src/state/useSDKConfig.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { useQuery } from '@tanstack/react-query'\nimport { QUERY_KEYS } from '../config/constants/queryKeys'\nimport { ChainId } from '@ape.swap/apeswap-lists'\nimport { setCustomRPCS } from '../config/constants/networks'\nimport { setWalletConnectorOpener } from '../config/constants/walletConnectors'\nimport { getAdapterForChain, getRegisteredAdapters, registerAdapters } from '../adapters/registry'\nimport type { SDKAdapter } from '../adapters/types'\n\n// Prod URLS. Do not make changes here\nconst defaultUrls = {\n apiV2: 'https://api.ape.bond',\n realTimeApi: 'https://realtime-api.ape.bond',\n mainUrl: 'https://ape.bond',\n}\n\n// Staging URLS.\nconst stagingUrls = {\n apiV2: 'https://staging-api.ape.bond',\n realTimeApi: 'https://realtime-api-staging.ape.bond',\n mainUrl: 'https://staging.ape.bond',\n}\n\nexport interface OpenWalletConnectorsDTO {\n evm?: () => void\n sol?: () => void\n sui?: () => void\n aptos?: () => void\n}\n\nexport interface SDKPropsDTO {\n referenceId: string\n chains: number[]\n hotBondChains?: number[]\n useHotBonds?: boolean\n useTiers?: boolean\n useTGEBonds?: boolean\n useCardsView?: boolean\n showLowValueBonds?: boolean\n bondPartner?: string\n namingPreference?: 'Discount' | 'Bonus'\n urls?: Partial<Record<URLKeys, string>>\n highestCompatibleVersion?: string\n blockSales?: boolean\n customBranch?: string\n highlightedBond?: string\n customRPCS?: Partial<Record<ChainId, string[]>>\n openWalletConnectors?: OpenWalletConnectorsDTO\n aptosAddress?: string\n suiAddress?: string\n suiTreasuryAddresses?: string[]\n /** Chain-family adapters (and optionally a bridge adapter) to enable. Required since v7; see the README. */\n adapters?: SDKAdapter[]\n}\n\nexport interface SDKProps {\n referenceId: string\n chains: number[]\n hotBondChains: number[]\n openWalletConnectors?: {\n evm?: boolean\n sol?: boolean\n sui?: boolean\n aptos?: boolean\n }\n useHotBonds: boolean\n useTiers: boolean\n useTGEBonds: boolean\n showLowValueBonds: boolean\n bondPartner?: string\n namingPreference: 'Discount' | 'Bonus'\n urls: Record<URLKeys, string>\n highestCompatibleVersion?: string\n evmAddress?: string\n solAddress?: string\n aptosAddress?: string\n suiAddress?: string\n useCardsView?: boolean\n blockSales?: boolean\n customBranch?: string\n highlightedBond?: string\n}\n\n// Adapter each chain family needs, for the \"unsupported chain\" error message.\nconst adapterHint = (chainId: number) =>\n chainId === ChainId.SOL\n ? 'solanaAdapter (@ape.swap/bonds-sdk/adapters/solana)'\n : chainId === ChainId.APTOS\n ? 'aptosAdapter (@ape.swap/bonds-sdk/adapters/aptos)'\n : chainId === ChainId.SUI\n ? 'suiAdapter (@ape.swap/bonds-sdk/adapters/sui)'\n : 'evmAdapter (@ape.swap/bonds-sdk/adapters/evm)'\n\n// Each message is logged once per page load, not on every render.\nconst loggedErrors = new Set<string>()\nconst logOnce = (message: string) => {\n if (loggedErrors.has(message)) return\n loggedErrors.add(message)\n console.error(message)\n}\n\n/** Keeps the configured chains that have a registered adapter; the others are unsupported, and logged once. */\nconst getSupportedChains = (chains: number[]): number[] => {\n if (getRegisteredAdapters().length === 0) {\n logOnce(\n '[ApeBond SDK] No chain adapters registered, so no chains are shown. Since v7, pass the adapters of the chain ' +\n 'families you use, e.g. adapters={[evmAdapter]} from \"@ape.swap/bonds-sdk/adapters/evm\". See the README ' +\n '(\"Upgrading from v6\").',\n )\n return []\n }\n const missing = new Map<string, number[]>()\n const supported = chains.filter((chainId) => {\n if (getAdapterForChain(chainId)) return true\n const hint = adapterHint(chainId)\n missing.set(hint, [...(missing.get(hint) ?? []), chainId])\n return false\n })\n missing.forEach((chainIds, hint) =>\n logOnce(`[ApeBond SDK] Chains ${chainIds.join(', ')} are configured but not supported without ${hint}; they're hidden.`),\n )\n return supported\n}\n\nexport const useSDKConfig = (config?: SDKPropsDTO): SDKProps => {\n const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls\n // Adapters hold components and functions, so they live in the adapter registry, not in the cached config.\n const { adapters, ...configProps } = (config ?? {}) as Partial<SDKPropsDTO>\n\n const hasConfig = config !== undefined\n const customRPCS = config?.customRPCS\n\n // Registries read by query functions are filled synchronously during render, not in an effect, so the first\n // render and the first queries already see them. Both calls are idempotent. Calls without config only read\n // shared settings and must not overwrite the registries.\n if (hasConfig) {\n setCustomRPCS(customRPCS ?? {})\n if (adapters) registerAdapters(adapters)\n }\n\n const initialData: SDKProps = {\n referenceId: '',\n hotBondChains: [ChainId.BSC, ChainId.MATIC],\n useHotBonds: true,\n useTGEBonds: false,\n showLowValueBonds: false,\n bondPartner: undefined,\n namingPreference: 'Bonus',\n useCardsView: false,\n blockSales: false,\n customBranch: '',\n ...configProps,\n // Chains without a registered adapter are unsupported: drop them (with a console error) instead of rendering\n // empty sections.\n chains: hasConfig ? getSupportedChains(config.chains ?? []) : [],\n openWalletConnectors: {\n evm: !!config?.openWalletConnectors?.evm,\n sol: !!config?.openWalletConnectors?.sol,\n sui: !!config?.openWalletConnectors?.sui,\n aptos: !!config?.openWalletConnectors?.aptos,\n },\n useTiers: config?.namingPreference === 'Discount' ? false : (config?.useTiers ?? false), // for the time being we'll assume discount preference does not want to useTiers\n urls: { ...urls, ...config?.urls },\n highestCompatibleVersion: '2.2.0',\n }\n\n\n const evmConnectorOpener = config?.openWalletConnectors?.evm\n const solConnectorOpener = config?.openWalletConnectors?.sol\n const suiConnectorOpener = config?.openWalletConnectors?.sui\n const aptosConnectorOpener = config?.openWalletConnectors?.aptos\n\n useEffect(() => {\n // Calls without config only read shared settings and must not overwrite their registries.\n if (!hasConfig) {\n return\n }\n if (evmConnectorOpener) setWalletConnectorOpener('evm', evmConnectorOpener)\n if (solConnectorOpener) setWalletConnectorOpener('sol', solConnectorOpener)\n if (suiConnectorOpener) setWalletConnectorOpener('sui', suiConnectorOpener)\n if (aptosConnectorOpener) setWalletConnectorOpener('aptos', aptosConnectorOpener)\n }, [hasConfig, evmConnectorOpener, solConnectorOpener, suiConnectorOpener, aptosConnectorOpener])\n\n const { data } = useQuery({\n queryKey: [QUERY_KEYS.SDK_CONFIG],\n queryFn: () => {\n throw new Error('Just a hotfix for latest versions of react-query that make queryFn a required prop')\n },\n initialData,\n })\n return data as SDKProps\n}\n\nexport type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl'\n\nexport const useURLByEnvironment = (key: URLKeys) => {\n const config = useSDKConfig()\n return config?.urls?.[key] as string\n}\n"],"names":[],"mappings":";;;;;;;;AASA;AACA,MAAM,WAAW,GAAG;AAClB,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,WAAW,EAAE,+BAA+B;AAC5C,IAAA,OAAO,EAAE,kBAAkB;CAC5B;AAED;AACA,MAAM,WAAW,GAAG;AAClB,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,WAAW,EAAE,uCAAuC;AACpD,IAAA,OAAO,EAAE,0BAA0B;CACpC;AA8DD;AACA,MAAM,WAAW,GAAG,CAAC,OAAe,KAClC,OAAO,KAAK,OAAO,CAAC;AAClB,MAAE;AACF,MAAE,OAAO,KAAK,OAAO,CAAC;AACpB,UAAE;AACF,UAAE,OAAO,KAAK,OAAO,CAAC;AACpB,cAAE;cACA,+CAA+C;AAEzD;AACA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU;AACtC,MAAM,OAAO,GAAG,CAAC,OAAe,KAAI;AAClC,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE;AAC/B,IAAA,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;AACxB,CAAC;AAED;AACA,MAAM,kBAAkB,GAAG,CAAC,MAAgB,KAAc;AACxD,IAAA,IAAI,qBAAqB,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;AACxC,QAAA,OAAO,CACL,+GAA+G;YAC7G,yGAAyG;AACzG,YAAA,wBAAwB,CAC3B;AACD,QAAA,OAAO,EAAE;IACX;AACA,IA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AAkB;AAAE,YAAA,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,CAAC;AAC3E,QAAA,IAAI,kBAAkB;AAAE,YAAA,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,CAAC;AAC3E,QAAA,IAAI,kBAAkB;AAAE,YAAA,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,CAAC;AAC3E,QAAA,IAAI,oBAAoB;AAAE,YAAA,wBAAwB,CAAC,OAAO,EAAE,oBAAoB,CAAC;AACnF,IAAA,CAAC,EAAE,CAAC,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AAEjG,IAAA,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;AACxB,QAAA,QAAQ,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QACjC,OAAO,EAAE,MAAK;AACZ,YAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC;QACvG,CAAC;QACD,WAAW;AACZ,KAAA,CAAC;AACF,IAAA,OAAO,IAAgB;AACzB;AAIO,MAAM,mBAAmB,GAAG,CAAC,GAAY,KAAI;AAClD,IAAA,MAAM,MAAM,GAAG,YAAY,EAAE;AAC7B,IAAA,OAAO,MAAM,EAAE,IAAI,GAAG,GAAG,CAAW;AACtC;;;;"}
1
+ {"version":3,"file":"useSDKConfig.js","sources":["../../src/state/useSDKConfig.ts"],"sourcesContent":["import { useEffect } from 'react'\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\nimport { QUERY_KEYS } from '../config/constants/queryKeys'\nimport { ChainId } from '@ape.swap/apeswap-lists'\nimport { setCustomRPCS } from '../config/constants/networks'\nimport { setWalletConnectorOpener } from '../config/constants/walletConnectors'\nimport { getAdapterForChain, getRegisteredAdapters, registerAdapters } from '../adapters/registry'\nimport type { SDKAdapter } from '../adapters/types'\n\n// Prod URLS. Do not make changes here\nconst defaultUrls = {\n apiV2: 'https://api.ape.bond',\n realTimeApi: 'https://realtime-api.ape.bond',\n mainUrl: 'https://ape.bond',\n}\n\n// Staging URLS.\nconst stagingUrls = {\n apiV2: 'https://staging-api.ape.bond',\n realTimeApi: 'https://realtime-api-staging.ape.bond',\n mainUrl: 'https://staging.ape.bond',\n}\n\nexport interface OpenWalletConnectorsDTO {\n evm?: () => void\n sol?: () => void\n sui?: () => void\n aptos?: () => void\n}\n\nexport interface SDKPropsDTO {\n referenceId: string\n chains: number[]\n hotBondChains?: number[]\n useHotBonds?: boolean\n useTiers?: boolean\n useTGEBonds?: boolean\n useCardsView?: boolean\n showLowValueBonds?: boolean\n bondPartner?: string\n namingPreference?: 'Discount' | 'Bonus'\n urls?: Partial<Record<URLKeys, string>>\n highestCompatibleVersion?: string\n blockSales?: boolean\n customBranch?: string\n highlightedBond?: string\n customRPCS?: Partial<Record<ChainId, string[]>>\n openWalletConnectors?: OpenWalletConnectorsDTO\n aptosAddress?: string\n suiAddress?: string\n suiTreasuryAddresses?: string[]\n /** Chain-family adapters (and optionally a bridge adapter) to enable. Required since v7; see the README. */\n adapters?: SDKAdapter[]\n}\n\nexport interface SDKProps {\n referenceId: string\n chains: number[]\n hotBondChains: number[]\n openWalletConnectors?: {\n evm?: boolean\n sol?: boolean\n sui?: boolean\n aptos?: boolean\n }\n useHotBonds: boolean\n useTiers: boolean\n useTGEBonds: boolean\n showLowValueBonds: boolean\n bondPartner?: string\n namingPreference: 'Discount' | 'Bonus'\n urls: Record<URLKeys, string>\n highestCompatibleVersion?: string\n evmAddress?: string\n solAddress?: string\n aptosAddress?: string\n suiAddress?: string\n useCardsView?: boolean\n blockSales?: boolean\n customBranch?: string\n highlightedBond?: string\n}\n\n// Adapter each chain family needs, for the \"unsupported chain\" error message.\nconst adapterHint = (chainId: number) =>\n chainId === ChainId.SOL\n ? 'solanaAdapter (@ape.swap/bonds-sdk/adapters/solana)'\n : chainId === ChainId.APTOS\n ? 'aptosAdapter (@ape.swap/bonds-sdk/adapters/aptos)'\n : chainId === ChainId.SUI\n ? 'suiAdapter (@ape.swap/bonds-sdk/adapters/sui)'\n : 'evmAdapter (@ape.swap/bonds-sdk/adapters/evm)'\n\n// Each message is logged once per page load, not on every render.\nconst loggedErrors = new Set<string>()\nconst logOnce = (message: string) => {\n if (loggedErrors.has(message)) return\n loggedErrors.add(message)\n console.error(message)\n}\n\n/** Keeps the configured chains that have a registered adapter; the others are unsupported, and logged once. */\nconst getSupportedChains = (chains: number[]): number[] => {\n if (getRegisteredAdapters().length === 0) {\n logOnce(\n '[ApeBond SDK] No chain adapters registered, so no chains are shown. Since v7, pass the adapters of the chain ' +\n 'families you use to <ApeBondSDK />, e.g. adapters={[evmAdapter]} from \"@ape.swap/bonds-sdk/adapters/evm\". ' +\n 'See the README (\"Upgrading from v6\").',\n )\n return []\n }\n const missing = new Map<string, number[]>()\n const supported = chains.filter((chainId) => {\n if (getAdapterForChain(chainId)) return true\n const hint = adapterHint(chainId)\n missing.set(hint, [...(missing.get(hint) ?? []), chainId])\n return false\n })\n missing.forEach((chainIds, hint) =>\n logOnce(\n `[ApeBond SDK] Chains ${chainIds.join(', ')} are configured but not supported without ${hint}; they're hidden.`,\n ),\n )\n return supported\n}\n\nconst urlsByEnvironment = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls\n\nconst configQueryKey = [QUERY_KEYS.SDK_CONFIG]\n\n// The config query is only a store: <ApeBondSDK /> fills it through `initialData`, and it is never fetched.\nconst noFetch = (): SDKProps => {\n throw new Error('[ApeBond SDK] The SDK config is set by <ApeBondSDK />, never fetched')\n}\n\n// What readers get before <ApeBondSDK /> has configured the SDK. Not stored, so it can't shadow the real config.\nconst UNCONFIGURED: SDKProps = {\n referenceId: '',\n chains: [],\n hotBondChains: [ChainId.BSC, ChainId.MATIC],\n openWalletConnectors: { evm: false, sol: false, sui: false, aptos: false },\n useHotBonds: true,\n useTiers: false,\n useTGEBonds: false,\n showLowValueBonds: false,\n namingPreference: 'Bonus',\n useCardsView: false,\n blockSales: false,\n customBranch: '',\n urls: urlsByEnvironment,\n highestCompatibleVersion: '2.2.0',\n}\n\n/**\n * Reads the SDK config set by <ApeBondSDK />. Reading never stores anything, so <ApeBondSDK /> wins whenever it\n * renders, even after the components that read the config.\n */\nexport const useSDKConfig = (): SDKProps => {\n const { data } = useQuery({ queryKey: configQueryKey, queryFn: noFetch, enabled: false, staleTime: Infinity })\n return data ?? UNCONFIGURED\n}\n\n/**\n * Sets the SDK config. Only <ApeBondSDK /> calls it. The config is stored the first time (later prop changes don't\n * rewrite it); the registries (custom RPCs, adapters, wallet openers) follow the props.\n */\nexport const useConfigureSDK = (config: SDKPropsDTO): void => {\n // Adapters hold components and functions, so they live in the adapter registry, not in the cached config.\n const { adapters, ...configProps } = config\n\n // Registries read by query functions are filled synchronously during render, not in an effect, so the first\n // render and the first queries already see them. Both calls are idempotent.\n if (config.customRPCS) setCustomRPCS(config.customRPCS)\n if (adapters) registerAdapters(adapters)\n\n const initialData: SDKProps = {\n ...UNCONFIGURED,\n bondPartner: undefined,\n ...configProps,\n // Chains without a registered adapter are unsupported: drop them (with a console error) instead of rendering\n // empty sections.\n chains: getSupportedChains(config.chains ?? []),\n openWalletConnectors: {\n evm: !!config.openWalletConnectors?.evm,\n sol: !!config.openWalletConnectors?.sol,\n sui: !!config.openWalletConnectors?.sui,\n aptos: !!config.openWalletConnectors?.aptos,\n },\n useTiers: config.namingPreference === 'Discount' ? false : (config.useTiers ?? false), // for the time being we'll assume discount preference does not want to useTiers\n urls: { ...urlsByEnvironment, ...config.urls },\n highestCompatibleVersion: '2.2.0',\n }\n\n const { evm, sol, sui, aptos } = config.openWalletConnectors ?? {}\n useEffect(() => {\n if (evm) setWalletConnectorOpener('evm', evm)\n if (sol) setWalletConnectorOpener('sol', sol)\n if (sui) setWalletConnectorOpener('sui', sui)\n if (aptos) setWalletConnectorOpener('aptos', aptos)\n }, [evm, sol, sui, aptos])\n\n // Also fills the query when a reader created it first (without data).\n useQuery({ queryKey: configQueryKey, queryFn: noFetch, enabled: false, staleTime: Infinity, initialData })\n}\n\n/** For the views: logs once if they render without <ApeBondSDK /> (they'd show no bonds). */\nexport const useWarnIfNotConfigured = () => {\n const queryClient = useQueryClient()\n useEffect(() => {\n // In an effect: <ApeBondSDK /> may render after the view in the same commit.\n if (queryClient.getQueryData(configQueryKey) === undefined) {\n logOnce(\n '[ApeBond SDK] The SDK views need <ApeBondSDK /> (@ape.swap/bonds-sdk/components/ApeBondSDK) mounted with your ' +\n 'config (referenceId, chains, adapters…); without it components and hooks will not work properly',\n )\n }\n }, [queryClient])\n}\n\nexport type URLKeys = 'apiV2' | 'realTimeApi' | 'mainUrl'\n\nexport const useURLByEnvironment = (key: URLKeys) => {\n const config = useSDKConfig()\n return config?.urls?.[key] as string\n}\n"],"names":[],"mappings":";;;;;;;;AASA;AACA,MAAM,WAAW,GAAG;AAClB,IAAA,KAAK,EAAE,sBAAsB;AAC7B,IAAA,WAAW,EAAE,+BAA+B;AAC5C,IAAA,OAAO,EAAE,kBAAkB;CAC5B;AAED;AACA,MAAM,WAAW,GAAG;AAClB,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,WAAW,EAAE,uCAAuC;AACpD,IAAA,OAAO,EAAE,0BAA0B;CACpC;AA8DD;AACA,MAAM,WAAW,GAAG,CAAC,OAAe,KAClC,OAAO,KAAK,OAAO,CAAC;AAClB,MAAE;AACF,MAAE,OAAO,KAAK,OAAO,CAAC;AACpB,UAAE;AACF,UAAE,OAAO,KAAK,OAAO,CAAC;AACpB,cAAE;cACA,+CAA+C;AAEzD;AACA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU;AACtC,MAAM,OAAO,GAAG,CAAC,OAAe,KAAI;AAClC,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE;AAC/B,IAAA,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC;AACzB,IAAA,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;AACxB,CAAC;AAED;AACA,MAAM,kBAAkB,GAAG,CAAC,MAAgB,KA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YAAA,OAAO,CACL,gHAAgH;AAC9G,gBAAA,iGAAiG,CACpG;QACH;AACF,IAAA,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AACnB;AAIO,MAAM,mBAAmB,GAAG,CAAC,GAAY,KAAI;AAClD,IAAA,MAAM,MAAM,GAAG,YAAY,EAAE;AAC7B,IAAA,OAAO,MAAM,EAAE,IAAI,GAAG,GAAG,CAAW;AACtC;;;;"}
@@ -1,4 +1,2 @@
1
- import React from 'react';
2
- import { SDKPropsDTO } from '../../state/useSDKConfig';
3
- declare const BondsWithProviders: React.FC<SDKPropsDTO>;
1
+ declare const BondsWithProviders: () => import("react/jsx-runtime").JSX.Element;
4
2
  export default BondsWithProviders;
@@ -1,12 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Providers from '../../providers/index.js';
3
3
  import Bonds from './Bonds.js';
4
- import { useSDKConfig } from '../../state/useSDKConfig.js';
5
4
 
6
- const BondsWithProviders = (props) => {
7
- useSDKConfig(props);
8
- return (jsx(Providers, { children: jsx(Bonds, {}) }));
9
- };
5
+ const BondsWithProviders = () => (jsx(Providers, { children: jsx(Bonds, {}) }));
10
6
 
11
7
  export { BondsWithProviders as default };
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/views/Bonds/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport Bonds from './Bonds'\nimport { SDKPropsDTO, useSDKConfig } from '../../state/useSDKConfig'\n\nconst BondsWithProviders: React.FC<SDKPropsDTO> = (props) => {\n useSDKConfig(props)\n return (\n <Providers>\n <Bonds />\n </Providers>\n )\n}\n\nexport default BondsWithProviders\n"],"names":["_jsx"],"mappings":";;;;;AAKA,MAAM,kBAAkB,GAA0B,CAAC,KAAK,KAAI;IAC1D,YAAY,CAAC,KAAK,CAAC;IACnB,QACEA,IAAC,SAAS,EAAA,EAAA,QAAA,EACRA,IAAC,KAAK,EAAA,EAAA,CAAG,EAAA,CACC;AAEhB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/views/Bonds/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport Bonds from './Bonds'\n\nconst BondsWithProviders = () => (\n <Providers>\n <Bonds />\n </Providers>\n)\n\nexport default BondsWithProviders\n"],"names":["_jsx"],"mappings":";;;;AAIA,MAAM,kBAAkB,GAAG,OACzBA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,GAAA,CAAC,KAAK,EAAA,EAAA,CAAG,EAAA,CACC;;;;"}
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { ChainBuyComponentProps } from '../../adapters/types';
3
- import { SDKPropsDTO } from '../../state/useSDKConfig';
4
- interface Props extends SDKPropsDTO, ChainBuyComponentProps {
5
- }
6
- declare const BuyBondModalWithProviders: React.FC<Props>;
3
+ declare const BuyBondModalWithProviders: React.FC<ChainBuyComponentProps>;
7
4
  export default BuyBondModalWithProviders;
@@ -1,12 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Providers from '../../providers/index.js';
3
- import { useSDKConfig } from '../../state/useSDKConfig.js';
4
3
  import BuyBondModal from './BuyBondModal.js';
5
4
 
6
- const BuyBondModalWithProviders = (props) => {
7
- useSDKConfig(props);
8
- return (jsx(Providers, { children: jsx(BuyBondModal, { ...props }) }));
9
- };
5
+ const BuyBondModalWithProviders = (props) => (jsx(Providers, { children: jsx(BuyBondModal, { ...props }) }));
10
6
 
11
7
  export { BuyBondModalWithProviders as default };
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/views/BuyBond/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport type { ChainBuyComponentProps } from '../../adapters/types'\nimport { SDKPropsDTO, useSDKConfig } from '../../state/useSDKConfig'\nimport BuyBondModal from './BuyBondModal'\n\ninterface Props extends SDKPropsDTO, ChainBuyComponentProps {}\n\nconst BuyBondModalWithProviders: React.FC<Props> = (props) => {\n useSDKConfig(props)\n\n return (\n <Providers>\n <BuyBondModal {...props} />\n </Providers>\n )\n}\n\nexport default BuyBondModalWithProviders\n"],"names":["_jsx"],"mappings":";;;;;AAQA,MAAM,yBAAyB,GAAoB,CAAC,KAAK,KAAI;IAC3D,YAAY,CAAC,KAAK,CAAC;IAEnB,QACEA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,GAAA,CAAC,YAAY,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CACjB;AAEhB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/views/BuyBond/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport type { ChainBuyComponentProps } from '../../adapters/types'\nimport BuyBondModal from './BuyBondModal'\n\nconst BuyBondModalWithProviders: React.FC<ChainBuyComponentProps> = (props) => (\n <Providers>\n <BuyBondModal {...props} />\n </Providers>\n)\n\nexport default BuyBondModalWithProviders\n"],"names":["_jsx"],"mappings":";;;;AAKA,MAAM,yBAAyB,GAAqC,CAAC,KAAK,MACxEA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,IAAC,YAAY,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CACjB;;;;"}
@@ -1,4 +1,2 @@
1
- import React from 'react';
2
- import { SDKPropsDTO } from '../../state/useSDKConfig';
3
- declare const FullBondsViewWithProviders: React.FC<SDKPropsDTO>;
1
+ declare const FullBondsViewWithProviders: () => import("react/jsx-runtime").JSX.Element;
4
2
  export default FullBondsViewWithProviders;
@@ -1,12 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Providers from '../../providers/index.js';
3
3
  import FullBondsView from './FullBondsView.js';
4
- import { useSDKConfig } from '../../state/useSDKConfig.js';
5
4
 
6
- const FullBondsViewWithProviders = (props) => {
7
- useSDKConfig(props);
8
- return (jsx(Providers, { children: jsx(FullBondsView, {}) }));
9
- };
5
+ const FullBondsViewWithProviders = () => (jsx(Providers, { children: jsx(FullBondsView, {}) }));
10
6
 
11
7
  export { FullBondsViewWithProviders as default };
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/views/FullBondsView/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport FullBondsView from './FullBondsView'\nimport { SDKPropsDTO, useSDKConfig } from '../../state/useSDKConfig'\n\nconst FullBondsViewWithProviders: React.FC<SDKPropsDTO> = (props) => {\n useSDKConfig(props)\n return (\n <Providers>\n <FullBondsView />\n </Providers>\n )\n}\n\nexport default FullBondsViewWithProviders\n"],"names":["_jsx"],"mappings":";;;;;AAKA,MAAM,0BAA0B,GAA0B,CAAC,KAAK,KAAI;IAClE,YAAY,CAAC,KAAK,CAAC;IACnB,QACEA,IAAC,SAAS,EAAA,EAAA,QAAA,EACRA,IAAC,aAAa,EAAA,EAAA,CAAG,EAAA,CACP;AAEhB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/views/FullBondsView/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport FullBondsView from './FullBondsView'\n\nconst FullBondsViewWithProviders = () => (\n <Providers>\n <FullBondsView />\n </Providers>\n)\n\nexport default FullBondsViewWithProviders\n"],"names":["_jsx"],"mappings":";;;;AAIA,MAAM,0BAA0B,GAAG,OACjCA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,GAAA,CAAC,aAAa,EAAA,EAAA,CAAG,EAAA,CACP;;;;"}
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
- import { SDKPropsDTO } from '../../state/useSDKConfig';
3
2
  import { ProjectViewProps } from './ProjectView';
4
- interface Props extends SDKPropsDTO, ProjectViewProps {
5
- }
6
- declare const ProjectViewWithProviders: React.FC<Props>;
3
+ declare const ProjectViewWithProviders: React.FC<ProjectViewProps>;
7
4
  export default ProjectViewWithProviders;
@@ -1,12 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Providers from '../../providers/index.js';
3
- import { useSDKConfig } from '../../state/useSDKConfig.js';
4
3
  import ProjectView from './ProjectView.js';
5
4
 
6
- const ProjectViewWithProviders = (props) => {
7
- useSDKConfig(props);
8
- return (jsx(Providers, { children: jsx(ProjectView, { ...props }) }));
9
- };
5
+ const ProjectViewWithProviders = (props) => (jsx(Providers, { children: jsx(ProjectView, { ...props }) }));
10
6
 
11
7
  export { ProjectViewWithProviders as default };
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/views/ProjectView/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport { SDKPropsDTO, useSDKConfig } from '../../state/useSDKConfig'\nimport ProjectView, { ProjectViewProps } from './ProjectView'\n\ninterface Props extends SDKPropsDTO, ProjectViewProps {}\n\nconst ProjectViewWithProviders: React.FC<Props> = (props) => {\n useSDKConfig(props)\n return (\n <Providers>\n <ProjectView {...props} />\n </Providers>\n )\n}\n\nexport default ProjectViewWithProviders\n"],"names":["_jsx"],"mappings":";;;;;AAOA,MAAM,wBAAwB,GAAoB,CAAC,KAAK,KAAI;IAC1D,YAAY,CAAC,KAAK,CAAC;IACnB,QACEA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,GAAA,CAAC,WAAW,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CAChB;AAEhB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/views/ProjectView/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport ProjectView, { ProjectViewProps } from './ProjectView'\n\nconst ProjectViewWithProviders: React.FC<ProjectViewProps> = (props) => (\n <Providers>\n <ProjectView {...props} />\n </Providers>\n)\n\nexport default ProjectViewWithProviders\n"],"names":["_jsx"],"mappings":";;;;AAIA,MAAM,wBAAwB,GAA+B,CAAC,KAAK,MACjEA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,IAAC,WAAW,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CAChB;;;;"}
@@ -1,7 +1,4 @@
1
1
  import React from 'react';
2
- import { SDKPropsDTO } from '../../state/useSDKConfig';
3
2
  import { SingleBondProps } from './SingleBond';
4
- interface Props extends SDKPropsDTO, SingleBondProps {
5
- }
6
- declare const SingleBondWithProviders: React.FC<Props>;
3
+ declare const SingleBondWithProviders: React.FC<SingleBondProps>;
7
4
  export default SingleBondWithProviders;
@@ -1,12 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Providers from '../../providers/index.js';
3
- import { useSDKConfig } from '../../state/useSDKConfig.js';
4
3
  import SingleBond from './SingleBond.js';
5
4
 
6
- const SingleBondWithProviders = (props) => {
7
- useSDKConfig(props);
8
- return (jsx(Providers, { children: jsx(SingleBond, { ...props }) }));
9
- };
5
+ const SingleBondWithProviders = (props) => (jsx(Providers, { children: jsx(SingleBond, { ...props }) }));
10
6
 
11
7
  export { SingleBondWithProviders as default };
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/views/SingleBond/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport { SDKPropsDTO, useSDKConfig } from '../../state/useSDKConfig'\nimport SingleBond, { SingleBondProps } from './SingleBond'\n\ninterface Props extends SDKPropsDTO, SingleBondProps {}\n\nconst SingleBondWithProviders: React.FC<Props> = (props) => {\n useSDKConfig(props)\n return (\n <Providers>\n <SingleBond {...props} />\n </Providers>\n )\n}\n\nexport default SingleBondWithProviders\n"],"names":["_jsx"],"mappings":";;;;;AAOA,MAAM,uBAAuB,GAAoB,CAAC,KAAK,KAAI;IACzD,YAAY,CAAC,KAAK,CAAC;IACnB,QACEA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,GAAA,CAAC,UAAU,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CACf;AAEhB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/views/SingleBond/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport SingleBond, { SingleBondProps } from './SingleBond'\n\nconst SingleBondWithProviders: React.FC<SingleBondProps> = (props) => (\n <Providers>\n <SingleBond {...props} />\n </Providers>\n)\n\nexport default SingleBondWithProviders\n"],"names":["_jsx"],"mappings":";;;;AAIA,MAAM,uBAAuB,GAA8B,CAAC,KAAK,MAC/DA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,IAAC,UAAU,EAAA,EAAA,GAAK,KAAK,EAAA,CAAI,EAAA,CACf;;;;"}
@@ -1,4 +1,2 @@
1
- import React from 'react';
2
- import { SDKPropsDTO } from '../../state/useSDKConfig';
3
- declare const YourBondsWithProviders: React.FC<SDKPropsDTO>;
1
+ declare const YourBondsWithProviders: () => import("react/jsx-runtime").JSX.Element;
4
2
  export default YourBondsWithProviders;
@@ -1,12 +1,8 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import Providers from '../../providers/index.js';
3
3
  import YourBonds from './YourBonds.js';
4
- import { useSDKConfig } from '../../state/useSDKConfig.js';
5
4
 
6
- const YourBondsWithProviders = (props) => {
7
- useSDKConfig(props);
8
- return (jsx(Providers, { children: jsx(YourBonds, {}) }));
9
- };
5
+ const YourBondsWithProviders = () => (jsx(Providers, { children: jsx(YourBonds, {}) }));
10
6
 
11
7
  export { YourBondsWithProviders as default };
12
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/views/YourBonds/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport YourBonds from './YourBonds'\nimport { SDKPropsDTO, useSDKConfig } from '../../state/useSDKConfig'\n\nconst YourBondsWithProviders: React.FC<SDKPropsDTO> = (props) => {\n useSDKConfig(props)\n\n return (\n <Providers>\n <YourBonds />\n </Providers>\n )\n}\n\nexport default YourBondsWithProviders\n"],"names":["_jsx"],"mappings":";;;;;AAKA,MAAM,sBAAsB,GAA0B,CAAC,KAAK,KAAI;IAC9D,YAAY,CAAC,KAAK,CAAC;IAEnB,QACEA,IAAC,SAAS,EAAA,EAAA,QAAA,EACRA,IAAC,SAAS,EAAA,EAAA,CAAG,EAAA,CACH;AAEhB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/views/YourBonds/index.tsx"],"sourcesContent":["import React from 'react'\nimport Providers from '../../providers'\nimport YourBonds from './YourBonds'\n\nconst YourBondsWithProviders = () => (\n <Providers>\n <YourBonds />\n </Providers>\n)\n\nexport default YourBondsWithProviders\n"],"names":["_jsx"],"mappings":";;;;AAIA,MAAM,sBAAsB,GAAG,OAC7BA,GAAA,CAAC,SAAS,EAAA,EAAA,QAAA,EACRA,GAAA,CAAC,SAAS,EAAA,EAAA,CAAG,EAAA,CACH;;;;"}