1.1.2 • Published 3 years ago

@twinsmaj/exbanking v1.1.2

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

exbanking

A simple NPM package banking application written in Typescript language.

API Reference

const createUser = (username: string): OK | BankingError => {}

  • Function creates new user in the system
  • New user has zero balance of any currency

const deposit = (username: string, amount: number, currency: string): (Ok & { newBalance: number } | BankingError) => {};

  • Increases user's balance in given currency by amount value
  • Returns newBalance of the user in given format

const withdraw = (username: string, amount: number, currency: string): (Ok & { newBalance: number } | BankingError) => {};

  • Decreases user's balance in given currency by amount value
  • Returns new_balance of the user in given format

const getBalance = (username: string, currency: string): (Ok & { balance: number } | BankingError) => {};

  • Returns balanceof the user in given format

const send = (fromUsername: string, toUsername: string, amount: number, currency: string): (Ok & { fromUsernameBalance: number, toUsernameBalance: number } | BankingError) => {};

  • Decreases fromUsername's balance in given currency by amount value
  • Increases toUsername's balance in given currency by amount value
  • Returns balance of fromUser and toUser in given format
1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.0

3 years ago