aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/pages/documentation
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/pages/documentation')
-rw-r--r--packages/website/ts/pages/documentation/developers_page.tsx201
-rw-r--r--packages/website/ts/pages/documentation/doc_page.tsx216
-rw-r--r--packages/website/ts/pages/documentation/docs_home.tsx469
3 files changed, 0 insertions, 886 deletions
diff --git a/packages/website/ts/pages/documentation/developers_page.tsx b/packages/website/ts/pages/documentation/developers_page.tsx
deleted file mode 100644
index 0b725c514..000000000
--- a/packages/website/ts/pages/documentation/developers_page.tsx
+++ /dev/null
@@ -1,201 +0,0 @@
-import { colors, constants as sharedConstants, utils as sharedUtils } from '@0x/react-shared';
-import * as _ from 'lodash';
-import * as React from 'react';
-import DocumentTitle from 'react-document-title';
-import { Helmet } from 'react-helmet';
-import { DocsLogo } from 'ts/components/documentation/docs_logo';
-import { DocsTopBar } from 'ts/components/documentation/docs_top_bar';
-import { Container } from 'ts/components/ui/container';
-import { Dispatcher } from 'ts/redux/dispatcher';
-import { media } from 'ts/style/media';
-import { styled } from 'ts/style/theme';
-import { BrowserType, OperatingSystemType, ScreenWidths } from 'ts/types';
-import { Translate } from 'ts/utils/translate';
-import { utils } from 'ts/utils/utils';
-
-const THROTTLE_TIMEOUT = 100;
-const TOP_BAR_HEIGHT = 80;
-const browserType = utils.getBrowserType();
-let SCROLLBAR_WIDTH;
-switch (browserType) {
- case BrowserType.Firefox:
- // HACK: Firefox doesn't allow styling of their scrollbar's.
- // Source: https://stackoverflow.com/questions/6165472/custom-css-scrollbar-for-firefox
- const os = utils.getOperatingSystem();
- SCROLLBAR_WIDTH = os === OperatingSystemType.Windows ? 17 : 15;
- break;
-
- case BrowserType.Edge:
- // Edge's scrollbar is placed outside of the div content and doesn't
- // need to be accounted for
- SCROLLBAR_WIDTH = 0;
- break;
-
- default:
- SCROLLBAR_WIDTH = 4;
-}
-const SIDEBAR_PADDING = 22;
-
-export interface DevelopersPageProps {
- location: Location;
- translate: Translate;
- screenWidth: ScreenWidths;
- dispatcher: Dispatcher;
- mainContent: React.ReactNode;
- sidebar: React.ReactNode;
-}
-
-export interface DevelopersPageState {
- isSidebarScrolling: boolean;
-}
-
-const isUserOnMobile = sharedUtils.isUserOnMobile();
-
-const scrollableContainerStyles = `
- position: absolute;
- top: ${TOP_BAR_HEIGHT}px;
- left: 0px;
- bottom: 0px;
- right: 0px;
- overflow-x: hidden;
- overflow-y: scroll;
- -webkit-overflow-scrolling: touch;
- /* Required for hide/show onHover of scrollbar on Microsoft Edge */
- -ms-overflow-style: -ms-autohiding-scrollbar;
-`;
-
-interface SidebarContainerProps {
- className?: string;
-}
-
-const SidebarContainer = styled.div<SidebarContainerProps>`
- ${scrollableContainerStyles}
- padding-top: 27px;
- padding-left: ${SIDEBAR_PADDING}px;
- padding-right: ${SIDEBAR_PADDING}px;
- overflow: hidden;
- &:hover {
- overflow: auto;
- padding-right: ${SIDEBAR_PADDING - SCROLLBAR_WIDTH}px;
- }
-`;
-
-interface MainContentContainerProps {
- className?: string;
-}
-
-const MainContentContainer = styled.div<MainContentContainerProps>`
- ${scrollableContainerStyles}
- padding-top: 0px;
- padding-left: 50px;
- padding-right: 50px;
- overflow: ${isUserOnMobile ? 'auto' : 'hidden'};
- &:hover {
- padding-right: ${50 - SCROLLBAR_WIDTH}px;
- overflow: auto;
- }
- ${media.small`
- padding-left: 20px;
- padding-right: 20px;
- &:hover {
- padding-right: ${20 - SCROLLBAR_WIDTH}px;
- overflow: auto;
- }
- `}
-`;
-
-export class DevelopersPage extends React.Component<DevelopersPageProps, DevelopersPageState> {
- private readonly _throttledScreenWidthUpdate: () => void;
- private readonly _throttledSidebarScrolling: () => void;
- private _sidebarScrollClearingInterval: number;
- constructor(props: DevelopersPageProps) {
- super(props);
- this._throttledScreenWidthUpdate = _.throttle(this._updateScreenWidth.bind(this), THROTTLE_TIMEOUT);
- this._throttledSidebarScrolling = _.throttle(this._onSidebarScroll.bind(this), THROTTLE_TIMEOUT);
- this.state = {
- isSidebarScrolling: false,
- };
- }
- public componentDidMount(): void {
- window.addEventListener('resize', this._throttledScreenWidthUpdate);
- window.scrollTo(0, 0);
- this._sidebarScrollClearingInterval = window.setInterval(() => {
- this.setState({
- isSidebarScrolling: false,
- });
- }, 1000);
- }
- public componentWillUnmount(): void {
- window.removeEventListener('resize', this._throttledScreenWidthUpdate);
- window.clearInterval(this._sidebarScrollClearingInterval);
- }
- public render(): React.ReactNode {
- const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
- const mainContentPadding = isSmallScreen ? 20 : 50;
- return (
- <Container
- className="flex items-center overflow-hidden"
- width="100%"
- background={`linear-gradient(to right, ${colors.grey100} 0%, ${colors.grey100} 50%, ${
- colors.white
- } 50%, ${colors.white} 100%)`}
- >
- <DocumentTitle title="0x Docs" />
- <Helmet>
- <link rel="stylesheet" href="/css/github-gist.css" />
- </Helmet>
- <Container className="flex mx-auto" height="100vh">
- <Container
- className="sm-hide xs-hide relative"
- width={270}
- paddingLeft={22}
- paddingRight={22}
- paddingTop={0}
- backgroundColor={colors.grey100}
- >
- <Container
- borderBottom={this.state.isSidebarScrolling ? `1px solid ${colors.grey300}` : 'none'}
- paddingBottom="2px"
- >
- <Container paddingTop="30px" paddingLeft="10px" paddingBottom="8px">
- <DocsLogo />
- </Container>
- </Container>
- <SidebarContainer onWheel={this._throttledSidebarScrolling}>
- <Container paddingBottom="100px">
- {this.props.screenWidth !== ScreenWidths.Sm && this.props.sidebar}
- </Container>
- </SidebarContainer>
- </Container>
- <Container
- className="relative"
- width={isSmallScreen ? '100vw' : 786}
- paddingBottom="100px"
- backgroundColor={colors.white}
- >
- <Container paddingLeft={mainContentPadding} paddingRight={mainContentPadding}>
- <DocsTopBar
- location={this.props.location}
- screenWidth={this.props.screenWidth}
- translate={this.props.translate}
- sidebar={this.props.sidebar}
- />
- </Container>
- <MainContentContainer id={sharedConstants.SCROLL_CONTAINER_ID}>
- {this.props.mainContent}
- </MainContentContainer>
- </Container>
- </Container>
- </Container>
- );
- }
- private _onSidebarScroll(_event: React.FormEvent<HTMLInputElement>): void {
- this.setState({
- isSidebarScrolling: true,
- });
- }
- private _updateScreenWidth(): void {
- const newScreenWidth = utils.getScreenWidth();
- this.props.dispatcher.updateScreenWidth(newScreenWidth);
- }
-} // tslint:disable:max-file-line-count
diff --git a/packages/website/ts/pages/documentation/doc_page.tsx b/packages/website/ts/pages/documentation/doc_page.tsx
deleted file mode 100644
index 14bad7329..000000000
--- a/packages/website/ts/pages/documentation/doc_page.tsx
+++ /dev/null
@@ -1,216 +0,0 @@
-import {
- DocAgnosticFormat,
- DocReference,
- DocsInfo,
- GeneratedDocJson,
- SupportedDocJson,
- TypeDocUtils,
-} from '@0x/react-docs';
-import findVersions from 'find-versions';
-import * as _ from 'lodash';
-import CircularProgress from 'material-ui/CircularProgress';
-import * as React from 'react';
-import semverSort from 'semver-sort';
-import { SidebarHeader } from 'ts/components/documentation/sidebar_header';
-import { NestedSidebarMenu } from 'ts/components/nested_sidebar_menu';
-import { Container } from 'ts/components/ui/container';
-import { DevelopersPage } from 'ts/pages/documentation/developers_page';
-import { Dispatcher } from 'ts/redux/dispatcher';
-import { DocPackages, ScreenWidths } from 'ts/types';
-import { constants } from 'ts/utils/constants';
-import { docUtils } from 'ts/utils/doc_utils';
-import { Translate } from 'ts/utils/translate';
-import { utils } from 'ts/utils/utils';
-
-const isDevelopmentOrStaging = utils.isDevelopment() || utils.isStaging();
-const ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH = '0.32.4';
-
-const docIdToSubpackageName: { [id: string]: string } = {
- [DocPackages.ZeroExJs]: '0x.js',
- [DocPackages.Connect]: 'connect',
- [DocPackages.SmartContracts]: 'contracts',
- [DocPackages.Web3Wrapper]: 'web3-wrapper',
- [DocPackages.ContractWrappers]: 'contract-wrappers',
- [DocPackages.SolCompiler]: 'sol-compiler',
- [DocPackages.JSONSchemas]: 'json-schemas',
- [DocPackages.SolCoverage]: 'sol-coverage',
- [DocPackages.SolProfiler]: 'sol-profiler',
- [DocPackages.SolTrace]: 'sol-trace',
- [DocPackages.Subproviders]: 'subproviders',
- [DocPackages.OrderUtils]: 'order-utils',
- [DocPackages.OrderWatcher]: 'order-watcher',
- [DocPackages.EthereumTypes]: 'ethereum-types',
- [DocPackages.AssetBuyer]: 'asset-buyer',
- [DocPackages.Migrations]: 'migrations',
-};
-
-export interface DocPageProps {
- location: Location;
- dispatcher: Dispatcher;
- docsVersion: string;
- availableDocVersions: string[];
- docsInfo: DocsInfo;
- translate: Translate;
- screenWidth: ScreenWidths;
-}
-
-interface DocPageState {
- docAgnosticFormat?: DocAgnosticFormat;
-}
-
-export class DocPage extends React.Component<DocPageProps, DocPageState> {
- private _isUnmounted: boolean;
- constructor(props: DocPageProps) {
- super(props);
- this._isUnmounted = false;
- this.state = {
- docAgnosticFormat: undefined,
- };
- }
- public componentWillMount(): void {
- const pathName = this.props.location.pathname;
- const lastSegment = pathName.substr(pathName.lastIndexOf('/') + 1);
- const versions = findVersions(lastSegment);
- const preferredVersionIfExists = versions.length > 0 ? versions[0] : undefined;
- // tslint:disable-next-line:no-floating-promises
- this._fetchJSONDocsFireAndForgetAsync(preferredVersionIfExists);
- }
- public componentWillUnmount(): void {
- this._isUnmounted = true;
- }
- public render(): React.ReactNode {
- const sourceUrl = this._getSourceUrl();
- const sectionNameToLinks = _.isUndefined(this.state.docAgnosticFormat)
- ? {}
- : this.props.docsInfo.getSectionNameToLinks(this.state.docAgnosticFormat);
- const mainContent = _.isUndefined(this.state.docAgnosticFormat) ? (
- <div className="flex justify-center">{this._renderLoading()}</div>
- ) : (
- <DocReference
- selectedVersion={this.props.docsVersion}
- availableVersions={this.props.availableDocVersions}
- docsInfo={this.props.docsInfo}
- docAgnosticFormat={this.state.docAgnosticFormat}
- sourceUrl={sourceUrl}
- />
- );
- const sidebar = _.isUndefined(this.state.docAgnosticFormat) ? (
- <div />
- ) : (
- <NestedSidebarMenu
- sidebarHeader={this._renderSidebarHeader()}
- sectionNameToLinks={sectionNameToLinks}
- screenWidth={this.props.screenWidth}
- />
- );
- return (
- <DevelopersPage
- sidebar={sidebar}
- mainContent={mainContent}
- location={this.props.location}
- screenWidth={this.props.screenWidth}
- translate={this.props.translate}
- dispatcher={this.props.dispatcher}
- />
- );
- }
- private _renderSidebarHeader(): React.ReactNode {
- return (
- <SidebarHeader
- screenWidth={this.props.screenWidth}
- title={this.props.docsInfo.displayName}
- docsVersion={this.props.docsVersion}
- availableDocVersions={this.props.availableDocVersions}
- onVersionSelected={this._onVersionSelected.bind(this)}
- />
- );
- }
- private _renderLoading(): React.ReactNode {
- return (
- <Container className="pt4">
- <Container className="center pb2">
- <CircularProgress size={40} thickness={5} />
- </Container>
- <Container className="center pt2" paddingBottom="11px">
- Loading documentation...
- </Container>
- </Container>
- );
- }
- private async _fetchJSONDocsFireAndForgetAsync(preferredVersionIfExists?: string): Promise<void> {
- const folderName = docIdToSubpackageName[this.props.docsInfo.id];
- const docBucketRoot = isDevelopmentOrStaging
- ? constants.S3_STAGING_DOC_BUCKET_ROOT
- : constants.S3_DOC_BUCKET_ROOT;
- const versionToFilePath = await docUtils.getVersionToFilePathAsync(docBucketRoot, folderName);
- const versions = _.keys(versionToFilePath);
- this.props.dispatcher.updateAvailableDocVersions(versions);
- const sortedVersions = semverSort.desc(versions);
- const latestVersion = sortedVersions[0];
-
- let versionToFetch = latestVersion;
- if (!_.isUndefined(preferredVersionIfExists)) {
- const preferredVersionFileNameIfExists = versionToFilePath[preferredVersionIfExists];
- if (!_.isUndefined(preferredVersionFileNameIfExists)) {
- versionToFetch = preferredVersionIfExists;
- }
- }
- this.props.dispatcher.updateCurrentDocsVersion(versionToFetch);
-
- const versionFilePathToFetch = versionToFilePath[versionToFetch];
- const versionDocObj = await docUtils.getJSONDocFileAsync(versionFilePathToFetch, docBucketRoot);
- let docAgnosticFormat;
- if (this.props.docsInfo.type === SupportedDocJson.TypeDoc) {
- docAgnosticFormat = new TypeDocUtils(
- versionDocObj as GeneratedDocJson,
- this.props.docsInfo,
- ).convertToDocAgnosticFormat();
- } else if (this.props.docsInfo.type === SupportedDocJson.SolDoc) {
- // documenting solidity.
- docAgnosticFormat = versionDocObj as DocAgnosticFormat;
- // HACK: need to modify docsInfo like convertToDocAgnosticFormat() would do
- this.props.docsInfo.markdownMenu.Contracts = [];
- _.each(docAgnosticFormat, (_docObj, sectionName) => {
- this.props.docsInfo.sections[sectionName] = sectionName;
- this.props.docsInfo.markdownMenu.Contracts.push(sectionName);
- });
- }
-
- if (!this._isUnmounted) {
- this.setState({
- docAgnosticFormat,
- });
- }
- }
- private _getSourceUrl(): string {
- const url = this.props.docsInfo.packageUrl;
- let pkg = docIdToSubpackageName[this.props.docsInfo.id];
- let tagPrefix = pkg;
- const packagesWithNamespace = ['connect'];
- if (_.includes(packagesWithNamespace, pkg)) {
- tagPrefix = `@0x/${pkg}`;
- }
- // HACK: The following three lines exist for backward compatibility reasons
- // Before exporting types from other packages as part of the 0x.js interface,
- // all TypeDoc generated paths omitted the topLevel `0x.js` segment. Now it
- // adds it, and for that reason, we need to make sure we don't add it twice in
- // the source links we generate.
- const semvers = semverSort.desc([this.props.docsVersion, ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH]);
- const isVersionAfterTopLevelPathChange = semvers[0] !== ZERO_EX_JS_VERSION_MISSING_TOPLEVEL_PATH;
- pkg = this.props.docsInfo.id === DocPackages.ZeroExJs && isVersionAfterTopLevelPathChange ? '' : `/${pkg}`;
-
- const sourceUrl = `${url}/blob/${tagPrefix}%40${this.props.docsVersion}/packages${pkg}`;
- return sourceUrl;
- }
- private _onVersionSelected(semver: string): void {
- let path = window.location.pathname;
- const lastChar = path[path.length - 1];
- if (_.isFinite(_.parseInt(lastChar))) {
- const pathSections = path.split('/');
- pathSections.pop();
- path = pathSections.join('/');
- }
- const baseUrl = utils.getCurrentBaseUrl();
- window.location.href = `${baseUrl}${path}/${semver}${window.location.hash}`;
- }
-}
diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx
deleted file mode 100644
index d11cf02fb..000000000
--- a/packages/website/ts/pages/documentation/docs_home.tsx
+++ /dev/null
@@ -1,469 +0,0 @@
-import { ALink, colors, Link } from '@0x/react-shared';
-import { ObjectMap } from '@0x/types';
-import * as _ from 'lodash';
-import * as React from 'react';
-import { OverviewContent } from 'ts/components/documentation/overview_content';
-import { NestedSidebarMenu } from 'ts/components/nested_sidebar_menu';
-import { Button } from 'ts/components/ui/button';
-import { DevelopersPage } from 'ts/pages/documentation/developers_page';
-import { Dispatcher } from 'ts/redux/dispatcher';
-import { Categories, Deco, Key, Package, ScreenWidths, TutorialInfo, WebsitePaths } from 'ts/types';
-import { constants } from 'ts/utils/constants';
-import { Translate } from 'ts/utils/translate';
-
-const TUTORIALS: TutorialInfo[] = [
- {
- iconUrl: '/images/developers/tutorials/develop_on_ethereum.svg',
- description: Key.DevelopOnEthereumDescription,
- link: {
- title: Key.DevelopOnEthereum,
- to: `${WebsitePaths.Wiki}#Ethereum-Development`,
- },
- },
- {
- iconUrl: '/images/developers/tutorials/build_a_relayer.svg',
- description: Key.BuildARelayerDescription,
- link: {
- title: Key.BuildARelayer,
- to: `${WebsitePaths.Wiki}#Build-A-Relayer`,
- },
- },
- {
- iconUrl: '/images/developers/tutorials/0x_order_basics.svg',
- description: Key.OrderBasicsDescription,
- link: {
- title: Key.OrderBasics,
- to: `${WebsitePaths.Wiki}#Create,-Validate,-Fill-Order`,
- },
- },
- {
- iconUrl: '/images/developers/tutorials/use_shared_liquidity.svg',
- description: Key.UseNetworkedLiquidityDescription,
- link: {
- title: Key.UseNetworkedLiquidity,
- to: `${WebsitePaths.Wiki}#Find,-Submit,-Fill-Order-From-Relayer`,
- },
- },
- {
- iconUrl: '/images/developers/tutorials/integrate_0x_instant.svg',
- description: Key.Integrate0xInstantDescription,
- link: {
- title: Key.Integrate0xInstant,
- to: `${WebsitePaths.Wiki}#Get-Started-With-Instant`,
- },
- },
-];
-
-const CATEGORY_TO_PACKAGES: ObjectMap<Package[]> = {
- [Categories.ZeroExProtocol]: [
- {
- 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).',
- link: {
- title: '0x.js',
- to: WebsitePaths.ZeroExJs,
- },
- },
- {
- description:
- 'A Typescript starter project that will walk you through the basics of how to interact with 0x Protocol and trade of an SRA relayer',
- link: {
- title: '0x starter project',
- to: 'https://github.com/0xProject/0x-starter-project',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'Launch a 0x relayer in under a minute with Launch Kit. `0x-launch-kit` is an open-source, free-to-use 0x relayer template that you can use as a starting point for your own project.',
- link: {
- title: '0x launch kit',
- to: 'https://github.com/0xProject/0x-launch-kit',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'Reference documentation for the 0x smart contracts. Helpful for dApp developer wanting to integrate 0x at the smart contract level.',
- link: {
- title: '0x smart contracts',
- to: WebsitePaths.SmartContracts,
- },
- },
- {
- 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',
- to: WebsitePaths.Connect,
- },
- },
- {
- description:
- 'Typescript/Javascript wrappers of the 0x protocol Ethereum smart contracts. Use this library to call methods on the 0x smart contracts, subscribe to contract events and to fetch information stored in contracts.',
- link: {
- title: '@0x/contract-wrappers',
- to: WebsitePaths.ContractWrappers,
- },
- },
- {
- description:
- "A package to deploy the 0x protocol's system of smart contracts to the testnet of your choice",
- link: {
- title: '@0x/migrations',
- to: WebsitePaths.Migrations,
- },
- },
- {
- description:
- 'A collection of 0x-related JSON-schemas (incl. SRA request/response schemas, 0x order message format schema, etc...)',
- link: {
- title: '@0x/json-schemas',
- to: WebsitePaths.JSONSchemas,
- },
- },
- {
- description:
- 'A set of utils for working with 0x orders. It includes utilities for creating, signing, validating 0x orders, encoding/decoding assetData and much more.',
- link: {
- title: '@0x/order-utils',
- to: WebsitePaths.OrderUtils,
- },
- },
- {
- description:
- "A daemon that watches a set of 0x orders and emits events when an order's fillability has changed. Can be used by a relayer to prune their orderbook or by a trader to keep their view of the market up-to-date.",
- link: {
- title: '@0x/order-watcher',
- to: WebsitePaths.OrderWatcher,
- },
- },
- {
- description:
- 'A tiny utility library for getting known deployed contract addresses for a particular network.',
- link: {
- title: '@0x/contract-addresses',
- to: 'https://www.npmjs.com/package/@0x/contract-addresses',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: 'Smart contract compilation artifacts for the latest version of the 0x protocol.',
- link: {
- title: '@0x/contract-artifacts',
- to: 'https://www.npmjs.com/package/@0x/contract-artifacts',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'Contains the Standard Relayer API OpenAPI Spec. The package distributes both a javascript object version and a json version.',
- link: {
- title: '@0x/sra-spec',
- to: 'https://github.com/0xProject/0x-monorepo/tree/development/packages/sra-spec',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'Convenience package for buying assets represented on the Ethereum blockchain using 0x. In its simplest form, the package helps in the usage of the [0x forwarder contract](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/forwarder-specification.md), which allows users to execute [Wrapped Ether](https://weth.io/) based 0x orders without having to set allowances, wrap Ether or own ZRX, meaning they can buy tokens with Ether alone. Given some liquidity (0x signed orders), it helps estimate the Ether cost of buying a certain asset (giving a range) and then buying that asset.',
- link: {
- title: '@0x/asset-buyer',
- to: WebsitePaths.AssetBuyer,
- },
- },
- ],
- [Categories.Ethereum]: [
- {
- description:
- "This package allows you to generate TypeScript contract wrappers from ABI files. It's heavily inspired by Geth abigen but takes a different approach. You can write your custom handlebars templates which will allow you to seamlessly integrate the generated code into your existing codebase with existing conventions.",
- link: {
- title: 'abi-gen',
- to: 'https://github.com/0xProject/0x-monorepo/tree/development/packages/abi-gen',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'A collection of Typescript types that are useful when working on an Ethereum-based project (e.g RawLog, Transaction, TxData, SolidityTypes, etc...).',
- link: {
- title: 'ethereum-types',
- to: WebsitePaths.EthereumTypes,
- },
- },
- {
- description:
- 'A wrapper around [solc-js](https://github.com/ethereum/solc-js) that adds smart re-compilation, ability to compile an entire project, Solidity version specific compilation, standard input description support and much more.',
- link: {
- title: '@0x/sol-compiler',
- to: WebsitePaths.SolCompiler,
- },
- },
- {
- description:
- 'A Solidity code coverage tool. Sol-coverage uses transaction traces to figure out which lines of your code has been covered by your tests.',
- link: {
- title: '@0x/sol-coverage',
- to: WebsitePaths.SolCoverage,
- },
- },
- {
- description:
- 'A Solidity profiler. Sol-profiler uses transaction traces to figure out line-by-line gas consumption.',
- link: {
- title: '@0x/sol-profiler',
- to: WebsitePaths.SolProfiler,
- },
- },
- {
- description:
- 'A Solidity revert trace tool. Sol-trace prints human-readable revert trace whenever the revert happens.',
- link: {
- title: '@0x/sol-trace',
- to: WebsitePaths.SolTrace,
- },
- },
- {
- description:
- 'A collection of subproviders to use with [web3-provider-engine](https://www.npmjs.com/package/web3-provider-engine) (e.g subproviders for interfacing with Ledger hardware wallet, Mnemonic wallet, private key wallet, etc...)',
- link: {
- title: '@0x/subproviders',
- to: WebsitePaths.Subproviders,
- },
- },
- {
- description:
- 'A raw Ethereum JSON RPC client to simplify interfacing with Ethereum nodes. Also includes some convenience functions for awaiting transactions to be mined, converting between token units, etc...',
- link: {
- title: '@0x/web3-wrapper',
- to: WebsitePaths.Web3Wrapper,
- },
- },
- ],
- [Categories.CommunityMaintained]: [
- {
- description:
- 'Node.js worker originally built for 0x Tracker which extracts 0x fill events from the Ethereum blockchain and persists them to MongoDB. Support for both V1 and V2 of the 0x protocol is included with events tagged against the protocol version they belong to.',
- link: {
- title: '0x Event Extractor',
- to: 'https://github.com/0xTracker/0x-event-extractor',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'Node.js worker built for 0x Tracker which performs various ETL tasks related to the 0x protocol trading data and other information used on 0x Tracker.',
- link: {
- title: '0x Tracker Worker',
- to: 'https://github.com/0xTracker/0x-tracker-worker',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- "ERCdEX's Javascript SDK for trading on their relayer, as well as other Aquaduct partner relayers",
- link: {
- title: 'Aquaduct',
- to: 'https://www.npmjs.com/package/aqueduct',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'SDKs for automation using Aqueduct & ERC dEX. Aqueduct Server is a lightweight, portable and secure server that runs locally on any workstation. The server exposes a small number of foundational endpoints that enable working with the decentralized Aqueduct liquidity pool from any context or programming language.',
- link: {
- title: 'Aquaduct Server SDK',
- to: 'https://github.com/ERCdEX/aqueduct-server-sdk',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: 'A node.js SDK for trading on the DDEX relayer',
- link: {
- to: 'https://www.npmjs.com/package/ddex-api',
- title: 'DDEX Node.js SDK',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: "The ERCdEX Trade Widget let's any website provide token liquidity to it's users",
- link: {
- to: 'https://github.com/ERCdEX/widget',
- title: 'ERCdEX Widget',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: "ERCdEX's Java SDK for trading on their relayer, as well as other Aquaduct partner relayers",
- link: {
- to: 'https://github.com/ERCdEX/java',
- title: 'ERCdEX Java SDK',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: "ERCdEX's Python SDK for trading on their relayer, as well as other Aquaduct partner relayers",
- link: {
- to: 'https://github.com/ERCdEX/python',
- title: 'ERCdEX Python SDK',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'A set of command-line tools for creating command-line scripts for interacting with the Ethereum blockchain in general, and 0x in particular',
- link: {
- title: 'Massive',
- to: 'https://github.com/NoteGio/massive',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: 'An open-source API-only Relayer written in Go',
- link: {
- to: 'https://github.com/NoteGio/openrelay',
- title: 'OpenRelay',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'A JavaScript Library for Interacting with OpenRelay.xyz and other 0x Standard Relayer API Implementations',
- link: {
- title: 'OpenRelay.js',
- to: 'https://github.com/NoteGio/openrelay.js',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'The Radar Relay SDK is a software development kit that simplifies the interactions with Radar Relay’s APIs',
- link: {
- title: 'Radar SDK',
- to: 'https://github.com/RadarRelay/sdk',
- shouldOpenInNewTab: true,
- },
- },
- {
- description:
- 'The Ocean provides a simple REST API, WebSockets API, and JavaScript library to help you integrate decentralized trading into your existing trading strategy.',
- link: {
- title: 'The Ocean Javascript SDK',
- to: 'https://github.com/TheOceanTrade/theoceanx-javascript',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: "Tokenlon SDK provides APIs for developers to trade of imToken's relayer",
- link: {
- to: 'https://www.npmjs.com/package/tokenlon-sdk',
- title: 'Tokenlon Javascript SDK',
- shouldOpenInNewTab: true,
- },
- },
- {
- description: 'A small library that implements the 0x order assetData encoding/decoding in Java',
- link: {
- to: 'https://github.com/wildnothing/asset-data-decoder',
- title: 'AssetData decoder library in Java',
- shouldOpenInNewTab: true,
- },
- },
- ],
-};
-
-export interface DocsHomeProps {
- location: Location;
- translate: Translate;
- screenWidth: ScreenWidths;
- tutorials: TutorialInfo[];
- categoryToPackages: ObjectMap<Package[]>;
- dispatcher: Dispatcher;
-}
-
-export interface DocsHomeState {}
-
-export class DocsHome extends React.Component<DocsHomeProps, DocsHomeState> {
- public render(): React.ReactNode {
- const sectionNameToLinks: ObjectMap<ALink[]> = {
- 'Starter guides': _.map(TUTORIALS, tutorialInfo => {
- return {
- ...tutorialInfo.link,
- title: this.props.translate.get(tutorialInfo.link.title as Key, Deco.Cap),
- };
- }),
- [Categories.ZeroExProtocol]: _.map(CATEGORY_TO_PACKAGES[Categories.ZeroExProtocol], pkg => pkg.link),
- [Categories.Ethereum]: _.map(CATEGORY_TO_PACKAGES[Categories.Ethereum], pkg => pkg.link),
- [Categories.CommunityMaintained]: _.map(
- CATEGORY_TO_PACKAGES[Categories.CommunityMaintained],
- pkg => pkg.link,
- ),
- };
- const mainContent = (
- <OverviewContent
- translate={this.props.translate}
- tutorials={TUTORIALS}
- categoryToPackages={CATEGORY_TO_PACKAGES}
- />
- );
- const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
- const sidebar = (
- <NestedSidebarMenu
- sidebarHeader={isSmallScreen ? this._renderSidebarHeader() : undefined}
- sectionNameToLinks={sectionNameToLinks}
- shouldReformatMenuItemNames={false}
- screenWidth={this.props.screenWidth}
- />
- );
- return (
- <DevelopersPage
- mainContent={mainContent}
- sidebar={sidebar}
- location={this.props.location}
- screenWidth={this.props.screenWidth}
- translate={this.props.translate}
- dispatcher={this.props.dispatcher}
- />
- );
- }
- private _renderSidebarHeader(): React.ReactNode {
- const menuItems = _.map(constants.DEVELOPER_TOPBAR_LINKS, menuItemInfo => {
- return (
- <Link
- key={`menu-item-${menuItemInfo.title}`}
- to={menuItemInfo.to}
- shouldOpenInNewTab={menuItemInfo.shouldOpenInNewTab}
- >
- <Button
- borderRadius="4px"
- padding="0.4em 0.375em"
- width="100%"
- fontColor={colors.grey800}
- fontSize="14px"
- textAlign="left"
- >
- {this.props.translate.get(menuItemInfo.title as Key, Deco.Cap)}
- </Button>
- </Link>
- );
- });
- return menuItems;
- }
-}