@ape.swap/bonds-sdk 2.0.0-test.2 → 2.0.0-test.4
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/dist/main.js +20 -4
- package/dist/state/zap/getChainParam.d.ts +2 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -18451,6 +18451,7 @@ const MAINNET_CHAINS = [
|
|
|
18451
18451
|
types.ChainId.LINEA,
|
|
18452
18452
|
types.ChainId.ARBITRUM,
|
|
18453
18453
|
types.ChainId.LIGHTLINK,
|
|
18454
|
+
types.ChainId.AVAX,
|
|
18454
18455
|
];
|
|
18455
18456
|
// Network Icons
|
|
18456
18457
|
const NETWORK_ICONS = {
|
|
@@ -18466,6 +18467,7 @@ const NETWORK_ICONS = {
|
|
|
18466
18467
|
[types.ChainId.IOTA]: icons.IOTA,
|
|
18467
18468
|
[types.ChainId.BASE]: icons.BASE,
|
|
18468
18469
|
[types.ChainId.GRAPHLINQ]: icons.GRAPHLINQ,
|
|
18470
|
+
[types.ChainId.AVAX]: icons.AVAX_TOKEN,
|
|
18469
18471
|
};
|
|
18470
18472
|
// Network labels
|
|
18471
18473
|
const NETWORK_LABEL = {
|
|
@@ -18483,6 +18485,7 @@ const NETWORK_LABEL = {
|
|
|
18483
18485
|
[types.ChainId.IOTA_TESTNET]: 'Iota Testnet',
|
|
18484
18486
|
[types.ChainId.BASE]: 'Base',
|
|
18485
18487
|
[types.ChainId.GRAPHLINQ]: 'GraphLinq',
|
|
18488
|
+
[types.ChainId.AVAX]: 'Avalanche',
|
|
18486
18489
|
};
|
|
18487
18490
|
// Network block explorers
|
|
18488
18491
|
const BLOCK_EXPLORER = {
|
|
@@ -18500,6 +18503,7 @@ const BLOCK_EXPLORER = {
|
|
|
18500
18503
|
[types.ChainId.IOTA_TESTNET]: 'https://explorer.evm.testnet.iotaledger.net/',
|
|
18501
18504
|
[types.ChainId.BASE]: 'https://basescan.org',
|
|
18502
18505
|
[types.ChainId.GRAPHLINQ]: 'https://graphlinq.dex.guru',
|
|
18506
|
+
[types.ChainId.AVAX]: 'https://snowscan.xyz',
|
|
18503
18507
|
};
|
|
18504
18508
|
|
|
18505
18509
|
const supportedByLIFI = [
|
|
@@ -18509,6 +18513,7 @@ const supportedByLIFI = [
|
|
|
18509
18513
|
types.ChainId.ARBITRUM,
|
|
18510
18514
|
types.ChainId.LINEA,
|
|
18511
18515
|
types.ChainId.BASE,
|
|
18516
|
+
types.ChainId.AVAX,
|
|
18512
18517
|
];
|
|
18513
18518
|
// we should be good just by using staging on this, as it is only used for token images
|
|
18514
18519
|
const APESWAP_LIST_REPO = `https://raw.githubusercontent.com/ApeSwapFinance/apeswap-token-lists/staging`;
|
|
@@ -18685,6 +18690,7 @@ const NETWORK_COLORS = {
|
|
|
18685
18690
|
[types.ChainId.LINEA]: '#fff',
|
|
18686
18691
|
[types.ChainId.IOTA]: '#fff',
|
|
18687
18692
|
[types.ChainId.GRAPHLINQ]: '#ded2ff',
|
|
18693
|
+
[types.ChainId.AVAX]: '#e74344',
|
|
18688
18694
|
};
|
|
18689
18695
|
const TokenInfoAndName = ({ bill, vestEnds, isHotBond, }) => {
|
|
18690
18696
|
var _a, _b, _c, _d;
|
|
@@ -48745,6 +48751,7 @@ const PRICE_GETTER_ADDRESSES = {
|
|
|
48745
48751
|
[types.ChainId.LIGHTLINK]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
|
|
48746
48752
|
[types.ChainId.IOTA]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
|
|
48747
48753
|
[types.ChainId.BASE]: '0x2e6AB3cc819BE64886C1bB403813cCBec0407a5b',
|
|
48754
|
+
[types.ChainId.AVAX]: '0x70005Da62E17041977f7F99f91098b125CcDE1a7',
|
|
48748
48755
|
};
|
|
48749
48756
|
const MULTICALL_V2 = {
|
|
48750
48757
|
[types.ChainId.BSC]: '0x38ce767d81de3940CFa5020B55af1A400ED4F657',
|
|
@@ -48760,6 +48767,7 @@ const MULTICALL_V2 = {
|
|
|
48760
48767
|
[types.ChainId.IOTA]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
48761
48768
|
[types.ChainId.BASE]: '0xDF845ff2dA2325Df9C6CC3DDF7418C54E16bbFDF',
|
|
48762
48769
|
[types.ChainId.GRAPHLINQ]: '0xCc88b233BbcE04c064C627ad5627da6e24a8A067',
|
|
48770
|
+
[types.ChainId.AVAX]: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
48763
48771
|
};
|
|
48764
48772
|
const SoulZapTokenManager = {
|
|
48765
48773
|
[types.ChainId.MAINNET]: '0x2F87f76336A560bbB0d18d357D10646bB96E8802',
|
|
@@ -48768,6 +48776,7 @@ const SoulZapTokenManager = {
|
|
|
48768
48776
|
[types.ChainId.BSC]: '0x7119014f0d75A7a31b875F79cE14b2a32B34B067',
|
|
48769
48777
|
[types.ChainId.BASE]: '0x0B750790dCa8f289fAB5eFd1a48EfAb969e51D16',
|
|
48770
48778
|
[types.ChainId.ARBITRUM]: '0x22572A548Ff26Fc5725a17dfd233F49a98c17EE7',
|
|
48779
|
+
[types.ChainId.AVAX]: '0xC4dE46cBE21400dabE2E7c66E04F43acE4b5b910',
|
|
48771
48780
|
};
|
|
48772
48781
|
const ACF_TO_ABOND = '0xEce2b9C3704632Ce760271B0b84E3A4A698Ca962';
|
|
48773
48782
|
|
|
@@ -67357,6 +67366,7 @@ const PUBLIC_RPC_URLS = {
|
|
|
67357
67366
|
[types.ChainId.IOTA_TESTNET]: ['https://json-rpc.evm.testnet.iotaledger.net/'],
|
|
67358
67367
|
[types.ChainId.BASE]: ['https://base-rpc.publicnode.com', 'https://mainnet.base.org'],
|
|
67359
67368
|
[types.ChainId.GRAPHLINQ]: ['https://glq-dataseed.graphlinq.io'],
|
|
67369
|
+
[types.ChainId.AVAX]: ['https://avax.meowrpc.com'],
|
|
67360
67370
|
};
|
|
67361
67371
|
|
|
67362
67372
|
// This is the legacy multicall
|
|
@@ -71297,7 +71307,7 @@ const NetworkFilter = ({ chainFilterOption, setChainFilterOption, }) => {
|
|
|
71297
71307
|
width: '100vw',
|
|
71298
71308
|
height: '100vh',
|
|
71299
71309
|
zIndex: 1000,
|
|
71300
|
-
}, onClick: () => setIsOpen(false)
|
|
71310
|
+
}, onClick: () => setIsOpen(false) })), jsxs(Flex, { sx: {
|
|
71301
71311
|
background: 'white2',
|
|
71302
71312
|
p: '6px',
|
|
71303
71313
|
borderRadius: 'normal',
|
|
@@ -72155,6 +72165,7 @@ var NetworkNames;
|
|
|
72155
72165
|
NetworkNames["ARBITRUM"] = "arb";
|
|
72156
72166
|
NetworkNames["LINEA"] = "lna";
|
|
72157
72167
|
NetworkNames["BASE"] = "bas";
|
|
72168
|
+
NetworkNames["AVAX"] = "ava";
|
|
72158
72169
|
})(NetworkNames || (NetworkNames = {}));
|
|
72159
72170
|
const getChainParam = (chain) => {
|
|
72160
72171
|
return chain === types.ChainId.LINEA
|
|
@@ -72169,7 +72180,9 @@ const getChainParam = (chain) => {
|
|
|
72169
72180
|
? NetworkNames.ARBITRUM
|
|
72170
72181
|
: chain === types.ChainId.MAINNET
|
|
72171
72182
|
? NetworkNames.MAINNET
|
|
72172
|
-
:
|
|
72183
|
+
: chain === types.ChainId.AVAX
|
|
72184
|
+
? NetworkNames.AVAX
|
|
72185
|
+
: null;
|
|
72173
72186
|
};
|
|
72174
72187
|
const getLpType = (protocol) => {
|
|
72175
72188
|
return protocol === types.Protocols.Algebra
|
|
@@ -73177,7 +73190,7 @@ accordionTitle = 'What are Bonds?', accordionBody = 'Body', accordionVisible = f
|
|
|
73177
73190
|
window.open(`https://ape.bond/swap?outputcurrency=${bondData === null || bondData === void 0 ? void 0 : bondData.lpToken.address[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]}&outputChain=${bondData === null || bondData === void 0 ? void 0 : bondData.chainId}`, '_blank');
|
|
73178
73191
|
}
|
|
73179
73192
|
};
|
|
73180
|
-
return (jsx$2(Modal, { className: "modal", children: modalVariant === 'standard' ? (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content", children: [typeof window !== 'undefined' && window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white', fontSize: '14px', mb: '10px' }, children: ["Dev mode - Current view: \"standard\"", jsx$2(Text, { onClick: () => setModalVariant('alt'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), jsx$2(BondCards, { bondData: bondData }), jsx$2(Estimations, { bondData: bondData, inputValue: inputValue, inputToken: inputToken, estimatedOutput: estimatedOutput, inputTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { className: "modaltable-container button-container", children: [jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", onClick: () => supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId) ? handleOpenZapModal() : openExternal(), variant: "secondary", children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) }), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
73193
|
+
return (jsx$2(Modal, { className: "modal", onDismiss: onDismiss, children: modalVariant === 'standard' ? (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content", children: [typeof window !== 'undefined' && window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white', fontSize: '14px', mb: '10px' }, children: ["Dev mode - Current view: \"standard\"", jsx$2(Text, { onClick: () => setModalVariant('alt'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), jsx$2(BondCards, { bondData: bondData }), jsx$2(Estimations, { bondData: bondData, inputValue: inputValue, inputToken: inputToken, estimatedOutput: estimatedOutput, inputTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleMaxBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), jsxs(Flex, { className: "modaltable-container button-container", children: [jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", onClick: () => supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId) ? handleOpenZapModal() : openExternal(), variant: "secondary", children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) }), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
73181
73194
|
event.stopPropagation();
|
|
73182
73195
|
switchChain({ chainId: bondData.chainId });
|
|
73183
73196
|
}, style: { fontSize: '14px', padding: '6px', marginLeft: '0px' }, children: `Switch to ${NETWORK_LABEL[bondData.chainId]}` })) : approvalState === ApprovalState.APPROVED ? (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
@@ -73239,7 +73252,10 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
|
73239
73252
|
refetch();
|
|
73240
73253
|
}
|
|
73241
73254
|
}, [billId]);
|
|
73242
|
-
return billId ? (jsx$2(YourBondsModal, { userBill: userBill, onDismiss: onDismiss })) : (jsx$2(BondModal, { bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: setBuyTxHash, onDismiss:
|
|
73255
|
+
return billId ? (jsx$2(YourBondsModal, { userBill: userBill, onDismiss: onDismiss })) : (jsx$2(BondModal, { bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: setBuyTxHash, onDismiss: () => {
|
|
73256
|
+
window.history.pushState({}, '', `/bonds`);
|
|
73257
|
+
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
73258
|
+
} }));
|
|
73243
73259
|
};
|
|
73244
73260
|
|
|
73245
73261
|
/** CheckURL purpose is to open the buy bond modal ONLY IF a user has opened the site with a custom URL */
|
|
@@ -5,7 +5,8 @@ declare enum NetworkNames {
|
|
|
5
5
|
POLYGON = "pol",
|
|
6
6
|
ARBITRUM = "arb",
|
|
7
7
|
LINEA = "lna",
|
|
8
|
-
BASE = "bas"
|
|
8
|
+
BASE = "bas",
|
|
9
|
+
AVAX = "ava"
|
|
9
10
|
}
|
|
10
11
|
export declare const getChainParam: (chain?: ChainId) => NetworkNames | null;
|
|
11
12
|
export declare const getLpType: (protocol?: Protocols) => "ichi" | "solidly" | "univ2" | null;
|