@marceloclp/monzojs
Version:
Unofficial wrapper for the Monzo API written in TypeScript.
31 lines (30 loc) • 943 B
TypeScript
export declare type Types = 'uk_retail' | 'uk_retail_joint' | 'uk_monzo_flex' | 'uk_monzo_flex_backing_loan';
export declare type Owner = {
user_id: string;
preferred_name: string;
preferred_first_name: string;
};
/**
* Accounts represent a store of funds, and have a list of transactions.
*
* @see https://docs.monzo.com/#accounts
*/
export declare type Account<T extends Types = Types> = {
id: string;
type: T;
closed: boolean;
created: string;
description: string;
currency: string;
country_code: string;
owners: Owner[];
};
export declare type RetailAccount = Account<'uk_retail' | 'uk_retail_joint'> & {
account_number: string;
sort_code: string;
payment_details: Record<'locale_uk', {
account_number: string;
sort_code: string;
}>;
};
export declare type GetAccount<T extends Types> = T extends 'uk_retail' | 'uk_retail_joint' ? RetailAccount : Account<T>;