Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,4 @@ VITE_USER_SERVER_URL=https://shapeshiftuser-service-production.up.railway.app
VITE_NOTIFICATIONS_SERVER_URL=https://shapeshiftnotifications-service-production.up.railway.app

VITE_FEATURE_TRON=false
VITE_FEATURE_MONAD=false
4 changes: 4 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ VITE_UNCHAINED_ARBITRUM_NOVA_HTTP_URL=https://dev-api.arbitrum-nova.shapeshift.c
VITE_UNCHAINED_ARBITRUM_NOVA_WS_URL=wss://dev-api.arbitrum-nova.shapeshift.com
VITE_UNCHAINED_BASE_HTTP_URL=https://dev-api.base.shapeshift.com
VITE_UNCHAINED_BASE_WS_URL=wss://dev-api.base.shapeshift.com
VITE_UNCHAINED_MONAD_HTTP_URL=https://rpc.monad.xyz
VITE_UNCHAINED_MONAD_WS_URL=wss://rpc3.monad.xyz
VITE_UNCHAINED_BITCOIN_HTTP_URL=https://dev-api.bitcoin.shapeshift.com
VITE_UNCHAINED_BITCOIN_WS_URL=wss://dev-api.bitcoin.shapeshift.com
VITE_UNCHAINED_DOGECOIN_WS_URL=wss://dev-api.dogecoin.shapeshift.com
Expand Down Expand Up @@ -59,6 +61,7 @@ VITE_GNOSIS_NODE_URL=https://dev-api.gnosis.shapeshift.com/api/v1/jsonrpc
VITE_ARBITRUM_NODE_URL=https://dev-api.arbitrum.shapeshift.com/api/v1/jsonrpc
VITE_ARBITRUM_NOVA_NODE_URL=https://dev-api.arbitrum-nova.shapeshift.com/api/v1/jsonrpc
VITE_BASE_NODE_URL=https://dev-api.base.shapeshift.com/api/v1/jsonrpc
VITE_MONAD_NODE_URL=https://rpc.monad.xyz
# Swap me back to 9R as-needed
# VITE_THORCHAIN_NODE_URL=https://thornode.ninerealms.com
VITE_THORCHAIN_NODE_URL=https://dev-api.thorchain.shapeshift.com/lcd
Expand Down Expand Up @@ -86,3 +89,4 @@ VITE_FEATURE_NOTIFICATIONS_WEBSERVICES=true

VITE_FEATURE_WC_DIRECT_CONNECTION=true
VITE_FEATURE_TRON=true
VITE_FEATURE_MONAD=true
Comment thread
gomesalexandre marked this conversation as resolved.
3 changes: 3 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ VITE_UNCHAINED_ARBITRUM_NOVA_HTTP_URL=https://api.arbitrum-nova.shapeshift.com
VITE_UNCHAINED_ARBITRUM_NOVA_WS_URL=wss://api.arbitrum-nova.shapeshift.com
VITE_UNCHAINED_BASE_HTTP_URL=https://api.base.shapeshift.com
VITE_UNCHAINED_BASE_WS_URL=wss://api.base.shapeshift.com
VITE_UNCHAINED_MONAD_HTTP_URL=https://rpc.monad.xyz
VITE_UNCHAINED_MONAD_WS_URL=wss://rpc3.monad.xyz
VITE_UNCHAINED_BITCOIN_HTTP_URL=https://api.bitcoin.shapeshift.com
VITE_UNCHAINED_BITCOIN_WS_URL=wss://api.bitcoin.shapeshift.com
VITE_UNCHAINED_DOGECOIN_WS_URL=wss://api.dogecoin.shapeshift.com
Expand Down Expand Up @@ -55,6 +57,7 @@ VITE_GNOSIS_NODE_URL=https://api.gnosis.shapeshift.com/api/v1/jsonrpc
VITE_ARBITRUM_NODE_URL=https://api.arbitrum.shapeshift.com/api/v1/jsonrpc
VITE_ARBITRUM_NOVA_NODE_URL=https://api.arbitrum-nova.shapeshift.com/api/v1/jsonrpc
VITE_BASE_NODE_URL=https://api.base.shapeshift.com/api/v1/jsonrpc
VITE_MONAD_NODE_URL=https://rpc.monad.xyz
VITE_THORCHAIN_NODE_URL=https://api.thorchain.shapeshift.com/lcd
VITE_MAYACHAIN_NODE_URL=https://api.mayachain.shapeshift.com/lcd
VITE_SOLANA_NODE_URL=https://api.solana.shapeshift.com/api/v1/jsonrpc
Expand Down
10 changes: 10 additions & 0 deletions headers/csps/chains/monad.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { loadEnv } from 'vite'

