Skip to content

Commit

Permalink
Merge pull request #769 from telosnetwork/753-crosschain--change-hard…
Browse files Browse the repository at this point in the history
…coded-telos-id-for-dynamic-chain-id

#753 | Crosschain - Step Four: change hardcoded telos id for dynamic chain id
  • Loading branch information
Viterbo authored Nov 19, 2024
2 parents bcb0d80 + b4a7f98 commit ce25b1c
Show file tree
Hide file tree
Showing 105 changed files with 5,233 additions and 1,287 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ module.exports = {
'curly': 'error',
'brace-style': ['error', '1tbs', { 'allowSingleLine': false }],
'no-restricted-imports': ['error', {
'patterns': ['.*'], // disallow relative imports
}],
'no-return-assign': ['error', 'always'],
'no-param-reassign': 'error',
Expand Down
41 changes: 3 additions & 38 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,24 @@
The environment variables ares set based on the single variable `MAINNET=true`
(or absence thereof) in the root `.env` file. The following env vars are then assigned in
`quasar.config.js`.
*/
Cross chain support: most of the variables that were here have been moved to `src/antelope/chains/evm`
*/
const sharedEnv = {
NETWORK_PROTOCOL: 'https',
NETWORK_PORT: 443,
NETWORK_EVM_CONTRACT: 'eosio.evm',
PROJECT_ID: '14ec76c44bae7d461fa0f5fd5f8a9da1',
};

const TESTNET = {
...sharedEnv,
APP_NAME: 'Teloscan (testnet)',
NETWORK_HOST: 'testnet.telos.net',
NETWORK_CHAIN_ID:
'1eaa0824707c8c16bd25145493bf062aecddfeb56c736f6ba6397f3195f33c9f',
NETWORK_EVM_RPC: 'https://testnet.telos.net/evm',
NETWORK_EVM_ENDPOINT: 'https://testnet.telos.net',
NETWORK_EVM_CHAIN_ID: 41,
NETWORK_EVM_DISPLAY: 'Telos Testnet',
NETWORK_EVM_NAME: 'telos-evm-testnet',
HYPERION_ENDPOINT: 'https://testnet.telos.net',
NETWORK_EXPLORER: 'https://explorer-test.telos.net',
TELOS_API_ENDPOINT: 'https://api-dev.telos.net/v1', //'http://localhost:9999/v1', //for local instance of api
INDEXER_API_ENDPOINT: 'https://api.testnet.teloscan.io/v1',
VERIFIED_CONTRACTS_BUCKET: 'verified-evm-contracts-testnet',
STAKED_TLOS_CONTRACT_ADDRESS: '0xa9991E4daA44922D00a78B6D986cDf628d46C4DD',
TELOS_ESCROW_CONTRACT_ADDRESS: '0x7E9cF9fBc881652B05BB8F26298fFAB538163b6f',
MULTICALL_CONTRACT_ADDRESS: '0x39b0CF441E616e4e21a5f7b37c9CE0Ca750bd05B',
OREID_APP_ID: 't_1e0417d2456e401893ec106e5e4c6314',
OREID_APP_ID_NATIVE: 't_a61e9926d5204387a9ac113dfce7cbc5',
};

const MAINNET = {
...sharedEnv,
APP_NAME: 'Teloscan',
NETWORK_HOST: 'mainnet.telos.net',
NETWORK_CHAIN_ID:
'4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11',
NETWORK_EVM_RPC: 'https://mainnet.telos.net/evm',
NETWORK_EVM_ENDPOINT: 'https://mainnet.telos.net',
NETWORK_EVM_CHAIN_ID: 40,
NETWORK_EVM_DISPLAY: 'Telos',
NETWORK_EVM_NAME: 'telos-evm',
HYPERION_ENDPOINT: 'https://mainnet.telos.net',
NETWORK_EXPLORER: 'https://explorer.telos.net',
TELOS_API_ENDPOINT: 'https://api.telos.net/v1', //'http://localhost:9999/v1', //for local instance of api
INDEXER_API_ENDPOINT: 'https://api.teloscan.io/v1',
VERIFIED_CONTRACTS_BUCKET: 'verified-evm-contracts',
STAKED_TLOS_CONTRACT_ADDRESS: '0xB4B01216a5Bc8F1C8A33CD990A1239030E60C905',
TELOS_ESCROW_CONTRACT_ADDRESS: '0x95F5713A1422Aa3FBD3DCB8D553945C128ee3855',
MULTICALL_CONTRACT_ADDRESS: '0xdDCbf776dF3dE60163066A5ddDF2277cB445E0F3',
OREID_APP_ID: 'p_b5cfbadeb17a44bdaf01e73b3120d202',
OREID_APP_ID_NATIVE: 'p_751f87258d5b40998b55c626d612fd4e',
};

const env = process.env.NETWORK === 'mainnet' ? MAINNET : TESTNET;
Expand Down
4 changes: 0 additions & 4 deletions quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ module.exports = function(/* ctx */) {
// --> boot files are part of "main.js"
// https://quasar.dev/quasar-cli/boot-files
boot: [
'ual',
'hyperion',
'i18n',
'api',
'errorHandling',
'telosApi',
'evm',
'q-component-defaults',
'antelope',
Expand Down
8 changes: 3 additions & 5 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import moment from 'moment';
import { getAntelope, useChainStore } from 'src/antelope';
import { TELOS_NETWORK_NAMES } from 'src/antelope/mocks/chain-constants';
import { indexerApi } from 'src/boot/telosApi';
import { ual } from 'src/boot/ual';
import { providerManager } from 'src/boot/evm';
const $store = useStore();
Expand All @@ -28,8 +26,8 @@ onMounted(async () => {
script.defer = true;
document.body.appendChild(script);
}
const health = await indexerApi.get('/health');
const indexerApi = useChainStore().currentChain.settings.getIndexerApi();
const health = await indexerApi.get('/v1/health');
if (health.data?.secondsBehind > 3) {
let behindBy = moment(health.data.secondsBehind * 1000).utc().format('HH:mm:ss');
Expand Down Expand Up @@ -63,7 +61,7 @@ onMounted(async () => {
return;
}
const loginObj = JSON.parse(loginData);
const wallet = ual.getAuthenticators().availableAuthenticators.find(a => a.getName() === loginObj.provider);
const wallet = getAntelope().config.authenticatorsGetter().find(a => a.getName() === loginObj.provider);
wallet?.logout();
}
$store.commit('login/setLogin', {});
Expand Down
Loading

0 comments on commit ce25b1c

Please sign in to comment.