Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ nodeLinker: node-modules

npmAuthToken: "${NPM_AUTH-fallback}"

npmRegistryServer: "https://registry.npmjs.org"
npmRegistryServer: "http://127.0.0.1:4873"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
Expand Down
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.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/hdwallet-coinbase": "1.62.29",
"@shapeshiftoss/hdwallet-core": "1.62.29",
"@shapeshiftoss/hdwallet-gridplus": "1.62.29",
"@shapeshiftoss/hdwallet-keepkey": "1.62.29",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.29",
"@shapeshiftoss/hdwallet-keplr": "1.62.29",
"@shapeshiftoss/hdwallet-ledger": "1.62.29",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.29",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.29",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.29",
"@shapeshiftoss/hdwallet-native": "1.62.29",
"@shapeshiftoss/hdwallet-native-vault": "1.62.29",
"@shapeshiftoss/hdwallet-phantom": "1.62.29",
"@shapeshiftoss/hdwallet-trezor": "1.62.29",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.29",
"@shapeshiftoss/hdwallet-vultisig": "1.62.29",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.29",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.29",
"@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.28",
"@shapeshiftoss/hdwallet-ledger": "1.62.28",
"@shapeshiftoss/hdwallet-core": "1.62.29",
"@shapeshiftoss/hdwallet-ledger": "1.62.29",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
4 changes: 4 additions & 0 deletions packages/chain-adapters/src/sui/SuiChainAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.SuiMainnet> {
tx.transferObjects([coin], to)
}

// Generate JSON format for Phantom
const transactionJson = await tx.toJSON()

const transactionBytes = await tx.build({ client: this.client })

// Build intent message: intent scope (0) + version (0) + app id (0) + tx bytes
Expand All @@ -286,6 +289,7 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.SuiMainnet> {
return {
addressNList: toAddressNList(this.getBip44Params({ accountNumber })),
intentMessageBytes: intentMessage,
transactionJson,
}
} catch (err) {
return ErrorHandler(err, {
Expand Down
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.28",
"@shapeshiftoss/hdwallet-core": "1.62.29",
"@shapeshiftoss/types": "workspace:^",
"@shapeshiftoss/unchained-client": "workspace:^",
"@shapeshiftoss/utils": "workspace:^",
Expand Down
2 changes: 2 additions & 0 deletions packages/swapper/src/swappers/CetusSwapper/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const cetusApi: SwapperApi = {
refreshAllCoins: true,
})

const transactionJson = await txb.toJSON({ client: suiClient })
const transactionBytes = await txb.build({ client: suiClient })

const intentMessage = new Uint8Array(3 + transactionBytes.length)
Expand All @@ -104,6 +105,7 @@ export const cetusApi: SwapperApi = {
return {
addressNList,
intentMessageBytes: intentMessage,
transactionJson,
}
},

Expand Down
26 changes: 25 additions & 1 deletion src/hooks/useWalletSupportsChain/useWalletSupportsChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
} from '@shapeshiftoss/hdwallet-core'
import { GridPlusHDWallet } from '@shapeshiftoss/hdwallet-gridplus'
import { isMetaMask } from '@shapeshiftoss/hdwallet-metamask-multichain'
import { PhantomHDWallet } from '@shapeshiftoss/hdwallet-phantom'
import { isPhantom, PhantomHDWallet } from '@shapeshiftoss/hdwallet-phantom'
import { VultisigHDWallet } from '@shapeshiftoss/hdwallet-vultisig'
import { useMemo } from 'react'

Expand Down Expand Up @@ -148,49 +148,73 @@ export const walletSupportsChain = ({
case btcChainId:
return supportsBTC(wallet)
case bchChainId:
// temp disable evm/BTC chains for phantom as it rate-limits Phantom. yet that's a thing.
if (wallet instanceof PhantomHDWallet) return false
return (
supportsBTC(wallet) &&
!(wallet instanceof PhantomHDWallet) &&
!(wallet instanceof GridPlusHDWallet)
)
case dogeChainId:
// temp disable evm/BTC chains for phantom as it rate-limits Phantom. yet that's a thing.
if (wallet instanceof PhantomHDWallet) return false
return (
supportsBTC(wallet) &&
!(wallet instanceof PhantomHDWallet) &&
!(wallet instanceof GridPlusHDWallet)
)
case ltcChainId:
// temp disable evm/BTC chains for phantom as it rate-limits Phantom. yet that's a thing.
if (wallet instanceof PhantomHDWallet) return false
return (
supportsBTC(wallet) &&
!(wallet instanceof PhantomHDWallet) &&
!(wallet instanceof GridPlusHDWallet)
)
case zecChainId:
// temp disable evm/BTC chains for phantom as it rate-limits Phantom. yet that's a thing.
if (wallet instanceof PhantomHDWallet) return false
return (
supportsBTC(wallet) &&
(isNativeHDWallet(wallet) || isLedgerHDWallet(wallet) || isTrezorHDWallet(wallet))
)
case ethChainId:
return supportsETH(wallet)
case avalancheChainId:
// Phantom doesn't support Avalanche
if (isPhantom(wallet)) return false
return supportsAvalanche(wallet)
case optimismChainId:
// Phantom doesn't support Optimism
if (isPhantom(wallet)) return false
return supportsOptimism(wallet)
case bscChainId:
// Phantom doesn't support BSC
if (isPhantom(wallet)) return false
return supportsBSC(wallet)
case polygonChainId:
// Phantom supports Polygon
return supportsPolygon(wallet)
case gnosisChainId:
// Phantom doesn't support Gnosis
if (isPhantom(wallet)) return false
return supportsGnosis(wallet)
case arbitrumChainId:
// Phantom doesn't support Arbitrum
if (isPhantom(wallet)) return false
return supportsArbitrum(wallet)
case arbitrumNovaChainId:
// Phantom doesn't support Arbitrum Nova
if (isPhantom(wallet)) return false
return isArbitrumNovaEnabled && supportsArbitrumNova(wallet)
case baseChainId:
// Phantom supports Base
return supportsBase(wallet)
case monadChainId:
// Phantom supports Monad
return isMonadEnabled && supportsMonad(wallet)
case hyperEvmChainId:
// Phantom supports HyperEVM
return isHyperEvmEnabled && supportsHyperEvm(wallet)
case plasmaChainId:
return isPlasmaEnabled && supportsPlasma(wallet)
Expand Down