ChainPortalChainPortal Docs
SDK Reference
SDK Reference

Types Reference

Exported TypeScript interfaces and types for @chainportal/sdk -- token/NFT configs, results, adapters, and transactions.

Types Reference

Every public type in @chainportal/sdk is exported from the package root, so you can import them directly alongside the hooks and services that use them:

import type {
  TokenConfig,
  TokenCreationResult,
  NFTCollectionConfig,
  NFTCreationResult,
  TransactionResult,
  WalletConnection,
} from '@chainportal/sdk';

Numeric vs string chain IDs: EVM chains use a numeric chainId (e.g. 1); Solana, Cosmos, Aptos, SUI, and NEAR use a string id (e.g. 'mainnet-beta'). Types that span ecosystems use number | string accordingly.

Wallet & connection

WalletConnection

Current state of a wallet connection for any ecosystem.

FieldTypeDescription
addressstringConnected wallet address
chainIdnumber | stringActive chain ID (numeric for EVM, string otherwise)
ecosystemChainEcosystemEcosystem this connection belongs to
walletNamestringDisplay name of the wallet (e.g. "MetaMask", "Phantom")
isConnectedbooleanWhether the wallet is currently connected

Token creation

TokenConfig

Configuration for creating a new token via the factory contract.

FieldTypeDescription
namestringToken display name
symbolstringToken ticker symbol
decimalsnumberNumber of decimal places (0–18)
initialSupplybigintInitial supply minted to the creator (base units)
maxSupply?bigintMaximum supply cap; 0/undefined means uncapped
mintable?booleanSupports post-deployment minting
burnable?booleanHolders can burn their tokens
pausable?booleanOwner can pause all transfers
description?stringHuman-readable description (not stored on-chain)
logoUri?stringURI to the token logo image
antiBotProtection?booleanEnable anti-bot protection features
maxTxPercent?bigintMax % of total supply per transaction (anti-bot)
maxWalletPercent?bigintMax % of total supply per wallet (anti-bot)
tradingCooldown?bigintCooldown between trades, seconds (anti-bot)
protectionDuration?bigintAnti-bot protection duration, seconds
maxBlockPercent?bigintMax % of total supply traded per block (anti-bot)

TokenCreationResult

Returned after a token creation transaction confirms.

FieldTypeDescription
successbooleanWhether the creation succeeded
tokenAddressstringDeployed token contract address
transactionHashstringOn-chain transaction hash
chainIdnumber | stringChain the token was created on
explorerUrl?stringBlock explorer URL for the transaction

NFT creation

NFTAttribute

A single OpenSea-compatible trait attribute.

FieldTypeDescription
trait_typestringTrait category (e.g. "Background")
valuestring | numberTrait value
display_type?'number' | 'date' | 'boost_number' | 'boost_percentage'Display hint for numeric values

NFTCollectionConfig

Configuration for creating an NFT collection (ERC-721 or ERC-1155).

FieldTypeDescription
namestringCollection display name
symbolstringCollection ticker symbol
description?stringHuman-readable description
baseUri?stringBase URI for token metadata (tokens append their ID)
maxSupply?numberMax mintable tokens (0 = unlimited)
royaltyBps?numberRoyalty fee in basis points (e.g. 250 = 2.5%)
royaltyRecipient?stringAddress that receives royalties

NFTItemConfig

Configuration for minting a single NFT within a collection.

FieldTypeDescription
namestringDisplay name of the NFT
descriptionstringHuman-readable description
imagestringIPFS or HTTP URL to the image
externalUrl?stringExternal link for more details
attributes?NFTAttribute[]Trait attributes
animationUrl?stringURL to a video/audio animation

NFTCreationResult

Returned after a collection creation or mint confirms.

FieldTypeDescription
successbooleanWhether the operation succeeded
collectionAddress?stringDeployed collection address (collection creation)
tokenId?string | numberMinted token ID (mint operations)
transactionHashstringOn-chain transaction hash
chainIdnumber | stringChain the operation occurred on
metadataUri?stringIPFS metadata URI for the minted token
explorerUrl?stringBlock explorer URL for the transaction

Transactions & gas

TransactionStatus

type TransactionStatus = 'pending' | 'confirmed' | 'failed';

The persisted transaction store uses a richer status set — 'pending' | 'confirming' | 'success' | 'failed' — see the State Stores page. This TransactionStatus is the adapter-level result type.

TransactionResult

Result of waiting for a transaction to confirm on-chain.

FieldTypeDescription
hashstringOn-chain transaction hash
statusTransactionStatusFinal status
chainIdnumber | stringChain the transaction ran on
blockNumber?numberBlock the transaction was included in
gasUsed?bigintGas consumed
explorerUrl?stringBlock explorer URL

GasEstimate

Result of estimating gas for a transaction.

FieldTypeDescription
gasLimitbigintMax gas units the transaction may consume
gasPrice?bigintLegacy gas price (pre-EIP-1559 chains)
maxFeePerGas?bigintEIP-1559 max fee per gas
maxPriorityFeePerGas?bigintEIP-1559 max priority fee (tip)
estimatedCostbigintEstimated total cost in native currency (wei)

Adapters

All ecosystem adapters implement a common interface, giving you a unified API regardless of chain. Most apps use hooks rather than adapters directly.

IChainAdapter

MemberSignatureDescription
ecosystemChainEcosystemAdapter's ecosystem (readonly)
chainChainConfigCurrent chain config (readonly)
connect()() => Promise<WalletConnection>Connect the wallet
disconnect()() => Promise<void>Disconnect the wallet
isConnected()() => booleanWhether a wallet is connected
getAddress()() => string | nullConnected address, or null
switchChain()(chainId) => Promise<void>Switch chain within the ecosystem
getNativeBalance()(address) => Promise<bigint>Native balance (ETH, SOL, …)
getTokenBalance()(address, tokenAddress) => Promise<bigint>Token balance
createToken()(config: TokenConfig) => Promise<TokenCreationResult>Create a token
createNFTCollection()(config: NFTCollectionConfig) => Promise<NFTCreationResult>Create a collection
mintNFT()(collectionAddress, config: NFTItemConfig) => Promise<NFTCreationResult>Mint into a collection
waitForTransaction()(hash) => Promise<TransactionResult>Wait for confirmation
estimateGas()(to, data, value?) => Promise<GasEstimate>Estimate gas

IEVMAdapter / ISolanaAdapter

Narrowed variants of IChainAdapter that fix ecosystem to 'evm' / 'solana' and use the ecosystem-specific chain config (EVMChainConfig / SolanaChainConfig).

See also

  • Services — classes that consume these types
  • Hooks — React hooks that return these result types
  • State Stores — the persisted Transaction shape