Skip to main content

Packages API

The Dapp relies on 3 packages:

@completium/archetype-ts-types

The @completium/archetype-ts-types package is presented here.

@completium/dapp-ts

call(c, e, a, p)

Low-level asynchronous call to contract's entry points used by contract binding.

Parameters


c :

string

Contract address


e :

string

entry point name


entry point argument


p :

Parameters

Call parameter (caller and transferred)

Returns


Various data about transaction.

Fails with

Error

An error is thrown if the transaction fails.


Related

deploy(path, params, p)

Low-level asynchronous function to deploy an Archetype contract, called by the deploy method of the contract's binding.

Parameters


path :

string

Path to contract (relative to command's execution folder)


params :

Contract intital storage values


p :

Parameters

Call parameter (caller and transferred)

Returns


DeployResult

Various data about deployment transaction.

exec_batch(cps, p)

Asynchronous function to execute calls to entry points in batch mode. See here for more information.

Parameters


cps :

Array<CallParameter>

Array of CallParameter values


p :

Parameters

Call parameter (caller and transferred)

Returns


Transaction information.

Fails with

Error

An error is thrown if one the transactions fails.


Related

exec_getter(c, e, a, p)

TODO

Parameter


a :

string

Contract address

Returns


any

TODO

Fails with

does not fail

exec_view(c, e, a, p)

Low-level asynchronous function to call on on-chain contract's view. It is used by the contract binding to call a view.

Parameters


Contract address


n :

string

View's name


View argument


Parameters

Returns


ViewResult

View's returned value

get_balance()

Asynchronous function to retrieve contract's balance

Parameter


Contract address

Returns


Contract balance

get_big_map_value(id, key, kv, kt)

Returns the value associated to key in big_map with id id. It is used by the generated big map getter of the contract's binding.

Parameters


id :

number

Big map identifier


key :

Key value


Key type


Value type

Returns


Promise<any>

Micheline value associated to key, null if not found.

Fails with

does not fail


Related

get_call_param(c, e, a, p)

Low-level asynchronous function to get the transaction parameters to call an entry point. It is used by the contract's binding to get entry point transaction parameters for batch execution of entry points.

Parameters


c :

string

Contract address


e :

string

Entry point name


Entry point argument


Parameters

Returns


CallParameter

Transaction parameter

get_storage(a)

Asynchronous function that returns the Taquito storage of a contract.

Parameter


a :

string

Contract address

Returns


any

Taquito's formatted contract storage.

originate(c, s, p)

Originates a contract with code c and initial storage s

Parameters


Contract Code


Initial contract storage


Parameters

Fails with

does not fail

set_binder_tezos_toolkit(tk)

Sets the Taquito Toolkit. It is used by the binding object to make calls to the blockchain.

Parameter


tk :

TezosToolkit

Taquito's toolkit

@completium/event-listener

register_event(p)

Low-level function to register an event listener. It is used by contract binding's register event methods.

Parameter


p :

RegisterParam

Parameter object:
  • source as string: emiting contract's address
  • filter as EventFilter: filter function to discriminate the event to listen to
  • process as EventProcessor: callback function to trigger when an event is emitted

run_listener(o)

Starts event listener "worker" (potentially-indefinite loop with timer)

Parameter


o :

EventListenerOptions

Event listener optional options:
  • delay: number of milliseconds between two lookups of the event well contract
  • horizon: number of blocks to look back (the higher, the higher the probability to read the main branch)
  • endpoint: endpoint used by the event listener
  • bottom: block hash to start crawling from (defaulted to head~2)
  • verbose: flag to turn crank's verbose mode on/off

stop_listener()

Stops event listener.