@ape.swap/bonds-sdk 1.0.351 → 1.0.353
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.
|
@@ -161,16 +161,6 @@ var YourBonds = function (_a) {
|
|
|
161
161
|
setIsModalOpen(true);
|
|
162
162
|
navigate("/YourBonds/?bondAddress=".concat(bond.billAddress, "&bondChain=").concat(bond.chainId), { replace: true });
|
|
163
163
|
};
|
|
164
|
-
// const usePollUserBills = () => {
|
|
165
|
-
// const { slowRefresh } = useRefresh()
|
|
166
|
-
// // const dispatch = useAppDispatch()
|
|
167
|
-
// const { account, isActive } = useWeb3React();
|
|
168
|
-
// useEffect(() => {
|
|
169
|
-
// if (account) {
|
|
170
|
-
// MAINNET_CHAINS.map((chain) => fetchUserOwnedBillsDataAsync(chain as number, account))
|
|
171
|
-
// }
|
|
172
|
-
// }, [account, slowRefresh])
|
|
173
|
-
// }
|
|
174
164
|
var currentTime = useCurrentTime() / 1000;
|
|
175
165
|
var vestingTimeRemaining = function (userBill) {
|
|
176
166
|
return getTimePeriods(parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime, true);
|
|
@@ -203,25 +193,16 @@ var YourBonds = function (_a) {
|
|
|
203
193
|
});
|
|
204
194
|
});
|
|
205
195
|
return [4 /*yield*/, fetchUserOwnedBillNftData(ownedBillsData, chainId, bonds)
|
|
206
|
-
//
|
|
207
|
-
// return {
|
|
208
|
-
// index: bonds[index].index,
|
|
209
|
-
// userOwnedBillsNfts: bs.map((b: any) => {
|
|
210
|
-
// const nftData = userBillNftData.find((nftB) => parseInt(nftB.id) === b.id);
|
|
211
|
-
// return {
|
|
212
|
-
// ...b,
|
|
213
|
-
// ...nftData
|
|
214
|
-
// } as UserBillNftData;
|
|
215
|
-
// }),
|
|
216
|
-
// };
|
|
217
|
-
// });
|
|
218
|
-
// Combine userBillNftData with userOwnedBillsData
|
|
196
|
+
// Merge userBillNftData into userOwnedBillsData
|
|
219
197
|
];
|
|
220
198
|
case 2:
|
|
221
199
|
userBillNftData_1 = _a.sent();
|
|
222
|
-
combinedData =
|
|
223
|
-
var
|
|
224
|
-
|
|
200
|
+
combinedData = userOwnedBillsData_1.map(function (data) {
|
|
201
|
+
var enrichedUserBills = data.userOwnedBills.map(function (bill) {
|
|
202
|
+
var nftData = userBillNftData_1.find(function (nft) { return nft.id === parseInt(bill.id); });
|
|
203
|
+
return __assign(__assign({}, bill), (nftData ? { image: nftData.data.image, attributes: nftData.data.attributes } : {}));
|
|
204
|
+
});
|
|
205
|
+
return __assign(__assign({}, data), { userOwnedBills: enrichedUserBills });
|
|
225
206
|
});
|
|
226
207
|
console.log("userBillNftData");
|
|
227
208
|
console.log(userBillNftData_1);
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -47,63 +47,66 @@ export interface UserBillNft {
|
|
|
47
47
|
}[];
|
|
48
48
|
}
|
|
49
49
|
export interface UserBillNftData {
|
|
50
|
-
|
|
51
|
-
description: string;
|
|
52
|
-
tokenId: number;
|
|
53
|
-
image: string;
|
|
54
|
-
attributes: {
|
|
55
|
-
trait_type: string;
|
|
56
|
-
value: string;
|
|
57
|
-
}[];
|
|
50
|
+
id: number;
|
|
58
51
|
data: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
+
};
|
|
77
80
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
token0: {
|
|
82
|
+
address: string;
|
|
83
|
+
symbol: string;
|
|
84
|
+
name: string;
|
|
85
|
+
decimals: {
|
|
86
|
+
[chainId: number]: number;
|
|
87
|
+
};
|
|
85
88
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
token1: {
|
|
90
|
+
address: string;
|
|
91
|
+
symbol: string;
|
|
92
|
+
name: string;
|
|
93
|
+
decimals: {
|
|
94
|
+
[chainId: number]: number;
|
|
95
|
+
};
|
|
93
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;
|
|
94
106
|
};
|
|
95
|
-
|
|
107
|
+
contractAddress: string;
|
|
96
108
|
chainId: ChainId;
|
|
97
|
-
blockNumber: number;
|
|
98
|
-
bondArtCollection: string;
|
|
99
|
-
bondPartner: string;
|
|
100
|
-
bondVersion: string;
|
|
101
|
-
createdAddressOwner: string;
|
|
102
|
-
createdAt: number;
|
|
103
|
-
payoutTokenPrice: string;
|
|
104
109
|
};
|
|
105
|
-
contractAddress: string;
|
|
106
|
-
chainId: ChainId;
|
|
107
110
|
}
|
|
108
111
|
export interface UserBill {
|
|
109
112
|
address: string;
|