monzolib
Version:
Fully Featured JS/Node Monzo Library
51 lines (50 loc) • 1.4 kB
TypeScript
import { QueryString, MonzoRequest } from './api';
export declare class Account {
private readonly acc;
constructor(acc: MonzoAccountResponse);
get created(): Date;
get description(): string;
get id(): string;
get name(): string;
get owners(): AccountOwner[];
get userId(): string;
get ownerNames(): string[];
balanceRequest(): MonzoRequest;
transactionRequest(txId: string): MonzoRequest;
transactionsRequest(options?: {
since?: Date | string;
before?: Date;
limit?: number;
}): MonzoRequest;
targetsRequest(): MonzoRequest;
limitsRequest(): MonzoRequest;
overdraftStatusRequest(): MonzoRequest;
get json(): MonzoAccountResponse;
get stringify(): string;
}
export declare function accountsRequest(): MonzoRequest;
export interface MonzoAccountsResponse {
accounts: MonzoAccountResponse[];
}
export interface AccountOwner {
user_id: string;
preferred_name: string;
preferred_first_name: string;
}
export interface MonzoAccountResponse {
account_number: string;
closed: boolean;
created: string;
description: string;
id: string;
owners: AccountOwner[];
sort_code: string;
type: string;
}
export interface MonzoTransactionQuery extends QueryString {
account_id: string;
'expand[]'?: string;
since?: string;
before?: string;
limit?: number;
}