feat: add --tokens flag to list deployment-specific tokens#2549
feat: add --tokens flag to list deployment-specific tokens#2549hardyjosh wants to merge 1 commit into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
How to use the Graphite Merge QueueAdd the label Raindex-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5b81496 to
09b6e85
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
09b6e85 to
9a36b8f
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
3188bcf to
70bd12e
Compare
Merge activity
|
## Motivation The Raindex orderbook protocol has a rich GUI builder flow in the webapp for configuring and deploying strategies. There is currently no way to do the same from a terminal or from a non-interactive agent — the webapp is the only entry point. That forces anyone automating a deployment (CI, scripts, AI agents) to either drive the browser or hand-roll the calldata. ## Solution Add a `strategy-builder` subcommand to the raindex CLI that generates deployment calldata from a remote registry strategy. ``` raindex strategy-builder \ --registry <url> \ --strategy <key> \ --deployment <key> \ --owner <0x-address> \ [--select-token KEY=ADDRESS ...] \ [--set-field BINDING=VALUE ...] \ [--set-deposit TOKEN=AMOUNT ...] ``` Outputs one `<address>:<calldata>` line per transaction on stdout — approvals first, then the deployment multicall, then optional metaboard meta emission. Each line is one signable transaction. Implementation reuses `RaindexOrderBuilder` from the common crate (same object the webapp drives) and `DotrainRegistry` from the js_api crate, so the CLI and webapp use identical resolution semantics. Follow-up PRs in this stack add `--interactive` (#2546), `--tokens` (#2549), the template-fallback operator (#2551), and `--describe` (#2548). ## Checks - [x] made this PR as small as possible - [x] unit-tested any new functionality - [x] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new `strategy-builder` command that generates deployment calldata from registry strategies with configurable field bindings, token selections, and deposit amounts. * **Improvements** * Token logo URIs are now optional, improving compatibility with token data sources. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
70bd12e to
064b102
Compare
## Motivation Non-interactive `strategy-builder` users need the valid token addresses for a deployment to populate `--select-token KEY=<address>` flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent. Inlining the full token list in `--describe` output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with. ## Solution Add a `--tokens` flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment. ``` raindex strategy-builder --tokens \ --registry <url> --strategy <key> --deployment <key> ``` Output: ``` # Available tokens — `fixed-limit` / `base` 14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag. | Symbol | Name | Address | Decimals | |--------|------|---------|----------| | `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 | ... ``` Any ERC20 address is accepted for `--select-token`; the list is a curated convenience subset. `--describe` links to this command so agents fetch scoped lists on demand. ## Checks - [x] made this PR as small as possible - [x] unit-tested any new functionality - [x] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change)
bd81bf6 to
48231b5
Compare
## Motivation The Raindex orderbook protocol has a rich GUI builder flow in the webapp for configuring and deploying strategies. There is currently no way to do the same from a terminal or from a non-interactive agent — the webapp is the only entry point. That forces anyone automating a deployment (CI, scripts, AI agents) to either drive the browser or hand-roll the calldata. ## Solution Add a `strategy-builder` subcommand to the raindex CLI that generates deployment calldata from a remote registry strategy. ``` raindex strategy-builder \ --registry <url> \ --strategy <key> \ --deployment <key> \ --owner <0x-address> \ [--select-token KEY=ADDRESS ...] \ [--set-field BINDING=VALUE ...] \ [--set-deposit TOKEN=AMOUNT ...] ``` Outputs one `<address>:<calldata>` line per transaction on stdout — approvals first, then the deployment multicall, then optional metaboard meta emission. Each line is one signable transaction. Implementation reuses `RaindexOrderBuilder` from the common crate (same object the webapp drives) and `DotrainRegistry` from the js_api crate, so the CLI and webapp use identical resolution semantics. Follow-up PRs in this stack add `--interactive` (#2546), `--tokens` (#2549), the template-fallback operator (#2551), and `--describe` (#2548). ## Checks - [x] made this PR as small as possible - [x] unit-tested any new functionality - [x] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a new `strategy-builder` command that generates deployment calldata from registry strategies with configurable field bindings, token selections, and deposit amounts. * **Improvements** * Token logo URIs are now optional, improving compatibility with token data sources. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
064b102 to
42d4024
Compare
## Motivation Non-interactive `strategy-builder` users need the valid token addresses for a deployment to populate `--select-token KEY=<address>` flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent. Inlining the full token list in `--describe` output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with. ## Solution Add a `--tokens` flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment. ``` raindex strategy-builder --tokens \ --registry <url> --strategy <key> --deployment <key> ``` Output: ``` # Available tokens — `fixed-limit` / `base` 14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag. | Symbol | Name | Address | Decimals | |--------|------|---------|----------| | `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 | ... ``` Any ERC20 address is accepted for `--select-token`; the list is a curated convenience subset. `--describe` links to this command so agents fetch scoped lists on demand. ## Checks - [x] made this PR as small as possible - [x] unit-tested any new functionality - [x] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change)
48231b5 to
077e453
Compare
## Motivation Non-interactive `strategy-builder` users need the valid token addresses for a deployment to populate `--select-token KEY=<address>` flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent. Inlining the full token list in `--describe` output was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with. ## Solution Add a `--tokens` flag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment. ``` raindex strategy-builder --tokens \ --registry <url> --strategy <key> --deployment <key> ``` Output: ``` # Available tokens — `fixed-limit` / `base` 14 tokens. Use any address as the value of a `--select-token KEY=<address>` flag. | Symbol | Name | Address | Decimals | |--------|------|---------|----------| | `wtIAU` | Wrapped iShares Gold Trust ST0x | `0x1E46...` | 18 | ... ``` Any ERC20 address is accepted for `--select-token`; the list is a curated convenience subset. `--describe` links to this command so agents fetch scoped lists on demand. ## Checks - [x] made this PR as small as possible - [x] unit-tested any new functionality - [x] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change)
## Motivation The Raindex orderbook protocol has a rich GUI builder flow in the webapp for configuring and deploying strategies. There is currently no way to do the same from a terminal or from a non-interactive agent — the webapp is the only entry point. That forces anyone automating a deployment (CI, scripts, AI agents) to either drive the browser or hand-roll the calldata. ## Solution Add a `strategy-builder` subcommand to the raindex CLI that generates deployment calldata from a remote registry strategy. ``` raindex strategy-builder \ --registry <url> \ --strategy <key> \ --deployment <key> \ --owner <0x-address> \ [--select-token KEY=ADDRESS ...] \ [--set-field BINDING=VALUE ...] \ [--set-deposit TOKEN=AMOUNT ...] ``` Outputs one `<address>:<calldata>` line per transaction on stdout — approvals first, then the deployment multicall, then optional metaboard meta emission. Each line is one signable transaction. Implementation reuses `RaindexOrderBuilder` from the common crate (same object the webapp drives) and `DotrainRegistry` from the js_api crate, so the CLI and webapp use identical resolution semantics. Follow-up PRs in this stack add `--interactive` (#2546), `--tokens` (#2549), the template-fallback operator (#2551), and `--describe` (#2548). ## Checks - [x] made this PR as small as possible - [x] unit-tested any new functionality - [x] linked any relevant issues or PRs - [ ] included screenshots (if this involves a front-end change) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added `strategy-builder` command to the CLI for generating deployment calldata from registry-based strategies. The command accepts required parameters for registry URL, strategy identifier, deployment address, and owner. Users can further customize strategy deployments with repeatable options to set field bindings, select tokens, and configure deposit amounts, enabling streamlined deployment workflows. [](https://app.coderabbit.ai/change-stack/rainlanguage/raindex/pull/2544) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
42d4024 to
b71ab0d
Compare
077e453 to
545edb8
Compare

Motivation
Non-interactive
strategy-builderusers need the valid token addresses for a deployment to populate--select-token KEY=<address>flags. The webapp resolves this dynamically by reading the registry's token-list; CLI users currently have no equivalent.Inlining the full token list in
--describeoutput was considered and rejected: a registry can have hundreds of tokens and the list is typically only needed for the one deployment the caller is working with.Solution
Add a
--tokensflag that scopes to a single strategy + deployment and emits a markdown table of the tokens the registry has registered for that deployment.Output:
Any ERC20 address is accepted for
--select-token; the list is a curated convenience subset.--describelinks to this command so agents fetch scoped lists on demand.Checks