0.6.3 • Published 1 year ago
@pngfi/react-hooks v0.6.3
@pngfi/react-hooks
Docs Link
Installation
yarn add @pngfi/react-hooks
// or
npm i @pngfi/react-hooks --save
Usage
- How to claim rewards
- How to create distributor
- How to get distributor
- How to update distributor
- How to delete distributor
- How to bond
- How to stake
Api Host
- Staging Version https://api-staging.png.fi
- Online Version https://api.png.fi
react hooks base api
[PngfiProvider]
import { PngfiProvider } from '@pngfi/react-hooks';
const App = ({ children }) => {
const wallet = useWallet();
return (
<PngfiProvider
cluster="mainnet-beta"
userPublicKey={wallet.publicKey}
>
{/* You can use useBonding in children now */}
{children}
</PngfiProvider>
)
}
[usePngfiConfig]
import { usePngfiConfig } from '@pngfi/react-hooks';
const {
fallback: {
cluster,
pngfiApi,
userPublicKey
//...
}
//...
} = usePngfiConfig()
[useAnchorProvider]
import { useAnchorProvider } from '@pngfi/react-hooks';
const provider = useAnchorProvider({
connection,
wallet,
connected
});
Distributors
[useDistributors]
import { useDistributors } from '@pngfi/react-hooks';
const { data, error, loading } = useDistributors(user: string);
[useMerkleRewards]
import { useMerkleRewards } from '@pngfi/react-hooks';
const { data, error, loading } = useMerkleRewards(user: string);
[useDistributorEpochs]
import { useDistributorEpochs } from '@pngfi/react-hooks';
const { data, error, loading } = useDistributorEpochs(distributor: string);
[useMerkleRewardsDistributor]
import { useMerkleRewardsDistributor } from '@pngfi/react-hooks';
const { data, error, loading } = useMerkleRewardsDistributor(distributor: string);
[useDistributorRewardsEpoch]
import { useDistributorRewardsEpoch } from '@pngfi/react-hooks';
const { data, error, loading } = useDistributorRewardsEpoch(distributor: string, epoch: string);
[useTokens]
import { useTokens } from '@pngfi/react-hooks';
const { data, error, loading } = useTokens();
[usePools]
import { usePools } from '@pngfi/react-hooks';
const { data, error, loading } = usePools();
[useMarkets]
import { useMarkets } from '@pngfi/react-hooks';
const { data, error, loading } = useMarkets();
[usePrices]
import { usePrices } from '@pngfi/react-hooks';
const { data, error, loading } = usePrices(['SOL', 'UST']);
[useBonding]
import { useBonding } from '@pngfi/react-hooks';
const { data, error, loading } = useBonding();
[useStaking]
import { useStaking } from '@pngfi/react-hooks';
const { data, error, loading } = useStaking();
[useBalances]
import { useBalances } from '@pngfi/react-hooks';
const { data, error, loading } = useBalances(user);
[useUserVesting]
import { useUserVesting } from '@pngfi/react-hooks';
const { data, error, loading } = useUserVesting(owner, vestConfig);
[useRewards]
[include:How-to-claim-rewards.md]
[include:How-to-create-distributor.md]
[include:How-to-get-distributor.md]
[include:How-to-update-distributor.md]
[include:How-to-delete-distributor.md]
[useBond]
[useStake]
0.6.3
1 year ago
0.6.2
1 year ago
0.6.1
1 year ago
0.5.65
2 years ago
0.5.60
2 years ago
0.6.0
2 years ago
0.5.56
2 years ago
0.5.57
2 years ago
0.5.52
2 years ago
0.5.53
2 years ago
0.3.43
2 years ago
0.4.5
2 years ago
0.4.4
2 years ago
0.5.0
2 years ago
0.4.2
2 years ago
0.3.42
2 years ago
0.3.30
2 years ago
0.3.29
2 years ago
0.3.28
2 years ago
0.3.10
2 years ago
0.3.8
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.1
2 years ago