npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@completium/experiment-ts

v1.0.3

Published

Test Archetype contracts in TS

Downloads

44

Readme

Testing contracts in TS

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

Types

The table below presents exported types:

| Type | Desc | | -- | -- | | Micheline | Micheline value | | MichelineType | Micheline type | | Account | Account imported with Completium CLI | | Parameters | Extra 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.

| Parameter | Type | Desc | | -- | -- | -- | | d | Date | Date value for now |

set_quiet(b) : void

Sets quiet mode (no execution trace) to b.

| Parameter | Type | Desc | | -- | -- | -- | | b | boolean | quiet mode |

Account

get_account(name) : Account

Returns account named name

| Parameter | Type | Desc | | -- | -- | -- | | name | string | Account name |

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

Transfers tez from an account to another.

| Parameter | Type | Desc | | -- | -- | -- | | from | Account | Account to transfer from | | to | Account \| string | Account or address to transfer to | | amount | bigint | Amount to transfer in mutez |

Crypto

pack(obj, typ) : string

Off-chain version of pack utility

| Parameter | Type | Desc | | -- | -- | -- | | obj | Micheline | Object to pack | | typ | MichelineType \| undefined | Optional Micheline Type of obj |

sign(v, a) : Promise<string>

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

| Parameter | Type | Desc | | -- | -- | -- | | v | string | value to sign | | a | Account | Signer account |

Contract

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

Deploys an archetype contract. Returns contract address.

| Parameter | Type | Desc | | -- | -- | -- | | path | string | Path to archetype contract file (.arl) | | parameters | any | Contract parameters | | p | Partial<Parameters> | Deployment parameters |

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

Calls a contract entrypoint.

| Parameter | Type | Desc | | -- | -- | -- | | addr | string | Contract address | | entry | string | Contract entry point name | | arg | Micheline | Entry point parameter | | params | Partial<Parameters> | Call parameters |

get_storage(addr) : Promise<any

Returns contract storage.

| Parameter | Type | Desc | | -- | -- | -- | | addr | string | Contract address |

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

Returns the value associated to a key in a big_map

| Parameter | Type | Desc | | -- | -- | -- | | bmid | bigint | Big map identifier | | k | Michleine | Key value | | t | MichelineType | Key type |

Flow control

expect_to_fail(f, error) : Promise<void>

Fails if f does not fail with error

| Parameter | Type | Desc | | -- | -- | -- | | f | { () : Promise<void> } | Function to execute | | error | Michleine | Error 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 |