Options
All
  • Public
  • Public/Protected
  • All
Menu

@pngfi/react-hooks - v0.6.2

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

IApiCluster: "devnet" | "stagingnet" | "testnet" | "mainnet-beta"
IBalancesRecord: Record<string, Decimal>
IBaseMethod: "getAccountInfo" | "getBalance" | "getBlock" | "getBlockHeight" | "getBlockProduction" | "getBlockCommitment" | "getBlocks" | "getBlocksWithLimit" | "getBlockTime" | "getClusterNodes" | "getEpochInfo" | "getEpochSchedule" | "getFeeCalculatorForBlockhash" | "getFeeRateGovernor" | "getFees" | "getFirstAvailableBlock" | "getGenesisHash" | "getHealth" | "getIdentity" | "getInflationGovernor" | "getInflationRate" | "getInflationReward" | "getLargestAccounts" | "getLeaderSchedule" | "getMaxRetransmitSlot" | "getMaxShredInsertSlot" | "getMinimumBalanceForRentExemption" | "getMultipleAccounts" | "getProgramAccounts" | "getRecentBlockhash" | "getRecentPerformanceSamples" | "getSnapshotSlot" | "getSignaturesForAddress" | "getSignatureStatuses" | "getSlot" | "getSlotLeader" | "getSlotLeaders" | "getStakeActivation" | "getSupply" | "getTokenAccountBalance" | "getTokenAccountsByDelegate" | "getTokenAccountsByOwner" | "getTokenLargestAccounts" | "getTokenSupply" | "getTransaction" | "getTransactionCount" | "getVersion" | "getVoteAccounts" | "minimumLedgerSlot" | "requestAirdrop" | "sendTransaction" | "simulateTransaction"
IBondResponse: { bondingInfos: IBonding[]; bondingTotalValue: Decimal; getBondingItemData: any; onBond: any }

Type declaration

  • bondingInfos: IBonding[]

    get format bonding info list

    example
    const { bondingInfos } = useBond(provider);
    
  • bondingTotalValue: Decimal

    get bonding total value

    example
    const { bondingTotalValue } = useBond(provider);
    
  • getBondingItemData:function
    • getBondingItemData(pubkey: PublicKey): Record<string, any>
    • get bonding info for submit

      example
      const { getBondingItemData } = useBond(provider);
      const res = getBondingItemData(pubkey);

      Parameters

      • pubkey: PublicKey

      Returns Record<string, any>

  • onBond:function
    • bond submit

      example
      const { onBond } = useBond(provider);
      const res = await onBond({
      ownerAccount,
      bondingInfo,
      bondingModel,
      stakingModel,
      depositToken,
      amount,
      allTokens: tokens,
      pngPools: poolInfos,
      execute: async (
      opTx: TransactionEnvelope,
      amount: string,
      token: IToken,
      isSwap: boolean,
      ) => {
      return await execute(opTx, amount, token, isSwap);
      // const { signature } = await opTx.confirm();
      },
      jupSwap: async (amount: Iu64, token: IToken) => {
      return await swap(amount, token);
      },
      userVestingInfo
      });

      Parameters

      Returns Promise<any>

IBondingInfoWithInitSupply: IBonding & { depositAmount: Iu64; initSupply: Iu64; isHidden?: boolean; onlyBonding: boolean }
IBondingInfoWithTokens: IBonding & { bondingPrice: number; depositToken: IToken; depositTokenPrice: number; onlyBonding: boolean; originMint?: string; payoutToken: IToken; payoutTokenPrice: number; roi: number; vestTerm: number }
IConfirmUpdateDistributor: { previousEpochID: string } & IConfirmDistributor
IDeprecatedMethods: "getConfirmedBlock" | "getConfirmedBlocks" | "getConfirmedBlocksWithLimit" | "getConfirmedSignaturesForAddress2" | "getConfirmedTransaction" | "getFeeCalculatorForBlockhash" | "getFeeRateGovernor" | "getFees" | "getRecentBlockhash" | "getSnapshotSlot"
IDistributorResponse: { address: string; base?: string; beneficiaries?: string[]; createdAt?: number; epochID: string; owner: string; projectID?: string; title: string; tokenHolder: string; tokenMint: string; totalAmount: string; updatedAt?: number }

