UNPKG

@sovrano-io/auth-sdk

Version:

Sovrano wallet auth sdk for koinos dapps

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