UNPKG

@nkhind/vivawallet-sdk

Version:
24 lines (23 loc) 1.01 kB
import { VivawalletAPIInit } from '../types/Vivawallet.types'; import VivaSkull from './VivaSkull.class'; declare class VivaAuth extends VivaSkull { /** * This code is used for Viva Wallet webhook verification (validation and events) and should be return in the `json` response with the following format: * ```json * { * "key": "<webhookCode>" * } * ``` */ webhookCode: string | null; vivaTotken: string | null; constructor(datas: VivawalletAPIInit); /** Credentials verification, `throw` error if credentials is not gived ***(required for API calls)*** */ init(): Promise<void>; /** Return the VivaWallet API Auth2.0 code from Credentials (needed for API Bearer calls) or `null` on request failed */ getVivaToken(): Promise<string | null>; getVivaBasicToken(): string; /** Return the code needed for Viva webhooks returns or `null` on request failed */ getVivaWebhookCode(): Promise<string | null>; } export default VivaAuth;