Skip to content

Commit

Permalink
chore(suite): rename custom backends to backend types
Browse files Browse the repository at this point in the history
  • Loading branch information
enjojoy committed Dec 19, 2024
1 parent ea4a3d8 commit c394d2e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Capitalize = styled.span`
const useBackendOptions = (network: Network) =>
useMemo(
() =>
['default', ...network.customBackends]
['default', ...network.backendTypes]
.filter(backend => {
switch (backend) {
case 'default':
Expand Down
52 changes: 26 additions & 26 deletions suite-common/wallet-config/src/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const networks = {
address: 'https://btc1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'amount-unit'],
customBackends: ['blockbook', 'electrum'],
backendTypes: ['blockbook', 'electrum'],
accountTypes: {
coinjoin: {
accountType: 'coinjoin',
Expand Down Expand Up @@ -63,7 +63,7 @@ export const networks = {
'nft-definitions',
'staking',
],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
ledger: {
// ledger (live), #1 acc is same as Trezor, so it is skipped
Expand Down Expand Up @@ -96,7 +96,7 @@ export const networks = {
address: 'https://pol1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'tokens', 'coin-definitions', 'nft-definitions'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
ledger: {
// ledger (live), #1 acc is same as Trezor, so it is skipped
Expand All @@ -123,7 +123,7 @@ export const networks = {
address: 'https://bsc1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'tokens', 'coin-definitions', 'nft-definitions'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
ledger: {
// ledger (live), #1 acc is same as Trezor, so it is skipped
Expand All @@ -150,7 +150,7 @@ export const networks = {
address: 'https://basescan.org/address/',
},
features: ['rbf', 'sign-verify', 'tokens', 'coin-definitions', 'nft-definitions'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
ledger: {
// ledger (live), #1 acc is same as Trezor, so it is skipped
Expand Down Expand Up @@ -178,7 +178,7 @@ export const networks = {
address: 'https://op1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'tokens', 'coin-definitions', 'nft-definitions'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
ledger: {
// ledger (live), #1 acc is same as Trezor, so it is skipped
Expand Down Expand Up @@ -211,7 +211,7 @@ export const networks = {
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['solana'],
backendTypes: ['solana'],
accountTypes: {
ledger: {
// bip44Change - Ledger Live
Expand Down Expand Up @@ -245,7 +245,7 @@ export const networks = {
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['blockfrost'],
backendTypes: ['blockfrost'],
accountTypes: {
legacy: {
// icarus-trezor derivation, differs from default just for 24 words seed
Expand Down Expand Up @@ -278,7 +278,7 @@ export const networks = {
address: 'https://etc1.trezor.io/address/',
},
features: ['sign-verify', 'tokens', 'coin-definitions'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: 'ethereum-classic',
coingeckoNativeId: 'ethereum-classic',
Expand All @@ -296,7 +296,7 @@ export const networks = {
address: 'https://xrpscan.com/account/',
},
features: [],
customBackends: ['ripple'],
backendTypes: ['ripple'],
accountTypes: {},
coingeckoId: 'ripple',
coingeckoNativeId: 'ripple',
Expand All @@ -314,7 +314,7 @@ export const networks = {
address: 'https://ltc1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
segwit: {
accountType: 'segwit',
Expand All @@ -341,7 +341,7 @@ export const networks = {
address: 'https://bch1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: 'bitcoin-cash',
coingeckoNativeId: 'bitcoin-cash',
Expand All @@ -359,7 +359,7 @@ export const networks = {
address: 'https://doge1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: 'dogecoin',
coingeckoNativeId: 'dogecoin',
Expand All @@ -377,7 +377,7 @@ export const networks = {
address: 'https://zec1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: 'zcash',
coingeckoNativeId: 'zcash',
Expand All @@ -395,7 +395,7 @@ export const networks = {
address: 'https://dash1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: 'dash',
coingeckoNativeId: 'dash',
Expand All @@ -413,7 +413,7 @@ export const networks = {
address: 'https://btg1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
legacy: {
accountType: 'legacy',
Expand All @@ -436,7 +436,7 @@ export const networks = {
address: 'https://dgb1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
legacy: {
accountType: 'legacy',
Expand All @@ -459,7 +459,7 @@ export const networks = {
address: 'https://nmc1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: 'namecoin',
coingeckoNativeId: 'namecoin',
Expand All @@ -477,7 +477,7 @@ export const networks = {
address: 'https://vtc1.trezor.io/address/',
},
features: ['sign-verify'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {
segwit: {
accountType: 'segwit',
Expand Down Expand Up @@ -505,7 +505,7 @@ export const networks = {
address: 'https://tbtc1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'amount-unit'],
customBackends: ['blockbook', 'electrum'],
backendTypes: ['blockbook', 'electrum'],
accountTypes: {
coinjoin: {
accountType: 'coinjoin',
Expand Down Expand Up @@ -543,7 +543,7 @@ export const networks = {
address: 'http://localhost:19121/address/',
},
features: ['rbf', 'sign-verify', 'amount-unit'],
customBackends: ['blockbook', 'electrum'],
backendTypes: ['blockbook', 'electrum'],
accountTypes: {
coinjoin: {
accountType: 'coinjoin',
Expand Down Expand Up @@ -584,7 +584,7 @@ export const networks = {
address: 'https://sepolia1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'tokens'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: undefined,
coingeckoNativeId: undefined,
Expand All @@ -604,7 +604,7 @@ export const networks = {
address: 'https://holesky1.trezor.io/address/',
},
features: ['rbf', 'sign-verify', 'tokens', 'staking'],
customBackends: ['blockbook'],
backendTypes: ['blockbook'],
accountTypes: {},
coingeckoId: undefined,
coingeckoNativeId: undefined,
Expand All @@ -630,7 +630,7 @@ export const networks = {
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['solana'],
backendTypes: ['solana'],
accountTypes: {},
coingeckoId: undefined,
coingeckoNativeId: undefined,
Expand All @@ -657,7 +657,7 @@ export const networks = {
[DeviceModelInternal.T3T1]: '2.0.0',
[DeviceModelInternal.T3W1]: '2.0.0',
},
customBackends: ['blockfrost'],
backendTypes: ['blockfrost'],
accountTypes: {
legacy: {
// icarus-trezor derivation
Expand Down Expand Up @@ -686,7 +686,7 @@ export const networks = {
address: 'https://test.bithomp.com/explorer/',
},
features: ['tokens'],
customBackends: [],
backendTypes: [],
accountTypes: {},
coingeckoId: undefined,
coingeckoNativeId: 'test-ripple', // fake, coingecko does not have testnets
Expand Down
2 changes: 1 addition & 1 deletion suite-common/wallet-config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ type NetworkWithSpecificKey<TKey extends NetworkSymbol> = {
isHidden?: boolean; // not used here, but supported elsewhere
chainId?: number;
features: NetworkFeature[];
customBackends: BackendType[];
backendTypes: BackendType[];
support?: NetworkDeviceSupport;
isDebugOnlyNetwork?: boolean;
coingeckoId?: string;
Expand Down
2 changes: 1 addition & 1 deletion suite-common/wallet-config/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const normalizeNetworkAccounts = (network: Network): NormalizedNetworkAcc
};

export const isBlockbookBasedNetwork = (symbol: NetworkSymbol) =>
networks[symbol]?.customBackends.some(backend => backend === 'blockbook');
networks[symbol]?.backendTypes.some(backend => backend === 'blockbook');

export const getNetworkType = (symbol: NetworkSymbol) => networks[symbol]?.networkType;

Expand Down

0 comments on commit c394d2e

Please sign in to comment.