Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .yarnrc.yml
Comment thread
gomesalexandre marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ unsafeHttpWhitelist:
- localhost
- 127.0.0.1

yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-3.5.0.cjs
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,24 @@
"@shapeshiftoss/chain-adapters": "workspace:^",
"@shapeshiftoss/contracts": "workspace:^",
"@shapeshiftoss/errors": "workspace:^",
"@shapeshiftoss/hdwallet-coinbase": "1.62.25",
"@shapeshiftoss/hdwallet-core": "1.62.25",
"@shapeshiftoss/hdwallet-gridplus": "1.62.25",
"@shapeshiftoss/hdwallet-keepkey": "1.62.25",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.25",
"@shapeshiftoss/hdwallet-keplr": "1.62.25",
"@shapeshiftoss/hdwallet-ledger": "1.62.25",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.25",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.25",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.25",
"@shapeshiftoss/hdwallet-native": "1.62.25",
"@shapeshiftoss/hdwallet-native-vault": "1.62.25",
"@shapeshiftoss/hdwallet-phantom": "1.62.25",
"@shapeshiftoss/hdwallet-trezor": "1.62.25",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.25",
"@shapeshiftoss/hdwallet-vultisig": "1.62.25",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.25",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.25",
"@shapeshiftoss/hdwallet-coinbase": "1.62.28",
"@shapeshiftoss/hdwallet-core": "1.62.28",
"@shapeshiftoss/hdwallet-gridplus": "1.62.28",
"@shapeshiftoss/hdwallet-keepkey": "1.62.28",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.28",
"@shapeshiftoss/hdwallet-keplr": "1.62.28",
"@shapeshiftoss/hdwallet-ledger": "1.62.28",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.28",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.28",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.28",
"@shapeshiftoss/hdwallet-native": "1.62.28",
"@shapeshiftoss/hdwallet-native-vault": "1.62.28",
"@shapeshiftoss/hdwallet-phantom": "1.62.28",
"@shapeshiftoss/hdwallet-trezor": "1.62.28",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.28",
"@shapeshiftoss/hdwallet-vultisig": "1.62.28",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.28",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.28",
"@shapeshiftoss/swapper": "workspace:^",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
Expand Down
4 changes: 2 additions & 2 deletions packages/chain-adapters/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"dependencies": {
"@mysten/sui": "1.45.0",
"@shapeshiftoss/caip": "workspace:^",
"@shapeshiftoss/hdwallet-core": "1.62.25",
"@shapeshiftoss/hdwallet-ledger": "1.62.25",
"@shapeshiftoss/hdwallet-core": "1.62.28",
"@shapeshiftoss/hdwallet-ledger": "1.62.28",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
3 changes: 3 additions & 0 deletions packages/chain-adapters/src/utxo/UtxoBaseAdapter.ts
Comment thread
gomesalexandre marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@
vout: input.vout,
txid: input.txid,
hex: data.hex,
// For Zcash, we need to pass the blockHeight and txid of each input transaction
// so Ledger can add them to the PSBT and determine the correct consensus branch ID
...(this.coinName === 'Zcash' && data.blockHeight && { blockHeight: data.blockHeight }),

Check failure on line 376 in packages/chain-adapters/src/utxo/UtxoBaseAdapter.ts

View workflow job for this annotation

GitHub Actions / Call / Static

Property 'blockHeight' does not exist on type 'Tx | { hex: any; }'.

Check failure on line 376 in packages/chain-adapters/src/utxo/UtxoBaseAdapter.ts

View workflow job for this annotation

GitHub Actions / Call / Static

Property 'blockHeight' does not exist on type 'Tx | { hex: any; }'.

Check failure on line 376 in packages/chain-adapters/src/utxo/UtxoBaseAdapter.ts

View workflow job for this annotation

GitHub Actions / Call / Static

Property 'blockHeight' does not exist on type 'Tx | { hex: any; }'.

Check failure on line 376 in packages/chain-adapters/src/utxo/UtxoBaseAdapter.ts

View workflow job for this annotation

GitHub Actions / Call / Static

Property 'blockHeight' does not exist on type 'Tx | { hex: any; }'.
Comment thread
gomesalexandre marked this conversation as resolved.
Outdated
})
}

