Skip to content
Merged
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
4 changes: 4 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export const enum CoinFeature {
* For example, Ethereum's ERC 20 token standard means that it supports tokens, so it shall have this feature.
*/
SUPPORTS_TOKENS = 'supports-tokens',
/*
* Are fees for transactions of this coin paid for by the Enterprise (eg, Enterprise gas tank)?
*/
ENTERPRISE_PAYS_FEES = 'enterprise-pays-fees',
}

/**
Expand Down
7 changes: 4 additions & 3 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import { Networks } from './networks';
import { ofc, tofc, ofcerc20, tofcerc20 } from './ofc';
import { utxo } from './utxo';

const ETH_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS];
const ETH_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS, CoinFeature.ENTERPRISE_PAYS_FEES];
const XLM_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.SUPPORTS_TOKENS];
const XTZ_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.ENTERPRISE_PAYS_FEES];

export const coins = CoinMap.fromCoins([
utxo('bch', 'Bitcoin Cash', Networks.main.bitcoinCash, UnderlyingAsset.BCH),
Expand Down Expand Up @@ -34,8 +35,8 @@ export const coins = CoinMap.fromCoins([
account('txrp', 'Testnet Ripple', Networks.test.xrp, 6, UnderlyingAsset.XRP),
account('xlm', 'Stellar', Networks.main.stellar, 7, UnderlyingAsset.XLM, XLM_FEATURES),
account('txlm', 'Testnet Stellar', Networks.test.stellar, 7, UnderlyingAsset.XLM, XLM_FEATURES),
account('xtz', 'Tezos', Networks.main.xtz, 6, UnderlyingAsset.XTZ),
account('txtz', 'Testnet Tezos Babylonnet', Networks.test.xtz, 6, UnderlyingAsset.XTZ),
account('xtz', 'Tezos', Networks.main.xtz, 6, UnderlyingAsset.XTZ, XTZ_FEATURES),
account('txtz', 'Testnet Tezos Babylonnet', Networks.test.xtz, 6, UnderlyingAsset.XTZ, XTZ_FEATURES),
account('susd', 'Silvergate USD', Networks.main.susd, 2, UnderlyingAsset.USD),
account('tsusd', 'Testnet Silvergate USD', Networks.test.susd, 2, UnderlyingAsset.USD),
ofc('ofcusd', 'USD', 2, UnderlyingAsset.USD, CoinKind.FIAT),
Expand Down
11 changes: 10 additions & 1 deletion modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ export interface UtxoNetwork extends BaseNetwork {
wif: number;
}

export interface AccountNetwork extends BaseNetwork {}
export interface AccountNetwork extends BaseNetwork {
// some chains pay fees via an enterprise gas task. The account explorer url
// is a url that can be used to look up the account for the gas tank on-chain.
readonly accountExplorerUrl?: string;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface OfcNetwork extends BaseNetwork {}

abstract class Mainnet extends BaseNetwork {
Expand Down Expand Up @@ -171,11 +176,13 @@ class DashTestnet extends BitcoinLikeTestnet {
class Ethereum extends Mainnet implements AccountNetwork {
family = CoinFamily.ETH;
explorerUrl = 'https://etherscan.io/tx/';
accountExplorerUrl = 'https://etherscan.io/address/';
}

class Kovan extends Testnet implements AccountNetwork {
family = CoinFamily.ETH;
explorerUrl = 'https://kovan.etherscan.io/tx/';
accountExplorerUrl = 'https://kovan.etherscan.io/address/';
}

class Eos extends Mainnet implements AccountNetwork {
Expand Down Expand Up @@ -261,11 +268,13 @@ class XrpTestnet extends Testnet implements AccountNetwork {
class Xtz extends Mainnet implements AccountNetwork {
family = CoinFamily.XTZ;
explorerUrl = 'https://tezblock.io/transaction/';
accountExplorerUrl = 'https://tezblock.io/account/';
}

class XtzTestnet extends Testnet implements AccountNetwork {
family = CoinFamily.XTZ;
explorerUrl = 'https://babylonnet.tezblock.io/transaction/';
accountExplorerUrl = 'https://babylonnet.tezblock.io/account/';
}

// https://github.com/zcash/zcash/blob/master/src/validation.cpp
Expand Down