{"id":51485852,"url":"https://github.com/0xsequence/wallet-dapp-client-cli","last_synced_at":"2026-07-07T06:30:44.153Z","repository":{"id":336499071,"uuid":"1149939637","full_name":"0xsequence/wallet-dapp-client-cli","owner":"0xsequence","description":"Wallet Dapp Client CLI","archived":false,"fork":false,"pushed_at":"2026-03-10T13:18:26.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-10T19:49:56.270Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xsequence.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-04T17:41:16.000Z","updated_at":"2026-03-10T13:18:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/0xsequence/wallet-dapp-client-cli","commit_stats":null,"previous_names":["0xsequence/wallet-dapp-client-cli"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/0xsequence/wallet-dapp-client-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fwallet-dapp-client-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fwallet-dapp-client-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fwallet-dapp-client-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fwallet-dapp-client-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xsequence","download_url":"https://codeload.github.com/0xsequence/wallet-dapp-client-cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xsequence%2Fwallet-dapp-client-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35218117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-07T02:00:07.222Z","response_time":90,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2026-07-07T06:30:43.545Z","updated_at":"2026-07-07T06:30:44.139Z","avatar_url":"https://github.com/0xsequence.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dapp-client-cli\n\nA standalone CLI wrapper around `@0xsequence/dapp-client`\nThe CLI uses **redirect mode** and auto-opens redirect URLs in your browser by default. It prints a short redirect summary by default (full URL is optional). State is encrypted at rest and persisted on disk.\n\n## Install\n\n### Use from npm package\n\n```bash\nnpm install @0xsequence/dapp-client-cli\nnpx dapp-client-cli --help\n```\n\nYou do not need to run `./node_modules/.bin/dapp-client-cli ...`.\nUse `npx dapp-client-cli ...` (or npm scripts that call `dapp-client-cli`).\n\n### Local repo development\n\n```bash\npnpm install\npnpm run build\n```\n\n## Configuration\n\nCreate a local `.env` in the working directory (or export env vars):\n\n```\nWALLET_URL=https://v3.sequence-dev.app\nRELAYER_URL=https://dev-{network}-relayer.sequence.app\nNODES_URL=https://dev-nodes.sequence.app/{network}\nPROJECT_ACCESS_KEY=...\nORIGIN=http://localhost:3000\nREDIRECT_PATH=/\nDAPP_CLIENT_CLI_PASSPHRASE=...\n```\n\nNotes:\n- A local `.env` is strongly recommended for CLI and agent workflows.\n- `ORIGIN + REDIRECT_PATH` must be a reachable HTTP URL for redirect flows.\n- The CLI uses the passphrase to encrypt state at `~/.sequence/dapp-client-cli/state.enc`.\n\n## Quick Start\n\n```bash\nnpx dapp-client-cli connect --chain-id 137\n```\n\nBy default the CLI starts a local listener and auto-opens the redirect URL in your browser. It prints a short redirect summary (instead of the full payload URL). Approve in wallet, then the CLI auto‑resumes and prints the result.\n\nFor normal runs, use minimal commands with only required args and keep defaults:\n- keep listener enabled (`--listen`)\n- keep browser auto-open enabled (`--open-url`)\n- avoid adding optional flags unless you are troubleshooting a specific issue\n\nAvoid disabling these for normal flows (`--listen=false` / `--open-url=false`), because then you must handle redirect/resume manually.\n\n### Troubleshooting Fallbacks (Only If Needed)\n\nDisable the listener:\n```bash\nnpx dapp-client-cli --no-listen connect --chain-id 137\n```\n\nTo disable automatic URL opening:\n```bash\nnpx dapp-client-cli --no-open-url connect --chain-id 137\n```\n\nTo print the full redirect URL:\n```bash\nnpx dapp-client-cli --show-redirect-url connect --chain-id 137\n```\n\n## Agent/Sandbox Note (Codex / Claude Code)\n\nRedirect-required commands should run with escalated permissions in sandboxed agent environments so browser launch works:\n- `connect`\n- `resume`\n- `sign-message`\n- `sign-typed-data`\n- `send-wallet-transaction`\n- `upgrade-sessionless`\n- `add-explicit-session`\n- `modify-explicit-session`\n\n## Commands\n\n### Status\n```bash\npnpm start -- status\n```\n\n### Disconnect\n```bash\npnpm start -- disconnect --keep-sessionless false\n```\n\n### Sign message (redirect)\n```bash\npnpm start -- sign-message --chain-id 137 --message \"hello\"\n```\n\n### Send transaction (explicit session)\n```bash\npnpm start -- send-transaction --chain-id 137 --transactions examples/polygon-native-transfer.json\n```\n\nMainnet behavior for `send-transaction`:\n- on mainnet chains (Ethereum, Polygon, Arbitrum One, etc.), the CLI auto-checks fee options\n- if fee options exist, it auto-selects one with sufficient balance\n- if no fee options are returned (for example sponsored setup), it proceeds without a fee option\n- if fee options exist but none are affordable, it throws a clear top-up error\n\n### Send transaction via wallet (redirect)\n```bash\npnpm start -- send-wallet-transaction --chain-id 137 --transaction examples/polygon-native-transfer.json\n```\n\n`send-wallet-transaction` accepts a single transaction object or an array.  \nIf you pass an array, the CLI uses the first item. `@currentWallet` is supported inside the JSON.\nFee option selection is handled by the wallet.\n\n### Resume (manual)\n```bash\npnpm start -- resume --url \"\u003credirect-url\u003e\"\n```\n\n## Explicit Session Defaults (Type‑Safe)\n\nEdit `src/explicit-session.config.ts` to configure default explicit session permissions.  \nSet it to `null` to disable defaults.\n\nAvailable presets in `src/explicit-session.config.ts`:\n- `explicitSessionDefaultsNftArbitrumSepolia` (existing)\n- `explicitSessionDefaultsPolygonNativeWithFee` (new, chain `137`)\n\nThe active export is:\n```ts\nexport const explicitSessionDefaults = explicitSessionDefaultsPolygonNativeWithFee\n```\nSwitch it to `explicitSessionDefaultsNftArbitrumSepolia` to test Arbitrum Sepolia mint examples instead.\n\nIf you need fee token permissions, set:\n```ts\nincludeFeeOptionPermissions: true\n```\n\nYou can also set this field directly in an explicit-session JSON file passed to:\n- `connect --explicit-session @file.json`\n- `upgrade-sessionless --explicit-session @file.json`\n- `add-explicit-session --explicit-session @file.json`\n\n## Transactions JSON\n\n`send-transaction` supports:\n- `abi` or `functionSignature`\n- `args` (array)\n- `@currentWallet` — a special token you can use in any `args` field. The CLI replaces it with the active wallet address before encoding the call.\n\n`send-wallet-transaction` can accept the same JSON. If you pass an array, the CLI uses the first item.\n\nExample in `examples/mint-transaction.json`:\n\n```json\n[\n  {\n    \"to\": \"0xD25b37E2fB07f85E9ecA9d40FE3BcF60BA2dc57b\",\n    \"abi\": \"function safeMint(address to)\",\n    \"args\": [\"@currentWallet\"],\n    \"value\": \"0\"\n  }\n]\n```\n\nPolygon native transfer example (for `explicitSessionDefaultsPolygonNativeWithFee`) is in `examples/polygon-native-transfer.json`.\n\n## Output\n\n`send-transaction` prints the transaction hash plus an explorer URL when available:\n\n```json\n{\n  \"txHash\": \"0x...\",\n  \"explorerUrl\": \"https://...\"\n}\n```\n\n## Notes\n\n- CLI forces `TransportMode.REDIRECT`.\n- macOS OS‑level notifications are triggered when a redirect needs user action.\n  - Disable with `DAPP_CLIENT_CLI_NO_OS_NOTIFY=1`.\n- `send-transaction` handles mainnet fees automatically unless you provide `--fee-option`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Fwallet-dapp-client-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xsequence%2Fwallet-dapp-client-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xsequence%2Fwallet-dapp-client-cli/lists"}