pix-utils
Version:
Set of tools to parse, generate and validate payments of Brazil Instant Payment System (Pix)
33 lines (32 loc) • 1.1 kB
TypeScript
import { PIXPayload, PIXRecPayload } from './types/pixDynamicPayload';
import { PixError } from './types/pixError';
export type PIXFetchResults = {
readonly jwsString: string;
readonly jws: {
readonly hdr: Uint8Array;
readonly payload: Uint8Array;
readonly signature: Uint8Array;
};
readonly header: Record<string, unknown>;
readonly payload: PIXPayload;
};
export type PIXFetchParams = {
readonly url: string;
readonly DPP?: string;
readonly codMun?: number;
};
export type PIXRecFetchResults = {
readonly jwsString: string;
readonly jws: {
readonly hdr: Uint8Array;
readonly payload: Uint8Array;
readonly signature: Uint8Array;
};
readonly header: Record<string, unknown>;
readonly payload: PIXRecPayload;
};
export type PIXRecFetchParams = {
readonly url: string;
};
export declare function fetchPayload({ url, DPP, codMun, }: PIXFetchParams): Promise<PIXFetchResults | PixError>;
export declare function fetchRecPayload({ url, }: PIXRecFetchParams): Promise<PIXRecFetchResults | PixError>;