@marceloclp/monzojs
Version:
Unofficial wrapper for the Monzo API written in TypeScript.
37 lines (36 loc) • 1.78 kB
TypeScript
import { Monzo, MonzoAPI } from '../types';
import { AuthedEndpoint } from '../types/endpoints';
/**
* Returns an individual transaction, fetched by its id.
*
* @see https://docs.monzo.com/#retrieve-transaction
*/
export declare const getTransaction: <E extends "merchant"[] | undefined = undefined>(accessToken: string, { transactionId, expand }: MonzoAPI.Transactions.GetTransactionParams<E>) => Promise<Monzo.Transactions.ExpandedTransaction<E>>;
/**
* Returns a list of transactions on the user’s account.
*
* @see https://docs.monzo.com/#list-transactions
*/
export declare const getTransactions: <E extends "merchant"[] | undefined = undefined>(accessToken: string, { accountId, expand, limit, since, before, }: MonzoAPI.Transactions.GetTransactionsParams<E>) => Promise<Monzo.Transactions.ExpandedTransaction<E>[]>;
/**
* Update a transaction's metadata.
*
* NOTE:
*
* It seems Monzo's documentation is out-of-date, and only the notes metadata
* param can be updated. Attempting to update any other field will result in no
* changes to the transaction object returned by Monzo.
*
* Keep in mind that the notes parameter will be seen on the app by the user,
* under each transaction's name, so attempting to store a stringified object or
* similar structure is not a good solution.
*
* Refer to the safelyAnnotateTransaction method to update the notes directly.
*
* @see https://docs.monzo.com/#annotate-transaction
*/
export declare const annotateTransaction: AuthedEndpoint<MonzoAPI.Transactions.AnnotateTransactionParams, Monzo.Transactions.Transaction>;
/**
* Update a transaction's notes.
*/
export declare const safelyAnnotateTransaction: AuthedEndpoint<MonzoAPI.Transactions.SafelyAnnotateTransactionParams, Monzo.Transactions.Transaction>;