UNPKG

@sovrano-io/auth-sdk

Version:

Sovrano wallet auth sdk for koinos dapps

70 lines (69 loc) 1.65 kB
/** * The request data for a new account signup */ export interface SignupRequest { redirectUrl: string; } /** * Represents the response from the signup request */ export type SignupResponse = { /** Indicates a successful signup */ type: "success"; /** The address of the user */ address: string; /** The nickname of the user */ nickname: string; } | { /** Indicates an error during signup */ type: "error"; /** The error code */ errorCode: number; /** The error message */ errorMessage: string; }; export declare class Signup { /** * Get the URL to redirect to for signup * @param data * @returns */ static getRequestUrl(data: SignupRequest): string; /** * Get the URL to redirect to after signup * * @param data * @param url * @returns */ static getResponseUrl(data: SignupResponse, url: string): string; /** * Encode the signup request data * @param data * @returns */ static encodeRequest(data: SignupRequest): string; /** * Decode the signup request data * @param data * @returns */ static decodeRequest(data: string): SignupRequest; /** * Encode the signup response data * @param data * @returns */ static encodeResponse(data: SignupResponse): string; /** * Decode the signup response data * @param data * @returns */ static decodeResponse(data: string): SignupResponse; /** * Get the response data from the URL * @returns */ static getResponse(responseUrl: string): SignupResponse; }