Skip to content

Commit e4271eb

Browse files
authored
fix: ME private rpc urls (#217)
1 parent ce5ad4b commit e4271eb

File tree

7 files changed

+85
-25
lines changed

7 files changed

+85
-25
lines changed

cli-typescript/package-lock.json

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli-typescript/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"ethers": "^6.13.5",
4545
"express": "^5.1.0",
4646
"mkdirp": "^3.0.1",
47+
"open": "8.4.0",
4748
"ox": "^0.7.0",
4849
"viem": "^2.26.3"
4950
}

cli-typescript/src/cmds/createCommand.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ import { EvmPlatform } from '../utils/evmUtils';
1212
import deployAction from '../utils/cmdActions/deployAction';
1313
import { setBaseDir } from '../utils/setters';
1414
import { showError } from '../utils/display';
15-
import {
16-
COLLECTION_DIR,
17-
supportedChainNames,
18-
TOKEN_STANDARD,
19-
} from '../utils/constants';
15+
import { supportedChainNames, TOKEN_STANDARD } from '../utils/constants';
2016
import newProjectAction from '../utils/cmdActions/newProjectAction';
2117
import {
2218
checkSignerBalanceCmd,
@@ -42,6 +38,7 @@ import listProjectsAction from '../utils/cmdActions/listProjectsAction';
4238
import { getProjectStore } from '../utils/fileUtils';
4339
import fillProjectConfigAction from '../utils/cmdActions/fillProjectConfigAction';
4440
import { authenticate } from '../utils/auth';
41+
import { getCollectionDir } from '../utils/getters';
4542

4643
export const getNewProjectCmdDescription = (defaultInfo?: string) => {
4744
defaultInfo =
@@ -50,7 +47,7 @@ export const getNewProjectCmdDescription = (defaultInfo?: string) => {
5047
return `
5148
Creates a new launchpad/collection template.
5249
you can specify the collection directory by setting the "MAGIC_DROP_COLLECTION_DIR" env
53-
else it defaults to "${COLLECTION_DIR}" in the project directory.
50+
else it defaults to "${getCollectionDir()}" in the project directory.
5451
You can also specify the chain and token standard to use for the new project.
5552
${defaultInfo}
5653
`;

cli-typescript/src/utils/cmdActions/listProjectsAction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import fs from 'fs';
22
import path from 'path';
3-
import { COLLECTION_DIR } from '../constants';
43
import { showError, showText } from '../display';
54
import { EvmPlatform } from '../evmUtils';
65
import { getProjectStore } from '../fileUtils';
6+
import { getCollectionDir } from '../getters';
77

88
const listProjectsAction = async (platform?: EvmPlatform) => {
99
try {
10-
const projectDir = `${COLLECTION_DIR}/projects`;
10+
const projectDir = `${getCollectionDir()}/projects`;
1111

1212
if (!fs.existsSync(projectDir)) {
1313
throw new Error(

cli-typescript/src/utils/constants.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ export const DEFAULT_COLLECTION_DIR = path.resolve(
2424
'../../collections',
2525
);
2626

27-
export const COLLECTION_DIR =
28-
process.env.MAGIC_DROP_COLLECTION_DIR || DEFAULT_COLLECTION_DIR;
29-
3027
export const ME_TRANSFER_VALIDATOR_V3 =
3128
'0x721C00D4FB075b22a5469e9CF2440697F729aA13';
3229
export const LIMITBREAK_TRANSFER_VALIDATOR_V3 =
@@ -94,18 +91,28 @@ export const supportedChainNames: { [key in SUPPORTED_CHAINS]: string } = {
9491
};
9592

9693
export const rpcUrls: { [chainId in SUPPORTED_CHAINS]: string } = {
97-
[SUPPORTED_CHAINS.ETHEREUM]: 'https://eth.llamarpc.com', // Ethereum
98-
[SUPPORTED_CHAINS.BSC]: 'https://bsc-dataseed.binance.org', // BSC
99-
[SUPPORTED_CHAINS.POLYGON]: 'https://polygon-rpc.com', // Polygon
100-
[SUPPORTED_CHAINS.BASE]: 'https://mainnet.base.org', // Base
101-
[SUPPORTED_CHAINS.ARBITRUM]: 'https://arb1.arbitrum.io/rpc', // Arbitrum
102-
[SUPPORTED_CHAINS.SEI]: 'https://evm-rpc.sei-apis.com', // Sei
103-
[SUPPORTED_CHAINS.APECHAIN]: 'https://rpc.apechain.com/http', // ApeChain
104-
[SUPPORTED_CHAINS.SEPOLIA]: 'https://ethereum-sepolia-rpc.publicnode.com', // Sepolia
105-
[SUPPORTED_CHAINS.ABSTRACT]: 'https://api.mainnet.abs.xyz', // Abstract
106-
[SUPPORTED_CHAINS.BERACHAIN]: 'https://rpc.berachain.com', // Berachain
107-
[SUPPORTED_CHAINS.MONAD_TESTNET]: 'https://testnet-rpc.monad.xyz', // Monad Testnet
108-
[SUPPORTED_CHAINS.AVALANCHE]: 'https://avalanche.drpc.org', // Avalanche
94+
[SUPPORTED_CHAINS.ETHEREUM]:
95+
'https://evm-router.magiceden.io/ethereum/mainnet/me2024', // Ethereum
96+
[SUPPORTED_CHAINS.BSC]: 'https://evm-router.magiceden.io/bsc/mainnet/me2024', // BSC
97+
[SUPPORTED_CHAINS.POLYGON]:
98+
'https://evm-router.magiceden.io/polygon/mainnet/me2024', // Polygon
99+
[SUPPORTED_CHAINS.BASE]:
100+
'https://evm-router.magiceden.io/base/mainnet/me2024', // Base
101+
[SUPPORTED_CHAINS.ARBITRUM]:
102+
'https://evm-router.magiceden.io/arbitrum/mainnet/me2024', // Arbitrum
103+
[SUPPORTED_CHAINS.SEI]: 'https://evm-router.magiceden.io/sei/mainnet/me2024', // Sei
104+
[SUPPORTED_CHAINS.APECHAIN]:
105+
'https://evm-router.magiceden.io/apechain/mainnet/me2024', // ApeChain
106+
[SUPPORTED_CHAINS.SEPOLIA]:
107+
'https://evm-router.magiceden.io/ethereum/sepolia/me2024', // Sepolia
108+
[SUPPORTED_CHAINS.ABSTRACT]:
109+
'https://evm-router.magiceden.io/abstract/mainnet/me2024', // Abstract
110+
[SUPPORTED_CHAINS.BERACHAIN]:
111+
'https://evm-router.magiceden.io/berachain/mainnet/me2024"', // Berachain
112+
[SUPPORTED_CHAINS.MONAD_TESTNET]:
113+
'https://evm-router.magiceden.io/monad/testnet/me2024', // Monad Testnet
114+
[SUPPORTED_CHAINS.AVALANCHE]:
115+
'https://evm-router.magiceden.io/avalanche/mainnet/me2024', // Avalanche
109116
};
110117

111118
export const explorerUrls: { [chainId in SUPPORTED_CHAINS]: string } = {

cli-typescript/src/utils/fileUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs';
22
import path from 'path';
3-
import { COLLECTION_DIR } from './constants';
43
import { Collection } from './types';
4+
import { getCollectionDir } from './getters';
55

66
export class Store<T> {
77
public root: string;
@@ -60,7 +60,7 @@ export const getProjectStore = (
6060
createDir = false,
6161
) => {
6262
const store = new Store<Collection>(
63-
COLLECTION_DIR,
63+
getCollectionDir(),
6464
path.join('projects', symbol),
6565
'project.json',
6666
readonly,

cli-typescript/src/utils/getters.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { confirm } from '@inquirer/prompts';
22
import {
33
ABSTRACT_FACTORY_ADDRESS,
44
ABSTRACT_REGISTRY_ADDRESS,
5+
DEFAULT_COLLECTION_DIR,
56
DEFAULT_FACTORY_ADDRESS,
67
DEFAULT_IMPL_ID,
78
DEFAULT_LIST_ID,
@@ -321,3 +322,7 @@ export const getBaseDir = (): string => {
321322
const baseDir = process.env.BASE_DIR || setBaseDir();
322323
return baseDir;
323324
};
325+
326+
export const getCollectionDir = (): string => {
327+
return process.env.MAGIC_DROP_COLLECTION_DIR || DEFAULT_COLLECTION_DIR;
328+
};

0 commit comments

Comments
 (0)