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.0</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',
});
private static AuthClient service = new AuthClient.Builder()
        .Credentials("ipeakoin1ab59eccfbc78d1b", "93fc39d77ef6a3a7b5f26b83fbbebe81", "https://api-sandbox.ipeakoin.com")
        .build();


CodeRes res = service.getCode();
AccessTokenRes res = service.getAccessToken(res.getCode());

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);
RefreshAccessTokenRes res = service.refreshAccessToken("74323196942eb80322bdf4fc38383df74946a5d402ecfc789b6f95e30435f6f9");
System.out.println(JsonUtil.toJSONString(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
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("qbitCardNoLastFour", "1234");
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(joinStr(data), "25d55ad283aa400af464c76d713c07ad");
System.out.println(s);