Type declaration

  • address: string
  • Optional base?: string
  • Optional beneficiaries?: string[]
  • Optional createdAt?: number
  • epochID: string
  • owner: string
  • Optional projectID?: string
  • title: string
  • tokenHolder: string
  • tokenMint: string
  • totalAmount: string
  • Optional updatedAt?: number
IEncoding: "base58" | "base64" | "base64+zstd" | "jsonParsed"
IMerkleDistributorInfo: IMerkleDistributorItem & { amountStr: string; isCommon?: boolean; leftAmount?: Decimal; nextRewardTime?: string; rewardTime?: string; token: IToken }
IOnBondParams: { amount: Iu64; bondingInfo: IBondingInfoWithTokens; bondingModel: Bonding; depositToken: IToken; ownerAccount: PublicKey; stakingModel: Staking; userVestingInfo: any; execute: any; swap: any }

Type declaration

  • amount: Iu64
  • bondingInfo: IBondingInfoWithTokens
  • bondingModel: Bonding
  • depositToken: IToken
  • ownerAccount: PublicKey
  • stakingModel: Staking
  • userVestingInfo: any
  • execute:function
    • execute(opTx: TransactionEnvelope, amount: string, token: IToken, isSwap: boolean): Promise<any>
    • Parameters

      • opTx: TransactionEnvelope
      • amount: string
      • token: IToken
      • isSwap: boolean

      Returns Promise<any>

  • swap:function
    • swap(amount: u64, token: IToken): Promise<any>
    • Parameters

      Returns Promise<any>

IOnStake: { amount: string; stakingInfo: IStaking; stakingModel: Staking }

Type declaration

IOnUnStake: { amount: string; stakingInfo: IStaking; stakingModel: Staking }

Type declaration

IPoolRecords: Record<string, IPool>
IPoolToken: IToken & { addr: IPublicKey; amount: Iu64 }
IPoolTokenResponse: IToken & { addr: string; amount: string }
IProviderOptionsValue: Partial<PublicConfiguration<any, any, BareFetcher<any>>> & Partial<ProviderConfiguration> & { provider?: ((cache: Readonly<Cache<any>>) => Cache<any>) } | undefined
IResolvedTokenAccountInstruction: { address: IPublicKey } & Instruction
IResponseBondingInfo: { bondingSupply: string; controlVariable: number; decayFactor: number; depositAmount: string; depositHolder: string; depositHolderAmount: string; depositTokenMint: string; initSupply: string; isHidden?: boolean; lastDecay: number; maxDebt: string; maxPayoutFactor: string; minPrice: string; onlyBonding: boolean; payoutHolder: string; payoutTokenMint: string; pubkey: string; stakingAddress: string; totalDebt: string; vestConfigInfo: {} }

Type declaration

  • bondingSupply: string
  • controlVariable: number
  • decayFactor: number
  • depositAmount: string
  • depositHolder: string
  • depositHolderAmount: string
  • depositTokenMint: string
  • initSupply: string
  • Optional isHidden?: boolean
  • lastDecay: number
  • maxDebt: string
  • maxPayoutFactor: string
  • minPrice: string
  • onlyBonding: boolean
  • payoutHolder: string
  • payoutTokenMint: string
  • pubkey: string
  • stakingAddress: string
  • totalDebt: string
  • vestConfigInfo: {}
    • [key: string]: any
IResponsePoolInfo: { authority: string; curveType: string; feeAccount: string; feeStructure: string; lpSupply: string; nonce: string; poolTokenDecimals: string; poolTokenMint: string; pubkey: string; tokenA: IPoolTokenResponse; tokenB: IPoolTokenResponse }

Type declaration

  • authority: string
  • curveType: string
  • feeAccount: string
  • feeStructure: string
  • lpSupply: string
  • nonce: string
  • poolTokenDecimals: string
  • poolTokenMint: string
  • pubkey: string
  • tokenA: IPoolTokenResponse
  • tokenB: IPoolTokenResponse
IResponseStakingInfo: { apy: number; pubkey: string; rebaseEpochDuration: number; rebaseLastTime: number; rebaseRateDenominator: number; rebaseRateNumerator: number; rebaseRewardsAmount: string; rebaseSupply: string; rewardsHolder: string; rewardsPerDay: string; sTokenMint: string; sTokenMintSupply: string; tokenHolder: string; tokenHolderAmount: string; tokenMint: string; vestConfigInfo: {} }

