@goodaofi/bonds-sdk 3.0.163 → 3.0.166

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 (2) hide show
  1. package/dist/main.js +10 -2
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { forwardRef, useContext, useState, useLayoutEffect, useEffect, useCallback, useMemo, createContext as createContext$1, useRef, useId, useInsertionEffect as useInsertionEffect$1, Children, isValidElement, Fragment as Fragment$1, createElement as createElement$1, Component } from 'react';
3
3
  import { useAccount, useWaitForTransactionReceipt, useChainId, useSwitchChain, useWriteContract, useSendTransaction } from 'wagmi';
4
- import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
4
+ import { useQueryClient, useQuery, useMutation } from '@tanstack/react-query';
5
5
  import axios from 'axios';
6
6
  import { ConnectButton as ConnectButton$1 } from '@rainbow-me/rainbowkit';
7
7
 
@@ -59178,6 +59178,7 @@ const stagingUrls = {
59178
59178
  mainUrl: 'https://staging.ape.bond',
59179
59179
  };
59180
59180
  const useSDKConfig = (config) => {
59181
+ const queryClient = useQueryClient();
59181
59182
  const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
59182
59183
  const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], hotBondChains: [main.ChainId.BSC, main.ChainId.MATIC], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined, namingPreference: 'Bonus', privatePartnerName: '' }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.3' });
59183
59184
  const { data } = useQuery({
@@ -59187,6 +59188,11 @@ const useSDKConfig = (config) => {
59187
59188
  },
59188
59189
  initialData,
59189
59190
  });
59191
+ useEffect(() => {
59192
+ if (!config)
59193
+ return;
59194
+ queryClient.setQueryData([QUERY_KEYS.SDK_CONFIG], initialData);
59195
+ }, [queryClient, config, initialData]);
59190
59196
  return data;
59191
59197
  };
59192
59198
  const useURLByEnvironment = (key) => {
@@ -74609,7 +74615,7 @@ const YourBonds = ({ showOnly, isGooSale }) => {
74609
74615
  const handleFilterOption = useCallback((newOption) => {
74610
74616
  setFilterOption(newOption);
74611
74617
  }, []);
74612
- return (jsxs(Flex$1, { className: "yourbonds table-container", children: [!showOnly && (jsx$2(YourBondsMenu, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleFilterOption, setInputValue: setInputValue, inputValue: inputValue, handleSort: handleSort })), !account ? (jsx$2(PlaceholderMonkey, { text: 'You are not connected.' })) : (bondsToRender && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) > 0) || (preTGEBondsToRender && preTGEBondsToRender.length > 0) ? (jsxs(Fragment$1, { children: [preTGEBondsToRender === null || preTGEBondsToRender === void 0 ? void 0 : preTGEBondsToRender.map((userBond, index) => (jsx$2(PreTgeUserRow, { userBond: userBond, isGooSale: true }, index))), bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.map((bill, index) => (jsx$2(UserBondRow, { bill: bill }, `${bill.id}-${index}`)))] })) : inputValue !== '' || !chainFilterOption.includes('All Chains') ? (jsx$2(PlaceholderMonkey, { text: 'No results, change filters.' })) : userBondsFetched && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) === 0 ? (jsx$2(PlaceholderMonkey, { text: 'You do not own any Bonds.' })) : (jsx$2(Flex$1, { className: "yourbonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
74618
+ return (jsxs(Flex$1, { className: "yourbonds table-container", children: [!showOnly && (jsx$2(YourBondsMenu, { chainFilterOption: chainFilterOption, setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleFilterOption, setInputValue: setInputValue, inputValue: inputValue, handleSort: handleSort })), !account ? (jsx$2(PlaceholderMonkey, { text: 'You are not connected.' })) : (bondsToRender && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) > 0) || (preTGEBondsToRender && preTGEBondsToRender.length > 0) ? (jsxs(Fragment$1, { children: [preTGEBondsToRender === null || preTGEBondsToRender === void 0 ? void 0 : preTGEBondsToRender.map((userBond, index) => (jsx$2(PreTgeUserRow, { userBond: userBond, isGooSale: true }, index))), bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.map((bill, index) => (jsx$2(UserBondRow, { bill: bill }, `${bill.id}-${index}`)))] })) : userBondsFetched && (bondsToRender === null || bondsToRender === void 0 ? void 0 : bondsToRender.length) === 0 ? (jsx$2(PlaceholderMonkey, { text: 'You do not own any Bonds.' })) : (jsx$2(Flex$1, { className: "yourbonds-spinner", children: jsx$2(Spinner, { size: 100 }) }))] }));
74613
74619
  };
74614
74620
 
74615
74621
  // This basically returns the 2 tags with the higher active bond count
@@ -81410,7 +81416,9 @@ const Bonds = () => {
81410
81416
  sortedBonds,
81411
81417
  searchQuery,
81412
81418
  SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.useTiers,
81419
+ SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.bondPartner,
81413
81420
  SDKConfig.highestCompatibleVersion,
81421
+ SDKConfig.showLowValueBonds,
81414
81422
  topTags,
81415
81423
  chainFilterOption,
81416
81424
  favTokens,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Goo Money Bond SDK",
4
4
  "author": "Goo Money",
5
5
  "license": "MIT",
6
- "version": "3.0.163",
6
+ "version": "3.0.166",
7
7
  "proxy": "https://realtime-api-pr-99.herokuapp.com",
8
8
  "module": "dist/main.js",
9
9
  "type": "module",