@shapeshiftoss/contracts 1.1.0 → 2.1.0
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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/constants.d.ts +0 -6596
- package/dist/cjs/constants.js +1 -31
- package/dist/cjs/contractManager.d.ts +8 -11
- package/dist/cjs/contractManager.js +38 -63
- package/dist/cjs/ethersProviderSingleton.d.ts +0 -3
- package/dist/cjs/ethersProviderSingleton.js +4 -23
- package/dist/cjs/publicRpcUrls.d.ts +1 -0
- package/dist/cjs/publicRpcUrls.js +1 -0
- package/dist/cjs/types.d.ts +1 -18
- package/dist/cjs/types.js +0 -7
- package/dist/cjs/viemClient.d.ts +9760 -6418
- package/dist/cjs/viemClient.js +62 -147
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/constants.d.ts +0 -6596
- package/dist/esm/constants.js +0 -30
- package/dist/esm/contractManager.d.ts +8 -11
- package/dist/esm/contractManager.js +39 -65
- package/dist/esm/ethersProviderSingleton.d.ts +0 -3
- package/dist/esm/ethersProviderSingleton.js +3 -20
- package/dist/esm/publicRpcUrls.d.ts +1 -0
- package/dist/esm/publicRpcUrls.js +1 -0
- package/dist/esm/types.d.ts +1 -18
- package/dist/esm/types.js +1 -6
- package/dist/esm/viemClient.d.ts +9760 -6418
- package/dist/esm/viemClient.js +60 -145
- package/package.json +4 -5
package/dist/cjs/constants.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PERMIT2_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_CONTRACTS = exports.UNI_V2_FOX_STAKING_REWARDS_V5_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V4_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V3_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V2_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V1_CONTRACT = exports.FOXY_STAKING_CONTRACT = exports.SHAPE_SHIFT_ROUTER_CONTRACT = exports.L1_ORBIT_CUSTOM_GATEWAY_CONTRACT = exports.L1_ARBITRUM_GATEWAY_CONTRACT = exports.L2_ARBITRUM_GATEWAY_CONTRACT = exports.L2_ARBITRUM_CUSTOM_GATEWAY_CONTRACT = exports.ARB_RETRYABLE_TX_CONTRACT = exports.ARBITRUM_L2_ERC20_GATEWAY_PROXY_CONTRACT = exports.ARB_SYS_CONTRACT = exports.ARB_OUTBOX_CONTRACT = exports.COWSWAP_SETTLEMENT_CONTRACT_MAINNET = exports.ZRX_OPTIMISM_PROXY_CONTRACT = exports.ZRX_ETHEREUM_PROXY_CONTRACT = exports.
|
|
4
|
-
const viem_1 = require("viem");
|
|
5
|
-
const evergreenFarming_1 = require("./abis/evergreenFarming");
|
|
6
|
-
const farming_1 = require("./abis/farming");
|
|
7
|
-
const iUniswapV2Pair_1 = require("./abis/iUniswapV2Pair");
|
|
8
|
-
const thorchainRouter_1 = require("./abis/thorchainRouter");
|
|
9
|
-
const uniswapV2Router02_1 = require("./abis/uniswapV2Router02");
|
|
10
|
-
const types_1 = require("./types");
|
|
3
|
+
exports.PERMIT2_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_CONTRACTS = exports.UNI_V2_FOX_STAKING_REWARDS_V5_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V4_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V3_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V2_CONTRACT = exports.UNI_V2_FOX_STAKING_REWARDS_V1_CONTRACT = exports.FOXY_STAKING_CONTRACT = exports.SHAPE_SHIFT_ROUTER_CONTRACT = exports.L1_ORBIT_CUSTOM_GATEWAY_CONTRACT = exports.L1_ARBITRUM_GATEWAY_CONTRACT = exports.L2_ARBITRUM_GATEWAY_CONTRACT = exports.L2_ARBITRUM_CUSTOM_GATEWAY_CONTRACT = exports.ARB_RETRYABLE_TX_CONTRACT = exports.ARBITRUM_L2_ERC20_GATEWAY_PROXY_CONTRACT = exports.ARB_SYS_CONTRACT = exports.ARB_OUTBOX_CONTRACT = exports.COWSWAP_SETTLEMENT_CONTRACT_MAINNET = exports.ZRX_OPTIMISM_PROXY_CONTRACT = exports.ZRX_ETHEREUM_PROXY_CONTRACT = exports.RFOX_WAD = exports.RFOX_REWARD_RATE = exports.RFOX_ETH_PROXY_CONTRACT = exports.RFOX_ARB_UNI_V2_ETH_FOX_PROXY_CONTRACT = exports.RFOX_ARB_PROXY_CONTRACT = exports.TS_AGGREGATOR_TOKEN_TRANSFER_PROXY_CONTRACT_MAINNET = exports.THOR_ROUTER_CONTRACT_MAINNET = exports.UNISWAP_V3_POOL_FACTORY_CONTRACT_MAINNET = exports.UNISWAP_V3_QUOTER_CONTRACT_MAINNET = exports.UNISWAP_V2_FACTORY_CONTRACT_MAINNET = exports.UNISWAP_V2_ROUTER_02_CONTRACT_MAINNET = exports.ETH_FOX_POOL_CONTRACT = exports.foxEthStakingContractAddresses = exports.ETH_FOX_STAKING_EVERGREEN_CONTRACT = exports.ETH_FOX_STAKING_V9_CONTRACT = exports.ETH_FOX_STAKING_V8_CONTRACT = exports.ETH_FOX_STAKING_V7_CONTRACT = exports.ETH_FOX_STAKING_V6_CONTRACT = exports.ETH_FOX_STAKING_V5_CONTRACT = exports.ETH_FOX_STAKING_V4_CONTRACT = exports.ETH_FOX_STAKING_V3_CONTRACT = exports.ETH_FOX_STAKING_V2_CONTRACT = exports.ETH_FOX_STAKING_V1_CONTRACT = exports.WETH_TOKEN_CONTRACT = void 0;
|
|
11
4
|
exports.WETH_TOKEN_CONTRACT = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2';
|
|
12
|
-
exports.FOX_TOKEN_CONTRACT = '0xc770EEfAd204B5180dF6a14Ee197D99d808ee52d';
|
|
13
5
|
// Staking contract addresses as string literals
|
|
14
6
|
exports.ETH_FOX_STAKING_V1_CONTRACT = '0xdd80e21669a664bce83e3ad9a0d74f8dad5d9e72';
|
|
15
7
|
exports.ETH_FOX_STAKING_V2_CONTRACT = '0xc54b9f82c1c54e9d4d274d633c7523f2299c42a0';
|
|
@@ -49,28 +41,6 @@ exports.RFOX_ARB_UNI_V2_ETH_FOX_PROXY_CONTRACT = '0x83B51B7605d2E277E03A7D6451B1
|
|
|
49
41
|
exports.RFOX_ETH_PROXY_CONTRACT = '0x7AC9c77263473A9e1DC9621F97b886c1e90Ddd33';
|
|
50
42
|
exports.RFOX_REWARD_RATE = 1n * 10n ** 27n;
|
|
51
43
|
exports.RFOX_WAD = 1n * 10n ** 18n;
|
|
52
|
-
exports.CONTRACT_ADDRESS_TO_ABI = {
|
|
53
|
-
[exports.ETH_FOX_POOL_CONTRACT]: iUniswapV2Pair_1.I_UNISWAP_V2_PAIR_ABI,
|
|
54
|
-
[exports.ETH_FOX_STAKING_V1_CONTRACT]: farming_1.FARMING_ABI,
|
|
55
|
-
[exports.ETH_FOX_STAKING_V2_CONTRACT]: farming_1.FARMING_ABI,
|
|
56
|
-
[exports.ETH_FOX_STAKING_V3_CONTRACT]: farming_1.FARMING_ABI,
|
|
57
|
-
[exports.ETH_FOX_STAKING_V4_CONTRACT]: farming_1.FARMING_ABI,
|
|
58
|
-
[exports.ETH_FOX_STAKING_V5_CONTRACT]: farming_1.FARMING_ABI,
|
|
59
|
-
[exports.ETH_FOX_STAKING_V6_CONTRACT]: farming_1.FARMING_ABI,
|
|
60
|
-
[exports.ETH_FOX_STAKING_V7_CONTRACT]: farming_1.FARMING_ABI,
|
|
61
|
-
[exports.ETH_FOX_STAKING_V8_CONTRACT]: farming_1.FARMING_ABI,
|
|
62
|
-
[exports.ETH_FOX_STAKING_V9_CONTRACT]: farming_1.FARMING_ABI,
|
|
63
|
-
[exports.ETH_FOX_STAKING_EVERGREEN_CONTRACT]: evergreenFarming_1.EVERGREEN_FARMING_ABI,
|
|
64
|
-
[exports.FOX_TOKEN_CONTRACT]: viem_1.erc20Abi,
|
|
65
|
-
[exports.UNISWAP_V2_ROUTER_02_CONTRACT_MAINNET]: uniswapV2Router02_1.UNISWAP_V2_ROUTER_02_ABI,
|
|
66
|
-
// THOR Router Mainnet
|
|
67
|
-
[exports.THOR_ROUTER_CONTRACT_MAINNET]: thorchainRouter_1.THORCHAIN_ROUTER_ABI,
|
|
68
|
-
};
|
|
69
|
-
exports.CONTRACT_TYPE_TO_ABI = {
|
|
70
|
-
[types_1.ContractType.UniV2Pair]: iUniswapV2Pair_1.I_UNISWAP_V2_PAIR_ABI,
|
|
71
|
-
[types_1.ContractType.ERC20]: viem_1.erc20Abi,
|
|
72
|
-
[types_1.ContractType.ThorRouter]: thorchainRouter_1.THORCHAIN_ROUTER_ABI,
|
|
73
|
-
};
|
|
74
44
|
// 0x proxy contracts - all EVM chains except Optimism have the same address
|
|
75
45
|
exports.ZRX_ETHEREUM_PROXY_CONTRACT = '0xDef1C0ded9bec7F1a1670819833240f027b25EfF';
|
|
76
46
|
exports.ZRX_OPTIMISM_PROXY_CONTRACT = '0xDEF1ABE32c034e558Cdd535791643C58a13aCC10';
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type { AssetId
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
chainId: ChainId;
|
|
10
|
-
}) => KnownContractByType<A, T>;
|
|
11
|
-
export declare const fetchUniV2PairData: ((pairAssetId: AssetId) => Promise<import("@uniswap/sdk").Pair>) & import("lodash").MemoizedFunction;
|
|
1
|
+
import type { AssetId } from '@shapeshiftoss/caip';
|
|
2
|
+
import { Pair } from '@uniswap/sdk';
|
|
3
|
+
import type { Address, GetContractReturnType, PublicClient } from 'viem';
|
|
4
|
+
import { I_UNISWAP_V2_PAIR_ABI } from './abis';
|
|
5
|
+
import type { FoxEthStakingContractAbi, FoxEthStakingContractAddress } from './types';
|
|
6
|
+
export declare const getFoxEthStakingContract: (address: FoxEthStakingContractAddress) => GetContractReturnType<FoxEthStakingContractAbi, PublicClient, Address>;
|
|
7
|
+
export declare const getEthFoxPoolContract: () => GetContractReturnType<typeof I_UNISWAP_V2_PAIR_ABI, PublicClient, Address>;
|
|
8
|
+
export declare const fetchUniV2PairData: (pairAssetId: AssetId) => Promise<Pair>;
|
|
@@ -3,75 +3,50 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.fetchUniV2PairData = exports.
|
|
6
|
+
exports.fetchUniV2PairData = exports.getEthFoxPoolContract = exports.getFoxEthStakingContract = void 0;
|
|
7
7
|
const caip_1 = require("@shapeshiftoss/caip");
|
|
8
|
-
const types_1 = require("@shapeshiftoss/types");
|
|
9
8
|
const sdk_1 = require("@uniswap/sdk");
|
|
10
|
-
const assert_1 = __importDefault(require("assert"));
|
|
11
9
|
const memoize_1 = __importDefault(require("lodash/memoize"));
|
|
12
10
|
const viem_1 = require("viem");
|
|
11
|
+
const abis_1 = require("./abis");
|
|
13
12
|
const constants_1 = require("./constants");
|
|
14
|
-
const ethersProviderSingleton_1 = require("./ethersProviderSingleton");
|
|
15
|
-
const types_2 = require("./types");
|
|
16
13
|
const viemClient_1 = require("./viemClient");
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
definedContracts[checksumAddress] = contract;
|
|
31
|
-
return contract;
|
|
32
|
-
};
|
|
33
|
-
exports.getOrCreateContractByAddress = getOrCreateContractByAddress;
|
|
34
|
-
const getOrCreateContractByType = ({ address, type, chainId, }) => {
|
|
35
|
-
const checksumAddress = (0, viem_1.getAddress)(address);
|
|
36
|
-
const definedContract = definedContracts[checksumAddress];
|
|
37
|
-
if (definedContract !== undefined) {
|
|
38
|
-
return definedContract;
|
|
39
|
-
}
|
|
40
|
-
const publicClient = viemClient_1.viemClientByChainId[chainId];
|
|
41
|
-
(0, assert_1.default)(publicClient !== undefined, `no public client found for chainId '${chainId}'`);
|
|
42
|
-
const contract = (0, viem_1.getContract)({
|
|
43
|
-
abi: constants_1.CONTRACT_TYPE_TO_ABI[type],
|
|
44
|
-
address: checksumAddress,
|
|
45
|
-
client: publicClient,
|
|
46
|
-
});
|
|
47
|
-
definedContracts[checksumAddress] = contract;
|
|
48
|
-
return contract;
|
|
49
|
-
};
|
|
50
|
-
exports.getOrCreateContractByType = getOrCreateContractByType;
|
|
51
|
-
exports.fetchUniV2PairData = (0, memoize_1.default)(async (pairAssetId) => {
|
|
14
|
+
const getFoxEthStakingContract = (address) => (0, viem_1.getContract)({
|
|
15
|
+
abi: address === constants_1.ETH_FOX_STAKING_EVERGREEN_CONTRACT ? abis_1.EVERGREEN_FARMING_ABI : abis_1.FARMING_ABI,
|
|
16
|
+
address: (0, viem_1.getAddress)(address),
|
|
17
|
+
client: viemClient_1.viemEthMainnetClient,
|
|
18
|
+
});
|
|
19
|
+
exports.getFoxEthStakingContract = getFoxEthStakingContract;
|
|
20
|
+
const getEthFoxPoolContract = () => (0, viem_1.getContract)({
|
|
21
|
+
abi: abis_1.I_UNISWAP_V2_PAIR_ABI,
|
|
22
|
+
address: constants_1.ETH_FOX_POOL_CONTRACT,
|
|
23
|
+
client: viemClient_1.viemEthMainnetClient,
|
|
24
|
+
});
|
|
25
|
+
exports.getEthFoxPoolContract = getEthFoxPoolContract;
|
|
26
|
+
const getUniV2PairTokens = (0, memoize_1.default)(async (pairAssetId) => {
|
|
52
27
|
const { assetReference, chainId } = (0, caip_1.fromAssetId)(pairAssetId);
|
|
53
|
-
const
|
|
54
|
-
const pair = (0,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
59
|
-
const ethersV5Provider = (0, ethersProviderSingleton_1.getEthersV5Provider)();
|
|
60
|
-
const token0Address = await pair.read.token0();
|
|
61
|
-
const token1Address = await pair.read.token1();
|
|
62
|
-
const token0AssetId = (0, caip_1.toAssetId)({
|
|
63
|
-
chainId,
|
|
64
|
-
assetNamespace: 'erc20',
|
|
65
|
-
assetReference: token0Address,
|
|
66
|
-
});
|
|
67
|
-
const token1AssetId = (0, caip_1.toAssetId)({
|
|
68
|
-
chainId,
|
|
69
|
-
assetNamespace: 'erc20',
|
|
70
|
-
assetReference: token1Address,
|
|
28
|
+
const client = (0, viemClient_1.assertGetViemClient)(chainId);
|
|
29
|
+
const pair = (0, viem_1.getContract)({
|
|
30
|
+
abi: abis_1.I_UNISWAP_V2_PAIR_ABI,
|
|
31
|
+
address: (0, viem_1.getAddress)(assetReference),
|
|
32
|
+
client,
|
|
71
33
|
});
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
34
|
+
const [token0Address, token1Address] = await Promise.all([pair.read.token0(), pair.read.token1()]);
|
|
35
|
+
const [decimals0, decimals1] = await Promise.all([token0Address, token1Address].map(address => client.readContract({ address, abi: viem_1.erc20Abi, functionName: 'decimals' })));
|
|
36
|
+
const evmChainId = Number((0, caip_1.fromChainId)(chainId).chainReference);
|
|
37
|
+
return {
|
|
38
|
+
pair,
|
|
39
|
+
token0: new sdk_1.Token(evmChainId, token0Address, decimals0),
|
|
40
|
+
token1: new sdk_1.Token(evmChainId, token1Address, decimals1),
|
|
41
|
+
};
|
|
77
42
|
});
|
|
43
|
+
const fetchUniV2PairData = async (pairAssetId) => {
|
|
44
|
+
const { pair, token0, token1 } = await getUniV2PairTokens(pairAssetId).catch(err => {
|
|
45
|
+
getUniV2PairTokens.cache.delete(pairAssetId);
|
|
46
|
+
throw err;
|
|
47
|
+
});
|
|
48
|
+
const [reserve0, reserve1] = await pair.read.getReserves();
|
|
49
|
+
// a uniswap v2 pair's token0 always sorts before token1, so reserves are already in token order
|
|
50
|
+
return new sdk_1.Pair(new sdk_1.TokenAmount(token0, reserve0.toString()), new sdk_1.TokenAmount(token1, reserve1.toString()));
|
|
51
|
+
};
|
|
52
|
+
exports.fetchUniV2PairData = fetchUniV2PairData;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import type { EvmChainId } from '@shapeshiftoss/types';
|
|
2
|
-
import { JsonRpcProvider } from 'ethers';
|
|
3
2
|
import { ethers as ethersV5 } from 'ethers5';
|
|
4
|
-
export declare const rpcUrlByChainId: (chainId: EvmChainId) => string;
|
|
5
|
-
export declare const getEthersProvider: (chainId: EvmChainId) => JsonRpcProvider;
|
|
6
3
|
export declare const getEthersV5Provider: (chainId?: EvmChainId) => ethersV5.providers.JsonRpcProvider;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getEthersV5Provider =
|
|
3
|
+
exports.getEthersV5Provider = void 0;
|
|
4
4
|
const types_1 = require("@shapeshiftoss/types");
|
|
5
5
|
const utils_1 = require("@shapeshiftoss/utils");
|
|
6
|
-
const ethers_1 = require("ethers");
|
|
7
6
|
const ethers5_1 = require("ethers5");
|
|
8
7
|
const publicRpcUrls_1 = require("./publicRpcUrls");
|
|
9
8
|
const rpcUrlByChainId = (chainId) => {
|
|
@@ -83,6 +82,8 @@ const rpcUrlByChainId = (chainId) => {
|
|
|
83
82
|
return publicRpcUrls_1.PUBLIC_RPC_URLS.abstract[0];
|
|
84
83
|
case types_1.KnownChainIds.RobinhoodMainnet:
|
|
85
84
|
return publicRpcUrls_1.PUBLIC_RPC_URLS.robinhood[0];
|
|
85
|
+
case types_1.KnownChainIds.ElysiumMainnet:
|
|
86
|
+
return publicRpcUrls_1.PUBLIC_RPC_URLS.elysium[0];
|
|
86
87
|
default:
|
|
87
88
|
return (0, utils_1.assertUnreachable)(chainId);
|
|
88
89
|
}
|
|
@@ -92,31 +93,11 @@ const rpcUrlByChainId = (chainId) => {
|
|
|
92
93
|
}
|
|
93
94
|
return url;
|
|
94
95
|
};
|
|
95
|
-
exports.rpcUrlByChainId = rpcUrlByChainId;
|
|
96
|
-
const ethersProviders = new Map();
|
|
97
96
|
const ethersV5Providers = new Map();
|
|
98
|
-
const getEthersProvider = (chainId) => {
|
|
99
|
-
if (!ethersProviders.has(chainId)) {
|
|
100
|
-
const provider = new ethers_1.JsonRpcProvider((0, exports.rpcUrlByChainId)(chainId), undefined, {
|
|
101
|
-
staticNetwork: true,
|
|
102
|
-
});
|
|
103
|
-
ethersProviders.set(chainId, provider);
|
|
104
|
-
return provider;
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
// This really should be defined but I guess enough safety never hurts mang...
|
|
108
|
-
const provider = ethersProviders.get(chainId);
|
|
109
|
-
if (!provider) {
|
|
110
|
-
throw new Error(`No provider found for chainId ${chainId}`);
|
|
111
|
-
}
|
|
112
|
-
return provider;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
exports.getEthersProvider = getEthersProvider;
|
|
116
97
|
// For backwards-compatibility for libraries still stuck in v5
|
|
117
98
|
const getEthersV5Provider = (chainId = types_1.KnownChainIds.EthereumMainnet) => {
|
|
118
99
|
if (!ethersV5Providers.has(chainId)) {
|
|
119
|
-
const provider = new ethers5_1.ethers.providers.StaticJsonRpcProvider(
|
|
100
|
+
const provider = new ethers5_1.ethers.providers.StaticJsonRpcProvider(rpcUrlByChainId(chainId));
|
|
120
101
|
ethersV5Providers.set(chainId, provider);
|
|
121
102
|
return provider;
|
|
122
103
|
}
|
|
@@ -35,4 +35,5 @@ export declare const PUBLIC_RPC_URLS: {
|
|
|
35
35
|
readonly worldChain: readonly ["https://worldchain-mainnet.g.alchemy.com/public", "https://worldchain.drpc.org"];
|
|
36
36
|
readonly zkSyncEra: readonly ["https://mainnet.era.zksync.io", "https://zksync.drpc.org", "https://zksync.api.onfinality.io/public"];
|
|
37
37
|
readonly robinhood: readonly ["https://rpc.mainnet.chain.robinhood.com", "https://robinhood-rpc.publicnode.com"];
|
|
38
|
+
readonly elysium: readonly ["https://rpc.elysium.kinetiq.xyz", "https://elysium.drpc.org"];
|
|
38
39
|
};
|
|
@@ -99,4 +99,5 @@ exports.PUBLIC_RPC_URLS = {
|
|
|
99
99
|
'https://zksync.api.onfinality.io/public',
|
|
100
100
|
],
|
|
101
101
|
robinhood: ['https://rpc.mainnet.chain.robinhood.com', 'https://robinhood-rpc.publicnode.com'],
|
|
102
|
+
elysium: ['https://rpc.elysium.kinetiq.xyz', 'https://elysium.drpc.org'],
|
|
102
103
|
};
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import type { Address, GetContractReturnType, PublicClient } from 'viem';
|
|
2
1
|
import type { EVERGREEN_FARMING_ABI, FARMING_ABI } from './abis';
|
|
3
|
-
import type {
|
|
4
|
-
export declare enum ContractType {
|
|
5
|
-
UniV2Pair = "UniV2Pair",
|
|
6
|
-
ERC20 = "ERC20",
|
|
7
|
-
ThorRouter = "ThorRouter"
|
|
8
|
-
}
|
|
9
|
-
export type KnownContractAbiByAddress<T extends KnownContractAddress> = (typeof CONTRACT_ADDRESS_TO_ABI)[T];
|
|
10
|
-
export type KnownContractAbiByType<T extends ContractType> = (typeof CONTRACT_TYPE_TO_ABI)[T];
|
|
11
|
-
export type KnownContractByAddress<T extends KnownContractAddress> = GetContractReturnType<KnownContractAbiByAddress<T>, PublicClient, T>;
|
|
12
|
-
export type KnownContract = KnownContractByAddress<KnownContractAddress>;
|
|
13
|
-
export type KnownContractByType<A extends KnownContractAddress, T extends ContractType> = GetContractReturnType<KnownContractAbiByType<T>, PublicClient, A>;
|
|
14
|
-
export type KnownContractAddress = typeof ETH_FOX_POOL_CONTRACT | FoxEthStakingContractAddress | typeof FOX_TOKEN_CONTRACT | typeof UNISWAP_V2_ROUTER_02_CONTRACT_MAINNET | typeof THOR_ROUTER_CONTRACT_MAINNET;
|
|
15
|
-
export type DefinedContract = {
|
|
16
|
-
contract: KnownContractByAddress<KnownContractAddress>;
|
|
17
|
-
address: KnownContractAddress;
|
|
18
|
-
};
|
|
2
|
+
import type { foxEthStakingContractAddresses } from './constants';
|
|
19
3
|
export type FoxEthStakingContractAddress = (typeof foxEthStakingContractAddresses)[number];
|
|
20
4
|
export type FoxEthStakingContractAbi = typeof FARMING_ABI | typeof EVERGREEN_FARMING_ABI;
|
|
21
|
-
export type FoxEthStakingContract<T extends FoxEthStakingContractAbi> = T extends typeof FARMING_ABI ? GetContractReturnType<typeof FARMING_ABI, PublicClient, Address> : GetContractReturnType<typeof EVERGREEN_FARMING_ABI, PublicClient, Address>;
|
package/dist/cjs/types.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContractType = void 0;
|
|
4
|
-
var ContractType;
|
|
5
|
-
(function (ContractType) {
|
|
6
|
-
ContractType["UniV2Pair"] = "UniV2Pair";
|
|
7
|
-
ContractType["ERC20"] = "ERC20";
|
|
8
|
-
ContractType["ThorRouter"] = "ThorRouter";
|
|
9
|
-
})(ContractType || (exports.ContractType = ContractType = {}));
|