@iexec/web3telegram
Version:
Enables secure, blockchain-based messaging by encrypting Telegram user IDs for privacy. It lets users message Ethereum account holders without knowing their Telegram details.
56 lines • 2.29 kB
JavaScript
export const MAX_DESIRED_DATA_ORDER_PRICE = 0;
export const MAX_DESIRED_APP_ORDER_PRICE = 0;
export const MAX_DESIRED_WORKERPOOL_ORDER_PRICE = 0;
export const ANY_DATASET_ADDRESS = 'any';
export const CHAIN_CONFIG = {
421614: {
name: 'arbitrum-sepolia-testnet',
dappAddress: undefined,
prodWorkerpoolAddress: '0x2956f0cb779904795a5f30d3b3ea88b714c3123f',
dataProtectorSubgraph: 'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/5YjRPLtjS6GH6bB4yY55Qg4HzwtRGQ8TaHtGf9UBWWd',
ipfsGateway: 'https://ipfs-gateway.arbitrum-sepolia-testnet.iex.ec',
ipfsUploadUrl: 'https://ipfs-upload.arbitrum-sepolia-testnet.iex.ec',
whitelistSmartContract: '0x7291ff96100DA6CF97933C225B86124ef95aEc9b',
},
42161: {
name: 'arbitrum-mainnet',
dappAddress: undefined,
prodWorkerpoolAddress: '0x8ef2ec3ef9535d4b4349bfec7d8b31a580e60244',
dataProtectorSubgraph: 'https://thegraph.arbitrum.iex.ec/api/subgraphs/id/Ep5zs5zVr4tDiVuQJepUu51e5eWYJpka624X4DMBxe3u',
ipfsGateway: 'https://ipfs-gateway.arbitrum-mainnet.iex.ec',
ipfsUploadUrl: 'https://ipfs-upload.arbitrum-mainnet.iex.ec',
whitelistSmartContract: '0x53AFc09a647e7D5Fa9BDC784Eb3623385C45eF89',
},
};
export const getChainDefaultConfig = (chainId, options) => {
const config = CHAIN_CONFIG[chainId];
if (!config) {
return null;
}
if (config.isExperimental && !options?.allowExperimentalNetworks) {
return null;
}
return config;
};
/**
* When `ethProvider` is a string, it may be an RPC URL, a decimal chain id, or an
* iExec chain host name (see each chain's `name` in CHAIN_CONFIG). RPC URLs are not
* resolved here (returns undefined); JsonRpcProvider handles those.
*/
export function tryResolveChainIdFromProviderString(hint) {
const trimmed = hint.trim();
if (/^https?:\/\//i.test(trimmed)) {
return undefined;
}
if (/^\d+$/.test(trimmed)) {
return Number(trimmed);
}
const lower = trimmed.toLowerCase();
for (const [id, cfg] of Object.entries(CHAIN_CONFIG)) {
if (cfg.name.toLowerCase() === lower) {
return Number(id);
}
}
return undefined;
}
//# sourceMappingURL=config.js.map