@ape.swap/bonds-sdk 3.0.80 → 3.0.81
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 +8 -8
- package/dist/types/yourbonds.d.ts +10 -8
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -70242,7 +70242,7 @@ const getUserBonds = (account, bondList, chains, tokenPrices, apiUrl) => __await
|
|
|
70242
70242
|
});
|
|
70243
70243
|
|
|
70244
70244
|
const YourBondsModal = ({ onDismiss, bill }) => {
|
|
70245
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
|
|
70245
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20;
|
|
70246
70246
|
// Hooks
|
|
70247
70247
|
const SDKConfig = useSDKConfig();
|
|
70248
70248
|
const chainId = useChainId();
|
|
@@ -70359,32 +70359,32 @@ const YourBondsModal = ({ onDismiss, bill }) => {
|
|
|
70359
70359
|
? attributes.map((a) => (jsxs(Flex$1, { sx: { background: 'white4', width: '100%', padding: '2px 8px' }, children: [jsx$2(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: a === null || a === void 0 ? void 0 : a.trait_type }), jsx$2(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: a === null || a === void 0 ? void 0 : a.value })] }, a.value)))
|
|
70360
70360
|
: BILL_ATTRIBUTES.map((attrib) => {
|
|
70361
70361
|
return (jsxs(Flex$1, { sx: { background: 'white4', width: '100%', padding: '2px 8px' }, children: [jsx$2(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: attrib }), jsx$2(Skeleton, { width: "150px" })] }, attrib));
|
|
70362
|
-
}) }) })) })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "You Spent" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.YouSpent }), width: "270px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_u = (_t = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _t === void 0 ? void 0 : _t.lpToken) === null || _u === void 0 ? void 0 : _u.symbol, size: 25, chain: (_v = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _v === void 0 ? void 0 : _v.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: bondNFTData ? formatNumberSI(bondNFTData.data.deposit.toFixed(4), 4) : '----' }), jsxs(Text, { sx: {
|
|
70362
|
+
}) }) })) })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "You Spent" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.YouSpent }), width: "270px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_u = (_t = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _t === void 0 ? void 0 : _t.lpToken) === null || _u === void 0 ? void 0 : _u.symbol, size: 25, chain: (_v = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _v === void 0 ? void 0 : _v.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: ((_w = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _w === void 0 ? void 0 : _w.deposit) ? formatNumberSI((_y = (_x = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _x === void 0 ? void 0 : _x.deposit) === null || _y === void 0 ? void 0 : _y.toFixed(4), 4) : '----' }), jsxs(Text, { sx: {
|
|
70363
70363
|
fontSize: ['10px', '10px', '10px', '12px'],
|
|
70364
70364
|
fontWeight: [500, 500, 500, 400],
|
|
70365
70365
|
paddingLeft: '10px',
|
|
70366
|
-
}, children: ["($", (
|
|
70366
|
+
}, children: ["($", (_z = bondNFTData === null || bondNFTData === void 0 ? void 0 : bondNFTData.data) === null || _z === void 0 ? void 0 : _z.dollarValue.toFixed(2), ")"] })] })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Fully Vested" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon" }), jsx$2(Flex$1, { className: "block-info text", children: jsxs(Flex$1, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: [vestingTimeRemainingString(userBill), isPendingCliff && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex$1, { children: ["Bond will be claimable in", ' ', `${cliffCountdown.days !== 0 ? `${cliffCountdown.days} days` : cliffCountdown.hours !== 0 ? `${cliffCountdown.hours} hours` : `${cliffCountdown.minutes} mins`}`, "."] }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex$1, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }) })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-pending", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Pending" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_1 = (_0 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _0 === void 0 ? void 0 : _0.showcaseTokenName) !== null && _1 !== void 0 ? _1 : (_3 = (_2 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _2 === void 0 ? void 0 : _2.earnToken) === null || _3 === void 0 ? void 0 : _3.symbol, size: 25, chain: (_4 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _4 === void 0 ? void 0 : _4.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(totalPending(userBill).toFixed(4)), 4) }), jsx$2(Text, { sx: {
|
|
70367
70367
|
fontSize: ['10px', '10px', '10px', '12px'],
|
|
70368
70368
|
fontWeight: [500, 500, 500, 400],
|
|
70369
70369
|
paddingLeft: '10px',
|
|
70370
|
-
}, children: `($${(totalPending(userBill) * ((
|
|
70370
|
+
}, children: `($${(totalPending(userBill) * ((_5 = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _5 !== void 0 ? _5 : 0)).toFixed(2)})` })] })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-claimable", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Claimable" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Claimable }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_7 = (_6 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _6 === void 0 ? void 0 : _6.showcaseTokenName) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _8 === void 0 ? void 0 : _8.earnToken) === null || _9 === void 0 ? void 0 : _9.symbol, size: 25, chain: (_10 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _10 === void 0 ? void 0 : _10.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(claimable(userBill).toFixed(4)), 4) }), jsx$2(Text, { sx: {
|
|
70371
70371
|
fontSize: ['10px', '10px', '10px', '12px'],
|
|
70372
70372
|
fontWeight: [500, 500, 500, 400],
|
|
70373
70373
|
paddingLeft: '10px',
|
|
70374
|
-
}, children: `($${(claimable(userBill) * ((
|
|
70374
|
+
}, children: `($${(claimable(userBill) * ((_11 = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _11 !== void 0 ? _11 : 0)).toFixed(2)})` })] })] })] }), jsxs(Flex$1, { className: "yourbondinfo-block row-vested", children: [jsxs(Flex$1, { className: "yourbondinfo-block header", children: [jsx$2(Flex$1, { className: "yourbondinfo-block header-title", children: "Claimed" }), jsx$2(Flex$1, { className: "yourbondinfo-block header-tooltip", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex$1, { children: UserBillTooltipText.Claimed }), width: "250px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex$1, { className: "block-header icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), jsxs(Flex$1, { className: "yourbondinfo-block info", children: [jsx$2(Flex$1, { className: "block-info icon", children: userBill && (jsx$2(TokenImage, { symbol: (_13 = (_12 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _12 === void 0 ? void 0 : _12.showcaseTokenName) !== null && _13 !== void 0 ? _13 : (_15 = (_14 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _14 === void 0 ? void 0 : _14.earnToken) === null || _15 === void 0 ? void 0 : _15.symbol, size: 25, chain: (_16 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _16 === void 0 ? void 0 : _16.chainId })) }), jsxs(Flex$1, { className: "block-info text", children: [jsx$2(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(claimed(userBill).toFixed(4)), 4) }), jsx$2(Text, { sx: {
|
|
70375
70375
|
fontSize: ['10px', '10px', '10px', '12px'],
|
|
70376
70376
|
fontWeight: [500, 500, 500, 400],
|
|
70377
70377
|
paddingLeft: '10px',
|
|
70378
|
-
}, children: `($${(claimed(userBill) * ((
|
|
70378
|
+
}, children: `($${(claimed(userBill) * ((_17 = earnTokenPrice === null || earnTokenPrice === void 0 ? void 0 : earnTokenPrice.price) !== null && _17 !== void 0 ? _17 : 0)).toFixed(2)})` })] })] })] })] }), ((_18 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _18 === void 0 ? void 0 : _18.warningCard) && (jsx$2(Flex$1, { sx: {
|
|
70379
70379
|
width: '100%',
|
|
70380
70380
|
background: '#DE62F366',
|
|
70381
70381
|
justifyContent: 'center',
|
|
70382
70382
|
borderRadius: 'normal',
|
|
70383
|
-
}, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: jsx$2(SafeHTMLComponent, { html: (
|
|
70383
|
+
}, children: jsx$2(Text, { sx: { fontSize: '12px', fontWeight: 400, p: '2px 10px' }, children: jsx$2(SafeHTMLComponent, { html: (_19 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _19 === void 0 ? void 0 : _19.warningCard }) }) })), jsxs(Flex$1, { className: "yourbondinfo button-container", children: [jsx$2(Flex$1, { className: "button-container claim", children: userBill && chainId !== (userBill === null || userBill === void 0 ? void 0 : userBill.bond.chainId) ? (jsxs(Button, { className: "switch-button", disabled: claimable(userBill) === 0 || load, onClick: (event) => {
|
|
70384
70384
|
var _a;
|
|
70385
70385
|
event.stopPropagation();
|
|
70386
70386
|
switchChain({ chainId: (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.chainId });
|
|
70387
|
-
}, children: ["Switch to ", NETWORK_LABEL[(
|
|
70387
|
+
}, children: ["Switch to ", NETWORK_LABEL[(_20 = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _20 === void 0 ? void 0 : _20.chainId]] })) : (jsx$2(Button, { className: "claim-button", disabled: claimable(userBill) === 0 || load || !userBill || isPendingCliff, load: load, onClick: (event) => {
|
|
70388
70388
|
event.stopPropagation();
|
|
70389
70389
|
handleClaim(userBill === null || userBill === void 0 ? void 0 : userBill.id, userBill === null || userBill === void 0 ? void 0 : userBill.address);
|
|
70390
70390
|
}, children: isPendingCliff
|
|
@@ -17,18 +17,20 @@ export interface UserBill {
|
|
|
17
17
|
bond?: BondsData;
|
|
18
18
|
}
|
|
19
19
|
export interface UserBillNftData {
|
|
20
|
-
id: number;
|
|
21
20
|
tokenId: number;
|
|
22
|
-
|
|
21
|
+
billNftId: number;
|
|
22
|
+
processing: boolean;
|
|
23
|
+
image: string;
|
|
24
|
+
id?: number;
|
|
25
|
+
attributes?: {
|
|
23
26
|
trait_type: string;
|
|
24
27
|
value: string;
|
|
25
28
|
}[];
|
|
26
|
-
chainId
|
|
27
|
-
contractAddress
|
|
28
|
-
description
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
data: {
|
|
29
|
+
chainId?: ChainId;
|
|
30
|
+
contractAddress?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
data?: {
|
|
32
34
|
billContract: string;
|
|
33
35
|
billNftAddress: string;
|
|
34
36
|
billNftId: number;
|