@ape.swap/bonds-sdk 1.0.355 → 1.0.357
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.
|
@@ -200,9 +200,11 @@ var YourBonds = function (_a) {
|
|
|
200
200
|
combinedData = userOwnedBillsData_1.map(function (data) {
|
|
201
201
|
var enrichedUserBills = data.userOwnedBills.map(function (bill) {
|
|
202
202
|
var nftData = userBillNftData_1.find(function (nft) { return nft.id === parseInt(bill.id); });
|
|
203
|
-
return __assign(__assign({}, bill), (nftData ? {
|
|
203
|
+
return __assign(__assign({}, bill), (nftData ? { nftData: nftData } : {}));
|
|
204
204
|
});
|
|
205
|
-
return __assign(__assign({}, data), {
|
|
205
|
+
return __assign(__assign({}, data), {
|
|
206
|
+
// userOwnedBills: enrichedUserBills
|
|
207
|
+
nftData: enrichedUserBills });
|
|
206
208
|
});
|
|
207
209
|
// console.log("userBillNftData");
|
|
208
210
|
// console.log(userBillNftData);
|
|
@@ -344,9 +346,6 @@ var YourBonds = function (_a) {
|
|
|
344
346
|
fontWeight: 600,
|
|
345
347
|
width: '100%',
|
|
346
348
|
} }, { children: "Claim All" })) }))] }))] })), userOwnedBillsData.flat().map(function (data) {
|
|
347
|
-
console.log("ROWDATA");
|
|
348
|
-
console.log(data);
|
|
349
|
-
console.log("ROWDATA");
|
|
350
349
|
var sortedBills = data.userOwnedBills.sort(function (a, b) {
|
|
351
350
|
var claimableDifference = claimable(b) - claimable(a);
|
|
352
351
|
if (claimableDifference !== 0) {
|
|
@@ -355,8 +354,8 @@ var YourBonds = function (_a) {
|
|
|
355
354
|
return totalPending(b) - totalPending(a);
|
|
356
355
|
});
|
|
357
356
|
return sortedBills.map(function (bill) {
|
|
358
|
-
var _a, _b, _c;
|
|
359
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsxs(Flex, __assign({ className: "column column-tokeninfoname" }, { children: [_jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }), (_a = bill.nftData) === null || _a === void 0 ? void 0 : _a.image] })) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-claimable" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), "($".concat((claimable(bill) * ((
|
|
357
|
+
var _a, _b, _c, _d;
|
|
358
|
+
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsxs(Flex, __assign({ className: "column column-tokeninfoname" }, { children: [_jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }), (_a = bill.nftData) === null || _a === void 0 ? void 0 : _a.data.image.toString(), (_b = bill.nftData) === null || _b === void 0 ? void 0 : _b.data.attributes.toString()] })) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-claimable" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), "($".concat((claimable(bill) * ((_c = parseFloat(earnTokenPrice(bill.bond))) !== null && _c !== void 0 ? _c : 0)).toFixed(2), ")")] })), _jsxs(Flex, __assign({ className: "column column-pending" }, { children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), "($".concat((totalPending(bill) * ((_d = parseFloat(earnTokenPrice(bill.bond))) !== null && _d !== void 0 ? _d : 0)).toFixed(2), ")")] })), _jsx(Flex, __assign({ className: "column column-term" }, { children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") })), _jsx(Flex, __assign({ className: "column column-claimall" }, { children: _jsx(Flex, __assign({ className: "column-claimall button" }, { children: _jsx(Button, __assign({ disabled: !account, sx: {
|
|
360
359
|
height: ['36px', '36px', '36px', '26px'],
|
|
361
360
|
lineHeight: '12px',
|
|
362
361
|
fontSize: '14px',
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -46,68 +46,6 @@ export interface UserBillNft {
|
|
|
46
46
|
value: string;
|
|
47
47
|
}[];
|
|
48
48
|
}
|
|
49
|
-
export interface UserBillNftData {
|
|
50
|
-
id: number;
|
|
51
|
-
data: {
|
|
52
|
-
name: string;
|
|
53
|
-
description: string;
|
|
54
|
-
tokenId: number;
|
|
55
|
-
image: string;
|
|
56
|
-
attributes: {
|
|
57
|
-
trait_type: string;
|
|
58
|
-
value: string;
|
|
59
|
-
}[];
|
|
60
|
-
data: {
|
|
61
|
-
billContract: string;
|
|
62
|
-
billNftAddress: string;
|
|
63
|
-
payout: number;
|
|
64
|
-
deposit: number;
|
|
65
|
-
createTransactionHash: string;
|
|
66
|
-
billNftId: number;
|
|
67
|
-
expires: number;
|
|
68
|
-
vestingPeriodSeconds: number;
|
|
69
|
-
payoutToken: string;
|
|
70
|
-
principalToken: string;
|
|
71
|
-
type: string;
|
|
72
|
-
pairName: string;
|
|
73
|
-
payoutTokenData: {
|
|
74
|
-
address: string;
|
|
75
|
-
name: string;
|
|
76
|
-
symbol: string;
|
|
77
|
-
decimals: {
|
|
78
|
-
[chainId: number]: number;
|
|
79
|
-
};
|
|
80
|
-
};
|
|
81
|
-
token0: {
|
|
82
|
-
address: string;
|
|
83
|
-
symbol: string;
|
|
84
|
-
name: string;
|
|
85
|
-
decimals: {
|
|
86
|
-
[chainId: number]: number;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
token1: {
|
|
90
|
-
address: string;
|
|
91
|
-
symbol: string;
|
|
92
|
-
name: string;
|
|
93
|
-
decimals: {
|
|
94
|
-
[chainId: number]: number;
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
dollarValue: number;
|
|
98
|
-
chainId: ChainId;
|
|
99
|
-
blockNumber: number;
|
|
100
|
-
bondArtCollection: string;
|
|
101
|
-
bondPartner: string;
|
|
102
|
-
bondVersion: string;
|
|
103
|
-
createdAddressOwner: string;
|
|
104
|
-
createdAt: number;
|
|
105
|
-
payoutTokenPrice: string;
|
|
106
|
-
};
|
|
107
|
-
contractAddress: string;
|
|
108
|
-
chainId: ChainId;
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
49
|
export interface UserBill {
|
|
112
50
|
address: string;
|
|
113
51
|
id: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChainId } from "../enum/apeswaplists";
|
|
1
2
|
import { BondsDataResponse } from "./bonds";
|
|
2
3
|
export interface UserOwnedBillsData {
|
|
3
4
|
index: number;
|
|
@@ -17,9 +18,71 @@ export interface UserBill {
|
|
|
17
18
|
lastBlockTimestamp: string;
|
|
18
19
|
pendingRewards: string;
|
|
19
20
|
billNftAddress: string;
|
|
20
|
-
nftData?:
|
|
21
|
+
nftData?: UserBillNftData;
|
|
21
22
|
bond: BondsDataResponse;
|
|
22
23
|
}
|
|
24
|
+
export interface UserBillNftData {
|
|
25
|
+
id: number;
|
|
26
|
+
data: {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
tokenId: number;
|
|
30
|
+
image: string;
|
|
31
|
+
attributes: {
|
|
32
|
+
trait_type: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}[];
|
|
35
|
+
data: {
|
|
36
|
+
billContract: string;
|
|
37
|
+
billNftAddress: string;
|
|
38
|
+
payout: number;
|
|
39
|
+
deposit: number;
|
|
40
|
+
createTransactionHash: string;
|
|
41
|
+
billNftId: number;
|
|
42
|
+
expires: number;
|
|
43
|
+
vestingPeriodSeconds: number;
|
|
44
|
+
payoutToken: string;
|
|
45
|
+
principalToken: string;
|
|
46
|
+
type: string;
|
|
47
|
+
pairName: string;
|
|
48
|
+
payoutTokenData: {
|
|
49
|
+
address: string;
|
|
50
|
+
name: string;
|
|
51
|
+
symbol: string;
|
|
52
|
+
decimals: {
|
|
53
|
+
[chainId: number]: number;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
token0: {
|
|
57
|
+
address: string;
|
|
58
|
+
symbol: string;
|
|
59
|
+
name: string;
|
|
60
|
+
decimals: {
|
|
61
|
+
[chainId: number]: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
token1: {
|
|
65
|
+
address: string;
|
|
66
|
+
symbol: string;
|
|
67
|
+
name: string;
|
|
68
|
+
decimals: {
|
|
69
|
+
[chainId: number]: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
dollarValue: number;
|
|
73
|
+
chainId: ChainId;
|
|
74
|
+
blockNumber: number;
|
|
75
|
+
bondArtCollection: string;
|
|
76
|
+
bondPartner: string;
|
|
77
|
+
bondVersion: string;
|
|
78
|
+
createdAddressOwner: string;
|
|
79
|
+
createdAt: number;
|
|
80
|
+
payoutTokenPrice: string;
|
|
81
|
+
};
|
|
82
|
+
contractAddress: string;
|
|
83
|
+
chainId: ChainId;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
23
86
|
export interface UserBillNft {
|
|
24
87
|
image: string;
|
|
25
88
|
tokenId: string;
|