Class ContractAbstraction<T, TMethods, TMethodsObject, TViews, TContractViews, TStorage>

Smart contract abstraction

Type Parameters

  • T extends ContractProvider | Wallet
  • TMethods extends DefaultMethods<T> = DefaultMethods<T>
  • TMethodsObject extends DefaultMethodsObject<T> = DefaultMethodsObject<T>
  • TViews extends DefaultViews = DefaultViews
  • TContractViews extends DefaultContractViews = DefaultContractViews
  • TStorage extends DefaultStorage = DefaultStorage

Constructors

Properties

address: string
contractViews: TContractViews = ...

Contains on-chain views that are defined by the target Tezos Smart Contract, and offers the user to simulate the views execution as if they were native TS/JS methods. NB: the expected format for the parameter when calling a smart contract view is the object format (same format as for the storage) and not the flattened representation.

entrypoints: EntrypointsResponse
eventSchema: EventSchema[]
methods: TMethods = ...

use methodsObject instead, flat params of methods can't sufficiently represent all Michelson values

Contains methods that are implemented by the target Tezos Smart Contract, and offers the user to call the Smart Contract methods as if they were native TS/JS methods. NB: if the contract contains annotation it will include named properties; if not it will be indexed by a number.

methodsObject: TMethodsObject = ...

Contains methods that are implemented by the target Tezos Smart Contract, and offers the user to call the Smart Contract methods as if they were native TS/JS methods. methodsObject serves the exact same purpose as the methods member. The difference is that it allows passing the parameter in an object format when calling the smart contract method (instead of the flattened representation) NB: if the contract contains annotation it will include named properties; if not it will be indexed by a number.

parameterSchema: ParameterSchema
schema: Schema
script: ScriptedContracts
viewSchema: ViewSchema[]
views: TViews = ...

Contains lamda views (tzip4) that are implemented by the target Tezos Smart Contract, and offers the user to call the lambda views as if they were native TS/JS methods. NB: These are the view defined in the tzip4 standard, not the views introduced by the Hangzhou protocol.

Methods