Fix casing on TypeScript
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -40,7 +40,7 @@ build/Release
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# NVM config
|
||||
|
@@ -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
|
||||
|
@@ -43,12 +43,12 @@ These packages are all under development. See [/contracts/README.md](/contracts/
|
||||
| [`@0x/contracts-exchange-libs`](/contracts/exchange-libs) | [](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) | [](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) | [](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) | [](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts |
|
||||
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [](https://www.npmjs.com/package/@0x/contracts-test-utils) | TypeScript/Javascript shared utilities used for testing contracts |
|
||||
| [`@0x/contracts-utils`](/contracts/utils) | [](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts |
|
||||
| [`@0x/contracts-coordinator`](/contracts/coordinator) | [](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) | [](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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
|
@@ -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:**
|
||||
|
@@ -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`
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## @0x/types
|
||||
|
||||
Typescript types shared across 0x projects and packages
|
||||
TypeScript types shared across 0x projects and packages
|
||||
|
||||
## Installation
|
||||
|
||||
|
@@ -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');
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -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:
|
||||
|
||||
|
@@ -74,7 +74,7 @@ const artifactAdapter = new TruffleArtifactAdapter(projectRoot, solcVersion);
|
||||
|
||||
# Code Tabs
|
||||
|
||||
<CodeTabs tabs={['Typescript', 'Python']}>
|
||||
<CodeTabs tabs={['TypeScript', 'Python']}>
|
||||
|
||||
```js canRun
|
||||
/// @param salt Arbitrary number to ensure uniqueness of transaction hash.
|
||||
|
@@ -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
|
||||
```
|
||||
```
|
||||
|
Reference in New Issue
Block a user