UNPKG

@web3-wallet/core

Version:
25 lines (24 loc) 910 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createWallet = void 0; /** * @param connector - The wallet connector. * @returns Wallet - The created public wallet api. */ const createWallet = (connector) => { const getConnector = () => { return typeof connector === 'function' ? connector() : connector; }; const wallet = { getWalletName: () => getConnector().walletName, getConnector, getStore: () => getConnector().store, detectProvider: () => getConnector().detectProvider(), connect: (...args) => getConnector().connect(...args), autoConnect: (...args) => getConnector().autoConnect(...args), disconnect: (...args) => getConnector().disconnect(...args), watchAsset: (...args) => getConnector().watchAsset(...args), }; return wallet; }; exports.createWallet = createWallet;