Constructors

Properties

formats: {
    web2: {
        discord: string[];
        github: string[];
        twitter: string[];
    };
} = ...

Methods

  • Add an Unstoppable Domain identity to the GCR.

    Flow:

    1. User selects an authorized address from their domain records
    2. User signs challenge with their wallet (MetaMask for EVM, Phantom for Solana)
    3. Submit domain + signature for verification

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC

    • domain: string

      The UD domain (e.g., "brad.crypto")

    • signingAddress: string

      The address used to sign (from domain's authorized addresses)

    • signature: string

      Signature from the signing address

    • signedData: string

      The challenge message that was signed

    • OptionalreferralCode: string

      Optional referral code

    Returns Promise<RPCResponseWithValidityData>

    The response from the RPC call

    const identities = new Identities()
    // Get signable addresses for the domain
    const addresses = await identities.getUDSignableAddresses("brad.crypto")
    const signingAddress = addresses[0].address // User selects address

    // Generate challenge with selected address
    const challenge = identities.generateUDChallenge(demos.publicKey, signingAddress)

    // User signs challenge (EVM example with MetaMask)
    const signature = await ethereum.request({
    method: 'personal_sign',
    params: [challenge, signingAddress]
    })

    await identities.addUnstoppableDomainIdentity(
    demos,
    "brad.crypto",
    signingAddress,
    signature,
    challenge
    )
  • Create a web2 proof payload for use with web2 identity inference.

    Parameters

    Returns Promise<string>

    The web2 proof payload string.

  • Generate a challenge message for Unstoppable Domain ownership verification.

    The user must sign this challenge with one of their domain's authorized addresses using MetaMask (EVM) or Phantom (Solana) wallet.

    Parameters

    • demosPublicKey: string

      The user's Demos public key (hex string)

    • signingAddress: string

      The address that will sign the challenge (from domain's authorized addresses)

    Returns string

    Challenge message to be signed

  • Get demos accounts by linked discord identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked github identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked telegram identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked twitter identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

    Returns Promise<Account[]>

    The account associated with the username.

  • Get demos accounts by linked web2 identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • context:
          | "github"
          | "twitter"
          | "telegram"
          | "discord"

      The context of the identity to get the account for.

    • username: string

      The username to get the account for.

    • OptionaluserId: string

      The user id to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get demos accounts by linked web3 identity.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • chain: `${string}.${string}`

      The chain as a string containing the chain and subchain separated by a period (eg. "eth.mainnet" | "solana.mainnet", etc.)

    • address: string

      The address to get the account for.

    Returns Promise<Account[]>

    The account associated with the identity.

  • Get the identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • call: string = "getIdentities"
    • Optionaladdress: string

      The address to get identities for.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Get referral information for an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get referral info for. Defaults to the connected wallet's address.

    Returns Promise<RPCResponse>

    The referral information associated with the address.

  • Get all signable addresses for a UD domain.

    This method resolves the domain and extracts all addresses from domain records that can be used to sign challenges (EVM and Solana addresses).

    Parameters

    • domain: string

      The UD domain (e.g., "brad.crypto")

    Returns Promise<SignableAddress[]>

    Array of signable addresses with their types

    const identities = new Identities()
    const addresses = await identities.getUDSignableAddresses("brad.crypto")
    console.log(addresses)
    // [
    // { address: "0x1234...", recordKey: "crypto.ETH.address", signatureType: "evm" },
    // { address: "ABC123...", recordKey: "crypto.SOL.address", signatureType: "solana" }
    // ]
  • Get the web2 identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get identities for.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Get the crosschain identities associated with an address.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • Optionaladdress: string

      The address to get identities for.

    Returns Promise<RPCResponse>

    The identities associated with the address.

  • Validate a referral code to check if it exists and is valid.

    Parameters

    • demos: Demos

      A Demos instance to communicate with the RPC.

    • referralCode: string

      The referral code to validate.

    Returns Promise<RPCResponse>

    The validation result containing validity status, referrer public key, and message.