import type { Csp } from '../../types'

const mode = process.env.MODE ?? process.env.NODE_ENV ?? 'development'
const env = loadEnv(mode, process.cwd(), '')

export const csp: Csp = {
'connect-src': [env.VITE_MONAD_NODE_URL],
}
2 changes: 2 additions & 0 deletions headers/csps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { csp as ethereum } from './chains/ethereum'
import { csp as gnosis } from './chains/gnosis'
import { csp as litecoin } from './chains/litecoin'
import { csp as mayachain } from './chains/mayachain'
import { csp as monad } from './chains/monad'
import { csp as optimism } from './chains/optimism'
import { csp as polygon } from './chains/polygon'
import { csp as solana } from './chains/solana'
Expand Down Expand Up @@ -102,6 +103,7 @@ export const csps = [
thorchain,
tron,
mayachain,
monad,
trustwallet,
coincap,
exchangeRates,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Comment thread
gomesalexandre marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
"use-long-press": "^3.3.0",
"uuid": "^9.0.0",
"vaul": "^1.1.2",
"viem": "^2.10.9",
"viem": "^2.40.3",
Comment thread
gomesalexandre marked this conversation as resolved.
Outdated
"wagmi": "^2.9.2",
"web-vitals": "^2.1.4",
"wouter": "^3.6.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eip155:143/slip44:60": "monad"
}
2 changes: 2 additions & 0 deletions packages/caip/src/adapters/coingecko/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import gnosis from './eip155_100/adapter.json'
import arbitrum from './eip155_42161/adapter.json'
import arbitrumNova from './eip155_42170/adapter.json'
import base from './eip155_8453/adapter.json'
import monad from './eip155_143/adapter.json'
import cosmos from './cosmos_cosmoshub-4/adapter.json'
import thorchain from './cosmos_thorchain-1/adapter.json'
import mayachain from './cosmos_mayachain-mainnet-v1/adapter.json'
Expand All @@ -31,6 +32,7 @@ export {
arbitrum,
arbitrumNova,
base,
monad,
cosmos,
thorchain,
mayachain,
Expand Down
6 changes: 6 additions & 0 deletions packages/caip/src/adapters/coingecko/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
ethChainId,
gnosisChainId,
mayachainChainId,
monadChainId,
optimismChainId,
polygonChainId,
solanaChainId,
Expand All @@ -40,6 +41,7 @@ export enum CoingeckoAssetPlatform {
Arbitrum = 'arbitrum-one',
ArbitrumNova = 'arbitrum-nova',
Base = 'base',
Monad = 'monad',
Solana = 'solana',
Tron = 'tron',
}
Expand Down Expand Up @@ -90,6 +92,8 @@ export const chainIdToCoingeckoAssetPlatform = (chainId: ChainId): string => {
return CoingeckoAssetPlatform.ArbitrumNova
case CHAIN_REFERENCE.BaseMainnet:
return CoingeckoAssetPlatform.Base
case CHAIN_REFERENCE.MonadMainnet:
return CoingeckoAssetPlatform.Monad
default:
throw new Error(
`chainNamespace ${chainNamespace}, chainReference ${chainReference} not supported.`,
Expand Down Expand Up @@ -155,6 +159,8 @@ export const coingeckoAssetPlatformToChainId = (
return arbitrumNovaChainId
case CoingeckoAssetPlatform.Base:
return baseChainId
case CoingeckoAssetPlatform.Monad:
return monadChainId
case CoingeckoAssetPlatform.Cosmos:
return cosmosChainId
case CoingeckoAssetPlatform.Thorchain:
Expand Down
6 changes: 6 additions & 0 deletions packages/caip/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const gnosisAssetId: AssetId = 'eip155:100/slip44:60'
export const arbitrumAssetId: AssetId = 'eip155:42161/slip44:60'
export const arbitrumNovaAssetId: AssetId = 'eip155:42170/slip44:60'
export const baseAssetId: AssetId = 'eip155:8453/slip44:60'
export const monadAssetId: AssetId = 'eip155:143/slip44:60'
export const solAssetId: AssetId = 'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/slip44:501'
export const wrappedSolAssetId: AssetId =
'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:So11111111111111111111111111111111111111112'
Expand Down Expand Up @@ -67,6 +68,7 @@ export const gnosisChainId: ChainId = 'eip155:100'
export const arbitrumChainId: ChainId = 'eip155:42161'
export const arbitrumNovaChainId: ChainId = 'eip155:42170'
export const baseChainId: ChainId = 'eip155:8453'
export const monadChainId: ChainId = 'eip155:143'

export const cosmosChainId: ChainId = 'cosmos:cosmoshub-4'
export const thorchainChainId: ChainId = 'cosmos:thorchain-1'
Expand Down Expand Up @@ -106,6 +108,7 @@ export const CHAIN_REFERENCE = {
ArbitrumMainnet: '42161', // https://chainlist.org/chain/42161
ArbitrumNovaMainnet: '42170', // https://chainlist.org/chain/42170
BaseMainnet: '8453', // https://chainlist.org/chain/8453
MonadMainnet: '143', // https://docs.monad.xyz/developer-essentials/network-information
SolanaMainnet: '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp', // https://namespaces.chainagnostic.org/solana/caip2
TronMainnet: '0x2b6653dc', // https://developers.tron.network/docs/networks
} as const
Expand Down Expand Up @@ -137,6 +140,7 @@ export const ASSET_REFERENCE = {
Arbitrum: '60', // evm chain which uses ethereum derivation path as common practice
ArbitrumNova: '60', // evm chain which uses ethereum derivation path as common practice
Base: '60', // evm chain which uses ethereum derivation path as common practice
Monad: '60', // evm chain which uses ethereum derivation path as common practice
Solana: '501',
Tron: '195',
} as const
Expand All @@ -158,6 +162,7 @@ export const VALID_CHAIN_IDS: ValidChainMap = Object.freeze({
CHAIN_REFERENCE.ArbitrumMainnet,
CHAIN_REFERENCE.ArbitrumNovaMainnet,
CHAIN_REFERENCE.BaseMainnet,
CHAIN_REFERENCE.MonadMainnet,
],
[CHAIN_NAMESPACE.CosmosSdk]: [
CHAIN_REFERENCE.CosmosHubMainnet,
Expand Down Expand Up @@ -204,6 +209,7 @@ export const FEE_ASSET_IDS = [
arbitrumAssetId,
arbitrumNovaAssetId,
baseAssetId,
monadAssetId,
solAssetId,
tronAssetId,
]
9 changes: 9 additions & 0 deletions packages/chain-adapters/src/evm/EvmBaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
supportsBSC,
supportsETH,
supportsGnosis,
supportsMonad,
supportsOptimism,
supportsPolygon,
} from '@shapeshiftoss/hdwallet-core'
Expand Down Expand Up @@ -76,6 +77,7 @@ export const evmChainIds = [
KnownChainIds.ArbitrumMainnet,
KnownChainIds.ArbitrumNovaMainnet,
KnownChainIds.BaseMainnet,
KnownChainIds.MonadMainnet,
] as const

export type EvmChainAdapter = EvmBaseAdapter<EvmChainId>
Expand Down Expand Up @@ -172,6 +174,8 @@ export abstract class EvmBaseAdapter<T extends EvmChainId> implements IChainAdap
return supportsArbitrumNova(wallet)
case Number(fromChainId(KnownChainIds.BaseMainnet).chainReference):
return supportsBase(wallet)
case Number(fromChainId(KnownChainIds.MonadMainnet).chainReference):
return supportsMonad(wallet)
default:
return false
}
Expand Down Expand Up @@ -249,6 +253,11 @@ export abstract class EvmBaseAdapter<T extends EvmChainId> implements IChainAdap
symbol: 'ETH',
explorer: 'https://basescan.org',
},
[KnownChainIds.MonadMainnet]: {
name: 'MON',
symbol: 'MON',
explorer: 'https://monadvision.com',
},
}[this.chainId]

try {
Expand Down
1 change: 1 addition & 0 deletions packages/chain-adapters/src/evm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ export * as bnbsmartchain from './bnbsmartchain'
export * as arbitrum from './arbitrum'
export * as arbitrumNova from './arbitrumNova'
export * as base from './base'
export * as monad from './monad'
Loading
Loading