2.0.1 • Published 4 months ago
okto-sdk-react-native v2.0.1
rn-okto-sdk
This is a React Native SDK for Okto.
Installation
Install the package in your React Native project:
npm i okto-sdk-react-native
Usage
First, import the package in your file:
import {
init,
authenticate,
getPortfolio,
getSupportedNetworks,
getSupportedTokens,
getUserDetails,
getWallets,
logout,
orderHistory,
transferFunds,
getNFTOrderDetails,
transferNFT,
} from 'rn-okto-sdk';
Then, initialize the SDK with your API key:
init(apiKeyValue);
You can then use the authenticate method to create a wallet using your Google Auth ID token. This method also returns a list of created wallets:
authenticate(idToken, (result, error) => {
if (error) {
console.error(error);
} else {
const wallet = JSON.parse(result);
console.log(wallet);
}
});
You can also use the other methods provided by the SDK to interact with Okto services. For example, you can get a list of supported tokens with the getSupportedTokens method:
getSupportedTokens((result, error) => {
const supportedTokens: Token[] = JSON.parse(result);
console.log(supportedTokens);
});
Documentation For more detailed usage instructions and API documentation, please visit . Okto SDK Documentation