@ape.swap/bonds-sdk 5.1.7 → 5.1.8-test.1
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.
- package/README.md +2 -2
- package/dist/components/TokenSelectorModal/index.js +1 -3
- package/dist/components/TokenSelectorModal/index.js.map +1 -1
- package/dist/config/constants/networks.js +1 -1
- package/dist/config/constants/networks.js.map +1 -1
- package/dist/hooks/useMonitorTx.d.ts +1 -0
- package/dist/state/allowance/useAllowance.js +3 -3
- package/dist/state/allowance/useAllowance.js.map +1 -1
- package/dist/state/bonds/fetchBillsUser.js +12 -9
- package/dist/state/bonds/fetchBillsUser.js.map +1 -1
- package/dist/state/bonds/useBondsData.js +8 -8
- package/dist/state/bonds/useBondsData.js.map +1 -1
- package/dist/state/bonds/useUserBondsPreTGE.js +11 -11
- package/dist/state/bonds/useUserBondsPreTGE.js.map +1 -1
- package/dist/state/bonds/utils.js +23 -19
- package/dist/state/bonds/utils.js.map +1 -1
- package/dist/state/tiers/useTierPoints.d.ts +7 -0
- package/dist/state/tiers/useTierPoints.js +8 -1
- package/dist/state/tiers/useTierPoints.js.map +1 -1
- package/dist/state/tokenPrices/useTokenPrices.d.ts +1 -0
- package/dist/state/tokenPrices/useTokenPrices.js.map +1 -1
- package/dist/state/useSDKConfig.js +0 -1
- package/dist/state/useSDKConfig.js.map +1 -1
- package/dist/types/bondCodec.js +1 -1
- package/dist/types/bondIssuanceCodec.js +1 -1
- package/dist/types/bondPricingCodec.js +1 -1
- package/dist/types/bondTermCodec.js +1 -1
- package/dist/utils/bondPriceHelpers.js.map +1 -1
- package/dist/utils/convertToBigish.d.ts +2 -0
- package/dist/utils/convertToBigish.js +25 -0
- package/dist/utils/convertToBigish.js.map +1 -0
- package/dist/utils/multicall.js +31 -19
- package/dist/utils/multicall.js.map +1 -1
- package/dist/views/Bonds/Bonds.js +1 -10
- package/dist/views/Bonds/Bonds.js.map +1 -1
- package/dist/views/Bonds/components/ChainBanner/ChainBanner.js +1 -1
- package/dist/views/Bonds/components/HotBondCards/index.js +6 -1
- package/dist/views/Bonds/components/HotBondCards/index.js.map +1 -1
- package/dist/views/BuyBond/BuyComponent.js +2 -3
- package/dist/views/BuyBond/BuyComponent.js.map +1 -1
- package/dist/views/BuyBond/components/GetUpToComponent/GetUpToComponent.js +8 -3
- package/dist/views/BuyBond/components/GetUpToComponent/GetUpToComponent.js.map +1 -1
- package/dist/views/ProjectView/components/BondLeaderboard/index.js +1 -1
- package/dist/views/ProjectView/components/BondLeaderboard/index.js.map +1 -1
- package/dist/views/YourBonds/components/UserBondRow/UserBondRow.js +1 -1
- package/dist/views/YourBonds/components/UserBondRow/UserBondRowSolana.js +1 -1
- package/dist/views/YourBondsModal/YourBondsModal.js +1 -1
- package/dist/views/YourBondsModal/components/TransferBondModal/index.js +1 -1
- package/package.json +2 -4
- package/dist/utils/convertToTokenValue.d.ts +0 -4
- package/dist/utils/convertToTokenValue.js +0 -27
- package/dist/utils/convertToTokenValue.js.map +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -16
- package/dist/utils/index.js.map +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ethers } from 'ethers';
|
|
2
|
-
|
|
3
|
-
function adjustDecimals(numStr) {
|
|
4
|
-
const parts = numStr.split('.');
|
|
5
|
-
if (parts.length < 2) {
|
|
6
|
-
// This means the number doesn't have any decimals
|
|
7
|
-
return numStr;
|
|
8
|
-
}
|
|
9
|
-
if (parts[1].length > 18) {
|
|
10
|
-
parts[1] = parts[1].slice(0, 18); // Take the first 18 decimals
|
|
11
|
-
return parts[0] + '.' + parts[1];
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
return numStr;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const convertToTokenValue = (numberString, decimals) => {
|
|
18
|
-
if (isNaN(parseFloat(numberString))) {
|
|
19
|
-
console.error('Error: numberString to parse is not a number');
|
|
20
|
-
return ethers.utils.parseUnits('0', decimals);
|
|
21
|
-
}
|
|
22
|
-
const tokenValue = ethers.utils.parseUnits(adjustDecimals(numberString), decimals);
|
|
23
|
-
return tokenValue;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { adjustDecimals, convertToTokenValue as default };
|
|
27
|
-
//# sourceMappingURL=convertToTokenValue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertToTokenValue.js","sources":["../../src/utils/convertToTokenValue.ts"],"sourcesContent":["import { ethers } from 'ethers'\n\nexport function adjustDecimals(numStr: string) {\n const parts = numStr.split('.')\n if (parts.length < 2) {\n // This means the number doesn't have any decimals\n return numStr\n }\n if (parts[1].length > 18) {\n parts[1] = parts[1].slice(0, 18) // Take the first 18 decimals\n return parts[0] + '.' + parts[1]\n } else {\n return numStr\n }\n}\n\nconst convertToTokenValue = (numberString: string, decimals: number): ethers.BigNumber => {\n if (isNaN(parseFloat(numberString))) {\n console.error('Error: numberString to parse is not a number')\n return ethers.utils.parseUnits('0', decimals)\n }\n const tokenValue = ethers.utils.parseUnits(adjustDecimals(numberString), decimals)\n return tokenValue\n}\n\nexport default convertToTokenValue\n"],"names":[],"mappings":";;AAEM,SAAU,cAAc,CAAC,MAAc,EAAA;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAC/B,IAAA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;;AAEpB,QAAA,OAAO,MAAM;IACf;IACA,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,EAAE;AACxB,QAAA,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;QAChC,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;IAClC;SAAO;AACL,QAAA,OAAO,MAAM;IACf;AACF;AAEA,MAAM,mBAAmB,GAAG,CAAC,YAAoB,EAAE,QAAgB,KAAsB;IACvF,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE;AACnC,QAAA,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC;QAC7D,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,QAAQ,CAAC;IAC/C;AACA,IAAA,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC;AAClF,IAAA,OAAO,UAAU;AACnB;;;;"}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isAddress(value: any): string | false;
|
package/dist/utils/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { getAddress } from '@ethersproject/address';
|
|
2
|
-
|
|
3
|
-
// returns the checksummed address if the address is valid, otherwise returns false
|
|
4
|
-
function isAddress(value) {
|
|
5
|
-
try {
|
|
6
|
-
// Alphabetical letters must be made lowercase for getAddress to work.
|
|
7
|
-
// See documentation here: https://docs.ethers.io/v5/api/utils/address/
|
|
8
|
-
return getAddress(value.toLowerCase());
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { isAddress };
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import { getAddress } from '@ethersproject/address'\n\n// returns the checksummed address if the address is valid, otherwise returns false\nexport function isAddress(value: any): string | false {\n try {\n // Alphabetical letters must be made lowercase for getAddress to work.\n // See documentation here: https://docs.ethers.io/v5/api/utils/address/\n return getAddress(value.toLowerCase())\n } catch {\n return false\n }\n}\n"],"names":[],"mappings":";;AAEA;AACM,SAAU,SAAS,CAAC,KAAU,EAAA;AAClC,IAAA,IAAI;;;AAGF,QAAA,OAAO,UAAU,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;IACxC;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,KAAK;IACd;AACF;;;;"}
|