UNPKG

@cowprotocol/cow-sdk

Version:

## 📚 [Docs website](https://docs.cow.fi/)

217 lines • 7.15 kB
export default { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "env": { "type": "string", "enum": [ "prod", "staging" ], "description": "The environment to use for the Cow API." }, "partiallyFillable": { "type": "boolean", "description": "Is the order fill-or-kill or partially fillable?" }, "slippageBps": { "type": "number", "description": "Slippage in basis points. If not provided, it will use AUTO slippage, which would suggest a slippage based on the quote." }, "receiver": { "anyOf": [ { "type": "string", "description": "20 byte Ethereum address encoded as a hex with `0x` prefix." }, { "type": "null" } ], "description": "An optional Ethereum address to receive the proceeds of the trade instead of the owner (i.e. the order signer)." }, "validFor": { "type": "number", "description": "Unix timestamp (`uint32`) until which the order is valid." }, "partnerFee": { "anyOf": [ { "type": "array", "items": { "anyOf": [ { "type": "object", "properties": { "volumeBps": { "type": "number", "description": "The fee in basis points (BPS) to be paid to the partner based on volume. Capped at protocol level to 100 BPS (1%)" }, "recipient": { "type": "string", "description": "The Ethereum address of the partner to receive the fee." } }, "required": [ "volumeBps", "recipient" ], "additionalProperties": false }, { "type": "object", "properties": { "surplusBps": { "type": "number", "description": "The fee in basis points (BPS) to be paid to the partner based on surplus" }, "maxVolumeBps": { "type": "number", "description": "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" }, "recipient": { "type": "string", "description": "The Ethereum address of the partner to receive the fee." } }, "required": [ "surplusBps", "maxVolumeBps", "recipient" ], "additionalProperties": false }, { "type": "object", "properties": { "priceImprovementBps": { "type": "number", "description": "The fee in basis points (BPS) to be paid to the partner based on price improvement" }, "maxVolumeBps": { "type": "number", "description": "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" }, "recipient": { "type": "string", "description": "The Ethereum address of the partner to receive the fee." } }, "required": [ "priceImprovementBps", "maxVolumeBps", "recipient" ], "additionalProperties": false } ] } }, { "type": "object", "properties": { "volumeBps": { "type": "number", "description": "The fee in basis points (BPS) to be paid to the partner based on volume. Capped at protocol level to 100 BPS (1%)" }, "recipient": { "type": "string", "description": "The Ethereum address of the partner to receive the fee." } }, "required": [ "volumeBps", "recipient" ], "additionalProperties": false }, { "type": "object", "properties": { "surplusBps": { "type": "number", "description": "The fee in basis points (BPS) to be paid to the partner based on surplus" }, "maxVolumeBps": { "type": "number", "description": "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" }, "recipient": { "type": "string", "description": "The Ethereum address of the partner to receive the fee." } }, "required": [ "surplusBps", "maxVolumeBps", "recipient" ], "additionalProperties": false }, { "type": "object", "properties": { "priceImprovementBps": { "type": "number", "description": "The fee in basis points (BPS) to be paid to the partner based on price improvement" }, "maxVolumeBps": { "type": "number", "description": "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" }, "recipient": { "type": "string", "description": "The Ethereum address of the partner to receive the fee." } }, "required": [ "priceImprovementBps", "maxVolumeBps", "recipient" ], "additionalProperties": false } ] }, "kind": { "type": "string", "enum": [ "buy", "sell" ], "description": "Is this order a buy or sell?" }, "owner": { "type": "string" }, "sellToken": { "type": "string", "description": "ERC-20 token to be sold." }, "sellTokenDecimals": { "type": "number" }, "buyToken": { "type": "string", "description": "ERC-20 token to be bought." }, "buyTokenDecimals": { "type": "number" }, "amount": { "type": "string", "description": "Amount of a token. `uint256` encoded in decimal." } }, "required": [ "amount", "buyToken", "buyTokenDecimals", "kind", "sellToken", "sellTokenDecimals" ], "description": "Trade type, assets, amounts, and optional parameters.", "definitions": {} } as const