UNPKG

@pushchain/ui-kit

Version:

Push Chain is a true universal L1 that is 100% EVM compatible. It allows developers to deploy once and make their apps instantly compatible with users from all other L1s (Ethereum, Solana, etc) with zero on-chain code change.

29 lines 998 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseWalletProvider = void 0; const address_1 = require("./helpers/address"); class BaseWalletProvider { name; icon; supportedChains; constructor(name, icon, supportedChains) { this.name = name; this.icon = icon; this.supportedChains = supportedChains; } formatAddress(rawAddress, chainType, chainId) { const caipAddress = (0, address_1.toCAIPFormat)(rawAddress, chainType, chainId); return { caipAddress }; } validateChainType(chainType) { if (!chainType && this.supportedChains.length === 1) { return this.supportedChains[0]; } if (chainType && !this.supportedChains.includes(chainType)) { throw new Error(`${this.name} does not support ${chainType}`); } return chainType; } } exports.BaseWalletProvider = BaseWalletProvider; //# sourceMappingURL=BaseWalletProvider.js.map