SDK Reference
react
overview

Okto React SDK Overview

The Okto React SDK provides a comprehensive set of functions to manage user authentication, portfolio data, supported networks and tokens, user details, wallet management, order history, NFT order details, transaction statuses, token and NFT transfers, raw transaction executions, and UI theme settings. Below is an overview of the available functions and their respective purposes.

Function Overview

CategoryFunctionDescription
AuthenticationisLoggedIn: booleanIndicates if the user is currently logged in.
authenticate(idToken: string, callback: (result: any, error: any) => void): voidAuthenticates a user using an ID token.
authenticateWithUserId(userId: string, jwtToken: string, callback: (result: any, error: any) => void): voidAuthenticates a user using a user ID and JWT token.
logOut(): voidLogs out the current user.
User ManagementgetUserDetails(): Promise<User>Retrieves the details of the currently authenticated user.
Portfolio ManagementgetPortfolio(): Promise<PortfolioData>Fetches the portfolio data for the current user.
Network and Token InformationgetSupportedNetworks(): Promise<NetworkData>Fetches the list of supported networks.
getSupportedTokens(): Promise<TokensData>Fetches the list of supported tokens.
Wallet ManagementgetWallets(): Promise<WalletData>Retrieves the list of wallets associated with the current user.
createWallet(): Promise<WalletData>Creates a new wallet for the current user.
Order ManagementorderHistory(query: Partial<OrderQuery>): Promise<OrderData>Fetches the order history based on the provided query.
NFT ManagementgetNftOrderDetails(query: Partial<NftOrderDetailsQuery>): Promise<NftOrderDetailsData>Fetches details of a specific NFT order based on the provided query.
transferNft(data: TransferNft): Promise<TransferNftData>Transfers an NFT based on the provided data.
transferNftWithJobStatus(data: TransferNft): Promise<NftOrderDetails>Transfers an NFT and provides job status updates based on the provided data.
Transaction ManagementgetRawTransactionStatus(query: RawTransactionStatusQuery): Promise<RawTransactionStatusData>Fetches the status of a raw transaction based on the provided query.
executeRawTransaction(data: ExecuteRawTransaction): Promise<ExecuteRawTransactionData>Executes a raw transaction based on the provided data.
executeRawTransactionWithJobStatus(data: ExecuteRawTransaction): Promise<RawTransactionStatus>Executes a raw transaction and provides job status updates based on the provided data.
transferTokens(data: TransferTokens): Promise<TransferTokensData>Transfers tokens based on the provided data.
transferTokensWithJobStatus(data: TransferTokens): Promise<Order>Transfers tokens and provides job status updates based on the provided data.
UI ManagementshowWidgetModal(): voidDisplays the widget modal.
closeModal(): voidCloses the currently open modal.
Theme ManagementgetTheme(): ThemeRetrieves the current UI theme.
setTheme(theme: Partial<Theme>): voidSets the UI theme based on the provided theme object.

This overview provides a high-level understanding of the functions available in the Okto React SDK. For detailed usage and examples, please refer to the specific function documentation.

Example Apps built using Okto's React SDK

App NameDescriptionGithub RepoOther Resources/Links
Simple React AppThis is a template app built using Create React App and showcases all the functionality of the React SDKgithub repo (opens in a new tab)Cheatsheet (opens in a new tab)
Simple Nextjs AppThis is a template app built using Nextjs and showcases all the functionality of the React SDKgithub repo (opens in a new tab)hosted url (opens in a new tab)
LifafaLifafa revolutionizes the tradition of red envelopes (hongbao) by leveraging blockchain technology on Solana. Create, manage, and claim crypto gifts seamlessly, enhancing the digital gifting experience. This is a Community Project built by Jovian (opens in a new tab)github repo (opens in a new tab)https://www.lifafa.fun/ (opens in a new tab)