ChainPortalChainPortal Docs
SDK Reference
SDK Reference

Hooks Reference

Complete reference for all 100+ React hooks in @chainportal/sdk.

Overview

The SDK provides hooks organized by feature and ecosystem. Each hook follows a consistent pattern:

const { action, isLoading, error, result } = useHookName(options);

Consistent API across all ecosystems. EVM, Solana, Cosmos, Aptos, SUI, and NEAR hooks all return the same { action, isLoading, error, result } shape — swap ecosystems without rewriting your UI.

Core Hooks (Ecosystem-Agnostic)

Token Hooks

HookDescription
useTokenCreation()Create tokens on the connected chain
useTokenManagement(address)Manage a deployed token (mint, burn, pause)
useTokenAnalytics(address)Get analytics for a token

NFT Hooks

HookDescription
useNftCreation()Create NFT collections
useNftManagement(address)Manage an NFT collection (mint, reveal)
useNftAnalytics(address)Get analytics for an NFT collection
useErc1155Management(address)Manage ERC1155 multi-token collections

Utility Hooks

HookDescription
useAirdrop()Batch distribute tokens
useTokenLocker()Lock tokens with time-release
useLiquidityLocker()Lock LP tokens
useLaunchpad()Create and manage presales
useStaking()Create and manage staking pools
useReferralRegistry()Register and track referrals
useBatchMint()Batch mint NFTs
useContractVerification()Verify contracts on explorers
useMultiChain()Multi-chain operations

State Hooks

HookDescription
useUserAssets()Get all assets for the connected wallet
useFactoryStatus(chainId)Check factory contract deployment status
useFactoryTotals()Get global creation statistics
useAllChainClients()Get RPC clients for all chains
useMultiChainGas()Gas estimates across chains

Ecosystem-Specific Hooks

Each ecosystem has dedicated hooks that handle chain-specific details:

EVM Hooks

import { useTokenCreation } from '@chainportal/sdk';
// Uses wagmi under the hood

Solana Hooks

import { useSolanaTokenCreation } from '@chainportal/sdk';
import { useSolanaNftCreation } from '@chainportal/sdk';
import { useSolanaMultiToken } from '@chainportal/sdk';

Cosmos Hooks

import { useCosmosTokenCreation } from '@chainportal/sdk';
import { useCosmosNftCreation } from '@chainportal/sdk';
import { useCosmosMultiToken } from '@chainportal/sdk';

Aptos Hooks

import { useAptosTokenCreation } from '@chainportal/sdk';
import { useAptosNftCreation } from '@chainportal/sdk';
import { useAptosMultiAsset } from '@chainportal/sdk';

SUI Hooks

import { useSuiTokenCreation } from '@chainportal/sdk';
import { useSuiNftCreation } from '@chainportal/sdk';
import { useSuiMultiToken } from '@chainportal/sdk';

NEAR Hooks

import { useNearTokenCreation } from '@chainportal/sdk';
import { useNearNftCreation } from '@chainportal/sdk';
import { useNearMultiToken } from '@chainportal/sdk';

Factory Status Hooks

import { useFactoryStatus, getTokenReadyChains } from '@chainportal/sdk';
 
// Check if a chain has factory contracts deployed
const { isReady, contracts } = useFactoryStatus(11155111); // Sepolia
 
// Get all chains ready for token creation
const readyChains = getTokenReadyChains();

Created Assets Hooks

import {
  useAptosCreatedAssets,
  useSolanaCreatedAssets,
  useSuiCreatedAssets,
  useCosmosCreatedAssets,
  useNearCreatedAssets,
} from '@chainportal/sdk';

Hook Return Pattern

All hooks follow this consistent pattern:

interface HookReturn<T> {
  // The action function
  action: (...args) => Promise<T>;
 
  // Loading state
  isLoading: boolean;
 
  // Error state
  error: Error | null;
 
  // Result of the last successful action
  result: T | null;
}

On this page

Edit on GitHub