0.9.10 • Published 1 year ago

futoin-xferengine v0.9.10

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
1 year ago

NPM Version NPM Downloads Build Status stable

NPM

About

Work in progress. Technology preview, even though partially used in production.

Universal cluster focused transaction engine concept implementation.

Documentation --> FutoIn Guide

Reference implementation of:

FTN19: FutoIn Interface - Transaction Engine
Version: 1.0

Features:

  • Market cases (aka transaction domains):
    • Deposits & Withdrawals
    • Retail
    • Payments
    • Online Gaming
    • Fee bound to transaction (both deducted & extra)
  • Multi-currency
    • ISO fiat currencies
    • Crypto currency namespace
    • Any custom currency namespace
  • Advanced limits per transaction domain:
    • Per-account statistics
    • Daily, Weekly, Monthly limits for amounts & transaction count
    • Overdraft for balance
    • Dedicated "External" accounts for integration limits of third-party systems
  • Clustering with protocol level interaction
  • External Wallet (Seamless Wallet)
  • DB-based event stream for reliable state distribution for ad-hoc systems

Supported database types

  • MySQL
  • PostgreSQL
  • SQLite
  • Potentially, any other SQL-compliant supported by futoin-database

BIG FAT WARNING

Please DO NOT use it unless you really understand what it is. The package is published as essential open source part of derived custom closed source projects of different vendors.

Installation for Node.js

Command line:

$ yarn add futoin-xferengine 

or

$ npm install futoin-xferengine --save

Concept

More detailed concept is in the FTN19 spec.

Examples

1.

API documentation

The concept is described in FutoIn specification: FTN19: FutoIn Interface - Transaction Engine v1.x

Classes

AccountsFace

Accounts Face

Kind: global class

AccountsService

Accounts Service

Kind: global class

BaseFace

Base Face with neutral common registration functionality

Kind: global class
Note: Not official API

BaseFace.LATEST_VERSION

Latest supported FTN17 version

Kind: static property of BaseFace

BaseFace.PING_VERSION

Latest supported FTN4 version

Kind: static property of BaseFace

BaseFace.register(as, ccm, name, endpoint, credentials, options)

CCM registration helper

Kind: static method of BaseFace

ParamTypeDefaultDescription
asAsyncStepssteps interface
ccmAdvancedCCMCCM instance
namestringCCM registration name
endpoint*see AdvancedCCM#register
credentials*see AdvancedCCM#register
optionsobject{}interface options
options.versionstring"1.0"interface version to use

BaseService

Base Service with common registration logic

Kind: global class

baseService._checkType(type, val) ⇒ boolean

Check value against type in spec of implemented interface

Kind: instance method of BaseService
Returns: boolean - result of check

ParamTypeDescription
typestringname of defined type
val*value to check

BaseService.register(as, executor, options) ⇒ LimitsService

Register futoin.xfers.limits interface with Executor

Kind: static method of BaseService
Returns: LimitsService - instance

ParamTypeDescription
asAsyncStepssteps interface
executorExecutorexecutor instance
optionsobjectimplementation defined options

BonusFace

Bonus Face

Kind: global class

BonusService

Bonus Service

Kind: global class

CachedAccountsFace

Efficient cached AccountsFace with event-based cache invalidation

Keeps local cache of limits and invalidates based on LIVE events.

Kind: global class

CachedAccountsFace.register(as, ccm, name, endpoint, credentials, options)

CCM registration helper

Kind: static method of CachedAccountsFace

ParamTypeDefaultDescription
asAsyncStepssteps interface
ccmAdvancedCCMCCM instance
namestringCCM registration name
endpoint*see AdvancedCCM#register
credentials*see AdvancedCCM#register
optionsobject{}interface options
options.versionstring"<latest>"interface version to use

CachedLimitsFace

Efficient cached LimitsFace with event-based cache invalidation

Keeps local cache of limits and invalidates based on LIVE events.

Kind: global class

CachedLimitsFace.register(as, ccm, name, endpoint, credentials, options)

CCM registration helper

Kind: static method of CachedLimitsFace

ParamTypeDefaultDescription
asAsyncStepssteps interface
ccmAdvancedCCMCCM instance
namestringCCM registration name
endpoint*see AdvancedCCM#register
credentials*see AdvancedCCM#register
optionsobject{}interface options
options.versionstring"<latest>"interface version to use

DepositFace

Deposits Face

Kind: global class

DepositService

Deposits Service

Kind: global class

DepositTools

XferTools with focus on Deposits use case

Kind: global class

GamingFace

Gaming Face

