Conversation
Integrations wanting encrypted or vault-backed ephemeral recovery storage previously had no hook: the secrets never crossed the public SDK surface, and storeEphemeralKeys: false silently disabled the backup entirely. The callback replaces the built-in file/localStorage persistence and keeps the fail-closed registration contract.
Sync README, ARCHITECTURE, and the ephemeral-accounts security spec with the new storeEphemeralKeysCallback: built-in storage stays local-only, a configured callback shifts destination custody to the integrator, and both paths keep the fail-closed registration contract.
The skill claimed integrators could set storeEphemeralKeys: false and persist the keys themselves, but the secrets never crossed the public SDK surface, so that flag alone just disabled the recovery backup. Point custom-storage integrations at storeEphemeralKeysCallback.
Additive only: StoredEphemeralKey, StoreEphemeralKeysCallback, and the optional storeEphemeralKeysCallback config field. No existing surface changed, so live integrators are unaffected.
…ation-atomicity Keep Avenia outcome emails atomic with status updates
…base-default Align dashboard E2E journeys with the Base default
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi canceled.
|
✅ Deploy Preview for vrtx-dashboard canceled.
|
…ge-callback Add a custom ephemeral key storage callback to the SDK
The API's squidrouter core now Big-parses toAmountUSD for routed subsidy valuation, but the wire schema only required a non-empty string. Mirror Big.js's accepted grammar so an unparsable value fails loudly at the wire boundary, matching how the other numerically consumed fields are guarded.
The Squid probe fallback was recorded only via quote-context notes, which reach no persistent sink, so a degraded Squid USD valuation (the one newly plausible silent trigger on exotic-token corridors) left no operational signal. Emit a structured warn from the catch, note the skipped adjustment when the oracle target is non-positive, and pin the retention>1 branch.
The fake's absolute toAmountUsd default of "1" modeled ~1% value retention for every probe; harmless today only because pre-existing scenario partners disable subsidy. A proportional default (raw Base USDC at $1) keeps the next discount-enabled routed-onramp scenario from encoding a 100x-loss route.
Copilot review follow-up: enforcing toAmountUSD parseability at the wire schema (or parsing it unguarded in the shared route helper) made every route consumer fail on a field only the SubsidizePost probe consumes - AveniaMint's fee probe and the swap leg would abort quote creation on a malformed value the probe is designed to degrade on. Keep the schema presence-only, parse the field tolerantly into Big|null in the helper, and let the probe's existing warn + 1:1 fallback absorb unusable values. This supersedes the big-parseable schema validation, whose regex also admitted a leading plus sign that Big.js rejects.
Copilot follow-up: requiring the field meant a Squid response omitting its USD estimate still aborted every shared getRoute caller before the tolerant parse could run - the one absence case the previous round left fatal. Normalize absence to an empty string so the shared type stays a plain string, non-consuming route callers are unaffected, and the SubsidizePost probe hits its existing warn + 1:1 fallback. The min(1) requirement predates this PR, so this extends the availability decision rather than fixing a regression.
…aluation Prevent routed quotes from inflating subsidies across token units
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Transactional notification logging can report a rolled-back enqueue as successful.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Promotes the shared package and SDK to production versions while hardening ephemeral-key custody, routed subsidy valuation, settlement metadata, and transactional notifications.
Changes:
- Adds fail-closed custom ephemeral-key storage to the SDK.
- Anchors routed subsidies to USD value and improves malformed Squid response handling.
- Makes verification notifications transactional and updates regression coverage and documentation.
File summaries
| File | Description |
|---|---|
packages/shared/src/services/squidrouter/schemas.ts |
Tolerates missing Squid USD estimates. |
packages/shared/src/services/squidrouter/schemas.test.ts |
Tests tolerant estimate parsing. |
packages/shared/package.json |
Releases shared v0.4.0. |
packages/sdk/test/vortexSdk.storeEphemerals.test.ts |
Tests custom key persistence. |
packages/sdk/test/vortexSdk.lazyNetworks.test.ts |
Verifies fail-closed registration ordering. |
packages/sdk/src/VortexSdk.ts |
Invokes the custom storage callback. |
packages/sdk/src/types.ts |
Exposes callback and stored-key types. |
packages/sdk/README.md |
Documents custom key custody. |
packages/sdk/package.json |
Releases SDK v0.9.0. |
packages/sdk/ARCHITECTURE.md |
Updates custody architecture. |
docs/security-spec/03-ramp-engine/ramp-phase-flows.md |
Clarifies settlement and subsidy behavior. |
docs/security-spec/03-ramp-engine/quote-lifecycle.md |
Documents the oracle-based subsidy cap. |
docs/security-spec/03-ramp-engine/discount-mechanism.md |
Updates routed subsidy invariants. |
docs/security-spec/02-signing-keys/ephemeral-accounts.md |
Specifies callback custody requirements. |
docs/api/wire-contract.snapshot.md |
Updates the generated SDK contract. |
docs/api/pages/11-production-checklist.md |
Adds production custody guidance. |
docs/api/pages/05-ephemeral-key-custody.md |
Documents callback-based persistence. |
docs/api/pages/02-quick-start-with-the-sdk.md |
Adds a callback integration example. |
bun.lock |
Synchronizes release versions. |
apps/dashboard/e2e/transfer-mxn-journey.spec.ts |
Explicitly selects Polygon in MXN tests. |
apps/dashboard/e2e/funding-gate.spec.ts |
Covers Base default and Polygon scenarios. |
apps/api/src/tests/notifications-onboarding.integration.test.ts |
Tests notification rollback. |
apps/api/src/tests/corridors/brl-onramp-crosschain.scenario.test.ts |
Covers USD-valued routed subsidies. |
apps/api/src/test-utils/fake-world/fake-squidrouter.ts |
Produces realistic USD estimates. |
apps/api/src/api/services/phases/blocks/phases/subsidize-post/simulation.ts |
Uses route USD-value retention. |
apps/api/src/api/services/phases/blocks/phases/final-settlement-subsidy/simulation.ts |
Records a neutral settlement target. |
apps/api/src/api/services/phases/blocks/phases/final-settlement-subsidy/simulation.test.ts |
Tests neutral settlement metadata. |
apps/api/src/api/services/phases/blocks/core/squidrouter.ts |
Parses USD estimates tolerantly. |
apps/api/src/api/services/phases/blocks/core/discount.ts |
Adds an independent subsidy cap basis. |
apps/api/src/api/services/phases/blocks/core/discount.test.ts |
Tests independent cap anchoring. |
apps/api/src/api/services/phases/blocks/__tests__/onramp-discount.test.ts |
Covers routed-token valuation cases. |
apps/api/src/api/services/phases/blocks/__tests__/eur-onramp-base-same-chain.flow.test.ts |
Updates Squid mock metadata. |
apps/api/src/api/services/phases/blocks/__tests__/eur-onramp-base-cross-chain.flow.test.ts |
Updates cross-chain Squid mocks. |
apps/api/src/api/services/phases/blocks/__tests__/brl-onramp-base-same-chain.flow.test.ts |
Updates BRL Squid mocks. |
apps/api/src/api/services/phases/blocks/__tests__/brl-onramp-base-cross-chain.flow.test.ts |
Tests non-stable subsidy bounds. |
apps/api/src/api/services/email/notification.service.ts |
Accepts transactional enqueueing. |
apps/api/src/api/services/avenia/verification-notifications.ts |
Propagates notification transactions. |
apps/api/src/api/services/avenia/avenia-customer.service.ts |
Enqueues outcomes atomically. |
apps/api/src/api/services/avenia/avenia-customer.service.test.ts |
Verifies transaction propagation. |
apps/api/src/api/controllers/brla.controller.ts |
Makes KYB notification enqueue atomic. |
.agents/skills/vortex-integration/SKILL.md |
Updates SDK integration guidance. |
Review details
- Files reviewed: 40/41 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| const [, created] = await EmailNotification.findOrCreate({ | ||
| defaults: { ...key, locale, payload, userId }, | ||
| transaction, |
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.
No description provided.