Skip to main content

fhe-airdrop/advanced/react

Interfaces

UsePredictAirdropAddressArgs

Defined in: fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:13

React hooks for @tokenops/sdk/fhe-airdrop/advanced. The headline React subpath stays lean; pre-mine address prediction lives here.

Properties

PropertyTypeDescriptionDefined in
params?... | ...-fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:14
userSalt?... | ...-fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:15
deployer?... | ...-fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:16
gasFee?... | ...Gas fee in wei to embed into the CREATE2 salt computation. Must match the fee that will be (or was) active for deployer at deploy time: custom fee if getCustomFee(deployer).enabled, otherwise defaultGasFee. Passing the wrong value produces a different address than the deployed clone — use useAirdropFactoryCustomFee and useAirdropFactoryDefaultGasFee from the headline @tokenops/sdk/fhe-airdrop/react subpath to resolve it correctly.fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:27
address?... | ...Override the on-chain factory address. Defaults to DEPLOYED_ADDRESSES.fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:29
chainId?... | ...Override the chain id used for default address resolution. Defaults to usePublicClient().chain?.id.fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:31
publicClient?... | ...Override the viem PublicClient — bypasses the wagmi context.fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:33
encryptor?... | ...Lazy or eager encryptor source. Not required for predict reads, accepted for client-construction symmetry.fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:35

Functions

usePredictAirdropAddress()

function usePredictAirdropAddress(args?): UseQueryResult<..., ...>;

Defined in: fhe-airdrop/advanced/react/usePredictAirdropAddress.ts:58

Compute the deterministic CREATE2 address the factory would produce for an airdrop clone without deploying it.

Advanced surface. This hook lives on the advanced subpath because the common "deploy and learn the address" flow is better served by useCreateConfidentialAirdropAndGetAddress on the headline React subpath — which parses the address from the ConfidentialAirdropCreated event and never has to guess the gasFee that was active at deploy time.

The hook is disabled until all four of params, userSalt, deployer, and gasFee are set.

Parameters

ParameterType
argsUsePredictAirdropAddressArgs

Returns

UseQueryResult<..., ...>

Example

import { usePredictAirdropAddress } from "@tokenops/sdk/fhe-airdrop/advanced/react";

const { data: predictedAddress } = usePredictAirdropAddress({
params, userSalt, deployer, gasFee: defaultGasFee,
});