Merge branch 'development' into feature/instant/open-close-events
This commit is contained in:
39
.github/autolabeler.yml
vendored
Normal file
39
.github/autolabeler.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
python: ['python-packages']
|
||||
contracts: ['contracts']
|
||||
sol-doc: ['packages/sol-doc']
|
||||
sol-resolver: ['packages/sol-resolver']
|
||||
sra-spec: ['packages/sra-spec']
|
||||
subproviders: ['packages/subproviders']
|
||||
contract-addresses: ['packages/contract-addresses']
|
||||
migrations: ['packages/migrations']
|
||||
web3-wrapper: ['packages/web3-wrapper']
|
||||
sol-compiler: ['packages/sol-compiler']
|
||||
types: ['packages/types']
|
||||
instant: ['packages/instant']
|
||||
abi-gen-templates: ['packages/abi-gen-templates']
|
||||
abi-gen: ['packages/abi-gen']
|
||||
website: ['packages/website']
|
||||
sol-cov: ['packages/sol-cov']
|
||||
utils: ['packages/utils']
|
||||
tslint-config: ['packages/tslint-config']
|
||||
asset-buyer: ['packages/asset-buyer']
|
||||
order-watcher: ['packages/order-watcher']
|
||||
react-docs: ['packages/react-docs']
|
||||
order-utils: ['packages/order-utils']
|
||||
react-shared: ['packages/react-shared']
|
||||
assert: ['packages/assert']
|
||||
base-contract: ['packages/base-contract']
|
||||
typescript-typings: ['packages/typescript-typings']
|
||||
0x.js: ['packages/0x.js']
|
||||
abi-gen-wrappers: ['packages/abi-gen-wrappers']
|
||||
metacoin: ['packages/metacoin']
|
||||
contract-artifacts: ['packages/contract-artifacts']
|
||||
dev-utils: ['packages/dev-utils']
|
||||
contract-wrappers: ['packages/contract-wrappers']
|
||||
json-schemas: ['packages/json-schemas']
|
||||
ethereum-types: ['ethereum-types']
|
||||
connect: ['packages/connect']
|
||||
fill-scenarios: ['packages/fill-scenarios']
|
||||
dev-tools-pages: ['packages/dev-tools-pages']
|
||||
testnet-faucets: ['packages/testnet-faucets']
|
||||
monorepo-scripts: ['packages/monorepo-scripts']
|
||||
@@ -46,10 +46,14 @@
|
||||
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
|
||||
| Package | Version |
|
||||
| ------------------: | :------ |
|
||||
| `0x.js` | 0.25.0 |
|
||||
| `Exchange Contract` | v1 |
|
||||
| Package | Version |
|
||||
| ------: | :------ |
|
||||
|
||||
|
||||
<!-- For example:
|
||||
| `0x.js` | 2.0.4 |
|
||||
| `Exchange Contract` | v2 |
|
||||
-->
|
||||
|
||||
| Network |
|
||||
| ------- |
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<!--- The following points should be used to indicate the progress of your PR. Put an `x` in all the boxes that apply right now, and come back over time and check them off as you make progress. If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||
|
||||
* [ ] Prefix PR title with `[WIP]` if necessary.
|
||||
* [ ] Prefix PR title with bracketed package name(s) corresponding to the changed package(s). For example: `[sol-cov] Fixed bug`.
|
||||
* [ ] Add tests to cover changes as needed.
|
||||
* [ ] Update documentation as needed.
|
||||
* [ ] Add new entries to the relevant CHANGELOG.jsons.
|
||||
|
||||
111
README.md
111
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
---
|
||||
|
||||
[0x][website-url] is an open protocol that facilitates trustless, low friction exchange of Ethereum-based assets. A full description of the protocol may be found in our [whitepaper][whitepaper-url].
|
||||
[0x][website-url] is an open protocol that facilitates trustless, low friction exchange of Ethereum-based assets. For more information on how it works, check out the [0x protocol specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md).
|
||||
|
||||
This repository is a monorepo including the 0x protocol smart contracts and numerous developer tools. Each public sub-package is independently published to NPM.
|
||||
|
||||
@@ -18,71 +18,72 @@ If you're developing on 0x now or are interested in using 0x infrastructure in t
|
||||
[](https://gitter.im/0xProject/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
|
||||
### Published Packages
|
||||
## Packages
|
||||
|
||||
#### TypeScript/JavaScript
|
||||
Visit our [developer portal](https://0xproject.com/docs/order-utils) for a comprehensive list of core & community maintained packages. All packages maintained with this monorepo are listed below.
|
||||
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| [`0x.js`](/packages/0x.js) | [](https://www.npmjs.com/package/0x.js) | A Javascript library for interacting with the 0x protocol |
|
||||
| [`@0x/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using @0x/abi-gen |
|
||||
| [`@0x/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0x/asset-buyer`](/packages/asset-buyer) | [](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
|
||||
| [`@0x/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
||||
| [`@0x/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0x/connect) | A Javascript library for interacting with the Standard Relayer API |
|
||||
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | Used to get known addresses of deployed 0x contracts |
|
||||
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
||||
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | Smart TS wrappers for 0x smart contracts |
|
||||
| [`@0x/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x projects and packages |
|
||||
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generation |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related json schemas |
|
||||
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | 0x smart contract migrations |
|
||||
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`@0x/order-watcher`](/packages/order-watcher) | [](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
|
||||
| [`@0x/react-docs`](/packages/react-docs) | [](https://www.npmjs.com/package/@0x/react-docs) | React documentation component for rendering TypeDoc & Doxity generated JSON |
|
||||
| [`@0x/react-shared`](/packages/react-shared) | [](https://www.npmjs.com/package/@0x/react-shared) | 0x shared react components |
|
||||
| [`@0x/sol-compiler`](/packages/sol-compiler) | [](https://www.npmjs.com/package/@0x/sol-compiler) | A thin wrapper around Solc.js that outputs artifacts, resolves imports, only re-compiles when needed, and other niceties |
|
||||
| [`@0x/sol-cov`](/packages/sol-cov) | [](https://www.npmjs.com/package/@0x/sol-cov) | Solidity test coverage tool |
|
||||
| [`@0x/sol-doc`](/packages/sol-doc) | [](https://www.npmjs.com/package/@0x/sol-doc) | Solidity documentation generator |
|
||||
| [`@0x/sol-resolver`](/packages/sol-resolver) | [](https://www.npmjs.com/package/@0x/sol-resolver) | Import resolver for smart contracts dependencies |
|
||||
| [`@0x/sra-spec`](/packages/sra-spec) | [](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the standard relayer API |
|
||||
| [`@0x/subproviders`](/packages/subproviders) | [](https://www.npmjs.com/package/@0x/subproviders) | Useful web3 subproviders (e.g. LedgerSubprovider) |
|
||||
| [`@0x/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0x/tslint-config) | Custom 0x development TSLint rules |
|
||||
| [`@0x/types`](/packages/types) | [](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
|
||||
| [`@0x/typescript-typings`](/packages/typescript-typings) | [](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
|
||||
| [`@0x/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
|
||||
| [`@0x/web3-wrapper`](/packages/web3-wrapper) | [](https://www.npmjs.com/package/@0x/web3-wrapper) | Web3 wrapper |
|
||||
|
||||
#### Python
|
||||
### Python Packages
|
||||
|
||||
| Package | Version | Description |
|
||||
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| [`0x-order-utils.py`](/python-packages/order_utils) | [](https://pypi.org/project/0x-order-utils/) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
|
||||
### Private Packages
|
||||
### Typescript/Javascript Packages
|
||||
|
||||
| Package | Description |
|
||||
| -------------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| [`@0x/contracts`](/packages/contracts) | 0x solidity smart contracts & tests |
|
||||
| [`@0x/react-docs-example`](/packages/react-docs-example) | Example documentation site created with `@0x/react-docs` |
|
||||
| [`@0x/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
|
||||
| [`@0x/website`](/packages/website) | 0x website & Portal DApp |
|
||||
#### 0x-specific packages
|
||||
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
||||
| [`0x.js`](/packages/0x.js) | [](https://www.npmjs.com/package/0x.js) | An aggregate package combining many smaller utility packages for interacting with the 0x protocol |
|
||||
| [`@0x/contract-addresses`](/packages/contract-addresses) | [](https://www.npmjs.com/package/@0x/contract-addresses) | A tiny utility library for getting known deployed contract addresses for a particular network. |
|
||||
| [`@0x/contract-wrappers`](/packages/contract-wrappers) | [](https://www.npmjs.com/package/@0x/contract-wrappers) | JS/TS wrappers for interacting with the 0x smart contracts |
|
||||
| [`@0x/order-utils`](/packages/order-utils) | [](https://www.npmjs.com/package/@0x/order-utils) | A set of utilities for generating, parsing, signing and validating 0x orders |
|
||||
| [`@0x/json-schemas`](/packages/json-schemas) | [](https://www.npmjs.com/package/@0x/json-schemas) | 0x-related JSON schemas |
|
||||
| [`@0x/order-watcher`](/packages/order-watcher) | [](https://www.npmjs.com/package/@0x/order-watcher) | An order watcher daemon that watches for order validity |
|
||||
| [`@0x/migrations`](/packages/migrations) | [](https://www.npmjs.com/package/@0x/migrations) | Migration tool for deploying 0x smart contracts on private testnets |
|
||||
| [`@0x/contract-artifacts`](/packages/contract-artifacts) | [](https://www.npmjs.com/package/@0x/contract-artifacts) | 0x smart contract compilation artifacts |
|
||||
| [`@0x/abi-gen-wrappers`](/packages/abi-gen-wrappers) | [](https://www.npmjs.com/package/@0x/abi-gen-wrappers) | Low-level 0x smart contract wrappers generated using `@0x/abi-gen` |
|
||||
| [`@0x/sra-spec`](/packages/sra-spec) | [](https://www.npmjs.com/package/@0x/sra-spec) | OpenAPI specification for the Standard Relayer API |
|
||||
| [`@0x/connect`](/packages/connect) | [](https://www.npmjs.com/package/@0x/connect) | An HTTP/WS client for interacting with the Standard Relayer API |
|
||||
| [`@0x/asset-buyer`](/packages/asset-buyer) | [](https://www.npmjs.com/package/@0x/asset-buyer) | Convenience package for discovering and buying assets with Ether |
|
||||
|
||||
#### Ethereum tooling
|
||||
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [`@0x/web3-wrapper`](/packages/web3-wrapper) | [](https://www.npmjs.com/package/@0x/web3-wrapper) | An Ethereum JSON RPC client |
|
||||
| [`@0x/sol-compiler`](/packages/sol-compiler) | [](https://www.npmjs.com/package/@0x/sol-compiler) | A wrapper around solc-js that adds smart re-compilation, ability to compile an entire project, Solidity version specific compilation, standard input description support and much more. |
|
||||
| [`@0x/sol-cov`](/packages/sol-cov) | [](https://www.npmjs.com/package/@0x/sol-cov) | A solidity test coverage tool |
|
||||
| [`@0x/sol-resolver`](/packages/sol-resolver) | [](https://www.npmjs.com/package/@0x/sol-resolver) | Import resolver for smart contracts dependencies |
|
||||
| [`@0x/subproviders`](/packages/subproviders) | [](https://www.npmjs.com/package/@0x/subproviders) | Web3 provider middlewares (e.g. LedgerSubprovider) |
|
||||
| [`@0x/sol-doc`](/packages/sol-doc) | [](https://www.npmjs.com/package/@0x/sol-doc) | Solidity documentation generator |
|
||||
|
||||
#### Utilities
|
||||
|
||||
| Package | Version | Description |
|
||||
| -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
|
||||
| [`@0x/abi-gen`](/packages/abi-gen) | [](https://www.npmjs.com/package/@0x/abi-gen) | Tool to generate TS wrappers from smart contract ABIs |
|
||||
| [`@0x/tslint-config`](/packages/tslint-config) | [](https://www.npmjs.com/package/@0x/tslint-config) | Custom TSLint rules used by the 0x core team |
|
||||
| [`@0x/types`](/packages/types) | [](https://www.npmjs.com/package/@0x/types) | Shared type declarations |
|
||||
| [`@0x/typescript-typings`](/packages/typescript-typings) | [](https://www.npmjs.com/package/@0x/typescript-typings) | Repository of types for external packages |
|
||||
| [`@0x/utils`](/packages/utils) | [](https://www.npmjs.com/package/@0x/utils) | Shared utilities |
|
||||
| [`@0x/react-docs`](/packages/react-docs) | [](https://www.npmjs.com/package/@0x/react-docs) | React documentation component for rendering TypeDoc & sol-doc generated JSON |
|
||||
| [`@0x/react-shared`](/packages/react-shared) | [](https://www.npmjs.com/package/@0x/react-shared) | 0x shared react components |
|
||||
| [`@0x/assert`](/packages/assert) | [](https://www.npmjs.com/package/@0x/assert) | Type and schema assertions used by our packages |
|
||||
| [`@0x/base-contract`](/packages/base-contract) | [](https://www.npmjs.com/package/@0x/base-contract) | BaseContract used by auto-generated `abi-gen` wrapper contracts |
|
||||
| [`@0x/dev-utils`](/packages/dev-utils) | [](https://www.npmjs.com/package/@0x/dev-utils) | Dev utils to be shared across 0x packages |
|
||||
| [`@0x/fill-scenarios`](/packages/fill-scenarios) | [](https://www.npmjs.com/package/@0x/fill-scenarios) | 0x order fill scenario generator |
|
||||
|
||||
#### Private Packages
|
||||
|
||||
| Package | Description |
|
||||
| -------------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| [`@0x/contracts`](/packages/contracts) | 0x protocol solidity smart contracts & tests |
|
||||
| [`@0x/testnet-faucets`](/packages/testnet-faucets) | A faucet micro-service that dispenses test ERC20 tokens or Ether |
|
||||
| [`@0x/website`](/packages/website) | 0x website |
|
||||
|
||||
## Usage
|
||||
|
||||
Dedicated documentation pages:
|
||||
|
||||
* [0x.js Library](https://0xproject.com/docs/0xjs)
|
||||
* [0x Connect](https://0xproject.com/docs/connect)
|
||||
* [Smart contracts](https://0xproject.com/docs/contracts)
|
||||
* [Subproviders](https://0xproject.com/docs/subproviders)
|
||||
* [Sol Compiler](https://0xproject.com/docs/sol-compiler)
|
||||
* [Web3-wrapper](https://0xproject.com/docs/web3-wrapper)
|
||||
* [JSON-schemas](https://0xproject.com/docs/json-schemas)
|
||||
* [Sol-cov](https://0xproject.com/docs/sol-cov)
|
||||
* [Standard Relayer API](https://github.com/0xProject/standard-relayer-api/blob/master/README.md)
|
||||
|
||||
Node version >= 6.12 is required.
|
||||
|
||||
Most of the packages require additional typings for external dependencies.
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
"install:all": "yarn install",
|
||||
"wsrun": "wsrun",
|
||||
"lerna": "lerna",
|
||||
"build": "wsrun build $PKG --fast-exit -r --stages",
|
||||
"build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0x/website",
|
||||
"build:ci:no_website": "wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website",
|
||||
"build": "wsrun build $PKG --fast-exit -r --stages --exclude-missing",
|
||||
"build:no_website": "wsrun build $PKG --fast-exit -r --stages --exclude @0x/website --exclude-missing",
|
||||
"build:ci:no_website": "wsrun build:ci $PKG --fast-exit -r --stages --exclude @0x/website --exclude-missing",
|
||||
"build:monorepo_scripts": "PKG=@0x/monorepo-scripts yarn build",
|
||||
"build:ts": "tsc -b",
|
||||
"watch:ts": "tsc -b -w",
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"config": {
|
||||
"mnemonic": "concert load couple harbor equip island argue ramp clarify fence smart topic",
|
||||
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-cov ethereum-types asset-buyer"
|
||||
"packagesWithDocPages": "0x.js connect json-schemas subproviders web3-wrapper contract-wrappers order-utils order-watcher sol-compiler sol-cov ethereum-types asset-buyer migrations"
|
||||
},
|
||||
"bundlewatch": {
|
||||
"files": [
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "2.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "2.0.4",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.5 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.4 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "2.0.4",
|
||||
"version": "2.0.5",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,11 +42,10 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.16",
|
||||
"@0x/abi-gen-wrappers": "^1.0.5",
|
||||
"@0x/contract-addresses": "^1.1.0",
|
||||
"@0x/dev-utils": "^1.0.17",
|
||||
"@0x/migrations": "^2.0.4",
|
||||
"@0x/abi-gen-wrappers": "^1.1.0",
|
||||
"@0x/contract-addresses": "^1.2.0",
|
||||
"@0x/dev-utils": "^1.0.18",
|
||||
"@0x/migrations": "^2.1.0",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -73,16 +72,16 @@
|
||||
"webpack": "^4.20.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.17",
|
||||
"@0x/base-contract": "^3.0.6",
|
||||
"@0x/contract-wrappers": "^4.0.2",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/order-watcher": "^2.2.4",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/base-contract": "^3.0.7",
|
||||
"@0x/contract-wrappers": "^4.1.0",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/order-watcher": "^2.2.5",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
|
||||
11
packages/abi-gen-templates/CHANGELOG.json
Normal file
11
packages/abi-gen-templates/CHANGELOG.json
Normal file
@@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Initial publish",
|
||||
"pr": 1305
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -40,7 +41,7 @@ export class {{contractName}}Contract extends BaseContract {
|
||||
{{/this.constant}}
|
||||
{{/each}}
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
{{> typed_params inputs=ctor.inputs}}
|
||||
20
packages/abi-gen-templates/package.json
Normal file
20
packages/abi-gen-templates/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-templates",
|
||||
"version": "1.0.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
"description": "Handlebars templates used by abi-gen to generate contract-wrappers",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/0xProject/0x-monorepo.git"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/0xProject/0x-monorepo/issues"
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-templates/README.md",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,24 @@
|
||||
[
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"pr": 1309,
|
||||
"note": "Update Exchange artifact to receive ZRX asset data as a constructor argument"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"`deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface",
|
||||
"pr": 1298
|
||||
}
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.5",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.0 - _November 21, 2018_
|
||||
|
||||
* `deployFrom0xArtifactAsync` additionally accepts artifacts that conform to the `SimpleContractArtifact` interface (#1298)
|
||||
|
||||
## v1.0.5 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "1.0.5",
|
||||
"version": "1.1.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -15,7 +15,7 @@
|
||||
"lint": "tslint --format stylish --project .",
|
||||
"pre_build": "yarn generate_contract_wrappers",
|
||||
"clean": "shx rm -rf lib wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/generated-wrappers --backend ethers"
|
||||
},
|
||||
"config": {
|
||||
"abis": "../contract-artifacts/artifacts/@(AssetProxyOwner|DummyERC20Token|DummyERC721Token|ERC20Proxy|ERC20Token|ERC721Proxy|ERC721Token|Exchange|Forwarder|IValidator|IWallet|OrderValidator|WETH9|ZRXToken).json"
|
||||
@@ -30,17 +30,19 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen-wrappers/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.16",
|
||||
"@0x/abi-gen": "^1.0.17",
|
||||
"@0x/abi-gen-templates": "^1.0.0",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.6"
|
||||
"@0x/base-contract": "^3.0.7"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -1800,7 +1801,7 @@ export class AssetProxyOwnerContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_owners: string[],
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -968,7 +969,7 @@ export class DummyERC20TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_name: string,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -1264,7 +1265,7 @@ export class DummyERC721TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_name: string,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -601,7 +602,7 @@ export class ERC20ProxyContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<ERC20ProxyContract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -508,7 +509,7 @@ export class ERC20TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<ERC20TokenContract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -601,7 +602,7 @@ export class ERC721ProxyContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<ERC721ProxyContract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -845,7 +846,7 @@ export class ERC721TokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<ERC721TokenContract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -3024,32 +3025,38 @@ export class ExchangeContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_zrxAssetData: string,
|
||||
): Promise<ExchangeContract> {
|
||||
if (_.isUndefined(artifact.compilerOutput)) {
|
||||
throw new Error('Compiler output not found in the artifact file');
|
||||
}
|
||||
const bytecode = artifact.compilerOutput.evm.bytecode.object;
|
||||
const abi = artifact.compilerOutput.abi;
|
||||
return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, );
|
||||
return ExchangeContract.deployAsync(bytecode, abi, provider, txDefaults, _zrxAssetData
|
||||
);
|
||||
}
|
||||
public static async deployAsync(
|
||||
bytecode: string,
|
||||
abi: ContractAbi,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_zrxAssetData: string,
|
||||
): Promise<ExchangeContract> {
|
||||
const constructorAbi = BaseContract._lookupConstructorAbi(abi);
|
||||
[] = BaseContract._formatABIDataItemList(
|
||||
[_zrxAssetData
|
||||
] = BaseContract._formatABIDataItemList(
|
||||
constructorAbi.inputs,
|
||||
[],
|
||||
[_zrxAssetData
|
||||
],
|
||||
BaseContract._bigNumberToString,
|
||||
);
|
||||
const iface = new ethers.utils.Interface(abi);
|
||||
const deployInfo = iface.deployFunction;
|
||||
const txData = deployInfo.encode(bytecode, []);
|
||||
const txData = deployInfo.encode(bytecode, [_zrxAssetData
|
||||
]);
|
||||
const web3Wrapper = new Web3Wrapper(provider);
|
||||
const txDataWithDefaults = await BaseContract._applyDefaultsToTxDataAsync(
|
||||
{data: txData},
|
||||
@@ -3061,7 +3068,8 @@ export class ExchangeContract extends BaseContract {
|
||||
const txReceipt = await web3Wrapper.awaitTransactionSuccessAsync(txHash);
|
||||
logUtils.log(`Exchange successfully deployed at ${txReceipt.contractAddress}`);
|
||||
const contractInstance = new ExchangeContract(abi, txReceipt.contractAddress as string, provider, txDefaults);
|
||||
contractInstance.constructorArgs = [];
|
||||
contractInstance.constructorArgs = [_zrxAssetData
|
||||
];
|
||||
return contractInstance;
|
||||
}
|
||||
constructor(abi: ContractAbi, address: string, provider: Provider, txDefaults?: Partial<TxData>) {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -661,7 +662,7 @@ export class ForwarderContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_exchange: string,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -60,7 +61,7 @@ export class IValidatorContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<IValidatorContract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -55,7 +56,7 @@ export class IWalletContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<IWalletContract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -295,7 +296,7 @@ export class OrderValidatorContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
_exchange: string,
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -787,7 +788,7 @@ export class WETH9Contract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<WETH9Contract> {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import { BaseContract } from '@0x/base-contract';
|
||||
import { BlockParam, BlockParamLiteral, CallData, ContractAbi, ContractArtifact, DecodedLogArgs, MethodAbi, Provider, TxData, TxDataPayable } from 'ethereum-types';
|
||||
import { BigNumber, classUtils, logUtils } from '@0x/utils';
|
||||
import { SimpleContractArtifact } from '@0x/types';
|
||||
import { Web3Wrapper } from '@0x/web3-wrapper';
|
||||
import * as ethers from 'ethers';
|
||||
import * as _ from 'lodash';
|
||||
@@ -598,7 +599,7 @@ export class ZRXTokenContract extends BaseContract {
|
||||
},
|
||||
};
|
||||
public static async deployFrom0xArtifactAsync(
|
||||
artifact: ContractArtifact,
|
||||
artifact: ContractArtifact | SimpleContractArtifact,
|
||||
provider: Provider,
|
||||
txDefaults: Partial<TxData>,
|
||||
): Promise<ZRXTokenContract> {
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.17",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.16",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.17 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.16 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.17",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -32,7 +32,7 @@
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/abi-gen/README.md",
|
||||
"dependencies": {
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"chalk": "^2.3.0",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"glob": "^7.1.2",
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.18",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.17",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.18 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.17 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/assert",
|
||||
"version": "1.0.17",
|
||||
"version": "1.0.18",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,9 +44,9 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/json-schemas": "^2.1.1",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"lodash": "^4.17.5",
|
||||
"valid-url": "^1.0.9"
|
||||
},
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
"note": "Dependencies updated",
|
||||
"pr": 1276
|
||||
}
|
||||
]
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.1 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated (#1276)
|
||||
|
||||
## v3.0.0 - _November 14, 2018_
|
||||
|
||||
* update `getBuyQuoteAsync` to return eth spent on assets instead of per unit amount (#1252)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-buyer",
|
||||
"version": "3.0.0",
|
||||
"version": "3.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,16 +36,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.17",
|
||||
"@0x/connect": "^3.0.6",
|
||||
"@0x/contract-wrappers": "^4.0.2",
|
||||
"@0x/json-schemas": "^2.1.1",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/connect": "^3.0.7",
|
||||
"@0x/contract-wrappers": "^4.1.0",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "3.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "3.0.6",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.7 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.6 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/base-contract",
|
||||
"version": "3.0.6",
|
||||
"version": "3.0.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,8 +41,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5"
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "3.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "3.0.6",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.7 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.6 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/connect",
|
||||
"version": "3.0.6",
|
||||
"version": "3.0.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,12 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.17",
|
||||
"@0x/json-schemas": "^2.1.1",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"lodash": "^4.17.5",
|
||||
"query-string": "^5.0.1",
|
||||
"sinon": "^4.0.0",
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
{
|
||||
"note": "Rinkeby Deployment"
|
||||
}
|
||||
]
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"version": "1.1.0",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.2.0 - _November 21, 2018_
|
||||
|
||||
* Rinkeby Deployment
|
||||
|
||||
## v1.1.0 - _November 9, 2018_
|
||||
|
||||
* Update Forwarder addresses (#1192)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-addresses",
|
||||
"version": "1.1.0",
|
||||
"version": "1.2.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "1.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"pr": 1309,
|
||||
"note": "Update Exchange artifact to receive ZRX asset data as a constructor argument"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"changes": [
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -7,7 +7,8 @@
|
||||
"Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount",
|
||||
"pr": 1292
|
||||
}
|
||||
]
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.1.0 - _November 21, 2018_
|
||||
|
||||
* Add a `nonce` field for `TxOpts` so that it's now possible to re-broadcast stuck transactions with a higher gas amount (#1292)
|
||||
|
||||
## v4.0.2 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "4.0.2",
|
||||
"version": "4.1.0",
|
||||
"description": "Smart TS wrappers for 0x smart contracts",
|
||||
"keywords": [
|
||||
"0xproject",
|
||||
@@ -37,9 +37,9 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^1.0.17",
|
||||
"@0x/migrations": "^2.0.4",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/dev-utils": "^1.0.18",
|
||||
"@0x/migrations": "^2.1.0",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@types/lodash": "4.14.104",
|
||||
"@types/mocha": "^2.2.42",
|
||||
@@ -65,17 +65,17 @@
|
||||
"web3-provider-engine": "14.0.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^1.0.5",
|
||||
"@0x/assert": "^1.0.17",
|
||||
"@0x/contract-addresses": "^1.1.0",
|
||||
"@0x/abi-gen-wrappers": "^1.1.0",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/contract-addresses": "^1.2.0",
|
||||
"@0x/contract-artifacts": "^1.1.0",
|
||||
"@0x/fill-scenarios": "^1.0.12",
|
||||
"@0x/json-schemas": "^2.1.1",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/fill-scenarios": "^1.0.13",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethereumjs-blockstream": "6.0.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "contracts",
|
||||
"version": "2.1.54",
|
||||
"version": "2.1.55",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -22,7 +22,7 @@
|
||||
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe 'lib/test/**/*.js' --timeout 100000 --bail --exit",
|
||||
"compile": "sol-compiler --contracts-dir contracts",
|
||||
"clean": "shx rm -rf lib generated-artifacts generated-wrappers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers",
|
||||
"lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||
@@ -45,11 +45,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/contracts/README.md",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.16",
|
||||
"@0x/dev-utils": "^1.0.17",
|
||||
"@0x/sol-compiler": "^1.1.12",
|
||||
"@0x/sol-cov": "^2.1.12",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/abi-gen": "^1.0.17",
|
||||
"@0x/dev-utils": "^1.0.18",
|
||||
"@0x/sol-compiler": "^1.1.13",
|
||||
"@0x/sol-cov": "^2.1.13",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@types/bn.js": "^4.11.0",
|
||||
"@types/ethereumjs-abi": "^0.6.0",
|
||||
@@ -71,12 +71,12 @@
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.6",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/base-contract": "^3.0.7",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-tools-pages",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.7",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -16,7 +16,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/react-shared": "^1.0.21",
|
||||
"@0x/react-shared": "^1.0.22",
|
||||
"basscss": "^8.0.3",
|
||||
"bowser": "^1.9.3",
|
||||
"less": "^2.7.2",
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.18",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.17",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.18 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.17 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-utils",
|
||||
"version": "1.0.17",
|
||||
"version": "1.0.18",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,11 +41,11 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"chai": "^4.0.1",
|
||||
"ethereum-types": "^1.1.2",
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.12",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.13 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.12 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/fill-scenarios",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.13",
|
||||
"description": "0x order fill scenario generator",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
@@ -28,14 +28,14 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^1.0.5",
|
||||
"@0x/base-contract": "^3.0.6",
|
||||
"@0x/abi-gen-wrappers": "^1.1.0",
|
||||
"@0x/base-contract": "^3.0.7",
|
||||
"@0x/contract-artifacts": "^1.1.0",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.*
|
||||
*
|
||||
*/
|
||||
!lib/src/**/*
|
||||
!lib/**/*
|
||||
!umd/**/*
|
||||
@@ -1 +1,11 @@
|
||||
[]
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1 +1,10 @@
|
||||
<!--
|
||||
changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly.
|
||||
Edit the package's CHANGELOG.json file only.
|
||||
-->
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.1 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
{
|
||||
"name": "@0x/instant",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
"description": "0x Instant React Component",
|
||||
"private": true,
|
||||
"main": "lib/src/index.js",
|
||||
"types": "lib/src/index.d.ts",
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "yarn build:all",
|
||||
"build:all": "run-p build:umd:prod build:commonjs",
|
||||
@@ -45,15 +44,15 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.17",
|
||||
"@0x/asset-buyer": "^3.0.0",
|
||||
"@0x/json-schemas": "^2.1.1",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/asset-buyer": "^3.0.1",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"bowser": "^1.9.4",
|
||||
"copy-to-clipboard": "^3.0.8",
|
||||
"ethereum-types": "^1.1.2",
|
||||
@@ -99,6 +98,6 @@
|
||||
"webpack-dev-server": "^3.1.9"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "private"
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,137 +1,206 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>0x Instant Dev Environment</title>
|
||||
<link rel="stylesheet" href="/external.css">
|
||||
<script type="text/javascript" src="/instant.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/jsuri@1.3.1/Uri.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/bignumber.js@4.1.0/bignumber.js" charset="utf-8"></script>
|
||||
<style>
|
||||
#zeroExInstantContainer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="zeroExInstantContainer"></div>
|
||||
<script>
|
||||
const removeUndefined = (obj) => {
|
||||
for (let k in obj) if (obj[k] === undefined) delete obj[k];
|
||||
return obj;
|
||||
}
|
||||
BigNumber.config({
|
||||
EXPONENTIAL_AT: 1000,
|
||||
DECIMAL_PLACES: 78,
|
||||
});
|
||||
const providedOrders = [
|
||||
// Order selling REP
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('200000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('10000000000000000000'),
|
||||
makerAssetData: '0xf47261b00000000000000000000000008cb3971b8eb709c14616bd556ff6683019e90d9c',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('1601535600'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber('3101985707338942582579795423923841749956600670712030922928319824580764688653'),
|
||||
signature: '0x1bd4d5686fea801fe33c68c4944356085e7e6cb553eb7073160abd815609f714e85fb47f44b7ffd0a2a1321ac40d72d55163869d0a50fdb5a402132150fe33a08403',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
|
||||
},
|
||||
// Order selling ZRX
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('300000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('31000000000000000000'),
|
||||
makerAssetData: '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('2524636800'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber('64592004666704945574675477805199411288137454783320798602050822322450089238268'),
|
||||
signature: '0x1c13cacddca8d7d8248e91f412377e68f8f1f9891a59a6c1b2eea9f7b33558c30c4fb86a448e08ab7def40a28fb3a3062dcb33bb3c45302447fce5c4288b7c7f5b03',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
|
||||
},
|
||||
// Order selling GNT
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('250000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('10000000000000000000'),
|
||||
makerAssetData: '0xf47261b000000000000000000000000031fb614e223706f15d0d3c5f4b08bdf0d5c78623',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('1601535600'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber('40204378562212615907903051460421336779451270522691667164301816101569427926606'),
|
||||
signature: '0x1c788bf4b93769da1e8f195f52f0f59b4a298ac6da30cf6d05a87ed4be5ee974f61352ed1bc6a0844d0962b8c894c9ca08e452431255958a4e98dd93cbe1fbc73803',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
|
||||
},
|
||||
// Order selling MKR
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('200000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('5000000000000000000'),
|
||||
makerAssetData: '0xf47261b00000000000000000000000007b6b10caa9e8e9552ba72638ea5b47c25afea1f3',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('1601535600'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber('71338269924068280039932133924198049371838034090153601678083172009862985793828'),
|
||||
signature: '0x1bb3151d57ee1e8fa697767ce83ee4ba77d1ceb8cc1e79c7d77126b3687517704c50c6b3d9cb42c7e7d4478d574b297dfbd1626c5c18a7bc9c2a792c4c07f0797c03',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2'
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>0x Instant Dev Environment</title>
|
||||
<link rel="stylesheet" href="/external.css" />
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.min.css" />
|
||||
<script type="text/javascript" src="/instant.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/jsuri@1.3.1/Uri.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="https://unpkg.com/bignumber.js@4.1.0/bignumber.js" charset="utf-8"></script>
|
||||
<style>
|
||||
.flex-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
];
|
||||
const queryParams = new Uri(window.location.search);
|
||||
const renderOptionsDefaults = {
|
||||
orderSource: 'https://api.radarrelay.com/0x/v2/',
|
||||
onClose: () => { console.log('0x Instant Closed') }
|
||||
}
|
||||
const orderSourceOverride = queryParams.getQueryParamValue('orderSource');
|
||||
const availableAssetDatasString = queryParams.getQueryParamValue('availableAssetDatas');
|
||||
const feeRecipientOverride = queryParams.getQueryParamValue('feeRecipient');
|
||||
const feePercentageOverride = +queryParams.getQueryParamValue('feePercentage');
|
||||
let affiliateInfoOverride;
|
||||
if (feeRecipientOverride !== undefined && feePercentageOverride !== undefined) {
|
||||
affiliateInfoOverride = {
|
||||
feeRecipient: feeRecipientOverride,
|
||||
feePercentage: feePercentageOverride
|
||||
};
|
||||
}
|
||||
const renderOptionsOverrides = {
|
||||
orderSource: orderSourceOverride === 'provided' ? providedOrders : orderSourceOverride,
|
||||
networkId: +queryParams.getQueryParamValue('networkId') || undefined,
|
||||
defaultAssetBuyAmount: +queryParams.getQueryParamValue('defaultAssetBuyAmount') || undefined,
|
||||
availableAssetDatas: availableAssetDatasString ? JSON.parse(availableAssetDatasString) : undefined,
|
||||
defaultSelectedAssetData: queryParams.getQueryParamValue('defaultSelectedAssetData'),
|
||||
affiliateInfo: affiliateInfoOverride,
|
||||
}
|
||||
const renderOptions = Object.assign({}, renderOptionsDefaults, removeUndefined(renderOptionsOverrides));
|
||||
zeroExInstant.render(renderOptions);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
.flex-center--column {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.button {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
height: 100vh;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="flex-center flex-center--column">
|
||||
<div><button class="button is-large" onClick="renderWithUrlDefaults()">Open</button></div>
|
||||
<div>
|
||||
<button
|
||||
class="button is-danger"
|
||||
onClick="renderWithAssetData('0xf47261b00000000000000000000000001985365e9f78359a9b6ad760e32412f4a445e862')"
|
||||
>
|
||||
Buy REP
|
||||
</button>
|
||||
<button
|
||||
class="button is-black"
|
||||
onClick="renderWithAssetData('0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498')"
|
||||
>
|
||||
Buy ZRX
|
||||
</button>
|
||||
<button
|
||||
class="button is-info"
|
||||
onClick="renderWithAssetData('0xf47261b00000000000000000000000006810e776880c02933d47db1b9fc05908e5386b96')"
|
||||
>
|
||||
Buy GNO
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="zeroExInstantContainer"></div>
|
||||
<script>
|
||||
// Simulate history
|
||||
window.history.pushState({ page: 1 }, '0x Instant');
|
||||
window.history.pushState({ page: 2 }, '0x Instant');
|
||||
window.history.pushState({ page: 3 }, '0x Instant');
|
||||
window.onpopstate = () => console.log("Integrator's onpopstate called");
|
||||
|
||||
const removeUndefined = obj => {
|
||||
for (let k in obj) if (obj[k] === undefined) delete obj[k];
|
||||
return obj;
|
||||
};
|
||||
BigNumber.config({
|
||||
EXPONENTIAL_AT: 1000,
|
||||
DECIMAL_PLACES: 78,
|
||||
});
|
||||
const providedOrders = [
|
||||
// Order selling REP
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('200000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('10000000000000000000'),
|
||||
makerAssetData: '0xf47261b00000000000000000000000008cb3971b8eb709c14616bd556ff6683019e90d9c',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('1601535600'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber('3101985707338942582579795423923841749956600670712030922928319824580764688653'),
|
||||
signature:
|
||||
'0x1bd4d5686fea801fe33c68c4944356085e7e6cb553eb7073160abd815609f714e85fb47f44b7ffd0a2a1321ac40d72d55163869d0a50fdb5a402132150fe33a08403',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2',
|
||||
},
|
||||
// Order selling ZRX
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('300000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('31000000000000000000'),
|
||||
makerAssetData: '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('2524636800'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber(
|
||||
'64592004666704945574675477805199411288137454783320798602050822322450089238268',
|
||||
),
|
||||
signature:
|
||||
'0x1c13cacddca8d7d8248e91f412377e68f8f1f9891a59a6c1b2eea9f7b33558c30c4fb86a448e08ab7def40a28fb3a3062dcb33bb3c45302447fce5c4288b7c7f5b03',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2',
|
||||
},
|
||||
// Order selling GNT
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('250000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('10000000000000000000'),
|
||||
makerAssetData: '0xf47261b000000000000000000000000031fb614e223706f15d0d3c5f4b08bdf0d5c78623',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('1601535600'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber(
|
||||
'40204378562212615907903051460421336779451270522691667164301816101569427926606',
|
||||
),
|
||||
signature:
|
||||
'0x1c788bf4b93769da1e8f195f52f0f59b4a298ac6da30cf6d05a87ed4be5ee974f61352ed1bc6a0844d0962b8c894c9ca08e452431255958a4e98dd93cbe1fbc73803',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2',
|
||||
},
|
||||
// Order selling MKR
|
||||
{
|
||||
senderAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerAddress: '0x34a745008a643eebc58920eaa29fb1165b4a288e',
|
||||
takerAddress: '0x0000000000000000000000000000000000000000',
|
||||
makerFee: new BigNumber('0'),
|
||||
takerFee: new BigNumber('0'),
|
||||
makerAssetAmount: new BigNumber('200000000000000000000'),
|
||||
takerAssetAmount: new BigNumber('5000000000000000000'),
|
||||
makerAssetData: '0xf47261b00000000000000000000000007b6b10caa9e8e9552ba72638ea5b47c25afea1f3',
|
||||
takerAssetData: '0xf47261b0000000000000000000000000d0a1e359811322d97991e03f863a0c30c2cf029c',
|
||||
expirationTimeSeconds: new BigNumber('1601535600'),
|
||||
feeRecipientAddress: '0x0000000000000000000000000000000000000000',
|
||||
salt: new BigNumber(
|
||||
'71338269924068280039932133924198049371838034090153601678083172009862985793828',
|
||||
),
|
||||
signature:
|
||||
'0x1bb3151d57ee1e8fa697767ce83ee4ba77d1ceb8cc1e79c7d77126b3687517704c50c6b3d9cb42c7e7d4478d574b297dfbd1626c5c18a7bc9c2a792c4c07f0797c03',
|
||||
exchangeAddress: '0x35dd2932454449b14cee11a94d3674a936d5d7b2',
|
||||
},
|
||||
];
|
||||
const getRenderOptionsOverridesFromUrl = () => {
|
||||
const queryParams = new Uri(window.location.search);
|
||||
const orderSourceOverride = queryParams.getQueryParamValue('orderSource');
|
||||
const availableAssetDatasString = queryParams.getQueryParamValue('availableAssetDatas');
|
||||
const feeRecipientOverride = queryParams.getQueryParamValue('feeRecipient');
|
||||
const feePercentageOverride = +queryParams.getQueryParamValue('feePercentage');
|
||||
let affiliateInfoOverride;
|
||||
if (feeRecipientOverride !== undefined && feePercentageOverride !== undefined) {
|
||||
affiliateInfoOverride = {
|
||||
feeRecipient: feeRecipientOverride,
|
||||
feePercentage: feePercentageOverride,
|
||||
};
|
||||
}
|
||||
const renderOptionsOverrides = {
|
||||
orderSource: orderSourceOverride === 'provided' ? providedOrders : orderSourceOverride,
|
||||
networkId: +queryParams.getQueryParamValue('networkId') || undefined,
|
||||
defaultAssetBuyAmount: +queryParams.getQueryParamValue('defaultAssetBuyAmount') || undefined,
|
||||
availableAssetDatas: availableAssetDatasString ? JSON.parse(availableAssetDatasString) : undefined,
|
||||
defaultSelectedAssetData: queryParams.getQueryParamValue('defaultSelectedAssetData'),
|
||||
affiliateInfo: affiliateInfoOverride,
|
||||
shouldDisablePushToHistory: !!queryParams.getQueryParamValue('shouldDisablePushToHistory'),
|
||||
};
|
||||
return renderOptionsOverrides;
|
||||
};
|
||||
const render = renderOptionsOverrides => {
|
||||
const renderOptionsDefaults = {
|
||||
orderSource: 'https://api.radarrelay.com/0x/v2/',
|
||||
onClose: () => {
|
||||
console.log('0x Instant Closed');
|
||||
},
|
||||
};
|
||||
const renderOptions = Object.assign({}, renderOptionsDefaults, removeUndefined(renderOptionsOverrides));
|
||||
zeroExInstant.render(renderOptions);
|
||||
};
|
||||
const renderWithUrlDefaults = (renderOptions = {}) => {
|
||||
const finalOptions = {
|
||||
...getRenderOptionsOverridesFromUrl(),
|
||||
...renderOptions,
|
||||
};
|
||||
render(finalOptions);
|
||||
};
|
||||
renderWithUrlDefaults();
|
||||
const renderWithAssetData = assetData => {
|
||||
renderWithUrlDefaults({
|
||||
defaultSelectedAssetData: assetData,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
42
packages/instant/src/assets/powered_by_0x.svg
generated
42
packages/instant/src/assets/powered_by_0x.svg
generated
@@ -1,27 +1,17 @@
|
||||
<svg width="114" height="20" viewBox="0 0 114 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.17959 11.0032V14.5455H0V5.49716H3.29917C4.27807 5.49716 5.04398 5.74988 5.59692 6.25533C6.15395 6.76077 6.43246 7.42986 6.43246 8.26261C6.43246 9.14092 6.16009 9.8183 5.61535 10.2947C5.0747 10.767 4.29855 11.0032 3.28688 11.0032H1.17959ZM1.17959 10.0275H3.29917C3.92992 10.0275 4.41323 9.87837 4.74909 9.58008C5.08494 9.27764 5.25287 8.84263 5.25287 8.27504C5.25287 7.73645 5.08494 7.30558 4.74909 6.98242C4.41323 6.65927 3.95245 6.49148 3.36675 6.47905H1.17959V10.0275Z" fill="#777777"/>
|
||||
<path d="M7.37245 11.1213C7.37245 10.4625 7.49942 9.87009 7.75336 9.34393C8.01139 8.81777 8.36773 8.41175 8.82236 8.12589C9.28109 7.84002 9.80331 7.69709 10.389 7.69709C11.2942 7.69709 12.0253 8.01403 12.5823 8.6479C13.1434 9.28178 13.424 10.1249 13.424 11.1772V11.258C13.424 11.9126 13.2991 12.5009 13.0492 13.0229C12.8035 13.5408 12.4492 13.9447 11.9864 14.2347C11.5276 14.5247 10.9993 14.6697 10.4013 14.6697C9.50022 14.6697 8.76912 14.3528 8.20799 13.7189C7.65096 13.085 7.37245 12.2461 7.37245 11.2021V11.1213ZM8.51518 11.258C8.51518 12.0037 8.68515 12.6024 9.02511 13.054C9.36915 13.5056 9.82788 13.7314 10.4013 13.7314C10.9788 13.7314 11.4375 13.5035 11.7775 13.0478C12.1174 12.5879 12.2874 11.9457 12.2874 11.1213C12.2874 10.3838 12.1133 9.78723 11.7652 9.3315C11.4212 8.87163 10.9624 8.64169 10.389 8.64169C9.82788 8.64169 9.3753 8.86748 9.03125 9.31907C8.6872 9.77066 8.51518 10.417 8.51518 11.258Z" fill="#777777"/>
|
||||
<path d="M20.735 12.9608L22.0129 7.82138H23.1495L21.2142 14.5455H20.2927L18.6769 9.44957L17.1041 14.5455H16.1825L14.2534 7.82138H15.3838L16.6925 12.8551L18.2407 7.82138H19.1561L20.735 12.9608Z" fill="#777777"/>
|
||||
<path d="M27.0692 14.6697C26.1681 14.6697 25.4349 14.3714 24.8697 13.7749C24.3045 13.1741 24.0219 12.3725 24.0219 11.3699V11.1586C24.0219 10.4915 24.1468 9.89702 24.3967 9.375C24.6506 8.84884 25.0028 8.43868 25.4534 8.14453C25.908 7.84624 26.3995 7.69709 26.9279 7.69709C27.7921 7.69709 28.4638 7.98503 28.943 8.5609C29.4222 9.13678 29.6618 9.96123 29.6618 11.0343V11.5128H25.1585C25.1749 12.1757 25.3653 12.7122 25.7298 13.1223C26.0985 13.5283 26.5654 13.7314 27.1306 13.7314C27.532 13.7314 27.872 13.6485 28.1505 13.4828C28.429 13.3171 28.6727 13.0975 28.8816 12.824L29.5758 13.3709C29.0188 14.2368 28.1832 14.6697 27.0692 14.6697ZM26.9279 8.64169C26.4691 8.64169 26.0841 8.81155 25.7729 9.15128C25.4616 9.48686 25.2691 9.95916 25.1953 10.5682H28.5252V10.4812C28.4925 9.89702 28.3368 9.44543 28.0583 9.12642C27.7798 8.80327 27.403 8.64169 26.9279 8.64169Z" fill="#777777"/>
|
||||
<path d="M34.1959 8.85298C34.0238 8.82398 33.8375 8.80948 33.6368 8.80948C32.8914 8.80948 32.3855 9.13056 32.1193 9.77273V14.5455H30.9827V7.82138H32.0886L32.107 8.59819C32.4797 7.99746 33.0081 7.69709 33.6921 7.69709C33.9133 7.69709 34.0812 7.72609 34.1959 7.78409V8.85298Z" fill="#777777"/>
|
||||
<path d="M37.8821 14.6697C36.981 14.6697 36.2479 14.3714 35.6826 13.7749C35.1174 13.1741 34.8348 12.3725 34.8348 11.3699V11.1586C34.8348 10.4915 34.9597 9.89702 35.2096 9.375C35.4635 8.84884 35.8158 8.43868 36.2663 8.14453C36.7209 7.84624 37.2124 7.69709 37.7408 7.69709C38.605 7.69709 39.2767 7.98503 39.7559 8.5609C40.2351 9.13678 40.4747 9.96123 40.4747 11.0343V11.5128H35.9714C35.9878 12.1757 36.1782 12.7122 36.5428 13.1223C36.9114 13.5283 37.3783 13.7314 37.9435 13.7314C38.3449 13.7314 38.6849 13.6485 38.9634 13.4828C39.2419 13.3171 39.4856 13.0975 39.6945 12.824L40.3887 13.3709C39.8317 14.2368 38.9962 14.6697 37.8821 14.6697ZM37.7408 8.64169C37.2821 8.64169 36.8971 8.81155 36.5858 9.15128C36.2745 9.48686 36.082 9.95916 36.0083 10.5682H39.3382V10.4812C39.3054 9.89702 39.1497 9.44543 38.8712 9.12642C38.5927 8.80327 38.2159 8.64169 37.7408 8.64169Z" fill="#777777"/>
|
||||
<path d="M41.5192 11.1275C41.5192 10.0959 41.7608 9.26728 42.2441 8.64169C42.7274 8.01196 43.3602 7.69709 44.1425 7.69709C44.9207 7.69709 45.5372 7.96638 45.9918 8.50497V5H47.1284V14.5455H46.0839L46.0287 13.8246C45.574 14.388 44.9412 14.6697 44.1302 14.6697C43.3602 14.6697 42.7315 14.3507 42.2441 13.7127C41.7608 13.0747 41.5192 12.242 41.5192 11.2145V11.1275ZM42.6558 11.258C42.6558 12.0203 42.8114 12.6169 43.1227 13.0478C43.434 13.4786 43.864 13.6941 44.4129 13.6941C45.1337 13.6941 45.66 13.3668 45.9918 12.7122V9.62358C45.6518 8.9897 45.1296 8.67276 44.4251 8.67276C43.8681 8.67276 43.434 8.89027 43.1227 9.32528C42.8114 9.7603 42.6558 10.4045 42.6558 11.258Z" fill="#777777"/>
|
||||
<path d="M57.6464 11.258C57.6464 12.2855 57.4129 13.112 56.946 13.7376C56.4791 14.359 55.8524 14.6697 55.066 14.6697C54.2264 14.6697 53.5772 14.3694 53.1185 13.7686L53.0632 14.5455H52.0188V5H53.1553V8.5609C53.6141 7.98503 54.2469 7.69709 55.0538 7.69709C55.8606 7.69709 56.4934 8.00574 56.9522 8.62305C57.415 9.24035 57.6464 10.0855 57.6464 11.1586V11.258ZM56.5098 11.1275C56.5098 10.3445 56.3603 9.73958 56.0613 9.31285C55.7623 8.88613 55.3323 8.67276 54.7711 8.67276C54.0216 8.67276 53.483 9.02492 53.1553 9.72923V12.6376C53.5035 13.3419 54.0462 13.6941 54.7834 13.6941C55.3282 13.6941 55.7521 13.4807 56.0552 13.054C56.3583 12.6272 56.5098 11.9851 56.5098 11.1275Z" fill="#777777"/>
|
||||
<path d="M61.1852 12.8613L62.7334 7.82138H63.9498L61.2773 15.5833C60.8637 16.7019 60.2063 17.2612 59.3052 17.2612L59.0902 17.2425L58.6663 17.1618V16.2296L58.9734 16.2544C59.3584 16.2544 59.6574 16.1757 59.8704 16.0183C60.0875 15.8609 60.2657 15.5729 60.4049 15.1545L60.6568 14.4709L58.2853 7.82138H59.5264L61.1852 12.8613Z" fill="#777777"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M102.319 9.94708L98.7681 12.2635C98.8595 13.5364 99.4513 14.1727 100.544 14.1727C101.727 14.1727 102.319 13.414 102.319 11.8964V9.94708ZM98.7527 11.0088L102.304 8.69233C102.263 8.02927 102.097 7.53857 101.805 7.22035C101.513 6.90224 101.087 6.74304 100.528 6.74304C99.9338 6.74304 99.4892 6.92776 99.1947 7.29714C98.8999 7.66658 98.7527 8.23403 98.7527 8.99935V11.0088ZM104.149 11.6161C104.149 12.2437 104.066 12.7967 103.901 13.275C103.736 13.7535 103.498 14.154 103.188 14.4766C102.879 14.7993 102.5 15.043 102.053 15.2076C101.606 15.3722 101.103 15.4546 100.544 15.4546C99.9902 15.4546 99.4897 15.3722 99.0427 15.2076C98.5956 15.043 98.2158 14.7993 97.9034 14.4766C97.591 14.154 97.3496 13.7535 97.1794 13.275C97.0091 12.7967 96.9241 12.2437 96.9241 11.6161V9.293C96.9241 8.66551 97.0079 8.11262 97.1756 7.63416C97.3433 7.15582 97.5833 6.75525 97.8958 6.43253C98.2083 6.10992 98.5866 5.8663 99.0313 5.70156C99.4758 5.53699 99.975 5.45459 100.529 5.45459C101.088 5.45459 101.591 5.53699 102.038 5.70156C102.485 5.8663 102.865 6.10992 103.177 6.43253C103.489 6.75525 103.73 7.15582 103.897 7.63416C104.065 8.11262 104.149 8.66551 104.149 9.293V11.6161Z" fill="#777777"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M110.041 10.4915L111.947 7.95448H113.911L111.09 11.6491L114 15.4545H112.043L110.063 12.8274L108.091 15.4545H106.119L109.029 11.6491L106.207 7.95448H108.165L110.041 10.4915Z" fill="#777777"/>
|
||||
<mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="76" y="13" width="13" height="7">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M76.666 20H88.9359V13.425H76.666V20Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask0)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M76.666 18.644C77.9189 19.3997 79.3537 19.8757 80.8969 19.9789C83.0284 20.1214 85.0448 19.534 86.7198 18.4267C87.5526 17.8761 88.3005 17.1969 88.9359 16.4141C88.4089 15.6562 87.8483 14.8742 87.2561 14.0775L86.7722 13.425C86.1355 14.4641 85.2199 15.2969 84.1423 15.8178L82.4893 14.1447L76.666 18.644Z" fill="#777777"/>
|
||||
</g>
|
||||
<mask id="mask1" mask-type="alpha" maskUnits="userSpaceOnUse" x="71" y="5" width="8" height="13">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M71.7593 5.17493V17.8053H78.1152V5.17493L71.7593 5.17493Z" fill="white"/>
|
||||
</mask>
|
||||
<g mask="url(#mask1)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M73.0424 5.17493C72.3281 6.45818 71.8782 7.92349 71.7797 9.49804C71.6417 11.7039 72.211 13.7904 73.2841 15.523C73.815 16.3803 74.4695 17.1504 75.2234 17.8053C75.9567 17.2604 76.7136 16.6807 77.4848 16.0686L78.1153 15.5695C77.1119 14.9113 76.3077 13.9658 75.8044 12.853L77.4333 11.1274L73.0424 5.17493Z" fill="#777777"/>
|
||||
</g>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M86.4377 1.38342C85.1877 0.612615 83.756 0.126653 82.2157 0.0214596C80.0888 -0.123789 78.0769 0.475348 76.4064 1.60452C75.5797 2.16325 74.8373 2.85192 74.2058 3.64528C74.7312 4.41698 75.2901 5.21342 75.8803 6.02502L76.3615 6.68845C76.9964 5.63221 77.9085 4.78555 78.982 4.25602L78.9832 4.25547L80.5359 5.8528L86.4377 1.38342Z" fill="#777777"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M90.0676 14.9203C90.769 13.6715 91.2122 12.2498 91.3097 10.722C91.4476 8.56117 90.8794 6.51701 89.8081 4.81903C89.2755 3.97475 88.6185 3.21662 87.8611 2.57239C87.128 3.10659 86.3715 3.67498 85.6007 4.27538L84.9695 4.76579C85.9764 5.41241 86.7834 6.3426 87.2872 7.43761L87.2969 7.46039L85.7288 9.10965L90.0676 14.9203Z" fill="#777777"/>
|
||||
<svg width="108" height="18" viewBox="0 0 108 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.17959 10.0032V13.5455H0V4.49716H3.29917C4.27807 4.49716 5.04398 4.74988 5.59692 5.25533C6.15395 5.76077 6.43246 6.42986 6.43246 7.26261C6.43246 8.14092 6.16009 8.8183 5.61535 9.29474C5.0747 9.76705 4.29855 10.0032 3.28688 10.0032H1.17959ZM1.17959 9.02752H3.29917C3.92992 9.02752 4.41323 8.87837 4.74909 8.58008C5.08494 8.27764 5.25287 7.84263 5.25287 7.27504C5.25287 6.73645 5.08494 6.30558 4.74909 5.98242C4.41323 5.65927 3.95245 5.49148 3.36675 5.47905H1.17959V9.02752Z" fill="#777777"/>
|
||||
<path d="M7.37245 10.1213C7.37245 9.46254 7.49942 8.87009 7.75336 8.34393C8.01139 7.81777 8.36773 7.41175 8.82236 7.12589C9.28109 6.84002 9.80331 6.69709 10.389 6.69709C11.2942 6.69709 12.0253 7.01403 12.5823 7.6479C13.1434 8.28178 13.424 9.12488 13.424 10.1772V10.258C13.424 10.9126 13.2991 11.5009 13.0492 12.0229C12.8035 12.5408 12.4492 12.9447 11.9864 13.2347C11.5276 13.5247 10.9993 13.6697 10.4013 13.6697C9.50022 13.6697 8.76912 13.3528 8.20799 12.7189C7.65096 12.085 7.37245 11.2461 7.37245 10.2021V10.1213ZM8.51518 10.258C8.51518 11.0037 8.68515 11.6024 9.02511 12.054C9.36915 12.5056 9.82788 12.7314 10.4013 12.7314C10.9788 12.7314 11.4375 12.5035 11.7775 12.0478C12.1174 11.5879 12.2874 10.9457 12.2874 10.1213C12.2874 9.38382 12.1133 8.78723 11.7652 8.3315C11.4212 7.87163 10.9624 7.64169 10.389 7.64169C9.82788 7.64169 9.3753 7.86748 9.03125 8.31907C8.6872 8.77066 8.51518 9.41696 8.51518 10.258Z" fill="#777777"/>
|
||||
<path d="M20.735 11.9608L22.0129 6.82138H23.1495L21.2142 13.5455H20.2927L18.6769 8.44957L17.1041 13.5455H16.1825L14.2534 6.82138H15.3838L16.6925 11.8551L18.2407 6.82138H19.1561L20.735 11.9608Z" fill="#777777"/>
|
||||
<path d="M27.0692 13.6697C26.1681 13.6697 25.4349 13.3714 24.8697 12.7749C24.3045 12.1741 24.0219 11.3725 24.0219 10.3699V10.1586C24.0219 9.49154 24.1468 8.89702 24.3967 8.375C24.6506 7.84884 25.0028 7.43868 25.4534 7.14453C25.908 6.84624 26.3995 6.69709 26.9279 6.69709C27.7921 6.69709 28.4638 6.98503 28.943 7.5609C29.4222 8.13678 29.6618 8.96123 29.6618 10.0343V10.5128H25.1585C25.1749 11.1757 25.3653 11.7122 25.7298 12.1223C26.0985 12.5283 26.5654 12.7314 27.1306 12.7314C27.532 12.7314 27.872 12.6485 28.1505 12.4828C28.429 12.3171 28.6727 12.0975 28.8816 11.824L29.5758 12.3709C29.0188 13.2368 28.1832 13.6697 27.0692 13.6697ZM26.9279 7.64169C26.4691 7.64169 26.0841 7.81155 25.7729 8.15128C25.4616 8.48686 25.2691 8.95916 25.1953 9.56818H28.5252V9.48118C28.4925 8.89702 28.3368 8.44543 28.0583 8.12642C27.7798 7.80327 27.403 7.64169 26.9279 7.64169Z" fill="#777777"/>
|
||||
<path d="M34.1959 7.85298C34.0238 7.82398 33.8375 7.80948 33.6368 7.80948C32.8914 7.80948 32.3855 8.13056 32.1193 8.77273V13.5455H30.9827V6.82138H32.0886L32.107 7.59819C32.4797 6.99746 33.0081 6.69709 33.6921 6.69709C33.9133 6.69709 34.0812 6.72609 34.1959 6.78409V7.85298Z" fill="#777777"/>
|
||||
<path d="M37.8821 13.6697C36.981 13.6697 36.2479 13.3714 35.6826 12.7749C35.1174 12.1741 34.8348 11.3725 34.8348 10.3699V10.1586C34.8348 9.49154 34.9597 8.89702 35.2096 8.375C35.4635 7.84884 35.8158 7.43868 36.2663 7.14453C36.7209 6.84624 37.2124 6.69709 37.7408 6.69709C38.605 6.69709 39.2767 6.98503 39.7559 7.5609C40.2351 8.13678 40.4747 8.96123 40.4747 10.0343V10.5128H35.9714C35.9878 11.1757 36.1782 11.7122 36.5428 12.1223C36.9114 12.5283 37.3783 12.7314 37.9435 12.7314C38.3449 12.7314 38.6849 12.6485 38.9634 12.4828C39.2419 12.3171 39.4856 12.0975 39.6945 11.824L40.3887 12.3709C39.8317 13.2368 38.9962 13.6697 37.8821 13.6697ZM37.7408 7.64169C37.2821 7.64169 36.8971 7.81155 36.5858 8.15128C36.2745 8.48686 36.082 8.95916 36.0083 9.56818H39.3382V9.48118C39.3054 8.89702 39.1497 8.44543 38.8712 8.12642C38.5927 7.80327 38.2159 7.64169 37.7408 7.64169Z" fill="#777777"/>
|
||||
<path d="M41.5192 10.1275C41.5192 9.09588 41.7608 8.26728 42.2441 7.64169C42.7274 7.01196 43.3602 6.69709 44.1425 6.69709C44.9207 6.69709 45.5372 6.96638 45.9918 7.50497V4H47.1284V13.5455H46.0839L46.0287 12.8246C45.574 13.388 44.9412 13.6697 44.1302 13.6697C43.3602 13.6697 42.7315 13.3507 42.2441 12.7127C41.7608 12.0747 41.5192 11.242 41.5192 10.2145V10.1275ZM42.6558 10.258C42.6558 11.0203 42.8114 11.6169 43.1227 12.0478C43.434 12.4786 43.864 12.6941 44.4129 12.6941C45.1337 12.6941 45.66 12.3668 45.9918 11.7122V8.62358C45.6518 7.9897 45.1296 7.67276 44.4251 7.67276C43.8681 7.67276 43.434 7.89027 43.1227 8.32528C42.8114 8.7603 42.6558 9.40453 42.6558 10.258Z" fill="#777777"/>
|
||||
<path d="M57.6464 10.258C57.6464 11.2855 57.4129 12.112 56.946 12.7376C56.4791 13.359 55.8524 13.6697 55.066 13.6697C54.2264 13.6697 53.5772 13.3694 53.1185 12.7686L53.0632 13.5455H52.0188V4H53.1553V7.5609C53.6141 6.98503 54.2469 6.69709 55.0538 6.69709C55.8606 6.69709 56.4934 7.00574 56.9522 7.62305C57.415 8.24035 57.6464 9.08552 57.6464 10.1586V10.258ZM56.5098 10.1275C56.5098 9.34446 56.3603 8.73958 56.0613 8.31285C55.7623 7.88613 55.3323 7.67276 54.7711 7.67276C54.0216 7.67276 53.483 8.02492 53.1553 8.72923V11.6376C53.5035 12.3419 54.0462 12.6941 54.7834 12.6941C55.3282 12.6941 55.7521 12.4807 56.0552 12.054C56.3583 11.6272 56.5098 10.9851 56.5098 10.1275Z" fill="#777777"/>
|
||||
<path d="M61.1852 11.8613L62.7334 6.82138H63.9498L61.2773 14.5833C60.8637 15.7019 60.2063 16.2612 59.3052 16.2612L59.0902 16.2425L58.6663 16.1618V15.2296L58.9734 15.2544C59.3584 15.2544 59.6574 15.1757 59.8704 15.0183C60.0875 14.8609 60.2657 14.5729 60.4049 14.1545L60.6568 13.4709L58.2853 6.82138H59.5264L61.1852 11.8613Z" fill="#777777"/>
|
||||
<path d="M72.7808 11.3763L74.178 9.93067L72.441 7.58664L70.2293 4.45722C69.448 5.79067 69 7.34287 69 9C69 11.7452 70.2293 14.203 72.1682 15.8537L74.9755 13.8697C74.0206 13.2748 73.2514 12.4087 72.7808 11.3763Z" fill="#777777"/>
|
||||
<path d="M75.6237 3.78081L77.0693 5.17803L79.4134 3.44099L82.5428 1.22933C81.2093 0.447982 79.6571 0 78 0C75.2548 0 72.797 1.22933 71.1463 3.16816L73.1303 5.97552C73.7252 5.02063 74.5913 4.25139 75.6237 3.78081Z" fill="#777777"/>
|
||||
<path d="M81.822 8.06933L83.559 10.4134L85.7707 13.5428C86.552 12.2093 87 10.6571 87 9C87 6.2548 85.7707 3.79695 83.8318 2.14628L81.0245 4.13031C81.9794 4.7252 82.7486 5.5913 83.2192 6.62368L81.822 8.06933Z" fill="#777777"/>
|
||||
<path d="M84.8537 14.8318L82.8697 12.0245C82.2748 12.9794 81.4087 13.7486 80.3763 14.2192L78.9307 12.822L76.5866 14.559L73.4572 16.7707C74.7907 17.552 76.3429 18 78 18C80.7452 18 83.203 16.7707 84.8537 14.8318Z" fill="#777777"/>
|
||||
<path d="M95.7487 3.89648C93.6141 3.89648 92.2419 5.54671 92.2419 8.8651C92.2419 12.1566 93.6231 13.8247 95.7487 13.8247C97.8742 13.8247 99.2733 12.1566 99.2733 8.8651C99.2733 5.57361 97.8742 3.89648 95.7487 3.89648ZM93.4348 8.87406C93.4348 6.41666 94.1971 4.97272 95.7397 4.97272C96.2061 4.97272 96.6097 5.10725 96.9594 5.38527L93.928 11.5826C93.6052 10.9279 93.4348 10.031 93.4348 8.87406ZM95.7487 12.7664C95.2823 12.7664 94.8877 12.6319 94.5469 12.3718L97.5783 6.18348C97.9101 6.85613 98.0715 7.74402 98.0715 8.87406C98.0715 11.3135 97.2913 12.7664 95.7487 12.7664Z" fill="#777777"/>
|
||||
<path d="M104.96 10.085L106.915 6.7666H105.704L104.09 9.50203H103.596L102.018 6.7666H100.78L102.708 10.1298L100.565 13.6545H101.838L103.587 10.7666H104.072L105.785 13.6545H107.094L104.96 10.085Z" fill="#777777"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -22,7 +22,8 @@ export interface ERC20AssetAmountInputProps {
|
||||
onSelectAssetClick?: (asset?: ERC20Asset) => void;
|
||||
startingFontSizePx: number;
|
||||
fontColor?: ColorOption;
|
||||
isDisabled: boolean;
|
||||
isInputDisabled: boolean;
|
||||
canSelectOtherAsset: boolean;
|
||||
numberOfAssetsAvailable?: number;
|
||||
}
|
||||
|
||||
@@ -50,14 +51,15 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
|
||||
);
|
||||
}
|
||||
private readonly _renderContentForAsset = (asset: ERC20Asset): React.ReactNode => {
|
||||
const { onChange, ...rest } = this.props;
|
||||
const amountBorderBottom = this.props.isDisabled ? '' : `1px solid ${transparentWhite}`;
|
||||
const { onChange, isInputDisabled, ...rest } = this.props;
|
||||
const amountBorderBottom = isInputDisabled ? '' : `1px solid ${transparentWhite}`;
|
||||
const onSymbolClick = this._generateSelectAssetClickHandler();
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Container borderBottom={amountBorderBottom} display="inline-block">
|
||||
<ScalingAmountInput
|
||||
{...rest}
|
||||
isDisabled={isInputDisabled}
|
||||
textLengthThreshold={this._textLengthThresholdForAsset(asset)}
|
||||
maxFontSizePx={this.props.startingFontSizePx}
|
||||
onAmountChange={this._handleChange}
|
||||
@@ -74,11 +76,11 @@ export class ERC20AssetAmountInput extends React.Component<ERC20AssetAmountInput
|
||||
fontSize={`${this.state.currentFontSizePx}px`}
|
||||
fontColor={ColorOption.white}
|
||||
textTransform="uppercase"
|
||||
onClick={onSymbolClick}
|
||||
onClick={this.props.canSelectOtherAsset ? onSymbolClick : undefined}
|
||||
>
|
||||
{assetUtils.formattedSymbolForAsset(asset)}
|
||||
</Text>
|
||||
{this._renderChevronIcon()}
|
||||
{this.props.canSelectOtherAsset && this._renderChevronIcon()}
|
||||
</Flex>
|
||||
</Container>
|
||||
</React.Fragment>
|
||||
|
||||
@@ -20,8 +20,6 @@ import { Heartbeater } from '../util/heartbeater';
|
||||
import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory';
|
||||
import { providerStateFactory } from '../util/provider_state_factory';
|
||||
|
||||
fonts.include();
|
||||
|
||||
export type ZeroExInstantProviderProps = ZeroExInstantProviderRequiredProps &
|
||||
Partial<ZeroExInstantProviderOptionalProps>;
|
||||
|
||||
@@ -88,6 +86,7 @@ export class ZeroExInstantProvider extends React.Component<ZeroExInstantProvider
|
||||
}
|
||||
constructor(props: ZeroExInstantProviderProps) {
|
||||
super(props);
|
||||
fonts.include();
|
||||
const initialAppState = ZeroExInstantProvider._mergeDefaultStateWithProps(this.props);
|
||||
this._store = store.create(initialAppState);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { Action, actions } from '../redux/actions';
|
||||
import { asyncData } from '../redux/async_data';
|
||||
import { State } from '../redux/reducer';
|
||||
import { Network, Omit, OperatingSystem, ProviderState, StandardSlidingPanelContent } from '../types';
|
||||
import { analytics } from '../util/analytics';
|
||||
import { envUtil } from '../util/env';
|
||||
|
||||
export interface ConnectedAccountPaymentMethodProps {}
|
||||
@@ -40,8 +41,11 @@ const mapDispatchToProps = (
|
||||
ownProps: ConnectedAccountPaymentMethodProps,
|
||||
): ConnectedDispatch => ({
|
||||
openInstallWalletPanel: () => dispatch(actions.openStandardSlidingPanel(StandardSlidingPanelContent.InstallWallet)),
|
||||
unlockWalletAndDispatchToStore: async (providerState: ProviderState) =>
|
||||
asyncData.fetchAccountInfoAndDispatchToStore(providerState, dispatch, true),
|
||||
unlockWalletAndDispatchToStore: (providerState: ProviderState) => {
|
||||
analytics.trackAccountUnlockRequested();
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
asyncData.fetchAccountInfoAndDispatchToStore(providerState, dispatch, true);
|
||||
},
|
||||
});
|
||||
|
||||
const mergeProps = (
|
||||
|
||||
@@ -23,9 +23,10 @@ interface ConnectedState {
|
||||
assetBuyer: AssetBuyer;
|
||||
value?: BigNumber;
|
||||
asset?: ERC20Asset;
|
||||
isDisabled: boolean;
|
||||
isInputDisabled: boolean;
|
||||
numberOfAssetsAvailable?: number;
|
||||
affiliateInfo?: AffiliateInfo;
|
||||
canSelectOtherAsset: boolean;
|
||||
}
|
||||
|
||||
interface ConnectedDispatch {
|
||||
@@ -43,21 +44,27 @@ type FinalProps = ConnectedProps & SelectedERC20AssetAmountInputProps;
|
||||
|
||||
const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputProps): ConnectedState => {
|
||||
const processState = state.buyOrderState.processState;
|
||||
const isEnabled = processState === OrderProcessState.None || processState === OrderProcessState.Failure;
|
||||
const isDisabled = !isEnabled;
|
||||
const isInputEnabled = processState === OrderProcessState.None || processState === OrderProcessState.Failure;
|
||||
const isInputDisabled = !isInputEnabled;
|
||||
const selectedAsset =
|
||||
!_.isUndefined(state.selectedAsset) && state.selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20
|
||||
? (state.selectedAsset as ERC20Asset)
|
||||
: undefined;
|
||||
const numberOfAssetsAvailable = _.isUndefined(state.availableAssets) ? undefined : state.availableAssets.length;
|
||||
const canSelectOtherAsset =
|
||||
numberOfAssetsAvailable && numberOfAssetsAvailable > 1
|
||||
? isInputEnabled || processState === OrderProcessState.Success
|
||||
: false;
|
||||
|
||||
const assetBuyer = state.providerState.assetBuyer;
|
||||
return {
|
||||
assetBuyer,
|
||||
value: state.selectedAssetUnitAmount,
|
||||
asset: selectedAsset,
|
||||
isDisabled,
|
||||
isInputDisabled,
|
||||
numberOfAssetsAvailable,
|
||||
affiliateInfo: state.affiliateInfo,
|
||||
canSelectOtherAsset,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -102,8 +109,9 @@ const mergeProps = (
|
||||
onChange: (value, asset) => {
|
||||
connectedDispatch.updateBuyQuote(connectedState.assetBuyer, value, asset, connectedState.affiliateInfo);
|
||||
},
|
||||
isDisabled: connectedState.isDisabled,
|
||||
isInputDisabled: connectedState.isInputDisabled,
|
||||
numberOfAssetsAvailable: connectedState.numberOfAssetsAvailable,
|
||||
canSelectOtherAsset: connectedState.canSelectOtherAsset,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -5,40 +5,50 @@ import * as ReactDOM from 'react-dom';
|
||||
import { DEFAULT_ZERO_EX_CONTAINER_SELECTOR, INJECTED_DIV_CLASS, INJECTED_DIV_ID } from './constants';
|
||||
import { ZeroExInstantOverlay, ZeroExInstantOverlayProps } from './index';
|
||||
import { assert } from './util/assert';
|
||||
import { util } from './util/util';
|
||||
|
||||
export const render = (props: ZeroExInstantOverlayProps, selector: string = DEFAULT_ZERO_EX_CONTAINER_SELECTOR) => {
|
||||
assert.isValidOrderSource('orderSource', props.orderSource);
|
||||
if (!_.isUndefined(props.defaultSelectedAssetData)) {
|
||||
assert.isHexString('defaultSelectedAssetData', props.defaultSelectedAssetData);
|
||||
const isInstantRendered = (): boolean => !!document.getElementById(INJECTED_DIV_ID);
|
||||
|
||||
const validateInstantRenderConfig = (config: ZeroExInstantConfig, selector: string) => {
|
||||
assert.isValidOrderSource('orderSource', config.orderSource);
|
||||
if (!_.isUndefined(config.defaultSelectedAssetData)) {
|
||||
assert.isHexString('defaultSelectedAssetData', config.defaultSelectedAssetData);
|
||||
}
|
||||
if (!_.isUndefined(props.additionalAssetMetaDataMap)) {
|
||||
assert.isValidAssetMetaDataMap('props.additionalAssetMetaDataMap', props.additionalAssetMetaDataMap);
|
||||
if (!_.isUndefined(config.additionalAssetMetaDataMap)) {
|
||||
assert.isValidAssetMetaDataMap('additionalAssetMetaDataMap', config.additionalAssetMetaDataMap);
|
||||
}
|
||||
if (!_.isUndefined(props.defaultAssetBuyAmount)) {
|
||||
assert.isNumber('props.defaultAssetBuyAmount', props.defaultAssetBuyAmount);
|
||||
if (!_.isUndefined(config.defaultAssetBuyAmount)) {
|
||||
assert.isNumber('defaultAssetBuyAmount', config.defaultAssetBuyAmount);
|
||||
}
|
||||
if (!_.isUndefined(props.networkId)) {
|
||||
assert.isNumber('props.networkId', props.networkId);
|
||||
if (!_.isUndefined(config.networkId)) {
|
||||
assert.isNumber('networkId', config.networkId);
|
||||
}
|
||||
if (!_.isUndefined(props.availableAssetDatas)) {
|
||||
assert.areValidAssetDatas('availableAssetDatas', props.availableAssetDatas);
|
||||
if (!_.isUndefined(config.availableAssetDatas)) {
|
||||
assert.areValidAssetDatas('availableAssetDatas', config.availableAssetDatas);
|
||||
}
|
||||
if (!_.isUndefined(props.onClose)) {
|
||||
assert.isFunction('props.onClose', props.onClose);
|
||||
if (!_.isUndefined(config.onClose)) {
|
||||
assert.isFunction('onClose', config.onClose);
|
||||
}
|
||||
if (!_.isUndefined(props.zIndex)) {
|
||||
assert.isNumber('props.zIndex', props.zIndex);
|
||||
if (!_.isUndefined(config.zIndex)) {
|
||||
assert.isNumber('zIndex', config.zIndex);
|
||||
}
|
||||
if (!_.isUndefined(props.affiliateInfo)) {
|
||||
assert.isValidAffiliateInfo('props.affiliateInfo', props.affiliateInfo);
|
||||
if (!_.isUndefined(config.affiliateInfo)) {
|
||||
assert.isValidAffiliateInfo('affiliateInfo', config.affiliateInfo);
|
||||
}
|
||||
if (!_.isUndefined(props.provider)) {
|
||||
assert.isWeb3Provider('props.provider', props.provider);
|
||||
if (!_.isUndefined(config.provider)) {
|
||||
assert.isWeb3Provider('provider', config.provider);
|
||||
}
|
||||
if (!_.isUndefined(props.shouldDisableAnalyticsTracking)) {
|
||||
assert.isBoolean('props.shouldDisableAnalyticsTracking', props.shouldDisableAnalyticsTracking);
|
||||
if (!_.isUndefined(config.shouldDisablePushToHistory)) {
|
||||
assert.isBoolean('shouldDisablePushToHistory', config.shouldDisablePushToHistory);
|
||||
}
|
||||
if (!_.isUndefined(config.shouldDisableAnalyticsTracking)) {
|
||||
assert.isBoolean('shouldDisableAnalyticsTracking', config.shouldDisableAnalyticsTracking);
|
||||
}
|
||||
assert.isString('selector', selector);
|
||||
};
|
||||
|
||||
// Render instant and return a callback that allows you to remove it from the DOM.
|
||||
const renderInstant = (config: ZeroExInstantConfig, selector: string) => {
|
||||
const appendToIfExists = document.querySelector(selector);
|
||||
assert.assert(!_.isNull(appendToIfExists), `Could not find div with selector: ${selector}`);
|
||||
const appendTo = appendToIfExists as Element;
|
||||
@@ -46,14 +56,57 @@ export const render = (props: ZeroExInstantOverlayProps, selector: string = DEFA
|
||||
injectedDiv.setAttribute('id', INJECTED_DIV_ID);
|
||||
injectedDiv.setAttribute('class', INJECTED_DIV_CLASS);
|
||||
appendTo.appendChild(injectedDiv);
|
||||
const closeInstant = () => {
|
||||
if (!_.isUndefined(config.onClose)) {
|
||||
config.onClose();
|
||||
}
|
||||
appendTo.removeChild(injectedDiv);
|
||||
};
|
||||
const instantOverlayProps = {
|
||||
...props,
|
||||
onClose: () => {
|
||||
appendTo.removeChild(injectedDiv);
|
||||
if (!_.isUndefined(props.onClose)) {
|
||||
props.onClose();
|
||||
}
|
||||
},
|
||||
...config,
|
||||
// If we are using the history API, just go back to close
|
||||
onClose: () => (config.shouldDisablePushToHistory ? closeInstant() : window.history.back()),
|
||||
};
|
||||
ReactDOM.render(React.createElement(ZeroExInstantOverlay, instantOverlayProps), injectedDiv);
|
||||
return closeInstant;
|
||||
};
|
||||
|
||||
export interface ZeroExInstantConfig extends ZeroExInstantOverlayProps {
|
||||
shouldDisablePushToHistory?: boolean;
|
||||
}
|
||||
|
||||
export const render = (config: ZeroExInstantConfig, selector: string = DEFAULT_ZERO_EX_CONTAINER_SELECTOR) => {
|
||||
validateInstantRenderConfig(config, selector);
|
||||
if (config.shouldDisablePushToHistory) {
|
||||
if (!isInstantRendered()) {
|
||||
renderInstant(config, selector);
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Before we render, push to history saying that instant is showing for this part of the history.
|
||||
window.history.pushState({ zeroExInstantShowing: true }, '0x Instant');
|
||||
let removeInstant = renderInstant(config, selector);
|
||||
// If the integrator defined a popstate handler, save it to __zeroExInstantIntegratorsPopStateHandler
|
||||
// unless we have already done so on a previous render.
|
||||
const anyWindow = window as any;
|
||||
if (window.onpopstate && !anyWindow.__zeroExInstantIntegratorsPopStateHandler) {
|
||||
anyWindow.__zeroExInstantIntegratorsPopStateHandler = window.onpopstate.bind(window);
|
||||
}
|
||||
const integratorsOnPopStateHandler = anyWindow.__zeroExInstantIntegratorsPopStateHandler || util.boundNoop;
|
||||
const onPopStateHandler = (e: PopStateEvent) => {
|
||||
integratorsOnPopStateHandler(e);
|
||||
const newState = e.state;
|
||||
if (newState && newState.zeroExInstantShowing) {
|
||||
// We have returned to a history state that expects instant to be rendered.
|
||||
if (!isInstantRendered()) {
|
||||
removeInstant = renderInstant(config, selector);
|
||||
}
|
||||
} else {
|
||||
// History has changed to a different state.
|
||||
if (isInstantRendered()) {
|
||||
removeInstant();
|
||||
}
|
||||
}
|
||||
};
|
||||
window.onpopstate = onPopStateHandler;
|
||||
};
|
||||
|
||||
@@ -10,20 +10,6 @@ import { Action, ActionTypes } from './actions';
|
||||
|
||||
import { State } from './reducer';
|
||||
|
||||
const shouldTriggerWalletReady = (prevAccount: Account, curAccount: Account): boolean => {
|
||||
const didJustTurnReady = curAccount.state === AccountState.Ready && prevAccount.state !== AccountState.Ready;
|
||||
if (didJustTurnReady) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (curAccount.state === AccountState.Ready && prevAccount.state === AccountState.Ready) {
|
||||
// Account was ready, and is now ready again, but address has changed
|
||||
return curAccount.address !== prevAccount.address;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
export const analyticsMiddleware: Middleware = store => next => middlewareAction => {
|
||||
const prevState = store.getState() as State;
|
||||
const prevAccount = prevState.providerState.account;
|
||||
@@ -35,10 +21,24 @@ export const analyticsMiddleware: Middleware = store => next => middlewareAction
|
||||
|
||||
switch (nextAction.type) {
|
||||
case ActionTypes.SET_ACCOUNT_STATE_READY:
|
||||
if (curAccount.state === AccountState.Ready && shouldTriggerWalletReady(prevAccount, curAccount)) {
|
||||
if (curAccount.state === AccountState.Ready) {
|
||||
const didJustTurnReady = prevAccount.state !== AccountState.Ready;
|
||||
const didJustUpdateAddress =
|
||||
prevAccount.state === AccountState.Ready && prevAccount.address !== curAccount.address;
|
||||
const ethAddress = curAccount.address;
|
||||
analytics.addUserProperties({ ethAddress });
|
||||
analytics.trackWalletReady();
|
||||
if (didJustTurnReady) {
|
||||
analytics.trackAccountReady(ethAddress);
|
||||
analytics.addUserProperties({ lastKnownEthAddress: ethAddress });
|
||||
} else if (didJustUpdateAddress) {
|
||||
analytics.trackAccountAddressChanged(ethAddress);
|
||||
analytics.addUserProperties({ lastKnownEthAddress: ethAddress });
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ActionTypes.SET_ACCOUNT_STATE_LOCKED:
|
||||
if (prevAccount.state !== AccountState.Locked && curAccount.state === AccountState.Locked) {
|
||||
// if we are moving from account not locked to account locked, track `Account - Locked`
|
||||
analytics.trackAccountLocked();
|
||||
}
|
||||
break;
|
||||
case ActionTypes.UPDATE_ACCOUNT_ETH_BALANCE:
|
||||
|
||||
@@ -5,6 +5,7 @@ import { Dispatch } from 'redux';
|
||||
|
||||
import { BIG_NUMBER_ZERO } from '../constants';
|
||||
import { AccountState, ERC20Asset, OrderProcessState, ProviderState } from '../types';
|
||||
import { analytics } from '../util/analytics';
|
||||
import { assetUtils } from '../util/asset';
|
||||
import { buyQuoteUpdater } from '../util/buy_quote_updater';
|
||||
import { coinbaseApi } from '../util/coinbase_api';
|
||||
@@ -58,6 +59,7 @@ export const asyncData = {
|
||||
? await (provider as any).enable()
|
||||
: await web3Wrapper.getAvailableAddressesAsync();
|
||||
} catch (e) {
|
||||
analytics.trackAccountUnlockDenied();
|
||||
dispatch(actions.setAccountStateLocked());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ObjectMap } from '@0x/types';
|
||||
|
||||
import { AffiliateInfo, Network, OrderSource, ProviderState } from '../types';
|
||||
|
||||
import { heapUtil } from './heap';
|
||||
import { EventProperties, heapUtil } from './heap';
|
||||
|
||||
let isDisabled = false;
|
||||
export const disableAnalytics = (shouldDisableAnalytics: boolean) => {
|
||||
@@ -17,11 +15,15 @@ export const evaluateIfEnabled = (fnCall: () => void) => {
|
||||
|
||||
enum EventNames {
|
||||
INSTANT_OPENED = 'Instant - Opened',
|
||||
WALLET_READY = 'Wallet - Ready',
|
||||
ACCOUNT_LOCKED = 'Account - Locked',
|
||||
ACCOUNT_READY = 'Account - Ready',
|
||||
ACCOUNT_UNLOCK_REQUESTED = 'Account - Unlock Requested',
|
||||
ACCOUNT_UNLOCK_DENIED = 'Account - Unlock Denied',
|
||||
ACCOUNT_ADDRESS_CHANGED = 'Account - Address Changed',
|
||||
}
|
||||
const track = (eventName: EventNames, eventData: ObjectMap<string | number> = {}): void => {
|
||||
const track = (eventName: EventNames, eventProperties: EventProperties = {}): void => {
|
||||
evaluateIfEnabled(() => {
|
||||
heapUtil.evaluateHeapCall(heap => heap.track(eventName, eventData));
|
||||
heapUtil.evaluateHeapCall(heap => heap.track(eventName, eventProperties));
|
||||
});
|
||||
};
|
||||
function trackingEventFnWithoutPayload(eventName: EventNames): () => void {
|
||||
@@ -30,16 +32,14 @@ function trackingEventFnWithoutPayload(eventName: EventNames): () => void {
|
||||
};
|
||||
}
|
||||
// tslint:disable-next-line:no-unused-variable
|
||||
function trackingEventFnWithPayload<T extends ObjectMap<string | number>>(
|
||||
eventName: EventNames,
|
||||
): (eventDataProperties: T) => void {
|
||||
return (eventDataProperties: T) => {
|
||||
track(eventName, eventDataProperties);
|
||||
function trackingEventFnWithPayload(eventName: EventNames): (eventProperties: EventProperties) => void {
|
||||
return (eventProperties: EventProperties) => {
|
||||
track(eventName, eventProperties);
|
||||
};
|
||||
}
|
||||
|
||||
export interface AnalyticsUserOptions {
|
||||
ethAddress?: string;
|
||||
lastKnownEthAddress?: string;
|
||||
ethBalanceInUnitAmount?: string;
|
||||
}
|
||||
export interface AnalyticsEventOptions {
|
||||
@@ -53,6 +53,7 @@ export interface AnalyticsEventOptions {
|
||||
affiliateAddress?: string;
|
||||
affiliateFeePercent?: number;
|
||||
}
|
||||
|
||||
export const analytics = {
|
||||
addUserProperties: (properties: AnalyticsUserOptions): void => {
|
||||
evaluateIfEnabled(() => {
|
||||
@@ -86,6 +87,11 @@ export const analytics = {
|
||||
affiliateFeePercent,
|
||||
};
|
||||
},
|
||||
trackWalletReady: trackingEventFnWithoutPayload(EventNames.WALLET_READY),
|
||||
trackInstantOpened: trackingEventFnWithoutPayload(EventNames.INSTANT_OPENED),
|
||||
trackAccountLocked: trackingEventFnWithoutPayload(EventNames.ACCOUNT_LOCKED),
|
||||
trackAccountReady: (address: string) => trackingEventFnWithPayload(EventNames.ACCOUNT_READY)({ address }),
|
||||
trackAccountUnlockRequested: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_REQUESTED),
|
||||
trackAccountUnlockDenied: trackingEventFnWithoutPayload(EventNames.ACCOUNT_UNLOCK_DENIED),
|
||||
trackAccountAddressChanged: (address: string) =>
|
||||
trackingEventFnWithPayload(EventNames.ACCOUNT_ADDRESS_CHANGED)({ address }),
|
||||
};
|
||||
|
||||
@@ -6,11 +6,13 @@ import { HEAP_ANALYTICS_ID } from '../constants';
|
||||
|
||||
import { AnalyticsEventOptions, AnalyticsUserOptions } from './analytics';
|
||||
|
||||
export type EventProperties = ObjectMap<string | number>;
|
||||
|
||||
export interface HeapAnalytics {
|
||||
loaded: boolean;
|
||||
appid: string;
|
||||
identify(id: string, idType: string): void;
|
||||
track(eventName: string, eventProperties?: ObjectMap<string | number>): void;
|
||||
track(eventName: string, eventProperties?: EventProperties): void;
|
||||
resetIdentity(): void;
|
||||
addUserProperties(properties: AnalyticsUserOptions): void;
|
||||
addEventProperties(properties: AnalyticsEventOptions): void;
|
||||
|
||||
@@ -2,16 +2,11 @@
|
||||
"extends": "../../tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib",
|
||||
"rootDir": ".",
|
||||
"rootDir": "src",
|
||||
"jsx": "react",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"noImplicitAny": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"lib": ["es2015", "dom"],
|
||||
"target": "es5",
|
||||
"sourceMap": true
|
||||
"allowSyntheticDefaultImports": true
|
||||
},
|
||||
"include": ["./src/**/*", "./test/**/*"],
|
||||
"include": ["./src/**/*"],
|
||||
"exclude": ["./src/index.umd.ts"]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "2.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "2.1.1",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.2 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.1.1 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/json-schemas",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@types/lodash.foreach": "^4.5.3",
|
||||
"@types/lodash.values": "^4.3.3",
|
||||
"@types/mocha": "^2.2.42",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/metacoin",
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.29",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -18,7 +18,7 @@
|
||||
"test:coverage": "SOLIDITY_COVERAGE=true run-s build run_mocha coverage:report:text coverage:report:lcov",
|
||||
"test:profile": "SOLIDITY_PROFILER=true run-s build run_mocha profiler:report:html",
|
||||
"run_mocha": "mocha --require source-map-support/register --require make-promises-safe lib/test/**/*_test.js lib/test/global_hooks.js --bail --exit --timeout 10000",
|
||||
"generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers",
|
||||
"generate_contract_wrappers": "abi-gen --abis 'artifacts/Metacoin.json' --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output src/contract_wrappers --backend ethers",
|
||||
"coverage:report:text": "istanbul report text",
|
||||
"coverage:report:html": "istanbul report html && open coverage/index.html",
|
||||
"profiler:report:html": "istanbul report html && open coverage/index.html",
|
||||
@@ -29,15 +29,16 @@
|
||||
"author": "",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/abi-gen": "^1.0.16",
|
||||
"@0x/base-contract": "^3.0.6",
|
||||
"@0x/sol-cov": "^2.1.12",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/abi-gen": "^1.0.17",
|
||||
"@0x/abi-gen-templates": "^1.0.0",
|
||||
"@0x/base-contract": "^3.0.7",
|
||||
"@0x/sol-cov": "^2.1.13",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"@types/mocha": "^5.2.2",
|
||||
"copyfiles": "^2.0.0",
|
||||
"ethereum-types": "^1.1.2",
|
||||
@@ -46,8 +47,8 @@
|
||||
"run-s": "^0.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^1.0.17",
|
||||
"@0x/sol-compiler": "^1.1.12",
|
||||
"@0x/dev-utils": "^1.0.18",
|
||||
"@0x/sol-compiler": "^1.1.13",
|
||||
"chai": "^4.0.1",
|
||||
"chai-as-promised": "^7.1.0",
|
||||
"chai-bignumber": "^2.0.1",
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
[
|
||||
{
|
||||
"version": "2.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Add CLI `0x-migrate` for running the 0x migrations in a language-agnostic way",
|
||||
"pr": 1324
|
||||
},
|
||||
{
|
||||
"note": "Deploy testnet Exchange arfitact. Previously mainnet Exchange artifact was deployed.",
|
||||
"pr": 1309
|
||||
},
|
||||
{
|
||||
"note": "Fund the Forwarder with ZRX for fees.",
|
||||
"pr": 1309
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping",
|
||||
"pr": 1301
|
||||
}
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "2.0.4",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.1.0 - _November 21, 2018_
|
||||
|
||||
* Export all type declarations used by the public interface, as well as the `ContractAddresses` mapping (#1301)
|
||||
|
||||
## v2.0.4 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
2
packages/migrations/bin/0x-migrate.js
Executable file
2
packages/migrations/bin/0x-migrate.js
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('../lib/cli.js');
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/migrations",
|
||||
"version": "2.0.4",
|
||||
"version": "2.1.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -13,32 +13,42 @@
|
||||
"clean": "shx rm -rf lib",
|
||||
"lint": "tslint --format stylish --project .",
|
||||
"migrate:v2": "run-s build script:migrate:v2",
|
||||
"script:migrate:v2": "node ./lib/migrate.js --contracts-version 2.0.0"
|
||||
"script:migrate:v2": "node ./lib/migrate.js",
|
||||
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --tsconfig typedoc-tsconfig.json --json $JSON_FILE_PATH $PROJECT_FILES"
|
||||
},
|
||||
"config": {
|
||||
"postpublish": {
|
||||
"assets": []
|
||||
}
|
||||
},
|
||||
"bin": {
|
||||
"0x-migrate": "bin/0x-migrate.js"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^1.0.17",
|
||||
"@0x/dev-utils": "^1.0.18",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@types/yargs": "^10.0.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"shx": "^0.2.2",
|
||||
"tslint": "5.11.0",
|
||||
"typedoc": "0.13.0",
|
||||
"typescript": "3.0.1",
|
||||
"yargs": "^10.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/abi-gen-wrappers": "^1.0.5",
|
||||
"@0x/base-contract": "^3.0.6",
|
||||
"@0x/contract-addresses": "^1.1.0",
|
||||
"@0x/abi-gen-wrappers": "^1.1.0",
|
||||
"@0x/base-contract": "^3.0.7",
|
||||
"@0x/contract-addresses": "^1.2.0",
|
||||
"@0x/contract-artifacts": "^1.1.0",
|
||||
"@0x/order-utils": "^3.0.2",
|
||||
"@0x/sol-compiler": "^1.1.12",
|
||||
"@0x/subproviders": "^2.1.4",
|
||||
"@0x/order-utils": "^3.0.3",
|
||||
"@0x/sol-compiler": "^1.1.13",
|
||||
"@0x/subproviders": "^2.1.5",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.5",
|
||||
"@0x/web3-wrapper": "^3.1.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.5",
|
||||
"@ledgerhq/hw-app-eth": "^4.3.0",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
|
||||
38
packages/migrations/src/cli.ts
Normal file
38
packages/migrations/src/cli.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env node
|
||||
import { RPCSubprovider, Web3ProviderEngine } from '@0x/subproviders';
|
||||
import { logUtils } from '@0x/utils';
|
||||
import * as yargs from 'yargs';
|
||||
|
||||
import { runMigrationsAsync } from './migration';
|
||||
|
||||
const args = yargs
|
||||
.option('rpc-url', {
|
||||
describe: 'Endpoint where backing Ethereum JSON RPC interface is available',
|
||||
type: 'string',
|
||||
demandOption: false,
|
||||
default: 'http://localhost:8545',
|
||||
})
|
||||
.option('from', {
|
||||
describe: 'Ethereum address from which to deploy the contracts',
|
||||
type: 'string',
|
||||
demandOption: true,
|
||||
})
|
||||
.example(
|
||||
'$0 --rpc-url http://localhost:8545 --from 0x5409ed021d9299bf6814279a6a1411a7e866a631',
|
||||
'Full usage example',
|
||||
).argv;
|
||||
|
||||
(async () => {
|
||||
const rpcSubprovider = new RPCSubprovider(args['rpc-url']);
|
||||
const provider = new Web3ProviderEngine();
|
||||
provider.addProvider(rpcSubprovider);
|
||||
provider.start();
|
||||
const txDefaults = {
|
||||
from: args.from,
|
||||
};
|
||||
await runMigrationsAsync(provider, txDefaults);
|
||||
process.exit(0);
|
||||
})().catch(err => {
|
||||
logUtils.log(err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -1 +1,11 @@
|
||||
export {
|
||||
Provider,
|
||||
TxData,
|
||||
JSONRPCRequestPayload,
|
||||
JSONRPCErrorCallback,
|
||||
TxDataPayable,
|
||||
JSONRPCResponsePayload,
|
||||
JSONRPCResponseError,
|
||||
} from 'ethereum-types';
|
||||
export { ContractAddresses } from '@0x/contract-addresses';
|
||||
export { runMigrationsAsync, runMigrationsOnceAsync } from './migration';
|
||||
|
||||
@@ -11,10 +11,9 @@ import { erc20TokenInfo, erc721TokenInfo } from './utils/token_info';
|
||||
|
||||
/**
|
||||
* Creates and deploys all the contracts that are required for the latest
|
||||
* version of the 0x protocol. Custom migrations can be defined here. This will
|
||||
* be called with the CLI 'migrate:v2' command.
|
||||
* @param provider Web3 provider instance.
|
||||
* @param txDefaults Default transaction values to use when deploying contracts.
|
||||
* version of the 0x protocol.
|
||||
* @param provider Web3 provider instance. Your provider instance should connect to the testnet you want to deploy to.
|
||||
* @param txDefaults Default transaction values to use when deploying contracts (e.g., specify the desired contract creator with the `from` parameter).
|
||||
* @returns The addresses of the contracts that were deployed.
|
||||
*/
|
||||
export async function runMigrationsAsync(provider: Provider, txDefaults: Partial<TxData>): Promise<ContractAddresses> {
|
||||
@@ -48,6 +47,7 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
|
||||
artifacts.Exchange,
|
||||
provider,
|
||||
txDefaults,
|
||||
zrxAssetData,
|
||||
);
|
||||
|
||||
// Multisigs
|
||||
@@ -141,6 +141,13 @@ export async function runMigrationsAsync(provider: Provider, txDefaults: Partial
|
||||
zrxAssetData,
|
||||
);
|
||||
|
||||
// Fund the Forwarder with ZRX
|
||||
const zrxDecimals = await zrxToken.decimals.callAsync();
|
||||
const zrxForwarderAmount = Web3Wrapper.toBaseUnitAmount(new BigNumber(5000), zrxDecimals);
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await zrxToken.transfer.sendTransactionAsync(forwarder.address, zrxForwarderAmount, txDefaults),
|
||||
);
|
||||
|
||||
return {
|
||||
erc20Proxy: erc20Proxy.address,
|
||||
erc721Proxy: erc721Proxy.address,
|
||||
@@ -159,8 +166,8 @@ let _cachedContractAddresses: ContractAddresses;
|
||||
* Exactly like runMigrationsAsync but will only run the migrations the first
|
||||
* time it is called. Any subsequent calls will return the cached contract
|
||||
* addresses.
|
||||
* @param provider Web3 provider instance.
|
||||
* @param txDefaults Default transaction values to use when deploying contracts.
|
||||
* @param provider Web3 provider instance. Your provider instance should connect to the testnet you want to deploy to.
|
||||
* @param txDefaults Default transaction values to use when deploying contracts (e.g., specify the desired contract creator with the `from` parameter).
|
||||
* @returns The addresses of the contracts that were deployed.
|
||||
*/
|
||||
export async function runMigrationsOnceAsync(
|
||||
|
||||
7
packages/migrations/typedoc-tsconfig.json
Normal file
7
packages/migrations/typedoc-tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../typedoc-tsconfig",
|
||||
"compilerOptions": {
|
||||
"outDir": "lib"
|
||||
},
|
||||
"include": ["./src/**/*", "./test/**/*"]
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@0x/monorepo-scripts",
|
||||
"version": "1.0.13",
|
||||
"version": "1.0.14",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
||||
@@ -195,6 +195,6 @@ const checkRequiredEnvVariables = () => {
|
||||
};
|
||||
|
||||
prepublishChecksAsync().catch(err => {
|
||||
utils.log(err.message);
|
||||
utils.log(err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
@@ -91,6 +91,7 @@ export const utils = {
|
||||
const changelog = changelogUtils.getChangelogOrCreateIfMissing(packageName, packageLocation);
|
||||
if (_.isEmpty(changelog)) {
|
||||
nextVersionIfValid = semver.inc(currentVersion, 'patch');
|
||||
return nextVersionIfValid as string;
|
||||
}
|
||||
const lastEntry = changelog[0];
|
||||
if (semver.gt(currentVersion, lastEntry.version)) {
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "3.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "3.0.2",
|
||||
|
||||
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.3 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.2 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user