Skip to content

Commit

Permalink
feat: thorchain memo parser dynamic precision loss and final asset sh…
Browse files Browse the repository at this point in the history
…ortener to support utxos (#7006)
  • Loading branch information
NeOMakinG authored Jun 6, 2024
1 parent bcca129 commit 16bcf41
Show file tree
Hide file tree
Showing 13 changed files with 658 additions and 276 deletions.
1 change: 1 addition & 0 deletions .env.develop
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# feature flags
REACT_APP_FEATURE_CHATWOOT=true
REACT_APP_FEATURE_RFOX=true
REACT_APP_FEATURE_THORCHAINSWAP_L1_TO_LONGTAIL=true
REACT_APP_FEATURE_ARBITRUM_BRIDGE=true

# mixpanel
Expand Down
11 changes: 9 additions & 2 deletions src/lib/swapper/swappers/ThorchainSwapper/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import type { ChainId } from '@shapeshiftoss/caip'
import { bchChainId, type ChainId } from '@shapeshiftoss/caip'
import type { SwapSource } from '@shapeshiftoss/swapper'
import { SwapperName } from '@shapeshiftoss/swapper'
import { KnownChainIds } from '@shapeshiftoss/types'
import type { SupportedChainIds } from 'lib/swapper/types'
import { isUtxoChainId } from 'lib/utils/utxo'

export const sellSupportedChainIds: Record<ChainId, boolean> = {
[KnownChainIds.EthereumMainnet]: true,
Expand Down Expand Up @@ -47,5 +48,11 @@ export const UNI_V3_ETHEREUM_POOL_FACTORY_CONTRACT_ADDRESS =
'0x1F98431c8aD98523631AE4a59f267346ea31F984'
export const ALLOWANCE_CONTRACT = '0xF892Fef9dA200d9E84c9b0647ecFF0F34633aBe8' // TSAggregatorTokenTransferProxy

export const UTXO_MAXIMUM_BYTES_LENGTH = 80
export const BTC_MAXIMUM_BYTES_LENGTH = 80
export const BCH_MAXIMUM_BYTES_LENGTH = 220

export const getMaxBytesLengthByChainId = (chainId: ChainId) => {
if (chainId === bchChainId) return BCH_MAXIMUM_BYTES_LENGTH
if (isUtxoChainId(chainId)) return BTC_MAXIMUM_BYTES_LENGTH
return Infinity
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 16bcf41

Please sign in to comment.