Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (26 sloc) 971 Bytes

Account Resolver

getPublicAddress

This resolves an email address to an Ethereum public Address. Returns an account if it already exists on torus network. Creates, if otherwise

const publicAddress = await torus.getPublicAddress(params);

Parameters

  • params - VerifierArgs : The parameters passed to the method
    • verifier - enum : The verifier to use. Supported enums are google, reddit, discord
    • verifierId - string : The unique identifier for that verifier. (Say email for google, username for reddit and id for discord)

Returns

  • Promise<string> : Returns a promise which resolves to the Ethereum address associated with the email

Reference

interface VerifierArgs {
  verifier: "google" | "reddit" | "discord";
  verifierId: string;
}

Examples

const publicAddress = await torus.getPublicAddress({
  verifier: "google",
  verifierId: "random@gmail.com"
});
You can’t perform that action at this time.