@ape.swap/bonds-sdk 2.5.4 → 2.6.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.
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
3
+ interface XmasFlashBondProps {
4
+ userTier: LaunchBondTiers | null;
5
+ minTier: number | undefined;
6
+ }
7
+ declare const TagXmasFlashBond: React.FC<XmasFlashBondProps>;
8
+ export default TagXmasFlashBond;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ChainId, Token } from '@ape.swap/apeswap-lists';
3
- declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }: {
3
+ declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, inputDisabled, }: {
4
4
  typedValue: string;
5
5
  setTypedValue: (value: React.SetStateAction<string>) => void;
6
6
  selectedToken?: "NATIVE" | Token;
@@ -13,5 +13,6 @@ declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, c
13
13
  bondPrincipalToken?: Token;
14
14
  bondEarnToken?: Token;
15
15
  modalVariant?: "alt" | "standard";
16
+ inputDisabled?: boolean;
16
17
  }) => React.JSX.Element;
17
18
  export default TokenSelectorPanel;
@@ -7,4 +7,5 @@ export declare const PRICE_GETTER_ADDRESSES: AddressMap;
7
7
  export declare const MULTICALL_V2: AddressMap;
8
8
  export declare const SoulZapTokenManager: Partial<Record<ChainId, string>>;
9
9
  export declare const ACF_TO_ABOND: string;
10
+ export declare const LENS_CONTRACT: AddressMap;
10
11
  export {};
package/dist/main.js CHANGED
@@ -39230,7 +39230,7 @@ const vestingTimeRemaining = (userBill) => {
39230
39230
  };
39231
39231
  const vestingTimeRemainingYourBonds = (userBill) => {
39232
39232
  const currentTime = new Date().getTime() / 1000;
39233
- return (parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime);
39233
+ return parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime;
39234
39234
  };
39235
39235
  const discountEarnTokenPrice = (bond) => {
39236
39236
  var _a, _b;
@@ -39268,10 +39268,10 @@ function formatUSDNumber(input) {
39268
39268
  }
39269
39269
  // If the number is greater than 1k, round to no decimals.
39270
39270
  if (number.gt(1000)) {
39271
- return number.toNumber().toLocaleString(undefined, { maximumFractionDigits: 0 });
39271
+ return number.toNumber().toLocaleString('en-US', { maximumFractionDigits: 0 });
39272
39272
  }
39273
39273
  // Note: Between 1k and 0.01 show 2 decimals
39274
- return parseFloat(number.toFixed(2)).toLocaleString(undefined);
39274
+ return parseFloat(number.toFixed(2)).toLocaleString('en-US');
39275
39275
  }
39276
39276
  const youSpend = (inputValue) => formatNumber$2(inputValue);
39277
39277
  const youSpendUSD = (bond, inputValue) => {
@@ -49086,6 +49086,9 @@ const SoulZapTokenManager = {
49086
49086
  [types.ChainId.AVAX]: '0xC4dE46cBE21400dabE2E7c66E04F43acE4b5b910',
49087
49087
  };
49088
49088
  const ACF_TO_ABOND = '0xEce2b9C3704632Ce760271B0b84E3A4A698Ca962';
49089
+ const LENS_CONTRACT = {
49090
+ [types.ChainId.BSC]: '0x6Fb7A34A271cc0F4016db6A3BAA6206757a9a164',
49091
+ };
49089
49092
 
49090
49093
  var bn$1 = {exports: {}};
49091
49094
 
@@ -71732,7 +71735,8 @@ const YourBonds = () => {
71732
71735
  return;
71733
71736
  if (sortConfig === null) {
71734
71737
  const sortedBills = (_a = [...userBonds]) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
71735
- const vestingDifference = parseFloat(vestingTimeRemainingYourBonds(b).toFixed(3)) - parseFloat(vestingTimeRemainingYourBonds(a).toFixed(3));
71738
+ const vestingDifference = parseFloat(vestingTimeRemainingYourBonds(b).toFixed(3)) -
71739
+ parseFloat(vestingTimeRemainingYourBonds(a).toFixed(3));
71736
71740
  if (vestingDifference !== 0) {
71737
71741
  return vestingDifference;
71738
71742
  }
@@ -72557,7 +72561,7 @@ const TokenSelectorModal = ({ bondPrincipalToken, bondEarnToken, handleCurrencyS
72557
72561
  }) })] }) }) }));
72558
72562
  };
72559
72563
 
72560
- const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }) => {
72564
+ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, inputDisabled = false, }) => {
72561
72565
  var _a, _b;
72562
72566
  const { address: account } = useAccount();
72563
72567
  const tokenBalanceString = tokenBalance ? new BigNumber$1(tokenBalance).toPrecision(5) : 'loading';
@@ -72580,7 +72584,7 @@ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
72580
72584
  !!v.currentTarget.value && isNumber$1(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
72581
72585
  ? v.currentTarget.value
72582
72586
  : v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
72583
- } }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }), jsxs(Flex$1, { className: "input-container balancerow", children: [jsx$2(Flex$1, { children: selectedTokenPrice && typedValue
72587
+ }, disabled: inputDisabled }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }), jsxs(Flex$1, { className: "input-container balancerow", children: [jsx$2(Flex$1, { children: selectedTokenPrice && typedValue
72584
72588
  ? `$${formatUSDNumber((selectedTokenPrice * parseFloat(typedValue)).toFixed(2))}`
72585
72589
  : '' }), jsxs(Flex$1, { children: [account && jsxs(Flex$1, { className: "balancerow text", children: ["Balance: ", tokenBalanceString] }), jsxs(Flex$1, { className: "balancerow max", children: [tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant !== 'alt' && (jsx$2(Fragment$1, { children: jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" }) })), tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant === 'alt' && (jsxs(Flex$1, { children: [jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 4).toString()), children: "25%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 2).toString()), children: "50%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) * 0.75).toString()), children: "75%" }), jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" })] }))] })] })] })] }));
