kross-finance-sdk
v1.0.0-beta.0
Published
Kross Finance SDK for login, sigup and loans
Downloads
5
Maintainers
Readme
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
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;
};