Skip to content
Open
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ VITE_ABSOLUTE_URL_PREFIX=https://app.shapeshift.com

# Dev tools
VITE_FEATURE_PERFORMANCE_PROFILER=false
VITE_FEATURE_ROBINHOOD=false

# chat woot
VITE_CHATWOOT_TOKEN=jmoXp9BPMSPEYHeJX5YKT15Q
Expand Down Expand Up @@ -283,6 +284,7 @@ VITE_BANXA_API_KEY=9b682e36d91849427377a710b40d8722f74ae1b1

# y.at
VITE_YAT_NODE_URL=https://a.y.at
VITE_ROBINHOOD_NODE_URL=https://rpc.mainnet.chain.robinhood.com

# Keepkey updater
VITE_KEEPKEY_UPDATER_RELEASE_PAGE=https://github.com/keepkey/keepkey-desktop/releases/latest
Expand Down
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ VITE_FEATURE_YIELD_MULTI_ACCOUNT=true
VITE_FEATURE_AGENTIC_CHAT=true
VITE_FEATURE_MM_NATIVE_MULTICHAIN=true
VITE_FEATURE_NOTIFICATIONS_WEBSERVICES=true
VITE_FEATURE_ROBINHOOD=true

# mixpanel
VITE_MIXPANEL_TOKEN=a867ce40912a6b7d01d088cf62b0e1ff
Expand Down Expand Up @@ -91,6 +92,7 @@ VITE_BASE_NODE_URL=https://dev-api.base.shapeshift.com/api/v1/jsonrpc
VITE_THORCHAIN_NODE_URL=https://dev-api.thorchain.shapeshift.com/lcd
VITE_MAYACHAIN_NODE_URL=https://dev-api.mayachain.shapeshift.com/lcd
VITE_SOLANA_NODE_URL=https://dev-api.solana.shapeshift.com/api/v1/jsonrpc
VITE_ROBINHOOD_NODE_URL=https://rpc.mainnet.chain.robinhood.com

# midgard
VITE_THORCHAIN_MIDGARD_URL=https://dev-api.thorchain.shapeshift.com/midgard/v2
Expand Down
30 changes: 30 additions & 0 deletions chains/robinhood.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"camelName": "robinhood",
"pascalName": "Robinhood",
"upperName": "ROBINHOOD",
"chainId": 4663,
"viemChainName": "robinhood",
"nativeSymbol": "ETH",
"nativeName": "Ethereum",
"nativePrecision": 18,
"isNativeEth": true,
"color": "#00C805",
"networkIconUrl": "https://assets.relay.link/icons/4663/light.png",
"nativeIconUrl": "https://assets.coingecko.com/coins/images/279/large/ethereum.png",
"explorerUrl": "https://robinhoodchain.blockscout.com",
"explorerAddressLink": "https://robinhoodchain.blockscout.com/address/",
"explorerTxLink": "https://robinhoodchain.blockscout.com/tx/",
"rpcUrl": "https://rpc.mainnet.chain.robinhood.com",
"publicRpcUrls": ["https://robinhood-chain.gateway.tenderly.co"],
"coingeckoPlatform": "robinhood",
"wrappedNativeAddress": "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73",
"relatedAssetKey": "eip155:1/slip44:60",
"shortName": "RH",
"swappers": {
"relay": { "supported": true, "relayChainId": 4663 },
"across": { "supported": true },
"portals": { "supported": false },
"zerion": { "supported": false },
"yieldxyz": { "supported": false }
}
}
11 changes: 11 additions & 0 deletions headers/csps/chains/robinhood.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { loadEnv } from 'vite'

