PollarPollarDemo

Products

AuthenticationWalletTransactions

Integrations

KYCSoonRampNewSwapNewEarnNew

Wallet Adapters

Stellar Wallets KitPrivyNew

Adapters

Trustless Work

Built with Pollar

LumenWipeNew
SendReceiveBalanceAssetsHistoryDistribution

Distribution

List the distribution rules the user is eligible for and claim their share. Pollar renders the rule list and claim actions inside a modal.

Drop-in button that opens a prebuilt modal — the eligible-rule list and claim actions are all rendered for you.

openDistributionRulesModal() takes no arguments — it loads the user's rules and handles claiming.

Hook & values used

All of these come from the usePollar() hook — the react layer built on top of getClient().

  • usePollar()hook

    params: No arguments. Call it at the top level of a component — it reads React context, so it must run during render.

    returns: PollarContextValue — the whole SDK surface: reactive state values, modal openers, and getClient() to drop down to core.

  • openDistributionRulesModal()sync

    params: No arguments — it loads the user's rules and handles claiming.

    returns: void — opens the prebuilt modal; there is nothing to await.

@pollar/react— hooks & components
import { usePollar } from '@pollar/react';

export function DistributionButton() {
  const { openDistributionRulesModal, isAuthenticated } = usePollar();

  // openDistributionRulesModal renders the rule list + claim
  // buttons on top of client.listDistributionRules / claimDistributionRule.
  return (
    <button
      onClick={openDistributionRulesModal}
      disabled={!isAuthenticated}
    >
      Distribution rules
    </button>
  );
}