diff options
Diffstat (limited to 'ui/app/helpers/constants')
-rw-r--r-- | ui/app/helpers/constants/common.js | 10 | ||||
-rw-r--r-- | ui/app/helpers/constants/error-keys.js | 4 | ||||
-rw-r--r-- | ui/app/helpers/constants/infura-conversion.json | 653 | ||||
-rw-r--r-- | ui/app/helpers/constants/routes.js | 83 | ||||
-rw-r--r-- | ui/app/helpers/constants/transactions.js | 24 |
5 files changed, 774 insertions, 0 deletions
diff --git a/ui/app/helpers/constants/common.js b/ui/app/helpers/constants/common.js new file mode 100644 index 000000000..c6e566b8b --- /dev/null +++ b/ui/app/helpers/constants/common.js @@ -0,0 +1,10 @@ +export const ETH = 'ETH' +export const GWEI = 'GWEI' +export const WEI = 'WEI' + +export const PRIMARY = 'PRIMARY' +export const SECONDARY = 'SECONDARY' + +export const NETWORK_TYPES = { + MAINNET: 'mainnet', +} diff --git a/ui/app/helpers/constants/error-keys.js b/ui/app/helpers/constants/error-keys.js new file mode 100644 index 000000000..704064c96 --- /dev/null +++ b/ui/app/helpers/constants/error-keys.js @@ -0,0 +1,4 @@ +export const INSUFFICIENT_FUNDS_ERROR_KEY = 'insufficientFunds' +export const GAS_LIMIT_TOO_LOW_ERROR_KEY = 'gasLimitTooLow' +export const TRANSACTION_ERROR_KEY = 'transactionError' +export const TRANSACTION_NO_CONTRACT_ERROR_KEY = 'transactionErrorNoContract' diff --git a/ui/app/helpers/constants/infura-conversion.json b/ui/app/helpers/constants/infura-conversion.json new file mode 100644 index 000000000..9a96fe069 --- /dev/null +++ b/ui/app/helpers/constants/infura-conversion.json @@ -0,0 +1,653 @@ +{ + "objects": [ + { + "symbol": "ethaud", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "aud", + "name": "Australian Dollar" + } + }, + { + "symbol": "ethhkd", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "hkd", + "name": "Hong Kong Dollar" + } + }, + { + "symbol": "ethsgd", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "sgd", + "name": "Singapore Dollar" + } + }, + { + "symbol": "ethidr", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "idr", + "name": "Indonesian Rupiah" + } + }, + { + "symbol": "ethphp", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "php", + "name": "Philippine Peso" + } + }, + { + "symbol": "eth1st", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "1st", + "name": "FirstBlood" + } + }, + { + "symbol": "ethadt", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "adt", + "name": "adToken" + } + }, + { + "symbol": "ethadx", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "adx", + "name": "AdEx" + } + }, + { + "symbol": "ethant", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "ant", + "name": "Aragon" + } + }, + { + "symbol": "ethbat", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "bat", + "name": "Basic Attention Token" + } + }, + { + "symbol": "ethbnt", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "bnt", + "name": "Bancor" + } + }, + { + "symbol": "ethbtc", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "btc", + "name": "Bitcoin" + } + }, + { + "symbol": "ethcad", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "cad", + "name": "Canadian Dollar" + } + }, + { + "symbol": "ethcfi", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "cfi", + "name": "Cofound.it" + } + }, + { + "symbol": "ethcrb", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "crb", + "name": "CreditBit" + } + }, + { + "symbol": "ethcvc", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "cvc", + "name": "Civic" + } + }, + { + "symbol": "ethdash", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "dash", + "name": "Dash" + } + }, + { + "symbol": "ethdgd", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "dgd", + "name": "DigixDAO" + } + }, + { + "symbol": "ethetc", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "etc", + "name": "Ethereum Classic" + } + }, + { + "symbol": "etheur", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "eur", + "name": "Euro" + } + }, + { + "symbol": "ethfun", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "fun", + "name": "FunFair" + } + }, + { + "symbol": "ethgbp", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "gbp", + "name": "Pound Sterling" + } + }, + { + "symbol": "ethgno", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "gno", + "name": "Gnosis" + } + }, + { + "symbol": "ethgnt", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "gnt", + "name": "Golem" + } + }, + { + "symbol": "ethgup", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "gup", + "name": "Matchpool" + } + }, + { + "symbol": "ethhmq", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "hmq", + "name": "Humaniq" + } + }, + { + "symbol": "ethjpy", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "jpy", + "name": "Japanese Yen" + } + }, + { + "symbol": "ethlgd", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "lgd", + "name": "Legends Room" + } + }, + { + "symbol": "ethlsk", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "lsk", + "name": "Lisk" + } + }, + { + "symbol": "ethltc", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "ltc", + "name": "Litecoin" + } + }, + { + "symbol": "ethlun", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "lun", + "name": "Lunyr" + } + }, + { + "symbol": "ethmco", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "mco", + "name": "Monaco" + } + }, + { + "symbol": "ethmtl", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "mtl", + "name": "Metal" + } + }, + { + "symbol": "ethmyst", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "myst", + "name": "Mysterium" + } + }, + { + "symbol": "ethnmr", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "nmr", + "name": "Numeraire" + } + }, + { + "symbol": "ethomg", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "omg", + "name": "OmiseGO" + } + }, + { + "symbol": "ethpay", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "pay", + "name": "TenX" + } + }, + { + "symbol": "ethptoy", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "ptoy", + "name": "Patientory" + } + }, + { + "symbol": "ethqrl", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "qrl", + "name": "Quantum-Resistant Ledger" + } + }, + { + "symbol": "ethqtum", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "qtum", + "name": "Qtum" + } + }, + { + "symbol": "ethrep", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "rep", + "name": "Augur" + } + }, + { + "symbol": "ethrlc", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "rlc", + "name": "iEx.ec" + } + }, + { + "symbol": "ethrub", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "rub", + "name": "Russian Ruble" + } + }, + { + "symbol": "ethsc", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "sc", + "name": "Siacoin" + } + }, + { + "symbol": "ethsngls", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "sngls", + "name": "SingularDTV" + } + }, + { + "symbol": "ethsnt", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "snt", + "name": "Status" + } + }, + { + "symbol": "ethsteem", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "steem", + "name": "Steem" + } + }, + { + "symbol": "ethstorj", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "storj", + "name": "Storj" + } + }, + { + "symbol": "ethtime", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "time", + "name": "ChronoBank" + } + }, + { + "symbol": "ethtkn", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "tkn", + "name": "TokenCard" + } + }, + { + "symbol": "ethtrst", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "trst", + "name": "WeTrust" + } + }, + { + "symbol": "ethuah", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "uah", + "name": "Ukrainian Hryvnia" + } + }, + { + "symbol": "ethusd", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "usd", + "name": "United States Dollar" + } + }, + { + "symbol": "ethwings", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "wings", + "name": "Wings" + } + }, + { + "symbol": "ethxem", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "xem", + "name": "NEM" + } + }, + { + "symbol": "ethxlm", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "xlm", + "name": "Stellar Lumen" + } + }, + { + "symbol": "ethxmr", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "xmr", + "name": "Monero" + } + }, + { + "symbol": "ethxrp", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "xrp", + "name": "Ripple" + } + }, + { + "symbol": "ethzec", + "base": { + "code": "eth", + "name": "Ethereum" + }, + "quote": { + "code": "zec", + "name": "Zcash" + } + } + ] +} diff --git a/ui/app/helpers/constants/routes.js b/ui/app/helpers/constants/routes.js new file mode 100644 index 000000000..932dfa7df --- /dev/null +++ b/ui/app/helpers/constants/routes.js @@ -0,0 +1,83 @@ +const DEFAULT_ROUTE = '/' +const UNLOCK_ROUTE = '/unlock' +const LOCK_ROUTE = '/lock' +const SETTINGS_ROUTE = '/settings' +const INFO_ROUTE = '/settings/info' +const REVEAL_SEED_ROUTE = '/seed' +const MOBILE_SYNC_ROUTE = '/mobile-sync' +const CONFIRM_SEED_ROUTE = '/confirm-seed' +const RESTORE_VAULT_ROUTE = '/restore-vault' +const ADD_TOKEN_ROUTE = '/add-token' +const CONFIRM_ADD_TOKEN_ROUTE = '/confirm-add-token' +const CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE = '/confirm-add-suggested-token' +const NEW_ACCOUNT_ROUTE = '/new-account' +const IMPORT_ACCOUNT_ROUTE = '/new-account/import' +const CONNECT_HARDWARE_ROUTE = '/new-account/connect' +const SEND_ROUTE = '/send' +const NOTICE_ROUTE = '/notice' +const WELCOME_ROUTE = '/welcome' + +const INITIALIZE_ROUTE = '/initialize' +const INITIALIZE_WELCOME_ROUTE = '/initialize/welcome' +const INITIALIZE_UNLOCK_ROUTE = '/initialize/unlock' +const INITIALIZE_CREATE_PASSWORD_ROUTE = '/initialize/create-password' +const INITIALIZE_IMPORT_ACCOUNT_ROUTE = '/initialize/create-password/import-account' +const INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE = '/initialize/create-password/import-with-seed-phrase' +const INITIALIZE_UNIQUE_IMAGE_ROUTE = '/initialize/create-password/unique-image' +const INITIALIZE_NOTICE_ROUTE = '/initialize/notice' +const INITIALIZE_SELECT_ACTION_ROUTE = '/initialize/select-action' +const INITIALIZE_SEED_PHRASE_ROUTE = '/initialize/seed-phrase' +const INITIALIZE_END_OF_FLOW_ROUTE = '/initialize/end-of-flow' +const INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE = '/initialize/seed-phrase/confirm' +const INITIALIZE_METAMETRICS_OPT_IN_ROUTE = '/initialize/metametrics-opt-in' + +const CONFIRM_TRANSACTION_ROUTE = '/confirm-transaction' +const CONFIRM_SEND_ETHER_PATH = '/send-ether' +const CONFIRM_SEND_TOKEN_PATH = '/send-token' +const CONFIRM_DEPLOY_CONTRACT_PATH = '/deploy-contract' +const CONFIRM_APPROVE_PATH = '/approve' +const CONFIRM_TRANSFER_FROM_PATH = '/transfer-from' +const CONFIRM_TOKEN_METHOD_PATH = '/token-method' +const SIGNATURE_REQUEST_PATH = '/signature-request' + +module.exports = { + DEFAULT_ROUTE, + UNLOCK_ROUTE, + LOCK_ROUTE, + SETTINGS_ROUTE, + INFO_ROUTE, + REVEAL_SEED_ROUTE, + MOBILE_SYNC_ROUTE, + CONFIRM_SEED_ROUTE, + RESTORE_VAULT_ROUTE, + ADD_TOKEN_ROUTE, + CONFIRM_ADD_TOKEN_ROUTE, + CONFIRM_ADD_SUGGESTED_TOKEN_ROUTE, + NEW_ACCOUNT_ROUTE, + IMPORT_ACCOUNT_ROUTE, + CONNECT_HARDWARE_ROUTE, + SEND_ROUTE, + NOTICE_ROUTE, + WELCOME_ROUTE, + INITIALIZE_ROUTE, + INITIALIZE_WELCOME_ROUTE, + INITIALIZE_UNLOCK_ROUTE, + INITIALIZE_CREATE_PASSWORD_ROUTE, + INITIALIZE_IMPORT_ACCOUNT_ROUTE, + INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE, + INITIALIZE_UNIQUE_IMAGE_ROUTE, + INITIALIZE_NOTICE_ROUTE, + INITIALIZE_SELECT_ACTION_ROUTE, + INITIALIZE_SEED_PHRASE_ROUTE, + INITIALIZE_CONFIRM_SEED_PHRASE_ROUTE, + INITIALIZE_END_OF_FLOW_ROUTE, + CONFIRM_TRANSACTION_ROUTE, + CONFIRM_SEND_ETHER_PATH, + CONFIRM_SEND_TOKEN_PATH, + CONFIRM_DEPLOY_CONTRACT_PATH, + CONFIRM_APPROVE_PATH, + CONFIRM_TRANSFER_FROM_PATH, + CONFIRM_TOKEN_METHOD_PATH, + SIGNATURE_REQUEST_PATH, + INITIALIZE_METAMETRICS_OPT_IN_ROUTE, +} diff --git a/ui/app/helpers/constants/transactions.js b/ui/app/helpers/constants/transactions.js new file mode 100644 index 000000000..d0a819b9b --- /dev/null +++ b/ui/app/helpers/constants/transactions.js @@ -0,0 +1,24 @@ +export const UNAPPROVED_STATUS = 'unapproved' +export const REJECTED_STATUS = 'rejected' +export const APPROVED_STATUS = 'approved' +export const SIGNED_STATUS = 'signed' +export const SUBMITTED_STATUS = 'submitted' +export const CONFIRMED_STATUS = 'confirmed' +export const FAILED_STATUS = 'failed' +export const DROPPED_STATUS = 'dropped' +export const CANCELLED_STATUS = 'cancelled' + +export const TOKEN_METHOD_TRANSFER = 'transfer' +export const TOKEN_METHOD_APPROVE = 'approve' +export const TOKEN_METHOD_TRANSFER_FROM = 'transferfrom' + +export const SEND_ETHER_ACTION_KEY = 'sentEther' +export const DEPLOY_CONTRACT_ACTION_KEY = 'contractDeployment' +export const APPROVE_ACTION_KEY = 'approve' +export const SEND_TOKEN_ACTION_KEY = 'sentTokens' +export const TRANSFER_FROM_ACTION_KEY = 'transferFrom' +export const SIGNATURE_REQUEST_KEY = 'signatureRequest' +export const CONTRACT_INTERACTION_KEY = 'contractInteraction' +export const CANCEL_ATTEMPT_ACTION_KEY = 'cancelAttempt' + +export const TRANSACTION_TYPE_SHAPESHIFT = 'shapeshift' |