1.10.1 • Published 8 months ago

@etransfer/core v1.10.1

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

@etransfer/core

ES Version Node Version NPM Package Version

This package integrates the main business functions of etransfer deposit and withdrawal, such as obtaining authorization tokens, initiating withdrawals, etc.

You only need to quote this package to easily access the etransfer deposit and withdrawal functions.

Installation

Using NPM

npm install @etransfer/core

Using Yarn

yarn add @etransfer/core

Prerequisites

Package.json Scripts

ScriptDescription
cleanUses rm to remove dist/
buildUses tsc to build package and dependent packages
lintUses eslint to lint package
lint:fixUses eslint to check and fix any warnings
formatUses prettier to format the code

How to use

See the @etransfer/example for usage examples.

See more Developer Documentation.

Init

import { eTransferCore } from '@etransfer/core';
import { IStorageSuite } from '@etransfer/types';

class Store implements IStorageSuite {
  async getItem(key: string) {
    return localStorage.getItem(key);
  }
  async setItem(key: string, value: string) {
    return localStorage.setItem(key, value);
  }
  async removeItem(key: string) {
    return localStorage.removeItem(key);
  }
}

eTransferCore.init({
  etransferUrl: 'etransfer service url',
  etransferAuthUrl: 'etransfer authorization service url' , 
  storage: new Store()
});

Get authorization

// Get new authorization from the interface, hang on the request header and set data to storage.
await eTransferCore.getAuthTokenFromApi()

// Get authorization from storage, if the data expired, get new authorization from the interface.
await eTransferCore.getAuthToken();

Withdraw

// First, as shown above, init eTransferCore.
// Then, as shown above, get authorization and hang on the request header.
// Then, you can withdraw with correct params.
const { orderId, transactionId} = await eTransferCore.sendWithdrawOrder();
1.10.1

8 months ago

1.10.0

8 months ago

1.9.1

8 months ago

1.8.0

8 months ago

1.7.1-alpha.1

9 months ago

1.7.0

9 months ago

1.6.5-alpha.3

9 months ago

1.6.5-alpha.2

9 months ago

1.6.5-alpha.1

9 months ago

1.6.5-alpha.0

9 months ago

1.6.4

9 months ago

1.6.3

9 months ago

1.6.3-alpha.0

9 months ago

1.6.2

9 months ago

1.6.1

9 months ago

1.6.0

10 months ago

1.5.1

10 months ago

1.5.1-alpha.2

10 months ago

1.5.1-alpha.1

10 months ago

1.5.1-alpha.0

10 months ago

1.5.0

10 months ago

1.4.1

10 months ago

1.4.0

10 months ago

1.3.0

10 months ago

1.2.1-alpha.5

10 months ago

1.2.1-alpha.4

10 months ago

1.2.1-alpha.3

10 months ago

1.3.0-alpha.0

10 months ago

1.2.1-alpha.2

11 months ago

1.2.1-alpha.1

11 months ago

1.2.1-alpha.0

11 months ago

1.2.0

11 months ago

1.2.0-alpha.3

11 months ago

1.2.0-alpha.2

11 months ago

1.2.0-alpha.1

11 months ago

1.2.0-alpha.0

11 months ago

1.1.0-alpha.0

11 months ago

1.0.0

1 year ago

1.0.0-alpha.11

1 year ago

1.0.0-alpha.10

1 year ago

1.0.0-alpha.9

1 year ago

1.0.0-alpha.8

1 year ago

1.0.0-alpha.7

1 year ago

1.0.0-alpha.6

1 year ago

1.0.0-alpha.5

1 year ago

1.0.0-alpha.4

1 year ago

1.0.0-alpha.3

1 year ago

1.0.0-alpha.2

1 year ago

1.0.0-alpha.1

1 year ago

1.0.0-alpha.0

1 year ago