72586
72590
  };
@@ -74067,7 +74071,7 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
74067
74071
  },
74068
74072
  });
74069
74073
  };
74070
- return (jsxs(Flex, { className: "modaltable-container title-container", children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_b = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _b === void 0 ? void 0 : _b[0] })] }), jsxs(Flex, { className: "title-container price-container", children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { className: "price-container discounted", children: ["$", discountEarnTokenPrice(bondData)] })] }), jsx$2(Flex, { className: "slipagge-close-icons", children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose }), jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] })) : (jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }));
74074
+ return (jsxs(Flex, { className: "modaltable-container title-container", children: [jsxs(Flex, { className: "title-container bondicon", children: [jsx$2("img", { src: "/images/bills/xmasHat.png", alt: "xmas-hat", className: "xmas-hat" }), jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 50, chain: bondData.chainId })] }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_b = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _b === void 0 ? void 0 : _b[0] })] }), jsxs(Flex, { className: "title-container price-container", children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { className: "price-container discounted", children: ["$", discountEarnTokenPrice(bondData)] })] }), jsx$2(Flex, { className: "slipagge-close-icons", children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose }), jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] })) : (jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }));
74071
74075
  };
74072
74076
 
74073
74077
  const BondCards = ({ bondData }) => {
@@ -74236,6 +74240,427 @@ const NoBonusModal = ({ onAcknowledge, showcaseTokenName }) => {
74236
74240
  return (isOpen && (jsxs(Modal, { className: "nobonus-modal", title: "Warning", onClose: handleAcknowledge, children: [jsxs("p", { children: ["You're buying ", showcaseTokenName, " at a higher price than the market, which will result in receiving fewer tokens compared to swapping via an exchange."] }), jsx$2("p", { children: "You will not receive any bonus tokens when buying this bond." }), jsxs(Flex, { className: "nobonus-checkbox-row", sx: { flexDirection: 'row', gap: '8px', pb: '20px' }, children: [jsx$2(Flex, { className: "nobonus-checkbox", children: jsx$2(Checkbox, { onChange: handleCheckboxChange }) }), jsx$2(Flex, { className: "nobonus-checkbox-text", children: "I understand and want to proceed." })] }), jsxs(Flex, { className: "nobonus-actions", sx: { flexDirection: 'row', gap: '8px' }, children: [jsx$2(Button, { classname: "nobonus-cancel", onClick: handleCancel, sx: { width: '100%', justifyContent: 'center' }, variant: "secondary", children: "Cancel" }), jsx$2(Button, { className: "nobonus-buy", onClick: handleAcknowledge, disabled: !isChecked, sx: { width: '100%', justifyContent: 'center' }, children: "Buy" })] })] })));
74237
74241
  };
74238
74242
 
74243
+ var lensContractABI = [
74244
+ {
74245
+ inputs: [
74246
+ ],
74247
+ stateMutability: "nonpayable",
74248
+ type: "constructor"
74249
+ },
74250
+ {
74251
+ inputs: [
74252
+ ],
74253
+ name: "DurationsNotDescendingOrder",
74254
+ type: "error"
74255
+ },
74256
+ {
74257
+ inputs: [
74258
+ ],
74259
+ name: "MismatchedLengths",
74260
+ type: "error"
74261
+ },
74262
+ {
74263
+ inputs: [
74264
+ ],
74265
+ name: "MultiplierBelowPrecision",
74266
+ type: "error"
74267
+ },
74268
+ {
74269
+ inputs: [
74270
+ ],
74271
+ name: "NotLockOwner",
74272
+ type: "error"
74273
+ },
74274
+ {
74275
+ anonymous: false,
74276
+ inputs: [
74277
+ {
74278
+ indexed: false,
74279
+ internalType: "uint8",
74280
+ name: "version",
74281
+ type: "uint8"
74282
+ }
74283
+ ],
74284
+ name: "Initialized",
74285
+ type: "event"
74286
+ },
74287
+ {
74288
+ anonymous: false,
74289
+ inputs: [
74290
+ {
74291
+ indexed: false,
74292
+ internalType: "uint256[]",
74293
+ name: "durationThresholds",
74294
+ type: "uint256[]"
74295
+ },
74296
+ {
74297
+ indexed: false,
74298
+ internalType: "uint256[]",
74299
+ name: "multipliers",
74300
+ type: "uint256[]"
74301
+ }
74302
+ ],
74303
+ name: "MultipliersUpdated",
74304
+ type: "event"
74305
+ },
74306
+ {
74307
+ anonymous: false,
74308
+ inputs: [
74309
+ {
74310
+ indexed: true,
74311
+ internalType: "address",
74312
+ name: "previousOwner",
74313
+ type: "address"
74314
+ },
74315
+ {
74316
+ indexed: true,
74317
+ internalType: "address",
74318
+ name: "newOwner",
74319
+ type: "address"
74320
+ }
74321
+ ],
74322
+ name: "OwnershipTransferred",
74323
+ type: "event"
74324
+ },
74325
+ {
74326
+ inputs: [
74327
+ ],
74328
+ name: "MULTIPLIER_PRECISION",
74329
+ outputs: [
74330
+ {
74331
+ internalType: "uint256",
74332
+ name: "",
74333
+ type: "uint256"
74334
+ }
74335
+ ],
74336
+ stateMutability: "view",
74337
+ type: "function"
74338
+ },
74339
+ {
74340
+ inputs: [
74341
+ {
74342
+ internalType: "uint256",
74343
+ name: "",
74344
+ type: "uint256"
74345
+ }
74346
+ ],
74347
+ name: "durationDaysThresholds",
74348
+ outputs: [
74349
+ {
74350
+ internalType: "uint256",
74351
+ name: "",
74352
+ type: "uint256"
74353
+ }
74354
+ ],
74355
+ stateMutability: "view",
74356
+ type: "function"
74357
+ },
74358
+ {
74359
+ inputs: [
74360
+ {
74361
+ internalType: "address",
74362
+ name: "escrowOwner",
74363
+ type: "address"
74364
+ }
74365
+ ],
74366
+ name: "getEscrowWeight",
74367
+ outputs: [
74368
+ {
74369
+ internalType: "uint256",
74370
+ name: "totalWeight",
74371
+ type: "uint256"
74372
+ },
74373
+ {
74374
+ internalType: "uint256",
74375
+ name: "maxMultiplier",
74376
+ type: "uint256"
74377
+ },
74378
+ {
74379
+ internalType: "uint256",
74380
+ name: "maxTier",
74381
+ type: "uint256"
74382
+ }
74383
+ ],
74384
+ stateMutability: "view",
74385
+ type: "function"
74386
+ },
74387
+ {
74388
+ inputs: [
74389
+ {
74390
+ internalType: "address",
74391
+ name: "escrowOwner",
74392
+ type: "address"
74393
+ },
74394
+ {
74395
+ internalType: "uint256[]",
74396
+ name: "tokenIds",
74397
+ type: "uint256[]"
74398
+ }
74399
+ ],
74400
+ name: "getEscrowWeightForTokenIds",
74401
+ outputs: [
74402
+ {
74403
+ internalType: "uint256",
74404
+ name: "totalWeight",
74405
+ type: "uint256"
74406
+ },
74407
+ {
74408
+ internalType: "uint256",
74409
+ name: "maxMultiplier",
74410
+ type: "uint256"
74411
+ },
74412
+ {
74413
+ internalType: "uint256",
74414
+ name: "maxTier",
74415
+ type: "uint256"
74416
+ }
74417
+ ],
74418
+ stateMutability: "view",
74419
+ type: "function"
74420
+ },
74421
+ {
74422
+ inputs: [
74423
+ {
74424
+ internalType: "uint256",
74425
+ name: "durationDays",
74426
+ type: "uint256"
74427
+ }
74428
+ ],
74429
+ name: "getMultiplierForDaysLocked",
74430
+ outputs: [
74431
+ {
74432
+ internalType: "uint256",
74433
+ name: "multiplier",
74434
+ type: "uint256"
74435
+ },
74436
+ {
74437
+ internalType: "uint256",
74438
+ name: "tier",
74439
+ type: "uint256"
74440
+ }
74441
+ ],
74442
+ stateMutability: "view",
74443
+ type: "function"
74444
+ },
74445
+ {
74446
+ inputs: [
74447
+ ],
74448
+ name: "getMultipliers",
74449
+ outputs: [
74450
+ {
74451
+ internalType: "uint256[]",
74452
+ name: "_durationDaysThresholds",
74453
+ type: "uint256[]"
74454
+ },
74455
+ {
74456
+ internalType: "uint256[]",
74457
+ name: "_multipliers",
74458
+ type: "uint256[]"
74459
+ }
74460
+ ],
74461
+ stateMutability: "view",
74462
+ type: "function"
74463
+ },
74464
+ {
74465
+ inputs: [
74466
+ {
74467
+ internalType: "address",
74468
+ name: "_votingEscrowAddress",
74469
+ type: "address"
74470
+ },
74471
+ {
74472
+ internalType: "uint256[]",
74473
+ name: "_durationDaysThresholds",
74474
+ type: "uint256[]"
74475
+ },
74476
+ {
74477
+ internalType: "uint256[]",
74478
+ name: "_multipliers",
74479
+ type: "uint256[]"
74480
+ }
74481
+ ],
74482
+ name: "initialize",
74483
+ outputs: [
74484
+ ],
74485
+ stateMutability: "nonpayable",
74486
+ type: "function"
74487
+ },
74488
+ {
74489
+ inputs: [
74490
+ {
74491
+ internalType: "uint256",
74492
+ name: "",
74493
+ type: "uint256"
74494
+ }
74495
+ ],
74496
+ name: "multipliers",
74497
+ outputs: [
74498
+ {
74499
+ internalType: "uint256",
74500
+ name: "",
74501
+ type: "uint256"
74502
+ }
74503
+ ],
74504
+ stateMutability: "view",
74505
+ type: "function"
74506
+ },
74507
+ {
74508
+ inputs: [
74509
+ ],
74510
+ name: "owner",
74511
+ outputs: [
74512
+ {
74513
+ internalType: "address",
74514
+ name: "",
74515
+ type: "address"
74516
+ }
74517
+ ],
74518
+ stateMutability: "view",
74519
+ type: "function"
74520
+ },
74521
+ {
74522
+ inputs: [
74523
+ ],
74524
+ name: "renounceOwnership",
74525
+ outputs: [
74526
+ ],
74527
+ stateMutability: "nonpayable",
74528
+ type: "function"
74529
+ },
74530
+ {
74531
+ inputs: [
74532
+ {
74533
+ internalType: "uint256[]",
74534
+ name: "_durationDaysThresholds",
74535
+ type: "uint256[]"
74536
+ },
74537
+ {
74538
+ internalType: "uint256[]",
74539
+ name: "_multipliers",
74540
+ type: "uint256[]"
74541
+ }
74542
+ ],
74543
+ name: "setMultipliers",
74544
+ outputs: [
74545
+ ],
74546
+ stateMutability: "nonpayable",
74547
+ type: "function"
74548
+ },
74549
+ {
74550
+ inputs: [
74551
+ {
74552
+ internalType: "address",
74553
+ name: "newOwner",
74554
+ type: "address"
74555
+ }
74556
+ ],
74557
+ name: "transferOwnership",
74558
+ outputs: [
74559
+ ],
74560
+ stateMutability: "nonpayable",
74561
+ type: "function"
74562
+ },
74563
+ {
74564
+ inputs: [
74565
+ ],
74566
+ name: "votingEscrow",
74567
+ outputs: [
74568
+ {
74569
+ internalType: "contract IVotingEscrowV2Upgradeable",
74570
+ name: "",
74571
+ type: "address"
74572
+ }
74573
+ ],
74574
+ stateMutability: "view",
74575
+ type: "function"
74576
+ }
74577
+ ];
74578
+
74579
+ const TIERS_WEIGHT = {
74580
+ [types.LaunchBondTiers.Bronze]: '1000000000000000000000',
74581
+ [types.LaunchBondTiers.Silver]: '10000000000000000000000',
74582
+ [types.LaunchBondTiers.Gold]: '25000000000000000000000',
74583
+ [types.LaunchBondTiers.Diamond]: '100000000000000000000000',
74584
+ [types.LaunchBondTiers.Legend]: '500000000000000000000000',
74585
+ };
74586
+ const TIERS_NAMES = {
74587
+ [types.LaunchBondTiers.Bronze]: 'Bronze',
74588
+ [types.LaunchBondTiers.Silver]: 'Silver',
74589
+ [types.LaunchBondTiers.Gold]: 'Gold',
74590
+ [types.LaunchBondTiers.Diamond]: 'Diamond',
74591
+ [types.LaunchBondTiers.Legend]: 'Legend',
74592
+ };
74593
+ const getUserTier = (weight) => {
74594
+ const weightBG = new BigNumber$1(weight);
74595
+ const bronze = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Bronze]);
74596
+ const silver = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Silver]);
74597
+ const gold = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Gold]);
74598
+ const diamond = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Diamond]);
74599
+ const legend = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Legend]);
74600
+ if (weightBG.gte(legend)) {
74601
+ return types.LaunchBondTiers.Legend;
74602
+ }
74603
+ else if (weightBG.gte(diamond)) {
74604
+ return types.LaunchBondTiers.Diamond;
74605
+ }
74606
+ else if (weightBG.gte(gold)) {
74607
+ return types.LaunchBondTiers.Gold;
74608
+ }
74609
+ else if (weightBG.gte(silver)) {
74610
+ return types.LaunchBondTiers.Silver;
74611
+ }
74612
+ else if (weightBG.gte(bronze)) {
74613
+ return types.LaunchBondTiers.Bronze;
74614
+ }
74615
+ else
74616
+ return null;
74617
+ };
74618
+ const fetchEscrowWeight = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
74619
+ const lensContractAddress = LENS_CONTRACT[types.ChainId.BSC];
74620
+ if (account) {
74621
+ try {
74622
+ const res = yield multicall(types.ChainId.BSC, lensContractABI, [
74623
+ {
74624
+ address: lensContractAddress,
74625
+ name: 'getEscrowWeight',
74626
+ params: [account],
74627
+ },
74628
+ ]);
74629
+ return res[0][0].toString();
74630
+ }
74631
+ catch (e) {
74632
+ console.error(e);
74633
+ return '0';
74634
+ }
74635
+ }
74636
+ else
74637
+ return null;
74638
+ });
74639
+ function useGetUserEscrowWeight(account) {
74640
+ return useQuery({
74641
+ queryKey: [`${QUERY_KEYS.TIERS}-${account}`],
74642
+ queryFn: () => fetchEscrowWeight(account),
74643
+ staleTime: 60000,
74644
+ refetchInterval: 30000, // i.e. 30 secs
74645
+ refetchOnWindowFocus: false,
74646
+ });
74647
+ }
74648
+
74649
+ const TagXmasFlashBond = ({ userTier, minTier }) => {
74650
+ return (jsxs(Flex, { sx: {
74651
+ p: '5px 10px',
74652
+ width: '100%',
74653
+ background: '#DF4141',
74654
+ borderRadius: 'normal',
74655
+ mt: '10px',
74656
+ fontSize: '12px',
74657
+ fontWeight: 400,
74658
+ justifyContent: 'center',
74659
+ textAlign: 'center',
74660
+ display: 'block',
74661
+ }, children: ["This is a special ", jsx$2("span", { style: { fontWeight: 700 }, children: "Christmas Flash Bond." }), !userTier || (minTier !== undefined && userTier < minTier) ? (jsxs(Fragment$1, { children: [' ', "You need to achieve", ' ', jsxs("span", { style: { fontWeight: 700 }, children: [TIERS_NAMES[minTier], " Ape Tier"] }), " to be elegible!"] })) : (jsxs(Fragment$1, { children: [' ', "You are eligible to buy it thanks to your", ' ', jsxs("span", { style: { fontWeight: 700 }, children: [TIERS_NAMES[userTier], " Ape Tier!"] }), ' '] }))] }));
74662
+ };
74663
+
74239
74664
  const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) => {
74240
74665
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
74241
74666
  const SDKConfig = useSDKConfig();
@@ -74251,8 +74676,11 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
74251
74676
  const { sendTransactionAsync } = useSendTransaction();
74252
74677
  const { data: bonds } = useBondsData();
74253
74678
  const sendReferenceId = useSendReferenceId();
74679
+ const { data: userEscrowWeight } = useGetUserEscrowWeight(account);
74680
+ const userTier = getUserTier(userEscrowWeight !== null && userEscrowWeight !== void 0 ? userEscrowWeight : '0');
74254
74681
  // State
74255
74682
  const bondData = useMemo(() => bonds === null || bonds === void 0 ? void 0 : bonds.find((bond) => { var _a; return ((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()); }), [bondAddress]);
74683
+ const isXmasStyle = (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) ? bondData.minTier : null;
74256
74684
  const [buyTxHash, setBuyTxHash] = useState();
74257
74685
  const [inputValue, setInputValue] = useState('');
74258
74686
  const [inputTokenString, setInputTokenString] = useState((_c = (_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bondData.chainId]) !== null && _c !== void 0 ? _c : 'NATIVE');
@@ -74451,7 +74879,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
74451
74879
  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');
74452
74880
  }
74453
74881
  };