Type declaration

  • apy: number
  • pubkey: string
  • rebaseEpochDuration: number
  • rebaseLastTime: number
  • rebaseRateDenominator: number
  • rebaseRateNumerator: number
  • rebaseRewardsAmount: string
  • rebaseSupply: string
  • rewardsHolder: string
  • rewardsPerDay: string
  • sTokenMint: string
  • sTokenMintSupply: string
  • tokenHolder: string
  • tokenHolderAmount: string
  • tokenMint: string
  • vestConfigInfo: {}
    • [key: string]: any
IResponseUserVestingInfo: { claimableAmount: string; lastUpdatedTime: string; lastVestTime: string; owner: string; pubkey: string; vestConfig: string; vestedHolder: string; vestedHolderAmount: string }

Type declaration

  • claimableAmount: string
  • lastUpdatedTime: string
  • lastVestTime: string
  • owner: string
  • pubkey: string
  • vestConfig: string
  • vestedHolder: string
  • vestedHolderAmount: string
IStakeResponse: { stakingInfos: IStaking[]; stakingTotalValue: Decimal; getStakingItemData: any; onStake: any; onUnStake: any }

Type declaration

  • stakingInfos: IStaking[]

    get format staking info list

    example
    const { stakingInfos } = useStake(provider);
    
  • stakingTotalValue: Decimal

    get staking total value

    example
    const { stakingTotalValue } = useStake(provider);
    
  • getStakingItemData:function
    • getStakingItemData(pubkey: PublicKey): Record<string, any>
    • get staking info for submit

      example
      const { getStakingItemData } = useStake(provider);
      const res = getStakingItemData(pubkey);

      Parameters

      • pubkey: PublicKey

      Returns Record<string, any>

  • onStake:function
    • stake submit

      example
      const { onStake } = useBond(provider);
      const [toVTokenTx, stakeAllTx, rebaseTx] = await onStake({
      stakingInfo: IStaking;
      stakingModel: Staking;
      amount: string;
      });
      const { signature } = await toVTokenTx
      .combine(stakeAllTx)
      .combine(rebaseTx)
      .confirm();

      Parameters

      Returns Promise<any>

  • onUnStake:function
    • unstake submit

      example
      const { onBond } = useBond(provider);
      const [unstakeTx, vestAllTx, rebaseTx] = await onUnStake({
      stakingInfo: IStaking;
      stakingModel: Staking;
      amount: string;
      });
      const { signature } = await unstakeTx
      .combine(vestAllTx)
      .combine(rebaseTx)
      .confirm();

      Parameters

      Returns Promise<any>

ISubscriptionWebsocket: "accountSubscribe" | "accountUnsubscribe" | "logsSubscribe" | "logsUnsubscribe" | "programSubscribe" | "programUnsubscribe" | "signatureSubscribe" | "signatureUnsubscribe" | "slotSubscribe" | "slotUnsubscribe"
IToken: { chainId?: number; decimals: number | undefined; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] }

Type declaration

  • Optional chainId?: number
  • decimals: number | undefined
  • Optional display?: boolean
  • Optional extensions?: IExtensions
  • Optional fetchPrice?: boolean
  • Optional isLP?: boolean
  • logoURI: string
  • mint: string
  • name: string
  • Optional price?: number
  • symbol: string
  • Optional tags?: string[]
ITypedLayout<T>: Omit<Layout<T>, "decode" | "encode"> & { decode: any; encode: any }

Layout with decode/encode types.

Type Parameters

  • T

IUnstableMethods: "blockSubscribe" | "blockUnsubscribe" | "slotsUpdatesSubscribe" | "slotsUpdatesUnsubscribe" | "voteSubscribe" | "voteUnsubscribe"
IUserVestingInfo: { claimableAmount: Iu64; lastUpdatedTime: Iu64; lastVestTime: Iu64; owner: IPublicKey; pubkey: IPublicKey; vestConfig: IPublicKey; vestedHolder: IPublicKey; vestedHolderAmount: Iu64 }

Type declaration

  • claimableAmount: Iu64
  • lastUpdatedTime: Iu64
  • lastVestTime: Iu64
  • owner: IPublicKey
  • pubkey: IPublicKey
  • vestConfig: IPublicKey
  • vestedHolder: IPublicKey
  • vestedHolderAmount: Iu64

Variables

IConfirmStatus: { CANCEL: number; ERROR: number; SUCCESS: number } = ...

Type declaration

  • CANCEL: number
  • ERROR: number
  • SUCCESS: number
ONE_DECIMAL: Decimal = ...
ONE_HUNDRED_DECIMAL: Decimal = ...
TokenAccountLayout: ITypedLayout<{ amount: Buffer; closeAuthority: Buffer; closeAuthorityOption: number; delegate: Buffer; delegateOption: number; delegatedAmount: Buffer; isNative: Buffer; isNativeOption: number; mint: Buffer; owner: Buffer; state: number }> = ...

Layout for a TokenAccount.

ZERO_DECIMAL: Decimal = ...
useBalanceStore: UseBoundStore<StoreApi<BalanceStore>> = ...

balance store

example
const {
balances,
fetchBalances,
resetBalance
} = useBalanceStore();
useBondingStore: UseBoundStore<StoreApi<BondingStore>> = ...

bonding store

example
const {
bondingList,
resetBondingList,
fetchBondingList
} = useBondingStore();
useMessageStore: UseBoundStore<StoreApi<MessageStore>> = ...

message store

example
const {
messages,
pushMessage,
removeMessage,
clearMessages
} = useMessageStore();
usePoolStore: UseBoundStore<StoreApi<PoolStore>> = ...

pool store

example
const {
pools,
updatePools,
fetchPoolList
} = usePoolStore();
useRewardsStore: UseBoundStore<StoreApi<IRewardsStore>> = ...

rewards store

example
const {
fetchUnclaimed,
getClaimStatus,
claimCommon,
claimOne
} = useRewardsStore();
useStakingStore: UseBoundStore<StoreApi<StakingStore>> = ...

staking store

example
const {
stakingList,
fetchStakingList
} = useStakingStore();
useTokenPriceStore: UseBoundStore<StoreApi<StoreComponent>> = ...

token price store

example
const {
tokenPrices,
fetchTokenPrices,
updateOneTokenPrices,
updateAllTokenPrices
} = useTokenPriceStore();
useTokensStore: UseBoundStore<StoreApi<StoreComponent>> = ...

tokens store

example
const {
allTokens,
fetchTokens,
updateAllTokens
} = useTokensStore();
useUserVestingStore: UseBoundStore<StoreApi<VestingStore>> = ...

vesting store

example
const {
userVestingInfo,
resetUserVestingInfo,
fetchUserVestingInfo
} = useUserVestingStore();
useZappingStore: UseBoundStore<StoreApi<ZappingStore>> = ...

zapping store

example
const {
estimatePayoutAmount,
prepareAccounts,
executeBond
} = useZappingStore();

