Skip to content

Commit

Permalink
Merge pull request #540 from telosnetwork/transactions-route
Browse files Browse the repository at this point in the history
Update global variable exports, setup refactor examples
  • Loading branch information
donnyquixotic authored Feb 22, 2024
2 parents 3722793 + e76b4a9 commit c6463b9
Show file tree
Hide file tree
Showing 13 changed files with 882 additions and 1,489 deletions.
15 changes: 15 additions & 0 deletions src/boot/errorHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,18 @@ export default boot(({ app, store }) => {
store['$t'] = app.config.globalProperties.$t;

});

export {
errorNotification,
unexpectedErrorNotification,
warningNotification,
successNotification,
notifySuccessTransaction,
notifySuccessMessage,
notifySuccessCopy,
notifyFailure,
notifyFailureWithAction,
notifyDisconnected,
notifyNeutralMessage,
notifyRememberInfo,
};
6 changes: 4 additions & 2 deletions src/boot/evm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ const hyperion = axios.create({
baseURL: process.env.NETWORK_EVM_ENDPOINT,
});

const providerManager = new ProviderManager();

export default boot(({ app, store }) => {
store.$providerManager = app.config.globalProperties.$providerManager = new ProviderManager();
store.$providerManager = app.config.globalProperties.$providerManager = providerManager;
store.$evm = app.config.globalProperties.$evm = evm;
store.$evmEndpoint = app.config.globalProperties.$evmEndpoint = hyperion;
});

export { evm };
export { evm, providerManager };
8 changes: 1 addition & 7 deletions src/boot/telosApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default boot(({ app, store }) => {
app.config.globalProperties.$telosApi = telosApi;
app.config.globalProperties.$indexerApi = indexerApi;
app.config.globalProperties.$fragmentParser = fragmentParser;
app.config.globalProperties.$contractManager = contractManager;
store.$contractManager = app.config.globalProperties.$contractManager = markRaw(contractManager);
store.$indexerApi = indexerApi;
// Intercept API answer to set contracts & abi in cache directly
Expand All @@ -41,11 +40,6 @@ export default boot(({ app, store }) => {
return Promise.reject(error);
});

// TODO remove global property assignments above after full migration to composition
app.provide('$telosApi', telosApi);
app.provide('$contractManager', markRaw(contractManager));
app.provide('$indexerApi', indexerApi);
app.provide('$fragmentParser', fragmentParser);
});

export { telosApi, indexerApi };
export { telosApi, indexerApi, contractManager, fragmentParser };
35 changes: 19 additions & 16 deletions src/boot/ual.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@ import { UAL } from 'universal-authenticator-library';
import { Wombat } from 'ual-wombat';
import { Anchor } from 'ual-anchor';

export default boot(async({ app, store }) => {
const chain = {
chainId: process.env.NETWORK_CHAIN_ID,
rpcEndpoints: [
{
protocol: process.env.NETWORK_PROTOCOL,
host: process.env.NETWORK_HOST,
port: process.env.NETWORK_PORT,
},
],
};
const chain = {
chainId: process.env.NETWORK_CHAIN_ID,
rpcEndpoints: [
{
protocol: process.env.NETWORK_PROTOCOL,
host: process.env.NETWORK_HOST,
port: process.env.NETWORK_PORT,
},
],
};

const authenticators = [
new Anchor([chain], { appName: process.env.APP_NAME }),
new Wombat([chain], { appName: process.env.APP_NAME }),
];

const authenticators = [
new Anchor([chain], { appName: process.env.APP_NAME }),
new Wombat([chain], { appName: process.env.APP_NAME }),
];
const ual = new UAL([chain], 'ual', authenticators);

const ual = new UAL([chain], 'ual', authenticators);
export default boot(async({ app, store }) => {
store['$ual'] = ual;
app.config.globalProperties.$ual = ual;
});

export { ual };
Loading

0 comments on commit c6463b9

Please sign in to comment.