UNPKG

revolut-sdk

Version:
31 lines (30 loc) 1.01 kB
import { AxiosError } from 'axios'; import { Option } from 'fp-ts/lib/Option'; import { TaskEither } from 'fp-ts/lib/TaskEither'; import { UUID } from '../common'; import { Account } from './accounts'; import API from './api'; export interface CounterPartyPayload { name: string; profile_type: 'business' | 'personal'; phone: string; email: string; } export interface Counterparty { id: UUID; name: string; phone: string; profile_type: 'business' | 'personal'; country: string; state: 'created' | 'deleted'; type: 'revolut' | 'external'; created_at: string; updated_at: string; accounts: Account[]; } export default class Counterparties extends API { add: (counterparty: CounterPartyPayload) => TaskEither<AxiosError, Option<Counterparty>>; get: (id: string) => TaskEither<AxiosError, Option<Counterparty>>; getAll: () => TaskEither<AxiosError, Option<Counterparty[]>>; del: (id: string) => TaskEither<AxiosError, Option<Counterparty>>; }