{"id":16561502,"url":"https://github.com/jcnelson/stx-wallet-cli","last_synced_at":"2025-06-11T15:35:32.271Z","repository":{"id":76940313,"uuid":"535162298","full_name":"jcnelson/stx-wallet-cli","owner":"jcnelson","description":"Stacks wallet swiss army-knife","archived":false,"fork":false,"pushed_at":"2022-11-30T19:18:11.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-15T14:41:30.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcnelson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-11T01:35:08.000Z","updated_at":"2022-11-24T19:16:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf409237-709f-4fc9-a9ea-5e0f06eeea42","html_url":"https://github.com/jcnelson/stx-wallet-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcnelson%2Fstx-wallet-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcnelson%2Fstx-wallet-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcnelson%2Fstx-wallet-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcnelson%2Fstx-wallet-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcnelson","download_url":"https://codeload.github.com/jcnelson/stx-wallet-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241965704,"owners_count":20050313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T20:33:23.099Z","updated_at":"2025-03-05T04:29:13.434Z","avatar_url":"https://github.com/jcnelson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wallet-cli\n\nStacks wallet swiss army-knife.\n\n## Installation\n\nInstall the following [stacks.js](https://github.com/hirosystems/stacks.js/)\npackages in your `$NODE_PATH`:\n\n* `@stacks/common`\n* `@stacks/transactions`\n* `@stacks/network`\n\n## Usage\n\n```\n$ ./wallet-cli help\nUnrecognized subcommand 'undefined'\nUsage: wallet-cli subcommand [options] args...\nWhere `subcommand` is any of the following:\n\n  Accounts\n     generate-account       Generate a wallet's secrets\n     get-account            Get an account's balance from the node\n     seed-phrase            Generate a wallet seed phrase\n\n  Transactions\n     token-transfer         Generate a token-transfer transaction\n     contract-publish       Generate a contract-publish transaction\n     contract-call          Generate a contract-call transaction\n\nRun 'wallet-cli help subcommand' for subcommand-specific instructions.\nRun 'wallet-cli help post-conditions' for how to craft post-conditions.\n```\n\n## Generating an account\n\n```\n$ ./wallet-cli help generate-account\nUsage: wallet-cli generate-account [options] [index]\nWhere `index` refers to the nth account created from this seed phrase, starting from 0.\nValues for 'options' include:\n   -t, --testnet       Use testnet address format\n   -s, --seed-phrase   12-word master secret. If '-' is passed, it will be read from stdin.\n\nOutputs the account secrets as JSON\n```\n\n### Example\n\n```\n$ ./wallet-cli generate-account -s - 1 \u003c ./test/test-seed-phrase.txt\n{\"stxPrivateKey\":\"2ca3ed6879438f7d3325159885c8f80f278563c03df042e3e799057f9dbc458a01\",\"dataPrivateKey\":\"895c2534dfa5ebfc8932b770b31943bb39539a362a410a187d35f81d05046134\",\"appsKey\":\"xprvA15Hx1JDPVphCBAocvNTX3eDDKPu7ghnRWAFg4HV7rkkcQ1yAS6pnTyz1cvFo8XzhUke92dP6W6BuiKybYNdhNZtQEAtpJLAy9pyJQbkaU6\",\"salt\":\"9653dd9da8e8c9cebc70448052ec2119bfc71a095a3306583b15bb487d7b14a0\",\"index\":1,\"stxAddress\":\"SPM8JZ8KXYR5YD99FKDN92S3SFZ2TKV5580CAJ55\"}\n```\n\n## Getting an account\n\n```\n$ ./wallet-cli help get-account     \nUsage: wallet-cli get-account [options] address\nWhere `address` is a standard or contract principal.\nValues for 'options' include:\n   -b, --at-block      Stacks chain tip block ID at which to run this function\n   -N, --node          Stacks node URL. Default is http://seed-0.mainnet.stacks.co:20443\n\nOutputs the account balance, locked tokens, unlock height, and nonce.\n```\n\n### Example\n\n```\n$ ./wallet-cli get-account -N \"http://localhost:20443\" SPM8JZ8KXYR5YD99FKDN92S3SFZ2TKV5580CAJ55\n{\"balance\":\"0\",\"locked\":\"0\",\"unlock_height\":\"0\",\"nonce\":\"0\"}\n```\n\n## Generating a seed phrase\n\n```\n$ ./wallet-cli help seed-phrase\nUsage: wallet-cli seed-phrase\n\nOutputs a 12-word BIP39 seed phrase\n```\n\n### Example\n\n```\n$ ./wallet-cli seed-phrase\n\"thought acquire slow fork intact devote six tattoo protect crazy panther lab bless city vacuum slush inside river scissors neither critic blue then model\"\n```\n\n## Sending STX tokens\n\n```\n$ ./wallet-cli help token-transfer\nUsage: wallet-cli token-transfer [options] recipient amount\nWhere:\n   `recipient` is a standard or contract principal\n   `amount` is the number of uSTX\n\nValues for 'options' include:\n   -A, --account-index Index of the account to derive from the master key.\n   -N, --node          URL to the node to use to look up the sending account nonce, if needed\n   -a, --anchor-mode   \"off-chain\" or \"on-chain\" if required. Defaults to 'Any'.\n   -f, --fee           uSTX transaction fee.\n   -k, --private-key   Bare private key to use, if -s is not given.\n   -m, --memo          Set the memo field\n   -n, --nonce         Use the given transaction nonce\n   -s, --seed-phrase   12-word master secret. If '-' is passed, it will be read from stdin.\n   -t, --testnet       Use testnet version bytes\n\nOutputs the serialized transaction as a hex-encoded string.\n```\n\n### Example\n\n```\n$ ./wallet-cli token-transfer -N \"http://localhost:20443\" -m \"abcde\" -f 123 -n 456 -s - -A 1 -a \"on-chain\" \\\nST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS 789\n\u003c ./test/test-seed-phrase.txt\n\"0000000001040028897d13efb05f35297cdb548b23cbfe2d4f652a00000000000001c8000000000000007b00014ab2550377c630d37f96365357bce1317f8fb62823feb9bbab20ae52b4c752af4397565c79401cac4ed79dcbd4592cdd1dea30f494578b75d2179dc84be24f5801020000000000051a634d03a67375b7d53fbe11d63835a5df6d989bc5000000000000031561626364650000000000000000000000000000000000000000000000000000000000\"\n```\n\n## Publishing a contract\n\n```\n$ ./wallet-cli help contract-publish\nUsage: wallet-cli contract-publish [options] contract-name contract-src\nWhere:\n   `contract-name` is the name of the contract\n   `contract-src` is the path to the contract code on disk\n\nValues for 'options' include:\n   -A, --account-index Index of the account to derive from the master key.\n   -N, --node          URL to the node to use to look up the sending account nonce, if needed\n   -a, --anchor-mode   \"off-chain\" or \"on-chain\" if required. Defaults to 'Any'.\n   -f, --fee           uSTX transaction fee.\n   -k, --private-key   Bare private key to use, if -s is not given.\n   -n, --nonce         Use the given transaction nonce\n   -p, --post-condition\n   -s, --seed-phrase   12-word master secret. If '-' is passed, it will be read from stdin.\n   -t, --testnet       Use testnet version bytes\n\nOutputs the serialized transaction as a hex-encoded string.\n```\n\n### Example\n\n```\n$ ./wallet-cli contract-publish -N \"http://52.0.54.100:20443\" -f 123 -n 456 -s - -A 1 -a \"on-chain\" \\\n-p \"allow \\\nstx ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS \u003c= 1 \\\nft ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS \u003e= ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.bar stackaroo 2 \\\nnft ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS keeps ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.baz quux 09\" \\\nfoo /tmp/hello.clar \\\n\u003c ./test/test-seed-phrase.txt\n\"0000000001040028897d13efb05f35297cdb548b23cbfe2d4f652a0000000000000000000000000000007b00004ca81cbc4221c03ed656550057bb7d1733485dd0b634836d9cf6d2584acd5dd031415c01375ea0383e05fa150faff92478ad55bdf1fbaee7574025721d41cb4c01010000000300021a634d03a67375b7d53fbe11d63835a5df6d989bc505000000000000000101021a634d03a67375b7d53fbe11d63835a5df6d989bc51a634d03a67375b7d53fbe11d63835a5df6d989bc50362617209737461636b61726f6f02000000000000000202021a634d03a67375b7d53fbe11d63835a5df6d989bc51a634d03a67375b7d53fbe11d63835a5df6d989bc50362617a047175757809110103666f6f00000016287072696e74202268656c6c6f20776f726c6422290a\"\n```\n\n## Calling a public contract function\n\n```\n$ ./wallet-cli help contract-call\nUsage: wallet-cli contract-call [options] contract-id function-name [arg...]\nWhere:\n   `contract-id` is the fully-qualified address of the contract\n   `function-name` is the name of the function to call\n   `[arg ...]` is a list of zero or more arguments, as hex-encoded serialized Clarity values\n\nValues for 'options' include:\n   -A, --account-index Index of the account to derive from the master key.\n   -N, --node          URL to the node to use to look up the sending account nonce, if needed\n   -a, --anchor-mode   \"off-chain\" or \"on-chain\" if required. Defaults to 'Any'.\n   -f, --fee           uSTX transaction fee.\n   -k, --private-key   Bare private key to use, if -s is not given.\n   -n, --nonce         Use the given transaction nonce\n   -p, --post-conds    Post-conditions. Run `help post-conditions` for details.\n   -s, --seed-phrase   12-word master secret. If '-' is passed, it will be read from stdin.\n   -t, --testnet       Use testnet version bytes\n\nOutputs the serialized transaction as a hex-encoded string.\n```\n\n**Tip:** You can use the\n[stacks-node-cli](https://github.com/jcnelson/stacks-node-cli) to encode Clarity\nvalues from a human-readable shell-friendly form to hex.\n\n### Example\n\n```\n$ ./wallet-cli contract-call -N \"http://52.0.54.100:20443\" -f 123 -n 456 -s - -A 1 -a \"on-chain\" \\\nST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.foo bar-func 0100000000000000000000000000000003 09 \\\n\u003c ./test/test-seed-phrase.txt\n\"0000000001040028897d13efb05f35297cdb548b23cbfe2d4f652a0000000000000000000000000000007b000069a1f0411b66397399ed30075753f4012284889afbaab5f59c95aec343ac434d715a892cd7643b4398786eb1cbcf7912f0a81b89a051fc68e32c3bd2a2a42888010200000000021a634d03a67375b7d53fbe11d63835a5df6d989bc503666f6f086261722d66756e6300000002010000000000000000000000000000000309\"\n```\n\n## Post-conditions\n\nThe `contract-publish` and `contract-call` commands take a list of\npost-conditions:\n\n```\n$ ./wallet-cli help post-conditions\nPost-conditions help\n\nPost-conditions are encoded as a sequence of words as follows:\n\n     post-condition = mode conditions\n               mode = \"allow\" | \"deny\"\n         conditions = type parameters\n               type = \"stx\" | \"ft\" | \"nft\"\n         parameters = stxParameters | ftParameters | nftParameters\n      stxParameters = principal fungibleCode amount\n       ftParameters = principal fungibleCode contractID name amount\n      nftParameters = principal nftCode contractID name value\n          principal = standardPrincipal | contractID\n  standardPrincipal = (a standard STX principal)\n       fungibleCode = \"\u003c\" | \"\u003c=\" | \"==\" | \"\u003e=\" | \"\u003e\"\n            nftCode = \"sends\" | \"keeps\"\n         contractID = (a fully-qualified STX contract principal)\n               name = (a valid FT or NFT name)\n             amount = (an unsigned integer)\n              value = (a hex-encoded serialized Clarity value)\n\nExamples:\n\n  \"Allow-all; `ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS` must spend less than or equal to 1 uSTX\"\n\n      `-p \"allow stx ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS \u003c= 1`\n\n  \"Allow-all; `ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS` must spend greater than or equal to 2 `stackaroos` from the\n  from the `ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.bar` contract\n\n      `-p \"allow ft ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS \u003e= ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.bar stackaroo 2\"`\n\n  \"Allow-all; `ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS` does not send the NFT value `none` from the\n  NFT `quux` defined in contract `ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.baz`\n\n      `-p \"allow nft ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS keeps ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.baz quux 09\"`\n\nNote that post-conditions are concatenative.  For example, you can combine all of the above post-conditions as follows:\n\n      `-p \"allow \\\n           stx ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS \u003c= 1 \\\n           ft ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS \u003e= ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.bar stackaroo 2 \\\n           nft ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS keeps ST1HMT0X6EDTVFN9ZQR8XCE1NMQFPV64VRQWXV8WS.baz quux 09\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcnelson%2Fstx-wallet-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcnelson%2Fstx-wallet-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcnelson%2Fstx-wallet-cli/lists"}