feat: add TON blockchain support #11625
Draft
+11,708
−11,207
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
Adds TON (The Open Network) blockchain as a second-class citizen in ShapeShift Web.
Changes
Chain Adapter (
packages/chain-adapters/src/ton/)TonChainAdapter.ts- Full chain adapter implementationtypes.ts- TON-specific types (Account, BuildTxInput, FeeData, TonSignTx)CAIP Constants (
packages/caip/src/constants.ts)tonAssetId,tonChainIdCHAIN_NAMESPACE.Ton,CHAIN_REFERENCE.TonMainnetASSET_REFERENCE.TonCoinGecko Integration (
packages/caip/src/adapters/coingecko/)Ton = 'the-open-network'toCoingeckoAssetPlatformenumchainIdToCoingeckoAssetPlatformandcoingeckoAssetPlatformToChainIdPlugin (
src/plugins/ton/)Tonfeature flagVITE_TON_NODE_URLConfig & Feature Flags
VITE_TON_NODE_URLenvironment variableVITE_FEATURE_TONfeature flagTontoFeatureFlagstype and initial stateAsset Generation (
scripts/generateAssetData/ton/)Utility Functions
chainIdToFeeAssetId.ts- Added TON casegetChainShortName.ts- Added TON case (returns 'TON')getBaseAsset.ts- Added TON casebaseAssets.ts- Added TON base asset definitionTON Chain Specifications
m/44'/607'/<account>'(3-level hardened)the-open-networkDependencies
Requires hdwallet TON support: https://github.com/shapeshift/hdwallet/pull/XXX
Environment Variables
Testing
yarn build:packagesyarn type-checkyarn generate:asset-data