Skip to content

Commit

Permalink
Merge pull request #879 from telosnetwork/741-epic-crosschain-compatable
Browse files Browse the repository at this point in the history
#741 | EPÎC - Crosschain Compatable (to dev)
  • Loading branch information
Viterbo authored Nov 25, 2024
2 parents dbc2471 + 1cc0127 commit d7857f1
Show file tree
Hide file tree
Showing 184 changed files with 5,357 additions and 2,306 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
43 changes: 3 additions & 40 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +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/config/chains`
*/
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',
EXPORT_API_ENDPOINT: 'https://api.testnet.teloscan.io',
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',
EXPORT_API_ENDPOINT: 'https://api.teloscan.io',
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
File renamed without changes
File renamed without changes
Binary file added public/assets/telos-testnet-logo--dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/telos-testnet-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
12 changes: 5 additions & 7 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import { useI18n } from 'vue-i18n';
import { useQuasar } from 'quasar';
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 { getAntelope, useChainStore } from 'src/core';
import { TELOS_NETWORK_NAMES } from 'src/core/mocks/chain-constants';
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
7 changes: 0 additions & 7 deletions src/antelope/index.ts

This file was deleted.

95 changes: 0 additions & 95 deletions src/antelope/mocks/ChainStore.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/antelope/mocks/index.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/antelope/types/Theme.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/antelope/types/index.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/antelope/wallets/index.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/antelope/wallets/utils/abi/signature/index.ts

This file was deleted.

Binary file added src/assets/tokens/telos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 14 additions & 2 deletions src/boot/antelope.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
import { boot } from 'quasar/wrappers';
import { initAntelope } from 'src/antelope/wallets/init';

import { initAntelope } from 'src/core/wallets/init';
import { evmSettings, useChainStore } from 'src/core';

export default boot(({ app }) => {
initAntelope(app);

const defaultNetwork = Object.keys(evmSettings)[0];
let network = new URLSearchParams(window.location.search).get('network');
if (network) {
const exists = Object.keys(evmSettings).some(key => evmSettings[key].getNetwork() === network);
if (!exists) {
network = defaultNetwork;
}
} else {
network = defaultNetwork;
}
useChainStore().setChain('not-used', network);
});


Expand Down
71 changes: 0 additions & 71 deletions src/boot/antelopeApi.js

This file was deleted.

Loading

0 comments on commit d7857f1

Please sign in to comment.