Kind: global class

GamingService

Gaming Service

Kind: global class

GamingTools

XferTools with focus on Gaming use case

Kind: global class

GenericFace

Generic Face

Kind: global class

GenericService

Generic Service

Kind: global class

LimitsFace

Limits Face

Kind: global class

LimitsService

Limits Service

Kind: global class

MessageFace

Message Face

Kind: global class

MessageService

Message Service

Kind: global class

MessageTools

XferTools with focus on Message processing

Kind: global class

PaymentFace

Payments Face

Kind: global class

PaymentService

Payments Service

Kind: global class

PaymentTools

XferTools with focus on Payments use case

Kind: global class

PeerFace

Peer Face

Kind: global class

PeerService

Peer Service

Kind: global class

RetailFace

Payments Face

Kind: global class

RetailService

Retail Service

Kind: global class

RetailTools

XferTools with focus on Retail use case

Kind: global class

UUIDTool

Extended UUIDTool with focus on collision safety in whole history of particular instance.

Kind: global class

UUIDTool.addXfer(xfer, val)

Call on xfer to ensure whole history uniqueness (just in case)

Kind: static method of UUIDTool

ParamTypeDescription
xferXferBuilderxfer builder object
valstringUUID in Base64 format without padding

UUIDTool.genXfer(xfer) ⇒ string

Generate UUID v4 in scope of transaction

Kind: static method of UUIDTool
Returns: string - UUID encoded in Base64 without padding

ParamTypeDescription
xferXferBuilderxfer builder object

WithdrawFace

Witdrawals Face

Kind: global class

WithdrawService

Withdrawals Service

Kind: global class

XferCCM

Special CCM implementation for XferCore

Kind: global class

xferCCM.registerServices(as, executor)

Register all services required for operation

Kind: instance method of XferCCM

ParamTypeDescription
asAsyncStepsasync step interface
executorExecutorinternal protected executor

xferCCM.registerEventServices(as, executor)

Register event services required for operation

Kind: instance method of XferCCM

ParamTypeDescription
asAsyncStepsasync step interface
executorExecutorinternal protected executor

xferCCM.registerCurrencyServices(as, executor)

Register currency services required for operation

Kind: instance method of XferCCM

ParamTypeDescription
asAsyncStepsasync step interface
executorExecutorinternal protected executor

xferCCM.registerLimitServices(as, executor)

Register limit services required for operation

Kind: instance method of XferCCM

ParamTypeDescription
asAsyncStepsasync step interface
executorExecutorinternal protected executor

xferCCM.registerAccountServices(as, executor)

Register account services required for operation

Kind: instance method of XferCCM

ParamTypeDescription
asAsyncStepsasync step interface
executorExecutorinternal protected executor

xferCCM.makeManualAlias(iface, key) ⇒ string

Get manual alias for specific iface & key combination

Kind: instance method of XferCCM
Returns: string - - manual key to be used with registerOnDemand()

ParamTypeDescription
ifacestringinterface identifier
keystringarbitrary key, typically account #

xferCCM.registerOnDemand(iface, flavour, callback)

Register callback for on-demand interface creation

Kind: instance method of XferCCM

ParamTypeDescription
ifacestringfull iface identifier
flavourstringa type of interface implementation
callbackcallablecallback to register interface

xferCCM.xferIface(as, iface, account)

Get interface with on-demand logic

Kind: instance method of XferCCM

ParamTypeDescription
asAsyncStepsasync step interface
ifacestringfull iface identifier
accountstringrelated account ID

CurrencyCacheInfoFace

An efficient version of Currency/InfoFace.

Keeps local cache of currencies and exchange rates. Listens on related event stream for changes as LIVE component.

Kind: global class

CurrencyCacheInfoFace.register(as, ccm, name, endpoint, credentials, options)

CCM registration helper

Kind: static method of CurrencyCacheInfoFace

ParamTypeDefaultDescription
asAsyncStepssteps interface
ccmAdvancedCCMCCM instance
namestringCCM registration name
endpoint*see AdvancedCCM#register
credentials*see AdvancedCCM#register
optionsobject{}interface options
options.versionstring"<latest>"interface version to use

CurrencyInfoFace

Currency Information Face

Kind: global class

CurrencyInfoService

Currency Manage Service

Kind: global class

CurrencyManageFace

Currency Management Face

Kind: global class

CurrencyManageService

Currency Manage Service

Kind: global class

documented by jsdoc-to-markdown.

0.9.10

1 year ago

0.9.9

4 years ago

0.9.8

5 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.0

6 years ago