1.0.4 • Published 3 years ago

ex-banking-core v1.0.4

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

ex-banking-core

Try out: Demo

Installation

Using npm:

$ npm i ex-banking-core

Usage

const exBankingCore = require('ex-banking-core')

const client = new exBankingCore.Client()

## User

// Create users
client.User.createUser(username: string): ResponseOk | UserAlreadyExistsError;

// List all users
client.User.getAll(): User[];

// Check does user exists
client.User.doesUserExists(username: string): boolean;

// Find user by username
client.User.findByUsername(username: string): User | null;

## Account

// List all accounts
client.Account.getAll(): Account[];

// Deposit funds
client.Account.deposit(username: string, amount: number, currency: string): DepositResponse;

// Withdrawal funds
client.Account.withdraw(username: string, amount: number, currency: string): WithdrawalResponse;

// Get ballance
client.Account.getBalance(username: string): CurrencyBalance[] | UserDoesNotExistError;

// Get ballance by currency name
client.Account.getBalanceByCurrencyName(
    username: string, 
    currency: string
): { balance: number } | UserDoesNotExistError | CurrencyDoesNotExistsError;

// Send Funds
client.Account.send(
    fromUsername: string,
    toUsername: string,
    amount: number,
    currency: string
): TransferMoneyResponse;
  
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago