|
| 1 | +/* tslint:disable */ |
| 2 | +/** |
| 3 | + * This file was automatically generated by json-schema-to-typescript. |
| 4 | + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
| 5 | + * and run json-schema-to-typescript to regenerate this file. |
| 6 | + */ |
| 7 | + |
| 8 | +/** |
| 9 | + * Semantic versioning of document. |
| 10 | + */ |
| 11 | +export type Version = string; |
| 12 | +/** |
| 13 | + * The code identifying the CLI, UI, service generating the order. |
| 14 | + */ |
| 15 | +export type AppCode = string; |
| 16 | +/** |
| 17 | + * Environment from which the order came from. |
| 18 | + */ |
| 19 | +export type Environment = string; |
| 20 | +/** |
| 21 | + * 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. |
| 22 | + */ |
| 23 | +export type Signer = string; |
| 24 | +export type ReferrerAddress = string; |
| 25 | +/** |
| 26 | + * Tracks in which medium the traffic originated from (twitter, facebook, etc.) |
| 27 | + */ |
| 28 | +export type UTMSource = string; |
| 29 | +/** |
| 30 | + * Tracks in which medium the traffic originated from (mail, CPC, social, etc.) |
| 31 | + */ |
| 32 | +export type UTMMedium = string; |
| 33 | +/** |
| 34 | + * Track the performance of a specific campaign |
| 35 | + */ |
| 36 | +export type UTMCampaign = string; |
| 37 | +/** |
| 38 | + * Track which link was clicked |
| 39 | + */ |
| 40 | +export type UTMContent = string; |
| 41 | +/** |
| 42 | + * Track which keyword term a website visitor came from |
| 43 | + */ |
| 44 | +export type UTMKeywordTerm = string; |
| 45 | +/** |
| 46 | + * 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) |
| 47 | + */ |
| 48 | +export type SlippageBips = number; |
| 49 | +/** |
| 50 | + * Whether the given slippageBips used is originated from a Smart slippage suggestion |
| 51 | + */ |
| 52 | +export type SmartSlippage = boolean; |
| 53 | +/** |
| 54 | + * Indicator of the order class. |
| 55 | + */ |
| 56 | +export type OrderClass1 = "market" | "limit" | "liquidity" | "twap"; |
| 57 | +/** |
| 58 | + * Semantic versioning of document. |
| 59 | + */ |
| 60 | +export type Version1 = string; |
| 61 | +/** |
| 62 | + * The contract to call for the hook |
| 63 | + */ |
| 64 | +export type HookTarget = string; |
| 65 | +/** |
| 66 | + * The calldata to use when calling the hook |
| 67 | + */ |
| 68 | +export type HookCallData = string; |
| 69 | +/** |
| 70 | + * The gas limit (in gas units) for the hook |
| 71 | + */ |
| 72 | +export type HookGasLimit = string; |
| 73 | +/** |
| 74 | + * 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. |
| 75 | + */ |
| 76 | +export type IdOfTheDAppWhichHasBuiltTheHook = string; |
| 77 | +/** |
| 78 | + * CoW Hooks to call before an order executes |
| 79 | + */ |
| 80 | +export type PreHooks = CoWHook[]; |
| 81 | +/** |
| 82 | + * CoW Hooks to call after an order executes |
| 83 | + */ |
| 84 | +export type PostHooks = CoWHook[]; |
| 85 | +/** |
| 86 | + * The code identifying the UI powering the widget |
| 87 | + */ |
| 88 | +export type AppCode1 = string; |
| 89 | +/** |
| 90 | + * Environment from which the order came from. |
| 91 | + */ |
| 92 | +export type Environment1 = string; |
| 93 | +export type PartnerFee = |
| 94 | + | ( |
| 95 | + | { |
| 96 | + volumeBps: VolumeBasisPointBPS; |
| 97 | + recipient: PartnerAccount; |
| 98 | + } |
| 99 | + | { |
| 100 | + surplusBps: SurplusBasisPointBPS; |
| 101 | + maxVolumeBps: MaxVolumeBasisPointBPS; |
| 102 | + recipient: PartnerAccount; |
| 103 | + } |
| 104 | + | { |
| 105 | + priceImprovementBps: PriceImprovementBasisPointBPS; |
| 106 | + maxVolumeBps: MaxVolumeBasisPointBPS; |
| 107 | + recipient: PartnerAccount; |
| 108 | + } |
| 109 | + )[] |
| 110 | + | ( |
| 111 | + | { |
| 112 | + volumeBps: VolumeBasisPointBPS; |
| 113 | + recipient: PartnerAccount; |
| 114 | + } |
| 115 | + | { |
| 116 | + surplusBps: SurplusBasisPointBPS; |
| 117 | + maxVolumeBps: MaxVolumeBasisPointBPS; |
| 118 | + recipient: PartnerAccount; |
| 119 | + } |
| 120 | + | { |
| 121 | + priceImprovementBps: PriceImprovementBasisPointBPS; |
| 122 | + maxVolumeBps: MaxVolumeBasisPointBPS; |
| 123 | + recipient: PartnerAccount; |
| 124 | + } |
| 125 | + ); |
| 126 | +/** |
| 127 | + * The fee in basis points (BPS) to be paid to the partner based on volume. Capped at protocol level to 100 BPS (1%) |
| 128 | + */ |
| 129 | +export type VolumeBasisPointBPS = number; |
| 130 | +/** |
| 131 | + * The Ethereum address of the partner to receive the fee. |
| 132 | + */ |
| 133 | +export type PartnerAccount = string; |
| 134 | +/** |
| 135 | + * The fee in basis points (BPS) to be paid to the partner based on surplus |
| 136 | + */ |
| 137 | +export type SurplusBasisPointBPS = number; |
| 138 | +/** |
| 139 | + * The maximum volume in basis points (BPS) to be paid to the partner. Capped at protocol level to 100 BPS (1%). You can chose to go lower but not higher |
| 140 | + */ |
| 141 | +export type MaxVolumeBasisPointBPS = number; |
| 142 | +/** |
| 143 | + * The fee in basis points (BPS) to be paid to the partner based on price improvement |
| 144 | + */ |
| 145 | +export type PriceImprovementBasisPointBPS = number; |
| 146 | +/** |
| 147 | + * The replaced order UID. |
| 148 | + */ |
| 149 | +export type ReplacedOrderUID = string; |
| 150 | +/** |
| 151 | + * Id of a blockchain where funds will be received |
| 152 | + */ |
| 153 | +export type BridgingDestinationChainId = string; |
| 154 | +/** |
| 155 | + * Address of a token that will be received at destination chain. The chain might be EVM or non-EVM. Some chains might even not have a token address. E.g.: Bitcoin |
| 156 | + */ |
| 157 | +export type BridgingDestinationTokenAddress = string; |
| 158 | + |
| 159 | +/** |
| 160 | + * Metadata JSON document for adding information to orders. |
| 161 | + */ |
| 162 | +export interface AppDataRootSchema { |
| 163 | + version: Version; |
| 164 | + appCode?: AppCode; |
| 165 | + environment?: Environment; |
| 166 | + metadata: Metadata; |
| 167 | +} |
| 168 | +/** |
| 169 | + * Each metadata will specify one aspect of the order. |
| 170 | + */ |
| 171 | +export interface Metadata { |
| 172 | + signer?: Signer; |
| 173 | + referrer?: Referrer; |
| 174 | + utm?: UTMCodes; |
| 175 | + quote?: Quote; |
| 176 | + orderClass?: OrderClass; |
| 177 | + hooks?: OrderInteractionHooks; |
| 178 | + widget?: Widget; |
| 179 | + partnerFee?: PartnerFee; |
| 180 | + replacedOrder?: ReplacedOrder; |
| 181 | + bridging?: Bridging; |
| 182 | +} |
| 183 | +export interface Referrer { |
| 184 | + address: ReferrerAddress; |
| 185 | +} |
| 186 | +export interface UTMCodes { |
| 187 | + utmSource?: UTMSource; |
| 188 | + utmMedium?: UTMMedium; |
| 189 | + utmCampaign?: UTMCampaign; |
| 190 | + utmContent?: UTMContent; |
| 191 | + utmTerm?: UTMKeywordTerm; |
| 192 | +} |
| 193 | +export interface Quote { |
| 194 | + slippageBips: SlippageBips; |
| 195 | + smartSlippage?: SmartSlippage; |
| 196 | +} |
| 197 | +export interface OrderClass { |
| 198 | + orderClass: OrderClass1; |
| 199 | +} |
| 200 | +/** |
| 201 | + * Optional Pre and Post order interaction hooks attached to a single order |
| 202 | + */ |
| 203 | +export interface OrderInteractionHooks { |
| 204 | + version?: Version1; |
| 205 | + pre?: PreHooks; |
| 206 | + post?: PostHooks; |
| 207 | +} |
| 208 | +export interface CoWHook { |
| 209 | + target: HookTarget; |
| 210 | + callData: HookCallData; |
| 211 | + gasLimit: HookGasLimit; |
| 212 | + dappId?: IdOfTheDAppWhichHasBuiltTheHook; |
| 213 | +} |
| 214 | +export interface Widget { |
| 215 | + appCode: AppCode1; |
| 216 | + environment?: Environment1; |
| 217 | +} |
| 218 | +export interface ReplacedOrder { |
| 219 | + uid: ReplacedOrderUID; |
| 220 | +} |
| 221 | +export interface Bridging { |
| 222 | + destinationChainId: BridgingDestinationChainId; |
| 223 | + destinationTokenAddress: BridgingDestinationTokenAddress; |
| 224 | +} |
0 commit comments