1.0.3 • Published 4 months ago

@completium/experiment-ts v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Testing contracts in TS

This library provides a TypeScript layer on top of Completium CLI library.

Types

The table below presents exported types:

TypeDesc
MichelineMicheline value
MichelineTypeMicheline type
AccountAccount imported with Completium CLI
ParametersExtra parameters when calling entrypoints (caller and amount of tez sent)

Execution modes

set_mockup() : void

Sets Completium to work in mockup mode.

set_mockup_now(d) : void

Sets contract's now value.

ParameterTypeDesc
dDateDate value for now

set_quiet(b) : void

Sets quiet mode (no execution trace) to b.

ParameterTypeDesc
bbooleanquiet mode

Account

get_account(name) : Account

Returns account named name

ParameterTypeDesc
namestringAccount name

transfer(from, to, amount) : Promise<void>

Transfers tez from an account to another.

ParameterTypeDesc
fromAccountAccount to transfer from
toAccount \| stringAccount or address to transfer to
amountbigintAmount to transfer in mutez

Crypto

pack(obj, typ) : string

Off-chain version of pack utility

ParameterTypeDesc
objMichelineObject to pack
typMichelineType \| undefinedOptional Micheline Type of obj

sign(v, a) : Promise<string>

Off-chain signature utility. A signature is check on-chain withcheck_signature

ParameterTypeDesc
vstringvalue to sign
aAccountSigner account

Contract

deploy(path, paramters, p) : Promise<string>)

Deploys an archetype contract. Returns contract address.

ParameterTypeDesc
pathstringPath to archetype contract file (.arl)
parametersanyContract parameters
pPartial<Parameters>Deployment parameters

call(addr, entry, arg, params) : Promise<void>

Calls a contract entrypoint.

ParameterTypeDesc
addrstringContract address
entrystringContract entry point name
argMichelineEntry point parameter
paramsPartial<Parameters>Call parameters

get_storage(addr) : Promise<any

Returns contract storage.

ParameterTypeDesc
addrstringContract address

get_big_map_value(bmid, k, t) : Promise<Micheline>

Returns the value associated to a key in a big_map

ParameterTypeDesc
bmidbigintBig map identifier
kMichleineKey value
tMichelineTypeKey type

Flow control

expect_to_fail(f, error) : Promise<void>

Fails if f does not fail with error

ParameterTypeDesc
f{ () : Promise<void> }Function to execute
errorMichleineError to catch

Micheline utilities

Name
prim_to_mich_type
bool_to_mich
bigint_to_mich
string_to_mich
elt_to_mich
pair_to_mich
pair_to_mich_type
option_to_mich_type
none_mich
some_to_mich
option_to_mich
list_to_mich
set_to_mich
1.0.2

4 months ago

1.0.3

4 months ago

1.0.1

5 months ago

1.0.0

5 months ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.0.106-dev-2

1 year ago

0.0.106-dev-3

1 year ago

0.0.105

1 year ago

0.0.104

1 year ago

0.0.103

1 year ago

0.0.102

1 year ago

0.0.101

1 year ago

0.0.100

2 years ago

0.1.0

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.3

1 year ago

0.0.106-dev

1 year ago

0.0.97

2 years ago

0.0.98

2 years ago

0.0.99

2 years ago

0.0.96

2 years ago

0.0.95

2 years ago

0.0.94

2 years ago

0.0.93

2 years ago

0.0.91

2 years ago

0.0.92

2 years ago

0.0.86

2 years ago

0.0.87

2 years ago

0.0.88

2 years ago

0.0.89

2 years ago

0.0.90

2 years ago

0.0.85

2 years ago

0.0.84

2 years ago

0.0.83

2 years ago

0.0.81

2 years ago

0.0.82

2 years ago

0.0.80

2 years ago

0.0.79

2 years ago

0.0.40

2 years ago

0.0.41

2 years ago

0.0.42

2 years ago

0.0.43

2 years ago

0.0.44

2 years ago

0.0.45

2 years ago

0.0.46

2 years ago

0.0.47

2 years ago

0.0.37

2 years ago

0.0.38

2 years ago

0.0.39

2 years ago

0.0.73

2 years ago

0.0.74

2 years ago

0.0.75

2 years ago

0.0.76

2 years ago

0.0.77

2 years ago

0.0.33

2 years ago

0.0.78

2 years ago

0.0.34

2 years ago

0.0.35

2 years ago

0.0.36

2 years ago

0.0.70

2 years ago

0.0.71

2 years ago

0.0.72

2 years ago

0.0.62

2 years ago

0.0.63

2 years ago

0.0.64

2 years ago

0.0.65

2 years ago

0.0.66

2 years ago

0.0.67

2 years ago

0.0.68

2 years ago

0.0.69

2 years ago

0.0.60

2 years ago

0.0.61

2 years ago

0.0.59

2 years ago

0.0.51

2 years ago

0.0.52

2 years ago

0.0.53

2 years ago

0.0.54

2 years ago

0.0.55

2 years ago

0.0.56

2 years ago

0.0.57

2 years ago

0.0.58

2 years ago

0.0.50

2 years ago

0.0.48

2 years ago

0.0.49

2 years ago

0.0.31

2 years ago

0.0.32

2 years ago

0.0.30

2 years ago

0.0.29

2 years ago

0.0.28

2 years ago

0.0.27

2 years ago

0.0.26

2 years ago

0.0.25

2 years ago

0.0.24

2 years ago

0.0.23

2 years ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago