-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add partner fee meta-data #53
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
212e638
docs: improve docs
anxolin f2ca95c
Add partner fee
anxolin 7633d85
Add new schema exported types
anxolin ce4e81a
Add unit tests
anxolin 5c027da
Assert decimal values are not allowed
anxolin d759d4e
Fix issue with versions
anxolin d600861
Use bips definition for the slippage too
anxolin 5b7ca81
Use the new bips definition also for the `slippageBips` in the quote
anxolin 1255e24
Add new breaking changes
anxolin a4789f0
chore: pretend 0.12.0 never existed
anxolin 1ca53bb
Merge pull request #55 from cowprotocol/use-bips-for-slippage
anxolin da6b8b1
chore: rename BIPS to BPS
anxolin b0b3d93
chore: change version
anxolin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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,154 @@ | ||
/* tslint:disable */ | ||
/** | ||
* This file was automatically generated by json-schema-to-typescript. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run json-schema-to-typescript to regenerate this file. | ||
*/ | ||
|
||
/** | ||
* Semantic versioning of document. | ||
*/ | ||
export type Version = string; | ||
/** | ||
* The code identifying the CLI, UI, service generating the order. | ||
*/ | ||
export type AppCode = string; | ||
/** | ||
* Environment from which the order came from. | ||
*/ | ||
export type Environment = string; | ||
/** | ||
* The address of the trader who signs the CoW Swap order. This field should normally be omitted; it is recommended to use it if the signer is a smart-contract wallet using EIP-1271 signatures. | ||
*/ | ||
export type Signer = string; | ||
export type ReferrerAddress = string; | ||
/** | ||
* Tracks in which medium the traffic originated from (twitter, facebook, etc.) | ||
*/ | ||
export type UTMSource = string; | ||
/** | ||
* Tracks in which medium the traffic originated from (mail, CPC, social, etc.) | ||
*/ | ||
export type UTMMedium = string; | ||
/** | ||
* Track the performance of a specific campaign | ||
*/ | ||
export type UTMCampaign = string; | ||
/** | ||
* Track which link was clicked | ||
*/ | ||
export type UTMContent = string; | ||
/** | ||
* Track which keyword term a website visitor came from | ||
*/ | ||
export type UTMKeywordTerm = string; | ||
/** | ||
* Slippage tolerance that was applied to the order to get the limit price. Expressed in Basis Points (BPS). One basis point is equivalent to 0.01% (1/100th of a percent) | ||
*/ | ||
export type SlippageBips = number; | ||
/** | ||
* Indicator of the order class. | ||
*/ | ||
export type OrderClass1 = "market" | "limit" | "liquidity" | "twap"; | ||
/** | ||
* Semantic versioning of document. | ||
*/ | ||
export type Version1 = string; | ||
/** | ||
* The contract to call for the hook | ||
*/ | ||
export type HookTarget = string; | ||
/** | ||
* The calldata to use when calling the hook | ||
*/ | ||
export type HookCallData = string; | ||
/** | ||
* The gas limit (in gas units) for the hook | ||
*/ | ||
export type HookGasLimit = string; | ||
/** | ||
* CoW Hooks to call before an order executes | ||
*/ | ||
export type PreHooks = CoWHook[]; | ||
/** | ||
* CoW Hooks to call after an order executes | ||
*/ | ||
export type PostHooks = CoWHook[]; | ||
/** | ||
* The code identifying the UI powering the widget | ||
*/ | ||
export type AppCode1 = string; | ||
/** | ||
* Environment from which the order came from. | ||
*/ | ||
export type Environment1 = string; | ||
/** | ||
* 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) | ||
*/ | ||
export type BasisPointBPS = number; | ||
/** | ||
* The Ethereum address of the partner to receive the fee. | ||
*/ | ||
export type PartnerAccount = string; | ||
|
||
/** | ||
* Metadata JSON document for adding information to orders. | ||
*/ | ||
export interface AppDataRootSchema { | ||
version: Version; | ||
appCode?: AppCode; | ||
environment?: Environment; | ||
metadata: Metadata; | ||
} | ||
/** | ||
* Each metadata will specify one aspect of the order. | ||
*/ | ||
export interface Metadata { | ||
signer?: Signer; | ||
referrer?: Referrer; | ||
utm?: UTMCodes; | ||
quote?: Quote; | ||
orderClass?: OrderClass; | ||
hooks?: OrderInteractionHooks; | ||
widget?: Widget; | ||
partnerFee?: PartnerFee; | ||
} | ||
export interface Referrer { | ||
address: ReferrerAddress; | ||
} | ||
export interface UTMCodes { | ||
utmSource?: UTMSource; | ||
utmMedium?: UTMMedium; | ||
utmCampaign?: UTMCampaign; | ||
utmContent?: UTMContent; | ||
utmTerm?: UTMKeywordTerm; | ||
} | ||
export interface Quote { | ||
slippageBips: SlippageBips; | ||
} | ||
export interface OrderClass { | ||
orderClass: OrderClass1; | ||
} | ||
/** | ||
* Optional Pre and Post order interaction hooks attached to a single order | ||
*/ | ||
export interface OrderInteractionHooks { | ||
version?: Version1; | ||
pre?: PreHooks; | ||
post?: PostHooks; | ||
} | ||
export interface CoWHook { | ||
target: HookTarget; | ||
callData: HookCallData; | ||
gasLimit: HookGasLimit; | ||
} | ||
export interface Widget { | ||
appCode: AppCode1; | ||
environment?: Environment1; | ||
[k: string]: unknown; | ||
} | ||
export interface PartnerFee { | ||
bps: BasisPointBPS; | ||
recipient: PartnerAccount; | ||
[k: string]: unknown; | ||
} |
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,19 @@ | ||
{ | ||
"$id": "#partnerFee/v0.1.0.json", | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"required": ["bps", "recipient"], | ||
"title": "Partner fee", | ||
"type": "object", | ||
"properties": { | ||
"bps": { | ||
"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/bps" | ||
}, | ||
"recipient": { | ||
"title": "Partner account", | ||
"description": "The Ethereum address of the partner to receive the fee.", | ||
"$ref": "../definitions.json#/definitions/ethereumAddress" | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated: this link was just broken