Expand Down
32 changes: 32 additions & 0 deletions packages/chain-adapters/src/utxo/zcash/ZcashChainAdapter.ts
Comment thread
gomesalexandre marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { RootBip44Params } from '@shapeshiftoss/types'
import { KnownChainIds, UtxoAccountType } from '@shapeshiftoss/types'
import * as unchained from '@shapeshiftoss/unchained-client'

import type { BroadcastTransactionInput } from '../../types'
import { ChainAdapterDisplayName } from '../../types'
import type { ChainAdapterArgs as BaseChainAdapterArgs } from '../UtxoBaseAdapter'
import { UtxoBaseAdapter } from '../UtxoBaseAdapter'
Expand Down Expand Up @@ -57,4 +58,35 @@ export class ChainAdapter extends UtxoBaseAdapter<KnownChainIds.ZcashMainnet> {
getFeeAssetId(): AssetId {
return this.assetId
}

async broadcastTransaction({ hex }: Pick<BroadcastTransactionInput, 'hex'>): Promise<string> {
console.log('[Zcash Adapter] Broadcasting via Blockchair monkey-patch:', {
hexLength: hex.length,
hexSample: hex.substring(0, 64),
})

try {
const response = await fetch('https://api.blockchair.com/zcash/push/transaction', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ data: hex }),
})

const result = await response.json()
console.log('[Zcash Adapter] Blockchair response:', result)

if (result.context.code !== 200) {
const errorMsg = result.context.error || 'Transaction broadcast failed'
console.error('[Zcash Adapter] Blockchair error:', errorMsg)
throw new Error(errorMsg)
}

const txHash = result.data?.transaction_hash
console.log('[Zcash Adapter] Broadcast successful, txHash:', txHash)
return txHash || ''
} catch (err) {
console.error('[Zcash Adapter] Blockchair broadcast failed:', err)
throw err
}
}
}
2 changes: 1 addition & 1 deletion packages/swapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@shapeshiftoss/caip": "workspace:^",
"@shapeshiftoss/chain-adapters": "workspace:^",
"@shapeshiftoss/contracts": "workspace:^",
"@shapeshiftoss/hdwallet-core": "1.62.25",
"@shapeshiftoss/hdwallet-core": "1.62.28",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
2 changes: 2 additions & 0 deletions src/context/WalletProvider/Ledger/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
suiAssetId,
thorchainAssetId,
tronAssetId,
zecAssetId,
} from '@shapeshiftoss/caip'
import { uniq } from 'lodash'

Expand All @@ -30,6 +31,7 @@ export const availableLedgerAppAssetIds = [
dogeAssetId,
bchAssetId,
ltcAssetId,
...(getConfig().VITE_FEATURE_ZCASH ? [zecAssetId] : []),
ethAssetId,
thorchainAssetId,
cosmosAssetId,
Expand Down
6 changes: 2 additions & 4 deletions src/hooks/useWalletSupportsChain/useWalletSupportsChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { KeyManager } from '@/context/WalletProvider/KeyManager'
import { useIsSnapInstalled } from '@/hooks/useIsSnapInstalled/useIsSnapInstalled'
import { useWallet } from '@/hooks/useWallet/useWallet'
import { METAMASK_RDNS } from '@/lib/mipd'
import { isNativeHDWallet } from '@/lib/utils'
import { isLedgerHDWallet, isNativeHDWallet } from '@/lib/utils'
import { selectAccountIdsByChainIdFilter } from '@/state/slices/portfolioSlice/selectors'
import { selectFeatureFlag } from '@/state/slices/selectors'
import { store, useAppSelector } from '@/state/store'
Expand Down Expand Up @@ -159,9 +159,7 @@ export const walletSupportsChain = ({
!(wallet instanceof GridPlusHDWallet)
)
case zecChainId:
// Only native wallet supports ZCash for now
// TODO(gomes): include more as more wallets supported for ZCash
return supportsBTC(wallet) && isNativeHDWallet(wallet)
return supportsBTC(wallet) && (isNativeHDWallet(wallet) || isLedgerHDWallet(wallet))
case ethChainId:
return supportsETH(wallet)
case avalancheChainId:
Expand Down
Loading
Loading