Sentre Legacy
  • 🥳Welcome
  • Getting Started
  • DApp Manifest
  • Folder Structure
  • Available Scripts
  • Development
    • View
    • Model & Controllers
    • Providers
      • UI Provider
      • Wallet Provider
      • Account Provider
      • Mint Provider
    • Static
    • Global variables
    • Configs
  • Advanced Usage
    • ☀️Theme
    • 👘Customizing Styles
    • 🪝Hooks
  • 🤩Submitting DApps
  • References
  • Best Practices
  • Troubleshoots
  • 🎨Design Pricinples
    • Button
    • Card
    • Checkbox
    • Color
    • Corner radius
    • Drawer
    • Dropdown
    • Grid
    • Icons
    • Input
    • List
    • Menu
    • Modal
    • Radio
    • Select
    • Shadow
    • Spacing
    • Switch
    • Tabs
    • Tooltip
    • Table
    • Typography
  • 📄Litepaper
    • Introduction
    • Industry Problems
    • Sentre: An All-in-one Solution
      • The Open Protocol
      • Liquidity Efficiency
    • SEN as the Heart of the Ecosystem
      • Asymmetric Deposit
      • Adaptive Fee Model
      • The Triad Pool
      • Simulated Mesh Trading
      • Token Use Cases
    • Conclusion
Powered by GitBook
On this page
  • useMintDecimals
  • useMintSupply
  • useAccountBalance
  • useAccountBalanceByMintAddress
  1. Advanced Usage

Hooks

Hook utilities for conveniently combining the essential data in functional components.

PreviousCustomizing StylesNextSubmitting DApps

Last updated 3 years ago

useMintDecimals

Prerequisites:

Params:

import useMintDecimals from 'shared/hooks/useMintDecimals'

const Component = () => {
    const decimals = useMintDecimals('SENBBKVCM7homnf5RX9zqpf1GFe935hnbU4uVzY1Y6M')
}

useMintSupply

Prerequisites:

Params:

import useMintSupply from 'shared/hooks/useMintSupply'

const Component = () => {
    const supply = useMintSupply('SENBBKVCM7homnf5RX9zqpf1GFe935hnbU4uVzY1Y6M')
}

useAccountBalance

import useAccountBalance from 'shared/hooks/useAccountBalance'

const Component = () => {
    const {
        amount, // <bigint> balance with decimals
        balance, // <number> balance without decimals
        decimals, // <number> mint decimals
        mintAddress, // <string> mint address
    } = useAccountBalance('H2yPHiZm2U53GN93iUhQAwMwkjKHRSN7BGZpLLHv7d1m')
}

useAccountBalanceByMintAddress

import { useAccountBalanceByMintAddress } from 'shared/hooks/useAccountBalance'

const Component = () => {
    const {
        amount, // <bigint> balance with decimals
        balance, // <number> balance without decimals
        decimals, // <number> mint decimals
        mintAddress, // <string> mint address
    } = useAccountBalanceByMintAddress('SENBBKVCM7homnf5RX9zqpf1GFe935hnbU4uVzY1Y6M')
}

Prerequisites: , , and .

Params:

Prerequisites: , , and .

Params:

🪝
MintProvider
mintAddress
MintProvider
mintAddress
WalletProvider
MintProvider
AccountProvider
accountAddress
WalletProvider
MintProvider
AccountProvider
mintAddress