Skip to content

Commit

Permalink
feat(suite): add Arbitrum one
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Dec 20, 2024
1 parent 917bc6f commit d800b0e
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/address-validator/src/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,11 @@ var CURRENCIES = [
symbol: 'bnb',
validator: ETHValidator,
},
{
name: 'Arbitrum One',
symbol: 'arb', // TODO
validator: ETHValidator,
},
{
name: 'Base',
symbol: 'base', // TODO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type LegacyNetworkSymbol = 'eos' | 'nem' | 'xlm' | 'xtz';

export const COINS: Record<NetworkSymbol | LegacyNetworkSymbol, string> = {
ada: require('../../images/coins/ada.svg'),
arb: require('../../images/coins/arb.svg'),
base: require('../../images/coins/base.svg'),
bch: require('../../images/coins/bch.svg'),
bnb: require('../../images/coins/bnb.svg'),
Expand Down
17 changes: 17 additions & 0 deletions packages/product-components/src/images/coins/arb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2822,6 +2822,10 @@ export default defineMessages({
defaultMessage: 'BNB Smart Chain',
id: 'TR_NETWORK_BNB',
},
TR_NETWORK_ARBITRUM_ONE: {
defaultMessage: 'Arbitrum One',
id: 'TR_NETWORK_ARBITRUM_ONE',
},
TR_NETWORK_BASE: {
defaultMessage: 'Base',
id: 'TR_NETWORK_BASE',
Expand Down
1 change: 1 addition & 0 deletions packages/theme/src/coinsColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type CoinsColors = Record<NetworkSymbol, CSSColor>;

export const coinsColors: CoinsColors = {
ada: '#3468d1',
arb: '#213147',
base: '#0052ff',
bch: '#0ac18e',
bnb: '#f0b90b',
Expand Down
17 changes: 17 additions & 0 deletions suite-common/icons-deprecated/assets/cryptoIcons/arb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions suite-common/icons-deprecated/src/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export type IconName = keyof typeof icons;

export const cryptoIcons = {
ada: require('../assets/cryptoIcons/ada.svg'),
arb: require('../assets/cryptoIcons/arb.svg'),
base: require('../assets/cryptoIcons/base.svg'),
bch: require('../assets/cryptoIcons/bch.svg'),
bnb: require('../assets/cryptoIcons/bnb.svg'),
Expand Down
17 changes: 17 additions & 0 deletions suite-common/icons/cryptoAssets/cryptoIcons/arb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions suite-common/icons/src/cryptoIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

export const cryptoIcons = {
ada: require('../cryptoAssets/cryptoIcons/ada.svg'),
arb: require('../cryptoAssets/cryptoIcons/arb.svg'),
base: require('../cryptoAssets/cryptoIcons/base.svg'),
bch: require('../cryptoAssets/cryptoIcons/bch.svg'),
bnb: require('../cryptoAssets/cryptoIcons/bnb.svg'),
Expand Down
5 changes: 5 additions & 0 deletions suite-common/suite-constants/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export type Protocol =
| 'sol'
| 'pol'
| 'bnb'
| 'arbitrum'
| 'arbitrum-one'
| 'arb'
| 'arbitrum-ethereum'
| 'base'
| 'op'
| 'test'
Expand Down Expand Up @@ -67,6 +71,7 @@ export const NETWORK_TO_PROTOCOLS: Record<NetworkSymbol, Protocol[]> = {
sol: ['solana', 'sol'],
pol: ['polygon', 'matic', 'pol'],
bnb: ['binance', 'bnb', 'bsc'],
arb: ['arbitrum', 'arbitrum-one', 'arb', 'arbitrum-ethereum'],
base: ['base'],
op: ['optimism', 'op'],
test: ['test'],
Expand Down
25 changes: 24 additions & 1 deletion suite-common/wallet-config/src/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,29 @@ export const networks = {
coingeckoId: 'binance-smart-chain',
coingeckoNativeId: 'binancecoin',
},
arb: {
symbol: 'arb',
name: 'Arbitrum One',
networkType: 'ethereum',
chainId: 42161,
bip43Path: "m/44'/60'/0'/0/i",
decimals: 18,
testnet: false,
explorer: getExplorerUrls('https://arbiscan.io', 'ethereum'),
features: ['rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions'],
backendTypes: ['blockbook'],
accountTypes: {
ledger: {
// ledger (live), #1 acc is same as Trezor, so it is skipped
accountType: 'ledger',
bip43Path: "m/44'/60'/i'/0/0",
isDebugOnlyAccountType: true,
},
},
coingeckoId: 'arbitrum-one',
coingeckoNativeId: 'ethereum',
isDebugOnlyNetwork: true,
},
base: {
symbol: 'base',
name: 'Base',
Expand Down Expand Up @@ -191,7 +214,7 @@ export const networks = {
bip43Path: "m/44'/60'/0'/0/i",
decimals: 18,
testnet: false,
explorer: getExplorerUrls('https://op1.trezor.io', 'ethereum'),
explorer: getExplorerUrls('https://optimistic.etherscan.io', 'ethereum'),
features: ['rbf', 'sign-verify', 'tokens', 'nfts', 'coin-definitions', 'nft-definitions'],
backendTypes: ['blockbook'],
accountTypes: {
Expand Down
1 change: 1 addition & 0 deletions suite-common/wallet-config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type NetworkSymbol =
| 'sol'
| 'pol'
| 'bnb'
| 'arb'
| 'base'
| 'op'
| 'test'
Expand Down
1 change: 1 addition & 0 deletions suite-common/wallet-utils/src/__fixtures__/accountUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const accountTitleFixture: Array<{
{ symbol: 'zec', title: 'TR_NETWORK_ZCASH' },
{ symbol: 'eth', title: 'TR_NETWORK_ETHEREUM' },
{ symbol: 'bnb', title: 'TR_NETWORK_BNB' },
{ symbol: 'arb', title: 'TR_NETWORK_ARBITRUM_ONE' },
{ symbol: 'base', title: 'TR_NETWORK_BASE' },
{ symbol: 'op', title: 'TR_NETWORK_OP' },
{ symbol: 'etc', title: 'TR_NETWORK_ETHEREUM_CLASSIC' },
Expand Down
2 changes: 2 additions & 0 deletions suite-common/wallet-utils/src/accountUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ export const getTitleForNetwork = (symbol: NetworkSymbolExtended) => {
return 'TR_NETWORK_ETHEREUM';
case 'bnb':
return 'TR_NETWORK_BNB';
case 'arb':
return 'TR_NETWORK_ARBITRUM_ONE';
case 'base':
return 'TR_NETWORK_BASE';
case 'op':
Expand Down

0 comments on commit d800b0e

Please sign in to comment.