The silkobject exposes the following methods in addition to the EIP-1193 request method:
// --- Methods exported from "@silk-wallet/silk-wallet-sdk" ---/** * @param [referralCode] - Silk points referral code */initSilk(referralCode?: string): SilkProvider// --- Methods on SilkProvider ---interfaceSilkProvider {/** * Open the Silk login modal (without other wallet options). * Returns null if the user logs in. * Throws an error if the user exits without logging in. */login():Promise<null>/** * Open the Silk login modal (with other wallet options). * Returns a string denoting the wallet selected by the user. * Throws an error if the user exits without logging in. * @param [injectedProvider] - window.ethereum. The text for the button for the * injected wallet in the login modal changes based on which wallet this is. */loginSelector(injectedProvider?:EthereumProvider):Promise<'silk'|'injected'|'walletconnect'>/** * Request the user's email address. */requestEmail():Promise<string>/** * Prompt the user to mint a Zeronym SBT. * Returns the user's address if they successfully mint the SBT, null if * they have already minted before. * Throws an error if the user exits before minting. */requestSBT(type:'kyc'|'phone'):Promise<string|null>/** * This function is implemented as described in EIP-1193 * (https://eips.ethereum.org/EIPS/eip-1193#request). */request(args: { method:string, params?:unknown[] |object }):Promise<unknown>}
CodeSandbox
We created a CodeSandbox so you can easily see how these methods behave.