74454
- 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, handleValueBtn: () => { 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 }), bondData.type === 'staking' && (jsxs(Flex, { sx: {
74882
+ return (jsx$2(Modal, { className: `modal ${isXmasStyle ? 'xmas-style' : ''}`, 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, handleValueBtn: () => { 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, inputDisabled: isXmasStyle && bondData.minTier && (!userTier || userTier < bondData.minTier) ? true : false }), bondData.type === 'staking' && (jsxs(Flex, { sx: {
74455
74883
  p: '5px 10px',
74456
74884
  width: '100%',
74457
74885
  background: '#8E568F',
@@ -74461,7 +74889,8 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
74461
74889
  fontWeight: 400,
74462
74890
  justifyContent: 'center',
74463
74891
  display: 'block',
74464
- }, children: ["Tokens bought through this bond will go directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a ", daysLeftOnBasepadPool(), " days lock."] })), 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) => {
74892
+ }, children: ["Tokens bought through this bond will go directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a ", daysLeftOnBasepadPool(), " days lock."] })), isXmasStyle && (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) !== undefined && (jsx$2(TagXmasFlashBond, { userTier: userTier, minTier: bondData.minTier })), jsxs(Flex, { className: "modaltable-container button-container", children: [account &&
74893
+ (!isXmasStyle || (isXmasStyle && bondData.minTier && userTier && userTier >= bondData.minTier)) && (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, {})) : isXmasStyle && bondData.minTier && (!userTier || userTier < bondData.minTier) ? (jsx$2(Button, { className: "action-button", onClick: () => window.open(`https://www.ape.bond/tier-staking`, '_blank'), children: "GET YOUR TIER" })) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
74465
74894
  event.stopPropagation();
74466
74895
  switchChain({ chainId: bondData.chainId });
74467
74896
  }, 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 ||
@@ -74512,6 +74941,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
74512
74941
  * */
74513
74942
  const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
74514
74943
  var _a;
74944
+ const locationPath = window.location.pathname;
74515
74945
  const [billId, setBillId] = useState('');
74516
74946
  const [buyTxHash, setBuyTxHash] = useState('');
74517
74947
  const { data: txReceipt } = useMonitorTxHash(buyTxHash, bondChain);
@@ -74543,7 +74973,7 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
74543
74973
  }
74544
74974
  }, [billId]);
