mtn-momo-client
Version:
A collection of utils to interact with the mtn-momo api
22 lines (21 loc) • 1.13 kB
TypeScript
import { CreateTokenClientOptions } from './client';
declare const expiresInToExpiresAt: (expiresIn: number) => number;
type CreateAccessTokenOptions = CreateTokenClientOptions;
type CreateAccessTokenResult = {
/** The authentication token you will use to access other endpoints */
accessToken: string;
/** The token type */
tokenType: string;
/** The validity time in seconds of the token. */
expiresIn: number;
/** The timestamp in milliseconds at which the token will expiry offset by 30 secs */
expiresAt: number;
};
/**
* Create an access token which can then be used to authorize and authenticate towards the other end-points of the API. Throws errors from the API when request is not successful
* @param {CreateAccessTokenOptions} options the properties you need to create an access token
* @returns {Promise<CreateAccessTokenResult>} the access token details
*/
declare const createAccessToken: (options: CreateAccessTokenOptions) => Promise<CreateAccessTokenResult>;
export { createAccessToken, expiresInToExpiresAt };
export type { CreateAccessTokenResult, CreateAccessTokenOptions };