feat: add anchor rails configuration and capability matrix (#54) - #207
Merged
Conversation
) - Add AnchorRailCapabilityState, AnchorRailCapability, AnchorAssetCapability, and AnchorCapabilityMatrix types to @anchorkit/types - Add ANCHOR_RAIL_CAPABILITY_STATES constant (extends CAPABILITY_STATES with 'unsupported') - Add Zod schemas for all three types in @anchorkit/validators - Add DEFAULT_ANCHOR_CAPABILITY_MATRIX with SEPA/ACH/WIRE/CARD rails and XLM/USDC/EURC assets to @anchorkit/config - Add getRailsByState, getDepositEnabledAssets, getWithdrawalEnabledAssets, findRailById, findAssetByCode, isRailDepositReady, isRailWithdrawalReady query helpers to @anchorkit/config - Add parseAnchorCapabilityMatrix, isAnchorCapabilityMatrixValid, parseAnchorRailCapability, parseAnchorAssetCapability validate helpers to @anchorkit/anchor-utils - Add mockAnchorCapabilityMatrix, allDisabledRailsMatrix, experimentalOnlyMatrix fixtures to @anchorkit/fixtures - Add CapabilityMatrixCard component to apps/web - Integrate capability matrix section into /anchors dashboard page - Add rail-capability-types, rail-config, rail-capability-schemas, rail-capability and rail-capability-fixtures entries to all package capability metadata objects - Add tests: types (4), validators (23), config (25), anchor-utils (19), fixtures (22), web (8) - Add docs/ANCHOR_RAILS_CAPABILITY_MATRIX.md Closes Axionvera#54
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
Closes #54.
Implements the typed anchor rails capability matrix as described in the issue.
Changes
Types
@anchorkit/typesAnchorRailCapabilityState— extendsCapabilityStatewith"unsupported"ANCHOR_RAIL_CAPABILITY_STATESconstantAnchorRailCapability— rail descriptor (railId, state, deposit/withdrawal support, currencies, countries)AnchorAssetCapability— asset descriptor (code, issuer, enabled flags, fee config)AnchorCapabilityMatrix— top-level matrix aggregating rails, assets, and experimental/disabled behaviour recordsValidators
@anchorkit/validatorsAnchorRailCapabilitySchema,AnchorAssetCapabilitySchema,AnchorCapabilityMatrixSchemaConfig
@anchorkit/configDEFAULT_ANCHOR_CAPABILITY_MATRIXwith SEPA/ACH (mock), WIRE (experimental, deposit-only), CARD (unavailable) rails and XLM/USDC/EURC assetsgetRailsByState,getDepositEnabledAssets,getWithdrawalEnabledAssets,findRailById,findAssetByCode,isRailDepositReady,isRailWithdrawalReadyanchor-utils
@anchorkit/anchor-utilsparseAnchorCapabilityMatrix,isAnchorCapabilityMatrixValid,parseAnchorRailCapability,isAnchorRailCapabilityValid,parseAnchorAssetCapability,isAnchorAssetCapabilityValidFixtures
@anchorkit/fixturesmockAnchorCapabilityMatrix— full fixture covering all rail/asset statesallDisabledRailsMatrix— all rails unavailable (negative testing)experimentalOnlyMatrix— single experimental railWeb dashboard
apps/webCapabilityMatrixCardcomponent — renders the full matrix (rails, assets, experimental/disabled behaviours) as a dashboard card/anchorspage below the lifecycle transition sectionDocs
docs/ANCHOR_RAILS_CAPABILITY_MATRIX.md— types reference, default matrix tables, query/validate helper API, extension guideTests
@anchorkit/types@anchorkit/validators@anchorkit/config@anchorkit/anchor-utils@anchorkit/fixturesapps/webAll new tests pass. Pre-existing
capability-badge.test.tsand lint failures inapps/webare unrelated to this PR and were present onmainbefore these changes.Acceptance criteria