74545
74975
  return billId ? (jsx$2(YourBondsModal, { userBill: userBill, onDismiss: onDismiss })) : (jsx$2(BondModal, { bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: setBuyTxHash, onDismiss: () => {
74546
- window.history.pushState({}, '', `/bonds`);
74976
+ window.history.pushState({}, '', `${locationPath !== '/bonds' ? locationPath : '/bonds'}`);
74547
74977
  onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
74548
74978
  } }));
74549
74979
  };
@@ -74691,18 +75121,20 @@ var ProgressBarWrapper$1 = React__default.memo(ProgressBarWrapper);
74691
75121
 
74692
75122
  const BondRow = ({ bond }) => {
74693
75123
  var _a, _b, _c, _d, _e, _f, _g;
75124
+ const locationPath = window.location.pathname.replace('/', '');
74694
75125
  const billAddress = 'billAddress' in bond
74695
75126
  ? bond.billAddress
74696
75127
  : 'contractAddress' in bond
74697
75128
  ? bond.contractAddress[bond.chainId]
74698
75129
  : undefined;
74699
75130
  const bonus = 'bonus' in bond ? bond.bonus : undefined;
75131
+ const isXmasStyle = 'minTier' in bond ? bond.minTier : null;
74700
75132
  // Modal
74701
75133
  const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${billAddress}-${bond.chainId}`);
74702
75134
  const handleOpenModal = () => {
74703
75135
  openBuyModal();
74704
75136
  if (typeof window !== 'undefined') {
74705
- window.history.pushState({}, '', `bonds?bondAddress=${billAddress}&bondChain=${bond.chainId}`);
75137
+ window.history.pushState({}, '', `${locationPath}?bondAddress=${billAddress}&bondChain=${bond.chainId}`);
74706
75138
  }
74707
75139
  track({
74708
75140
  event: 'buyModalOpen',
@@ -74734,7 +75166,7 @@ const BondRow = ({ bond }) => {
74734
75166
  const tokens = new BigNumber$1(tokensRemaining);
74735
75167
  return tokens.times(payoutTokenPrice);
74736
75168
  };
74737
- return (jsxs("div", { className: "bond-row", onClick: handleOpenModal, children: [jsx$2("div", { className: "token-info-container", children: jsx$2(TokenInfoAndName, { bill: bond }) }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: `discount-column ${getDiscountColor(bonus)}`, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' }), jsx$2("div", { className: "arr-column", children: bonus !== undefined && bonus < 0 ? '0%' : calculateARR(bond) !== undefined ? calculateARR(bond) : '-' }), jsx$2("div", { className: "terms-column", children: bond.type === 'staking'
75169
+ return (jsxs("div", { className: `bond-row ${isXmasStyle ? 'xmas-border' : ''}`, onClick: handleOpenModal, children: [jsxs("div", { className: "token-info-container", children: [isXmasStyle && jsx$2("img", { src: "/images/bills/xmasHat.png", alt: "xmas-hat", className: "xmas-hat" }), jsx$2(TokenInfoAndName, { bill: bond })] }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: `discount-column ${getDiscountColor(bonus)}`, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' }), jsx$2("div", { className: "arr-column", children: bonus !== undefined && bonus < 0 ? '0%' : calculateARR(bond) !== undefined ? calculateARR(bond) : '-' }), jsx$2("div", { className: "terms-column", children: bond.type === 'staking'
74738
75170
  ? `${daysLeftOnBasepadPool()} D Lock`
74739
75171
  : vestingTime((_a = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _a !== void 0 ? _a : 0).days
74740
75172
  ? `${vestingTime((_b = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _b !== void 0 ? _b : 0).days} D`
@@ -75059,8 +75491,30 @@ const Bonds = () => {
75059
75491
  const topTags = useTopTags(sortedBonds);
75060
75492
  // remove favorites for seedify
75061
75493
  const filterOptions = SDKConfig.referenceId !== 'seedify' ? ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'] : ['ALL', ...topTags, 'SOLD OUT'];
75494
+ let campaign = 'noCampaign';
75495
+ if (typeof window !== 'undefined' &&
75496
+ (window.location.host.includes('ape.bond') ||
75497
+ window.location.host.includes('apebond') ||
75498
+ window.location.host.includes('localhost'))) {
75499
+ if (window.location.pathname.includes('christmas-sale'))
75500
+ campaign = 'xmas';
75501
+ if (window.location.pathname.includes('bonds'))
75502
+ campaign = 'combined';
75503
+ }
75062
75504
  const billsToRender = useMemo(() => {
75063
75505
  let billsToReturn = filterOption === 'SOLD OUT' ? (allBonds !== null && allBonds !== void 0 ? allBonds : []) : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
75506
+ if (campaign === undefined || campaign === 'noCampaign') {
75507
+ billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
75508
+ const isXmasStyle = 'minTier' in bill ? bill.minTier : null;
75509
+ return !isXmasStyle;
75510
+ });
75511
+ }
75512
+ if (campaign === 'xmas') {
75513
+ billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
75514
+ const isXmasStyle = 'minTier' in bill ? bill.minTier : null;
75515
+ return isXmasStyle;
75516
+ });
75517
+ }
75064
75518
  if (searchQuery) {
75065
75519
  billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
75066
75520
  var _a, _b;
@@ -75117,12 +75571,13 @@ const FullBondsView = () => {
75117
75571
  const handleToogle = () => {
75118
75572
  const newOption = activeView === BondsViewOptions.YOURBONDS ? BondsViewOptions.BONDSMARKET : BondsViewOptions.YOURBONDS;
75119
75573
  if (typeof window !== 'undefined') {
75574
+ const currentPath = window.location.pathname;
75120
75575
  if (newOption === BondsViewOptions.YOURBONDS) {
75121
75576
  // window.location.pathname = '/yourBonds'
75122
- window.history.pushState({}, '', '/bonds?yourBonds');
75577
+ window.history.pushState({}, '', `${currentPath}?yourBonds`);
75123
75578
  }
75124
75579
  else {
75125
- window.history.pushState({}, '', '/bonds');
75580
+ window.history.pushState({}, '', `${currentPath}`);
75126
75581
  }
75127
75582
  }
75128
75583
  setActiveView(newOption);
@@ -91472,7 +91927,7 @@ const styles = {
91472
91927
  pr: '0px',
91473
91928
  alignItems: 'center',
91474
91929
  mt: ['15px', '15px', '15px', '5px'],
91475
- height: ['330px', '330px', '330px', '430px'],
91930
+ minHeight: ['330px', '330px', '330px', '430px'],
91476
91931
  ml: ['0px', '0px', '0px', '5px'],
91477
91932
  },
91478
91933
  container: {
@@ -91533,6 +91988,7 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
91533
91988
  return ((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()) &&
91534
91989
  bondChain === bond.chainId.toString();
91535
91990
  });
91991
+ const isXmasStyle = (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) ? bondData.minTier : null;
91536
91992
  // Hooks
91537
91993
  const userChainId = useChainId();
91538
91994
  const { address: account } = useAccount();
@@ -91540,6 +91996,8 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
91540
91996
  const { writeContractAsync } = useWriteContract();
91541
91997
  const { sendTransactionAsync } = useSendTransaction();
91542
91998
  const sendReferenceId = useSendReferenceId();
91999
+ const { data: userEscrowWeight } = useGetUserEscrowWeight(account);
92000
+ const userTier = getUserTier(userEscrowWeight !== null && userEscrowWeight !== void 0 ? userEscrowWeight : '0');
91543
92001
  const [buyTxHash, setBuyTxHash] = useState();
91544
92002
  const [inputValue, setInputValue] = useState('');
91545
92003
  const [inputTokenString, setInputTokenString] = useState('');
@@ -91673,14 +92131,26 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
91673
92131
  '&& > div > div': {
91674
92132
  background: 'white2',
91675
92133
  },
91676
- }, children: jsx$2(BondCards, { bondData: bondData }) }), jsxs(Flex, { sx: { width: '100%', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsxs(Flex, { sx: {
92134
+ }, children: jsx$2(BondCards, { bondData: bondData }) }), jsxs(Flex, { sx: { width: '100%', flexDirection: ['column', 'column', 'column', 'row'], alignItems: 'stretch' }, children: [jsxs(Flex, { sx: {
91677
92135
  width: ['100%', '100%', '100%', '50%'],
91678
92136
  flexDirection: 'column',
91679
92137
  background: 'white2',
91680
92138
  p: '20px',
91681
92139
  borderRadius: '10px',
91682
92140
  mt: '5px',
91683
- }, children: [jsx$2(BondModalHeader, { bondData: bondData }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), 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, handleValueBtn: () => { 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) => {
92141
+ }, className: `project-view ${isXmasStyle ? 'xmas-style' : ''}`, children: [jsx$2(BondModalHeader, { bondData: bondData }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), 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, handleValueBtn: () => { 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 }), bondData.type === 'staking' && (jsxs(Flex, { sx: {
92142
+ p: '5px 10px',
92143
+ width: '100%',
92144
+ background: '#8E568F',
92145
+ borderRadius: 'normal',
92146
+ mt: '10px',
92147
+ fontSize: '12px',
92148
+ fontWeight: 400,
92149
+ justifyContent: 'center',
92150
+ display: 'block',
92151
+ }, children: ["Tokens bought through this bond will go directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a ", daysLeftOnBasepadPool(), " days lock."] })), isXmasStyle && (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) !== undefined && (jsx$2(TagXmasFlashBond, { userTier: userTier, minTier: bondData === null || bondData === void 0 ? void 0 : bondData.minTier })), jsxs(Flex, { className: "modaltable-container button-container", children: [account &&
92152
+ (!isXmasStyle ||
92153
+ (isXmasStyle && bondData.minTier && (!userTier || userTier >= bondData.minTier))) && (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, {})) : isXmasStyle && bondData.minTier && (!userTier || userTier < bondData.minTier) ? (jsx$2(Button, { className: "action-button", onClick: () => window.open(`https://www.ape.bond/tier-staking`, '_blank'), children: "GET YOUR TIER" })) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
91684
92154
  event.stopPropagation();
91685
92155
  switchChain({ chainId: bondData.chainId });
91686
92156
  }, 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 ||
@@ -0,0 +1,11 @@
1
+ import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
2
+ export declare const TIERS_NAMES: {
3
+ 0: string;
4
+ 1: string;
5
+ 2: string;
6
+ 3: string;
7
+ 4: string;
8
+ };
9
+ export declare const getUserTier: (weight: string) => LaunchBondTiers | null;
10
+ export declare const fetchEscrowWeight: (account?: string) => Promise<string | null>;
11
+ export default function useGetUserEscrowWeight(account?: string): import("@tanstack/react-query").UseQueryResult<string | null, Error>;
package/dist/styles.css CHANGED
@@ -131,10 +131,70 @@
131
131
  }
