How-Tos
Welcome to the How-Tos section of WAAS. This page provides concise, linkable guides to help you integrate and use our React and JavaScript SDKs. Each link below points to a detailed guide; the short descriptions help you choose the right entry.
React SDK
Configuration
- Example of
KeybanProvider
Usage
Minimal example showing how to wrap your app withKeybanProvider
and provide required props such asappId
andnetwork
. - Configuration Options
Overview of the provider options (e.g.clientShareProvider
,network
,appId
) and their effects. - Custom ClientShareProvider
Guide to implementing a customClientShareProvider
to control where and how client shares are persisted.
Using React Hooks
- Configure the Authentication
How to use authentication hooks (useKeybanAuth
) for login/logout and passwordless flows. - Accessing the Keyban Client
How to obtain theKeybanClient
instance from React usinguseKeybanClient
. - Retrieving the Keyban Account
How to get and manage theKeybanAccount
bound to the authenticated user. - Retrieving the Account Balance
Fetch and subscribe to the native balance of the account and update the UI in real time. - Retrieving NFTs of the Account
List NFTs owned by the account with pagination and subscription support. - Retrieving Token Balances
List ERC‑20 token balances and subscribe to updates using the provided hooks. - Performing Transactions
Summary of transaction methods available onKeybanAccount
with usage examples.- Transferring Native Tokens — Send native currency (e.g. ETH).
- Transferring ERC20 Tokens — Estimate fees and perform ERC‑20 transfers.
- Transferring NFTs — Transfer ERC‑721 / ERC‑1155 tokens (tokenId, value).
- Retrieving Transaction History
How to fetch paginated transfer history for the account. - Formatting a Balance
UseFormattedBalance
oruseFormattedBalance
to render balances in a human-friendly format.
JavaScript SDK
Basic Example
- Initialize the SDK
Create aKeybanClient
instance withappId
andnetwork
(examples for EVM, Starknet, Stellar). - Retrieve Account Information
How to initialize and obtain the account object (address, public key, metadata). - Estimate Transaction Fees
How to estimate fees for native transfers, ERC‑20 and NFT operations (FeesEstimation
). - Perform Token Transfer
Generic guide to sending assets (native / ERC‑20 / NFT) and handling errors. - Retrieve ERC-20 Token Balances
Query token balances with the exported GraphQL documents and subscribe to changes. - Perform ERC-20 Token Transfer
Example: estimate fees then perform an ERC‑20 transfer. - Retrieve NFTs Owned by the Account
Query NFTs and collection/token details. - Perform NFT Transfer
Transfer ERC‑721 / ERC‑1155: required parameters (tokenId
, optionalvalue
), and error handling. - Balances (GraphQL)
How to query native and token balances via Apollo and the provided GraphQL documents. - Custom Storage / ClientShareProvider
How to implement or configure a custom client-share storage provider if you don't use the built-in persistence.