Feature / Add account options to AnchorChaining#294
Feature / Add account options to AnchorChaining#294bogdanblazhkevych wants to merge 6 commits intomainfrom
Conversation
chpzcch
left a comment
There was a problem hiding this comment.
I've reviewed the changes. The implementation of account overrides for FX exchanges and AnchorChaining looks solid and is well-supported by new tests.
I found one suspicious removal of an override in the asset movement planning stage and a minor syntax issue.
Please see the inline comments for details.
chpzcch
left a comment
There was a problem hiding this comment.
Added inline comments for specific concerns.
| @@ -1128,7 +1142,7 @@ export class AnchorChainingPlan extends AnchorChainingPath { | |||
| type: 'assetMovement', | |||
There was a problem hiding this comment.
Why was options?.overrides removed from this getAccountForAction call? In the previous version it was present, and it is still used in the FX step resolution above. If an override is provided for asset movement, it should likely be honored here as well to ensure consistent plan validation.
| this.providerID = providerID; | ||
| this.conversion = conversion; | ||
| this.parent = parent; | ||
| this.options = options |
Code Review SummaryIssues reviewed: PR 294 — Feature / use account option in FX Client and AnchorChaining. No linked issues were provided in the PR description. Threads addressed: 0 threads reviewed (no existing threads). New issues found: Must Fix
Minor / Optional
|
|
There was a problem hiding this comment.
Pull request overview
This PR extends the FX and chaining flows to support optional account/signer overrides, enabling exchanges (and subsequent chaining execution) to be performed using non-default accounts such as storage accounts.
Changes:
- Thread
accountoptions throughKeetaFXAnchorClientprovider instances socreateExchange()can build blocks using a specified account. - Add
ComputePlanOptionstoAnchorChaining.getPlans()and propagate overrides into FX quote/estimate lookup and into execution-time sends. - Expand chaining tests (and FX client tests) to validate execution using storage accounts and update transfer-status expectations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/services/fx/client.ts | Adds optional account options to provider instances and passes them into block builder operations in createExchange. |
| src/services/fx/client.test.ts | Adds a storage-account test ensuring FX exchanges can complete using overridden account funds. |
| src/lib/chaining.ts | Exposes ComputePlanOptions, adds account/signer override resolution helpers, and uses overrides during planning/execution. |
| src/lib/chaining.test.ts | Adds chaining execution coverage for storage-account overrides and updates mocked transfer statuses. |
| } | ||
|
|
||
| await this.parent['client'].send(sendToAddress, value, token, external); | ||
| const { account } = await this.getAccountsForAction({ type: 'assetMovement', providerMethod: 'initiateTransfer' }, this.#_plan?.options?.overrides); |



Adds account and signer optional overrides to
getPlansin AnchorChainingAdds options to KeetaFXAnchorProviderBase which can pass an account to block builder options in
createExchange.