132
132
  }
133
133
 
134
+ .project-view .xmas-hat {
135
+ display: none;
136
+ }
137
+ .project-view .xmas-tag {
138
+ display: none;
139
+ }
140
+
134
141
  .modal {
135
142
  width: fit-content !important;
136
143
  max-width: 95%;
137
144
  }
145
+ .modal .xmas-hat {
146
+ display: none;
147
+ }
148
+ .modal .xmas-tag {
149
+ display: none;
150
+ }
151
+
152
+ .project-view.xmas-style {
153
+ background: url("/images/bills/xmasRowBG.png");
154
+ background-size: contain;
155
+ }
156
+ .project-view.xmas-style .bond-card-block, .project-view.xmas-style .token-selector-panel {
157
+ background-color: rgb(38, 51, 63);
158
+ }
159
+ .project-view.xmas-style .input-container.token {
160
+ background-color: rgb(45, 58, 71);
161
+ }
162
+
163
+ .modal.xmas-style, .project-view.xmas-style {
164
+ background-color: rgb(31, 44, 56);
165
+ }
166
+ .modal.xmas-style .title-container.bondicon .xmas-hat, .project-view.xmas-style .title-container.bondicon .xmas-hat {
167
+ display: block;
168
+ position: absolute;
169
+ z-index: 9;
170
+ left: 13px;
171
+ top: -18px;
172
+ }
173
+ .modal.xmas-style .title-container.bondname, .project-view.xmas-style .title-container.bondname {
174
+ display: block;
175
+ }
176
+ .modal.xmas-style .title-container.bondname .list-tag, .project-view.xmas-style .title-container.bondname .list-tag {
177
+ background: #DF4141;
178
+ color: white;
179
+ }
180
+ .modal.xmas-style .modal-content, .project-view.xmas-style .modal-content {
181
+ background: url("/images/bills/xmasRowBG.png");
182
+ background-size: contain;
183
+ }
184
+ .modal.xmas-style .modal-content .bond-card-block, .modal.xmas-style .modal-content .token-selector-panel, .project-view.xmas-style .modal-content .bond-card-block, .project-view.xmas-style .modal-content .token-selector-panel {
185
+ background-color: rgb(38, 51, 63);
186
+ }
187
+ .modal.xmas-style .modal-content .input-container.token, .project-view.xmas-style .modal-content .input-container.token {
188
+ background-color: rgb(45, 58, 71);
189
+ }
190
+ .modal.xmas-style .hide-mobile, .project-view.xmas-style .hide-mobile {
191
+ display: none;
192
+ }
193
+ @media screen and (min-width: 800px) {
194
+ .modal.xmas-style .hide-mobile, .project-view.xmas-style .hide-mobile {
195
+ display: flex;
196
+ }
197
+ }
138
198
 
