diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/contract-wrappers/src/utils/decorators.ts | 2 | ||||
-rw-r--r-- | packages/forwarder-helper/package.json | 5 | ||||
-rw-r--r-- | packages/website/md/docs/0xjs/2.0.0/async.md | 26 | ||||
-rw-r--r-- | packages/website/md/docs/0xjs/2.0.0/installation.md | 38 | ||||
-rw-r--r-- | packages/website/public/images/advisors/david.png | bin | 0 -> 29962 bytes | |||
-rw-r--r-- | packages/website/public/images/team/gene.jpg | bin | 0 -> 44173 bytes | |||
-rw-r--r-- | packages/website/ts/blockchain.ts | 23 | ||||
-rw-r--r-- | packages/website/ts/components/token_balances.tsx | 18 | ||||
-rw-r--r-- | packages/website/ts/pages/about/about.tsx | 24 | ||||
-rw-r--r-- | packages/website/ts/utils/configs.ts | 27 | ||||
-rw-r--r-- | packages/website/ts/utils/constants.ts | 1 | ||||
-rw-r--r-- | packages/website/ts/utils/token_address_overrides.ts | 24 |
12 files changed, 140 insertions, 48 deletions
diff --git a/packages/contract-wrappers/src/utils/decorators.ts b/packages/contract-wrappers/src/utils/decorators.ts index 6e77450e8..d6bf6ec1e 100644 --- a/packages/contract-wrappers/src/utils/decorators.ts +++ b/packages/contract-wrappers/src/utils/decorators.ts @@ -24,7 +24,7 @@ const contractCallErrorTransformer = (error: Error) => { const schemaErrorTransformer = (error: Error) => { if (_.includes(error.message, constants.INVALID_TAKER_FORMAT)) { const errMsg = - 'Order taker must be of type string. If you want anyone to be able to fill an order - pass ZeroEx.NULL_ADDRESS'; + 'Order taker must be of type string. If you want anyone to be able to fill an order - pass NULL_ADDRESS'; return new Error(errMsg); } return error; diff --git a/packages/forwarder-helper/package.json b/packages/forwarder-helper/package.json index 410323f76..99f82d32e 100644 --- a/packages/forwarder-helper/package.json +++ b/packages/forwarder-helper/package.json @@ -18,10 +18,7 @@ "run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js --exit", "clean": "shx rm -rf lib test_temp scripts", "build": "tsc && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts", - "manual:postpublish": "yarn build; node ./scripts/postpublish.js", - "docs:stage": "node scripts/stage_docs.js", - "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES", - "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json" + "manual:postpublish": "yarn build; node ./scripts/postpublish.js" }, "config": { "postpublish": { diff --git a/packages/website/md/docs/0xjs/2.0.0/async.md b/packages/website/md/docs/0xjs/2.0.0/async.md new file mode 100644 index 000000000..c84eebf94 --- /dev/null +++ b/packages/website/md/docs/0xjs/2.0.0/async.md @@ -0,0 +1,26 @@ +0x.js is a promise-based library. This means that whenever an asynchronous call is required, the library method will return a native Javascript promise. You can therefore choose between using `promise` or `async/await` syntax when calling our async methods. + +_Async/await syntax (recommended):_ + +```javascript +try { + var availableAddresses = await web3Wrapper.getAvailableAddressesAsync(); +} catch (error) { + console.log('Caught error: ', error); +} +``` + +_Promise syntax:_ + +```javascript +web3Wrapper + .getAvailableAddressesAsync() + .then(function(availableAddresses) { + console.log(availableAddresses); + }) + .catch(function(error) { + console.log('Caught error: ', error); + }); +``` + +As is the convention with promise-based libraries, if an error occurs, it is thrown. It is the callers responsibility to catch thrown errors and to handle them appropriately. diff --git a/packages/website/md/docs/0xjs/2.0.0/installation.md b/packages/website/md/docs/0xjs/2.0.0/installation.md new file mode 100644 index 000000000..aaac263d0 --- /dev/null +++ b/packages/website/md/docs/0xjs/2.0.0/installation.md @@ -0,0 +1,38 @@ +0x.js ships as both a [UMD](https://github.com/umdjs/umd) module and a [CommonJS](https://en.wikipedia.org/wiki/CommonJS) package. + +#### CommonJS _(recommended)_: + +**Install** + +```bash +npm install 0x.js --save +``` + +**Import** + +```javascript +import { + assetDataUtils, + BigNumber, + ContractWrappers, + generatePseudoRandomSalt, + orderHashUtils, + signatureUtils, +} from '0x.js'; +``` + +#### UMD: + +**Install** + +Download the UMD module from our [releases page](https://github.com/0xProject/0x-monorepo/releases) and add it to your project. + +**Import** + +```html +<script type="text/javascript" src="0x.js"></script> +``` + +### Wiki + +Check out our [wiki](https://0xproject.com/wiki) for articles on how to get 0x.js setup with TestRPC, Infura and more! diff --git a/packages/website/public/images/advisors/david.png b/packages/website/public/images/advisors/david.png Binary files differnew file mode 100644 index 000000000..0f87d8935 --- /dev/null +++ b/packages/website/public/images/advisors/david.png diff --git a/packages/website/public/images/team/gene.jpg b/packages/website/public/images/team/gene.jpg Binary files differnew file mode 100644 index 000000000..1d4222118 --- /dev/null +++ b/packages/website/public/images/team/gene.jpg diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index a976f915f..d3f2f3f7b 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -27,6 +27,7 @@ import * as _ from 'lodash'; import * as moment from 'moment'; import * as React from 'react'; import contract = require('truffle-contract'); +import { tokenAddressOverrides } from 'ts/utils/token_address_overrides'; import { BlockchainWatcher } from 'ts/blockchain_watcher'; import { AssetSendCompleted } from 'ts/components/flash_messages/asset_send_completed'; @@ -223,7 +224,13 @@ export class Blockchain { public async isAddressInTokenRegistryAsync(tokenAddress: string): Promise<boolean> { utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); const tokenIfExists = await this._zeroEx.tokenRegistry.getTokenIfExistsAsync(tokenAddress); - return !_.isUndefined(tokenIfExists); + // HACK: Override token addresses on testnets + const tokenSymbolToAddressOverrides = tokenAddressOverrides[this.networkId]; + let isTokenAddressInOverrides = false; + if (!_.isUndefined(tokenSymbolToAddressOverrides)) { + isTokenAddressInOverrides = _.keys(tokenSymbolToAddressOverrides).includes(tokenAddress); + } + return !_.isUndefined(tokenIfExists) || isTokenAddressInOverrides; } public getLedgerDerivationPathIfExists(): string { if (_.isUndefined(this._ledgerSubprovider)) { @@ -771,6 +778,20 @@ export class Blockchain { } else { utils.assert(!_.isUndefined(this._zeroEx), 'ZeroEx must be instantiated.'); tokenRegistryTokens = await this._zeroEx.tokenRegistry.getTokensAsync(); + const tokenSymbolToAddressOverrides = tokenAddressOverrides[this.networkId]; + if (!_.isUndefined(tokenAddressOverrides)) { + // HACK: Override token addresses on testnets + tokenRegistryTokens = _.map(tokenRegistryTokens, (token: ZeroExToken) => { + const overrideIfExists = tokenSymbolToAddressOverrides[token.symbol]; + if (!_.isUndefined(overrideIfExists)) { + return { + ...token, + address: overrideIfExists, + }; + } + return token; + }); + } } const tokenByAddress: TokenByAddress = {}; _.each(tokenRegistryTokens, (t: ZeroExToken) => { diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index 7e7a8d1fa..5965ad9bd 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -337,14 +337,8 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala const isMintable = (_.includes(configs.SYMBOLS_OF_MINTABLE_KOVAN_TOKENS, token.symbol) && this.props.networkId === sharedConstants.NETWORK_ID_BY_NAME[Networks.Kovan]) || - (_.includes(configs.SYMBOLS_OF_MINTABLE_RINKEBY_ROPSTEN_TOKENS, token.symbol) && - _.includes( - [ - sharedConstants.NETWORK_ID_BY_NAME[Networks.Rinkeby], - sharedConstants.NETWORK_ID_BY_NAME[Networks.Ropsten], - ], - this.props.networkId, - )); + (_.includes(configs.SYMBOLS_OF_MINTABLE_ROPSTEN_TOKENS, token.symbol) && + this.props.networkId === sharedConstants.NETWORK_ID_BY_NAME[Networks.Ropsten]); return ( <TableRow key={token.address} style={{ height: TOKEN_TABLE_ROW_HEIGHT }}> <TableRowColumn colSpan={tokenColSpan}> @@ -392,14 +386,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala onClickAsyncFn={this._onMintTestTokensAsync.bind(this, token)} /> )} - {token.symbol === ZRX_TOKEN_SYMBOL && ( - <LifeCycleRaisedButton - labelReady="Request" - labelLoading="Sending..." - labelComplete="Sent!" - onClickAsyncFn={this._faucetRequestAsync.bind(this, false)} - /> - )} </TableRowColumn> )} {this.props.screenWidth !== ScreenWidths.Sm && ( diff --git a/packages/website/ts/pages/about/about.tsx b/packages/website/ts/pages/about/about.tsx index 519e4be5e..42237bec3 100644 --- a/packages/website/ts/pages/about/about.tsx +++ b/packages/website/ts/pages/about/about.tsx @@ -206,9 +206,17 @@ const teamRow7: ProfileInfo[] = [ image: 'images/team/matt.jpg', linkedIn: 'https://www.linkedin.com/in/mattytay/', }, + { + name: 'Eugene Aumson', + title: 'Engineer', + description: `Developer Experience. Previously senior software engineer in foreign exchange applications at Bloomberg LP.`, + image: 'images/team/gene.jpg', + linkedIn: 'https://www.linkedin.com/in/aumson/', + github: 'https://github.com/feuGeneA', + }, ]; -const advisors: ProfileInfo[] = [ +const advisors1: ProfileInfo[] = [ { name: 'Fred Ehrsam', description: 'Co-founder of Coinbase. Previously FX trader at Goldman Sachs.', @@ -232,6 +240,9 @@ const advisors: ProfileInfo[] = [ github: 'https://github.com/joeykrug', angellist: 'https://angel.co/joeykrug', }, +]; + +const advisors2: ProfileInfo[] = [ { name: 'Linda Xie', description: 'Co-founder of Scalar Capital. Previously PM at Coinbase.', @@ -240,6 +251,14 @@ const advisors: ProfileInfo[] = [ medium: 'https://medium.com/@linda.xie', twitter: 'https://twitter.com/ljxie', }, + { + name: 'David Sacks', + description: 'General Partner at Craft Ventures. Original COO of PayPal. Founder of Yammer.', + image: '/images/advisors/david.png', + linkedIn: 'https://www.linkedin.com/in/davidoliversacks/', + medium: 'https://medium.com/@davidsacks', + twitter: 'https://twitter.com/DavidSacks', + }, ]; export interface AboutProps { @@ -316,7 +335,8 @@ export class About extends React.Component<AboutProps, AboutState> { > Advisors: </div> - <div className="clearfix">{this._renderProfiles(advisors)}</div> + <div className="clearfix">{this._renderProfiles(advisors1)}</div> + <div className="clearfix">{this._renderProfiles(advisors2)}</div> </div> <div className="mx-auto py4 sm-px3" style={{ maxWidth: 308 }}> <div className="pb2" style={styles.weAreHiring}> diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index a1c64f9cb..7b74eccfb 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -18,7 +18,7 @@ export const configs = { DOMAIN_PRODUCTION: '0xproject.com', GOOGLE_ANALYTICS_ID: 'UA-98720122-1', LAST_LOCAL_STORAGE_FILL_CLEARANCE_DATE: '2017-11-22', - LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE: '2018-7-5', + LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE: '2018-9-7', OUTDATED_WRAPPED_ETHERS: [ { 42: { @@ -44,27 +44,6 @@ export const configs = { [3]: [`https://ropsten.infura.io/${INFURA_API_KEY}`], [4]: [`https://rinkeby.infura.io/${INFURA_API_KEY}`], } as PublicNodeUrlsByNetworkId, - 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', - ], + SYMBOLS_OF_MINTABLE_KOVAN_TOKENS: ['ZRX', 'MKR', 'MLN', 'GNT', 'DGD', 'REP'], + SYMBOLS_OF_MINTABLE_ROPSTEN_TOKENS: ['ZRX', 'MKR', 'MLN', 'GNT', 'DGD', 'REP'], }; diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index 005d17823..23d419907 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -24,6 +24,7 @@ export const constants = { NETWORK_ID_MAINNET: 1, NETWORK_ID_KOVAN: 42, NETWORK_ID_TESTRPC: 50, + NETWORK_ID_ROPSTEN: 3, NULL_ADDRESS: '0x0000000000000000000000000000000000000000', PROVIDER_NAME_LEDGER: 'Ledger', PROVIDER_NAME_METAMASK: 'MetaMask', diff --git a/packages/website/ts/utils/token_address_overrides.ts b/packages/website/ts/utils/token_address_overrides.ts new file mode 100644 index 000000000..8353358bc --- /dev/null +++ b/packages/website/ts/utils/token_address_overrides.ts @@ -0,0 +1,24 @@ +import { ObjectMap } from 'ts/types'; +import { constants } from 'ts/utils/constants'; + +// Map of networkId -> tokenSymbol -> tokenAddress +export type TokenOverrides = ObjectMap<ObjectMap<string>>; + +export const tokenAddressOverrides: TokenOverrides = { + [constants.NETWORK_ID_KOVAN]: { + ZRX: '0x2002d3812f58e35f0ea1ffbf80a75a38c32175fa', + REP: '0x8cb3971b8eb709c14616bd556ff6683019e90d9c', + DGD: '0xa4f468c9c692eb6b4b8b06270dae7a2cfeedcde9', + GNT: '0x31fb614e223706f15d0d3c5f4b08bdf0d5c78623', + MKR: '0x7b6b10caa9e8e9552ba72638ea5b47c25afea1f3', + MLN: '0x17e394d1df6ce29d042195ea38411a98ff3ead94', + }, + [constants.NETWORK_ID_ROPSTEN]: { + ZRX: '0xff67881f8d12f372d91baae9752eb3631ff0ed00', + REP: '0xb0b443fe0e8a04c4c85e8fda9c5c1ccc057d6653', + DGD: '0xc4895a5aafa2708d6bc1294e20ec839aad156b1d', + GNT: '0x7f8acc55a359ca4517c30510566ac35b800f7cac', + MKR: '0x06732516acd125b6e83c127752ed5f027e1b276e', + MLN: '0x823ebe83d39115536274a8617e00a1ff3544fd63', + }, +}; |