A typesafe SDK for revolut API.
$ yarn add revolut-sdk
# or if you have time to spare
$ npm install revolut-sdk
import { RevolutClient } from 'revolut-sdk';
const revolut = RevolutClient.run({
sandbox: true,
apiKey: 'your-api-key'
});
The SDK uses Either
and Option
to model the result returned from API.
revolut
.accounts
.get(accountId: string): TaskEither<AxiosError, Option<Account>>>;
revolut
.accounts
.getAll(): TaskEither<AxiosError, Option<Account[]>>>;
revolut
.counterparties
.add(counterparty: Counterparty): TaskEither<AxiosError, Option<Counterparty>>>;
revolut
.counterparties
.getAll(): TaskEither<AxiosError, Option<Counterparty[]>>>;
revolut
.counterparties
.get(counterpartyId: string): TaskEither<AxiosError, Option<Counterparty>>>;
revolut
.counterparties
.del(counterpartyId: string): TaskEither<AxiosError, Option<any>>>;
revolut
.payments
.transfer(transfer: TransferData): TaskEither<AxiosError, Option<Transaction>>>;
revolut
.payments
.pay(payment: PaymentData): TaskEither<AxiosError, Option<Transaction>>>;
revolut
.payments
.transactionById(transactionId: string): TaskEither<AxiosError, Option<Transaction>>>;
revolut
.payments
.transactionByRequestId(transactionRequestId: string): TaskEither<AxiosError, Option<Transaction>>>;
revolut
.payments
.cancel(paymentId: string): TaskEither<AxiosError, Option<any>>>;
revolut
.payments
.transactions(transactionsParams?: TransactionParams): TaskEither<AxiosError, Option<Transaction[]>>>;
$ yarn test