monzolib
Version:
Fully Featured JS/Node Monzo Library
54 lines (53 loc) • 1.56 kB
TypeScript
import { Amount } from './Amount';
import { MonzoRequest, QueryString } from '.';
export declare class Pot {
private readonly pot;
constructor(pot: MonzoPotResponse);
get balance(): Amount;
get created(): Date;
get currency(): string;
get deleted(): boolean;
get id(): string;
get goalAmount(): Amount | undefined;
get maximumBalance(): number;
get minimumBalance(): number;
get name(): string;
get roundUp(): boolean;
get style(): string;
get type(): string;
get updated(): Date;
deletePotRequest(): MonzoRequest;
depositRequest(depositOpts: MonzoPotDepositOpts): MonzoRequest;
withdrawRequest(withdrawOpts: MonzoPotWithdrawOpts): MonzoRequest;
toString(): string;
}
export declare function potsRequest(): MonzoRequest;
export declare function potRequest(id: string): MonzoRequest;
export interface MonzoPotResponse {
balance: number;
created: string;
currency: string;
deleted: boolean;
id: string;
goal_amount?: number;
maximum_balance: number;
minimum_balance: number;
name: string;
round_up: boolean;
style: string;
type: string;
updated: string;
}
export interface MonzoPotsResponse {
pots: MonzoPotResponse[];
}
export interface MonzoPotTransferOpts extends QueryString {
amount: number;
dedupe_id: string;
}
export interface MonzoPotDepositOpts extends MonzoPotTransferOpts {
source_account_id: string;
}
export interface MonzoPotWithdrawOpts extends MonzoPotTransferOpts {
destination_account_id: string;
}