kross-finance-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.0 • Public • Published

For Installing

yarn add kross-sdk

OR

npm install kross-sdk

For Usage

API Client

import { KrossClient } from 'kross-sdk'

const client = new KrossClient({
  baseURL: 'https://da.kross.kr'
  accessId: 'youraccessid',
  secretKey: 'yoursecretkey',
  authToken: authToken,
  refreshToken: refreshToken,
  refreshTokenCallback: refreshTokenCallback,
});

KrossClient Params Description

Client Options Object


Clients Provided

KrossClient, Account, Loans, Investments, Inquiry, User, Verifications, GeneralInfo, SignContract

KrossClient : It is a base client through which you will be able to make requests any of the data providing APIs via axios instance.
Investments : Contains functions and hooks through which you can make requests for investments related data
User : Contains functions and hooks through which you can make requests for users related data
Loans : Contains functions and hooks through which you can make requests for loans related data

Example of how to prepare clients for usage in real app

import { storage } from 'utils/storage';
import { envVariables } from './../constants/envVariables';
import {
  KrossClient,
  Loans,
  Investments,
  User,
  Account,
  Inquiry,
  GeneralInfo,
  SignContract,
} from 'kross-sdk';

export const useClients = () => {
  const authToken = storage.getString('authToken');
  const refreshToken = storage.getString('refreshToken');

  const refreshTokenCallback = (token: string) => {
    storage.set('authToken', token);
  };

  const clientOptions = {
    baseURL: baseURL,
    accessId: accessId,
    secretKey: secretKey,
    authToken: authToken,
    refreshToken: refreshToken,
    refreshTokenCallback: refreshTokenCallback,
  };
  const clients = {
    krossClient: new KrossClient(clientOptions),
    LoansClient: new Loans(clientOptions),
    InvestmentsClient: new Investments(clientOptions),
    UserClient: new User(clientOptions),
  };

  return clients;
};

Package Sidebar

Install

npm i kross-finance-sdk

Weekly Downloads

2

Version

1.0.0-beta.0

License

ISC

Unpacked Size

2.44 MB

Total Files

27

Last publish

Collaborators

  • jscripter-pk