Taquito TypeDocs
    Preparing search index...

    Class TezosToolkit

    Facade class that surfaces all of the libraries capability and allow it's configuration

    The RPC server to use

    Index
    format: (
        from: Format | undefined,
        to: Format | undefined,
        amount: string | number | BigNumber,
    ) => string | number | BigNumber = format
    • Allow to add a module to the TezosToolkit instance. This method adds the appropriate Providers(s) required by the module to the internal context.

      Parameters

      Returns void

      Tezos.addExtension(new Tzip16Module());
      
    • Sets the strategy used for field numbering in Token execute/encode/decode to convert Michelson values to/from javascript objects

      Parameters

      • strategy: FieldNumberingStrategy

        a value of type FieldNumberingStrategy that controls how field numbers are calculated

      Returns void

    • Sets forger provider on the Tezos Taquito instance The LocalForger from @taquito/local-forging is set by default.

      Parameters

      • Optionalforger: Forger

        forger to use to interact with the Tezos network

      Returns void

      Tezos.setForgerProvider(this.getFactory(RpcForger)())
      
    • Sets global constants provider on the Tezos Taquito instance

      Parameters

      • OptionalglobalConstantsProvider: GlobalConstantsProvider

        globalConstantsProvider to use to interact with the Tezos network

      Returns void

      const globalConst = new DefaultGlobalConstantsProvider();
      globalConst.loadGlobalConstant({
      "expruu5BTdW7ajqJ9XPTF3kgcV78pRiaBW3Gq31mgp3WSYjjUBYxre": { prim: "int" },
      // ...
      })
      Tezos.setGlobalConstantsProvider(globalConst);
    • Sets injector provider on the Tezos Taquito instance

      Parameters

      • OptionalinjectorProvider: Injector

        Injector to use to interact with the Tezos network by default RpcInjector

      Returns void

    • Sets Packer provider on the Tezos Taquito instance

      Parameters

      • Optionalpacker: Packer

        packer to use to interact with the Tezos network

      Returns void

      Tezos.setPackerProvider(new MichelCodecPacker())
      
    • Sets configuration on the Tezos Taquito instance. Allows user to choose which signer, rpc client, rpc url, forger and so forth

      Parameters

      • options: SetProviderOptions

        rpc url or rpcClient to use to interact with the Tezos network

      Returns void

      Tezos.setProvider({rpc: 'https://mainnet.tezos.ecadinfra.com/', signer: new InMemorySigner.fromSecretKey(“edsk...”)})
      
      Tezos.setProvider({ config: { confirmationPollingTimeoutSecond: 300 }})
      
    • Sets read provider on the Tezos Taquito instance By default reads use the current RPC through RpcReadAdapter. An explicit provider can read from an indexer. Calling this method without a provider restores default reads that follow subsequent RPC changes.

      Parameters

      • OptionalreadProvider: TzReadProvider

        TzReadProvider to use to interact with the Tezos network

      Returns void

    • Sets rpc provider on the Tezos Taquito instance. Updates the toolkit-created default read provider. Explicit read providers remain unchanged.

      Parameters

      • Optionalrpc: string | RpcClientInterface

        rpc url or rpcClient to use to interact with the Tezos network

      Returns void

      Tezos.setRpcProvider('https://mainnet.tezos.ecadinfra.com/')
      
    • Sets signer provider on the Tezos Taquito instance.

      Parameters

      • Optionalsigner: Signer

        signer to use to interact with the Tezos network

      Returns void

      Tezos.setSignerProvider(new InMemorySigner.fromSecretKey('edsk...'))