classic-ui/constants/variables.js

105 lines
3.3 KiB
JavaScript
Raw Permalink Normal View History

2022-04-22 06:05:56 +03:00
import networkConfig from '@/networkConfig'
export const CHAIN_IDS = Object.keys(networkConfig)
export const NETWORKS = CHAIN_IDS.map((i) => i.replace('netId', ''))
export const LOCALES_NAMES = {
en: 'en-US',
es: 'es-ES',
'zh-cn': 'zh-CN',
ru: 'ru-RU',
tr: 'tr-TR',
uk: 'uk-UA',
fr: 'fr-FR'
}
export const SECOND = 1000
export const ROUNDING_PRECISION = 0.0001
const DEPOSIT = 'deposit'
const WITHDRAWAL = 'withdrawal'
export const eventsType = {
DEPOSIT,
WITHDRAWAL
}
export const CONTRACT_INSTANCES = ['0.1', '1', '10', '100', '1000']
export const INDEX_DB_ERROR = 'A mutation operation was attempted on a database that did not allow mutations.'
export const ACTION = Object.freeze({
WITHDRAW: 'WITHDRAW',
WITHDRAW_WITH_EXTRA: 'WITHDRAW_WITH_EXTRA',
ARB_WITHDRAW: 'ARB_WITHDRAW',
OP_WITHDRAW: 'OP_WITHDRAW'
})
// TODO unique gas limit for each token
export const ACTION_GAS = Object.freeze({
[ACTION.WITHDRAW]: 390000,
[ACTION.WITHDRAW_WITH_EXTRA]: 550000,
[ACTION.OP_WITHDRAW]: 440000,
[ACTION.ARB_WITHDRAW]: 1900000
})
export const WITHDRAW_GAS_LIMIT = 600_000
2022-04-22 06:05:56 +03:00
export const GAS_PRICES = ['low', 'standard', 'fast']
export const addressType = { type: 'string', pattern: '^0x[a-fA-F0-9]{40}$' }
// TODO auto update in yarn updateCache
export const cachedEventsLength = {
mainnet: {
2022-06-13 10:13:54 +03:00
ENCRYPTED_NOTES: 16898
2022-04-22 06:05:56 +03:00
},
2022-06-13 10:13:54 +03:00
bsc: {
ENCRYPTED_NOTES: 11333
2022-04-22 06:05:56 +03:00
}
}
2022-11-23 14:42:59 +03:00
export const httpConfig = {
2022-11-21 14:07:23 +03:00
// buffer for tor connections
2022-11-23 14:42:59 +03:00
timeout: 30000,
keepAlive: true
}
2022-11-21 14:07:23 +03:00
2022-04-22 06:05:56 +03:00
export const PROVIDERS = {
walletConnect: {
name: 'WalletConnect',
isPartialSupport: true,
storageName: 'walletconnect',
listener: 'walletConnectSocketListener'
},
metamask: {
name: 'Metamask',
isPartialSupport: false
},
generic: {
name: 'Web3 Wallet',
isPartialSupport: true
},
mobileWallet: {
name: 'Wallet',
isPartialSupport: true
}
}
export const REGISTRY_DEPLOYED_BLOCK = {
1: 14173129
}
2023-07-14 21:32:41 +03:00
export const DONATIONS_ADDRESS = '0xB008Ce23852Be9e7d43638432617617b2e07B41e'
2022-04-22 06:05:56 +03:00
export const trees = {
PARTS_COUNT: 4,
LEVELS: 20 // const from contract
}
2022-05-26 17:04:27 +03:00
export const DUMMY_NONCE = '0x1111111111111111111111111111111111111111111111111111111111111111'
export const DUMMY_WITHDRAW_DATA =
'0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
export const CHUNK_COUNT_PER_BATCH_REQUEST = 200