diff --git a/book/src/ref/commands.md b/book/src/ref/commands.md index 7f0f112..6123ae2 100644 --- a/book/src/ref/commands.md +++ b/book/src/ref/commands.md @@ -2,36 +2,748 @@ Starkli offers the following commands: -- selector -- class-hash -- to-cairo-string -- parse-cairo-string -- mont -- call -- transaction -- block-number -- block-hash -- block -- block-time -- state-update -- transaction-receipt -- chain-id -- balance -- nonce -- storage -- class-hash-at -- class-by-hash -- class-at -- syncing -- signer -- account -- invoke -- declare -- deploy -- completions - -To check usage of each command, run with the `--help` option. - -> 🏗️ **TODO** -> -> Document each command instead of asking users to run `--help`. +## selector +Calculate selector from name + +**Usage:** starkli selector `` + +**Arguments:** + `` Selector name + +**Options:** +`-h, --help` Print help + +--- + +## class-hash +Calculate class hash from any contract artifacts (Sierra, casm, legacy) + +**Usage:** starkli class-hash `` + +**Arguments:** + `` Path to contract artifact file + +**Options:** + `-h, --help` Print help + +--- + +## to-cairo-string +Encode string into felt with the Cairo short string representation + +**Usage:** starkli to-cairo-string [OPTIONS] `` + +**Arguments:** + `` Text to be encoded in felt + +**Options:** + + `--dec` Display the encoded value in decimal representation + + `-h, --help` Print help + +--- + +## parse-cairo-string +Decode string from felt with the Cairo short string representation + +**Usage:** starkli parse-cairo-string `` + +**Arguments:** + `` Encoded string value in felt, in decimal or hexadecimal representation + +**Options:** + `-h, --help` Print help + +--- + +## mont +Print the montgomery representation of a field element + +**Usage**: starkli mont [OPTIONS] `` + +**Arguments:** + `` Encoded string value in felt, in decimal or hexadecimal representation + +**Options:** + +`--hex` Emit array elements in hexadecimal format + +`-h, --help` Print help + +--- + +## call +Call contract functions without sending transactions + +**Usage:** starkli call [OPTIONS] `` `` `[CALLDATA]...` + +**Arguments:** + + `` Contract address + + `` Name of the function being called + + `[CALLDATA]...` Raw function call arguments + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## transaction +Get Starknet transaction by hash + +**Usage:** starkli transaction [OPTIONS] `` + +**Arguments:** +`` Transaction hash + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + + +--- + +## block-number +Get latest block number + +**Usage:** starkli block-number [OPTIONS] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## block-hash +Get latest block hash + +**Usage:** starkli block-hash [OPTIONS] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## block +Get Starknet block + +**Usage:** starkli block [OPTIONS] [BLOCK_ID] + +**Arguments:** + `[BLOCK_ID]` Block number, hash, or tag (latest/pending) [default: latest] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--full` Fetch full transactions instead of hashes only + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## block-time +Get Starknet block timestamp only + +**Usage:** starkli block-time [OPTIONS] [BLOCK_ID] + +**Arguments:** + `[BLOCK_ID]` Block number, hash, or tag (latest/pending) [default: latest] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--unix` Show block time in Unix timestamp format + +`--rfc2822 Show block time in RFC 2822 format + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## state-update +Get state update from a certain block + +**Usage:** starkli state-update [OPTIONS] [BLOCK_ID] + +**Arguments:** + `[BLOCK_ID]` Block number, hash, or tag (latest/pending) [default: latest] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## transaction-receipt +Get transaction receipt by hash + +**Usage:** starkli transaction-receipt [OPTIONS] `` + +**Arguments:** + `` Transaction hash + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## chain-id +Get Starknet network ID + +**Usage:** starkli chain-id [OPTIONS] [BLOCK_ID] + +**Arguments:** + `[BLOCK_ID]` Block number, hash, or tag (latest/pending) [default: latest] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--no-decode` Do not show the decoded text + +`--dec` Display the decimal instead of hexadecimal representation + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +## balance + +TBD + +--- + +## nonce +Get nonce for a certain contract + +**Usage:** starkli nonce [OPTIONS] `
` + +**Arguments:** + `
` Contract address + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`h, --help` Print help + +--- + +## storage +Get storage value for a slot at a contract + +**Usage:** starkli storage [OPTIONS] `
` `` + +**Arguments:** + + `` Storage key + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help ` Print help + +--- + +## class-hash-at +Get contract class hash deployed at a certain address + +**Usage:** starkli class-hash-at [OPTIONS] `
` + +**Arguments:** + `
` Contract address + +**Options:** + +`-rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## class-by-hash +Get contract class by hash + +**Usage:** starkli class-by-hash [OPTIONS] `` + +**Arguments:** + `` Class hash + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## class-at +Get contract class deployed at a certain address + +**Usage:** starkli class-at [OPTIONS]
+ +**Arguments:** + `
` Contract address + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- + +## syncing +Get node syncing status + +**Usage:** starkli syncing [OPTIONS] + +**Options:** + +`--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--log-traffic` Log raw request/response traffic of providers + +`-h, --help` Print help + +--- +## signer +Signer management commands + +**Usage:** starkli signer `` + +**Commands:** +- **`keystore`** Keystore management commands + + **Usage:** starkli signer keystore `` + + **Commands:** + - **`new`** Randomly generate a new keystore + + **Usage:** starkli signer keystore new [OPTIONS] `` + + **Arguments:** + `` Path to save the JSON keystore + + **Options:** + + `--password ` Supply password from command line option instead of prompt + + `-force` Overwrite the file if it already exists + + `-h, --help` Print help + + - **`from-key`** Create a keystore file from an existing private key + + **Usage:** starkli signer keystore from-key [OPTIONS] `` + + **Arguments:** + `` Path to save the JSON keystore + + **Options:** + + `--force` Overwrite the file if it already exists + + `--private-key-stdin` Take the private key from stdin instead of prompt + + `--password ` Supply password from command line option instead of prompt + + `-h, --help` Print help + + - **`inspect`** Check the public key of an existing keystore file + + **Usage:** starkli signer keystore inspect [OPTIONS] `` + + **Arguments:** + `` Path to the JSON keystore + + **Options:** + + `--password ` Supply password from command line option instead of prompt + + `--raw` Print the public key only + + `-h, --help` Print help + + - **`inspect-private`** Check the private key of an existing keystore file + **Usage:** starkli signer keystore inspect-private [OPTIONS] `` + + **Arguments:** + `` Path to the JSON keystore + + **Options:** + + `--password ` Supply password from command line option instead of prompt + + `--raw` Print the private key only + + `-h, --help` Print help + + - **`help`** Print this message or the help of the given subcommand(s) + + **Options:** + `-h, --help` Print help + +- **`gen-keypair`** Randomly generate a new key pair + **Usage:** starkli signer gen-keypair + + **Options:** + `-h, --help` Print help + +**Options:** + `-h, --help` Print help + +--- + +## account + +Account management commands + +**Usage:** starkli account `` + +**Commands:** +- **`fetch`** Fetch account config from an already deployed account contract + + **Usage:** starkli account fetch [OPTIONS] `
` + + **Arguments:** `
` Contract address + + **Options:** + + `--rpc ` Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + + `--network ` Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + + `--force` Overwrite the file if it already exists + + `--output ` Path to save the account config file + + `--log-traffic` Log raw request/response traffic of providers + + `-h, --help` Print help + +- **`deploy`** Deploy account contract with a DeployAccount transaction + + **Usage:** starkli account deploy [OPTIONS] + + **Arguments:** `` Path to the account config file + + **Options:** + + `--rpc ` + Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + + `--network ` + Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + + `--keystore ` + Path to keystore JSON file [env: STARKNET_KEYSTORE=/Users/danielbejarano/Dev/starkli-wallets/deployer/keystore.json] + + `--keystore-password ` + Supply keystore password from the command line option instead of prompt + + `--private-key ` + Private key in hex in plain text + + `--max-fee ` + Maximum transaction fee in Ether (18 decimals) + + `--max-fee-raw ` + Maximum transaction fee in Wei + + `--estimate-only` + Only estimate transaction fee without sending the transaction + + `--log-traffic` + Log raw request/response traffic of providers + + `-h, --help` + Print help +- **`oz`** Create and manage OpenZeppelin account contracts + + **Usage:** starkli account oz `` + + **Commands:** + + - **`init`** Create a new account configuration without actually deploying + + **Usage:** starkli account oz init [OPTIONS] `` + + **Arguments:** + `` Path to save the account config file + + **Options:** + + `--keystore ` + Path to keystore JSON file [env: STARKNET_KEYSTORE=] + + + `--keystore-password ` + Supply keystore password from command line option instead of prompt + + `--private-key ` + Private key in hex in plain text + + `-f, --force` + Overwrite the account config file if it already exists + + `-h, --help` + Print help + + - **`help`** Print this message or the help of the given subcommand(s) + + +**Options:** +`-h, --help` Print help + +--- + +## invoke +Send an invoke transaction from an account contract + +**Usage:** starkli invoke [OPTIONS] `--account ` `[CALLS]...` + +**Arguments:** + `[CALLS]...` One or more contract calls. See documentation for more details + +**Options:** + +`--rpc ` + Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` + Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--keystore ` + Path to keystore JSON file [env: STARKNET_KEYSTORE=] + +`--keystore-password ` + Supply keystore password from command line option instead of prompt + +`--private-key ` + Private key in hex in plain text + +`--account ` + Path to account config JSON file [env: STARKNET_ACCOUNT=] + +`--max-fee ` + Maximum transaction fee in Ether (18 decimals) + +`--max-fee-raw ` + Maximum transaction fee in Wei + +`--estimate-only` + Only estimate transaction fee without sending transaction + +`--watch` + Wait for the transaction to confirm + +`--log-traffic` + Log raw request/response traffic of providers + +`-h, --help` + Print help + +--- + +## declare +Declare a contract class + +**Usage:** starkli declare [OPTIONS] `--account ` `` + +**Arguments:** + `` Path to contract artifact file + +**Options:** + +`--rpc ` +Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` +Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--keystore ` +Path to keystore JSON file [env: STARKNET_KEYSTORE=] + +`--keystore-password ` +Supply keystore password from command line option instead of prompt + +`--private-key ` +Private key in hex in plain text + +`--compiler-version ` +Statically-linked Sierra compiler version [possible values: 2.0.1, 2.1.0] + +`--casm-hash ` +Override Sierra compilation and use CASM hash directly + +`--account ` +Path to account config JSON file [env: STARKNET_ACCOUNT=] + +`--max-fee ` +Maximum transaction fee in Ether (18 decimals) + +`--max-fee-raw ` +Maximum transaction fee in Wei + +`--estimate-only` +Only estimate transaction fee without sending transaction + +`--watch` +Wait for the transaction to confirm + +`--log-traffic` +Log raw request/response traffic of providers + +`-h, --help` +Print help + +--- + +## deploy +Deploy contract via the Universal Deployer Contract + +**Usage:** starkli deploy [OPTIONS] `--account ` `` `[CTOR_ARGS]...` + +**Arguments:** + +`` + Starknet JSON-RPC endpoint [env: STARKNET_RPC=] + +`--network ` + Starknet network [env: STARKNET_NETWORK=] [possible values: mainnet, goerli-1, goerli-2, integration] + +`--keystore ` + Path to keystore JSON file [env: STARKNET_KEYSTORE=] + +`--keystore-password ` + Supply keystore password from command line option instead of prompt + +`--private-key ` + Private key in hex in plain text + +`--not-unique` + Do not derive contract address from deployer address + +`--account ` + Path to account config JSON file [env: STARKNET_ACCOUNT=] + +`--max-fee ` + Maximum transaction fee in Ether (18 decimals) + +`--max-fee-raw ` + Maximum transaction fee in Wei + +`--estimate-only` + Only estimate transaction fee without sending transaction + +`--salt ` + Use the given salt to compute contract deploy address + +`--watch` + Wait for the transaction to confirm + +`--log-traffic` + Log raw request/response traffic of providers + +`-h, --help` + Print help + +--- + + +## completions +Generate shell completions script + +**Usage:** starkli completions `` + +**Arguments:** + `` Shell name [possible values: bash, elvish, fish, powershell, zsh] + +**Options:** + `-h, --help` Print help