Sentre
Search…
πŸͺ
Hooks
Hook utilities for conveniently combining the essential data in functional components.

useMintDecimals

Prerequisites: MintProvider​
Params: mintAddress​
1
import useMintDecimals from 'shared/hooks/useMintDecimals'
2
​
3
const Component = () => {
4
const decimals = useMintDecimals('SENBBKVCM7homnf5RX9zqpf1GFe935hnbU4uVzY1Y6M')
5
}
Copied!

useMintSupply

Prerequisites: MintProvider​
Params: mintAddress​
1
import useMintSupply from 'shared/hooks/useMintSupply'
2
​
3
const Component = () => {
4
const supply = useMintSupply('SENBBKVCM7homnf5RX9zqpf1GFe935hnbU4uVzY1Y6M')
5
}
Copied!

useAccountBalance

Params: accountAddress​
1
import useAccountBalance from 'shared/hooks/useAccountBalance'
2
​
3
const Component = () => {
4
const {
5
amount, // <bigint> balance with decimals
6
balance, // <number> balance without decimals
7
decimals, // <number> mint decimals
8
mintAddress, // <string> mint address
9
} = useAccountBalance('H2yPHiZm2U53GN93iUhQAwMwkjKHRSN7BGZpLLHv7d1m')
10
}
Copied!

useAccountBalanceByMintAddress

Params: mintAddress​
1
import { useAccountBalanceByMintAddress } from 'shared/hooks/useAccountBalance'
2
​
3
const Component = () => {
4
const {
5
amount, // <bigint> balance with decimals
6
balance, // <number> balance without decimals
7
decimals, // <number> mint decimals
8
mintAddress, // <string> mint address
9
} = useAccountBalanceByMintAddress('SENBBKVCM7homnf5RX9zqpf1GFe935hnbU4uVzY1Y6M')
10
}
Copied!