Function useCandidAdapter

  • Accesses the CandidAdapter to download the actor's Candid interface.

    Returns types.CandidAdapter

    The CandidAdapter instance.

    Example

    function CandidAdapterComponent() {
    const candidAdapter = useCandidAdapter();

    const getActor = async () => {
    const { idlFactory } = await candidAdapter.getCandidDefinition(canisterId)
    console.log(idlFactory)
    }

    return (
    <button onClick={getActor}>Get Actor</button>
    );
    }