Skip to content

Commit

Permalink
feat(@nftx/constants): support base
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmellis committed May 13, 2024
1 parent 78ecf6e commit 349bf16
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 33 deletions.
13 changes: 13 additions & 0 deletions packages/constants/src/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ export const WETH_TOKEN = {
[Network.Mainnet]: a('0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'),
[Network.Arbitrum]: a('0x82af49447d8a07e3bd95bd0d56f35241523fbab1'),
[Network.Sepolia]: a('0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14'),
[Network.Base]: a('0x4200000000000000000000000000000000000006'),
};

/** The address for USDC across networks */
export const USDC = {
[Network.Mainnet]: a('0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'),
[Network.Arbitrum]: a('0xff970a61a04b1ca14834a43f5de4533ebddb5cc8'),
[Network.Sepolia]: a('0x2C032Aa43D119D7bf4Adc42583F1f94f3bf3023a'),
[Network.Base]: a('0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913'),
};

export const OPENSEA_COLLECTION = a(
Expand All @@ -46,76 +48,87 @@ export const CREATE_VAULT_ZAP = {
[Network.Mainnet]: a('0x56dab32697B4A313f353DA0CE42B5113eD8E6f74'),
[Network.Sepolia]: a('0xD80b916470F8e79FD8d09874cb159CbB8D13d8da'),
[Network.Arbitrum]: a('0xF9E891AB1ECa89B7A4B3cBD45aEBFDF3Ec38946F'),
[Network.Base]: a('0x2D77756C139ed3c25472Daf233F332E8F605Dd8E'),
};

/** Perform buy/sell/swaps - MarketplaceUniversalRouterZap */
export const MARKETPLACE_ZAP = {
[Network.Mainnet]: a('0x293A0c49c85F1D8851C665Ac3cE1f1DC2a79bE3d'),
[Network.Sepolia]: a('0xd88a3B9D0Fb2d39ec8394CfFD983aFBB2D4a6410'),
[Network.Arbitrum]: a('0xf56296B3010a59Ef7F0915569DD44E1302b9Ca40'),
[Network.Base]: a('0x31cB832F661Cd90fc9Fca6fB70A39cA811a02aEd'),
};

/** Stake NFTs or vTokens for xNFTs - NFTXInventoryStakingV3Upgradable */
export const INVENTORY_STAKING = {
[Network.Mainnet]: a('0x889f313e2a3FDC1c9a45bC6020A8a18749CD6152'),
[Network.Sepolia]: a('0xfBFf0635f7c5327FD138E1EBa72BD9877A6a7C1C'),
[Network.Arbitrum]: a('0xe39a7E67d3E3b6eAF58BC02C4E80C3688847d155'),
[Network.Base]: a('0x47D9ACEE6aa260C36F4368091bE92F0824876C72'),
};

/** AMM Router - nftxUniversalRouter */
export const NFTX_ROUTER = {
[Network.Mainnet]: a('0x250d62a67254A46c0De472d2c9215E1d890cC90f'),
[Network.Sepolia]: a('0x12156cCA1958B6591CC49EaE03a5553458a4b424'),
[Network.Arbitrum]: a('0x0DA69287B4C1B28181E5d155dDDda7Fa5C32E5Ad'),
[Network.Base]: a('0x7c656F0691Db983ee78f68189c55C36d1862c901'),
};

/** Staking / Liquidity / Pools - NftxRouter */
export const POOL_ROUTER = {
[Network.Mainnet]: a('0x70A741A12262d4b5Ff45C0179c783a380EebE42a'),
[Network.Sepolia]: a('0x441b7DE4340AAa5aA86dB4DA43d9Badf7B2DAA66'),
[Network.Arbitrum]: a('0x52731751Dede22827ad47109f5e9697d75a3ef4d'),
[Network.Base]: a('0x590F8679964D4dEfB54DCD307b2941B053eb1821'),
};

/** NonfungiblePositionManager */
export const NONFUNGIBLE_POSITION_MANAGER = {
[Network.Mainnet]: a('0x26387fcA3692FCac1C1e8E4E2B22A6CF0d4b71bF'),
[Network.Sepolia]: a('0xA9bCC1e29d3460177875f68fDCC0264D22c40BF0'),
[Network.Arbitrum]: a('0x8AD238377531547838370B9C4aC346b9Ed5466Ea'),
[Network.Base]: a('0x4f566a711901168804A74F252680d85C9246188e'),
};

/** The permit2 contract, needs an approval signature because the UniversalRouter only transfers tokens from user via Permit2 */
export const PERMIT2 = {
[Network.Mainnet]: a('0x000000000022d473030f116ddee9f6b43ac78ba3'),
[Network.Sepolia]: a('0x000000000022d473030f116ddee9f6b43ac78ba3'),
[Network.Arbitrum]: a('0x000000000022d473030f116ddee9f6b43ac78ba3'),
[Network.Base]: a('0x000000000022d473030f116ddee9f6b43ac78ba3'),
};

/** ENS Address */
export const ENS_REGISTRAR = {
[Network.Mainnet]: a('0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85'),
[Network.Arbitrum]: a('0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85'),
[Network.Sepolia]: a('0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85'),
[Network.Base]: a('0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85'),
};

/** UniswapV3FactoryUpgradeable */
export const AMM_FACTORY = {
[Network.Mainnet]: a('0xa70e10beB02fF9a44007D9D3695d4b96003db101'),
[Network.Sepolia]: a('0xDD2dce9C403f93c10af1846543870D065419E70b'),
[Network.Arbitrum]: a('0xF4D0512FB47319B0CE9144EF582862e2921CaBF8'),
[Network.Base]: '0x5FD88cD0034A0B2FC77E75Ea09b6e512511b0Eb9',
};

/** NFTXVaultFactoryUpgradableV3 */
export const VAULT_FACTORY = {
[Network.Mainnet]: a('0xC255335bc5aBd6928063F5788a5E420554858f01'),
[Network.Sepolia]: a('0x31C56CaF49125043e80B4d3C7f8734f949d8178C'),
[Network.Arbitrum]: a('0x4dEeb9D2Bff2e9C35ce1f013DcC4582F891cb711'),
[Network.Base]: a('0x0D74B761eAB5cC7Cc0E4e625A2e2B8251A4915c6'),
};

/** NftxFeeDistributorV3 */
export const NFTX_FEE_DISTRIBUTOR = {
[Network.Mainnet]: a('0xF4d96C5094FCD9eC24E612585e723b58F89e21fe'),
[Network.Sepolia]: a('0x66EF5B4b6ee05639194844CE4867515665F14fED'),
[Network.Arbitrum]: a('0x0d50970C7848ebbE52661e70057D7D063B7de886'),
[Network.Base]: a('0xA64c2F3f965f055E51482bF0960Ebb5f2904BF68'),
};

/** A list of old fee distributors that are no longer active (but useful for historical data) */
Expand Down
1 change: 1 addition & 0 deletions packages/constants/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export enum Network {
Mainnet = 1,
Arbitrum = 42_161,
Sepolia = 11_155_111,
Base = 8_453,
}
52 changes: 19 additions & 33 deletions packages/constants/src/subgraph.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,27 @@
import { Network } from './networks';

export const NON_STANDARD_SUBGRAPH = {
[Network.Mainnet]: `https://graph-proxy.nftx.xyz/shared/subgraphs/name/0xorg/non-standard-nfts`,
};

export const ERC721_SUBGRAPH = {
[Network.Mainnet]:
'https://gateway-arbitrum.network.thegraph.com/api/49f332ad234c93d2f07d2c085f1ca6d6/subgraphs/id/CBf1FtUKFnipwKVm36mHyeMtkuhjmh4KHzY3uWNNq5ow',
[Network.Arbitrum]:
'https://gateway-arbitrum.network.thegraph.com/api/49f332ad234c93d2f07d2c085f1ca6d6/subgraphs/id/5A1TN7amJEcStLt1UtYZfNhUhDTNL7qkMMRmokZvvLgW',
[Network.Sepolia]:
'https://api.thegraph.com/subgraphs/name/nftx-project/721-sepolia-data-nexus',
const ROOT = 'https://g.nftx.xyz';
const CHAINS = {
[Network.Mainnet]: 'eth-mainnet',
[Network.Arbitrum]: 'arbitrum-mainnet',
[Network.Sepolia]: 'eth-sepolia',
[Network.Base]: 'base-mainnet',
};

export const ERC1155_SUBGRAPH = {
[Network.Mainnet]:
'https://gateway-arbitrum.network.thegraph.com/api/49f332ad234c93d2f07d2c085f1ca6d6/subgraphs/id/5C6JRVzKcE9AVbT7S71EycV8eEGcfkJB9gGsyTbHMVmN',
[Network.Arbitrum]:
'https://gateway-arbitrum.network.thegraph.com/api/49f332ad234c93d2f07d2c085f1ca6d6/subgraphs/id/Gtkb9LdjxZR99YfaxHtZDi6j5fbCho1gypSKuN4zEWym',
[Network.Sepolia]:
'https://api.thegraph.com/subgraphs/name/nftx-project/1155-sepolia-data-nexus',
const createNftxGraphs = (name: string) => {
return {
[Network.Mainnet]: `${ROOT}/${name}/${CHAINS[Network.Mainnet]}`,
[Network.Arbitrum]: `${ROOT}/${name}/${CHAINS[Network.Arbitrum]}`,
[Network.Sepolia]: `${ROOT}/${name}/${CHAINS[Network.Sepolia]}`,
[Network.Base]: `${ROOT}/${name}/${CHAINS[Network.Base]}`,
};
};

export const NFTX_SUBGRAPH = {
[Network.Mainnet]:
'https://graph-proxy.nftx.xyz/nftx-indexer/subgraphs/id/QmTzyQKcTsLq1jLXM4gcEyu9XkRLX7wbJJ5mY4SCHRXgii',
[Network.Arbitrum]:
'https://api.thegraph.com/subgraphs/name/nftx-project/nftx-v3-vaults-arbitrum',
[Network.Sepolia]:
'https://api.thegraph.com/subgraphs/name/nftx-project/nftx-v3-vaults-sepolia',
export const NON_STANDARD_SUBGRAPH = {
[Network.Mainnet]: `https://graph-proxy.nftx.xyz/shared/subgraphs/name/0xorg/non-standard-nfts`,
};

export const NFTX_UNISWAP_SUBGRAPH = {
[Network.Mainnet]:
'https://query.graph.nftx.xyz/subgraphs/id/QmXavb61qVUrfYe7daW47n77LhinFgSoMhWVkMfgEdUspS',
[Network.Sepolia]:
'https://api.thegraph.com/subgraphs/name/gundamdweeb/nftx-univ3-sepolia',
[Network.Arbitrum]:
'https://query.graph.nftx.xyz/subgraphs/id/QmaTrSbtkkCeJW5fhbsm1BoEZm31zEE9HtCP5BEjfeGLMT',
};
export const ERC721_SUBGRAPH = createNftxGraphs('erc721');
export const ERC1155_SUBGRAPH = createNftxGraphs('erc1155');
export const NFTX_SUBGRAPH = createNftxGraphs('nftx-v3-vaults');
export const NFTX_UNISWAP_SUBGRAPH = createNftxGraphs('nftx-v3-amm');
4 changes: 4 additions & 0 deletions packages/constants/src/ticks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,26 @@ export const RFBR_MIN_PRICE = {
[Network.Mainnet]: 100000000000000n,
[Network.Sepolia]: 100000000000000n,
[Network.Arbitrum]: 100000000000000n,
[Network.Base]: 100000000000000n,
};
// 10,000 ETH
export const RFBR_MAX_PRICE = {
[Network.Mainnet]: 10000000000000000000000n,
[Network.Sepolia]: 10000000000000000000000n,
[Network.Arbitrum]: 10000000000000000000000n,
[Network.Base]: 10000000000000000000000n,
};
export const RFBR_MIN_TICK = {
[Network.Mainnet]: -92160,
[Network.Sepolia]: -92160,
[Network.Arbitrum]: -92160,
[Network.Base]: -92160,
};
export const RFBR_MAX_TICK = {
[Network.Mainnet]: 92100,
[Network.Sepolia]: 92100,
[Network.Arbitrum]: 92100,
[Network.Base]: 92100,
};

// This is the "absolute" max/min ticks that can be used
Expand Down
2 changes: 2 additions & 0 deletions packages/constants/src/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const NFTX_ROUTER_URL = {
[Network.Mainnet]: 'https://api.nftx.xyz/v3/eth-mainnet/quote',
[Network.Sepolia]: 'https://api.nftx.xyz/v3/eth-sepolia/quote',
[Network.Arbitrum]: 'https://api.nftx.xyz/v3/arb-mainnet/quote',
[Network.Base]: 'https://api.nftx.xyz/v3/base-mainnet/quote',
};

export const NFTX_APR_URL = {
Expand All @@ -17,4 +18,5 @@ export const RESERVOIR_URL = {
[Network.Mainnet]: 'https://api.reservoir.tools',
[Network.Arbitrum]: 'https://api-arbitrum.reservoir.tools',
[Network.Sepolia]: 'https://api-sepolia.reservoir.tools',
[Network.Base]: 'https://api-base.reservoir.tools',
};
1 change: 1 addition & 0 deletions packages/constants/src/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const PREMIUM_DURATION = {
[Network.Mainnet]: 36000, // 10 hours
[Network.Arbitrum]: 36000, // 10 hours
[Network.Sepolia]: 36000, // 1 hour
[Network.Base]: 36000, // 10 hours
};

0 comments on commit 349bf16

Please sign in to comment.