interface IRelay {
    fetchPKPs(body: string): Promise<IRelayFetchResponse>;
    generateRegistrationOptions(username?: string): Promise<any>;
    getUrl(): string;
    mintPKP(body: string): Promise<IRelayMintResponse>;
    mintPKPWithAuthMethods(authMethods: AuthMethod[], options: {
        addPkpEthAddressAsPermittedAddress?: boolean;
        pkpPermissionScopes?: number[][];
        sendPkpToitself?: boolean;
    }): Promise<{
        pkpEthAddress?: string;
        pkpPublicKey?: string;
        pkpTokenId?: string;
    }>;
    pollRequestUntilTerminalState(requestId: string): Promise<IRelayPollStatusResponse>;
}

Implemented by

Methods

  • Generate options for registering a new credential to pass to the authenticator

    Parameters

    • Optionalusername: string

      Optional username to associate with the credential

    Returns Promise<any>

    Registration options for the browser to pass to the authenticator

  • Mint a new PKP for the given auth method

    Parameters

    • authMethods: AuthMethod[]

      AuthMethods authentication methods to be added to the pkp

    • options: {
          addPkpEthAddressAsPermittedAddress?: boolean;
          pkpPermissionScopes?: number[][];
          sendPkpToitself?: boolean;
      }
      • OptionaladdPkpEthAddressAsPermittedAddress?: boolean
      • OptionalpkpPermissionScopes?: number[][]
      • OptionalsendPkpToitself?: boolean

    Returns Promise<{
        pkpEthAddress?: string;
        pkpPublicKey?: string;
        pkpTokenId?: string;
    }>

    pkp information

    • Throws an error if no AuthMethods are given