diff options
Diffstat (limited to 'packages/website/ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 2 | ||||
-rw-r--r-- | packages/website/ts/components/fill_order.tsx | 4 | ||||
-rw-r--r-- | packages/website/ts/pages/documentation/docs_home.tsx | 77 | ||||
-rw-r--r-- | packages/website/ts/types.ts | 5 | ||||
-rw-r--r-- | packages/website/ts/utils/utils.ts | 2 |
5 files changed, 64 insertions, 26 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 37f746f7c..ea5a59340 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -944,7 +944,7 @@ export class Blockchain { try { const gasInfo = await backendClient.getGasInfoAsync(); const gasPriceInGwei = new BigNumber(gasInfo.fast / 10); - const gasPriceInWei = gasPriceInGwei.mul(1000000000); + const gasPriceInWei = gasPriceInGwei.multipliedBy(1000000000); this._defaultGasPrice = gasPriceInWei; } catch (err) { return; diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index 7fee8c4df..95a3671c4 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -205,7 +205,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { amount: orderMakerAmount .times(takerAssetToken.amount) .div(orderTakerAmount) - .floor(), + .integerValue(BigNumber.ROUND_FLOOR), symbol: makerToken.symbol, }; const fillAssetToken = { @@ -219,7 +219,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { const orderReceiveAmountBigNumber = orderMakerAmount .times(this.props.orderFillAmount) .dividedBy(orderTakerAmount) - .floor(); + .integerValue(BigNumber.ROUND_FLOOR); orderReceiveAmount = this._formatCurrencyAmount(orderReceiveAmountBigNumber, makerToken.decimals); } const isUserMaker = diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx index d11cf02fb..5849a2a03 100644 --- a/packages/website/ts/pages/documentation/docs_home.tsx +++ b/packages/website/ts/pages/documentation/docs_home.tsx @@ -55,7 +55,7 @@ const TUTORIALS: TutorialInfo[] = [ ]; const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = { - [Categories.ZeroExProtocol]: [ + [Categories.ZeroExProtocolTypescript]: [ { description: 'A library for interacting with the 0x protocol. It is a high level package which combines a number of smaller specific-purpose packages such as [order-utils](https://0x.org/docs/order-utils) and [contract-wrappers](https://0x.org/docs/contract-wrappers).', @@ -92,23 +92,6 @@ const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = { }, { description: - "A Python library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.", - link: { - title: '0x-order-utils.py', - to: 'http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/', - shouldOpenInNewTab: true, - }, - }, - { - description: 'A Python Standard Relayer API client', - link: { - title: '0x-sra-client.py', - to: 'https://pypi.org/project/0x-sra-client/', - shouldOpenInNewTab: true, - }, - }, - { - description: 'An http & websocket client for interacting with relayers that have implemented the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)', link: { title: '@0x/connect', @@ -190,6 +173,57 @@ const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = { }, }, ], + [Categories.ZeroExProtocolPython]: [ + { + description: + "A library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.", + link: { + title: '0x-order-utils', + to: 'https://pypi.org/project/0x-order-utils/', + shouldOpenInNewTab: true, + }, + }, + { + description: 'A Standard Relayer API client', + link: { + title: '0x-sra-client', + to: 'https://pypi.org/project/0x-sra-client/', + shouldOpenInNewTab: true, + }, + }, + { + description: 'Package containing the addresses at which the 0x smart contracts have been deployed', + link: { + title: '0x-contract-addresses', + to: 'https://pypi.org/project/0x-contract-addresses/', + shouldOpenInNewTab: true, + }, + }, + { + description: 'Package containing the 0x smart contract compilation artifacts', + link: { + title: '0x-contract-artifacts', + to: 'https://pypi.org/project/0x-contract-artifacts/', + shouldOpenInNewTab: true, + }, + }, + { + description: '0x JSON schemas for those developing on top of 0x protocol', + link: { + title: '0x-json-schemas', + to: 'https://pypi.org/project/0x-json-schemas/', + shouldOpenInNewTab: true, + }, + }, + { + description: 'Demo project showing how to interact with the 0x smart contracts using Python', + link: { + title: '0x-contract-demo', + to: 'https://github.com/0xProject/0x-monorepo/blob/development/python-packages/contract_demo/README.md', + shouldOpenInNewTab: true, + }, + }, + ], [Categories.Ethereum]: [ { description: @@ -409,7 +443,10 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> { title: this.props.translate.get(tutorialInfo.link.title as Key, Deco.Cap), }; }), - [Categories.ZeroExProtocol]: _.map(CATEGORY_TO_PACKAGES[Categories.ZeroExProtocol], pkg => pkg.link), + [Categories.ZeroExProtocolTypescript]: _.map( + CATEGORY_TO_PACKAGES[Categories.ZeroExProtocolTypescript], + pkg => pkg.link, + ), [Categories.Ethereum]: _.map(CATEGORY_TO_PACKAGES[Categories.Ethereum], pkg => pkg.link), [Categories.CommunityMaintained]: _.map( CATEGORY_TO_PACKAGES[Categories.CommunityMaintained], @@ -466,4 +503,4 @@ export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> { }); return menuItems; } -} +} // tslint:disable:max-file-line-count diff --git a/packages/website/ts/types.ts b/packages/website/ts/types.ts index 9492da5a5..081c6d014 100644 --- a/packages/website/ts/types.ts +++ b/packages/website/ts/types.ts @@ -655,8 +655,9 @@ export interface TutorialInfo { } export enum Categories { - ZeroExProtocol = '0x Protocol', - Ethereum = 'Ethereum', + ZeroExProtocolTypescript = '0x Protocol (Typescript/Javascript)', + ZeroExProtocolPython = '0x Protocol (Python)', + Ethereum = 'Ethereum (Typescript/Javascript)', CommunityMaintained = 'Community Maintained', } diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 890f1553a..e84f9d0cc 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -394,7 +394,7 @@ export const utils = { }, getUsdValueFormattedAmount(amount: BigNumber, decimals: number, price: BigNumber): string { const unitAmount = Web3Wrapper.toUnitAmount(amount, decimals); - const value = unitAmount.mul(price); + const value = unitAmount.multipliedBy(price); return utils.format(value, constants.NUMERAL_USD_FORMAT); }, openUrl(url: string): void { |