iPeakoin SDKs

iPeakoin SDKs facilitate a seamless integration of iPeakoin APIs into your codebase, enabling swift development.

Our SDKs are open-source, meaning that if you encounter any missing features or bugs, we encourage you to report them by filing an issue or actively contributing to the node-sdk. Note: Java SDKs are currently in beta.

To install the SDK, simply run one of the following commands in your project directory:

npm install @ipeakoin/ipeakoin-sdk --save
# or
yarn add @ipeakoin/ipeakoin-sdk
<!-- https://mvnrepository.com/artifact/com.ipeakoin/ipeakoin-sdk -->
<dependency>
    <groupId>com.ipeakoin</groupId>
    <artifactId>ipeakoin-sdk</artifactId>
    <version>2.0.1-beta</version>
</dependency>

Configuration

import Client from "@ipeakoin/ipeakoin-sdk"

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

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

Client service = new Client.Builder()
            .config("ipeakoin1ab59eccfbc78d1b", "93fc39d77ef6a3a7b5f26b83fbbebe81", "https://global.service.test.qbitnetwork.com")
            .build();

get access token

const codeRes = await client.getCode();
const res = await client.getAccessToken(codeRes.content.code);
console.log(res.content.accessToken);
ApiResponse<CodeRes> code = service.getCode();
ApiResponse<AccessTokenRes> accessToken = service.getAccessToken(code.getContent().getCode());

refresh access token

const res = await client.refreshAccessToken(refreshToken);
console.log(res);
ApiResponse<RefreshAccessTokenRes> res = service.refreshAccessToken("12c4aec847b969b11a610a7ced6027506e88699fc1868893b2396ffb329a01b2");

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
 Map<String, String> address = new HashMap<>();
 address.put("addressLine1", "20 Barneson ave");
 address.put("addressLine2", "");
 address.put("city", "San Mateo");
 address.put("country", "US");
 address.put("postalCode", "94402");
 address.put("state", "California");

 Map<String, Object> data = new HashMap<>();
 data.put("id", "b9ce056b-c1f8-4f19-b014-d7be02a54598");
 data.put("accountId", "01eba490-5f9c-48a6-aa2d-7bcfdff0d720");
 data.put("token", "0ef85b24-866f-4c03-a7e8-459e3742642b");
 data.put("status", "Active");
 data.put("currency", "USD");
 data.put("provider", "PrepaidCard_493728");
 data.put("userName", "test test");
 data.put("createTime", "2023-05-31T07:29:46.784Z");
 data.put("label", "ce08100b-fca8-4a13-bbfc-c381aeaec5d0");
 data.put("useType", "79f22263-a3fe-4347-8a40-2af6bf422839");
 data.put("balanceId", "ab43462f-93b3-4540-8601-11d759948ee7");
 data.put("budgetId", null);
 data.put("cardAddress", address);
 String s = encryptHmacSHA256(data, "25d55ad283aa400af464c76d713c07ad");
 System.out.println(s.equals("22825d6c8cd5787ef14f46862b9ba6181d02178ace76ed814001b9e34ba2971d"));

V1 Interface Example

// Create a account
const res = await client.v1.createAccount({
  phone: '+8613100200001',
  name: 'klover',
  accessToken,
});
ApiResponse<List<AccountFeeRatesRes>> res = service.v1().accountFeeRates(new DefaultReq() {{
                this.setAccessToken("accessToken");
            }});

V2 Interface Example

// List all cards
const res = await client.v2.getCards({
  accessToken,
});
ApiResponse<ListRes<CardInfo>> res = service.v2().card().getCards(new CardsReq() {{
                this.setAccessToken("accessToken");
                this.setLimit(10);
            }});