2.0.2 • Published 5 months ago

@ipeakoin/ipeakoin-sdk v2.0.2

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

iPeakoin Concept

The developer API aims to allow enterprises to integrate with iPeakoin systems and easily make it part of their workflow. This API allows developers to use businesses such as Global Account, Crypto Asset, and Quantum Card.

Project Status

It supports auth related interfaces and also provides other interfaces required by iPeakoin Api. Please refer to the following code example for specific usage.

Notice:Please ask the professional technical personnel of the merchant to pay attention to the correctness and compatibility of the system and software, as well as the risks involved when using them.

Environmental Requirements

  • Node 12+

Install

The latest version is already available in npmjs

yarn add @ipeakoin/ipeakoin-sdk or npm i @ipeakoin/ipeakoin-sdk

Used in JS

const Client = require('@ipeakoin/ipeakoin-sdk');

const client = new Client({
  clientId: '<your-client-id>',
  clientSecret: '<your-client-secret>',
  baseUrl: 'https://api-sandbox.ipeakoin.com',
});

Used in TS

import Client from '@ipeakoin/ipeakoin-sdk';

const client = new Client({
  clientId: '<your-client-id>',
  clientSecret: '<your-client-secret>',
  baseUrl: 'https://api-sandbox.ipeakoin.com',
});

Used in nestjs

Please take a look nestjs-ipeakoin-node-sdk

Start Using

get access token

const codeRes = await client.getCode();
const res = await client.getAccessToken(codeRes.content.code);
console.log(res.content.accessToken);

refresh access token

const res = await client.refreshAccessToken(refreshToken);
console.log(res);

encrypt Hmac SHA256

const sign = await client.encryptHmacSHA256(
  {
    id: 'ee74c872-8173-4b67-81b1-5746e7d5ab88',
    accountId: null,
    holderId: 'd2bd6ab3-3c28-4ac7-a7c4-b7eed5eee367',
    currency: 'USD',
    settlementCurrency: null,
    counterparty: 'SAILINGWOOD;;US;1800948598;;091000019',
    transactionAmount: 11,
    fee: 0,
    businessType: 'Inbound',
    status: 'Closed',
    transactionTime: '2021-11-22T07:34:10.997Z',
    transactionId: '124d3804-defa-4033-9f30-1d8b0468e506',
    clientTransactionId: null,
    createTime: '2021-11-22T07:34:10.997Z',
    appendFee: 0,
  },
  '25d55ad283aa400af464c76d713c07ad',
);
console.log(sign);
// => 8287d5539c03918c9de51176162c2bf7065d5a8756b014e3293be1920c20d102

V1 Interface Example

// Create a account
const res = await client.v1.createAccount({
  phone: '+8613100200001',
  name: 'klover',
  accessToken,
});

Vl API List

