diff --git a/.gitignore b/.gitignore index 95a1c083c3..7b827520b9 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,7 @@ build/Release node_modules/ jspm_packages/ -# Typescript v1 declaration files +# TypeScript v1 declaration files typings/ # NVM config diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aea2f10e24..c2ad992330 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ If an entry without a `timestamp` already exists, this means other changes have ### Development Tooling -We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in Typescript and it offers amazing support for the language. +We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in TypeScript and it offers amazing support for the language. #### Linter @@ -89,7 +89,7 @@ A few of our coding conventions are not yet enforced by the linter/auto-formatte 1. Do not import from a project's `index.ts` (e.g import { Token } from '../src';). Always import from the source file itself. 1. Generic error variables should be named `err` instead of `e` or `error`. 1. If you _must_ cast a variable to any - try to type it back as fast as possible. (e.g., `const cw = ((zeroEx as any)._contractWrappers as ContractWrappers);`). This ensures subsequent code is type-safe. -1. Our enum conventions coincide with the recommended Typescript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'` +1. Our enum conventions coincide with the recommended TypeScript conventions, using capitalized keys, and all-caps snake-case values. Eg `GetStats = 'GET_STATS'` 1. All public, exported methods/functions/classes must have associated Javadoc-style comments. ### Fix `submit-coverage` CI failure diff --git a/README.md b/README.md index 9deabd51db..7408be2a80 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,12 @@ These packages are all under development. See [/contracts/README.md](/contracts/ | [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [![npm](https://img.shields.io/npm/v/@0x/contracts-exchange-libs.svg)](https://www.npmjs.com/package/@0x/contracts-exchange-libs) | Protocol specific libraries used within the [`Exchange`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#exchange) contract | | [`@0x/contracts-extensions`](/contracts/extensions) | [![npm](https://img.shields.io/npm/v/@0x/contracts-extensions.svg)](https://www.npmjs.com/package/@0x/contracts-extensions) | Contracts that interact with and extend the functionality of the core protocol | | [`@0x/contracts-multisig`](/contracts/multisig) | [![npm](https://img.shields.io/npm/v/@0x/contracts-multisig.svg)](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol | -| [`@0x/contracts-test-utils`](/contracts/test-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-test-utils.svg)](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts | +| [`@0x/contracts-test-utils`](/contracts/test-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-test-utils.svg)](https://www.npmjs.com/package/@0x/contracts-test-utils) | TypeScript/Javascript shared utilities used for testing contracts | | [`@0x/contracts-utils`](/contracts/utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-utils.svg)](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts | | [`@0x/contracts-coordinator`](/contracts/coordinator) | [![npm](https://img.shields.io/npm/v/@0x/contracts-coordinator.svg)](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator | | [`@0x/contracts-dev-utils`](/contracts/dev-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-dev-utils.svg)](https://www.npmjs.com/package/@0x/contracts-dev-utils) | A contract contains utility functions for developers (such as validating many orders using a single eth_call) | -### Typescript/Javascript Packages +### TypeScript/Javascript Packages #### 0x-specific packages diff --git a/packages/ethereum-types/README.md b/packages/ethereum-types/README.md index 817e22d153..2b992a1c75 100644 --- a/packages/ethereum-types/README.md +++ b/packages/ethereum-types/README.md @@ -1,6 +1,6 @@ ## ethereum-types -Typescript types shared across Ethereum-related packages/libraries/tools. +TypeScript types shared across Ethereum-related packages/libraries/tools. ## Installation diff --git a/packages/instant/src/util/heap.ts b/packages/instant/src/util/heap.ts index 63d96e63b5..c644b55cd9 100644 --- a/packages/instant/src/util/heap.ts +++ b/packages/instant/src/util/heap.ts @@ -37,7 +37,7 @@ const setupZeroExInstantHeap = () => { // Set property to specify that this is zeroEx's heap curWindow.zeroExInstantLoadedHeap = true; - // Typescript-compatible version of https://docs.heapanalytics.com/docs/installation + // TypeScript-compatible version of https://docs.heapanalytics.com/docs/installation /* tslint:disable */ ((window as any).heap = (window as any).heap || []), ((window as any).heap.load = function(e: any, t: any) { diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index 4ad135996a..a0d0bd1603 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -105,7 +105,7 @@ async function testInstallPackageAsync( utils.log(`Testing ${packageName}@${lastChangelogVersion}`); const packageDirName = path.join(...`${packageName}-test`.split('/')); // NOTE(fabio): The `testDirectory` needs to be somewhere **outside** the monorepo root directory. - // Otherwise, it will have access to the hoisted `node_modules` directory and the Typescript missing + // Otherwise, it will have access to the hoisted `node_modules` directory and the TypeScript missing // type errors will not be caught. const testDirectory = path.join(monorepoRootPath, '..', '.installation-test', packageDirName); await rimrafAsync(testDirectory); diff --git a/packages/order-utils/docs/reference.mdx b/packages/order-utils/docs/reference.mdx index 4a95b56a60..6922431311 100644 --- a/packages/order-utils/docs/reference.mdx +++ b/packages/order-utils/docs/reference.mdx @@ -553,7 +553,7 @@ ___ *Defined in [order-utils/src/order_validation_utils.ts:34](https://github.com/0xProject/0x-monorepo/blob/abf1141ad/packages/order-utils/src/order_validation_utils.ts#L34)* -A Typescript implementation mirroring the implementation of isRoundingError in the +A TypeScript implementation mirroring the implementation of isRoundingError in the Exchange smart contract **Parameters:** diff --git a/packages/order-utils/src/order_validation_utils.ts b/packages/order-utils/src/order_validation_utils.ts index 9c5309e264..868dae9ffb 100644 --- a/packages/order-utils/src/order_validation_utils.ts +++ b/packages/order-utils/src/order_validation_utils.ts @@ -25,7 +25,7 @@ export class OrderValidationUtils { private readonly _orderFilledCancelledFetcher: AbstractOrderFilledCancelledFetcher; private readonly _provider: ZeroExProvider; /** - * A Typescript implementation mirroring the implementation of isRoundingError in the + * A TypeScript implementation mirroring the implementation of isRoundingError in the * Exchange smart contract * @param numerator Numerator value. When used to check an order, pass in `takerAssetFilledAmount` * @param denominator Denominator value. When used to check an order, pass in `order.takerAssetAmount` diff --git a/packages/types/README.md b/packages/types/README.md index 136eb19403..fcaf5aaa04 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -1,6 +1,6 @@ ## @0x/types -Typescript types shared across 0x projects and packages +TypeScript types shared across 0x projects and packages ## Installation diff --git a/packages/utils/src/configured_bignumber.ts b/packages/utils/src/configured_bignumber.ts index 34b57d3031..42d3aa3785 100644 --- a/packages/utils/src/configured_bignumber.ts +++ b/packages/utils/src/configured_bignumber.ts @@ -16,7 +16,7 @@ BigNumber.config({ import isNode = require('detect-node'); if (isNode) { // Dynamically load a NodeJS specific module. - // Typescript requires all imports to be global, so we need to use + // TypeScript requires all imports to be global, so we need to use // `const` here and disable the tslint warning. // tslint:disable-next-line: no-var-requires const util = require('util'); diff --git a/packages/website/mdx/core-concepts/index.mdx b/packages/website/mdx/core-concepts/index.mdx index 3bc413d1ac..284bb12e15 100644 --- a/packages/website/mdx/core-concepts/index.mdx +++ b/packages/website/mdx/core-concepts/index.mdx @@ -194,10 +194,10 @@ There are two main Ethereum clients that most developers use: [Parity](https://w Every Ethereum node exposes an API that let's the outside world interact with it (e.g., submit transactions, call smart contract functions, etc...). This API adheres to the [JSON-RPC 2.0 standard](https://www.jsonrpc.org/specification) and has many [standardized methods](https://github.com/ethereum/wiki/wiki/JSON-RPC). Most Ethereum libraries come bundled with an Ethereum JSON-RPC client, including the following: - [Web3.py](https://github.com/ethereum/web3.py) (Python) -- [Ethers.js](https://github.com/ethers-io/ethers.js/) (Typescript/Javascript) +- [Ethers.js](https://github.com/ethers-io/ethers.js/) (TypeScript/Javascript) - [Web3.j](https://github.com/web3j/web3j) (Java) -In addition to being the API for interacting with Ethereum nodes, Ethereum JSON-RPC has also become the interface through which 0x libraries interact with Ethereum nodes and signers. Many of our methods and classes will require that you pass in a "provider", which is an instance of a class that exposes a single method through which JSON-RPC requests can be made. JSON-RPC requests that interact with the Ethereum network such as [eth_sendTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendTransaction) will get proxied through the provider to an Ethereum node, however requests to sign a transaction such as [eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign) can be sent to any signer you desire (e.g., [Metamask](https://metamask.io/), [Coinbase wallet](https://wallet.coinbase.com/), a [Ledger hardware wallet](https://www.ledger.com/), a private key signer, a mnemonic signer, etc...). Typescript developers can use the [@0x/subproviders](https://0x.org/docs/tools/subproviders) library to construct a provider, and Python developers can use [0x-middlewares](https://github.com/0xProject/0x-monorepo/tree/development/python-packages/middlewares). +In addition to being the API for interacting with Ethereum nodes, Ethereum JSON-RPC has also become the interface through which 0x libraries interact with Ethereum nodes and signers. Many of our methods and classes will require that you pass in a "provider", which is an instance of a class that exposes a single method through which JSON-RPC requests can be made. JSON-RPC requests that interact with the Ethereum network such as [eth_sendTransaction](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sendTransaction) will get proxied through the provider to an Ethereum node, however requests to sign a transaction such as [eth_sign](https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign) can be sent to any signer you desire (e.g., [Metamask](https://metamask.io/), [Coinbase wallet](https://wallet.coinbase.com/), a [Ledger hardware wallet](https://www.ledger.com/), a private key signer, a mnemonic signer, etc...). TypeScript developers can use the [@0x/subproviders](https://0x.org/docs/tools/subproviders) library to construct a provider, and Python developers can use [0x-middlewares](https://github.com/0xProject/0x-monorepo/tree/development/python-packages/middlewares). ### Interacting with 0x on Ethereum diff --git a/packages/website/mdx/guides/market-making-on-0x.mdx b/packages/website/mdx/guides/market-making-on-0x.mdx index 76df48c8ac..e0662d770d 100644 --- a/packages/website/mdx/guides/market-making-on-0x.mdx +++ b/packages/website/mdx/guides/market-making-on-0x.mdx @@ -36,7 +36,7 @@ In both models, the relayer never has custody over a trader's assets. # Creating orders -0x orders only exist off-chain and are completely free to create. In order to create a valid 0x order, you can use the [@0x/order-utils](https://0x.org/docs/tools/order-utils) Typescript/Javascript library, or alternatively the [0x-order-utils.py](http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/) Python library. These libraries will help you: +0x orders only exist off-chain and are completely free to create. In order to create a valid 0x order, you can use the [@0x/order-utils](https://0x.org/docs/tools/order-utils) TypeScript/Javascript library, or alternatively the [0x-order-utils.py](http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/) Python library. These libraries will help you: 1. Generate an order in the proper format (e.g encoding/decoding [`assetData`](https://0x.org/docs/guides/v2-specification#assetdata)) 2. Generating a proper hash for the order contents @@ -96,7 +96,7 @@ Explicitly cancelling orders always requires an on-chain transaction. However, y # Fetching off-chain orders -Since 0x orders live off-chain, they must be fetched from relayers. All relayers host APIs that allow you to pull orders from their orderbook. In order to make life easier for traders, many implement the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/), allowing you to use a single client to fetch orders from multiple relayers. Standard Relayer API clients exist in [Python](https://pypi.org/project/0x-sra-client/) and [Typescript/Javascript](https://0x.org/docs/tools/connect). +Since 0x orders live off-chain, they must be fetched from relayers. All relayers host APIs that allow you to pull orders from their orderbook. In order to make life easier for traders, many implement the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/), allowing you to use a single client to fetch orders from multiple relayers. Standard Relayer API clients exist in [Python](https://pypi.org/project/0x-sra-client/) and [TypeScript/Javascript](https://0x.org/docs/tools/connect). To learn more about fetching orders from relayers, check out our [How to use the Standard Relayer API tutorial](https://0x.org/docs/guides/using-the-standard-relayer-api). @@ -167,7 +167,7 @@ The 0x protocol expects a user's assets to be located in their own wallet, rathe ## What is the state of 0x developer tooling? -Currently we have the best tooling support for Javascript/Typescript and are actively improving support for Python. Visit the [developers section](https://0x.org/docs) of our site for a full-list of developer tools avaiable. +Currently we have the best tooling support for Javascript/TypeScript and are actively improving support for Python. Visit the [developers section](https://0x.org/docs) of our site for a full-list of developer tools avaiable. If you plan on implementing custom infrastructure, you will need the following functionality at a bare minimum: diff --git a/packages/website/mdx/guides/page-template.mdx b/packages/website/mdx/guides/page-template.mdx index 0c2dd4ef0f..779357dff6 100644 --- a/packages/website/mdx/guides/page-template.mdx +++ b/packages/website/mdx/guides/page-template.mdx @@ -74,7 +74,7 @@ const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion); # Code Tabs - + ```js canRun /// @param salt Arbitrary number to ensure uniqueness of transaction hash. diff --git a/packages/website/mdx/tools/ethereum-types/v2.1.4/README.md b/packages/website/mdx/tools/ethereum-types/v2.1.4/README.md index 8ccf3f9698..2b992a1c75 100644 --- a/packages/website/mdx/tools/ethereum-types/v2.1.4/README.md +++ b/packages/website/mdx/tools/ethereum-types/v2.1.4/README.md @@ -1,6 +1,6 @@ ## ethereum-types -Typescript types shared across Ethereum-related packages/libraries/tools. +TypeScript types shared across Ethereum-related packages/libraries/tools. ## Installation @@ -58,4 +58,4 @@ yarn clean ```bash yarn lint -``` \ No newline at end of file +```