@ape.swap/bonds-sdk 1.0.473 → 1.0.475
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/config/abi/bondNft.json +424 -0
- package/dist/config/abi/ens-public-resolver.json +816 -0
- package/dist/config/abi/ens-registrar.json +422 -0
- package/dist/config/abi/erc20_bytes32.json +30 -0
- package/dist/config/abi/jungleChef.json +291 -0
- package/dist/config/abi/launchBonds.json +2014 -0
- package/dist/config/abi/lockVeAbond.json +2198 -0
- package/dist/config/abi/migrationBond.json +1639 -0
- package/dist/config/abi/migrationFveAbond.json +160 -0
- package/dist/config/abi/multicallv3.json +92 -0
- package/dist/config/abi/sousChef.json +649 -0
- package/dist/config/abi/types/Banana.d.ts +417 -0
- package/dist/config/abi/types/Banana.js +1 -0
- package/dist/config/abi/types/Bond.d.ts +803 -0
- package/dist/config/abi/types/Bond.js +1 -0
- package/dist/config/abi/types/BondNft.d.ts +603 -0
- package/dist/config/abi/types/BondNft.js +1 -0
- package/dist/config/abi/types/EnsPublicResolver.d.ts +513 -0
- package/dist/config/abi/types/EnsPublicResolver.js +1 -0
- package/dist/config/abi/types/EnsRegistrar.d.ts +274 -0
- package/dist/config/abi/types/EnsRegistrar.js +1 -0
- package/dist/config/abi/types/Erc20.d.ts +168 -0
- package/dist/config/abi/types/Erc20.js +1 -0
- package/dist/config/abi/types/Erc20_bytes32.d.ts +50 -0
- package/dist/config/abi/types/Erc20_bytes32.js +1 -0
- package/dist/config/abi/types/JungleChef.d.ts +260 -0
- package/dist/config/abi/types/JungleChef.js +1 -0
- package/dist/config/abi/types/LaunchBonds.d.ts +1362 -0
- package/dist/config/abi/types/LaunchBonds.js +1 -0
- package/dist/config/abi/types/LensContract.d.ts +295 -0
- package/dist/config/abi/types/LensContract.js +1 -0
- package/dist/config/abi/types/LockVeAbond.d.ts +1279 -0
- package/dist/config/abi/types/LockVeAbond.js +1 -0
- package/dist/config/abi/types/MigrationBond.d.ts +1136 -0
- package/dist/config/abi/types/MigrationBond.js +1 -0
- package/dist/config/abi/types/MigrationFveAbond.d.ts +290 -0
- package/dist/config/abi/types/MigrationFveAbond.js +1 -0
- package/dist/config/abi/types/MiniComplexRewarder.d.ts +469 -0
- package/dist/config/abi/types/MiniComplexRewarder.js +1 -0
- package/dist/config/abi/types/Multicallv2.d.ts +150 -0
- package/dist/config/abi/types/Multicallv2.js +1 -0
- package/dist/config/abi/types/Multicallv3.d.ts +98 -0
- package/dist/config/abi/types/Multicallv3.js +1 -0
- package/dist/config/abi/types/NonFungibleApes.d.ts +532 -0
- package/dist/config/abi/types/NonFungibleApes.js +1 -0
- package/dist/config/abi/types/NonFungibleBananas.d.ts +505 -0
- package/dist/config/abi/types/NonFungibleBananas.js +1 -0
- package/dist/config/abi/types/PriceGetter.d.ts +713 -0
- package/dist/config/abi/types/PriceGetter.js +1 -0
- package/dist/config/abi/types/PriceGetterLinea.d.ts +789 -0
- package/dist/config/abi/types/PriceGetterLinea.js +1 -0
- package/dist/config/abi/types/PriceGetterV2.d.ts +729 -0
- package/dist/config/abi/types/PriceGetterV2.js +1 -0
- package/dist/config/abi/types/SousChef.d.ts +579 -0
- package/dist/config/abi/types/SousChef.js +1 -0
- package/dist/config/abi/types/Treasury.d.ts +277 -0
- package/dist/config/abi/types/Treasury.js +1 -0
- package/dist/config/abi/types/Weth.d.ts +221 -0
- package/dist/config/abi/types/Weth.js +1 -0
- package/dist/config/abi/types/Zap.d.ts +528 -0
- package/dist/config/abi/types/Zap.js +1 -0
- package/dist/config/abi/types/common.d.ts +22 -0
- package/dist/config/abi/types/common.js +1 -0
- package/dist/config/abi/types/factories/Banana__factory.d.ts +475 -0
- package/dist/config/abi/types/factories/Banana__factory.js +628 -0
- package/dist/config/abi/types/factories/BondNft__factory.d.ts +723 -0
- package/dist/config/abi/types/factories/BondNft__factory.js +951 -0
- package/dist/config/abi/types/factories/Bond__factory.d.ts +799 -0
- package/dist/config/abi/types/factories/Bond__factory.js +1042 -0
- package/dist/config/abi/types/factories/EnsPublicResolver__factory.d.ts +649 -0
- package/dist/config/abi/types/factories/EnsPublicResolver__factory.js +833 -0
- package/dist/config/abi/types/factories/EnsRegistrar__factory.d.ts +338 -0
- package/dist/config/abi/types/factories/EnsRegistrar__factory.js +439 -0
- package/dist/config/abi/types/factories/Erc20__factory.d.ts +175 -0
- package/dist/config/abi/types/factories/Erc20__factory.js +239 -0
- package/dist/config/abi/types/factories/Erc20_bytes32__factory.d.ts +30 -0
- package/dist/config/abi/types/factories/Erc20_bytes32__factory.js +47 -0
- package/dist/config/abi/types/factories/JungleChef__factory.d.ts +247 -0
- package/dist/config/abi/types/factories/JungleChef__factory.js +326 -0
- package/dist/config/abi/types/factories/LaunchBonds__factory.d.ts +1560 -0
- package/dist/config/abi/types/factories/LaunchBonds__factory.js +2031 -0
- package/dist/config/abi/types/factories/LensContract__factory.d.ts +254 -0
- package/dist/config/abi/types/factories/LensContract__factory.js +338 -0
- package/dist/config/abi/types/factories/LockVeAbond__factory.d.ts +1698 -0
- package/dist/config/abi/types/factories/LockVeAbond__factory.js +2215 -0
- package/dist/config/abi/types/factories/MigrationBond__factory.d.ts +1268 -0
- package/dist/config/abi/types/factories/MigrationBond__factory.js +1656 -0
- package/dist/config/abi/types/factories/MigrationFveAbond__factory.d.ts +262 -0
- package/dist/config/abi/types/factories/MigrationFveAbond__factory.js +346 -0
- package/dist/config/abi/types/factories/MiniComplexRewarder__factory.d.ts +448 -0
- package/dist/config/abi/types/factories/MiniComplexRewarder__factory.js +586 -0
- package/dist/config/abi/types/factories/Multicallv2__factory.d.ts +115 -0
- package/dist/config/abi/types/factories/Multicallv2__factory.js +160 -0
- package/dist/config/abi/types/factories/Multicallv3__factory.d.ts +76 -0
- package/dist/config/abi/types/factories/Multicallv3__factory.js +109 -0
- package/dist/config/abi/types/factories/NonFungibleApes__factory.d.ts +617 -0
- package/dist/config/abi/types/factories/NonFungibleApes__factory.js +810 -0
- package/dist/config/abi/types/factories/NonFungibleBananas__factory.d.ts +576 -0
- package/dist/config/abi/types/factories/NonFungibleBananas__factory.js +756 -0
- package/dist/config/abi/types/factories/PriceGetterLinea__factory.d.ts +1105 -0
- package/dist/config/abi/types/factories/PriceGetterLinea__factory.js +1465 -0
- package/dist/config/abi/types/factories/PriceGetterV2__factory.d.ts +1027 -0
- package/dist/config/abi/types/factories/PriceGetterV2__factory.js +1364 -0
- package/dist/config/abi/types/factories/PriceGetter__factory.d.ts +999 -0
- package/dist/config/abi/types/factories/PriceGetter__factory.js +1326 -0
- package/dist/config/abi/types/factories/SousChef__factory.d.ts +511 -0
- package/dist/config/abi/types/factories/SousChef__factory.js +666 -0
- package/dist/config/abi/types/factories/Treasury__factory.d.ts +235 -0
- package/dist/config/abi/types/factories/Treasury__factory.js +309 -0
- package/dist/config/abi/types/factories/Weth__factory.d.ts +220 -0
- package/dist/config/abi/types/factories/Weth__factory.js +296 -0
- package/dist/config/abi/types/factories/Zap__factory.d.ts +695 -0
- package/dist/config/abi/types/factories/Zap__factory.js +889 -0
- package/dist/config/abi/types/factories/index.d.ts +25 -0
- package/dist/config/abi/types/factories/index.js +28 -0
- package/dist/config/abi/types/index.d.ts +51 -0
- package/dist/config/abi/types/index.js +26 -0
- package/dist/config/abi/weth.json +279 -0
- package/dist/hooks/useClaimBill.d.ts +4 -0
- package/dist/hooks/useClaimBill.js +59 -0
- package/dist/hooks/useContract.d.ts +25 -0
- package/dist/hooks/useContract.js +107 -0
- package/dist/pages/YourBonds/YourBonds.js +37 -10
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.js +127 -0
- package/dist/utils/track.d.ts +7 -0
- package/dist/utils/track.js +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { Banana__factory } from "./Banana__factory";
|
|
2
|
+
export { Bond__factory } from "./Bond__factory";
|
|
3
|
+
export { BondNft__factory } from "./BondNft__factory";
|
|
4
|
+
export { EnsPublicResolver__factory } from "./EnsPublicResolver__factory";
|
|
5
|
+
export { EnsRegistrar__factory } from "./EnsRegistrar__factory";
|
|
6
|
+
export { Erc20__factory } from "./Erc20__factory";
|
|
7
|
+
export { Erc20_bytes32__factory } from "./Erc20_bytes32__factory";
|
|
8
|
+
export { JungleChef__factory } from "./JungleChef__factory";
|
|
9
|
+
export { LaunchBonds__factory } from "./LaunchBonds__factory";
|
|
10
|
+
export { LensContract__factory } from "./LensContract__factory";
|
|
11
|
+
export { LockVeAbond__factory } from "./LockVeAbond__factory";
|
|
12
|
+
export { MigrationBond__factory } from "./MigrationBond__factory";
|
|
13
|
+
export { MigrationFveAbond__factory } from "./MigrationFveAbond__factory";
|
|
14
|
+
export { MiniComplexRewarder__factory } from "./MiniComplexRewarder__factory";
|
|
15
|
+
export { Multicallv2__factory } from "./Multicallv2__factory";
|
|
16
|
+
export { Multicallv3__factory } from "./Multicallv3__factory";
|
|
17
|
+
export { NonFungibleApes__factory } from "./NonFungibleApes__factory";
|
|
18
|
+
export { NonFungibleBananas__factory } from "./NonFungibleBananas__factory";
|
|
19
|
+
export { PriceGetter__factory } from "./PriceGetter__factory";
|
|
20
|
+
export { PriceGetterLinea__factory } from "./PriceGetterLinea__factory";
|
|
21
|
+
export { PriceGetterV2__factory } from "./PriceGetterV2__factory";
|
|
22
|
+
export { SousChef__factory } from "./SousChef__factory";
|
|
23
|
+
export { Treasury__factory } from "./Treasury__factory";
|
|
24
|
+
export { Weth__factory } from "./Weth__factory";
|
|
25
|
+
export { Zap__factory } from "./Zap__factory";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
export { Banana__factory } from "./Banana__factory";
|
|
5
|
+
export { Bond__factory } from "./Bond__factory";
|
|
6
|
+
export { BondNft__factory } from "./BondNft__factory";
|
|
7
|
+
export { EnsPublicResolver__factory } from "./EnsPublicResolver__factory";
|
|
8
|
+
export { EnsRegistrar__factory } from "./EnsRegistrar__factory";
|
|
9
|
+
export { Erc20__factory } from "./Erc20__factory";
|
|
10
|
+
export { Erc20_bytes32__factory } from "./Erc20_bytes32__factory";
|
|
11
|
+
export { JungleChef__factory } from "./JungleChef__factory";
|
|
12
|
+
export { LaunchBonds__factory } from "./LaunchBonds__factory";
|
|
13
|
+
export { LensContract__factory } from "./LensContract__factory";
|
|
14
|
+
export { LockVeAbond__factory } from "./LockVeAbond__factory";
|
|
15
|
+
export { MigrationBond__factory } from "./MigrationBond__factory";
|
|
16
|
+
export { MigrationFveAbond__factory } from "./MigrationFveAbond__factory";
|
|
17
|
+
export { MiniComplexRewarder__factory } from "./MiniComplexRewarder__factory";
|
|
18
|
+
export { Multicallv2__factory } from "./Multicallv2__factory";
|
|
19
|
+
export { Multicallv3__factory } from "./Multicallv3__factory";
|
|
20
|
+
export { NonFungibleApes__factory } from "./NonFungibleApes__factory";
|
|
21
|
+
export { NonFungibleBananas__factory } from "./NonFungibleBananas__factory";
|
|
22
|
+
export { PriceGetter__factory } from "./PriceGetter__factory";
|
|
23
|
+
export { PriceGetterLinea__factory } from "./PriceGetterLinea__factory";
|
|
24
|
+
export { PriceGetterV2__factory } from "./PriceGetterV2__factory";
|
|
25
|
+
export { SousChef__factory } from "./SousChef__factory";
|
|
26
|
+
export { Treasury__factory } from "./Treasury__factory";
|
|
27
|
+
export { Weth__factory } from "./Weth__factory";
|
|
28
|
+
export { Zap__factory } from "./Zap__factory";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type { Banana } from "./Banana";
|
|
2
|
+
export type { Bond } from "./Bond";
|
|
3
|
+
export type { BondNft } from "./BondNft";
|
|
4
|
+
export type { EnsPublicResolver } from "./EnsPublicResolver";
|
|
5
|
+
export type { EnsRegistrar } from "./EnsRegistrar";
|
|
6
|
+
export type { Erc20 } from "./Erc20";
|
|
7
|
+
export type { Erc20_bytes32 } from "./Erc20_bytes32";
|
|
8
|
+
export type { JungleChef } from "./JungleChef";
|
|
9
|
+
export type { LaunchBonds } from "./LaunchBonds";
|
|
10
|
+
export type { LensContract } from "./LensContract";
|
|
11
|
+
export type { LockVeAbond } from "./LockVeAbond";
|
|
12
|
+
export type { MigrationBond } from "./MigrationBond";
|
|
13
|
+
export type { MigrationFveAbond } from "./MigrationFveAbond";
|
|
14
|
+
export type { MiniComplexRewarder } from "./MiniComplexRewarder";
|
|
15
|
+
export type { Multicallv2 } from "./Multicallv2";
|
|
16
|
+
export type { Multicallv3 } from "./Multicallv3";
|
|
17
|
+
export type { NonFungibleApes } from "./NonFungibleApes";
|
|
18
|
+
export type { NonFungibleBananas } from "./NonFungibleBananas";
|
|
19
|
+
export type { PriceGetter } from "./PriceGetter";
|
|
20
|
+
export type { PriceGetterLinea } from "./PriceGetterLinea";
|
|
21
|
+
export type { PriceGetterV2 } from "./PriceGetterV2";
|
|
22
|
+
export type { SousChef } from "./SousChef";
|
|
23
|
+
export type { Treasury } from "./Treasury";
|
|
24
|
+
export type { Weth } from "./Weth";
|
|
25
|
+
export type { Zap } from "./Zap";
|
|
26
|
+
export * as factories from "./factories";
|
|
27
|
+
export { Banana__factory } from "./factories/Banana__factory";
|
|
28
|
+
export { Bond__factory } from "./factories/Bond__factory";
|
|
29
|
+
export { BondNft__factory } from "./factories/BondNft__factory";
|
|
30
|
+
export { EnsPublicResolver__factory } from "./factories/EnsPublicResolver__factory";
|
|
31
|
+
export { EnsRegistrar__factory } from "./factories/EnsRegistrar__factory";
|
|
32
|
+
export { Erc20_bytes32__factory } from "./factories/Erc20_bytes32__factory";
|
|
33
|
+
export { Erc20__factory } from "./factories/Erc20__factory";
|
|
34
|
+
export { JungleChef__factory } from "./factories/JungleChef__factory";
|
|
35
|
+
export { LaunchBonds__factory } from "./factories/LaunchBonds__factory";
|
|
36
|
+
export { LensContract__factory } from "./factories/LensContract__factory";
|
|
37
|
+
export { LockVeAbond__factory } from "./factories/LockVeAbond__factory";
|
|
38
|
+
export { MigrationBond__factory } from "./factories/MigrationBond__factory";
|
|
39
|
+
export { MigrationFveAbond__factory } from "./factories/MigrationFveAbond__factory";
|
|
40
|
+
export { MiniComplexRewarder__factory } from "./factories/MiniComplexRewarder__factory";
|
|
41
|
+
export { Multicallv2__factory } from "./factories/Multicallv2__factory";
|
|
42
|
+
export { Multicallv3__factory } from "./factories/Multicallv3__factory";
|
|
43
|
+
export { NonFungibleApes__factory } from "./factories/NonFungibleApes__factory";
|
|
44
|
+
export { NonFungibleBananas__factory } from "./factories/NonFungibleBananas__factory";
|
|
45
|
+
export { PriceGetterLinea__factory } from "./factories/PriceGetterLinea__factory";
|
|
46
|
+
export { PriceGetterV2__factory } from "./factories/PriceGetterV2__factory";
|
|
47
|
+
export { PriceGetter__factory } from "./factories/PriceGetter__factory";
|
|
48
|
+
export { SousChef__factory } from "./factories/SousChef__factory";
|
|
49
|
+
export { Treasury__factory } from "./factories/Treasury__factory";
|
|
50
|
+
export { Weth__factory } from "./factories/Weth__factory";
|
|
51
|
+
export { Zap__factory } from "./factories/Zap__factory";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * as factories from "./factories";
|
|
2
|
+
export { Banana__factory } from "./factories/Banana__factory";
|
|
3
|
+
export { Bond__factory } from "./factories/Bond__factory";
|
|
4
|
+
export { BondNft__factory } from "./factories/BondNft__factory";
|
|
5
|
+
export { EnsPublicResolver__factory } from "./factories/EnsPublicResolver__factory";
|
|
6
|
+
export { EnsRegistrar__factory } from "./factories/EnsRegistrar__factory";
|
|
7
|
+
export { Erc20_bytes32__factory } from "./factories/Erc20_bytes32__factory";
|
|
8
|
+
export { Erc20__factory } from "./factories/Erc20__factory";
|
|
9
|
+
export { JungleChef__factory } from "./factories/JungleChef__factory";
|
|
10
|
+
export { LaunchBonds__factory } from "./factories/LaunchBonds__factory";
|
|
11
|
+
export { LensContract__factory } from "./factories/LensContract__factory";
|
|
12
|
+
export { LockVeAbond__factory } from "./factories/LockVeAbond__factory";
|
|
13
|
+
export { MigrationBond__factory } from "./factories/MigrationBond__factory";
|
|
14
|
+
export { MigrationFveAbond__factory } from "./factories/MigrationFveAbond__factory";
|
|
15
|
+
export { MiniComplexRewarder__factory } from "./factories/MiniComplexRewarder__factory";
|
|
16
|
+
export { Multicallv2__factory } from "./factories/Multicallv2__factory";
|
|
17
|
+
export { Multicallv3__factory } from "./factories/Multicallv3__factory";
|
|
18
|
+
export { NonFungibleApes__factory } from "./factories/NonFungibleApes__factory";
|
|
19
|
+
export { NonFungibleBananas__factory } from "./factories/NonFungibleBananas__factory";
|
|
20
|
+
export { PriceGetterLinea__factory } from "./factories/PriceGetterLinea__factory";
|
|
21
|
+
export { PriceGetterV2__factory } from "./factories/PriceGetterV2__factory";
|
|
22
|
+
export { PriceGetter__factory } from "./factories/PriceGetter__factory";
|
|
23
|
+
export { SousChef__factory } from "./factories/SousChef__factory";
|
|
24
|
+
export { Treasury__factory } from "./factories/Treasury__factory";
|
|
25
|
+
export { Weth__factory } from "./factories/Weth__factory";
|
|
26
|
+
export { Zap__factory } from "./factories/Zap__factory";
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"constant": true,
|
|
4
|
+
"inputs": [],
|
|
5
|
+
"name": "name",
|
|
6
|
+
"outputs": [
|
|
7
|
+
{
|
|
8
|
+
"name": "",
|
|
9
|
+
"type": "string"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"payable": false,
|
|
13
|
+
"stateMutability": "view",
|
|
14
|
+
"type": "function"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"constant": false,
|
|
18
|
+
"inputs": [
|
|
19
|
+
{
|
|
20
|
+
"name": "guy",
|
|
21
|
+
"type": "address"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "wad",
|
|
25
|
+
"type": "uint256"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"name": "approve",
|
|
29
|
+
"outputs": [
|
|
30
|
+
{
|
|
31
|
+
"name": "",
|
|
32
|
+
"type": "bool"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"payable": false,
|
|
36
|
+
"stateMutability": "nonpayable",
|
|
37
|
+
"type": "function"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"constant": true,
|
|
41
|
+
"inputs": [],
|
|
42
|
+
"name": "totalSupply",
|
|
43
|
+
"outputs": [
|
|
44
|
+
{
|
|
45
|
+
"name": "",
|
|
46
|
+
"type": "uint256"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"payable": false,
|
|
50
|
+
"stateMutability": "view",
|
|
51
|
+
"type": "function"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"constant": false,
|
|
55
|
+
"inputs": [
|
|
56
|
+
{
|
|
57
|
+
"name": "src",
|
|
58
|
+
"type": "address"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "dst",
|
|
62
|
+
"type": "address"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "wad",
|
|
66
|
+
"type": "uint256"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"name": "transferFrom",
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"name": "",
|
|
73
|
+
"type": "bool"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"payable": false,
|
|
77
|
+
"stateMutability": "nonpayable",
|
|
78
|
+
"type": "function"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"constant": false,
|
|
82
|
+
"inputs": [
|
|
83
|
+
{
|
|
84
|
+
"name": "wad",
|
|
85
|
+
"type": "uint256"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"name": "withdraw",
|
|
89
|
+
"outputs": [],
|
|
90
|
+
"payable": false,
|
|
91
|
+
"stateMutability": "nonpayable",
|
|
92
|
+
"type": "function"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"constant": true,
|
|
96
|
+
"inputs": [],
|
|
97
|
+
"name": "decimals",
|
|
98
|
+
"outputs": [
|
|
99
|
+
{
|
|
100
|
+
"name": "",
|
|
101
|
+
"type": "uint8"
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"payable": false,
|
|
105
|
+
"stateMutability": "view",
|
|
106
|
+
"type": "function"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"constant": true,
|
|
110
|
+
"inputs": [
|
|
111
|
+
{
|
|
112
|
+
"name": "",
|
|
113
|
+
"type": "address"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"name": "balanceOf",
|
|
117
|
+
"outputs": [
|
|
118
|
+
{
|
|
119
|
+
"name": "",
|
|
120
|
+
"type": "uint256"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"payable": false,
|
|
124
|
+
"stateMutability": "view",
|
|
125
|
+
"type": "function"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"constant": true,
|
|
129
|
+
"inputs": [],
|
|
130
|
+
"name": "symbol",
|
|
131
|
+
"outputs": [
|
|
132
|
+
{
|
|
133
|
+
"name": "",
|
|
134
|
+
"type": "string"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"payable": false,
|
|
138
|
+
"stateMutability": "view",
|
|
139
|
+
"type": "function"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"constant": false,
|
|
143
|
+
"inputs": [
|
|
144
|
+
{
|
|
145
|
+
"name": "dst",
|
|
146
|
+
"type": "address"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "wad",
|
|
150
|
+
"type": "uint256"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"name": "transfer",
|
|
154
|
+
"outputs": [
|
|
155
|
+
{
|
|
156
|
+
"name": "",
|
|
157
|
+
"type": "bool"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"payable": false,
|
|
161
|
+
"stateMutability": "nonpayable",
|
|
162
|
+
"type": "function"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"constant": false,
|
|
166
|
+
"inputs": [],
|
|
167
|
+
"name": "deposit",
|
|
168
|
+
"outputs": [],
|
|
169
|
+
"payable": true,
|
|
170
|
+
"stateMutability": "payable",
|
|
171
|
+
"type": "function"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"constant": true,
|
|
175
|
+
"inputs": [
|
|
176
|
+
{
|
|
177
|
+
"name": "",
|
|
178
|
+
"type": "address"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "",
|
|
182
|
+
"type": "address"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"name": "allowance",
|
|
186
|
+
"outputs": [
|
|
187
|
+
{
|
|
188
|
+
"name": "",
|
|
189
|
+
"type": "uint256"
|
|
190
|
+
}
|
|
191
|
+
],
|
|
192
|
+
"payable": false,
|
|
193
|
+
"stateMutability": "view",
|
|
194
|
+
"type": "function"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"payable": true,
|
|
198
|
+
"stateMutability": "payable",
|
|
199
|
+
"type": "fallback"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"anonymous": false,
|
|
203
|
+
"inputs": [
|
|
204
|
+
{
|
|
205
|
+
"indexed": true,
|
|
206
|
+
"name": "src",
|
|
207
|
+
"type": "address"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"indexed": true,
|
|
211
|
+
"name": "guy",
|
|
212
|
+
"type": "address"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"indexed": false,
|
|
216
|
+
"name": "wad",
|
|
217
|
+
"type": "uint256"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"name": "Approval",
|
|
221
|
+
"type": "event"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"anonymous": false,
|
|
225
|
+
"inputs": [
|
|
226
|
+
{
|
|
227
|
+
"indexed": true,
|
|
228
|
+
"name": "src",
|
|
229
|
+
"type": "address"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"indexed": true,
|
|
233
|
+
"name": "dst",
|
|
234
|
+
"type": "address"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"indexed": false,
|
|
238
|
+
"name": "wad",
|
|
239
|
+
"type": "uint256"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"name": "Transfer",
|
|
243
|
+
"type": "event"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"anonymous": false,
|
|
247
|
+
"inputs": [
|
|
248
|
+
{
|
|
249
|
+
"indexed": true,
|
|
250
|
+
"name": "dst",
|
|
251
|
+
"type": "address"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"indexed": false,
|
|
255
|
+
"name": "wad",
|
|
256
|
+
"type": "uint256"
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"name": "Deposit",
|
|
260
|
+
"type": "event"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"anonymous": false,
|
|
264
|
+
"inputs": [
|
|
265
|
+
{
|
|
266
|
+
"indexed": true,
|
|
267
|
+
"name": "src",
|
|
268
|
+
"type": "address"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"indexed": false,
|
|
272
|
+
"name": "wad",
|
|
273
|
+
"type": "uint256"
|
|
274
|
+
}
|
|
275
|
+
],
|
|
276
|
+
"name": "Withdrawal",
|
|
277
|
+
"type": "event"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { useCallback } from 'react';
|
|
38
|
+
import { useBondContract } from '../hooks/useContract';
|
|
39
|
+
// Claim a Bill
|
|
40
|
+
var useClaimBill = function (billAddress, billIds, chainId) {
|
|
41
|
+
//const { chainId } = useWeb3React()
|
|
42
|
+
var bondContract = useBondContract(billAddress);
|
|
43
|
+
// const billType = useBillType(billAddress)
|
|
44
|
+
var handleClaimBill = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
45
|
+
var tx;
|
|
46
|
+
return __generator(this, function (_a) {
|
|
47
|
+
switch (_a.label) {
|
|
48
|
+
case 0: return [4 /*yield*/, bondContract.batchRedeem(billIds)];
|
|
49
|
+
case 1:
|
|
50
|
+
tx = _a.sent();
|
|
51
|
+
console.log('HANDLECLAIMBILL TX');
|
|
52
|
+
console.log(tx);
|
|
53
|
+
return [2 /*return*/, tx];
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}); }, [bondContract, billIds, chainId]);
|
|
57
|
+
return { onClaimBill: handleClaimBill };
|
|
58
|
+
};
|
|
59
|
+
export default useClaimBill;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Contract } from '@ethersproject/contracts';
|
|
2
|
+
import { Bond, BondNft, JungleChef, Multicallv3, MigrationBond, LaunchBonds, LockVeAbond, MigrationFveAbond } from '../config/abi/types';
|
|
3
|
+
import { Erc20 } from '../config/abi/types/Erc20';
|
|
4
|
+
import { EnsRegistrar } from '../config/abi/types/EnsRegistrar';
|
|
5
|
+
import { EnsPublicResolver } from '../config/abi/types/EnsPublicResolver';
|
|
6
|
+
import { PriceGetter } from '../config/abi/types/PriceGetter';
|
|
7
|
+
import { Weth } from '../config/abi/types/Weth';
|
|
8
|
+
import { ChainId } from '@ape.swap/apeswap-lists';
|
|
9
|
+
export declare function useContract<T extends Contract = Contract>(addressOrAddressMap: string | {
|
|
10
|
+
[chainId: number]: string;
|
|
11
|
+
} | undefined, ABI: any, withSignerIfPossible?: boolean): T | null;
|
|
12
|
+
export declare function useInterfaceMulticall(): Multicallv3 | null;
|
|
13
|
+
export declare function useTokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Erc20 | null;
|
|
14
|
+
export declare function useBytes32TokenContract(tokenAddress?: string, withSignerIfPossible?: boolean): Contract | null;
|
|
15
|
+
export declare function useENSRegistrarContract(withSignerIfPossible?: boolean): EnsRegistrar | null;
|
|
16
|
+
export declare function useENSResolverContract(address: string | undefined, withSignerIfPossible?: boolean): EnsPublicResolver | null;
|
|
17
|
+
export declare function usePriceGetter(chain?: ChainId): PriceGetter | null;
|
|
18
|
+
export declare const useBondContract: (address: string) => Bond;
|
|
19
|
+
export declare const useLaunchBondContract: (address: string) => LaunchBonds;
|
|
20
|
+
export declare const useMigrationBondContract: (address: string) => MigrationBond;
|
|
21
|
+
export declare const useBondNftContract: (address: string) => BondNft;
|
|
22
|
+
export declare const useJungleFarmContract: (address: string) => JungleChef | null;
|
|
23
|
+
export declare function useWETHContract(withSignerIfPossible?: boolean): Weth | null;
|
|
24
|
+
export declare const useLockAbondContract: (address: string) => LockVeAbond;
|
|
25
|
+
export declare const useMigrationFveAbondContract: (address: string) => MigrationFveAbond;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { useWeb3React } from '@web3-react/core';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { getContract } from '../utils';
|
|
4
|
+
// ABIS
|
|
5
|
+
import multicallV3Abi from '../config/abi/multicallv3.json';
|
|
6
|
+
import ERC20_ABI from '../config/abi/erc20.json';
|
|
7
|
+
import ERC20_BYTES32_ABI from '../config/abi/erc20_bytes32.json';
|
|
8
|
+
import ENS_ABI from '../config/abi/ens-registrar.json';
|
|
9
|
+
import BOND_ABI from '../config/abi/bond.json';
|
|
10
|
+
import MIGRATION_BOND_ABI from '../config/abi/migrationBond.json';
|
|
11
|
+
import LAUNCH_BOND_ABI from '../config/abi/launchBonds.json';
|
|
12
|
+
import BOND_NFT_ABI from '../config/abi/bondNft.json';
|
|
13
|
+
import JUNGLE_CHEF_ABI from '../config/abi/jungleChef.json';
|
|
14
|
+
import PRICE_GETTER_ABI from '../config/abi/price-getter.json';
|
|
15
|
+
import ENS_PUBLIC_RESOLVER_ABI from '../config/abi/ens-public-resolver.json';
|
|
16
|
+
import LOCK_VEABOND_ABI from '../config/abi/lockVeAbond.json';
|
|
17
|
+
import MIGRATION_FVEABOND_ABI from '../config/abi/migrationFveAbond.json';
|
|
18
|
+
import { PRICE_GETTER_ADDRESSES, MULTICALL } from '../config/constants/addresses';
|
|
19
|
+
import WETH_ABI from '../config/abi/weth.json';
|
|
20
|
+
import { SupportedChainId } from '@ape.swap/sdk-core';
|
|
21
|
+
import { WRAPPED_NATIVE_CURRENCY } from '../config/constants/tokens';
|
|
22
|
+
// returns null on errors
|
|
23
|
+
export function useContract(addressOrAddressMap, ABI, withSignerIfPossible) {
|
|
24
|
+
if (withSignerIfPossible === void 0) { withSignerIfPossible = true; }
|
|
25
|
+
var _a = useWeb3React(), provider = _a.provider, account = _a.account, chainId = _a.chainId;
|
|
26
|
+
return useMemo(function () {
|
|
27
|
+
if (!addressOrAddressMap || !ABI || !provider || !chainId)
|
|
28
|
+
return null;
|
|
29
|
+
var address;
|
|
30
|
+
if (typeof addressOrAddressMap === 'string')
|
|
31
|
+
address = addressOrAddressMap;
|
|
32
|
+
else
|
|
33
|
+
address = addressOrAddressMap[chainId];
|
|
34
|
+
if (!address)
|
|
35
|
+
return null;
|
|
36
|
+
try {
|
|
37
|
+
return getContract(address, ABI, provider, withSignerIfPossible && account ? account : undefined);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error('Failed to get contract', error);
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}, [addressOrAddressMap, ABI, provider, chainId, withSignerIfPossible, account]);
|
|
44
|
+
}
|
|
45
|
+
export function useInterfaceMulticall() {
|
|
46
|
+
return useContract(MULTICALL, multicallV3Abi, false);
|
|
47
|
+
}
|
|
48
|
+
export function useTokenContract(tokenAddress, withSignerIfPossible) {
|
|
49
|
+
return useContract(tokenAddress, ERC20_ABI, withSignerIfPossible);
|
|
50
|
+
}
|
|
51
|
+
export function useBytes32TokenContract(tokenAddress, withSignerIfPossible) {
|
|
52
|
+
return useContract(tokenAddress, ERC20_BYTES32_ABI, withSignerIfPossible);
|
|
53
|
+
}
|
|
54
|
+
export function useENSRegistrarContract(withSignerIfPossible) {
|
|
55
|
+
var chainId = useWeb3React().chainId;
|
|
56
|
+
var address;
|
|
57
|
+
if (chainId) {
|
|
58
|
+
// eslint-disable-next-line default-case
|
|
59
|
+
switch (chainId) {
|
|
60
|
+
case SupportedChainId.MAINNET:
|
|
61
|
+
address = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e';
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return useContract(address, ENS_ABI, withSignerIfPossible);
|
|
66
|
+
}
|
|
67
|
+
export function useENSResolverContract(address, withSignerIfPossible) {
|
|
68
|
+
return useContract(address, ENS_PUBLIC_RESOLVER_ABI, withSignerIfPossible);
|
|
69
|
+
}
|
|
70
|
+
export function usePriceGetter(chain) {
|
|
71
|
+
var chainId = useWeb3React().chainId;
|
|
72
|
+
var selectedChain = chain !== null && chain !== void 0 ? chain : chainId;
|
|
73
|
+
return useContract(selectedChain ? PRICE_GETTER_ADDRESSES[selectedChain] : undefined, PRICE_GETTER_ABI);
|
|
74
|
+
}
|
|
75
|
+
export var useBondContract = function (address) {
|
|
76
|
+
return useContract(address, BOND_ABI);
|
|
77
|
+
};
|
|
78
|
+
export var useLaunchBondContract = function (address) {
|
|
79
|
+
return useContract(address, LAUNCH_BOND_ABI);
|
|
80
|
+
};
|
|
81
|
+
export var useMigrationBondContract = function (address) {
|
|
82
|
+
return useContract(address, MIGRATION_BOND_ABI);
|
|
83
|
+
};
|
|
84
|
+
export var useBondNftContract = function (address) {
|
|
85
|
+
return useContract(address, BOND_NFT_ABI);
|
|
86
|
+
};
|
|
87
|
+
// export const useSousChef = (id: number) => {
|
|
88
|
+
// // If we ever use pools again revisit this
|
|
89
|
+
// const { chainId } = useWeb3React()
|
|
90
|
+
// const pools = useSelector((state: AppState) => state.pools.data)
|
|
91
|
+
// const config = pools.find((pool) => pool.sousId === id)
|
|
92
|
+
// return useContract(config ? config.contractAddress[chainId as SupportedChainId] : '', SOUS_CHEF_ABI) as SousChef
|
|
93
|
+
// }
|
|
94
|
+
export var useJungleFarmContract = function (address) {
|
|
95
|
+
return useContract(address, JUNGLE_CHEF_ABI);
|
|
96
|
+
};
|
|
97
|
+
export function useWETHContract(withSignerIfPossible) {
|
|
98
|
+
var _a;
|
|
99
|
+
var chainId = useWeb3React().chainId;
|
|
100
|
+
return useContract(chainId ? (_a = WRAPPED_NATIVE_CURRENCY[chainId]) === null || _a === void 0 ? void 0 : _a.address : undefined, WETH_ABI, withSignerIfPossible);
|
|
101
|
+
}
|
|
102
|
+
export var useLockAbondContract = function (address) {
|
|
103
|
+
return useContract(address, LOCK_VEABOND_ABI);
|
|
104
|
+
};
|
|
105
|
+
export var useMigrationFveAbondContract = function (address) {
|
|
106
|
+
return useContract(address, MIGRATION_FVEABOND_ABI);
|
|
107
|
+
};
|