From 03f5c9b9508b833bd4645386b5f46720a7d7ba2a Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:22:20 -0800 Subject: Add networkId to faucet requests so that we can request tokens on Kovan, Rinkeby and Ropsten --- packages/website/ts/components/token_balances.tsx | 4 +++- packages/website/ts/utils/constants.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index dfb62bbb3..64aa1ef3f 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -599,7 +599,9 @@ export class TokenBalances extends React.Component ${responseBody}`); diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index 26a793f38..3df4c9370 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -69,7 +69,7 @@ export const constants = { URL_BLOG: 'https://blog.0xproject.com/latest', URL_DISCOURSE_FORUM: 'https://forum.0xproject.com', URL_FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/', - URL_ETHER_FAUCET: 'https://faucet.0xproject.com', + URL_TESTNET_FAUCET: 'https://faucet.0xproject.com', URL_GITHUB_ORG: 'https://github.com/0xProject', URL_GITHUB_WIKI: 'https://github.com/0xProject/wiki', URL_METAMASK_CHROME_STORE: 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn', -- cgit v1.2.3 From 05aa2fa42148e79f6a3dd35e91e9e85346c4d421 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:23:01 -0800 Subject: Properly detect Rinkeby and Ropsten TokenRegistry tokens as mintable --- packages/website/ts/components/token_balances.tsx | 10 ++++++++-- packages/website/ts/utils/configs.ts | 24 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index 64aa1ef3f..ea8144b7d 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -362,8 +362,14 @@ export class TokenBalances extends React.Component diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 874ad04c2..69773eae7 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -124,5 +124,27 @@ export const configs = { [4]: [`https://rinkeby.infura.io/${INFURA_API_KEY}`], } as PublicNodeUrlsByNetworkId, SHOULD_DEPRECATE_OLD_WETH_TOKEN: true, - SYMBOLS_OF_MINTABLE_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], + SYMBOLS_OF_MINTABLE_KOVAN_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], + SYMBOLS_OF_MINTABLE_RINKEBY_ROPSTEN_TOKENS: [ + 'TKN0', + 'TKN1', + 'TKN2', + 'TKN3', + 'TKN4', + 'TKN5', + 'TKN6', + 'TKN7', + 'TKN8', + 'TKN9', + 'TKN10', + 'TKN11', + 'TKN12', + 'TKN13', + 'TKN14', + 'TKN15', + 'TKN16', + 'TKN17', + 'TKN18', + 'TKN19', + ], }; -- cgit v1.2.3 From b7676d8c466db73527552d68eea71bd315a45b02 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:23:27 -0800 Subject: Use isTestNetwork instead of isKovanTestNetwork on balances page except for Dharma integration --- packages/website/ts/components/token_balances.tsx | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index ea8144b7d..a25c8b077 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -176,13 +176,21 @@ export class TokenBalances extends React.Component, ]; + const isTestNetwork = _.includes( + [ + constants.NETWORK_ID_BY_NAME[Networks.Kovan], + constants.NETWORK_ID_BY_NAME[Networks.Rinkeby], + constants.NETWORK_ID_BY_NAME[Networks.Ropsten], + ], + this.props.networkId, + ); const isKovanTestNetwork = this.props.networkId === constants.NETWORK_ID_KOVAN; const dharmaButtonColumnStyle = { paddingLeft: 3, display: isKovanTestNetwork ? 'table-cell' : 'none', }; const stubColumnStyle = { - display: isKovanTestNetwork ? 'none' : 'table-cell', + display: isTestNetwork ? 'none' : 'table-cell', }; const allTokenRowHeight = _.size(this.props.tokenByAddress) * TOKEN_TABLE_ROW_HEIGHT; const tokenTableHeight = @@ -201,10 +209,10 @@ export class TokenBalances extends React.Component -

{isKovanTestNetwork ? 'Test ether' : 'Ether'}

+

{isTestNetwork ? 'Test ether' : 'Ether'}

- {isKovanTestNetwork + {isTestNetwork ? 'In order to try out the 0x Portal Dapp, request some test ether to pay for \ gas costs. It might take a bit of time for the test ether to show up.' : 'Ether must be converted to Ether Tokens in order to be tradable via 0x. \ @@ -216,7 +224,7 @@ export class TokenBalances extends React.ComponentCurrency Balance - {isKovanTestNetwork && ( + {isTestNetwork && ( {isSmallScreen ? 'Faucet' : 'Request from faucet'} @@ -243,7 +251,7 @@ export class TokenBalances extends React.Component - {isKovanTestNetwork && ( + {isTestNetwork && (
-

{isKovanTestNetwork ? 'Test tokens' : 'Tokens'}

+

{isTestNetwork ? 'Test tokens' : 'Tokens'}

@@ -282,7 +290,7 @@ export class TokenBalances extends React.Component
- {isKovanTestNetwork + {isTestNetwork ? "Mint some test tokens you'd like to use to generate or fill an order using 0x." : "Set trading permissions for a token you'd like to start trading."}
-- cgit v1.2.3 From 9deaf612f13728bd9285e9de9d32ad628c426059 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:25:19 -0800 Subject: Remove stray log --- packages/website/ts/components/token_balances.tsx | 1 - 1 file changed, 1 deletion(-) (limited to 'packages') diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index a25c8b077..d91dbd093 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -377,7 +377,6 @@ export class TokenBalances extends React.Component -- cgit v1.2.3 From 518efa8ad2765b3664ad1b5433c56a82cc7c50be Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:29:10 -0800 Subject: Move isTestNetwork into utils and also check it from showing ZRX request button --- packages/website/ts/components/token_balances.tsx | 11 ++--------- packages/website/ts/utils/utils.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index d91dbd093..301a332ce 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -176,14 +176,7 @@ export class TokenBalances extends React.Component, ]; - const isTestNetwork = _.includes( - [ - constants.NETWORK_ID_BY_NAME[Networks.Kovan], - constants.NETWORK_ID_BY_NAME[Networks.Rinkeby], - constants.NETWORK_ID_BY_NAME[Networks.Ropsten], - ], - this.props.networkId, - ); + const isTestNetwork = utils.isTestNetwork(this.props.networkId); const isKovanTestNetwork = this.props.networkId === constants.NETWORK_ID_KOVAN; const dharmaButtonColumnStyle = { paddingLeft: 3, @@ -426,7 +419,7 @@ export class TokenBalances extends React.Component )} {token.symbol === ZRX_TOKEN_SYMBOL && - this.props.networkId === constants.NETWORK_ID_KOVAN && ( + utils.isTestNetwork(this.props.networkId) && ( Date: Tue, 6 Feb 2018 17:55:15 -0800 Subject: Only show faucet error if not on a testnet --- packages/website/ts/components/token_balances.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index 301a332ce..6c3f4748b 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -504,9 +504,8 @@ export class TokenBalances extends React.Component - Our faucet can only send test Ether to addresses on the {Networks.Kovan} testnet (networkId{' '} - {constants.NETWORK_ID_KOVAN}). Please make sure you are connected to the {Networks.Kovan}{' '} - testnet and try requesting ether again. + Our faucet can only send test Ether to addresses on testnets. Please make sure you are connected + to a testnet and try requesting again.
); @@ -595,7 +594,7 @@ export class TokenBalances extends React.Component