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
This commit is contained in:
@@ -1 +0,0 @@
|
||||
../../../../../packages/json-schemas/schemas/
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/addressSchema",
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9a-f]{40}$"
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "/AssetPairsRequestOptsSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"assetDataA": { "$ref": "/hexSchema" },
|
||||
"assetDataB": { "$ref": "/hexSchema" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "/blockParamSchema",
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"enum": ["latest", "earliest", "pending"]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "/blockRangeSchema",
|
||||
"properties": {
|
||||
"fromBlock": { "$ref": "/blockParamSchema" },
|
||||
"toBlock": { "$ref": "/blockParamSchema" }
|
||||
},
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"id": "/callDataSchema",
|
||||
"properties": {
|
||||
"from": { "$ref": "/addressSchema" },
|
||||
"to": { "$ref": "/addressSchema" },
|
||||
"value": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }]
|
||||
},
|
||||
"gas": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }]
|
||||
},
|
||||
"gasPrice": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }]
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9a-f]*$"
|
||||
},
|
||||
"nonce": {
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": [],
|
||||
"type": "object",
|
||||
"additionalProperties": false
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/ecSignatureParameterSchema",
|
||||
"type": "string",
|
||||
"pattern": "^0[xX][0-9A-Fa-f]{64}$"
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "/ecSignatureSchema",
|
||||
"properties": {
|
||||
"v": {
|
||||
"type": "number",
|
||||
"minimum": 27,
|
||||
"maximum": 28
|
||||
},
|
||||
"r": { "$ref": "/ecSignatureParameterSchema" },
|
||||
"s": { "$ref": "/ecSignatureParameterSchema" }
|
||||
},
|
||||
"required": ["v", "r", "s"],
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"id": "/eip712TypedDataSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"types": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"EIP712Domain": { "type": "array" }
|
||||
},
|
||||
"additionalProperties": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"type": { "type": "string" }
|
||||
},
|
||||
"required": ["name", "type"]
|
||||
}
|
||||
},
|
||||
"required": ["EIP712Domain"]
|
||||
},
|
||||
"primaryType": { "type": "string" },
|
||||
"domain": { "type": "object" },
|
||||
"message": { "type": "object" }
|
||||
},
|
||||
"required": ["types", "primaryType", "domain", "message"]
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/hexSchema",
|
||||
"type": "string",
|
||||
"pattern": "^0x(([0-9a-f][0-9a-f])+)?$"
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "/indexFilterValuesSchema",
|
||||
"additionalProperties": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/addressSchema" }, { "$ref": "/orderHashSchema" }]
|
||||
},
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/jsNumberSchema",
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/numberSchema",
|
||||
"type": "string",
|
||||
"pattern": "^\\d+(\\.\\d+)?$"
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "/orderCancellationRequestsSchema",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"order": { "$ref": "/orderSchema" },
|
||||
"takerTokenCancelAmount": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": ["order", "takerTokenCancelAmount"],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"id": "/OrderConfigRequestSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"makerAddress": { "$ref": "/addressSchema" },
|
||||
"takerAddress": { "$ref": "/addressSchema" },
|
||||
"makerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"takerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"exchangeAddress": { "$ref": "/addressSchema" },
|
||||
"expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": [
|
||||
"makerAddress",
|
||||
"takerAddress",
|
||||
"makerAssetAmount",
|
||||
"takerAssetAmount",
|
||||
"makerAssetData",
|
||||
"takerAssetData",
|
||||
"exchangeAddress",
|
||||
"expirationTimeSeconds"
|
||||
]
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "/orderFillOrKillRequestsSchema",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"signedOrder": { "$ref": "/signedOrderSchema" },
|
||||
"fillTakerAmount": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": ["signedOrder", "fillTakerAmount"],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "/orderFillRequestsSchema",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"signedOrder": { "$ref": "/signedOrderSchema" },
|
||||
"takerTokenFillAmount": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": ["signedOrder", "takerTokenFillAmount"],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/orderHashSchema",
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9a-fA-F]{64}$"
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"id": "/orderSchema",
|
||||
"properties": {
|
||||
"makerAddress": { "$ref": "/addressSchema" },
|
||||
"takerAddress": { "$ref": "/addressSchema" },
|
||||
"makerFee": { "$ref": "/wholeNumberSchema" },
|
||||
"takerFee": { "$ref": "/wholeNumberSchema" },
|
||||
"senderAddress": { "$ref": "/addressSchema" },
|
||||
"makerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"takerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"salt": { "$ref": "/wholeNumberSchema" },
|
||||
"exchangeAddress": { "$ref": "/addressSchema" },
|
||||
"feeRecipientAddress": { "$ref": "/addressSchema" },
|
||||
"expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": [
|
||||
"makerAddress",
|
||||
"takerAddress",
|
||||
"makerFee",
|
||||
"takerFee",
|
||||
"senderAddress",
|
||||
"makerAssetAmount",
|
||||
"takerAssetAmount",
|
||||
"makerAssetData",
|
||||
"takerAssetData",
|
||||
"salt",
|
||||
"exchangeAddress",
|
||||
"feeRecipientAddress",
|
||||
"expirationTimeSeconds"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"id": "/orderWatcherWebSocketRequestSchema",
|
||||
"type": "object",
|
||||
"definitions": {
|
||||
"signedOrderParam": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"signedOrder": { "$ref": "/signedOrderSchema" }
|
||||
},
|
||||
"required": ["signedOrder"]
|
||||
},
|
||||
"orderHashParam": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"orderHash": { "$ref": "/hexSchema" }
|
||||
},
|
||||
"required": ["orderHash"]
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": { "type": "number" },
|
||||
"jsonrpc": { "type": "string" },
|
||||
"method": { "enum": ["ADD_ORDER"] },
|
||||
"params": { "$ref": "#/definitions/signedOrderParam" }
|
||||
},
|
||||
"required": ["id", "jsonrpc", "method", "params"]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": { "type": "number" },
|
||||
"jsonrpc": { "type": "string" },
|
||||
"method": { "enum": ["REMOVE_ORDER"] },
|
||||
"params": { "$ref": "#/definitions/orderHashParam" }
|
||||
},
|
||||
"required": ["id", "jsonrpc", "method", "params"]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": { "type": "number" },
|
||||
"jsonrpc": { "type": "string" },
|
||||
"method": { "enum": ["GET_STATS"] },
|
||||
"params": {}
|
||||
},
|
||||
"required": ["id", "jsonrpc", "method"]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "/orderWatcherWebSocketUtf8MessageSchema",
|
||||
"properties": {
|
||||
"utf8Data": { "type": "string" }
|
||||
},
|
||||
"required": [
|
||||
"utf8Data"
|
||||
],
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "/OrderbookRequestSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseAssetData": { "$ref": "/hexSchema" },
|
||||
"quoteAssetData": { "$ref": "/hexSchema" }
|
||||
},
|
||||
"required": ["baseAssetData", "quoteAssetData"]
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"id": "/OrdersRequestOptsSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"makerAssetProxyId": { "$ref": "/hexSchema" },
|
||||
"takerAssetProxyId": { "$ref": "/hexSchema" },
|
||||
"makerAssetAddress": { "$ref": "/addressSchema" },
|
||||
"takerAssetAddress": { "$ref": "/addressSchema" },
|
||||
"exchangeAddress": { "$ref": "/addressSchema" },
|
||||
"senderAddress": { "$ref": "/addressSchema" },
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"traderAssetData": { "$ref": "/hexSchema" },
|
||||
"makerAddress": { "$ref": "/addressSchema" },
|
||||
"takerAddress": { "$ref": "/addressSchema" },
|
||||
"traderAddress": { "$ref": "/addressSchema" },
|
||||
"feeRecipientAddress": { "$ref": "/addressSchema" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/ordersSchema",
|
||||
"type": "array",
|
||||
"items": { "$ref": "/orderSchema" }
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "/PagedRequestOptsSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"page": { "type": "number" },
|
||||
"perPage": { "type": "number" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "/paginatedCollectionSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": { "type": "number" },
|
||||
"perPage": { "type": "number" },
|
||||
"page": { "type": "number" }
|
||||
},
|
||||
"required": ["total", "perPage", "page"]
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"id": "/relayerApiAssetDataPairsResponseSchema",
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "/paginatedCollectionSchema" },
|
||||
{
|
||||
"properties": {
|
||||
"records": { "$ref": "/relayerApiAssetDataPairsSchema" }
|
||||
},
|
||||
"required": ["records"]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "/relayerApiAssetDataPairsSchema",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"assetDataA": { "$ref": "/relayerApiAssetDataTradeInfoSchema" },
|
||||
"assetDataB": { "$ref": "/relayerApiAssetDataTradeInfoSchema" }
|
||||
},
|
||||
"required": ["assetDataA", "assetDataB"],
|
||||
"type": "object"
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "/relayerApiAssetDataTradeInfoSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"assetData": { "$ref": "/hexSchema" },
|
||||
"minAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"maxAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"precision": { "type": "number" }
|
||||
},
|
||||
"required": ["assetData"]
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"id": "/relayerApiErrorResponseSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": { "type": "integer", "minimum": 100, "maximum": 103 },
|
||||
"reason": { "type": "string" },
|
||||
"validationErrors": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"field": { "type": "string" },
|
||||
"code": { "type": "integer", "minimum": 1000, "maximum": 1006 },
|
||||
"reason": { "type": "string" }
|
||||
},
|
||||
"required": ["field", "code", "reason"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["code", "reason"]
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"id": "/relayerApiFeeRecipientsResponseSchema",
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "/paginatedCollectionSchema" },
|
||||
{
|
||||
"properties": {
|
||||
"records": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "/addressSchema" }
|
||||
}
|
||||
},
|
||||
"required": ["records"]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"id": "/relayerApiOrderConfigPayloadSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"makerAddress": { "$ref": "/addressSchema" },
|
||||
"takerAddress": { "$ref": "/addressSchema" },
|
||||
"makerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"takerAssetAmount": { "$ref": "/wholeNumberSchema" },
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"exchangeAddress": { "$ref": "/addressSchema" },
|
||||
"expirationTimeSeconds": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": [
|
||||
"makerAddress",
|
||||
"takerAddress",
|
||||
"makerAssetAmount",
|
||||
"takerAssetAmount",
|
||||
"makerAssetData",
|
||||
"takerAssetData",
|
||||
"exchangeAddress",
|
||||
"expirationTimeSeconds"
|
||||
]
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "/relayerApiOrderConfigResponseSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"makerFee": { "$ref": "/wholeNumberSchema" },
|
||||
"takerFee": { "$ref": "/wholeNumberSchema" },
|
||||
"feeRecipientAddress": { "$ref": "/addressSchema" },
|
||||
"senderAddress": { "$ref": "/addressSchema" }
|
||||
},
|
||||
"required": ["makerFee", "takerFee", "feeRecipientAddress", "senderAddress"]
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "/relayerApiOrderSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"order": { "$ref": "/orderSchema" },
|
||||
"metaData": { "type": "object" }
|
||||
},
|
||||
"required": ["order", "metaData"]
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "/relayerApiOrderbookResponseSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bids": { "$ref": "/relayerApiOrdersResponseSchema" },
|
||||
"asks": { "$ref": "/relayerApiOrdersResponseSchema" }
|
||||
},
|
||||
"required": ["bids", "asks"]
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "/relayerApiOrdersChannelSubscribePayloadSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"makerAssetProxyId": { "$ref": "/hexSchema" },
|
||||
"takerAssetProxyId": { "$ref": "/hexSchema" },
|
||||
"networkId": { "type": "number" },
|
||||
"makerAssetAddress": { "$ref": "/addressSchema" },
|
||||
"takerAssetAddress": { "$ref": "/addressSchema" },
|
||||
"makerAssetData": { "$ref": "/hexSchema" },
|
||||
"takerAssetData": { "$ref": "/hexSchema" },
|
||||
"traderAssetData": { "$ref": "/hexSchema" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "/relayerApiOrdersChannelSubscribeSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": { "enum": ["subscribe"] },
|
||||
"channel": { "enum": ["orders"] },
|
||||
"requestId": { "type": "string" },
|
||||
"payload": { "$ref": "/relayerApiOrdersChannelSubscribePayloadSchema" }
|
||||
},
|
||||
"required": ["type", "channel", "requestId"]
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "/relayerApiOrdersChannelUpdateSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": { "enum": ["update"] },
|
||||
"channel": { "enum": ["orders"] },
|
||||
"requestId": { "type": "string" },
|
||||
"payload": { "$ref": "/relayerApiOrdersSchema" }
|
||||
},
|
||||
"required": ["type", "channel", "requestId"]
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"id": "/relayerApiOrdersResponseSchema",
|
||||
"type": "object",
|
||||
"allOf": [
|
||||
{ "$ref": "/paginatedCollectionSchema" },
|
||||
{
|
||||
"properties": {
|
||||
"records": { "$ref": "/relayerApiOrdersSchema" }
|
||||
},
|
||||
"required": ["records"]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/relayerApiOrdersSchema",
|
||||
"type": "array",
|
||||
"items": { "$ref": "/relayerApiOrderSchema" }
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "/RequestOptsSchema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"networkId": { "type": "number" }
|
||||
}
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "/signedOrderSchema",
|
||||
"allOf": [
|
||||
{ "$ref": "/orderSchema" },
|
||||
{
|
||||
"properties": {
|
||||
"signature": { "$ref": "/hexSchema" }
|
||||
},
|
||||
"required": ["signature"]
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "/signedOrdersSchema",
|
||||
"type": "array",
|
||||
"items": { "$ref": "/signedOrderSchema" }
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "/tokenSchema",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"symbol": { "type": "string" },
|
||||
"decimals": { "type": "number" },
|
||||
"address": { "$ref": "/addressSchema" }
|
||||
},
|
||||
"required": ["name", "symbol", "decimals", "address"],
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "/txDataSchema",
|
||||
"properties": {
|
||||
"from": { "$ref": "/addressSchema" },
|
||||
"to": { "$ref": "/addressSchema" },
|
||||
"value": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }]
|
||||
},
|
||||
"gas": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }]
|
||||
},
|
||||
"gasPrice": {
|
||||
"oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }]
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9a-f]*$"
|
||||
},
|
||||
"nonce": {
|
||||
"type": "number",
|
||||
"minimum": 0
|
||||
}
|
||||
},
|
||||
"required": ["from"],
|
||||
"type": "object"
|
||||
}
|
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "/wholeNumberSchema",
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^\\d+$"
|
||||
},
|
||||
{
|
||||
"type": "integer"
|
||||
}
|
||||
]
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "/zeroExTransactionSchema",
|
||||
"properties": {
|
||||
"data": { "$ref": "/hexSchema" },
|
||||
"signerAddress": { "$ref": "/addressSchema" },
|
||||
"salt": { "$ref": "/wholeNumberSchema" }
|
||||
},
|
||||
"required": ["data", "salt", "signerAddress"],
|
||||
"type": "object"
|
||||
}
|
Reference in New Issue
Block a user