Skip to content

Commit

Permalink
Add partner fee meta-data
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Feb 15, 2024
1 parent af9ed21 commit b128922
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/schemas/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,31 @@
"$id": "#/definitions/version",
"description": "Semantic versioning of document.",
"readOnly": true,
"examples": [
"1.0.0",
"1.2.3"
],
"examples": ["1.0.0", "1.2.3"],
"title": "Version",
"type": "string"
},
"ethereumAddress": {
"$id": "#/definitions/ethereumAddress",
"pattern": "^0x[a-fA-F0-9]{40}$",
"title": "Ethereum compatible address",
"examples": [
"0xb6BAd41ae76A11D10f7b0E664C5007b908bC77C9"
],
"examples": ["0xb6BAd41ae76A11D10f7b0E664C5007b908bC77C9"],
"type": "string"
},
"bigNumber": {
"$id": "#/definitions/bigNumber",
"pattern": "^\\d+$",
"title": "BigNumber",
"examples": [
"90741097240912730913",
"0",
"75891372"
],
"examples": ["90741097240912730913", "0", "75891372"],
"type": "string"
},
"bips": {
"$id": "#/definitions/bips",
"pattern": "^\\d+$",
"title": "Basis Point (BPS)",
"description": "One basis point is equivalent to 0.01% (1/100th of a percent)",
"examples": [0, 10, 50],
"type": "integer"
}
}
}
20 changes: 20 additions & 0 deletions src/schemas/partnerFee/v0.1.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$id": "#partnerFee/v0.1.0.json",
"$schema": "http://json-schema.org/draft-07/schema",
"required": ["bips", "recipient"],
"title": "Partner fee",
"type": "object",
"properties": {
"bips": {
"$id": "#/properties/bips",
"title": "Basis Point (BPS)",
"description": "The fee in basis points (BPS) to be paid to the partner. One basis point is equivalent to 0.01% (1/100th of a percent)",
"$ref": "../definitions.json#/definitions/bips"
},
"recipient": {
"$ref": "../definitions.json#/definitions/ethereumAddress",
"title": "Partner account",
"description": "The Ethereum address of the partner to receive the fee."
}
}
}
65 changes: 65 additions & 0 deletions src/schemas/v0.12.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"$id": "https://cowswap.exchange/schemas/app-data/v0.11.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.11.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.1.0.json#"
},
"widget": {
"$ref": "widget/v0.1.0.json#"
},
"partnerFee": {
"$ref": "partnerFee/v0.1.0.json#"
}
}
}
}
}

0 comments on commit b128922

Please sign in to comment.