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

warp-contracts-cli

v1.0.8

Published

[Warp SDK](https://github.com/warp-contracts/warp) dedicated CLI which eases the process of using main mathods of the library.

Downloads

31

Readme

Warp Contracts CLI

Warp SDK dedicated CLI which eases the process of using main mathods of the library.

Installation

NPM

npm install -g warp-contracts-cli

YARN

yarn global add warp-contracts-cli

...or simply run

npx warp-contracts-cli

Usage


Usage: warp [options] [command]

Options:
  -wlt, --wallet <string>                     Path to the wallet keyfile (e.g.: ./secrets/wallet.json)
  -env --environment <string>                 Envrionment in which action needs to be executed: local | testnet | mainnet (default:
                                              "mainnet")
  -lvl --level <string>                       Logging level: silly | trace | debug | info | warn | error | fatal | none (default: "none")
  -c --cacheLocation <string>                 Realtive path for the Level database location (default: "/cache/warp")
  -sil --silent                               Run CLI in silent mode (no logo, only error messages displayed, logged result not formatted
  -v, --version                               Display current version of Warp SDK
  -h, --help                                  display help for command

Commands:
  generate                                    Generate project template
  deploy                                      Deploy contract
  read [options] <contractId>                 Read contract state based on contract id
  write [options] <contractId> <interaction>  Write interaction to the contract based on specified contract id
  view <contractId> <input>                   View state of the contract based on specified contract id and provided input
  clear                                       Clears cache
  help [command]                              display help for command

Commands

Generate

Generate one of the project templates provided in this repository. Clones chosen Github subdirectory into new project. Sample contract with tools to deploy contract in test and mainnet environment as well to test the contract are provided.

Deploy

Executes deploying contract creator which asks user wether the contract will be deployed from file or from source transaction id and questions for the type of the contract (WASM or Javascript), if WASM is chosen, it then asks for the specific language in which contract is written (Rust, Assemlbyscript or Go). Lastly, user needs to provide source transaction id or path to the source file, path to the initial state file, path to the WASM source file (in case of WASM contracts) and path to the WASM glue code (in case of Rust contracts). It is possible to upload data within the contract (e.g. in case of deploying Atomic NFT contract) which will be put in a data field of the contract transaction - in that case user needs to provide type of data (e.g. image/png) and relative path to the data asset.

Contract is then deployed, its id is returned to the user and SonAr link is provided (for testnet and mainnet environment).

warp deploy

Read

Reads contract state based on its id.

Arguments:

  1. <contractId> - id of the contract

Options:

  1. -sv --save [string] - instead of logging state to the console, saves state to a file, if no argument is provided it saves state with a default name, if user enters name for a file (e.g.: state.json) - state is saved under that name
  2. -eo --evaluationOptions <string...> - allows to set one of three evaluation options - allowBigInt, allowUnsafeClient or internalWrites
  3. -stval --stateValidity - besides state, returns validity of all the contract interactions
  4. -sterr --stateErrorMessages - besides state, returns error messages for the invalid contract interactions
warp read Daj-MNSnH55TDfxqC7v4eq0lKzVIwh98srUaWqyuZtY -stval -sterr -eo allowBigInt internal wrrites -sv

Write

Writes interaction to the contract based on its contract id and provided input.

Arguments

  1. <contractId> - id of the contract
  2. [interaction] - interaction to the contract in a stringified form

Otions

  1. -str --strict - if set, writeInteraction method evaluates the state and lets verify wether transaction has been processed correctly
  2. -eo --evaluationOptions <string...> - allows to set one of three evaluation options - allowBigInt, allowUnsafeClient or internalWrites
warp write Daj-MNSnH55TDfxqC7v4eq0lKzVIwh98srUaWqyuZtY '{"function": "transfer", "to": "aRQwckYG8gmcVNG0EL68dFwHi7gW53FkrHdTdzxFVRI"}' -str -eo allowBigInt

View state

View state of the contract based on its id and provided input.

  1. <contractId> - id of the contract
  2. [input] - input to the contract in a stringified form
warp view 1otA3fcu5TTjCciIFy1L9vic8plXrfT7AW1CjfS3Cr8 '{"function": "balance", "target": "uhE-QeYS8i4pmUtnxQyHD7dzXFNaJ9oMK-IM-QPNY6M"}'

Clear cache

Clears cache folder created during reading contract state. By default, command removes /cache/warp folder. It is possible to change it using global cacheLocation option.

Global options

  1. -wlt --wallet - relative path to the wallet, if not provided - new wallet is generated, its keyfile is save to a file in .secrets folder
  2. -env --environment - environment in which action needs to be executed mainnet | testnet | local
  3. -lvl -level - logging level for Warp: silly | trace | debug | info | warn | error | fatal | none, by default level is set to none
  4. -c -cacheLocation - relative path for the Level database location, by default it is set to /cache/warp
  5. -sil --silent - run CLI in silent mode (no logo, only error messages displayed, logged result not formatted)
  6. -v --version - displays current version of the Warp SDK