@kadena/pactjs-cli v1.11.0
@kadena/pactjs-cli
CLI tool accompanying @kadena/pactjs-core and @kadena/pactjs-client to generate TypeScript definitions and Pact client
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
30 days ago
2 months ago
2 months ago
3 months ago
4 months ago
5 months ago
5 months ago
8 months ago
9 months ago
6 months ago
6 months ago
7 months ago
8 months ago
8 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago