@web3auth/modal
Version:
Multi chain wallet aggregator for web3Auth
25 lines (21 loc) • 856 B
JavaScript
;
var vue = require('vue');
var useWeb3AuthInner = require('./useWeb3AuthInner.js');
const useChain = () => {
const context = useWeb3AuthInner.useWeb3AuthInner();
const chainId = vue.computed(() => {
var _context$web3Auth$val;
if (!((_context$web3Auth$val = context.web3Auth.value) !== null && _context$web3Auth$val !== void 0 && _context$web3Auth$val.currentChain)) return null;
return context.web3Auth.value.currentChain.chainId;
});
const chainNamespace = vue.computed(() => {
var _context$web3Auth$val2;
if (!((_context$web3Auth$val2 = context.web3Auth.value) !== null && _context$web3Auth$val2 !== void 0 && _context$web3Auth$val2.currentChain)) return null;
return context.web3Auth.value.currentChain.chainNamespace;
});
return {
chainId,
chainNamespace
};
};
exports.useChain = useChain;