@shapeshiftoss/utils 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  import type { Asset } from '@shapeshiftoss/types';
2
+ export declare const robinhood: Readonly<Asset>;
2
3
  export declare const abstract: Readonly<Asset>;
3
4
  export declare const ethereum: Readonly<Asset>;
4
5
  export declare const bitcoin: Readonly<Asset>;
@@ -1,4 +1,20 @@
1
1
  import * as caip from '@shapeshiftoss/caip';
2
+ export const robinhood = Object.freeze({
3
+ assetId: caip.robinhoodAssetId,
4
+ chainId: caip.robinhoodChainId,
5
+ name: 'Ethereum',
6
+ networkName: 'Robinhood',
7
+ symbol: 'ETH',
8
+ precision: 18,
9
+ color: '#00C805',
10
+ networkColor: '#00C805',
11
+ icon: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
12
+ networkIcon: 'https://assets.relay.link/icons/4663/light.png',
13
+ explorer: 'https://robinhoodchain.blockscout.com',
14
+ explorerAddressLink: 'https://robinhoodchain.blockscout.com/address/',
15
+ explorerTxLink: 'https://robinhoodchain.blockscout.com/tx/',
16
+ relatedAssetKey: 'eip155:1/slip44:60',
17
+ });
2
18
  export const abstract = Object.freeze({
3
19
  assetId: caip.abstractAssetId,
4
20
  chainId: caip.abstractChainId,
@@ -1,6 +1,6 @@
1
1
  import { KnownChainIds } from '@shapeshiftoss/types';
2
2
  import { assertUnreachable } from '../assertUnreachable.js';
3
- import { abstract, arbitrum, atom, avax, base, berachain, bitcoin, bitcoincash, blast, bnbsmartchain, bobChain, celo, cronos, dogecoin, ethereal, ethereum, flowEvm, gnosis, hemi, hyperevm, ink, katana, linea, litecoin, mantle, mayachain, megaeth, modeChain, monad, near, optimism, plasma, plume, polygon, scroll, sei, solana, soneium, sonic, starknet, story, sui, thorchain, ton, tron, unichainChain, worldchain, zcash, zkSyncEra, } from './baseAssets.js';
3
+ import { abstract, arbitrum, atom, avax, base, berachain, bitcoin, bitcoincash, blast, bnbsmartchain, bobChain, celo, cronos, dogecoin, ethereal, ethereum, flowEvm, gnosis, hemi, hyperevm, ink, katana, linea, litecoin, mantle, mayachain, megaeth, modeChain, monad, near, optimism, plasma, plume, polygon, robinhood, scroll, sei, solana, soneium, sonic, starknet, story, sui, thorchain, ton, tron, unichainChain, worldchain, zcash, zkSyncEra, } from './baseAssets.js';
4
4
  export const getBaseAsset = (chainId) => {
5
5
  const knownChainId = chainId;
6
6
  switch (knownChainId) {
@@ -102,6 +102,8 @@ export const getBaseAsset = (chainId) => {
102
102
  return ton;
103
103
  case KnownChainIds.AbstractMainnet:
104
104
  return abstract;
105
+ case KnownChainIds.RobinhoodMainnet:
106
+ return robinhood;
105
107
  default:
106
108
  return assertUnreachable(knownChainId);
107
109
  }
@@ -1,4 +1,4 @@
1
- import { abstractAssetId, arbitrumAssetId, avalancheAssetId, baseAssetId, bchAssetId, berachainAssetId, blastAssetId, bobAssetId, bscAssetId, btcAssetId, celoAssetId, cosmosAssetId, cronosAssetId, dogeAssetId, ethAssetId, etherealAssetId, flowEvmAssetId, gnosisAssetId, hemiAssetId, hyperEvmAssetId, inkAssetId, katanaAssetId, lineaAssetId, ltcAssetId, mantleAssetId, mayachainAssetId, megaethAssetId, modeAssetId, monadAssetId, nearAssetId, optimismAssetId, plasmaAssetId, plumeAssetId, polygonAssetId, scrollAssetId, seiAssetId, solAssetId, soneiumAssetId, sonicAssetId, starknetAssetId, storyAssetId, suiAssetId, thorchainAssetId, tonAssetId, tronAssetId, unichainAssetId, worldChainAssetId, zecAssetId, zkSyncEraAssetId, } from '@shapeshiftoss/caip';
1
+ import { abstractAssetId, arbitrumAssetId, avalancheAssetId, baseAssetId, bchAssetId, berachainAssetId, blastAssetId, bobAssetId, bscAssetId, btcAssetId, celoAssetId, cosmosAssetId, cronosAssetId, dogeAssetId, ethAssetId, etherealAssetId, flowEvmAssetId, gnosisAssetId, hemiAssetId, hyperEvmAssetId, inkAssetId, katanaAssetId, lineaAssetId, ltcAssetId, mantleAssetId, mayachainAssetId, megaethAssetId, modeAssetId, monadAssetId, nearAssetId, optimismAssetId, plasmaAssetId, plumeAssetId, polygonAssetId, robinhoodAssetId, scrollAssetId, seiAssetId, solAssetId, soneiumAssetId, sonicAssetId, starknetAssetId, storyAssetId, suiAssetId, thorchainAssetId, tonAssetId, tronAssetId, unichainAssetId, worldChainAssetId, zecAssetId, zkSyncEraAssetId, } from '@shapeshiftoss/caip';
2
2
  import { KnownChainIds } from '@shapeshiftoss/types';
3
3
  import { assertUnreachable } from './assertUnreachable.js';
4
4
  export const chainIdToFeeAssetId = (_chainId) => {
@@ -102,6 +102,8 @@ export const chainIdToFeeAssetId = (_chainId) => {
102
102
  return tonAssetId;
103
103
  case KnownChainIds.AbstractMainnet:
104
104
  return abstractAssetId;
105
+ case KnownChainIds.RobinhoodMainnet:
106
+ return robinhoodAssetId;
105
107
  default:
106
108
  return assertUnreachable(chainId);
107
109
  }
@@ -46,6 +46,7 @@ export const getAssetNamespaceFromChainId = (chainId) => {
46
46
  case KnownChainIds.FlowEvmMainnet:
47
47
  case KnownChainIds.CeloMainnet:
48
48
  case KnownChainIds.AbstractMainnet:
49
+ case KnownChainIds.RobinhoodMainnet:
49
50
  return ASSET_NAMESPACE.erc20;
50
51
  case KnownChainIds.StarknetMainnet:
51
52
  return ASSET_NAMESPACE.starknetToken;
@@ -1,2 +1,2 @@
1
1
  import { KnownChainIds } from '@shapeshiftoss/types';
2
- export declare const getChainShortName: (chainId: KnownChainIds) => "AVA" | "OP" | "ETH" | "POLY" | "GNO" | "BNB" | "ARB" | "BAS" | "BTC" | "BCH" | "COSM" | "THOR" | "MAYA" | "DOGE" | "LTC" | "SOL" | "TRX" | "SUI" | "STRK" | "MON" | "HYPE" | "XPL" | "MNT" | "INK" | "MEGA" | "BERA" | "CRO" | "KAT" | "ETRL" | "FLOW" | "CELO" | "PLUME" | "STORY" | "ZKS" | "BLAST" | "WLD" | "HEM" | "SEI" | "LIN" | "SCR" | "S" | "UNI" | "BOB" | "MODE" | "SON" | "ZEC" | "NEAR" | "TON" | "ABS" | undefined;
2
+ export declare const getChainShortName: (chainId: KnownChainIds) => "AVA" | "OP" | "ETH" | "POLY" | "GNO" | "BNB" | "ARB" | "BAS" | "BTC" | "BCH" | "COSM" | "THOR" | "MAYA" | "DOGE" | "LTC" | "SOL" | "TRX" | "SUI" | "STRK" | "MON" | "HYPE" | "XPL" | "MNT" | "INK" | "MEGA" | "BERA" | "CRO" | "KAT" | "ETRL" | "FLOW" | "CELO" | "PLUME" | "STORY" | "ZKS" | "BLAST" | "WLD" | "HEM" | "SEI" | "LIN" | "SCR" | "S" | "UNI" | "BOB" | "MODE" | "SON" | "ZEC" | "NEAR" | "TON" | "ABS" | "RH" | undefined;
@@ -100,6 +100,8 @@ export const getChainShortName = (chainId) => {
100
100
  return 'TON';
101
101
  case KnownChainIds.AbstractMainnet:
102
102
  return 'ABS';
103
+ case KnownChainIds.RobinhoodMainnet:
104
+ return 'RH';
103
105
  default: {
104
106
  assertUnreachable(chainId);
105
107
  }
@@ -89,6 +89,8 @@ export const getNativeFeeAssetReference = (chainNamespace, chainReference) => {
89
89
  return ASSET_REFERENCE.Mode;
90
90
  case CHAIN_REFERENCE.SoneiumMainnet:
91
91
  return ASSET_REFERENCE.Soneium;
92
+ case CHAIN_REFERENCE.RobinhoodMainnet:
93
+ return ASSET_REFERENCE.Robinhood;
92
94
  default:
93
95
  throw new Error(`Chain namespace ${chainNamespace} on ${chainReference} not supported.`);
94
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/utils",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "repository": "https://github.com/shapeshift/web",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,8 +25,8 @@
25
25
  "bignumber.js": "^9.3.1",
26
26
  "dayjs": "^1.11.3",
27
27
  "lodash-es": "^4.17.23",
28
- "@shapeshiftoss/caip": "^8.16.9",
29
- "@shapeshiftoss/types": "^8.6.8"
28
+ "@shapeshiftoss/caip": "^8.16.10",
29
+ "@shapeshiftoss/types": "^9.0.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/lodash-es": "^4.17.12"