139
199
  .project-image {
140
200
  border-radius: 6px;
@@ -185,6 +245,7 @@
185
245
  display: flex;
186
246
  flex-direction: row;
187
247
  align-items: center;
248
+ position: relative;
188
249
  }
189
250
 
190
251
  .icon-container {
@@ -495,15 +556,13 @@
495
556
  justify-content: center;
496
557
  align-items: center;
497
558
  cursor: pointer;
498
- width: 375px;
559
+ width: 100%;
499
560
  }
500
561
  .button-container.buy .action-button {
501
- width: 375px;
502
- margin-left: 10px;
562
+ width: 100%;
503
563
  }
504
564
  .button-container.buy .switch-button {
505
- width: 375px;
506
- margin-left: 10px;
565
+ width: 100%;
507
566
  }
508
567
 
509
568
  .modaltable-container.accordion-container {
@@ -628,6 +687,18 @@ span.flex-inline {
628
687
  min-height: 92px;
629
688
  }
630
689
 
690
+ .show-alert-tier-xmas {
691
+ padding: 5px 10px;
692
+ width: 100%;
693
+ background: #DF4141;
694
+ border-radius: 4px;
695
+ margin-top: 10px !important;
696
+ font-size: 12px;
697
+ font-weight: 400;
698
+ justify-content: center;
699
+ text-align: center;
700
+ }
701
+
631
702
  .bond-row {
632
703
  display: flex;
633
704
  flex-direction: row;
@@ -645,6 +716,13 @@ span.flex-inline {
645
716
  .bond-row .token-info-container {
646
717
  display: flex;
647
718
  width: 40%;
719
+ position: relative;
720
+ }
721
+ .bond-row .token-info-container .xmas-hat {
722
+ position: absolute;
723
+ z-index: 9;
724
+ left: 25px;
725
+ top: 3px;
648
726
  }
649
727
  .bond-row .bond-info-columns {
650
728
  display: flex;
@@ -702,6 +780,19 @@ span.flex-inline {
702
780
  display: flex;
703
781
  }
704
782
 
783
+ .bond-row.xmas-border {
784
+ background: url("/images/bills/xmasRowBG.png");
785
+ background-color: rgb(31, 44, 56);
786
+ }
787
+ .bond-row.xmas-border .tokeninfoname.container .list-tag {
788
+ background: #DF4141;
789
+ color: white;
790
+ }
791
+
792
+ .bond-row.xmas-border:hover {
793
+ background-color: rgb(42, 64, 84);
794
+ }
795
+
705
796
  .column.column-tokens {
706
797
  display: flex;
707
798
  align-items: center;
@@ -1,4 +1,4 @@
1
- import { ChainId, Token } from '@ape.swap/apeswap-lists';
1
+ import { ChainId, LaunchBondTiers, Token } from '@ape.swap/apeswap-lists';
2
2
  export interface BondsData {
3
3
  index?: number;
4
4
  cmcId?: number;
@@ -27,4 +27,5 @@ export interface BondsData {
27
27
  audit?: string;
28
28
  earnToken: Token;
29
29
  lpToken: Token;
30
+ minTier?: LaunchBondTiers;
30
31
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "2.5.4",
6
+ "version": "2.6.1",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",
@@ -56,7 +56,7 @@
56
56
  "yalc": "^1.0.0-pre.53"
57
57
  },
58
58
  "dependencies": {
59
- "@ape.swap/apeswap-lists": "3.73.1",
59
+ "@ape.swap/apeswap-lists": "3.73.5",
60
60
  "@emotion/react": "11.11.4",
61
61
  "bignumber.js": "^9.1.2",
62
62
  "chart.js": "4.2.0",