125 Commits

Author SHA1 Message Date
F. Eugene Aumson
ead8099109
Auto-gen Python Exchange wrapper (#1919)
* Rename existing wrapper, to match contract name

* base contract: make member var public

* json_schemas.py: stop storing copies of schemas!

* .gitignore generated erc20_token.py wrapper

* json schemas: allow uppercase digits in address

* existing exchange wrapper: re-order methods

to match method order in Solidity contract, to reduce noise in upcoming
diffs of newly generated code vs. old manually-written code.

* existing exchange wrapper: rename method params

To match contract method param names

* existing exchange wrapper: remove redundant member

* existing exchange wrapper: make signatures bytes

Not strings.

* abi-gen/test-cli: show context on diff failure

* abi-gen-templates/Py: fix broken event interface

Previous changes had removed the `token_address` parameter from all
generated methods, but this instance was missed because there weren't
tests/examples using events for the first contract for which wrappers
were generated (ERC20Token).

* abi-gen: remove unused method parameters

* abi-gen: convert Py method params to snake case

* abi-gen: rewrite Python tuple handling

* python-generated-wrappers: include Exchange

* abi-gen-templates/Py: easy linter fixes

* abi-gen-templates/Py: satisfy docstring linters

* abi-gen-templates/Py: normalize bytes before use

* contract_wrappers.py: replace Exchange w/generated

* contract_wrappers.py: rm manually written Exchange

* contract_wrappers.py/doctest: rename variables

* abi-gen: fix misspelling in docstring

Co-Authored-By: Fabio B <me@fabioberger.com>

* Py docs: error on warning, and test build in CI

* abi-gen: doc Py bytes params as requiring UTF-8

* abi-gen: git mv diff.sh test-cli/

* abi-gen: put Py wrapper in module folder, not file

This leaves space for user-defined additions to the same module, such as
for custom types, as shown herein.

* abi-gen: customizable param validation for Python

* contract_wrappers.py: JSON schema Order validation

* CircleCI Build Artifacts

For abi-gen command-line test output, for generated Python contract
wrappers as output by abi-gen, for generated Python contract wrappers as
reformatted and included in the Python package area, and for the "build"
output folder in each Python package, which includes the generated
documentation.

* CHANGELOG updates for all components

* abi-gen: grammar in comments

Co-Authored-By: Fabio B <me@fabioberger.com>

* abi-gen: CHANGELOG spelling correction

Co-Authored-By: Fabio B <me@fabioberger.com>

* order_utils.py: reverse (chronological) CHANGELOG

* abi-gen-templates: reset CHANGELOG patch version

* CHANGELOGs: use multiple entries where appropriate

* abi-gen: enable devdoc solc output in test-cli

* abi-gen-templates/Py: consolidate return type

* abi-gen/test-cli: non-pure fixture contract method

Added a method to the "dummy" test fixture contract that isn't pure.
All of the other prior method cases were pure.

* abi-gen/Py: fix const methods missing return type

* abi-gen/Py: fix wrong return types on some methods

Specifically, wrapper methods wrapping contract methods that modify
contract state and return no return value.  There was no test case for
this.  Now there is.

* contract_wrappers.py: rm generated code in `clean`

* Parallelize Py monorepo scripts (test, lint, etc)
2019-07-23 12:58:18 -04:00
Fabio Berger
84d38ea878 Add assertions to abi-gen templates and fix tests 2019-06-04 13:18:01 +01:00
Xianny
7423028fea
Replace lodash with built-ins where possible to reduce bundle size (#1766)
* add tslint rule to disallow lodash.isUndefined

* add tslint rule to disallow lodash.isNull

* apply fixes
2019-04-10 09:36:32 -07:00
Fabio Berger
3f9872d8b3 Remove getZeroExProvider method since it can be confusing 2019-02-21 16:07:23 -08:00
Fabio Berger
ba56019f2d Add missing exported types 2019-02-19 23:59:12 -08:00
Fabio Berger
26e17074c2 Fix linter issues 2019-02-19 23:09:26 -08:00
Fabio Berger
1fa82c1077 Fix up missing Provider interfaces and refactor providerUtils.standardizeOrThrow() 2019-02-19 22:34:31 -08:00
Fabio Berger
2417084145 Rename public interface provider to supportedProvider and our internal provider to Provider 2019-02-19 12:47:01 -08:00
Fabio Berger
5db20bbbe8 Add support for EIP1193 providers and clean up provider standardization logic 2019-02-18 15:12:29 -08:00
Greg Hysen
500b4940a3 Improvements and conventions in utils package + abi decoder 2019-02-08 17:12:54 -08:00
Greg Hysen
93c128ee21 Added exports for doc generation 2019-02-08 16:25:30 -08:00
Leonid Logvinov
e84232cce8
Use new check for isBigNumber 2019-01-15 16:25:25 +01:00
Leonid Logvinov
c3afc13dd6
Upgrade bignumber.js version 2019-01-15 16:25:24 +01:00
Fabio Berger
1a44d86c59 Fix linter 2018-12-07 17:55:38 +00:00
Fabio Berger
ccd8d4ac30 Remove excess commas 2018-12-07 15:25:07 +00:00
Fabio Berger
84f1d1107a fix: txData returned so that value and gasPrice are BigNumbers to avoid precision errors 2018-12-07 15:24:01 +00:00
Jacob Evans
03b3b80a65
bug: Only unmarshall receipt if blockNumber present.
https://github.com/paritytech/parity-ethereum/issues/1180
Parity can return a pending transaction receipt with a number of null values
2018-11-23 15:31:00 +11:00
Leonid Logvinov
22cfdd9f0b
Properly unmarshall TransactionReceiptRPC to TransactionReceipt 2018-11-20 15:22:06 +01:00
Bryan Stitt
789f573452
Merge branch 'development' into patch-1 2018-11-12 09:10:40 -08:00
Jacob Evans
e0c4f58970
bug(web3-wrapper): throws when contract returns null 2018-11-12 13:55:46 +11:00
Bryan Stitt
801004be66 start jsonRpcRequestId at 1, not 0
I'm trying to use the 0x-watcher against a parity websocket rpc and getting an error that I think is the same as https://github.com/ethereum/web3.js/issues/1967
2018-11-07 16:39:07 -08:00
Alex Browne
c2e8390d21 chore: Fix linter 2018-10-23 16:12:48 -07:00
Alex Browne
6027e275b1 fix(web3-wrapper): Make getTransactionByHashAsync return the correct type 2018-10-23 15:56:20 -07:00
Jacob Evans
9f924e459c
chore: change package org from 0xproject to 0x 2018-10-18 22:27:31 +11:00
Jacob Evans
7f554303b4
Update the exported types for the packages which touch RPC providers 2018-10-09 20:29:41 +11:00
Jacob Evans
9e8031d5e3
Throw and handle errors from Providers.
In web3 wrapper when a response contains an error field we throw this rather than return response.result which is often undefined.
In Signature Utils we handle the error thrown when a user rejects the signing dialogue to prevent double signing.
Exposed the ZeroExTransaction JSON schema.
In Website only use the MetamaskSubprovider if we can detect the provider is Metamask
2018-10-09 19:01:36 +11:00
Jacob Evans
75d274f330
Return SignedOrder from signing utils.
Create a helper back in EIP712Utils for code cleanup.
Moved constants in order-utils into the constants object
2018-10-05 17:12:17 +10:00
Jacob Evans
adcfaa2e80
Expose eth_signTypedData functionality for order signing 2018-10-05 11:59:24 +10:00
Leonid Logvinov
8c985eb579
Fix linter issue 2018-10-02 15:09:24 +02:00
Fabio Berger
9c89d1e99b Expose method to send raw JSON RPC payloads 2018-09-25 10:45:11 +01:00
Fabio Berger
5e1a2bd972 Merge development 2018-09-24 15:53:34 +01:00
Fabio Berger
311b925919 Add to doc comment why a block might not be returned to the caller 2018-09-24 15:14:07 +01:00
Fabio Berger
d0448c2bbd Fix bug where if block wasn't found, getBlockAsync would throw. Now it returns undefined 2018-09-24 15:02:06 +01:00
Fabio Berger
45dc2be083 Fix prettier 2018-09-21 14:53:25 +01:00
Fabio Berger
e6840c60c7 Add assertion that one cannot specify both blockHash & fromBlock/toBlock to getLogsAsync 2018-09-21 13:43:06 +01:00
Fabio Berger
4e8ec2359d Also make sure the transactionReceipt contains a blockNumber when checking if a transaction has been mined. 2018-09-21 10:56:31 +01:00
Fabio Berger
b4cf69b021 Cleanup web3-wrapper and subproviders index.ts 2018-08-20 13:50:28 +01:00
Fabio Berger
2f2582a0da Merge development 2018-08-14 14:21:47 -07:00
Leonid Logvinov
d44ff6a915
Add @return comments 2018-08-09 17:02:13 +02:00
Fabio Berger
3ee3fc2fb3 Add missing doc comments 2018-08-03 17:13:10 +02:00
Leonid Logvinov
bb4d15005a
Add comments 2018-08-03 16:45:26 +02:00
Leonid Logvinov
bd488020df
Export RPC data types from web3-wrapper 2018-08-03 13:36:16 +02:00
Leonid Logvinov
74d5f2f0b9
Export marshaller from web3-wrapper 2018-08-03 13:32:45 +02:00
Fabio Berger
10f6647ab3 Add missing types to web3-wrapper index.ts 2018-08-03 13:27:20 +02:00
Fabio Berger
4579e1637d Add missing exports discovered by generating compact typedoc JSON 2018-07-29 21:59:09 +02:00
Fabio Berger
f4a2e227e1 Remove all in-package monorepo-scripts by adding doc gen/upload and aggregate release note publishing to publish script 2018-07-29 21:58:39 +02:00
fragosti
da4b70fcae Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/web3-wrapper/unexport-marshaller 2018-07-25 10:33:13 -07:00
Amir Bandeali
0a976a3fb8 Get actual gasPrice from transaction instead of setting default 2018-07-23 10:00:23 -05:00
fragosti
067adbfb62 Stop exporting marshaller from web3-wrapper 2018-07-20 07:37:17 -07:00
Igor Kroitor
5bb68974ec
Deduplicate assert web3-wrapper signMessageAsync 2018-07-20 08:49:16 +03:00