46 Commits

Author SHA1 Message Date
F. Eugene Aumson
aa5af04447
Python contract demo, with lots of refactoring (#1485)
* Refine Order for Web3 compat. & add conversions

Changed some of the fields in the Order class so that it can be passed
to our contracts via Web3.

Added conversion utilities so that an Order can be easily converted to
and from a JSON-compatible dict (specifically by encoding/decoding the
`bytes` fields), to facilitate validation against the JSON schema.

Also modified JSON order schema to accept integers in addition to
stringified integers.

* Fixes for json_schemas

Has-types indicator file, py.typed, was not being included in package.

Schemas were not being properly gathered into package installation.

* Add test/demo of Exchange.getOrderInfo()

* web3 bug workaround

* Fix problem packaging contract artifacts

* Move contract addresses to their own package

* Move contract artifacts to their own package

* Add scripts to install, test & lint all components

* prettierignore files in local python dev env

* Correct missing coverage analysis for sra_client

* CI cache lint: don't save, re-use from test-python

* tag hacks as hacks

* correct merge mistake

* remove local strip_0x() in favor of eth_utils

* remove json schemas from old order_utils location

* correct merge mistake

* doctest json schemas via command-line, not code
2019-01-09 09:58:29 -05:00
F. Eugene Aumson
4689f20b86
Move json_schemas to its own package (#1435)
* Move zero_ex.json_schemas to its own package

* Support ALL the schemas

* Stop installing packages as editable

* HACK: cp files because CircleCI isn't

* Add example usage to sra_client README

* Tweak special case: only strip Schema as suffix

* Correct doc titles

* Clarify what kind of support ticket was raised.

* Correct inconsistencies in JSON schema names

In both ref ID's and file names.

* Add entry point for validation of JSON strings
2019-01-08 14:28:32 -05:00
F. Eugene Aumson
a3eab71908
Correct inconsistencies in JSON schema names
In both ref ID's and file names.
2018-12-28 15:08:15 -05:00
Fabio Berger
896c8d17c1 Fix schemas and tests 2018-12-16 17:31:38 -08:00
Fabio Berger
ee4185ab46 Move OrderWatcher Websocket schemas to json-schemas and convert to JSON so that they are language agnostic 2018-12-16 16:52:37 -08:00
Leonid Logvinov
33dbdb0184
Move connect schemas to JSON Schemas 2018-11-12 13:44:24 +01:00
Fabio Berger
632d7b6fc1 fix: improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal numbers 2018-10-21 19:24:19 +02:00
Fabio Berger
b9dccf9da3 chore: add whole number schema 2018-10-21 19:20:36 +02:00
Fabio Berger
7d9009bb96 Convert all schemas to json files, so it's easier for devs in other languages to use it 2018-10-17 13:28:26 +01: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
fragosti
8f6a96740e Remove superflous id from relayer api fee recipients json schema 2018-08-24 08:25:34 -07:00
fragosti
44cc5e45cc Run prettier 2018-08-20 11:53:49 -07:00
fragosti
f2d1d95355 Remove default query parameters 2018-08-17 13:58:55 -07:00
fragosti
ca5e52920d Add fee recipients test 2018-08-15 17:52:13 -07:00
Fabio Berger
7340338626
Merge pull request #938 from 0xProject/sol-cov-fixes
Sol cov fixes
2018-08-13 16:40:46 -04:00
Leonid Logvinov
15e15f994a
Merge branch 'development' into sol-cov-fixes 2018-08-09 17:03:41 +02:00
fragosti
cc67c0df51 Correct orderbook typo 2018-08-08 14:18:24 -07:00
fragosti
76b91cbcda Enforce that error code are ints not number 2018-08-08 14:16:59 -07:00
fragosti
c9e1b7c5dc Change remainingFillableAmount to metaData 2018-08-08 11:57:16 -07:00
fragosti
95b656f360 Add GET fee_recipients 2018-08-07 17:42:52 -07:00
fragosti
0a616ad3b8 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package 2018-08-07 13:52:53 -07:00
Brandon Millman
e5d65b585a Update hex schema to match 0x 2018-08-05 18:33:52 -04:00
Leonid Logvinov
ab398751e1
Alow additional properties in txData json-schema 2018-08-03 13:34:40 +02:00
fragosti
0390a5ecbf Limit error codes with ranges 2018-08-02 18:08:36 -07:00
fragosti
afc5c2616a Enforce stronger naming convention for json schema ids 2018-08-02 11:57:23 -07:00
fragosti
962d6e71b6 update orders channel subscribe schema 2018-08-01 13:52:40 -07:00
fragosti
a78d35f84e Add test for relayerApiOrderSchema 2018-07-31 17:22:26 -07:00
fragosti
63e869f6d0 Add paginated collection test case 2018-07-31 17:04:22 -07:00
fragosti
4aff9515d8 Get schema tests running (not crashiing) 2018-07-31 16:37:51 -07:00
fragosti
e671563f1e Update json-schemas for SRA v1 2018-07-30 17:16:14 -07:00
Jacob Evans
6529e06057
Rename call data schema id to CallData.
Check for TypedArray when hashing data in order-utils crypto
2018-07-19 17:51:03 +10:00
Leonid Logvinov
01c6efeaf1
Merge branch 'v2-prototype' into v2-contract-wrappers-WIP 2018-07-05 17:00:50 +03:00
Leonid Logvinov
3cc1a952ca
Add ordersSchema to json-schemas 2018-07-05 15:05:57 +02:00
Fabio Berger
2a7b3aecc3 Add CallData schema to json-schemas 2018-07-05 12:33:48 +02:00
Fabio Berger
3302c89284 Revivie the ECSignatureSchema 2018-05-30 13:52:27 -07:00
Fabio Berger
4874d55d03 Initial refactor of order-utils. Move many utils from contracts into this package. 2018-05-29 16:58:30 -07:00
Fabio Berger
662dc12877 Add senderAddress to order schema 2018-05-24 16:05:07 -07:00
Fabio Berger
3ec05bb5d8 Force hex to have at least two hex values after the prefix, but it could be two zeros 2018-05-23 17:36:34 -07:00
Fabio Berger
59890f2c83 Fix Hex regex and tests 2018-05-23 17:28:17 -07:00
Fabio Berger
9c850d152c Updated Order, SignedOrder schemas, removed ECSignature schema types and added Hex basic type 2018-05-23 16:52:41 -07:00
Leonid Logvinov
e744e4cd98
Apply prettier config 2018-01-03 11:37:38 +01:00
Leonid Logvinov
1e4fdcf615
Rename SubscriptionOpts to BlockRange 2017-12-19 12:10:43 +01:00
Brandon Millman
20e28d6c70 Add requestId to subscription messages and update json-schemas 2017-12-05 11:28:32 -08:00
Brandon Millman
56b5619d24 Add json-schemas package to mono repo 2017-11-14 09:42:50 -05:00