Conversation
anilgangapersaud-circle
force-pushed
the
feat/delegate-funding-support
branch
from
September 1, 2026 13:44
63ebaf3 to
8d803f5
Compare
For net_delegate, the presign API returns a single funderPermitTypedData shared across all trades. Previously the signing loop treated it like delegate mode and tried to sign a funder permit per trade. - makeApiCall: propagate the shared funderTypedData to all batch entries - signWithCircle: for net_delegate, sign each trader permit individually then sign the shared funder permit once and apply the signature to all entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…delegate/net_delegate modes - Read traderPermitTypedData/funderPermitTypedData with batch variants as fallback - Sign trader and funder typed data once per batch (not per trade) since all entries share the same typed data object - Skip trader signing when traderTypedData is null (auto-confirmation enabled) - Update allDelegateSigned and Signed chip to handle auto-confirm case where traderSignature stays empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gning The LLC funder wallet is typically under a different Circle entity than the trader wallet. Using the trader entity secret to sign with the funder wallet ID causes a 400 from Circle's sign API due to entity mismatch. Added funderWalletApiKey and funderEntitySecret to the store and settings panel. signWithCircle now uses funder entity credentials when signing the funder permit, falling back to trader credentials if the funder fields are not configured. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Circle's sign typed data API rejects typed data that includes EIP712Domain in the types object. It is a reserved type in EIP-712 — the domain info is already encoded via the domain field, so EIP712Domain in types is redundant and causes a 400. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…equest Circle's sign typed data API expects the data field to be a JSON object. Sending it as a JSON string caused the KMS to see domain as undefined when trying to access .domain on a string value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g, fix net_delegate funding mode - Revert circleWalletsApi to pass `data` as JSON string (Circle API requires string, not object) - Remove stripEip712Domain helper — EIP712Domain must remain in types per contract - Fix fundDelegateBatch to use formData.fundingMode instead of hardcoded 'delegate' Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rade net_delegate issues one batch authorization covering all trade IDs together, so fundDelegateBatch was incorrectly looping over batch entries and calling fund() N times with the same payload. Split the handler: net_delegate makes one fund() call using the first entry's permits (all entries share them) and marks all entries succeeded/failed together; delegate keeps the per-trade loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…modes funding-presign stores the same shared typed data on every batch entry regardless of mode. The old delegate path looped once per entry and called fund N times, duplicating the same request. Both delegate and net_delegate use a single batch permit that covers all trades, so one fund call is correct. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
anilgangapersaud-circle
force-pushed
the
feat/delegate-funding-support
branch
from
September 2, 2026 21:31
a6b9522 to
cdcb217
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
anilgangapersaud-circle
marked this pull request as ready for review
September 2, 2026 21:50
yitianx00
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes to the delegate funding debug flow in the StableFX pages, plus funder entity credential support in settings.
Detail
stores/main.ts+layouts/default.vuefunderWalletApiKeyandfunderEntitySecretstate, getters, actions, and settings fields (masked as password inputs)pages/debug/stablefx/funding-presign.vuebatchTraderPermitTypedData/batchFunderPermitTypedDatain addition to the single-trade variants, so batch and net delegate presign responses are handled correctlyallDelegateSignedcomputed to use the same conditiongetFunderWalletApiKey,getFunderEntitySecret) when signing the funder permit, falling back to the trader credentials if not setpages/debug/stablefx/fund.vuefund()for each, but the batch permit covers all trades in a single call. Bothdelegateandnet_delegatemodes now submit one API call using the data from the first batch entry'delegate'funding mode:fundingModeis now read fromformData.fundingModesonet_delegatepasses through correctlyTest plan
delegatemode)makerBatchDelegateDeliver)makerNetDelegateDeliver)🤖 Generated with Claude Code