UNPKG

@dappykit/sdk

Version:

Web3 SDK for DApps

33 lines (32 loc) 1.5 kB
import { GatewayUser } from './gateway-user'; import { AppParams, GetAuthUrlOptions } from './interface'; import { HttpClient } from '../http-client/http-client'; import { GatewayVerification } from './gateway-verification'; export { GatewayUser, GatewayVerification }; export declare class Gateway { private gatewayUrl; private verificationRpcUrl; readonly user: GatewayUser; readonly verification: GatewayVerification; readonly gatewayHttpClient: HttpClient; constructor(gatewayUrl: string, verificationRpcUrl: string); /** * Generates an authentication URL for the given app ID and options. * * @param {number} appId - The ID of the app. * @param {Object} [options] - The options for generating the authentication URL. * @param {string} [options.authStrategy=AuthStrategy.GET_ACCOUNT] - The authentication strategy to be used. * @param {string} [options.appSignerAddress] - The address that manages data on behalf of the user within the application. * @returns {string} The generated authentication URL. */ getAuthUrl(appId: number, options?: GetAuthUrlOptions): string; /** * Parses application parameters from a string. * * @param {string} data - The string containing the application parameters. * * @returns {AppParams} - The parsed application parameters. * @throws {Error} - If the version is missing or if the parameters are invalid. */ parseAppParams(data: string): AppParams; }