Functions

  • global config provider for Pngfi api

    example
    const wallet = useWallet();

    <PngfiProvider
    appId="xkwFOD8LDi1nA2yl1Mc6F6ehone6MwsPhdHU1euAj3Mx"
    cluster='mainnet-beta'
    userPublicKey={wallet.publicKey}>
    {children}
    </PngfiProvider>

    Parameters

    Returns Element

  • beautify(str?: string): string
  • Parameters

    • str: string = ''

    Returns string

  • createApprovalInstruction(ownerAddress: PublicKey, approveAmount: u64, tokenUserAddress: PublicKey, userTransferAuthority?: Keypair): { userTransferAuthority: Keypair } & Instruction
  • Parameters

    • ownerAddress: PublicKey
    • approveAmount: u64
    • tokenUserAddress: PublicKey
    • Optional userTransferAuthority: Keypair

    Returns { userTransferAuthority: Keypair } & Instruction

  • createAssociatedTokenAccountInstruction(associatedTokenAddress: PublicKey, fundSource: PublicKey, destination: PublicKey, tokenMint: PublicKey): Instruction
  • Parameters

    • associatedTokenAddress: PublicKey
    • fundSource: PublicKey
    • destination: PublicKey
    • tokenMint: PublicKey

    Returns Instruction

  • createTokenAccount(__namedParameters: { accountSigner?: Signer; mint: PublicKey; owner?: PublicKey; payer?: PublicKey; provider: Provider }): Promise<IResolvedTokenAccountInstruction>
  • Parameters

    • __namedParameters: { accountSigner?: Signer; mint: PublicKey; owner?: PublicKey; payer?: PublicKey; provider: Provider }
      • Optional accountSigner?: Signer

        The keypair of the account to be created.

      • mint: PublicKey
      • Optional owner?: PublicKey
      • Optional payer?: PublicKey
      • provider: Provider

    Returns Promise<IResolvedTokenAccountInstruction>

  • createTokenMint(provider: Provider, authority: PublicKey, mint: PublicKey, decimals?: number): Promise<Instruction>
  • Parameters

    • provider: Provider
    • authority: PublicKey
    • mint: PublicKey
    • decimals: number = 6

    Returns Promise<Instruction>

  • createWSOLAccountInstructions(owner: PublicKey, solMint: PublicKey, amountIn: u64, rentExemptLamports: number): ResolvedTokenAddressInstruction
  • Parameters

    • owner: PublicKey
    • solMint: PublicKey
    • amountIn: u64
    • rentExemptLamports: number

    Returns ResolvedTokenAddressInstruction

  • deserializeTokenAccount(data: Buffer): Omit<AccountInfo, "address">
  • Parameters

    • data: Buffer

    Returns Omit<AccountInfo, "address">

  • getAmountsForUser(distributor: string, user: string): Promise<string>
  • Parameters

    • distributor: string
    • user: string

    Returns Promise<string>

  • getBalanceTree(rewards: { amount: string; dest: string }[]): BalanceTree
  • Parameters

    • rewards: { amount: string; dest: string }[]

    Returns BalanceTree

  • getBalances(user: string): Promise<any>
  • Parameters

    • user: string

    Returns Promise<any>

  • getBonding(): Promise<any>
  • Returns Promise<any>

  • getDistributorEpochs(distributor: string): Promise<any>
  • Parameters

    • distributor: string

    Returns Promise<any>

  • getDistributorInfo(distributor: string): Promise<any>
  • Parameters

    • distributor: string

    Returns Promise<any>

  • getDistributorRewardsEpoch(distributor: string, epoch: string): Promise<any>
  • Parameters

    • distributor: string
    • epoch: string

    Returns Promise<any>

  • getDistributors(user: string): Promise<any>
  • Parameters

    • user: string

    Returns Promise<any>

  • getMarkets(): Promise<any>
  • Returns Promise<any>

  • getMerkleRewards(user: string): Promise<any>
  • Parameters

    • user: string

    Returns Promise<any>

  • getMerkleRewardsDistributor(distributor: string): Promise<any>
  • Parameters

    • distributor: string

    Returns Promise<any>

  • getPools(): Promise<any>
  • Returns Promise<any>

  • getPrice(symbol: string): Promise<any>
  • Parameters

    • symbol: string

    Returns Promise<any>

  • getPrices(symbols?: string[]): Promise<any>
  • Parameters

    • Optional symbols: string[]

    Returns Promise<any>

  • getStaking(): Promise<any>
  • Returns Promise<any>

  • getTokenAccountInfo(provider: Provider, tokenAccount: PublicKey): Promise<null | Omit<AccountInfo, "address">>
  • Parameters

    • provider: Provider
    • tokenAccount: PublicKey

    Returns Promise<null | Omit<AccountInfo, "address">>

  • getTokenMintInfo(provider: Provider, tokenMint: PublicKey): Promise<MintInfo>
  • Parameters

    • provider: Provider
    • tokenMint: PublicKey

    Returns Promise<MintInfo>

  • getTokens(): Promise<any>
  • Returns Promise<any>

  • getUserVesting(owner: string, vestConfig: string): Promise<any>
  • Parameters

    • owner: string
    • vestConfig: string

    Returns Promise<any>

  • isNumber(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

  • pngAddLiquidityInstruction(poolInfo: IPool, ownerAccount: PublicKey, userSourceTokenAccount: PublicKey, userLPTokenAccount: PublicKey, amount: u64): TransactionInstruction
  • Parameters

    • poolInfo: IPool
    • ownerAccount: PublicKey
    • userSourceTokenAccount: PublicKey
    • userLPTokenAccount: PublicKey
    • amount: u64

    Returns TransactionInstruction

  • postConfirmDistributor(options: IDistributorConfirm, headers: AxiosRequestHeaders): Promise<any>
  • Parameters

    Returns Promise<any>

  • raydiumSwapInstruction(isBase: boolean, poolInfo: LiquidityPoolInfo, poolKeys: LiquidityPoolKeysV4, depositAmount: u64, ownerAccount: PublicKey, userLPTokenATokenAccount: PublicKey, userLPTokenBTokenAccount: PublicKey): TransactionInstruction
  • Parameters

    • isBase: boolean
    • poolInfo: LiquidityPoolInfo
    • poolKeys: LiquidityPoolKeysV4
    • depositAmount: u64
    • ownerAccount: PublicKey
    • userLPTokenATokenAccount: PublicKey
    • userLPTokenBTokenAccount: PublicKey

    Returns TransactionInstruction

  • signAuth(signMessage: undefined | ((message: Uint8Array) => Promise<Uint8Array>), message: string): Promise<string>
  • Parameters

    • signMessage: undefined | ((message: Uint8Array) => Promise<Uint8Array>)
    • message: string

    Returns Promise<string>

  • simulateTransaction(connection: Connection, feePayer: PublicKey, instructions: TransactionInstruction[], accounts?: PublicKey[], signers?: Signer[]): Promise<RpcResponseAndContext<SimulatedTransactionResponse>>
  • Parameters

    • connection: Connection
    • feePayer: PublicKey
    • instructions: TransactionInstruction[]
    • Optional accounts: PublicKey[]
    • Optional signers: Signer[]

    Returns Promise<RpcResponseAndContext<SimulatedTransactionResponse>>

  • simulateTransactionAndGetBalanceChanges(connection: Connection, instructions: TransactionInstruction[], owner: PublicKey, tokenAccount: PublicKey): Promise<{ diff: any; postBalance: string; preBalance: any }>
  • Parameters

    • connection: Connection
    • instructions: TransactionInstruction[]
    • owner: PublicKey
    • tokenAccount: PublicKey

    Returns Promise<{ diff: any; postBalance: string; preBalance: any }>

  • toFixed(value?: number, fixed?: number, force?: boolean): string
  • Parameters

    • value: number = 0
    • fixed: number = 2
    • force: boolean = false

    Returns string

  • toPoolInfo(item: IResponsePoolInfo): { address: PublicKey; authority: PublicKey; curveType: string; feeAccount: PublicKey; feeStructure: string; lpSupply: Decimal; nonce: string; poolTokenDecimals: string; poolTokenMint: PublicKey; tokenA: { addr: PublicKey; amount: any; chainId?: number; decimals: undefined | number; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] }; tokenB: { addr: PublicKey; amount: any; chainId?: number; decimals: undefined | number; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] } }
  • Parameters

    Returns { address: PublicKey; authority: PublicKey; curveType: string; feeAccount: PublicKey; feeStructure: string; lpSupply: Decimal; nonce: string; poolTokenDecimals: string; poolTokenMint: PublicKey; tokenA: { addr: PublicKey; amount: any; chainId?: number; decimals: undefined | number; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] }; tokenB: { addr: PublicKey; amount: any; chainId?: number; decimals: undefined | number; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] } }

    • address: PublicKey
    • authority: PublicKey
    • curveType: string
    • feeAccount: PublicKey
    • feeStructure: string
    • lpSupply: Decimal
    • nonce: string
    • poolTokenDecimals: string
    • poolTokenMint: PublicKey
    • tokenA: { addr: PublicKey; amount: any; chainId?: number; decimals: undefined | number; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] }
      • addr: PublicKey
      • amount: any
      • Optional chainId?: number
      • decimals: undefined | number
      • Optional display?: boolean
      • Optional extensions?: IExtensions
      • Optional fetchPrice?: boolean
      • Optional isLP?: boolean
      • logoURI: string
      • mint: string
      • name: string
      • Optional price?: number
      • symbol: string
      • Optional tags?: string[]
    • tokenB: { addr: PublicKey; amount: any; chainId?: number; decimals: undefined | number; display?: boolean; extensions?: IExtensions; fetchPrice?: boolean; isLP?: boolean; logoURI: string; mint: string; name: string; price?: number; symbol: string; tags?: string[] }
      • addr: PublicKey
      • amount: any
      • Optional chainId?: number
      • decimals: undefined | number
      • Optional display?: boolean
      • Optional extensions?: IExtensions
      • Optional fetchPrice?: boolean
      • Optional isLP?: boolean
      • logoURI: string
      • mint: string
      • name: string
      • Optional price?: number
      • symbol: string
      • Optional tags?: string[]
  • toStakingInfo(item: IResponseStakingInfo): { apy: number; payoutTokenMint: PublicKey; pubkey: PublicKey; rebaseEpochDuration: number; rebaseLastTime: number; rebaseRateDenominator: number; rebaseRateNumerator: number; rebaseRewardsAmount: u64; rebaseSupply: u64; rewardsHolder: PublicKey; rewardsPerDay: string; sTokenMint: PublicKey; sTokenMintSupply: u64; tokenHolder: PublicKey; tokenHolderAmount: u64; tokenMint: PublicKey; vestConfigInfo: { claimAllDuration: any; claimableHolder: PublicKey; claimableMint: PublicKey; halfLifeDuration: any; pubkey: PublicKey; vestMint: PublicKey } }
  • Parameters

    Returns { apy: number; payoutTokenMint: PublicKey; pubkey: PublicKey; rebaseEpochDuration: number; rebaseLastTime: number; rebaseRateDenominator: number; rebaseRateNumerator: number; rebaseRewardsAmount: u64; rebaseSupply: u64; rewardsHolder: PublicKey; rewardsPerDay: string; sTokenMint: PublicKey; sTokenMintSupply: u64; tokenHolder: PublicKey; tokenHolderAmount: u64; tokenMint: PublicKey; vestConfigInfo: { claimAllDuration: any; claimableHolder: PublicKey; claimableMint: PublicKey; halfLifeDuration: any; pubkey: PublicKey; vestMint: PublicKey } }

    • apy: number
    • payoutTokenMint: PublicKey
    • pubkey: PublicKey
    • rebaseEpochDuration: number
    • rebaseLastTime: number
    • rebaseRateDenominator: number
    • rebaseRateNumerator: number
    • rebaseRewardsAmount: u64
    • rebaseSupply: u64
    • rewardsHolder: PublicKey
    • rewardsPerDay: string
    • sTokenMint: PublicKey
    • sTokenMintSupply: u64
    • tokenHolder: PublicKey
    • tokenHolderAmount: u64
    • tokenMint: PublicKey
    • vestConfigInfo: { claimAllDuration: any; claimableHolder: PublicKey; claimableMint: PublicKey; halfLifeDuration: any; pubkey: PublicKey; vestMint: PublicKey }
      • claimAllDuration: any
      • claimableHolder: PublicKey
      • claimableMint: PublicKey
      • halfLifeDuration: any
      • pubkey: PublicKey
      • vestMint: PublicKey
  • toVestingInfo(item: IResponseUserVestingInfo): undefined | { claimableAmount: u64; lastUpdatedTime: u64; lastVestTime: u64; owner: PublicKey; pubkey: PublicKey; vestConfig: PublicKey; vestedHolder: PublicKey; vestedHolderAmount: u64 }
  • Parameters

    Returns undefined | { claimableAmount: u64; lastUpdatedTime: u64; lastVestTime: u64; owner: PublicKey; pubkey: PublicKey; vestConfig: PublicKey; vestedHolder: PublicKey; vestedHolderAmount: u64 }

  • transferToken(source: PublicKey, destination: PublicKey, amount: u64, payer: PublicKey): { cleanupInstructions: never[]; instructions: any[]; signers: never[] }
  • Parameters

    • source: PublicKey
    • destination: PublicKey
    • amount: u64
    • payer: PublicKey

    Returns { cleanupInstructions: never[]; instructions: any[]; signers: never[] }

    • cleanupInstructions: never[]
    • instructions: any[]
    • signers: never[]
  • solana provider

    example
    const { connection } = useConnection();
    const { wallet, connected } = useWallet();
    const provider = useAnchorProvider({
    connection,
    wallet,
    connected
    })

    Parameters

    Returns Provider

    Provider

  • useBalances(user: null | string): { data: any; error: any; loading: boolean }
  • Parameters

    • user: null | string

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • Parameters

    • provider: Provider

    Returns IBondResponse

  • useCoinsIdMarketChart(options: ICoinsIdMarketChart): { data: any; error: any; loading: boolean }
  • Get historical market data include price, market cap, and 24h volume (granularity auto)

    Parameters

    • options: ICoinsIdMarketChart

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • useCoinsMarkets(coingeckoId: string | string[], vsCurrency?: string): { data: any; error: any; loading: boolean }
  • List all supported coins price, market cap, volume, and market related data

    Parameters

    • coingeckoId: string | string[]
    • vsCurrency: string = 'usd'

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • get distributor

    example
    const { data, loading, error } = useDistributor(publicKey.toString());
    

    Parameters

    • address: string

    Returns IResponse<IDistributorResponse>

    IResponse

  • useDistributorEpochs(distributor: string): IResponse<string[]>
  • Parameters

    • distributor: string

    Returns IResponse<string[]>

  • useDistributorRewardsEpoch(distributor: string, epoch: string): IResponse<IRewards[]>
  • Parameters

    • distributor: string
    • epoch: string

    Returns IResponse<IRewards[]>

  • List of distributors

    example
    const { data, loading, error } = useDistributors(publicKey.toString());
    

    Parameters

    • user: string

    Returns IResponse<IDistributorResponse[]>

    IResponse<IDistributorResponse[]>

  • useJsonRPC(options: IRPCRequest): { data: any; error: any; loading: boolean }
  • example
    const { id, result } = useJsonRPC({
    "method":"getLatestBlockhash",
    "jsonrpc":"2.0",
    "params":[{
    "commitment":"confirmed"
    }],
    "id":"952c496d-dd14-4de3-8fca-d268d36c66dc"
    });

    Parameters

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • List of distributor rewards

    example
    const { data, loading, error } = useMerkleRewards(publicKey.toString());
    

    Parameters

    • user: string

    Returns IResponse<IMerkleRewardsResponse[]>

    IResponse

  • usePngfiConfig(): FullConfiguration
  • Returns FullConfiguration

  • Request multiple interfaces API and return a fast and stable price.

    example
    const price = usePrice('SOL');
    

    Parameters

    • symbol: string

    Returns IResponse<string>

  • usePrices(symbols?: string[]): IResponse<Record<string, number>>
  • Request multiple interfaces API and return multiple fast and stable token's price.

    example
    let prices = usePrices(['SOL', 'ETH', 'BTC']);
    prices = usePrices([]);
    prices = usePrices();

    Parameters

    • Optional symbols: string[]

    Returns IResponse<Record<string, number>>

  • useSimplePrice(coingeckoId: string | string[], vs_currencies?: string | string[]): { data: any; error: any; loading: boolean }
  • Get the current price of any cryptocurrencies in any other supported currencies that you need.

    Parameters

    • coingeckoId: string | string[]
    • vs_currencies: string | string[] = 'usd'

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • useSimpleTokenPrice(options: ISimpleTokenPrice): { data: any; error: any; loading: boolean }
  • Get current price of tokens (using contract addresses) for a given platform in any other currency that you need.

    Parameters

    • options: ISimpleTokenPrice

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • Parameters

    • provider: Provider

    Returns IStakeResponse

  • useToken(filter: Record<keyof IToken, any>): any
  • Parameters

    • filter: Record<keyof IToken, any>

    Returns any

  • useTokenByDefault(filter: Record<keyof IToken, any>): any
  • Parameters

    • filter: Record<keyof IToken, any>

    Returns any

  • useTokenByMint(mint: string): any
  • Parameters

    • mint: string

    Returns any

  • useTokenBySymbol(symbol: string): any
  • Parameters

    • symbol: string

    Returns any

  • useTokensByMints(mints: string[]): any
  • Parameters

    • mints: string[]

    Returns any

  • useTokensBySymbols(symbols: string[]): any
  • Parameters

    • symbols: string[]

    Returns any

  • useTokensPriceByMints(mints: string[]): { data: any; error: any; loading: boolean }
  • Parameters

    • mints: string[]

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • useTokensPriceBySymbols(symbols: string[]): { data: any; error: any; loading: boolean }
  • Parameters

    • symbols: string[]

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • useUserPublicKey(): PublicKey
  • get userPublicKey of PngfiProvider config

    example
    const userPublicKey = useUserPublicKey();
    

    Returns PublicKey

    userPublicKey

  • useUserVesting(owner: string, vestConfig: string): { data: any; error: any; loading: boolean }
  • Parameters

    • owner: string
    • vestConfig: string

    Returns { data: any; error: any; loading: boolean }

    • data: any
    • error: any
    • loading: boolean
  • Returns IUtils

Generated using TypeDoc