UNPKG

@onboard-dx/injected-wallets

Version:

Injected wallet module for connecting browser extension and mobile wallets to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported

23 lines (22 loc) 925 B
import Joi from 'joi'; import { validate } from '@web3-onboard/common'; const walletModule = Joi.object({ label: Joi.string().required(), getIcon: Joi.function().arity(0).required(), getInterface: Joi.function().maxArity(1).required(), injectedNamespace: Joi.string().required(), checkProviderIdentity: Joi.function().arity(1).required(), platforms: Joi.array().items(Joi.string()), externalUrl: Joi.string() }); const wallets = Joi.array().items(walletModule); const filter = Joi.object().pattern(/\w+/, Joi.any().allow(Joi.boolean(), Joi.array().items(Joi.string()))); const walletOptions = Joi.object({ custom: wallets, filter, displayUnavailable: [Joi.boolean(), Joi.array().items(Joi.string())], walletUnavailableMessage: Joi.function(), sort: Joi.function(), externalUrl: Joi.string() }); export const validateWalletOptions = (data) => validate(walletOptions, data);