@kadena/pactjs-cli
TypeScript icon, indicating that this package has built-in type declarations

1.11.1 • Public • Published

@kadena/pactjs-cli

CLI tool accompanying @kadena/pactjs-core and @kadena/pactjs-client to generate TypeScript definitions and Pact client

kadena.js logo

generate

Generate client based on a contract

Parameter Description Required Default value
-c, --clean Clean existing generated files No
-i, --caps-interface Custom name for the interface of the caps. Can be used to create a type definition with a limited set of capabilities. No
-f, --file Generate d.ts from Pact contract file If --contract is ommitted
--contract Generate d.ts from Pact contract from the blockchain If --file is ommitted
--api The API to use for retrieving the contract (e.g. https://api.chainweb.com/chainweb/0.0/mainnet01/chain/8/pact) When --contract is provided
--chain The chainId to retrieve the contract from When --contract is provided 0
--network The networkId to retrieve the contract from (e.g. testnet) When --contract is provided mainnet

Generate from file

pactjs contract-generate --file ./myContract.pact

Generate from chain

pactjs contract-generate --contract free.coin --api https://api.testnet.chainweb.com/chainweb/0.0/testnet04/chain/1/pact --chain 1 --network testnet

retrieve-contract

Retrieve a contract from an API using a /local call

Parameter Description Required Default value
-m --module The module you want to retrieve (e.g. "coin") Yes
-o, --out File to write the contract to (e.g. ./myContract.pact) Yes
-a, --api API to fetch the contract from (e.g. https://api.chainweb.com/chainweb/0.0/mainnet01/chain/8/pact) Yes https://api.chainweb.com
-n, --network Network to retrieve from (e.g. testnet) No mainnet

Retrieve a contract from chain

pactjs retrieve-contract --out ./myContract.pact --module coin --api https://api.chainweb.com/chainweb/0.0/mainnet01/chain/8/pact

template-generate

Generate statically typed generators for templates

Parameter Description Required Default value
-c, clean Clean existing template No
-f, --file File or directory to use to generate the client Yes
-o, --out Output file/directory to place the generated client Yes

Generate a client from a template

pactjs template-generate --file ./contractDir --out ./myContract.pact

Readme

Keywords

none

Package Sidebar

Install

npm i @kadena/pactjs-cli

Weekly Downloads

697

Version

1.11.1

License

BSD-3-Clause

Unpacked Size

139 kB

Total Files

70

Last publish

Collaborators

  • kadena-lars
  • alber70g
  • takadenoshi
  • ash_vd
  • randynamic
  • buckie
  • heekyun