Compare commits
384 Commits
@0x/react-
...
@0x/web3-w
Author | SHA1 | Date | |
---|---|---|---|
|
4861e48059 | ||
|
c0b9214138 | ||
|
9266df43a4 | ||
|
dac0bee95c | ||
|
494adedeef | ||
|
f0ed0c6a35 | ||
|
47a87e57f1 | ||
|
768c28f328 | ||
|
96a46bcb4b | ||
|
4653e4c011 | ||
|
372a242ea2 | ||
|
fb1893626f | ||
|
5fd837cc4f | ||
|
435e62a94d | ||
|
598db72523 | ||
|
4ebc561986 | ||
|
d23fd23e91 | ||
|
6e2523625f | ||
|
23274f9b48 | ||
|
7efa71eaf6 | ||
|
9c27feeff6 | ||
|
be787a0fd1 | ||
|
ee5b6ad77f | ||
|
e08fb72cf1 | ||
|
fdc4a4e5fa | ||
|
ef2c5159dd | ||
|
f0f991245c | ||
|
d3b0162dc9 | ||
|
f3d08c13eb | ||
|
10cc46779e | ||
|
80a53aedf2 | ||
|
1b96867df8 | ||
|
0192127e5d | ||
|
7610130f73 | ||
|
218c0d9f51 | ||
|
d5898a3a05 | ||
|
b055055253 | ||
|
6e3d70af56 | ||
|
ae570dba05 | ||
|
2795849dd3 | ||
|
fad48b8b6c | ||
|
685d83d6d0 | ||
|
9206f2d288 | ||
|
2fec7613c4 | ||
|
2f026cd1b6 | ||
|
6eec84d21b | ||
|
5f6a5e28e7 | ||
|
825911ed89 | ||
|
a72d418ddb | ||
|
cf5fd8ff42 | ||
|
994c6032bb | ||
|
1494a70bad | ||
|
6d565f4bff | ||
|
c6592148a7 | ||
|
6e39f11db1 | ||
|
ee86cd1dcc | ||
|
420a677828 | ||
|
9da43878b1 | ||
|
527f074e59 | ||
|
eefd9d9dd2 | ||
|
2648f5ba65 | ||
|
1b45aa5974 | ||
|
dcf19e5226 | ||
|
c5c852f54f | ||
|
7b15217694 | ||
|
8caded1d1d | ||
|
ebc3116909 | ||
|
387d7199d1 | ||
|
dc965da64e | ||
|
1d83d99d87 | ||
|
09a683557b | ||
|
99e92a346b | ||
|
9ddd45e2c6 | ||
|
0c0a1db114 | ||
|
b1474973cd | ||
|
f0f6b26c3b | ||
|
03b3b80a65 | ||
|
06cc66005c | ||
|
b0792a85a4 | ||
|
a5359df002 | ||
|
10c9d0b723 | ||
|
5c81f07d46 | ||
|
0adc8f5053 | ||
|
804de89796 | ||
|
6604e2db20 | ||
|
f46a49fd13 | ||
|
707af1ec58 | ||
|
31d1b4ba67 | ||
|
d750225554 | ||
|
ed91c6c874 | ||
|
68c15de890 | ||
|
71d15a68c1 | ||
|
3273117888 | ||
|
8ea2eb9102 | ||
|
b494a4a4db | ||
|
e0beb7fb38 | ||
|
fc123871ad | ||
|
f27fef0295 | ||
|
36974a9557 | ||
|
584dc6217d | ||
|
edf07d9b5b | ||
|
f66b695a47 | ||
|
61b3305af3 | ||
|
e2b3c98d25 | ||
|
39429dde68 | ||
|
baf69a60eb | ||
|
a90be44c9f | ||
|
fb7ac81945 | ||
|
db26ca977f | ||
|
a8803431b3 | ||
|
2821bac3a3 | ||
|
716168132a | ||
|
351e0e6f5f | ||
|
0244d04a55 | ||
|
895281989c | ||
|
21f39079c8 | ||
|
c2ebcfb023 | ||
|
15f05733be | ||
|
7741edbbcc | ||
|
1593b94aac | ||
|
4b64d8c3aa | ||
|
6124d80c89 | ||
|
48aec9ef47 | ||
|
1a7b167f63 | ||
|
b7eb2e887d | ||
|
eca63b1a58 | ||
|
2bda6dd719 | ||
|
cd4600b081 | ||
|
83f4fa92a5 | ||
|
7ad5dbc59d | ||
|
ba41fc9275 | ||
|
36e888c3a5 | ||
|
6939182348 | ||
|
7a38a196ad | ||
|
0c91bf1415 | ||
|
e1bc3f3f2d | ||
|
e5cfc94cd2 | ||
|
22cfdd9f0b | ||
|
0ba34f587c | ||
|
e86982bd41 | ||
|
6de499459c | ||
|
3169b72406 | ||
|
db6b2cbb05 | ||
|
a1b7f0ad83 | ||
|
b62fbd0b13 | ||
|
578a46c57f | ||
|
9ab55fd07d | ||
|
497385818b | ||
|
c30ae762bf | ||
|
953f8c119b | ||
|
6119bd3115 | ||
|
1880c7c27d | ||
|
8772d91699 | ||
|
9b725a645d | ||
|
2bfd03e64f | ||
|
e23f90b82c | ||
|
0648e270fe | ||
|
3d6711bd38 | ||
|
99541f89f7 | ||
|
4cb138ab37 | ||
|
8b8e277b75 | ||
|
94de441de7 | ||
|
43443d6057 | ||
|
4caacc78a1 | ||
|
302d172aad | ||
|
21046e4349 | ||
|
9914f7edef | ||
|
1426145946 | ||
|
6fe4aef6f7 | ||
|
3f0d94c838 | ||
|
9384c507ac | ||
|
097bfe581d | ||
|
ac942faa25 | ||
|
654c13df8a | ||
|
6e2fbcdb3e | ||
|
51dce30088 | ||
|
a4f6cd21bd | ||
|
1564415e5d | ||
|
9a53a29b1f | ||
|
83a6d7b97d | ||
|
e8be70da10 | ||
|
4d7bd15334 | ||
|
f7914af9c5 | ||
|
848193074a | ||
|
31ffa65f59 | ||
|
21ae0c46e1 | ||
|
d64bc28ba6 | ||
|
b6e6607c46 | ||
|
d8c6b36cff | ||
|
e00c41ad88 | ||
|
9c182fe6e4 | ||
|
cbcb954c30 | ||
|
42565869a4 | ||
|
85a99203d0 | ||
|
988bb398bc | ||
|
ed62271cda | ||
|
74254636b4 | ||
|
db7f74f99f | ||
|
45a1899ead | ||
|
1626e284cd | ||
|
c5d208c90e | ||
|
a3ccd42093 | ||
|
cb3e7b4120 | ||
|
7e58f21a74 | ||
|
3add465edb | ||
|
df71dba8ed | ||
|
5c4ad3505a | ||
|
37d60dc39e | ||
|
59c473dc33 | ||
|
5f9c7d8cfa | ||
|
9a6bc4f05f | ||
|
ef860c5a58 | ||
|
d19a9acd6b | ||
|
416fec7a97 | ||
|
25d0b1e6e5 | ||
|
e36fc4e6ae | ||
|
0a5364ff35 | ||
|
cabb7432b9 | ||
|
9726c375af | ||
|
f582cc327b | ||
|
7534c0f19e | ||
|
004e197863 | ||
|
ae1fb97794 | ||
|
79397d4b15 | ||
|
b7fd0ee74c | ||
|
3931202d4a | ||
|
2cf3d4ff83 | ||
|
bc14ae5d8b | ||
|
d4a8cd1f1c | ||
|
e9b298931a | ||
|
f8681a7780 | ||
|
fb3c2e1fb0 | ||
|
9adfd1f323 | ||
|
8c96720080 | ||
|
d0609d7131 | ||
|
33a156d9b5 | ||
|
20e3a22d5d | ||
|
312dfb9572 | ||
|
447b0f91f9 | ||
|
ed26f5af98 | ||
|
28d105a1af | ||
|
fd4a782bdd | ||
|
587739f8e1 | ||
|
4da574560d | ||
|
f9e0123986 | ||
|
f4cc152cfb | ||
|
29747a0487 | ||
|
b01db9141b | ||
|
71aeb7cddc | ||
|
34d86647bf | ||
|
a8863ac85e | ||
|
ca9bb45327 | ||
|
450814ad80 | ||
|
0a38bf8fd6 | ||
|
2e61050a22 | ||
|
1dd903ddcc | ||
|
61f227e123 | ||
|
633d17ffde | ||
|
20ed4fbbd4 | ||
|
39bb855a9c | ||
|
b2a26ef21a | ||
|
d895b0296f | ||
|
b45167422b | ||
|
8e81b0680f | ||
|
408bbdb52e | ||
|
f2a6feff29 | ||
|
7ccf9cd48e | ||
|
8afcba7ba1 | ||
|
2eef766aff | ||
|
fe23bf9e51 | ||
|
1aae112d0e | ||
|
504f4d9eb9 | ||
|
daf5719f08 | ||
|
e9754b4c08 | ||
|
adce627888 | ||
|
7688037fb8 | ||
|
997912a8f8 | ||
|
b961cb1952 | ||
|
e1d64def20 | ||
|
fe1b7f15e8 | ||
|
3f647c259a | ||
|
06dcf24496 | ||
|
77c77631e1 | ||
|
b0e9f58033 | ||
|
80e7e84a06 | ||
|
15105cde0f | ||
|
921ef90a14 | ||
|
1a1caa1ca2 | ||
|
af6aa2df93 | ||
|
fe1746c7ac | ||
|
d19c8ae9b1 | ||
|
84215f75e0 | ||
|
4fc457b78b | ||
|
2f6b1273aa | ||
|
da9de70bbc | ||
|
35bfd493e8 | ||
|
b174a891bc | ||
|
bb79a5e324 | ||
|
9e0c232a73 | ||
|
e02dc13805 | ||
|
c8b2a975f4 | ||
|
820ab062a6 | ||
|
7b4f63a39c | ||
|
8a64599ca5 | ||
|
9b1ec5baaa | ||
|
3a3fe0e69a | ||
|
5c21d3f6af | ||
|
baba78f545 | ||
|
f03afe6f1b | ||
|
a824264da2 | ||
|
a66c03aa21 | ||
|
bed134c1da | ||
|
d36cf58b82 | ||
|
5527de62ff | ||
|
11f0bebd7f | ||
|
954fe3f549 | ||
|
4a444591c1 | ||
|
3fb29041b0 | ||
|
161a935003 | ||
|
e8afc66a5a | ||
|
49a9345bf4 | ||
|
d73faf1b81 | ||
|
0c6110b736 | ||
|
2da258f5be | ||
|
e9bf7206bd | ||
|
2b4dcb419e | ||
|
c67632dff5 | ||
|
01b36b4949 | ||
|
711b307e6c | ||
|
1ab19a7c23 | ||
|
7068f7b4d1 | ||
|
79f0324abc | ||
|
b82148ea60 | ||
|
add1cfd261 | ||
|
cdf78494d5 | ||
|
789f573452 | ||
|
22f217807d | ||
|
08797392e0 | ||
|
853c77dc09 | ||
|
a4a46dc076 | ||
|
0d565fe32f | ||
|
320460feb9 | ||
|
dbce3f8935 | ||
|
76b3caa124 | ||
|
0101cd73aa | ||
|
6ef628613e | ||
|
498be7ac41 | ||
|
0391f93490 | ||
|
399a7d5fec | ||
|
0d201173ef | ||
|
2d43f312c8 | ||
|
1ec8a4115f | ||
|
753b33aec5 | ||
|
7626d1d6fe | ||
|
a8a1ea92a6 | ||
|
ff027ee36a | ||
|
ba292ead45 | ||
|
5355f3c538 | ||
|
478330c12d | ||
|
b1376059d3 | ||
|
2bba01c664 | ||
|
433fb3597d | ||
|
7460f2796a | ||
|
7249cc7b49 | ||
|
b598827708 | ||
|
128abb39dd | ||
|
79a533940e | ||
|
3a51bd1e69 | ||
|
3f1f19e344 | ||
|
3aa831ad77 | ||
|
3fd667b3be | ||
|
fa7bd072d0 | ||
|
daa011f7cb | ||
|
239eada7d9 | ||
|
a50f0ca997 | ||
|
39ae21d693 | ||
|
fc138cd73d | ||
|
990d510d05 | ||
|
801004be66 | ||
|
81fb8d614f | ||
|
3e75daafa1 | ||
|
6696aa46ee | ||
|
14a9770d57 | ||
|
b8d2cc1221 |
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']
|
19
.github/stale.yml
vendored
Normal file
19
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: >
|
||||
This issue has been automatically closed because no activity occured in 7 days after being marked as stale. If it's still relevant - feel free to reopen. Thank you
|
||||
for your contributions.
|
@@ -6,6 +6,7 @@ lib
|
||||
/packages/contract-artifacts/artifacts
|
||||
/python-packages/order_utils/src/zero_ex/contract_artifacts/artifacts
|
||||
/packages/json-schemas/schemas
|
||||
/python-packages/order_utils/src/zero_ex/json_schemas/schemas
|
||||
/packages/metacoin/src/contract_wrappers
|
||||
/packages/metacoin/artifacts
|
||||
/packages/sra-spec/public/
|
||||
|
@@ -1,61 +1,92 @@
|
||||
## 0x Contribution Guide
|
||||
|
||||
Thank you for your interest in contributing to 0x protocol! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!
|
||||
We welcome contributions from anyone on the internet and are grateful for even the smallest contributions. This document will help get you setup to start contributing back to 0x.
|
||||
|
||||
### How to contribute
|
||||
### Getting started
|
||||
|
||||
If you'd like to contribute to 0x protocol, please fork the repo, fix, commit and send a pull request against the `development` branch for the maintainers to review and merge into the main code base. If you wish to submit more complex changes though, please check with a core dev first on [our RocketChat #dev channel](http://chat.0xproject.com) to ensure those changes are in-line with the general philosophy of the project and/or to get some early feedback which can make both your efforts easier as well as our review and merge procedures quick and simple.
|
||||
1. Fork `0xproject/0x-monorepo`
|
||||
2. Clone your fork
|
||||
3. Follow the [installation & build steps](https://github.com/0xProject/0x-monorepo#install-dependencies) in the repo's top-level README.
|
||||
4. Setup the recommended [Development Tooling](#development-tooling).
|
||||
5. Open a PR with the `[WIP]` flag against the `development` branch and describe the change you are intending to undertake in the PR description. (see [our branch naming conventions](#branch-structure))
|
||||
|
||||
We encourage a “PR early” approach so create the PR as early as possible even without the fix/feature ready, so that devs and other contributors know you have picked up the issue. These early PRs should indicate an 'in progress' status by adding the '[WIP]' prefix to the PR title. Please make sure your contributions adhere to our coding guidelines:
|
||||
Before removing the `[WIP]` tag and submitting the PR for review, make sure:
|
||||
|
||||
* Pull requests adding features or refactoring should be opened against the `development` branch
|
||||
* Pull requests fixing bugs in the latest release version should be opened again the `master` branch
|
||||
* Write [good commit messages](https://chris.beams.io/posts/git-commit/)
|
||||
* It passes our linter checks (`yarn lint`)
|
||||
* It is properly formatted with Prettier (`yarn prettier`)
|
||||
* It passes our continuous integration tests (See: [Enabling code coverage checks on your fork](#enabling-code-coverage-checks-on-your-fork) for instructions on getting the `submit-coverage` test to pass on forks)
|
||||
* You've created/updated the corresponding [CHANGELOG](#CHANGELOGs) entries.
|
||||
* Your changes have sufficient test coverage (e.g regression tests have been added for bug fixes)
|
||||
|
||||
### Code quality
|
||||
### Branch structure
|
||||
|
||||
Because 0x.js is used by multiple relayers in production and their businesses depend on it, we strive for exceptional code quality. Please follow the existing code standards and conventions. `tslint` and `prettier` (described below) will help you.
|
||||
We have two main branches:
|
||||
|
||||
If you're adding functionality, please also add tests and make sure they pass. We have an automatic coverage reporting tool, so we'll see it if they are missing ;)
|
||||
If you're adding a new public function/member, make sure you document it with Java doc-style comments. We use typedoc to generate [awesome documentation](https://0xproject.com/docs/0xjs) from the comments within our source code.
|
||||
* `master` represents the most recently released (published on npm) version of the codebase.
|
||||
* `development` represents the current development state of the codebase.
|
||||
|
||||
If the sub-package you are modifying has a `CHANGELOG.md` file, make sure to add an entry in it for the change made to the package. For published packages, only changes that modify the public interface or behavior of the package need a CHANGELOG entry.
|
||||
ALL PRs should be opened against `development`.
|
||||
|
||||
#### Enabling code coverage checks on your fork
|
||||
Branch names should be prefixed with `fix`, `feature` or `refactor`.
|
||||
|
||||
If you simply fork the repo and then create a PR sourced from it, your PR will fail its test coverage check. This is because the 0x CircleCI configuration sets the `COVERALLS_REPO_TOKEN` environment variable to the token for 0xProject/0x-monorepo, but when running the check against your fork the token needs to match the repo that is your fork, rather than the 0x repo.
|
||||
* e.g `fix/broken-wiki-link`
|
||||
* If the PR only edits a single package, add it's name too
|
||||
* e.g `fix/website/broken-wiki-link`
|
||||
|
||||
To facilitate this check, after creating your fork, but before creating the branch for your PR, do the following:
|
||||
### CHANGELOGs
|
||||
|
||||
1. Log in to [coveralls.io](https://coveralls.io/), go to Add Repos, and enable your fork. Then go to the settings for that repo, and copy the Repo Token identifier.
|
||||
2. Log in to [CircleCI](https://circleci.com/login), go to Add Projects, click the Set Up Project button corresponding to your fork, and then click Start Building. (Aside from step 3 below, no actual set up is needed, since it will use the `.circleci/config.yml` file in 0x-monorepo, so you can ignore all of the instruction/explanation given on the page with the Start Building button.)
|
||||
3. In CircleCI, configure your project to add an Environment Variable, with name `COVERALLS_REPO_TOKEN`, and for the value paste in the Repo Token you copied in step 1.
|
||||
At 0x we use [Semantic Versioning](http://semver.org/) for all our published packages. If a change you make corresponds to a semver bump, you must modify the package's `CHANGELOG.json` file accordingly.
|
||||
|
||||
Now, when you push to your branch, CircleCI will automatically run all of the checks in your own instance, and the coverage check will work since it has the proper Repo Token, and the PR will magically refer to your own checks rather than running them in the 0x CircleCI instance.
|
||||
Each CHANGELOG entry that corresponds to a published package will have a `timestamp`. If no entry exists without a `timestamp`, you must first create a new one:
|
||||
|
||||
### Styleguide
|
||||
```
|
||||
{
|
||||
"version": "1.0.1", <- The updated package version
|
||||
"changes": [
|
||||
{
|
||||
"note": "", <- Describe your change
|
||||
"PR": 100 <- Your PR number
|
||||
}
|
||||
]
|
||||
},
|
||||
```
|
||||
|
||||
We use [TSLint](https://palantir.github.io/tslint/) with [custom configs](https://github.com/0xProject/0x-monorepo/tree/development/packages/tslint-config) to keep our code style consistent.
|
||||
If an entry without a `timestamp` already exists, this means other changes have been introduced by other collaborators since the last publish. Add your changes to the list of notes and adjust the version if your PR introduces a greater semver change (i.e current changes required a patch bump, but your changes require a major version bump).
|
||||
|
||||
To lint your code just run: `yarn lint`
|
||||
### Development Tooling
|
||||
|
||||
We also use [Prettier](https://prettier.io/) to auto-format our code. Be sure to either add a [text editor integration](https://prettier.io/docs/en/editors.html) or a [pre-commit hook](https://prettier.io/docs/en/precommit.html) to properly format your code changes.
|
||||
We strongly recommend you use the [VSCode](https://code.visualstudio.com/) text editor since most of our code is written in Typescript and it offers amazing support for the language.
|
||||
|
||||
#### Linter
|
||||
|
||||
We use [TSLint](https://palantir.github.io/tslint/) with [custom configs](https://github.com/0xProject/0x-monorepo/tree/development/packages/tslint-config) to keep our code-style consistent.
|
||||
|
||||
Use `yarn:lint` to lint the entire monorepo, and `PKG={PACKAGE_NAME} yarn lint` to lint a specific package.
|
||||
|
||||
If you want to change a rule, or add a custom rule, please make these changes to our [tslint-config](https://github.com/0xProject/0x-monorepo/tree/development/packages/tslint-config) package. All other packages have it as a dependency.
|
||||
|
||||
Integrate it into your text editor:
|
||||
|
||||
* VSCode: [vscode-tslint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint)
|
||||
* Atom: [linter-tslint](https://atom.io/packages/linter-tslint)
|
||||
|
||||
#### Auto-formatter
|
||||
|
||||
We use [Prettier](https://prettier.io/) to auto-format our code. Be sure to either add a [text editor integration](https://prettier.io/docs/en/editors.html) or a [pre-commit hook](https://prettier.io/docs/en/precommit.html) to properly format your code changes.
|
||||
|
||||
If using the Atom text editor, we recommend you install the following packages:
|
||||
|
||||
* [atom-typescript](https://atom.io/packages/atom-typescript)
|
||||
* [linter-tslint](https://atom.io/packages/linter-tslint)
|
||||
* [prettier-atom](https://atom.io/packages/prettier-atom)
|
||||
* [language-ethereum](https://atom.io/packages/language-ethereum)
|
||||
* VSCode: [prettier-vscode](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
||||
* Atom: [prettier-atom](https://atom.io/packages/prettier-atom)
|
||||
|
||||
Our CI will also run TSLint and Prettier as a part of the test run when you submit your PR. Make sure that the CI tests pass for your contribution.
|
||||
## Fix `submit-coverage` CI failure
|
||||
|
||||
### Branch structure & versioning
|
||||
If you simply fork the repo and then create a PR from it, your PR will fail the `submit-coverage` check on CI. This is because the 0x CircleCI configuration sets the `COVERALLS_REPO_TOKEN` environment variable to the token for `0xProject/0x-monorepo`, but when running the check against your fork the token needs to match your repo's name `your-username/0x-monorepo`.
|
||||
|
||||
We use [semantic versioning](http://semver.org/), but before a package reaches v1.0.0 all breaking changes as well as new features will be minor version bumps.
|
||||
To facilitate this check, after creating your fork, but before creating the branch for your PR, do the following:
|
||||
|
||||
We have two main branches: `master` and `development`.
|
||||
1. Log in to [coveralls.io](https://coveralls.io/), go to `Add Repos`, and enable your fork. Then go to the settings for that repo, and copy the `Repo Token` identifier.
|
||||
2. Log in to [CircleCI](https://circleci.com/login), go to `Add Projects`, click the `Set Up Project` button corresponding to your fork, and then click `Start Building`. (Aside from step 3 below, no actual set up is needed, since it will use the `.circleci/config.yml` file in 0x-monorepo, so you can ignore all of the instruction/explanation given on the page with the `Start Building` button.)
|
||||
3. In CircleCI, configure your project to add an environment variable, with name `COVERALLS_REPO_TOKEN`, and for the value paste in the `Repo Token` you copied in step 1.
|
||||
|
||||
`master` represents the most recent released (published on npm) version.
|
||||
|
||||
`development` represents the development state and is a default branch to which you will submit a PR. We use this structure so that we can push hotfixes to the currently released version without needing to publish all the changes made towards the next release. If a hotfix is implemented on `master`, it is back-ported to `development`.
|
||||
Now, when you push to your branch, CircleCI will automatically run all of the checks in your own instance, and the coverage check will work since it has the proper `Repo Token`, and the PR will magically refer to your own checks rather than running them in the 0x CircleCI instance.
|
||||
|
@@ -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 |
|
||||
| ------- |
|
||||
|
4
LICENSE
4
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright 2017 ZeroEx Inc.
|
||||
Copyright 2017 ZeroEx Intl.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
limitations under the License.
|
||||
|
@@ -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.
|
||||
|
113
README.md
113
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,63 +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
|
||||
|
||||
| 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 |
|
||||
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.
|
||||
|
||||
### Private Packages
|
||||
### Python 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 |
|
||||
| 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 |
|
||||
|
||||
### Typescript/Javascript Packages
|
||||
|
||||
#### 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.
|
||||
|
14
package.json
14
package.json
@@ -8,7 +8,7 @@
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"ganache": "ganache-cli -p 8545 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
|
||||
"ganache": "ganache-cli -p 8545 --gasLimit 10000000 --networkId 50 -m \"${npm_package_config_mnemonic}\"",
|
||||
"prettier": "prettier --write '**/*.{ts,tsx,json,md}' --config .prettierrc",
|
||||
"prettier:ci": "prettier --list-different '**/*.{ts,tsx,json,md}' --config .prettierrc",
|
||||
"report_coverage": "lcov-result-merger './{packages/*/coverage/lcov.info,python-packages/*/.coverage}' | coveralls",
|
||||
@@ -22,13 +22,13 @@
|
||||
"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",
|
||||
"clean": "wsrun clean $PKG --fast-exit -r --parallel",
|
||||
"clean": "wsrun clean $PKG --fast-exit -r --parallel --exclude-missing",
|
||||
"remove_node_modules": "lerna clean --yes; rm -rf node_modules",
|
||||
"rebuild": "run-s clean build",
|
||||
"rebuild:no_website": "run-s clean build:no_website",
|
||||
@@ -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": [
|
||||
@@ -49,7 +49,7 @@
|
||||
"maxSize": "700kB"
|
||||
},
|
||||
{
|
||||
"path": "packages/instant/public/main.bundle.js",
|
||||
"path": "packages/instant/umd/instant.js",
|
||||
"maxSize": "1000kB"
|
||||
}
|
||||
],
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "2.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "2.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "2.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "2.0.3",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "2.0.2",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.6 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.5 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.4 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.3 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.0.2 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "0x.js",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.6",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -42,11 +42,10 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"@0x/abi-gen": "^1.0.15",
|
||||
"@0x/abi-gen-wrappers": "^1.0.3",
|
||||
"@0x/contract-addresses": "^1.1.0",
|
||||
"@0x/dev-utils": "^1.0.15",
|
||||
"@0x/migrations": "^2.0.2",
|
||||
"@0x/abi-gen-wrappers": "^2.0.0",
|
||||
"@0x/contract-addresses": "^2.0.0",
|
||||
"@0x/dev-utils": "^1.0.19",
|
||||
"@0x/migrations": "^2.2.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.16",
|
||||
"@0x/base-contract": "^3.0.4",
|
||||
"@0x/contract-wrappers": "^4.0.0",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/order-watcher": "^2.2.2",
|
||||
"@0x/subproviders": "^2.1.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/base-contract": "^3.0.8",
|
||||
"@0x/contract-wrappers": "^4.1.1",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/order-watcher": "^2.2.6",
|
||||
"@0x/subproviders": "^2.1.6",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
|
20
packages/abi-gen-templates/CHANGELOG.json
Normal file
20
packages/abi-gen-templates/CHANGELOG.json
Normal file
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "1.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Initial publish",
|
||||
"pr": 1305
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
14
packages/abi-gen-templates/CHANGELOG.md
Normal file
14
packages/abi-gen-templates/CHANGELOG.md
Normal file
@@ -0,0 +1,14 @@
|
||||
<!--
|
||||
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 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.0 - _Invalid date_
|
||||
|
||||
* Initial publish (#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.1",
|
||||
"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,43 @@
|
||||
[
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"pr": 1309,
|
||||
"note": "Update Exchange artifact to receive ZRX asset data as a constructor argument"
|
||||
}
|
||||
],
|
||||
"timestamp": 1543401373
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "1.0.4",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "1.0.3",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.0 - _November 28, 2018_
|
||||
|
||||
* Update Exchange artifact to receive ZRX asset data as a constructor argument (#1309)
|
||||
|
||||
## 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
|
||||
|
||||
## v1.0.4 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.3 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen-wrappers",
|
||||
"version": "1.0.3",
|
||||
"version": "2.0.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.15",
|
||||
"@0x/abi-gen": "^1.0.17",
|
||||
"@0x/abi-gen-templates": "^1.0.1",
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5",
|
||||
"shx": "^0.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/base-contract": "^3.0.4"
|
||||
"@0x/base-contract": "^3.0.8"
|
||||
},
|
||||
"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,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.17",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.16",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "1.0.15",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,14 @@ 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
|
||||
|
||||
## v1.0.15 - _November 9, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/abi-gen",
|
||||
"version": "1.0.15",
|
||||
"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.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"chalk": "^2.3.0",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"glob": "^7.1.2",
|
||||
|
@@ -1,4 +1,22 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.18",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.17",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "1.0.16",
|
||||
|
@@ -5,6 +5,14 @@ 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
|
||||
|
||||
## v1.0.16 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/assert",
|
||||
"version": "1.0.16",
|
||||
"version": "1.0.18",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,9 +44,9 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/json-schemas": "^2.1.0",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"lodash": "^4.17.5",
|
||||
"valid-url": "^1.0.9"
|
||||
},
|
||||
|
@@ -1,4 +1,42 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "3.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "3.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated",
|
||||
"pr": 1276
|
||||
}
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"version": "3.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "update `getBuyQuoteAsync` to return eth spent on assets instead of per unit amount",
|
||||
"pr": 1252
|
||||
}
|
||||
],
|
||||
"timestamp": 1542208198
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "2.2.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "2.2.1",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.2 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## 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)
|
||||
|
||||
## v2.2.2 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v2.2.1 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/asset-buyer",
|
||||
"version": "2.2.1",
|
||||
"version": "3.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -36,18 +36,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/asset-buyer/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.16",
|
||||
"@0x/connect": "^3.0.4",
|
||||
"@0x/contract-wrappers": "^4.0.0",
|
||||
"@0x/json-schemas": "^2.1.0",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/subproviders": "^2.1.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/connect": "^3.0.8",
|
||||
"@0x/contract-wrappers": "^4.1.1",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/subproviders": "^2.1.6",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"lodash": "^4.17.10"
|
||||
"lodash": "^4.17.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/tslint-config": "^1.0.10",
|
||||
|
@@ -54,12 +54,12 @@ export interface BuyQuote {
|
||||
}
|
||||
|
||||
/**
|
||||
* ethPerAssetPrice: The price of one unit of the desired asset in ETH
|
||||
* assetEthAmount: The amount of eth required to pay for the requested asset.
|
||||
* feeEthAmount: The amount of eth required to pay the affiliate fee.
|
||||
* totalEthAmount: the total amount of eth required to complete the buy. (Filling orders, feeOrders, and paying affiliate fee)
|
||||
* totalEthAmount: The total amount of eth required to complete the buy (filling orders, feeOrders, and paying affiliate fee).
|
||||
*/
|
||||
export interface BuyQuoteInfo {
|
||||
ethPerAssetPrice: BigNumber;
|
||||
assetEthAmount: BigNumber;
|
||||
feeEthAmount: BigNumber;
|
||||
totalEthAmount: BigNumber;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ export const assert = {
|
||||
}
|
||||
},
|
||||
isValidBuyQuoteInfo(variableName: string, buyQuoteInfo: BuyQuoteInfo): void {
|
||||
sharedAssert.isBigNumber(`${variableName}.ethPerAssetPrice`, buyQuoteInfo.ethPerAssetPrice);
|
||||
sharedAssert.isBigNumber(`${variableName}.assetEthAmount`, buyQuoteInfo.assetEthAmount);
|
||||
sharedAssert.isBigNumber(`${variableName}.feeEthAmount`, buyQuoteInfo.feeEthAmount);
|
||||
sharedAssert.isBigNumber(`${variableName}.totalEthAmount`, buyQuoteInfo.totalEthAmount);
|
||||
},
|
||||
|
@@ -106,28 +106,28 @@ function calculateQuoteInfo(
|
||||
isMakerAssetZrxToken: boolean,
|
||||
): BuyQuoteInfo {
|
||||
// find the total eth and zrx needed to buy assetAmount from the resultOrders from left to right
|
||||
let ethAmountToBuyAsset = constants.ZERO_AMOUNT;
|
||||
let ethAmountToBuyZrx = constants.ZERO_AMOUNT;
|
||||
let assetEthAmount = constants.ZERO_AMOUNT;
|
||||
let zrxEthAmount = constants.ZERO_AMOUNT;
|
||||
if (isMakerAssetZrxToken) {
|
||||
ethAmountToBuyAsset = findEthAmountNeededToBuyZrx(ordersAndFillableAmounts, assetBuyAmount);
|
||||
assetEthAmount = findEthAmountNeededToBuyZrx(ordersAndFillableAmounts, assetBuyAmount);
|
||||
} else {
|
||||
// find eth and zrx amounts needed to buy
|
||||
const ethAndZrxAmountToBuyAsset = findEthAndZrxAmountNeededToBuyAsset(ordersAndFillableAmounts, assetBuyAmount);
|
||||
ethAmountToBuyAsset = ethAndZrxAmountToBuyAsset[0];
|
||||
assetEthAmount = ethAndZrxAmountToBuyAsset[0];
|
||||
const zrxAmountToBuyAsset = ethAndZrxAmountToBuyAsset[1];
|
||||
// find eth amount needed to buy zrx
|
||||
ethAmountToBuyZrx = findEthAmountNeededToBuyZrx(feeOrdersAndFillableAmounts, zrxAmountToBuyAsset);
|
||||
zrxEthAmount = findEthAmountNeededToBuyZrx(feeOrdersAndFillableAmounts, zrxAmountToBuyAsset);
|
||||
}
|
||||
/// find the eth amount needed to buy the affiliate fee
|
||||
const ethAmountToBuyAffiliateFee = ethAmountToBuyAsset.mul(feePercentage).ceil();
|
||||
const totalEthAmountWithoutAffiliateFee = ethAmountToBuyAsset.plus(ethAmountToBuyZrx);
|
||||
const ethAmountTotal = totalEthAmountWithoutAffiliateFee.plus(ethAmountToBuyAffiliateFee);
|
||||
// divide into the assetBuyAmount in order to find rate of makerAsset / WETH
|
||||
const ethPerAssetPrice = totalEthAmountWithoutAffiliateFee.div(assetBuyAmount);
|
||||
// eth amount needed to buy the affiliate fee
|
||||
const affiliateFeeEthAmount = assetEthAmount.mul(feePercentage).ceil();
|
||||
// eth amount needed for fees is the sum of affiliate fee and zrx fee
|
||||
const feeEthAmount = affiliateFeeEthAmount.plus(zrxEthAmount);
|
||||
// eth amount needed in total is the sum of the amount needed for the asset and the amount needed for fees
|
||||
const totalEthAmount = assetEthAmount.plus(feeEthAmount);
|
||||
return {
|
||||
totalEthAmount: ethAmountTotal,
|
||||
feeEthAmount: ethAmountToBuyAffiliateFee,
|
||||
ethPerAssetPrice,
|
||||
assetEthAmount,
|
||||
feeEthAmount,
|
||||
totalEthAmount,
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -44,19 +44,24 @@ export const orderProviderResponseProcessor = {
|
||||
let unsortedOrders = filteredOrders;
|
||||
// if an orderValidator is provided, use on chain information to calculate remaining fillable makerAsset amounts
|
||||
if (!_.isUndefined(orderValidator)) {
|
||||
// TODO(bmillman): improvement
|
||||
// try/catch this request and throw a more domain specific error
|
||||
const takerAddresses = _.map(filteredOrders, () => constants.NULL_ADDRESS);
|
||||
const ordersAndTradersInfo = await orderValidator.getOrdersAndTradersInfoAsync(
|
||||
filteredOrders,
|
||||
takerAddresses,
|
||||
);
|
||||
// take orders + on chain information and find the valid orders and remaining fillable maker asset amounts
|
||||
unsortedOrders = getValidOrdersWithRemainingFillableMakerAssetAmountsFromOnChain(
|
||||
filteredOrders,
|
||||
ordersAndTradersInfo,
|
||||
isMakerAssetZrxToken,
|
||||
);
|
||||
try {
|
||||
const ordersAndTradersInfo = await orderValidator.getOrdersAndTradersInfoAsync(
|
||||
filteredOrders,
|
||||
takerAddresses,
|
||||
);
|
||||
// take orders + on chain information and find the valid orders and remaining fillable maker asset amounts
|
||||
unsortedOrders = getValidOrdersWithRemainingFillableMakerAssetAmountsFromOnChain(
|
||||
filteredOrders,
|
||||
ordersAndTradersInfo,
|
||||
isMakerAssetZrxToken,
|
||||
);
|
||||
} catch (err) {
|
||||
// Sometimes we observe this call to orderValidator fail with response `0x`
|
||||
// Because of differences in Parity / Geth implementations, its very hard to tell if this response is a "system error"
|
||||
// or a revert. In this case we just swallow these errors and fallback to partial fill information from the SRA.
|
||||
// TODO(bmillman): report these errors so we have an idea of how often we're getting these failures.
|
||||
}
|
||||
}
|
||||
// sort orders by rate
|
||||
// TODO(bmillman): optimization
|
||||
|
@@ -108,17 +108,17 @@ describe('buyQuoteCalculator', () => {
|
||||
// 50 eth to fill the first order + 100 eth for fees
|
||||
const expectedEthAmountForAsset = new BigNumber(50);
|
||||
const expectedEthAmountForZrxFees = new BigNumber(100);
|
||||
const expectedFillEthAmount = expectedEthAmountForAsset.plus(expectedEthAmountForZrxFees);
|
||||
const expectedFeeEthAmount = expectedEthAmountForAsset.mul(feePercentage);
|
||||
const expectedFillEthAmount = expectedEthAmountForAsset;
|
||||
const expectedAffiliateFeeEthAmount = expectedEthAmountForAsset.mul(feePercentage);
|
||||
const expectedFeeEthAmount = expectedAffiliateFeeEthAmount.plus(expectedEthAmountForZrxFees);
|
||||
const expectedTotalEthAmount = expectedFillEthAmount.plus(expectedFeeEthAmount);
|
||||
const expectedEthPerAssetPrice = expectedFillEthAmount.div(assetBuyAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedFillEthAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.feeEthAmount).to.bignumber.equal(expectedFeeEthAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.totalEthAmount).to.bignumber.equal(expectedTotalEthAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.ethPerAssetPrice).to.bignumber.equal(expectedEthPerAssetPrice);
|
||||
// because we have no slippage protection, minRate is equal to maxRate
|
||||
expect(buyQuote.worstCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedFillEthAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.feeEthAmount).to.bignumber.equal(expectedFeeEthAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.totalEthAmount).to.bignumber.equal(expectedTotalEthAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.ethPerAssetPrice).to.bignumber.equal(expectedEthPerAssetPrice);
|
||||
// test if feePercentage gets passed through
|
||||
expect(buyQuote.feePercentage).to.equal(feePercentage);
|
||||
});
|
||||
@@ -146,23 +146,23 @@ describe('buyQuoteCalculator', () => {
|
||||
// 50 eth to fill the first order + 100 eth for fees
|
||||
const expectedEthAmountForAsset = new BigNumber(50);
|
||||
const expectedEthAmountForZrxFees = new BigNumber(100);
|
||||
const expectedFillEthAmount = expectedEthAmountForAsset.plus(expectedEthAmountForZrxFees);
|
||||
const expectedFeeEthAmount = expectedEthAmountForAsset.mul(feePercentage);
|
||||
const expectedFillEthAmount = expectedEthAmountForAsset;
|
||||
const expectedAffiliateFeeEthAmount = expectedEthAmountForAsset.mul(feePercentage);
|
||||
const expectedFeeEthAmount = expectedAffiliateFeeEthAmount.plus(expectedEthAmountForZrxFees);
|
||||
const expectedTotalEthAmount = expectedFillEthAmount.plus(expectedFeeEthAmount);
|
||||
const expectedEthPerAssetPrice = expectedFillEthAmount.div(assetBuyAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedFillEthAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.feeEthAmount).to.bignumber.equal(expectedFeeEthAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.totalEthAmount).to.bignumber.equal(expectedTotalEthAmount);
|
||||
expect(buyQuote.bestCaseQuoteInfo.ethPerAssetPrice).to.bignumber.equal(expectedEthPerAssetPrice);
|
||||
// 100 eth to fill the first order + 208 eth for fees
|
||||
const expectedWorstEthAmountForAsset = new BigNumber(100);
|
||||
const expectedWorstEthAmountForZrxFees = new BigNumber(208);
|
||||
const expectedWorstFillEthAmount = expectedWorstEthAmountForAsset.plus(expectedWorstEthAmountForZrxFees);
|
||||
const expectedWorstFeeEthAmount = expectedWorstEthAmountForAsset.mul(feePercentage);
|
||||
const expectedWorstFillEthAmount = expectedWorstEthAmountForAsset;
|
||||
const expectedWorstAffiliateFeeEthAmount = expectedWorstEthAmountForAsset.mul(feePercentage);
|
||||
const expectedWorstFeeEthAmount = expectedWorstAffiliateFeeEthAmount.plus(expectedWorstEthAmountForZrxFees);
|
||||
const expectedWorstTotalEthAmount = expectedWorstFillEthAmount.plus(expectedWorstFeeEthAmount);
|
||||
const expectedWorstEthPerAssetPrice = expectedWorstFillEthAmount.div(assetBuyAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.assetEthAmount).to.bignumber.equal(expectedWorstFillEthAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.feeEthAmount).to.bignumber.equal(expectedWorstFeeEthAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.totalEthAmount).to.bignumber.equal(expectedWorstTotalEthAmount);
|
||||
expect(buyQuote.worstCaseQuoteInfo.ethPerAssetPrice).to.bignumber.equal(expectedWorstEthPerAssetPrice);
|
||||
// test if feePercentage gets passed through
|
||||
expect(buyQuote.feePercentage).to.equal(feePercentage);
|
||||
});
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "3.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "3.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "3.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "3.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "3.0.4",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.8 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.7 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.6 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.5 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.4 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/base-contract",
|
||||
"version": "3.0.4",
|
||||
"version": "3.0.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,8 +41,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5"
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "3.0.8",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "3.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "3.0.6",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "3.0.5",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "3.0.4",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v3.0.8 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.7 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.6 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.5 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v3.0.4 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/connect",
|
||||
"version": "3.0.4",
|
||||
"version": "3.0.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -44,12 +44,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/connect/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.16",
|
||||
"@0x/json-schemas": "^2.1.0",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"lodash": "^4.17.5",
|
||||
"query-string": "^5.0.1",
|
||||
"sinon": "^4.0.0",
|
||||
|
@@ -1,4 +1,27 @@
|
||||
[
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Redeployed Rinkeby with testnet Exchange artifact",
|
||||
"pr": 1318
|
||||
},
|
||||
{
|
||||
"note": "Added Ganache snapshot addresses for network 50",
|
||||
"pr": 1318
|
||||
}
|
||||
],
|
||||
"timestamp": 1543401373
|
||||
},
|
||||
{
|
||||
"version": "1.2.0",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Rinkeby Deployment"
|
||||
}
|
||||
],
|
||||
"timestamp": 1542821676
|
||||
},
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,15 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v2.0.0 - _November 28, 2018_
|
||||
|
||||
* Redeployed Rinkeby with testnet Exchange artifact (#1318)
|
||||
* Added Ganache snapshot addresses for network 50 (#1318)
|
||||
|
||||
## 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": "2.0.0",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -14,7 +14,9 @@ export interface ContractAddresses {
|
||||
export enum NetworkId {
|
||||
Mainnet = 1,
|
||||
Ropsten = 3,
|
||||
Rinkeby = 4,
|
||||
Kovan = 42,
|
||||
Ganache = 50,
|
||||
}
|
||||
|
||||
const networkToAddresses: { [networkId: number]: ContractAddresses } = {
|
||||
@@ -38,6 +40,16 @@ const networkToAddresses: { [networkId: number]: ContractAddresses } = {
|
||||
forwarder: '0x2240dab907db71e64d3e0dba4800c83b5c502d4e',
|
||||
orderValidator: '0x90431a90516ab49af23a0530e04e8c7836e7122f',
|
||||
},
|
||||
4: {
|
||||
exchange: '0xbce0b5f6eb618c565c3e5f5cd69652bbc279f44e',
|
||||
erc20Proxy: '0x2f5ae4f6106e89b4147651688a92256885c5f410',
|
||||
erc721Proxy: '0x7656d773e11ff7383a14dcf09a9c50990481cd10',
|
||||
zrxToken: '0x8080c7e4b81ecf23aa6f877cfbfd9b0c228c6ffa',
|
||||
etherToken: '0xc778417e063141139fce010982780140aa0cd5ab',
|
||||
assetProxyOwner: '0xe1703da878afcebff5b7624a826902af475b9c03',
|
||||
forwarder: '0x2d40589abbdee84961f3a7656b9af7adb0ee5ab4',
|
||||
orderValidator: '0x0c5173a51e26b29d6126c686756fb9fbef71f762',
|
||||
},
|
||||
42: {
|
||||
erc20Proxy: '0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e',
|
||||
erc721Proxy: '0x2a9127c745688a165106c11cd4d647d2220af821',
|
||||
@@ -48,6 +60,17 @@ const networkToAddresses: { [networkId: number]: ContractAddresses } = {
|
||||
forwarder: '0x17992e4ffb22730138e4b62aaa6367fa9d3699a6',
|
||||
orderValidator: '0xb389da3d204b412df2f75c6afb3d0a7ce0bc283d',
|
||||
},
|
||||
// NetworkId 50 represents our Ganache snapshot generated from migrations.
|
||||
50: {
|
||||
exchange: '0x48bacb9266a570d521063ef5dd96e61686dbe788',
|
||||
erc20Proxy: '0x1dc4c1cefef38a777b15aa20260a54e584b16c48',
|
||||
erc721Proxy: '0x1d7022f5b17d2f8b695918fb48fa1089c9f85401',
|
||||
zrxToken: '0x871dd7c2b4b25e1aa18728e9d5f2af4c4e431f5c',
|
||||
etherToken: '0x0b1ba0af832d7c05fd64161e0db78e85978e8082',
|
||||
assetProxyOwner: '0x34d402f14d58e001d8efbe6585051bf9706aa064',
|
||||
forwarder: '0xb69e673309512a9d726f87304c6984054f87a93b',
|
||||
orderValidator: '0xe86bb98fcf9bff3512c74589b78fb168200cc546',
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,14 @@
|
||||
[
|
||||
{
|
||||
"version": "1.1.2",
|
||||
"changes": [
|
||||
{
|
||||
"pr": 1309,
|
||||
"note": "Update Exchange artifact to receive ZRX asset data as a constructor argument"
|
||||
}
|
||||
],
|
||||
"timestamp": 1543401373
|
||||
},
|
||||
{
|
||||
"version": "1.1.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.1.2 - _November 28, 2018_
|
||||
|
||||
* Update Exchange artifact to receive ZRX asset data as a constructor argument (#1309)
|
||||
|
||||
## v1.1.0 - _November 9, 2018_
|
||||
|
||||
* Update Forwarder artifact (#1192)
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-artifacts",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
|
@@ -1,4 +1,42 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "4.1.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.1.0",
|
||||
"changes": [
|
||||
{
|
||||
"note":
|
||||
"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,
|
||||
"version": "4.0.2",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "4.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.0",
|
||||
"changes": [
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v4.1.1 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## 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
|
||||
|
||||
## v4.0.1 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v4.0.0 - _November 12, 2018_
|
||||
|
||||
* Add signature validation, regular cancellation and `cancelledUpTo` checks to `validateOrderFillableOrThrowAsync` (#1235)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/contract-wrappers",
|
||||
"version": "4.0.0",
|
||||
"version": "4.1.1",
|
||||
"description": "Smart TS wrappers for 0x smart contracts",
|
||||
"keywords": [
|
||||
"0xproject",
|
||||
@@ -37,9 +37,9 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@0x/dev-utils": "^1.0.15",
|
||||
"@0x/migrations": "^2.0.2",
|
||||
"@0x/subproviders": "^2.1.2",
|
||||
"@0x/dev-utils": "^1.0.19",
|
||||
"@0x/migrations": "^2.2.0",
|
||||
"@0x/subproviders": "^2.1.6",
|
||||
"@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.3",
|
||||
"@0x/assert": "^1.0.16",
|
||||
"@0x/contract-addresses": "^1.1.0",
|
||||
"@0x/contract-artifacts": "^1.1.0",
|
||||
"@0x/fill-scenarios": "^1.0.10",
|
||||
"@0x/json-schemas": "^2.1.0",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/abi-gen-wrappers": "^2.0.0",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/contract-addresses": "^2.0.0",
|
||||
"@0x/contract-artifacts": "^1.1.2",
|
||||
"@0x/fill-scenarios": "^1.0.14",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethereumjs-blockstream": "6.0.0",
|
||||
"ethereumjs-util": "^5.1.1",
|
||||
|
@@ -111,6 +111,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
|
||||
from: normalizedOwnerAddress,
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
@@ -281,6 +282,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
|
||||
from: normalizedFromAddress,
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
@@ -342,6 +344,7 @@ export class ERC20TokenWrapper extends ContractWrapper {
|
||||
from: normalizedSenderAddress,
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
|
@@ -238,6 +238,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
from: normalizedOwnerAddress,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
@@ -298,6 +299,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
from: tokenOwnerAddress,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
@@ -369,6 +371,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
from: normalizedSenderAddress,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
|
@@ -71,6 +71,7 @@ export class EtherTokenWrapper extends ContractWrapper {
|
||||
value: amountInWei,
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
@@ -112,6 +113,7 @@ export class EtherTokenWrapper extends ContractWrapper {
|
||||
from: normalizedWithdrawerAddress,
|
||||
gas: txOpts.gasLimit,
|
||||
gasPrice: txOpts.gasPrice,
|
||||
nonce: txOpts.nonce,
|
||||
}),
|
||||
);
|
||||
return txHash;
|
||||
|
@@ -196,6 +196,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -207,6 +208,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -243,6 +245,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -254,6 +257,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -287,6 +291,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.fillOrKillOrder.sendTransactionAsync(
|
||||
@@ -297,6 +302,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -336,6 +342,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedSenderAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.executeTransaction.sendTransactionAsync(
|
||||
@@ -347,6 +354,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedSenderAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -382,6 +390,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.batchFillOrders.sendTransactionAsync(
|
||||
@@ -392,6 +401,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -425,6 +435,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.marketBuyOrders.sendTransactionAsync(
|
||||
@@ -435,6 +446,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -468,6 +480,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.marketSellOrders.sendTransactionAsync(
|
||||
@@ -478,6 +491,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -511,6 +525,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.marketBuyOrdersNoThrow.sendTransactionAsync(
|
||||
@@ -521,6 +536,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -554,6 +570,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.marketSellOrdersNoThrow.sendTransactionAsync(
|
||||
@@ -564,6 +581,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -599,6 +617,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.batchFillOrdersNoThrow.sendTransactionAsync(
|
||||
@@ -609,6 +628,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -644,6 +664,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.batchFillOrKillOrders.sendTransactionAsync(
|
||||
@@ -654,6 +675,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -682,12 +704,14 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedMakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.batchCancelOrders.sendTransactionAsync(orders, {
|
||||
from: normalizedMakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
return txHash;
|
||||
}
|
||||
@@ -735,6 +759,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -747,6 +772,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -781,12 +807,14 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.preSign.sendTransactionAsync(hash, signerAddress, signature, {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
return txHash;
|
||||
}
|
||||
@@ -956,12 +984,14 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedMakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.cancelOrder.sendTransactionAsync(order, {
|
||||
from: normalizedMakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
return txHash;
|
||||
}
|
||||
@@ -992,6 +1022,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedSenderAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.setSignatureValidatorApproval.sendTransactionAsync(
|
||||
@@ -1001,6 +1032,7 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedSenderAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -1030,12 +1062,14 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
from: normalizedSenderAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
}
|
||||
const txHash = await exchangeInstance.cancelOrdersUpTo.sendTransactionAsync(targetOrderEpoch, {
|
||||
from: normalizedSenderAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
});
|
||||
return txHash;
|
||||
}
|
||||
|
@@ -124,6 +124,7 @@ export class ForwarderWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -140,6 +141,7 @@ export class ForwarderWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
@@ -213,6 +215,7 @@ export class ForwarderWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -230,6 +233,7 @@ export class ForwarderWrapper extends ContractWrapper {
|
||||
from: normalizedTakerAddress,
|
||||
gas: orderTransactionOpts.gasLimit,
|
||||
gasPrice: orderTransactionOpts.gasPrice,
|
||||
nonce: orderTransactionOpts.nonce,
|
||||
},
|
||||
);
|
||||
return txHash;
|
||||
|
@@ -3,6 +3,7 @@ export const txOptsSchema = {
|
||||
properties: {
|
||||
gasPrice: { $ref: '/numberSchema' },
|
||||
gasLimit: { type: 'number' },
|
||||
nonce: { type: 'number' },
|
||||
},
|
||||
type: 'object',
|
||||
};
|
||||
|
@@ -142,10 +142,12 @@ export interface MethodOpts {
|
||||
/**
|
||||
* gasPrice: Gas price in Wei to use for a transaction
|
||||
* gasLimit: The amount of gas to send with a transaction (in Gwei)
|
||||
* nonce: The nonce to use for a transaction. If not specified, it defaults to the next incremented nonce.
|
||||
*/
|
||||
export interface TransactionOpts {
|
||||
gasPrice?: BigNumber;
|
||||
gasLimit?: number;
|
||||
nonce?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,4 +1,14 @@
|
||||
[
|
||||
{
|
||||
"name": "OrderValidator",
|
||||
"version": "1.0.1",
|
||||
"changes": [
|
||||
{
|
||||
"note": "remove `getApproved` check from ERC721 approval query",
|
||||
"pr": 1149
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Forwarder",
|
||||
"version": "1.1.0",
|
||||
|
@@ -148,7 +148,7 @@ contract OrderValidator {
|
||||
balance = target == owner ? 1 : 0;
|
||||
|
||||
// Check if ERC721Proxy is approved to spend tokenId
|
||||
bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy) || IERC721Token(token).getApproved(tokenId) == assetProxy;
|
||||
bool isApproved = IERC721Token(token).isApprovedForAll(target, assetProxy);
|
||||
|
||||
// Set alowance to 1 if ERC721Proxy is approved to spend tokenId
|
||||
allowance = isApproved ? 1 : 0;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "contracts",
|
||||
"version": "2.1.52",
|
||||
"version": "2.1.56",
|
||||
"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.15",
|
||||
"@0x/dev-utils": "^1.0.15",
|
||||
"@0x/sol-compiler": "^1.1.10",
|
||||
"@0x/sol-cov": "^2.1.10",
|
||||
"@0x/subproviders": "^2.1.2",
|
||||
"@0x/abi-gen": "^1.0.17",
|
||||
"@0x/dev-utils": "^1.0.19",
|
||||
"@0x/sol-compiler": "^1.1.14",
|
||||
"@0x/sol-cov": "^2.1.14",
|
||||
"@0x/subproviders": "^2.1.6",
|
||||
"@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.4",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/base-contract": "^3.0.8",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"@types/js-combinatorics": "^0.5.29",
|
||||
"bn.js": "^4.11.8",
|
||||
"ethereum-types": "^1.1.2",
|
||||
|
@@ -198,7 +198,7 @@ describe('OrderValidator', () => {
|
||||
);
|
||||
expect(newAllowance).to.be.bignumber.equal(ERC721_ALLOWANCE);
|
||||
});
|
||||
it('should return an allowance of 1 when ERC721Proxy is approved for specific tokenId', async () => {
|
||||
it('should return an allowance of 0 when ERC721Proxy is approved for specific tokenId', async () => {
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721Token.mint.sendTransactionAsync(makerAddress, tokenId),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
@@ -213,7 +213,7 @@ describe('OrderValidator', () => {
|
||||
makerAddress,
|
||||
erc721AssetData,
|
||||
);
|
||||
expect(newAllowance).to.be.bignumber.equal(ERC721_ALLOWANCE);
|
||||
expect(newAllowance).to.be.bignumber.equal(constants.ZERO_AMOUNT);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -248,8 +248,9 @@ describe('OrderValidator', () => {
|
||||
await erc721Token.mint.sendTransactionAsync(makerAddress, tokenId),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const isApproved = true;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721Token.approve.sendTransactionAsync(erc721Proxy.address, tokenId, {
|
||||
await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, isApproved, {
|
||||
from: makerAddress,
|
||||
}),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
@@ -311,8 +312,9 @@ describe('OrderValidator', () => {
|
||||
await erc721Token.mint.sendTransactionAsync(takerAddress, tokenId),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const isApproved = true;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721Token.approve.sendTransactionAsync(erc721Proxy.address, tokenId, {
|
||||
await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, isApproved, {
|
||||
from: takerAddress,
|
||||
}),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
@@ -465,8 +467,9 @@ describe('OrderValidator', () => {
|
||||
await erc721Token.mint.sendTransactionAsync(takerAddress, tokenId),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
);
|
||||
const isApproved = true;
|
||||
await web3Wrapper.awaitTransactionSuccessAsync(
|
||||
await erc721Token.approve.sendTransactionAsync(erc721Proxy.address, tokenId, {
|
||||
await erc721Token.setApprovalForAll.sendTransactionAsync(erc721Proxy.address, isApproved, {
|
||||
from: takerAddress,
|
||||
}),
|
||||
constants.AWAIT_TRANSACTION_MINED_MS,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-tools-pages",
|
||||
"version": "0.0.4",
|
||||
"version": "0.0.8",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -16,7 +16,7 @@
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@0x/react-shared": "^1.0.19",
|
||||
"@0x/react-shared": "^1.0.23",
|
||||
"basscss": "^8.0.3",
|
||||
"bowser": "^1.9.3",
|
||||
"less": "^2.7.2",
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "1.0.19",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.18",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.17",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "1.0.16",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "1.0.15",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.19 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.18 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.17 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.16 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.15 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/dev-utils",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.19",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
@@ -41,11 +41,11 @@
|
||||
"typescript": "3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@0x/subproviders": "^2.1.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/subproviders": "^2.1.6",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"@types/web3-provider-engine": "^14.0.0",
|
||||
"chai": "^4.0.1",
|
||||
"ethereum-types": "^1.1.2",
|
||||
|
@@ -1,4 +1,40 @@
|
||||
[
|
||||
{
|
||||
"timestamp": 1543401373,
|
||||
"version": "1.0.14",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542821676,
|
||||
"version": "1.0.13",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542208198,
|
||||
"version": "1.0.12",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542134075,
|
||||
"version": "1.0.11",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Dependencies updated"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"timestamp": 1542028948,
|
||||
"version": "1.0.10",
|
||||
|
@@ -5,6 +5,22 @@ Edit the package's CHANGELOG.json file only.
|
||||
|
||||
CHANGELOG
|
||||
|
||||
## v1.0.14 - _November 28, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.13 - _November 21, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.12 - _November 14, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.11 - _November 13, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
||||
## v1.0.10 - _November 12, 2018_
|
||||
|
||||
* Dependencies updated
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@0x/fill-scenarios",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.14",
|
||||
"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.3",
|
||||
"@0x/base-contract": "^3.0.4",
|
||||
"@0x/contract-artifacts": "^1.1.0",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/abi-gen-wrappers": "^2.0.0",
|
||||
"@0x/base-contract": "^3.0.8",
|
||||
"@0x/contract-artifacts": "^1.1.2",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"ethers": "~4.0.4",
|
||||
"lodash": "^4.17.5"
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"domain": "0x-instant-dogfood",
|
||||
"build_command": "yarn build:umd:prod",
|
||||
"build_command": "WEBPACK_OUTPUT_PATH=public yarn build:umd:prod",
|
||||
"upload_directory": "public",
|
||||
"index_key": "index.html",
|
||||
"error_key": "index.html",
|
||||
|
5
packages/instant/.gitignore
vendored
5
packages/instant/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
public/main.bundle.js
|
||||
public/main.bundle.js.map
|
||||
public/instant.js
|
||||
public/instant.js.map
|
||||
umd/*
|
5
packages/instant/.npmignore
Normal file
5
packages/instant/.npmignore
Normal file
@@ -0,0 +1,5 @@
|
||||
.*
|
||||
*
|
||||
*/
|
||||
!lib/**/*
|
||||
!umd/**/*
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"domain": "0x-instant-staging",
|
||||
"build_command": "yarn build:umd:prod",
|
||||
"build_command": "WEBPACK_OUTPUT_PATH=public yarn build:umd:prod",
|
||||
"upload_directory": "public",
|
||||
"index_key": "index.html",
|
||||
"error_key": "index.html",
|
||||
|
@@ -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,13 @@
|
||||
{
|
||||
"name": "@0x/instant",
|
||||
"version": "0.0.5",
|
||||
"version": "1.0.2",
|
||||
"engines": {
|
||||
"node": ">=6.12"
|
||||
},
|
||||
"private": true,
|
||||
"description": "0x Instant React Component",
|
||||
"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",
|
||||
@@ -29,8 +29,8 @@
|
||||
"config": {
|
||||
"postpublish": {
|
||||
"assets": [
|
||||
"packages/instant/public/index.js",
|
||||
"packages/instant/public/index.min.js"
|
||||
"packages/instant/umd/instant.js",
|
||||
"packages/instant/umd/instant.js.map"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -45,18 +45,19 @@
|
||||
},
|
||||
"homepage": "https://github.com/0xProject/0x-monorepo/packages/instant/README.md",
|
||||
"dependencies": {
|
||||
"@0x/assert": "^1.0.16",
|
||||
"@0x/asset-buyer": "^2.2.1",
|
||||
"@0x/json-schemas": "^2.1.0",
|
||||
"@0x/order-utils": "^3.0.0",
|
||||
"@0x/subproviders": "^2.1.2",
|
||||
"@0x/types": "^1.2.1",
|
||||
"@0x/assert": "^1.0.18",
|
||||
"@0x/asset-buyer": "^3.0.2",
|
||||
"@0x/json-schemas": "^2.1.2",
|
||||
"@0x/order-utils": "^3.0.4",
|
||||
"@0x/subproviders": "^2.1.6",
|
||||
"@0x/types": "^1.3.0",
|
||||
"@0x/typescript-typings": "^3.0.4",
|
||||
"@0x/utils": "^2.0.4",
|
||||
"@0x/web3-wrapper": "^3.1.2",
|
||||
"@0x/utils": "^2.0.6",
|
||||
"@0x/web3-wrapper": "^3.1.6",
|
||||
"bowser": "^1.9.4",
|
||||
"copy-to-clipboard": "^3.0.8",
|
||||
"ethereum-types": "^1.1.2",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.5",
|
||||
"polished": "^2.2.0",
|
||||
"react": "^16.5.2",
|
||||
"react-dom": "^16.5.2",
|
||||
@@ -82,11 +83,13 @@
|
||||
"awesome-typescript-loader": "^5.2.1",
|
||||
"enzyme": "^3.6.0",
|
||||
"enzyme-adapter-react-16": "^1.5.0",
|
||||
"ip": "^1.1.5",
|
||||
"jest": "^23.6.0",
|
||||
"make-promises-safe": "^1.1.0",
|
||||
"npm-run-all": "^4.1.2",
|
||||
"nyc": "^11.0.1",
|
||||
"shx": "^0.2.2",
|
||||
"svg-react-loader": "^0.4.6",
|
||||
"ts-jest": "^23.10.3",
|
||||
"tslint": "5.11.0",
|
||||
"typedoc": "0.13.0",
|
||||
@@ -96,6 +99,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="/main.bundle.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>
|
||||
|
4
packages/instant/src/assets/icons/ae.svg
generated
Normal file
4
packages/instant/src/assets/icons/ae.svg
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22.7499 13.7657H17.0782V12.215H21.1376C20.7961 10.7612 19.5062 9.6757 17.9887 9.6757C16.6799 9.6757 15.5038 10.4704 14.9916 11.711L14.6692 12.3506L13.588 11.1101C14.3467 9.28802 16.0729 8.125 17.9887 8.125C20.6064 8.125 22.7499 10.3154 22.7499 12.9903V13.7657V13.7657Z" fill="white"/>
|
||||
<path d="M17.9888 17.8556C15.8453 17.8556 14.6882 16.5375 13.7777 15.3164L13.1707 14.5022C12.2792 13.3004 11.3497 12.0405 10.4202 10.8193C9.88911 10.1215 8.95963 9.6757 8.01119 9.6757C6.22811 9.6757 4.76751 11.1682 4.76751 12.9903C4.76751 14.8124 6.22811 16.3049 8.01119 16.3049C9.62354 16.3049 10.7806 14.793 11.2169 14.1339L11.4446 13.6881L12.4689 15.0062C11.2738 16.8283 9.64251 17.875 7.99222 17.875C5.39348 17.8556 3.25 15.6846 3.25 12.9903C3.25 10.296 5.39348 8.125 8.01119 8.125C9.45282 8.125 10.7996 8.78405 11.6153 9.86953C12.5447 11.0907 13.4742 12.3506 14.3658 13.5718L14.9728 14.3859C15.8833 15.6071 16.661 16.3049 17.9698 16.3049C19.2218 16.3049 20.1892 15.7428 20.7203 14.5992L22.4275 14.6573L22.2758 15.0644C21.517 16.7701 19.8288 17.8556 17.9888 17.8556Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.2 KiB |
5
packages/instant/src/assets/icons/agi.svg
generated
Normal file
5
packages/instant/src/assets/icons/agi.svg
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.325 5C10.8394 6.11774 9.74739 8.04279 10.0509 9.9134C10.6651 13.7056 16.5341 13.6813 16.6503 17.6773C16.7037 19.5213 15.62 20.7213 14.413 22" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
|
||||
<path d="M14.1626 5C14.1626 5 18.2507 7.50998 15.551 12.0307" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
|
||||
<path d="M12.311 21.9988C12.311 21.9988 8.22279 19.4888 10.9225 14.9681" stroke="white" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
|
||||
</svg>
|
After Width: | Height: | Size: 639 B |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user