JS library

$completium-cli also comes as a Javascript library to implement test scenarios.

It provides a subset of commands as programming fnuctions. The benefit is that you can use endpoints and accounts already configured with the CLI, which simplifies the writing of scenarios.

Once installed locally, import the library with the following instruction;

const Completium = require('@completium/completium-cli');

Then create the completium object:

const completium = new Completium ();

An example of test scenario is available here.

API#

FunctionArgument(s)Description
originatepath, paramsOriginates Archetype contract with source code at path.

params is an optional object to specify originate parameters:
  • as : contract alias (defaulted to source file without .arl)
  • amount
  • burncap
  • metadatastorage
  • metadatauri
callalias, paramsCalls the contract with alias alias.

params is an optional object to specify call parameters:
  • as : account to use (defaulted to current one)
  • entry
  • with: entrypoint arguments
  • amount

Returns the Taquito operation object, augmented with a cost field, the total cost of the transaction.
getStoragealiasReturns the Taquito storage object of the contract with alias alias.
getAddressaliasReturns the address of the account or contract associated to alias.
setAccountaliasChanges the current account used to interact with contracts.
setEndpointaliasChanges the current endpoint.