namefunc
List account fee ratesclient.v1.accountFeeRates(...)
Create a accountclient.v1.createAccount(...)
List all accountsclient.v1.getAccounts(...)
List all usersclient.v1.getUsers(...)
Upload fileclient.v1.uploadFile(...)
OCR (ID card - Face)client.v1.ocrIdCardFace(...)
OCR (ID card - Back)client.v1.ocrIdCardBack(...)
OCR (Passport)client.v1.ocrPassport(...)
Submit account KYCclient.v1.submitAccountKyc(...)
Reset account KYCclient.v1.resetAccountKyc(...)
Get a face authentication urlclient.v1.getFaceAuthUrl(...)
Face authenticationclient.v1.faceAuth(...)
Get a account KYCclient.v1.getAccountKyc(...)
List all balancesclient.v1.getBalances(...)
Create a transferclient.v1.createTransfer(...)
Get a transferclient.v1.getTransfer(...)
Trigger webhookclient.v1.triggerWebhook(...)
List all budgetsclient.v1.card.getBudgets(...)
Update a budgetclient.v1.card.updateBudget(...)
Create a budgetclient.v1.card.createBudget(...)
Increase the budget balanceclient.v1.card.increaseBudgetBalance(...)
Decrease the budget balanceclient.v1.card.decreaseBudgetBalance(...)
List all budget transactionsclient.v1.card.getBudgetTransactions(...)
List all available card BINclient.v1.card.getCardBins(...)
List all quantum cardsclient.v1.card.getCards(...)
Create a quantum cardclient.v1.card.createCard(...)
Create Quantum card parameters checkclient.v1.card.createCardCheck(...)
Delete quantum cardclient.v1.card.deleteCard(...)
Quantum card transfer inclient.v1.card.cardTransferIn(...)
Quantum card transfer outclient.v1.card.cardTransferOut(...)
Frozen quantum cardclient.v1.card.suspendCard(...)
Unfrozen quantum cardclient.v1.card.enableCard(...)
Velocity Controlclient.v1.card.velocityControl(...)
Frozen quantum card balanceclient.v1.card.frozenCardBalance(...)
Unfrozen quantum card balanceclient.v1.card.unfrozenCardBalance(...)
Get a quantum card private infoclient.v1.card.getCardPrivateInfo(...)
List all quantum card transactionsclient.v1.card.getCardTransactions(...)
List all global accountsclient.v1.globalAccount.getGlobalAccounts(...)
Create a global accountclient.v1.globalAccount.createGlobalAccount(...)
List all bank accountsclient.v1.globalAccount.getBanks(...)
List all beneficiariesclient.v1.globalAccount.getBeneficiaries(...)
Create a beneficiaryclient.v1.globalAccount.createBeneficiaries(...)
Get a exchange rateclient.v1.globalAccount.getRate(...)
Create a paymentclient.v1.globalAccount.payment(...)
Batch create paymentsclient.v1.globalAccount.batchPayment(...)
Get a payment feeclient.v1.globalAccount.getPaymentFee(...)
List all payment transactionsclient.v1.globalAccount.getPaymentTransactions(...)
List all wallet balancesclient.v1.cryptoAssets.getBalances(...)
List all addressesclient.v1.cryptoAssets.getAddresses(...)
Create a blockchain addressclient.v1.cryptoAssets.createBlockchainAddress(...)
List all deposit historyclient.v1.cryptoAssets.getDeposits(...)
List all withdrawal historyclient.v1.cryptoAssets.getWithdrawals(...)
Withdraw coinclient.v1.cryptoAssets.withdrawal(...)
List all billsclient.v1.cryptoAssets.getBills(...)
Get a trade currency pairclient.v1.cryptoAssets.getCurrencyPair(...)
Get a estimate quoteclient.v1.cryptoAssets.estimateQuote(...)
List all tradesclient.v1.cryptoAssets.getTrades(...)
Create a tradeclient.v1.cryptoAssets.trade(...)
List all Wire bank accountsclient.v1.cryptoAssets.getWires(...)
Create a wire bank accountclient.v1.cryptoAssets.wire(...)
Delete a Wire bank accountclient.v1.cryptoAssets.deleteWire(...)
List all payoutsclient.v1.cryptoAssets.getPayouts(...)
Create a payoutclient.v1.cryptoAssets.payout(...)
Get a payoutclient.v1.cryptoAssets.getPayout(...)

V2 Interface Example

// List all cards
const res = await client.v2.getCards({
  accessToken,
});

V2 API List

namefunc
List all cardsclient.v2.card.getCards(...)
Get a cardclient.v2.card.getCard(...)
Update cardservice.v2.card.updateCard(...)
Delete accountclient.v2.deleteAccount(...)
Update a accountclient.v2.updateAccount(...)
List all quantum account transactionsclient.v2.quantumAccount.getAccountTransactions(...)
Get a quantum account transactionclient.v2.quantumAccount.getAccountTransaction(...)

Contact Us

If you find a BUG or have any questions or suggestions, please provide feedback through the issue.

2.0.2

5 months ago

1.0.2

10 months ago

1.0.1

10 months ago

2.0.1

8 months ago

2.0.0

10 months ago

1.0.0

11 months ago

0.0.1-beta

12 months ago