Taquito TypeDocs
    Preparing search index...

    Allows to specify static data related to contracts (i.e., script and entrypoints) avoiding Taquito to fetch them from the network.

    import { ContractsLibrary } from '@taquito/contracts-library';
    import { TezosToolkit } from '@taquito/taquito';

    const Tezos = new TezosToolkit('rpcUrl');
    const contractsLibrary = new ContractsLibrary();

    contractsLibrary.addContract({
    ['contractAddress1']: {
    script: script1, // obtained from Tezos.rpc.getContract('contractAddress1').script
    entrypoints: entrypoints1 // obtained from Tezos.rpc.getEntrypoints('contractAddress1')
    },
    // load more contracts
    });

    Tezos.addExtension(contractsLibrary);

    Implements

    • Extension
    Index

    Constructors

    Methods

    • Saves one of several contract in the library

      Parameters

      • contract: ContractsData

        is an object where the key is a contract address and the value is an object having a script and an entrypoints properties. Note: the expected format for the script and entrypoints properties are the same as the one respectivlely returned by TezosToolkit.rpc.getContract('contractAddress').script and TezosToolkit.rpc.getEntrypoints

      Returns void

      InvalidAddressError If the contract address is not valid

      InvalidScriptFormatError If the script is not in the expected format