-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"$id": "#hook/v0.2.0.json", | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"required": [ | ||
"target", | ||
"callData", | ||
"gasLimit" | ||
], | ||
"title": "CoW Hook", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"target": { | ||
"$ref": "../definitions.json#/definitions/ethereumAddress", | ||
"title": "Hook Target", | ||
"description": "The contract to call for the hook" | ||
}, | ||
"callData": { | ||
"$id": "#/properties/callData", | ||
"title": "Hook CallData", | ||
"description": "The calldata to use when calling the hook", | ||
"type": "string", | ||
"pattern": "^0x[a-fA-F0-9]*$", | ||
"examples": [ | ||
"0x", | ||
"0x01020304" | ||
] | ||
}, | ||
"gasLimit": { | ||
"$ref": "../definitions.json#/definitions/bigNumber", | ||
"title": "Hook Gas Limit", | ||
"description": "The gas limit (in gas units) for the hook" | ||
}, | ||
"dappId": { | ||
"$ref": "../definitions.json#/definitions/dappId", | ||
"title": "Id of the dApp which has built the hook", | ||
"description": "CoW Swap has an interface that allows dApps to build hooks for orders. This field is used to identify the dApp that has built the hook." | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$id": "#hooks/v0.2.0.json", | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"default": {}, | ||
"required": [], | ||
"title": "Order interaction hooks", | ||
"description": "Optional Pre and Post order interaction hooks attached to a single order", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"version": { | ||
"$ref": "../definitions.json#/definitions/version", | ||
"readOnly": true, | ||
"default": "0.1.0" | ||
}, | ||
"pre": { | ||
"$id": "#/properties/hooks/pre", | ||
"title": "Pre-Hooks", | ||
"description": "CoW Hooks to call before an order executes", | ||
"type": "array", | ||
"items": { | ||
"$ref": "../hook/v0.2.0.json#" | ||
} | ||
}, | ||
"post": { | ||
"$id": "#/properties/hooks/post", | ||
"title": "Post-Hooks", | ||
"description": "CoW Hooks to call after an order executes", | ||
"type": "array", | ||
"items": { | ||
"$ref": "../hook/v0.2.0.json#" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"$id": "https://cowswap.exchange/schemas/app-data/v0.12.0.json", | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"description": "Metadata JSON document for adding information to orders.", | ||
"required": ["version", "metadata"], | ||
"title": "AppData Root Schema", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"version": { | ||
"$ref": "definitions.json#/definitions/version", | ||
"readOnly": true, | ||
"default": "0.12.0" | ||
}, | ||
"appCode": { | ||
"$id": "#/properties/appCode", | ||
"description": "The code identifying the CLI, UI, service generating the order.", | ||
"examples": ["CoW Swap"], | ||
"title": "App Code", | ||
"type": "string" | ||
}, | ||
"environment": { | ||
"$id": "#/properties/environment", | ||
"description": "Environment from which the order came from.", | ||
"title": "Environment", | ||
"type": "string", | ||
"examples": ["production", "development", "staging", "ens"] | ||
}, | ||
"metadata": { | ||
"$id": "#/properties/metadata", | ||
"default": {}, | ||
"description": "Each metadata will specify one aspect of the order.", | ||
"required": [], | ||
"title": "Metadata", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"signer": { | ||
"$ref": "signer/v0.1.0.json#" | ||
}, | ||
"referrer": { | ||
"$ref": "referrer/v0.2.0.json#" | ||
}, | ||
"utm": { | ||
"$ref": "utm/v0.2.0.json#" | ||
}, | ||
"quote": { | ||
"$ref": "quote/v0.3.0.json#" | ||
}, | ||
"orderClass": { | ||
"$ref": "orderClass/v0.3.0.json#" | ||
}, | ||
"hooks": { | ||
"$ref": "hooks/v0.2.0.json#" | ||
}, | ||
"widget": { | ||
"$ref": "widget/v0.1.0.json#" | ||
} | ||
} | ||
} | ||
} | ||
} |