Options
All
  • Public
  • Public/Protected
  • All
Menu
description

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

example
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);

Hierarchy

  • ContractsLibrary

Implements

  • Extension

Index

Constructors

constructor

Methods

addContract

  • addContract(contract: ContractsData): void
  • description

    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

configureContext

  • configureContext(context: Context): void

getContract

  • getContract(contractAddress: string): { entrypoints: EntrypointsResponse; script: ScriptedContracts }

Generated using TypeDoc