import { PUBLIC_RPC_URLS } from '../../../packages/contracts/src/publicRpcUrls'
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_ROBINHOOD_NODE_URL, ...PUBLIC_RPC_URLS.robinhood],
}
2 changes: 2 additions & 0 deletions headers/csps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { csp as optimism } from './chains/optimism'
import { csp as plasma } from './chains/plasma'
import { csp as plume } from './chains/plume'
import { csp as polygon } from './chains/polygon'
import { csp as robinhood } from './chains/robinhood'
import { csp as scroll } from './chains/scroll'
import { csp as sei } from './chains/sei'
import { csp as solana } from './chains/solana'
Expand Down Expand Up @@ -208,4 +209,5 @@ export const csps = [
railway,
discord,
yieldxyz,
robinhood,
]

Large diffs are not rendered by default.

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 @@ -36,6 +36,7 @@ import flowevm from "./eip155_747/adapter.json";
import celo from "./eip155_42220/adapter.json";
import sei from "./eip155_1329/adapter.json";
import abstract from "./eip155_2741/adapter.json";
import robinhood from "./eip155_4663/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 Down Expand Up @@ -86,6 +87,7 @@ export {
celo,
sei,
abstract,
robinhood,
cosmos,
thorchain,
mayachain,
Expand Down
7 changes: 7 additions & 0 deletions packages/caip/src/adapters/coingecko/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ describe('adapters:coingecko', () => {
assetNamespace: 'slip44',
assetReference: ASSET_REFERENCE.Soneium,
})
const ethOnRobinhood = toAssetId({
chainNamespace,
chainReference: CHAIN_REFERENCE.RobinhoodMainnet,
assetNamespace: 'slip44',
assetReference: ASSET_REFERENCE.Robinhood,
})
expect(coingeckoToAssetIds('ethereum')).toEqual([
ethOnEthereum,
ethOnOptimism,
Expand All @@ -155,6 +161,7 @@ describe('adapters:coingecko', () => {
ethOnUnichain,
ethOnSoneium,
ethOnAbstract,
ethOnRobinhood,
])
})

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 @@ -36,6 +36,7 @@ import {
plasmaChainId,
plumeChainId,
polygonChainId,
robinhoodChainId,
scrollChainId,
seiChainId,
solanaChainId,
Expand Down Expand Up @@ -100,6 +101,7 @@ export enum CoingeckoAssetPlatform {
Ton = 'the-open-network',
Near = 'near-protocol',
Abstract = 'abstract',
Robinhood = 'robinhood',
}

type CoinGeckoId = string
Expand Down Expand Up @@ -198,6 +200,8 @@ export const chainIdToCoingeckoAssetPlatform = (chainId: ChainId): string => {
return CoingeckoAssetPlatform.Soneium
case CHAIN_REFERENCE.SeiMainnet:
return CoingeckoAssetPlatform.Sei
case CHAIN_REFERENCE.RobinhoodMainnet:
return CoingeckoAssetPlatform.Robinhood
default:
throw new Error(
`chainNamespace ${chainNamespace}, chainReference ${chainReference} not supported.`,
Expand Down Expand Up @@ -367,6 +371,8 @@ export const coingeckoAssetPlatformToChainId = (
return tonChainId
case CoingeckoAssetPlatform.Near:
return nearChainId
case CoingeckoAssetPlatform.Robinhood:
return robinhoodChainId
default:
return undefined
}
Expand Down
3 changes: 3 additions & 0 deletions packages/caip/src/adapters/coingecko/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ describe('adapters:coingecko:utils', () => {
'eip155:2741': {
'eip155:2741/slip44:60': 'ethereum',
},
'eip155:4663': {
'eip155:4663/slip44:60': 'ethereum',
},
'near:mainnet': {
'near:mainnet/slip44:397': 'near',
},
Expand Down
17 changes: 17 additions & 0 deletions packages/caip/src/adapters/coingecko/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ import {
plumeChainId,
polygonAssetId,
polygonChainId,
robinhoodAssetId,
robinhoodChainId,
scrollAssetId,
scrollChainId,
solanaChainId,
Expand Down Expand Up @@ -665,6 +667,20 @@ export const parseData = (coins: CoingeckoCoin[]): AssetMap => {
}
}

if (Object.keys(platforms).includes(CoingeckoAssetPlatform.Robinhood)) {
try {
const assetId = toAssetId({
chainNamespace: CHAIN_NAMESPACE.Evm,
chainReference: CHAIN_REFERENCE.RobinhoodMainnet,
assetNamespace: 'erc20',
assetReference: platforms[CoingeckoAssetPlatform.Robinhood],
})
prev[robinhoodChainId][assetId] = id
} catch {
// unable to create assetId, skip token
}
}

return prev
},
{
Expand Down Expand Up @@ -707,6 +723,7 @@ export const parseData = (coins: CoingeckoCoin[]): AssetMap => {
[suiChainId]: { [suiAssetId]: 'sui' },
[nearChainId]: { [nearAssetId]: 'near' },
[tonChainId]: { [tonAssetId]: 'the-open-network' },
[robinhoodChainId]: { [robinhoodAssetId]: 'ethereum' },
},
)

Expand Down
5 changes: 5 additions & 0 deletions packages/caip/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const ltcAssetId: AssetId = 'bip122:12a765e31ffd4059bada1e25190f6e98/slip
export const zecAssetId: AssetId = 'bip122:00040fe8ec8471911baa1db1266ea15d/slip44:133'

export const ethAssetId: AssetId = 'eip155:1/slip44:60'
export const robinhoodAssetId: AssetId = 'eip155:4663/slip44:60'
export const abstractAssetId: AssetId = 'eip155:2741/slip44:60'
export const avalancheAssetId: AssetId = 'eip155:43114/slip44:60'
export const optimismAssetId: AssetId = 'eip155:10/slip44:60'
Expand Down Expand Up @@ -97,6 +98,7 @@ export const ltcChainId: ChainId = 'bip122:12a765e31ffd4059bada1e25190f6e98'
export const zecChainId: ChainId = 'bip122:00040fe8ec8471911baa1db1266ea15d'

export const ethChainId: ChainId = 'eip155:1'
export const robinhoodChainId: ChainId = 'eip155:4663'
export const abstractChainId: ChainId = 'eip155:2741'
export const avalancheChainId: ChainId = 'eip155:43114'
export const optimismChainId: ChainId = 'eip155:10'
Expand Down Expand Up @@ -211,6 +213,7 @@ export const CHAIN_REFERENCE = {
StarknetMainnet: 'SN_MAIN', // https://namespaces.chainagnostic.org/starknet/caip2
TonMainnet: 'mainnet', // TON Mainnet
AbstractMainnet: '2741', // https://abscan.org
RobinhoodMainnet: '4663', // https://robinhoodchain.blockscout.com
} as const

export const ASSET_NAMESPACE = {
Expand Down Expand Up @@ -278,6 +281,7 @@ export const ASSET_REFERENCE = {
Starknet: '9004',
Ton: '607',
Abstract: '60', // evm chain which uses ethereum derivation path as common practice
Robinhood: '60', // evm chain which uses ethereum derivation path as common practice
} as const

export const VALID_CHAIN_IDS: ValidChainMap = Object.freeze({
Expand Down Expand Up @@ -324,6 +328,7 @@ export const VALID_CHAIN_IDS: ValidChainMap = Object.freeze({
CHAIN_REFERENCE.SeiMainnet,
CHAIN_REFERENCE.CeloMainnet,
CHAIN_REFERENCE.AbstractMainnet,
CHAIN_REFERENCE.RobinhoodMainnet,
],
[CHAIN_NAMESPACE.CosmosSdk]: [
CHAIN_REFERENCE.CosmosHubMainnet,
Expand Down
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 @@ -36,6 +36,7 @@ import {
supportsPlasma,
supportsPlume,
supportsPolygon,
supportsRobinhood,
supportsScroll,
supportsSei,
supportsSoneium,
Expand Down Expand Up @@ -135,6 +136,7 @@ export const evmChainIds = [
KnownChainIds.SoneiumMainnet,
KnownChainIds.SeiMainnet,
KnownChainIds.AbstractMainnet,
KnownChainIds.RobinhoodMainnet,
] as const

export type EvmChainAdapter = EvmBaseAdapter<EvmChainId>
Expand Down Expand Up @@ -283,6 +285,8 @@ export abstract class EvmBaseAdapter<T extends EvmChainId> implements IChainAdap
return supportsSoneium(wallet)
case Number(fromChainId(KnownChainIds.SeiMainnet).chainReference):
return supportsSei(wallet)
case Number(fromChainId(KnownChainIds.RobinhoodMainnet).chainReference):
return supportsRobinhood(wallet)
default:
return false
}
Expand Down Expand Up @@ -490,6 +494,11 @@ export abstract class EvmBaseAdapter<T extends EvmChainId> implements IChainAdap
symbol: 'ETH',
explorer: 'https://abscan.org',
},
[KnownChainIds.RobinhoodMainnet]: {
name: 'Ethereum',
symbol: 'ETH',
explorer: 'https://robinhoodchain.blockscout.com',
},
}[this.chainId]

try {
Expand Down
2 changes: 2 additions & 0 deletions packages/chain-adapters/src/evm/SecondClassEvmAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
mantleChainId,
modeChainId,
plumeChainId,
robinhoodChainId,
seiChainId,
soneiumChainId,
sonicChainId,
Expand Down Expand Up @@ -75,6 +76,7 @@ const WRAPPED_NATIVE_CONTRACT_BY_CHAIN_ID: Partial<Record<ChainId, string>> = {
[storyChainId]: '0x1514000000000000000000000000000000000000',
[plumeChainId]: '0xea237441c92cae6fc17caaf9a7acb3f953be4bd1',
[seiChainId]: '0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7',
[robinhoodChainId]: '0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73',
}
const BATCH_SIZE = 500

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 @@ -40,3 +40,4 @@ export * as bob from './bob'
export * as mode from './mode'
export * as soneium from './soneium'
export * as sei from './sei'
export * as robinhood from './robinhood'
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import type { AssetId } from '@shapeshiftoss/caip'
import { ASSET_REFERENCE, robinhoodAssetId } from '@shapeshiftoss/caip'
import type { RootBip44Params } from '@shapeshiftoss/types'
import { KnownChainIds } from '@shapeshiftoss/types'

import { ChainAdapterDisplayName } from '../../types'
import type { TokenInfo } from '../SecondClassEvmAdapter'
import { SecondClassEvmAdapter } from '../SecondClassEvmAdapter'

const SUPPORTED_CHAIN_IDS = [KnownChainIds.RobinhoodMainnet]
const DEFAULT_CHAIN_ID = KnownChainIds.RobinhoodMainnet

export type ChainAdapterArgs = {
rpcUrl: string
getKnownTokens: () => TokenInfo[]
}

export const isRobinhoodChainAdapter = (adapter: unknown): adapter is ChainAdapter => {
return (adapter as ChainAdapter).getType() === KnownChainIds.RobinhoodMainnet
}

export class ChainAdapter extends SecondClassEvmAdapter<KnownChainIds.RobinhoodMainnet> {
public static readonly rootBip44Params: RootBip44Params = {
purpose: 44,
coinType: Number(ASSET_REFERENCE.Robinhood),
accountNumber: 0,
}

constructor(args: ChainAdapterArgs) {
super({
assetId: robinhoodAssetId,
chainId: DEFAULT_CHAIN_ID,
rootBip44Params: ChainAdapter.rootBip44Params,
supportedChainIds: SUPPORTED_CHAIN_IDS,
rpcUrl: args.rpcUrl,
getKnownTokens: args.getKnownTokens,
})
}

getDisplayName() {
return ChainAdapterDisplayName.Robinhood
}

getName() {
return 'Robinhood'
}

getType(): KnownChainIds.RobinhoodMainnet {
return KnownChainIds.RobinhoodMainnet
}

getFeeAssetId(): AssetId {
return this.assetId
}
}

export type { TokenInfo }
1 change: 1 addition & 0 deletions packages/chain-adapters/src/evm/robinhood/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './RobinhoodChainAdapter'
Loading