@ape.swap/bonds-sdk 1.0.356 → 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.
- package/dist/components/BondModal/BondModal.js +11 -20
- package/dist/components/YourBonds/YourBonds.js +61 -43
- package/dist/components/YourBonds/fetchBillsUser.d.ts +3 -3
- package/dist/components/YourBonds/fetchBillsUser.js +4 -4
- package/dist/config/abi/erc20.json +117 -0
- package/dist/config/abi/price-getter-linea.json +1448 -0
- package/dist/config/abi/price-getter.json +1309 -0
- package/dist/enum/abis.d.ts +80 -0
- package/dist/enum/abis.js +1 -0
- package/dist/hooks/PriceGetter/usePricesFromPriceGetter.d.ts +17 -0
- package/dist/hooks/PriceGetter/usePricesFromPriceGetter.js +205 -0
- package/dist/state/bills/cleanBillsData.d.ts +5 -0
- package/dist/state/bills/cleanBillsData.js +41 -0
- package/dist/state/bills/fetchBills.d.ts +4 -0
- package/dist/state/bills/fetchBills.js +61 -0
- package/dist/state/bills/fetchBillsCalls.d.ts +4 -0
- package/dist/state/bills/fetchBillsCalls.js +27 -0
- package/dist/state/bills/fetchBillsUser.d.ts +15 -0
- package/dist/state/bills/fetchBillsUser.js +171 -0
- package/dist/state/bills/getBillNftData.d.ts +9 -0
- package/dist/state/bills/getBillNftData.js +109 -0
- package/dist/state/bills/hooks.d.ts +4 -0
- package/dist/state/bills/hooks.js +142 -0
- package/dist/state/bills/index.d.ts +48 -0
- package/dist/state/bills/index.js +293 -0
- package/dist/state/bills/types.d.ts +168 -0
- package/dist/state/bills/types.js +1 -0
- package/dist/state/tokenPrices/fetchTokenPricesForMultipleChains.d.ts +4 -0
- package/dist/state/tokenPrices/fetchTokenPricesForMultipleChains.js +68 -0
- package/dist/state/tokenPrices/getAllTokenPrices.d.ts +5 -0
- package/dist/state/tokenPrices/getAllTokenPrices.js +288 -0
- package/dist/state/tokenPrices/useTokenPricesNew.d.ts +11 -0
- package/dist/state/tokenPrices/useTokenPricesNew.js +72 -0
- package/dist/types/dexFactories.d.ts +11 -0
- package/dist/types/dexFactories.js +2 -0
- package/dist/types/yourbonds.d.ts +68 -1
- package/package.json +1 -1
|
@@ -62,10 +62,9 @@ import { TooltipText } from '../../enum/tooltips';
|
|
|
62
62
|
import { formatNumberSI } from '../../utils/formatNumber';
|
|
63
63
|
import { ethers } from 'ethers';
|
|
64
64
|
import { adjustDecimals } from "../../utils/convertToTokenValue";
|
|
65
|
+
import { BondAbi } from '../../enum/abis';
|
|
65
66
|
import TokenImage from '../uikit-sdk/TokenImage';
|
|
66
67
|
import '../../scss/BondModal.scss';
|
|
67
|
-
import BOND_ABI from '../../config/abi/bond.json';
|
|
68
|
-
import ERC_20_ABI from '../../config/abi/bond.json';
|
|
69
68
|
var BondModal = function (_a) {
|
|
70
69
|
var isOpen = _a.isOpen, onClose = _a.onClose, bondAddress = _a.bondAddress;
|
|
71
70
|
if (!isOpen)
|
|
@@ -116,8 +115,6 @@ var BondModal = function (_a) {
|
|
|
116
115
|
setSelectedBond(bond);
|
|
117
116
|
navigate("/bondsingle/".concat(bond.billAddress));
|
|
118
117
|
};
|
|
119
|
-
//Note to Gordon: Can we put all this in a helper file or something so the code in here is less?
|
|
120
|
-
/////////////////////
|
|
121
118
|
function formatNumber(input) {
|
|
122
119
|
var number = new BigNumber(input);
|
|
123
120
|
if (number.isNaN())
|
|
@@ -169,9 +166,6 @@ var BondModal = function (_a) {
|
|
|
169
166
|
var getPremium = premium(bond);
|
|
170
167
|
return parseFloat(getPremium) < 0 ? 'premium-negative' : 'premium-positive';
|
|
171
168
|
};
|
|
172
|
-
////////////////////////////////////////////////////////////////////////////////////
|
|
173
|
-
////////////////////////////////////////////////////////////////////////////////////
|
|
174
|
-
////////////////////////////////////////////////////////////////////////////////////
|
|
175
169
|
var handleBuy = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
170
|
var provider, signer, bondContract, maxPrice, amount, tx, error_1;
|
|
177
171
|
return __generator(this, function (_a) {
|
|
@@ -185,7 +179,7 @@ var BondModal = function (_a) {
|
|
|
185
179
|
}
|
|
186
180
|
provider = new ethers.providers.Web3Provider(window.ethereum);
|
|
187
181
|
signer = provider.getSigner();
|
|
188
|
-
bondContract = new ethers.Contract(bondAddress !== null && bondAddress !== void 0 ? bondAddress : "",
|
|
182
|
+
bondContract = new ethers.Contract(bondAddress !== null && bondAddress !== void 0 ? bondAddress : "", BondAbi, signer);
|
|
189
183
|
_a.label = 1;
|
|
190
184
|
case 1:
|
|
191
185
|
_a.trys.push([1, 4, , 5]);
|
|
@@ -208,12 +202,10 @@ var BondModal = function (_a) {
|
|
|
208
202
|
}
|
|
209
203
|
});
|
|
210
204
|
}); };
|
|
211
|
-
//You approve the token, not the contract (this code will have to be updated for zap)
|
|
212
205
|
var handleApprove = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
213
206
|
var provider, signer, bondContract, amount, tx, error_2;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
switch (_b.label) {
|
|
207
|
+
return __generator(this, function (_a) {
|
|
208
|
+
switch (_a.label) {
|
|
217
209
|
case 0:
|
|
218
210
|
console.log('handle approve clicked');
|
|
219
211
|
if (!window.ethereum) {
|
|
@@ -221,25 +213,24 @@ var BondModal = function (_a) {
|
|
|
221
213
|
alert('No Ethereum provider found');
|
|
222
214
|
return [2 /*return*/];
|
|
223
215
|
}
|
|
224
|
-
console.log(selectedBond === null || selectedBond === void 0 ? void 0 : selectedBond.principalToken);
|
|
225
216
|
provider = new ethers.providers.Web3Provider(window.ethereum);
|
|
226
217
|
signer = provider.getSigner();
|
|
227
|
-
bondContract = new ethers.Contract(
|
|
228
|
-
|
|
218
|
+
bondContract = new ethers.Contract(bondAddress !== null && bondAddress !== void 0 ? bondAddress : "", BondAbi, signer);
|
|
219
|
+
_a.label = 1;
|
|
229
220
|
case 1:
|
|
230
|
-
|
|
221
|
+
_a.trys.push([1, 4, , 5]);
|
|
231
222
|
amount = adjustDecimals(inputValue);
|
|
232
|
-
return [4 /*yield*/, bondContract.approve(
|
|
223
|
+
return [4 /*yield*/, bondContract.approve(amount, account)];
|
|
233
224
|
case 2:
|
|
234
|
-
tx =
|
|
225
|
+
tx = _a.sent();
|
|
235
226
|
return [4 /*yield*/, tx.wait()];
|
|
236
227
|
case 3:
|
|
237
|
-
|
|
228
|
+
_a.sent();
|
|
238
229
|
setApprovalStatus(true);
|
|
239
230
|
alert('Approve Successful');
|
|
240
231
|
return [3 /*break*/, 5];
|
|
241
232
|
case 4:
|
|
242
|
-
error_2 =
|
|
233
|
+
error_2 = _a.sent();
|
|
243
234
|
console.error('Approval error', error_2);
|
|
244
235
|
alert('Approval Failed');
|
|
245
236
|
return [3 /*break*/, 5];
|
|
@@ -69,6 +69,7 @@ import { formatNumberSI } from '../../utils/formatNumber';
|
|
|
69
69
|
import useCurrentTime from '../../hooks/useTimer';
|
|
70
70
|
import { getPendingVesting } from '../../hooks/usePendingVesting';
|
|
71
71
|
import axios from 'axios';
|
|
72
|
+
import { fetchUserOwnedBillNftData } from './fetchBillsUser';
|
|
72
73
|
var YourBonds = function (_a) {
|
|
73
74
|
var connectionString = _a.connectionString;
|
|
74
75
|
var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
|
|
@@ -160,26 +161,16 @@ var YourBonds = function (_a) {
|
|
|
160
161
|
setIsModalOpen(true);
|
|
161
162
|
navigate("/YourBonds/?bondAddress=".concat(bond.billAddress, "&bondChain=").concat(bond.chainId), { replace: true });
|
|
162
163
|
};
|
|
163
|
-
// const usePollUserBills = () => {
|
|
164
|
-
// const { slowRefresh } = useRefresh()
|
|
165
|
-
// // const dispatch = useAppDispatch()
|
|
166
|
-
// const { account, isActive } = useWeb3React();
|
|
167
|
-
// useEffect(() => {
|
|
168
|
-
// if (account) {
|
|
169
|
-
// MAINNET_CHAINS.map((chain) => fetchUserOwnedBillsDataAsync(chain as number, account))
|
|
170
|
-
// }
|
|
171
|
-
// }, [account, slowRefresh])
|
|
172
|
-
// }
|
|
173
164
|
var currentTime = useCurrentTime() / 1000;
|
|
174
165
|
var vestingTimeRemaining = function (userBill) {
|
|
175
166
|
return getTimePeriods(parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime, true);
|
|
176
167
|
};
|
|
177
168
|
var fetchUserOwnedBillsDataAsync = function (chainId, account) { return __awaiter(void 0, void 0, void 0, function () {
|
|
178
|
-
var bonds, userOwnedBills_1, mapUserOwnedBills_1, userOwnedBillsData_1, error_2;
|
|
169
|
+
var bonds, userOwnedBills_1, mapUserOwnedBills_1, userOwnedBillsData_1, ownedBillsData, userBillNftData_1, combinedData, error_2;
|
|
179
170
|
return __generator(this, function (_a) {
|
|
180
171
|
switch (_a.label) {
|
|
181
172
|
case 0:
|
|
182
|
-
_a.trys.push([0,
|
|
173
|
+
_a.trys.push([0, 3, , 4]);
|
|
183
174
|
bonds = bondData.filter(function (bond) {
|
|
184
175
|
return bond.billVersion !== BillVersion.FixedPrice &&
|
|
185
176
|
(bond === null || bond === void 0 ? void 0 : bond.chainId) === chainId &&
|
|
@@ -196,41 +187,43 @@ var YourBonds = function (_a) {
|
|
|
196
187
|
index: bill.index,
|
|
197
188
|
userOwnedBills: mapUserOwnedBills_1[i],
|
|
198
189
|
}); });
|
|
199
|
-
|
|
190
|
+
ownedBillsData = mapUserOwnedBills_1.flatMap(function (bs) {
|
|
191
|
+
return bs.map(function (b) {
|
|
192
|
+
return { id: b.id, billNftAddress: b.billNftAddress, contractAddress: b.address };
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
return [4 /*yield*/, fetchUserOwnedBillNftData(ownedBillsData, chainId, bonds)
|
|
196
|
+
// Merge userBillNftData into userOwnedBillsData
|
|
197
|
+
];
|
|
200
198
|
case 2:
|
|
199
|
+
userBillNftData_1 = _a.sent();
|
|
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 ? { nftData: nftData } : {}));
|
|
204
|
+
});
|
|
205
|
+
return __assign(__assign({}, data), {
|
|
206
|
+
// userOwnedBills: enrichedUserBills
|
|
207
|
+
nftData: enrichedUserBills });
|
|
208
|
+
});
|
|
209
|
+
// console.log("userBillNftData");
|
|
210
|
+
// console.log(userBillNftData);
|
|
211
|
+
// console.log("userBillNftData");
|
|
212
|
+
// console.log("userOwnedBillsData");
|
|
213
|
+
// console.log(userOwnedBillsData);
|
|
214
|
+
// console.log("userOwnedBillsData");
|
|
215
|
+
console.log("combinedData");
|
|
216
|
+
console.log(combinedData);
|
|
217
|
+
console.log("combinedData");
|
|
218
|
+
return [2 /*return*/, Promise.resolve(combinedData)];
|
|
219
|
+
case 3:
|
|
201
220
|
error_2 = _a.sent();
|
|
202
221
|
console.error('Error fetching user owned bills data:', error_2);
|
|
203
222
|
return [2 /*return*/, Promise.reject(error_2)];
|
|
204
|
-
case
|
|
223
|
+
case 4: return [2 /*return*/];
|
|
205
224
|
}
|
|
206
225
|
});
|
|
207
226
|
}); };
|
|
208
|
-
var _g = useState([]), userOwnedBillsData = _g[0], setUserOwnedBillsData = _g[1];
|
|
209
|
-
useEffect(function () {
|
|
210
|
-
var fetchData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
211
|
-
var results, error_3;
|
|
212
|
-
return __generator(this, function (_a) {
|
|
213
|
-
switch (_a.label) {
|
|
214
|
-
case 0:
|
|
215
|
-
if (!account) return [3 /*break*/, 4];
|
|
216
|
-
_a.label = 1;
|
|
217
|
-
case 1:
|
|
218
|
-
_a.trys.push([1, 3, , 4]);
|
|
219
|
-
return [4 /*yield*/, Promise.all(MAINNET_CHAINS.map(function (chain) { return fetchUserOwnedBillsDataAsync(chain, account); }))];
|
|
220
|
-
case 2:
|
|
221
|
-
results = _a.sent();
|
|
222
|
-
setUserOwnedBillsData(results);
|
|
223
|
-
return [3 /*break*/, 4];
|
|
224
|
-
case 3:
|
|
225
|
-
error_3 = _a.sent();
|
|
226
|
-
console.error('Error fetching user owned bills data:', error_3);
|
|
227
|
-
return [3 /*break*/, 4];
|
|
228
|
-
case 4: return [2 /*return*/];
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}); };
|
|
232
|
-
fetchData();
|
|
233
|
-
}, [account]);
|
|
234
227
|
var fetchUserOwnedBills = function (chainId, account, bonds) { return __awaiter(void 0, void 0, void 0, function () {
|
|
235
228
|
var billIdCalls, billIds, billsPendingRewardCall, billDataCalls, billVersions, billData, pendingRewardsCall, result, i, billDataPos, data;
|
|
236
229
|
var _a, _b, _c, _d, _e;
|
|
@@ -307,6 +300,32 @@ var YourBonds = function (_a) {
|
|
|
307
300
|
}
|
|
308
301
|
});
|
|
309
302
|
}); };
|
|
303
|
+
var _g = useState([]), userOwnedBillsData = _g[0], setUserOwnedBillsData = _g[1];
|
|
304
|
+
useEffect(function () {
|
|
305
|
+
var fetchData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
306
|
+
var results, error_3;
|
|
307
|
+
return __generator(this, function (_a) {
|
|
308
|
+
switch (_a.label) {
|
|
309
|
+
case 0:
|
|
310
|
+
if (!account) return [3 /*break*/, 4];
|
|
311
|
+
_a.label = 1;
|
|
312
|
+
case 1:
|
|
313
|
+
_a.trys.push([1, 3, , 4]);
|
|
314
|
+
return [4 /*yield*/, Promise.all(MAINNET_CHAINS.map(function (chain) { return fetchUserOwnedBillsDataAsync(chain, account); }))];
|
|
315
|
+
case 2:
|
|
316
|
+
results = _a.sent();
|
|
317
|
+
setUserOwnedBillsData(results);
|
|
318
|
+
return [3 /*break*/, 4];
|
|
319
|
+
case 3:
|
|
320
|
+
error_3 = _a.sent();
|
|
321
|
+
console.error('Error fetching user owned bills data:', error_3);
|
|
322
|
+
return [3 /*break*/, 4];
|
|
323
|
+
case 4: return [2 /*return*/];
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}); };
|
|
327
|
+
fetchData();
|
|
328
|
+
}, [account]);
|
|
310
329
|
var chainId = useWeb3React().chainId;
|
|
311
330
|
var totalPending = function (userBill) {
|
|
312
331
|
var _a, _b, _c, _d;
|
|
@@ -334,10 +353,9 @@ var YourBonds = function (_a) {
|
|
|
334
353
|
}
|
|
335
354
|
return totalPending(b) - totalPending(a);
|
|
336
355
|
});
|
|
337
|
-
console.log(sortedBills);
|
|
338
356
|
return sortedBills.map(function (bill) {
|
|
339
|
-
var _a, _b;
|
|
340
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill.bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children:
|
|
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: {
|
|
341
359
|
height: ['36px', '36px', '36px', '26px'],
|
|
342
360
|
lineHeight: '12px',
|
|
343
361
|
fontSize: '14px',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { BondsDataResponse, CleanedBondsState, UserBill } from '../../types/bonds';
|
|
2
|
+
import { ChainId } from '../../enum/apeswaplists';
|
|
3
3
|
/**
|
|
4
4
|
* Fetches user-owned bill NFT data for a given set of owned bills data, chain ID, and bills.
|
|
5
5
|
* @param ownedBillsData An array of objects containing the ID, bill NFT address, and contract address of the owned bills.
|
|
@@ -11,5 +11,5 @@ export declare const fetchUserOwnedBillNftData: (ownedBillsData: {
|
|
|
11
11
|
id: string;
|
|
12
12
|
billNftAddress: string;
|
|
13
13
|
contractAddress: string;
|
|
14
|
-
}[], chainId: ChainId, bills:
|
|
14
|
+
}[], chainId: ChainId, bills: BondsDataResponse[]) => Promise<any[]>;
|
|
15
15
|
export declare const fetchUserOwnedBills: (chainId: ChainId, account: string, bills: CleanedBondsState[]) => Promise<UserBill[]>;
|
|
@@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
import billAbi from '../../config/abi/bond.json';
|
|
38
38
|
import BigNumber from 'bignumber.js';
|
|
39
39
|
import { getBillNftBatchData } from './getBillNftData';
|
|
40
|
-
import { BillVersion } from '@ape.swap/apeswap-lists';
|
|
41
40
|
import multicall from '../../utils/multicall';
|
|
41
|
+
import { BillVersion } from '../../enum/apeswaplists';
|
|
42
42
|
/**
|
|
43
43
|
* Fetches user-owned bill NFT data for a given set of owned bills data, chain ID, and bills.
|
|
44
44
|
* @param ownedBillsData An array of objects containing the ID, bill NFT address, and contract address of the owned bills.
|
|
@@ -55,10 +55,10 @@ export var fetchUserOwnedBillNftData = function (ownedBillsData, chainId, bills)
|
|
|
55
55
|
billsFetched = [];
|
|
56
56
|
// Loop through each owned bill and check if it exists in the bills array
|
|
57
57
|
ownedBillsData === null || ownedBillsData === void 0 ? void 0 : ownedBillsData.forEach(function (_a) {
|
|
58
|
-
var _b, _c;
|
|
59
58
|
var id = _a.id, billNftAddress = _a.billNftAddress, contractAddress = _a.contractAddress;
|
|
60
|
-
var bill =
|
|
61
|
-
.find(function (b) { return b.
|
|
59
|
+
var bill = bills
|
|
60
|
+
.find(function (b) { return b.billAddress[chainId] === contractAddress; });
|
|
61
|
+
// ?.userOwnedBillsNftData?.find((u) => +u.tokenId === +id)
|
|
62
62
|
// If the bill exists in the bills array, add it to the billsFetched array
|
|
63
63
|
if (bill) {
|
|
64
64
|
billsFetched.push({ id: id, data: bill });
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"constant": true,
|
|
4
|
+
"inputs": [],
|
|
5
|
+
"name": "name",
|
|
6
|
+
"outputs": [{ "name": "", "type": "string" }],
|
|
7
|
+
"payable": false,
|
|
8
|
+
"stateMutability": "view",
|
|
9
|
+
"type": "function"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"constant": false,
|
|
13
|
+
"inputs": [
|
|
14
|
+
{ "name": "_spender", "type": "address" },
|
|
15
|
+
{ "name": "_value", "type": "uint256" }
|
|
16
|
+
],
|
|
17
|
+
"name": "approve",
|
|
18
|
+
"outputs": [{ "name": "", "type": "bool" }],
|
|
19
|
+
"payable": false,
|
|
20
|
+
"stateMutability": "nonpayable",
|
|
21
|
+
"type": "function"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"constant": true,
|
|
25
|
+
"inputs": [],
|
|
26
|
+
"name": "totalSupply",
|
|
27
|
+
"outputs": [{ "name": "", "type": "uint256" }],
|
|
28
|
+
"payable": false,
|
|
29
|
+
"stateMutability": "view",
|
|
30
|
+
"type": "function"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"constant": false,
|
|
34
|
+
"inputs": [
|
|
35
|
+
{ "name": "_from", "type": "address" },
|
|
36
|
+
{ "name": "_to", "type": "address" },
|
|
37
|
+
{ "name": "_value", "type": "uint256" }
|
|
38
|
+
],
|
|
39
|
+
"name": "transferFrom",
|
|
40
|
+
"outputs": [{ "name": "", "type": "bool" }],
|
|
41
|
+
"payable": false,
|
|
42
|
+
"stateMutability": "nonpayable",
|
|
43
|
+
"type": "function"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"constant": true,
|
|
47
|
+
"inputs": [],
|
|
48
|
+
"name": "decimals",
|
|
49
|
+
"outputs": [{ "name": "", "type": "uint8" }],
|
|
50
|
+
"payable": false,
|
|
51
|
+
"stateMutability": "view",
|
|
52
|
+
"type": "function"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"constant": true,
|
|
56
|
+
"inputs": [{ "name": "_owner", "type": "address" }],
|
|
57
|
+
"name": "balanceOf",
|
|
58
|
+
"outputs": [{ "name": "balance", "type": "uint256" }],
|
|
59
|
+
"payable": false,
|
|
60
|
+
"stateMutability": "view",
|
|
61
|
+
"type": "function"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"constant": true,
|
|
65
|
+
"inputs": [],
|
|
66
|
+
"name": "symbol",
|
|
67
|
+
"outputs": [{ "name": "", "type": "string" }],
|
|
68
|
+
"payable": false,
|
|
69
|
+
"stateMutability": "view",
|
|
70
|
+
"type": "function"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"constant": false,
|
|
74
|
+
"inputs": [
|
|
75
|
+
{ "name": "_to", "type": "address" },
|
|
76
|
+
{ "name": "_value", "type": "uint256" }
|
|
77
|
+
],
|
|
78
|
+
"name": "transfer",
|
|
79
|
+
"outputs": [{ "name": "", "type": "bool" }],
|
|
80
|
+
"payable": false,
|
|
81
|
+
"stateMutability": "nonpayable",
|
|
82
|
+
"type": "function"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"constant": true,
|
|
86
|
+
"inputs": [
|
|
87
|
+
{ "name": "_owner", "type": "address" },
|
|
88
|
+
{ "name": "_spender", "type": "address" }
|
|
89
|
+
],
|
|
90
|
+
"name": "allowance",
|
|
91
|
+
"outputs": [{ "name": "", "type": "uint256" }],
|
|
92
|
+
"payable": false,
|
|
93
|
+
"stateMutability": "view",
|
|
94
|
+
"type": "function"
|
|
95
|
+
},
|
|
96
|
+
{ "payable": true, "stateMutability": "payable", "type": "fallback" },
|
|
97
|
+
{
|
|
98
|
+
"anonymous": false,
|
|
99
|
+
"inputs": [
|
|
100
|
+
{ "indexed": true, "name": "owner", "type": "address" },
|
|
101
|
+
{ "indexed": true, "name": "spender", "type": "address" },
|
|
102
|
+
{ "indexed": false, "name": "value", "type": "uint256" }
|
|
103
|
+
],
|
|
104
|
+
"name": "Approval",
|
|
105
|
+
"type": "event"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"anonymous": false,
|
|
109
|
+
"inputs": [
|
|
110
|
+
{ "indexed": true, "name": "from", "type": "address" },
|
|
111
|
+
{ "indexed": true, "name": "to", "type": "address" },
|
|
112
|
+
{ "indexed": false, "name": "value", "type": "uint256" }
|
|
113
|
+
],
|
|
114
|
+
"name": "Transfer",
|
|
115
|
+
"type": "event"
|
|
116
|
+
}
|
|
117
|
+
]
|