-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathconfig.ts
More file actions
65 lines (61 loc) · 2.43 KB
/
config.ts
File metadata and controls
65 lines (61 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
export type ChainId = number;
export interface ChainConfig {
name?: string;
dataprotectorContractAddress?: string;
sharingContractAddress?: string;
subgraphUrl?: string;
ipfsGateway?: string;
ipfsNode?: string;
smsDebugURL?: string;
workerpoolAddress?: string;
isExperimental?: boolean;
}
const CHAIN_CONFIG: Record<ChainId, ChainConfig> = {
// Bellecour
134: {
name: 'bellecour',
dataprotectorContractAddress: '0x3a4ab33f3d605e75b6d00a32a0fa55c3628f6a59',
sharingContractAddress: '0x1390c3c6a545198809f1c7c5dd2600ef74d60925',
subgraphUrl:
'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2',
ipfsGateway: 'https://ipfs-gateway.v8-bellecour.iex.ec',
ipfsNode: 'https://ipfs-upload.v8-bellecour.iex.ec',
smsDebugURL: 'https://sms-debug.iex.ec',
workerpoolAddress: 'prod-v8-bellecour.main.pools.iexec.eth',
},
// Arbitrum Sepolia
421614: {
name: 'arbitrum-sepolia-testnet',
dataprotectorContractAddress: '0x2296daeDD3090750a80fFB2D0147669984909ED2',
sharingContractAddress: '0x2485Ed90d4566516298B7D01462df8d1A41E13AE',
subgraphUrl:
'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/5YjRPLtjS6GH6bB4yY55Qg4HzwtRGQ8TaHtGf9UBWWd',
ipfsGateway: 'https://ipfs-gateway.arbitrum-sepolia-testnet.iex.ec',
ipfsNode: 'https://ipfs-upload.arbitrum-sepolia-testnet.iex.ec',
smsDebugURL: 'https://sms.arbitrum-sepolia-testnet.iex.ec', // ⚠️ default SMS is a debug SMS
workerpoolAddress: '0x39c3cdd91a7f1c4ed59108a9da4e79de9a1c1b59',
isExperimental: true,
},
};
export const getChainConfig = (
chainId: ChainId,
options?: { allowExperimentalNetworks?: boolean }
): ChainConfig => {
const config = CHAIN_CONFIG[chainId] || {};
if (config?.isExperimental && !options?.allowExperimentalNetworks) {
return {};
}
return config;
};
export const DEFAULT_CHAIN_ID = 134;
export const DEFAULT_ARWEAVE_UPLOAD_API = 'https://arweave-api.iex.ec';
export const DEFAULT_ARWEAVE_GATEWAY = 'https://arweave.net';
export const ARWEAVE_FREE_UPLOAD_MAX_SIZE = 100 * 1024; // 100kb
export const DEFAULT_DATA_NAME = '';
export const SCONE_TAG = ['tee', 'scone'];
export const DEFAULT_MAX_PRICE = 0;
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 KEY_PURPOSE_SELECTOR = 'keyHasPurpose(bytes32,uint256)';
export const GROUP_MEMBER_PURPOSE = 4;