Skip to content

Commit

Permalink
feat(suite): add optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasklim committed Aug 6, 2024
1 parent 038a294 commit 3e1f011
Show file tree
Hide file tree
Showing 13 changed files with 121 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 @@ -1445,6 +1445,11 @@ var CURRENCIES = [
symbol: 'bnb',
validator: ETHValidator,
},
{
name: 'Optimism',
symbol: 'eth',
validator: ETHValidator,
},
{
name: 'EOS',
symbol: 'eos',
Expand Down
22 changes: 22 additions & 0 deletions packages/blockchain-link/src/ui/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,28 @@ export default [
subscribe: '',
},
},
{
blockchain: {
name: 'Optimism',
worker: 'js/blockbook-worker.js',
server: ['https://blockbook-dev.corp.sldev.cz:9302'],
debug: true,
},
data: {
address: '',
accountInfoOptions: {
page: 1,
pageSize: 25,
contractFilter: undefined,
},
estimateFeeOptions: {
blocks: [1, 2, 10],
},
txid: '',
tx: '',
subscribe: '',
},
},
{
blockchain: {
name: 'Ethereum Classic',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export const COINS = {
ada: require('../../../images/coins/ada.svg'),
bch: require('../../../images/coins/bch.svg'),
bnb: require('../../../images/coins/bnb.svg'),
op: require('../../../images/coins/op.svg'),
btc: require('../../../images/coins/btc.svg'),
test: require('../../../images/coins/btctestnet.svg'),
regtest: require('../../../images/coins/btctestnet.svg'),
Expand Down
21 changes: 21 additions & 0 deletions packages/components/src/images/coins/op.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions packages/connect-common/files/coins-eth.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,27 @@
"suite": true
}
},
{
"blockchain_link": {
"type": "blockbook",
"url": ["https://blockbook-dev.corp.sldev.cz:9302"]
},
"chain": "op",
"chain_id": 10,
"coingecko_id": "optimistic-ethereum",
"is_testnet": false,
"name": "Optimism",
"shortcut": "ETH",
"slip44": 1,
"support": {
"T1B1": "1.9.4",
"T2B1": "2.6.1",
"T2T1": "2.4.0",
"T3T1": "2.6.1",
"connect": true,
"suite": true
}
},
{
"blockchain_link": {
"type": "blockbook",
Expand Down
4 changes: 4 additions & 0 deletions packages/suite/src/support/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2904,6 +2904,10 @@ export default defineMessages({
defaultMessage: 'BNB Smart Chain',
id: 'TR_NETWORK_BNB',
},
TR_NETWORK_OP: {
defaultMessage: 'Optimism',
id: 'TR_NETWORK_OP',
},
TR_NETWORK_LITECOIN: {
defaultMessage: 'Litecoin',
id: 'TR_NETWORK_LITECOIN',
Expand Down
21 changes: 21 additions & 0 deletions suite-common/icons/assets/cryptoIcons/op.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/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const cryptoIcons = {
etc: require('../assets/cryptoIcons/etc.svg'),
eth: require('../assets/cryptoIcons/eth.svg'),
bnb: require('../assets/cryptoIcons/bnb.svg'),
op: require('../assets/cryptoIcons/op.svg'),
gnt: require('../assets/cryptoIcons/gnt.svg'),
ltc: require('../assets/cryptoIcons/ltc.svg'),
matic: require('../assets/cryptoIcons/matic.svg'),
Expand Down
20 changes: 20 additions & 0 deletions suite-common/wallet-config/src/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,26 @@ export const networks = {
accountTypes: {},
coingeckoId: 'binance-smart-chain',
},
op: {
name: 'Optimism',
networkType: 'ethereum',
chainId: 10,
bip43Path: "m/44'/60'/0'/0/i",
decimals: 18,
testnet: false,
explorer: {
tx: 'https://blockbook-dev.corp.sldev.cz:9302/tx/',
account: 'https://blockbook-dev.corp.sldev.cz:9302/address/',
nft: 'https://blockbook-dev.corp.sldev.cz:9302/nft/',
address: 'https://blockbook-dev.corp.sldev.cz:9302/address/',
queryString: '',
},
features: ['rbf', 'sign-verify', 'tokens', 'coin-definitions', 'nft-definitions'],
customBackends: ['blockbook'],
accountTypes: {},
coingeckoId: 'optimistic-ethereum',
isDebugOnly: true,
},
// testnets
test: {
name: 'Bitcoin Testnet',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const DEFAULT_ACCOUNT_SYNC_INTERVAL = 60 * 1000;
const CUSTOM_ACCOUNT_SYNC_INTERVALS: Partial<Record<NetworkSymbol, number>> = {
matic: 20 * 1000,
bnb: 20 * 1000,
op: 20 * 1000,
};

const getAccountSyncInterval = (symbol: NetworkSymbol) =>
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 @@ -63,6 +63,7 @@ export const accountTitleFixture = [
{ symbol: 'zec', title: 'TR_NETWORK_ZCASH' },
{ symbol: 'eth', title: 'TR_NETWORK_ETHEREUM' },
{ symbol: 'bnb', title: 'TR_NETWORK_BNB' },
{ symbol: 'op', title: 'TR_NETWORK_OP' },
{ symbol: 'etc', title: 'TR_NETWORK_ETHEREUM_CLASSIC' },
{ symbol: 'xem', title: 'TR_NETWORK_NEM' },
{ symbol: 'xlm', title: 'TR_NETWORK_STELLAR' },
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 @@ -154,6 +154,8 @@ export const getTitleForNetwork = (symbol: NetworkSymbol) => {
return 'TR_NETWORK_ETHEREUM';
case 'bnb':
return 'TR_NETWORK_BNB';
case 'op':
return 'TR_NETWORK_OP';
case 'tsep':
return 'TR_NETWORK_ETHEREUM_SEPOLIA';
case 'thol':
Expand Down
2 changes: 1 addition & 1 deletion suite-native/config/src/supportedNetworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const orderedAccountTypes: AccountType[] = [
'ledger',
];

const discoveryBlacklist: NetworkSymbol[] = ['sol', 'dsol', 'matic', 'bnb'];
const discoveryBlacklist: NetworkSymbol[] = ['sol', 'dsol', 'matic', 'bnb', 'op'];

// All supported coins for device discovery
export const networkSymbolsWhitelistMap = {
Expand Down

0 comments on commit 3e1f011

Please sign in to comment.