Skip to main content

@cowprotocol/cow-sdk

Namespacesโ€‹

Enumerationsโ€‹

Classesโ€‹

Interfacesโ€‹

Type Aliasesโ€‹

AccountAddressโ€‹

ฦฌ AccountAddress: `0x${string}`

Defined inโ€‹

external/cow-sdk/src/trading/types.ts:18


Addressโ€‹

ฦฌ Address: string

20 byte Ethereum address encoded as a hex with 0x prefix.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Address.ts:8


ApiBaseUrlsโ€‹

ฦฌ ApiBaseUrls: Record<SupportedChainId, string>

Defined inโ€‹

external/cow-sdk/src/common/configs.ts:49


AppDataโ€‹

ฦฌ AppData: string

The string encoding of a JSON object representing some appData. The format of the JSON expected in the appData field is defined here.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/AppData.ts:11


AppDataHashโ€‹

ฦฌ AppDataHash: string

32 bytes encoded as hex with 0x prefix. It's expected to be the hash of the stringified JSON object representing the appData.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/AppDataHash.ts:10


AppDataObjectโ€‹

ฦฌ AppDataObject: Object

An appData document that is registered with the API.

Type declarationโ€‹

NameType
fullAppData?AppData

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/AppDataObject.ts:10


AppDataRootSchemaโ€‹

ฦฌ AppDataRootSchema: latest.AppDataRootSchema

Defined inโ€‹

external/cow-sdk/src/trading/types.ts:140


Auctionโ€‹

ฦฌ Auction: Object

A batch auction for solving.

Type declarationโ€‹

NameTypeDescription
block?numberThe block number for the auction. Orders and prices are guaranteed to be valid on this block. Proposed settlements should be valid for this block as well.
id?numberThe unique identifier of the auction. Increment whenever the backend creates a new auction.
latestSettlementBlock?numberThe latest block on which a settlement has been processed. NOTE: Under certain conditions it is possible for a settlement to have been mined as part of block but not have yet been processed.
orders?AuctionOrder[]The solvable orders included in the auction.
prices?AuctionPrices-
surplusCapturingJitOrderOwners?Address[]List of addresses on whose surplus will count towards the objective value of their solution (unlike other orders that were created by the solver).

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Auction.ts:13


AuctionOrderโ€‹

ฦฌ AuctionOrder: Object

A solvable order included in the current batch auction. Contains the data forwarded to solvers for solving.

Type declarationโ€‹

NameTypeDescription
appDataAppDataHash-
buyAmountTokenAmountsee OrderParameters::buyAmount
buyTokenAddresssee OrderParameters::buyToken
buyTokenBalanceBuyTokenDestinationsee OrderParameters::buyTokenBalance
classOrderClass-
createdstringCreation time of the order. Denominated in epoch seconds.
executedTokenAmountCurrently executed amount of sell/buy token, depending on the order kind.
kindOrderKindsee OrderParameters::kind
ownerAddress-
partiallyFillablebooleansee OrderParameters::partiallyFillable
postInteractionsInteractionData[]The post-interactions that need to be executed after the execution of the order.
preInteractionsInteractionData[]The pre-interactions that need to be executed before the first execution of the order.
protocolFeesFeePolicy[]The fee policies that are used to compute the protocol fees for this order.
quote?QuoteA winning quote.
receiverAddress | nullsee OrderParameters::receiver
sellAmountTokenAmountsee OrderParameters::sellAmount
sellTokenAddresssee OrderParameters::sellToken
sellTokenBalanceSellTokenSourcesee OrderParameters::sellTokenBalance
signatureSignature-
uidUID-
validTonumbersee OrderParameters::validTo

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/AuctionOrder.ts:22


AuctionPricesโ€‹

ฦฌ AuctionPrices: Record<string, BigUint>

The reference prices for all traded tokens in the auction as a mapping from token addresses to a price denominated in native token (i.e. 1e18 represents a token that trades one to one with the native token). These prices are used for solution competition for computing surplus and converting fees to native token.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/AuctionPrices.ts:14


BigUintโ€‹

ฦฌ BigUint: string

A big unsigned integer encoded in decimal.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/BigUint.ts:8


BlockInfoโ€‹

ฦฌ BlockInfo: Object

Type declarationโ€‹

NameType
blockNumbernumber
blockTimestampnumber

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:102


CallDataโ€‹

ฦฌ CallData: string

Some calldata sent to a contract in a transaction encoded as a hex with 0x prefix.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/CallData.ts:8


CompetitionAuctionโ€‹

ฦฌ CompetitionAuction: Object

The components that describe a batch auction for the solver competition.

Type declarationโ€‹

NameTypeDescription
orders?UID[]The UIDs of the orders included in the auction.
prices?AuctionPrices-

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/CompetitionAuction.ts:12


CompetitionOrderStatusโ€‹

ฦฌ CompetitionOrderStatus: Object

Type declarationโ€‹

NameTypeDescription
typetype-
value?{ executedAmounts?: ExecutedAmounts ; solver: string }[]A list of solvers who participated in the latest competition, sorted by score in ascending order, where the last element is the winner. The presence of executed amounts defines whether the solver provided a solution for the desired order.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/CompetitionOrderStatus.ts:7

external/cow-sdk/src/order-book/generated/models/CompetitionOrderStatus.ts:23


ConditionalOrderParamsโ€‹

ฦฌ ConditionalOrderParams: Object

Type declarationโ€‹

NameType
handlerstring
saltstring
staticInputstring

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:13


ConditionalOrderRegistryโ€‹

ฦฌ ConditionalOrderRegistry: Record<string, FromParams<unknown, unknown>>

Defined inโ€‹

external/cow-sdk/src/composable/ConditionalOrderFactory.ts:5


ContextFactoryโ€‹

ฦฌ ContextFactory: Object

A factory and it's arguments that are called at transaction mining time to generate the context for a conditional order(s).

This allows to support the case where conditional orders may want to commence validity at the time of transaction mining, like in the case of a TWAP executed by a DAO or Safe that takes a reasonable amount of time to aggregate signatures or collect votes.

Remarks

This is used in conjunction with setRootWithContext or createWithContext.

Type declarationโ€‹

NameType
addressstring
factoryArgs?{ args: unknown[] ; argsType: string[] }
factoryArgs.argsunknown[]
factoryArgs.argsTypestring[]

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:44


CowEnvโ€‹

ฦฌ CowEnv: "prod" | "staging"

The environment to use for the Cow API.

Defined inโ€‹

external/cow-sdk/src/common/configs.ts:35


DurationOfPartโ€‹

ฦฌ DurationOfPart: { durationType: AUTO } | { duration: BigNumber ; durationType: LIMIT_DURATION }

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:138


EcdsaSignatureโ€‹

ฦฌ EcdsaSignature: string

65 bytes encoded as hex with 0x prefix. r || s || v from the spec.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/EcdsaSignature.ts:8


EthflowDataโ€‹

ฦฌ EthflowData: Object

Provides the additional data for ethflow orders.

Type declarationโ€‹

NameTypeDescription
refundTxHashTransactionHash | nullSpecifies in which transaction the order was refunded. If this field is null the order was not yet refunded.
userValidTonumberDescribes the validTo of an order ethflow order. NOTE: For ethflow orders, the validTo encoded in the smart contract is type(uint256).max.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/EthflowData.ts:10


ExecutedAmountsโ€‹

ฦฌ ExecutedAmounts: Object

Type declarationโ€‹

NameType
buyBigUint
sellBigUint

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/ExecutedAmounts.ts:7


ExecutedProtocolFeeโ€‹

ฦฌ ExecutedProtocolFee: Object

Type declarationโ€‹

NameTypeDescription
amount?TokenAmountFee amount taken
policy?FeePolicy-
token?AddressThe token in which the fee is taken

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/ExecutedProtocolFee.ts:9


FeePolicyโ€‹

ฦฌ FeePolicy: Surplus | Volume | PriceImprovement

Defines the ways to calculate the protocol fee.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/FeePolicy.ts:12


FromParamsโ€‹

ฦฌ FromParams<D, S>: (params: ConditionalOrderParams) => ConditionalOrder<D, S>

Type parametersโ€‹

Name
D
S

Type declarationโ€‹

โ–ธ (params): ConditionalOrder<D, S>

Parametersโ€‹
NameType
paramsConditionalOrderParams
Returnsโ€‹

ConditionalOrder<D, S>

Defined inโ€‹

external/cow-sdk/src/composable/ConditionalOrderFactory.ts:4


GetOrdersRequestโ€‹

ฦฌ GetOrdersRequest: Object

The parameters for the getOrders request.

Type declarationโ€‹

NameType
limit?number
offset?number
ownerAddress

Defined inโ€‹

external/cow-sdk/src/order-book/api.ts:68


InteractionDataโ€‹

ฦฌ InteractionData: Object

Type declarationโ€‹

NameTypeDescription
call_data?CallData[]The call data to be used for the interaction.
target?Address-
value?TokenAmount-

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/InteractionData.ts:9


IsValidResultโ€‹

ฦฌ IsValidResult: IsValid | IsNotValid

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:164


NativePriceResponseโ€‹

ฦฌ NativePriceResponse: Object

The estimated native price for the token

Type declarationโ€‹

NameTypeDescription
price?numberEstimated price of the token.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/NativePriceResponse.ts:9


OnchainOrderDataโ€‹

ฦฌ OnchainOrderData: Object

Type declarationโ€‹

NameTypeDescription
placementError?placementErrorDescribes the error, if the order placement was not successful. This could happen, for example, if the validTo is too high, or no valid quote was found or generated.
senderAddressIf orders are placed as on-chain orders, the owner of the order might be a smart contract, but not the user placing the order. The actual user will be provided in this field.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OnchainOrderData.ts:7

external/cow-sdk/src/order-book/generated/models/OnchainOrderData.ts:24


Orderโ€‹

ฦฌ Order: OrderCreation & OrderMetaData

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Order.ts:8


OrderCancellationโ€‹

ฦฌ OrderCancellation: Object

EIP-712 signature of struct OrderCancellation(bytes orderUid) from the order's owner.

Type declarationโ€‹

NameTypeDescription
signatureEcdsaSignatureOrderCancellation signed by owner
signingSchemeEcdsaSigningScheme-

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderCancellation.ts:13


OrderCancellationErrorโ€‹

ฦฌ OrderCancellationError: Object

Type declarationโ€‹

NameType
descriptionstring
errorTypeerrorType

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderCancellationError.ts:5

external/cow-sdk/src/order-book/generated/models/OrderCancellationError.ts:10


OrderCancellationsโ€‹

ฦฌ OrderCancellations: Object

EIP-712 signature of struct OrderCancellations { orderUid: bytes[] } from the order's owner.

Type declarationโ€‹

NameTypeDescription
orderUids?UID[]UIDs of orders to cancel.
signatureEcdsaSignatureOrderCancellation signed by the owner.
signingSchemeEcdsaSigningScheme-

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderCancellations.ts:13


OrderCreationโ€‹

ฦฌ OrderCreation: Object

Data a user provides when creating a new order.

Type declarationโ€‹

NameTypeDescription
appDataAppData | AppDataHashThis field comes in two forms for backward compatibility. The hash form will eventually stop being accepted.
appDataHash?AppDataHash | nullMay be set for debugging purposes. If set, this field is compared to what the backend internally calculates as the app data hash based on the contents of appData. If the hash does not match, an error is returned. If this field is set, then appData MUST be a string encoding of a JSON object.
buyAmountTokenAmountsee OrderParameters::buyAmount
buyTokenAddresssee OrderParameters::buyToken
buyTokenBalance?BuyTokenDestinationsee OrderParameters::buyTokenBalance
feeAmountTokenAmountsee OrderParameters::feeAmount
from?Address | nullIf set, the backend enforces that this address matches what is decoded as the signer of the signature. This helps catch errors with invalid signature encodings as the backend might otherwise silently work with an unexpected address that for example does not have any balance.
kindOrderKindsee OrderParameters::kind
partiallyFillablebooleansee OrderParameters::partiallyFillable
quoteId?number | nullOrders can optionally include a quote ID. This way the order can be linked to a quote and enable providing more metadata when analysing order slippage.
receiver?Address | nullsee OrderParameters::receiver
sellAmountTokenAmountsee OrderParameters::sellAmount
sellTokenAddresssee OrderParameters::sellToken
sellTokenBalance?SellTokenSourcesee OrderParameters::sellTokenBalance
signatureSignature-
signingSchemeSigningScheme-
validTonumbersee OrderParameters::validTo

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderCreation.ts:18


OrderMetaDataโ€‹

ฦฌ OrderMetaData: Object

Extra order data that is returned to users when querying orders but not provided by users when creating orders.

Type declarationโ€‹

NameTypeDescription
availableBalance?TokenAmount | nullUnused field that is currently always set to null and will be removed in the future. Deprecated
classOrderClass-
creationDatestringCreation time of the order. Encoded as ISO 8601 UTC.
ethflowData?EthflowData-
executedBuyAmountBigUintThe total amount of buyToken that has been executed for this order.
executedFeeAmountBigUintThe total amount of fees that have been executed for this order.
executedSellAmountBigUintThe total amount of sellToken that has been executed for this order including fees.
executedSellAmountBeforeFeesBigUintThe total amount of sellToken that has been executed for this order without fees.
executedSurplusFee?BigUint | nullSurplus fee that the limit order was executed with.
fullAppData?string | nullFull appData, which the contract-level appData is a hash of. See OrderCreation for more information.
fullFeeAmount?TokenAmountAmount that the signed fee would be without subsidies.
invalidatedbooleanHas this order been invalidated?
isLiquidityOrder?booleanLiquidity orders are functionally the same as normal smart contract orders but are not placed with the intent of actively getting traded. Instead they facilitate the trade of normal orders by allowing them to be matched against liquidity orders which uses less gas and can have better prices than external liquidity. As such liquidity orders will only be used in order to improve settlement of normal orders. They should not be expected to be traded otherwise and should not expect to get surplus.
onchainOrderData?OnchainOrderDataThere is some data only available for orders that are placed on-chain. This data can be found in this object.
onchainUser?AddressThis represents the actual trader of an on-chain order. ### ethflow orders In this case, the owner would be the EthFlow contract and not the actual trader.
ownerAddress-
statusOrderStatusOrder status.
uidUID-

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderMetaData.ts:19


OrderParametersโ€‹

ฦฌ OrderParameters: Object

Order parameters.

Type declarationโ€‹

NameTypeDescription
appDataAppDataHash-
buyAmountTokenAmountAmount of buyToken to be bought in atoms.
buyTokenAddressERC-20 token to be bought.
buyTokenBalance?BuyTokenDestination-
feeAmountTokenAmountfeeRatio * sellAmount + minimal_fee in atoms.
kindOrderKindThe kind is either a buy or sell order.
partiallyFillablebooleanIs the order fill-or-kill or partially fillable?
receiver?Address | nullAn optional Ethereum address to receive the proceeds of the trade instead of the owner (i.e. the order signer).
sellAmountTokenAmountAmount of sellToken to be sold in atoms.
sellTokenAddressERC-20 token to be sold.
sellTokenBalance?SellTokenSource-
signingScheme?SigningScheme-
validTonumberUnix timestamp (uint32) until which the order is valid.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderParameters.ts:16


OrderPostErrorโ€‹

ฦฌ OrderPostError: Object

Type declarationโ€‹

NameType
descriptionstring
errorTypeerrorType

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderPostError.ts:5

external/cow-sdk/src/order-book/generated/models/OrderPostError.ts:10


OrderQuoteRequestโ€‹

ฦฌ OrderQuoteRequest: OrderQuoteSide & OrderQuoteValidity & { appData?: AppData | AppDataHash ; appDataHash?: AppDataHash ; buyToken: Address ; buyTokenBalance?: BuyTokenDestination ; from: Address ; onchainOrder?: any ; priceQuality?: PriceQuality ; receiver?: Address | null ; sellToken: Address ; sellTokenBalance?: SellTokenSource ; signingScheme?: SigningScheme }

Request fee and price quote.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderQuoteRequest.ts:18


OrderQuoteResponseโ€‹

ฦฌ OrderQuoteResponse: Object

An order quoted by the backend that can be directly signed and submitted to the order creation backend.

Type declarationโ€‹

NameTypeDescription
expirationstringExpiration date of the offered fee. Order service might not accept the fee after this expiration date. Encoded as ISO 8601 UTC.
from?Address-
id?numberQuote ID linked to a quote to enable providing more metadata when analysing order slippage.
quoteOrderParameters-
verifiedbooleanWhether it was possible to verify that the quoted amounts are accurate using a simulation.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderQuoteResponse.ts:13


OrderQuoteSideโ€‹

ฦฌ OrderQuoteSide: { kind: OrderQuoteSideKindSell ; sellAmountBeforeFee: TokenAmount } | { kind: OrderQuoteSideKindSell ; sellAmountAfterFee: TokenAmount } | { buyAmountAfterFee: TokenAmount ; kind: OrderQuoteSideKindBuy }

The buy or sell side when quoting an order.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderQuoteSide.ts:12


OrderQuoteValidityโ€‹

ฦฌ OrderQuoteValidity: { validTo?: number } | { validFor?: number }

The validity for the order.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/OrderQuoteValidity.ts:8


Ordersโ€‹

ฦฌ Orders: Record<string, ConditionalOrder<unknown, unknown>>

Defined inโ€‹

external/cow-sdk/src/composable/Multiplexer.ts:15


OwnerContextโ€‹

ฦฌ OwnerContext: Object

Type declarationโ€‹

NameType
chainIdSupportedChainId
ownerstring
providerproviders.Provider

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:85


PartialApiContextโ€‹

ฦฌ PartialApiContext: Partial<ApiContext>

Override some properties of the ApiContext.

Defined inโ€‹

external/cow-sdk/src/common/configs.ts:40


PayloadLocationEmittedโ€‹

ฦฌ PayloadLocationEmitted: Object

Payload for emitting a merkle root to a ComposableCoW-enabled Safe.

If setting ProofLocation.EMITTED, this type should be used as the data in the Proof struct.

Type declarationโ€‹

NameType
proofsProofWithParams[]

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:70


PollParamsโ€‹

ฦฌ PollParams: OwnerContext & { blockInfo?: BlockInfo ; offchainInput?: string ; orderBookApi: OrderBookApi ; proof?: string[] }

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:91


PollResultโ€‹

ฦฌ PollResult: PollResultSuccess | PollResultErrors

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:107


PollResultErrorsโ€‹

ฦฌ PollResultErrors: PollResultTryNextBlock | PollResultTryOnBlock | PollResultTryAtEpoch | PollResultUnexpectedError | PollResultDontTryAgain

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:109


PreSignatureโ€‹

ฦฌ PreSignature: string

Empty signature bytes. Used for "presign" signatures.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/PreSignature.ts:8


PriceEstimationErrorโ€‹

ฦฌ PriceEstimationError: Object

Type declarationโ€‹

NameType
descriptionstring
errorTypeerrorType

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/PriceEstimationError.ts:5

external/cow-sdk/src/order-book/generated/models/PriceEstimationError.ts:10


PriceImprovementโ€‹

ฦฌ PriceImprovement: Object

The protocol fee is taken as a percent of the order price improvement which is a difference between the executed price and the best quote.

Type declarationโ€‹

NameTypeDescription
factornumber-
maxVolumeFactornumber-
quoteQuoteThe best quote received.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/PriceImprovement.ts:10


PrivateKeyโ€‹

ฦฌ PrivateKey: string

Defined inโ€‹

external/cow-sdk/src/trading/types.ts:17


ProofStructโ€‹

ฦฌ ProofStruct: Object

A struct for a proof that can be used with setRoot and setRootWithContext on a ComposableCoW-enabled Safe.

Type declarationโ€‹

NameType
datastring | "0x"
locationProofLocation

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:58


ProofWithParamsโ€‹

ฦฌ ProofWithParams: Object

A proof for a conditional order and it's parameters.

Type declarationโ€‹

NameType
paramsConditionalOrderParams
proofstring[]

Defined inโ€‹

external/cow-sdk/src/composable/types.ts:78


ProtocolAppDataโ€‹

ฦฌ ProtocolAppData: Object

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/ProtocolAppData.ts:5


Quoteโ€‹

ฦฌ Quote: Object

A calculated order quote.

Type declarationโ€‹

NameTypeDescription
buyAmount?TokenAmountThe amount of the buy token.
fee?TokenAmountThe amount that needs to be paid, denominated in the sell token.
sellAmount?TokenAmountThe amount of the sell token.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Quote.ts:11


QuoterParametersโ€‹

ฦฌ QuoterParameters: Omit<TraderParameters, "signer"> & { account: AccountAddress }

Defined inโ€‹

external/cow-sdk/src/trading/types.ts:83


Signatureโ€‹

ฦฌ Signature: EcdsaSignature | PreSignature

A signature.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Signature.ts:11


SigningResultโ€‹

ฦฌ SigningResult: Object

Encoded signature including signing scheme for the order.

Type declarationโ€‹

NameType
signaturestring
signingSchemeEcdsaSigningScheme

Defined inโ€‹

external/cow-sdk/src/order-signing/types.ts:13


SolverCompetitionResponseโ€‹

ฦฌ SolverCompetitionResponse: Object

The settlements submitted by every solver for a specific auction. The auctionId corresponds to the id external solvers are provided with.

Type declarationโ€‹

NameTypeDescription
auction?CompetitionAuction-
auctionId?numberThe ID of the auction the competition info is for.
competitionSimulationBlock?number-
gasPrice?numberGas price used for ranking solutions.
liquidityCollectedBlock?number-
solutions?SolverSettlement[]Maps from solver name to object describing that solver's settlement.
transactionHash?TransactionHash | nullThe hash of the transaction that the winning solution of this info was submitted in.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/SolverCompetitionResponse.ts:15


SolverSettlementโ€‹

ฦฌ SolverSettlement: Object

Type declarationโ€‹

NameTypeDescription
clearingPrices?Record<string, BigUint>The prices of tokens for settled user orders as passed to the settlement contract.
objective?{ cost?: number ; fees?: number ; gas?: number ; surplus?: number ; total?: number }-
objective.cost?number-
objective.fees?number-
objective.gas?number-
objective.surplus?number-
objective.total?numberThe total objective value used for ranking solutions.
orders?{ executedAmount?: BigUint ; id?: UID }[]Touched orders.
score?BigUint | nullThe score of the current auction as defined in CIP-20. It is null for old auctions.
solver?stringName of the solver.
solverAddress?stringThe address used by the solver to execute the settlement on-chain. This field is missing for old settlements, the zero address has been used instead.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/SolverSettlement.ts:8


StartTimeโ€‹

ฦฌ StartTime: { startType: AT_MINING_TIME } | { epoch: BigNumber ; startType: AT_EPOCH }

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:147


Surplusโ€‹

ฦฌ Surplus: Object

The protocol fee is taken as a percent of the surplus.

Type declarationโ€‹

NameType
factornumber
maxVolumeFactornumber

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Surplus.ts:8


TokenAmountโ€‹

ฦฌ TokenAmount: string

Amount of a token. uint256 encoded in decimal.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/TokenAmount.ts:8


TotalSurplusโ€‹

ฦฌ TotalSurplus: Object

The total surplus.

Type declarationโ€‹

NameTypeDescription
totalSurplus?stringThe total surplus.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/TotalSurplus.ts:9


Tradeโ€‹

ฦฌ Trade: Object

Trade data such as executed amounts, fees, orderUid and block number.

Type declarationโ€‹

NameTypeDescription
blockNumbernumberBlock in which trade occurred.
buyAmountTokenAmountTotal amount of buyToken received in this trade.
buyTokenAddressAddress of token bought.
executedProtocolFees?ExecutedProtocolFee[]Executed protocol fees for this trade, together with the fee policies used. Listed in the order they got applied.
logIndexnumberIndex in which transaction was included in block.
orderUidUIDUID of the order matched by this trade.
ownerAddressAddress of trader.
sellAmountTokenAmountTotal amount of sellToken that has been executed for this trade (including fees).
sellAmountBeforeFeesBigUintThe total amount of sellToken that has been executed for this order without fees.
sellTokenAddressAddress of token sold.
txHashTransactionHash | nullTransaction hash of the corresponding settlement transaction containing the trade (if available).

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Trade.ts:16


TransactionHashโ€‹

ฦฌ TransactionHash: string

32 byte digest encoded as a hex with 0x prefix.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/TransactionHash.ts:8


TwapDataBaseโ€‹

ฦฌ TwapDataBase: Object

Base parameters for a TWAP order. Shared by:

  • TwapStruct (modelling the contract's struct used for staticInput).
  • TwapData (modelling the friendly SDK interface).

Type declarationโ€‹

NameTypeDescription
appDatastringMeta-data associated with the order. Normally would be the keccak256 hash of the document generated in http://github.com/cowprotocol/app-data This hash should have been uploaded to the API https://api.cow.fi/docs/#/default/put_api_v1_app_data__app_data_hash_ and potentially to other data availability protocols like IPFS.
buyTokenstringwhich token to buy
receiverstringwho to send the tokens to
sellTokenstringwhich token to sell

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:41


UIDโ€‹

ฦฌ UID: string

Unique identifier for the order: 56 bytes encoded as hex with 0x prefix. Bytes 0..32 are the order digest, bytes 30..52 the owner address and bytes 52..56 the expiry (validTo) as a uint32 unix epoch timestamp.

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/UID.ts:11


UnsignedOrderโ€‹

ฦฌ UnsignedOrder: Omit<OrderParameters, "receiver"> & { receiver: string }

Unsigned order intent to be placed.

Defined inโ€‹

external/cow-sdk/src/order-signing/types.ts:8


Volumeโ€‹

ฦฌ Volume: Object

The protocol fee is taken as a percent of the order volume.

Type declarationโ€‹

NameType
factornumber

Defined inโ€‹

external/cow-sdk/src/order-book/generated/models/Volume.ts:8

Variablesโ€‹

ALL_SUPPORTED_CHAIN_IDSโ€‹

โ€ข Const ALL_SUPPORTED_CHAIN_IDS: SupportedChainId[]

The list of supported chains.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:16


BARN_ETH_FLOW_ADDRESSESโ€‹

โ€ข Const BARN_ETH_FLOW_ADDRESSES: Record<SupportedChainId, string>

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:78


COMPOSABLE_COWโ€‹

โ€ข Const COMPOSABLE_COW: "0xfdaFc9d1902f4e0b84f65F49f244b32b31013b74"

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:5


COMPOSABLE_COW_CONTRACT_ADDRESSโ€‹

โ€ข Const COMPOSABLE_COW_CONTRACT_ADDRESS: Record<SupportedChainId, string>

An object containing the addresses of the ComposableCow contracts for each supported chain.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:54


CONDITIONAL_ORDER_PARAMS_ABIโ€‹

โ€ข Const CONDITIONAL_ORDER_PARAMS_ABI: string[]

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:19


COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESSโ€‹

โ€ข Const COW_PROTOCOL_SETTLEMENT_CONTRACT_ADDRESS: Record<SupportedChainId, string>

An object containing the addresses of the CoW Protocol settlement contracts for each supported chain.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:39


COW_PROTOCOL_VAULT_RELAYER_ADDRESSโ€‹

โ€ข Const COW_PROTOCOL_VAULT_RELAYER_ADDRESS: Record<SupportedChainId, string>

An object containing the addresses of the CoW Protocol Vault realyer contracts for each supported chain.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:44


COW_SHED_712_TYPESโ€‹

โ€ข Const COW_SHED_712_TYPES: Object

Type declarationโ€‹

NameType
Call{ name: string = 'target'; type: string = 'address' }[]
ExecuteHooks{ name: string = 'calls'; type: string = 'Call[]' }[]

Defined inโ€‹

external/cow-sdk/src/cow-shed/types.ts:30


COW_SHED_FACTORYโ€‹

โ€ข Const COW_SHED_FACTORY: "0x00E989b87700514118Fa55326CD1cCE82faebEF6"

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:7


COW_SHED_IMPLEMENTATIONโ€‹

โ€ข Const COW_SHED_IMPLEMENTATION: "0x2CFFA8cf11B90C9F437567b86352169dF4009F73"

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:8


COW_SHED_PROXY_INIT_CODEโ€‹

โ€ข Const COW_SHED_PROXY_INIT_CODE: "0x60a034608e57601f61037138819003918201601f19168301916001600160401b038311848410176093578084926040948552833981010312608e57604b602060458360a9565b920160a9565b6080527f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc556040516102b490816100bd8239608051818181608f01526101720152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203608e5756fe60806040526004361015610018575b3661019457610194565b6000803560e01c908163025b22bc1461003b575063f851a4400361000e5761010d565b3461010a5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261010a5773ffffffffffffffffffffffffffffffffffffffff60043581811691828203610106577f0000000000000000000000000000000000000000000000000000000000000000163314600014610101577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b61023d565b8380fd5b80fd5b346101645760007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610164576020610146610169565b73ffffffffffffffffffffffffffffffffffffffff60405191168152f35b600080fd5b333003610101577f000000000000000000000000000000000000000000000000000000000000000090565b60ff7f68df44b1011761f481358c0f49a711192727fb02c377d697bcb0ea8ff8393ac0541615806101ef575b1561023d5760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b507f400ada75000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000006000351614156101c0565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546000808092368280378136915af43d82803e1561027a573d90f35b3d90fdfea2646970667358221220c7c26ff3040b96a28e96d6d27b743972943aeaef81cc821544c5fe1e24f9b17264736f6c63430008190033"

Defined inโ€‹

external/cow-sdk/src/cow-shed/proxyInitCode.ts:1


CURRENT_BLOCK_TIMESTAMP_FACTORY_ADDRESSโ€‹

โ€ข Const CURRENT_BLOCK_TIMESTAMP_FACTORY_ADDRESS: "0x52eD56Da04309Aca4c3FECC595298d80C2f16BAc"

The address of the CurrentBlockTimestampFactory contract

NOTE: This is used in the event that TWAP's have a t0 of 0.

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:26


DEFAULT_BACKOFF_OPTIONSโ€‹

โ€ข Const DEFAULT_BACKOFF_OPTIONS: BackoffOptions

The default backoff options for CoW Protocol's API

See

Backoff configuration: https://www.npmjs.com/package/@insertish/exponential-backoff

Defined inโ€‹

external/cow-sdk/src/order-book/request.ts:41


DEFAULT_CONDITIONAL_ORDER_REGISTRYโ€‹

โ€ข Const DEFAULT_CONDITIONAL_ORDER_REGISTRY: ConditionalOrderRegistry

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/index.ts:5


DEFAULT_COW_API_CONTEXTโ€‹

โ€ข Const DEFAULT_COW_API_CONTEXT: ApiContext

The default CoW Protocol API context.

Defined inโ€‹

external/cow-sdk/src/common/configs.ts:86


DEFAULT_IPFS_READ_URIโ€‹

โ€ข Const DEFAULT_IPFS_READ_URI: "https://gnosis.mypinata.cloud/ipfs"

Defined inโ€‹

external/cow-sdk/src/common/ipfs.ts:1


DEFAULT_IPFS_WRITE_URIโ€‹

โ€ข Const DEFAULT_IPFS_WRITE_URI: "https://api.pinata.cloud"

Defined inโ€‹

external/cow-sdk/src/common/ipfs.ts:2


DEFAULT_LIMITER_OPTIONSโ€‹

โ€ข Const DEFAULT_LIMITER_OPTIONS: RateLimiterOpts

The default rate limiter options for CoW Protocol's API.

CAUTION: The CoW Protocol OrderBook API is limited to 5 requests per second per IP.

Defined inโ€‹

external/cow-sdk/src/order-book/request.ts:59


DOMAIN_TYPEโ€‹

โ€ข Const DOMAIN_TYPE: Object

Type declarationโ€‹

NameType
EIP712Domain{ name: string = 'name'; type: string = 'string' }[]

Defined inโ€‹

external/cow-sdk/src/cow-shed/types.ts:21


ENVS_LISTโ€‹

โ€ข Const ENVS_LIST: CowEnv[]

The list of available environments.

Defined inโ€‹

external/cow-sdk/src/common/configs.ts:81


ETH_ADDRESSโ€‹

โ€ข Const ETH_ADDRESS: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:3


ETH_FLOW_ADDRESSESโ€‹

โ€ข Const ETH_FLOW_ADDRESSES: Record<SupportedChainId, string>

An object containing the addresses of ETH flow contracts for each supported chain.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:70


EXTENSIBLE_FALLBACK_HANDLERโ€‹

โ€ข Const EXTENSIBLE_FALLBACK_HANDLER: "0x2f55e8b20D0B9FEFA187AA7d00B6Cbe563605bF5"

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:4


EXTENSIBLE_FALLBACK_HANDLER_CONTRACT_ADDRESSโ€‹

โ€ข Const EXTENSIBLE_FALLBACK_HANDLER_CONTRACT_ADDRESS: Record<SupportedChainId, string>

An object containing the addresses of the ExtensibleFallbackHandler contracts for each supported chain.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:49


MAX_FREQUENCYโ€‹

โ€ข Const MAX_FREQUENCY: BigNumber

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:29


MAX_UINT32โ€‹

โ€ข Const MAX_UINT32: BigNumber

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:28


MAX_VALID_TO_EPOCHโ€‹

โ€ข Const MAX_VALID_TO_EPOCH: 4294967295

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:86


ORDER_BOOK_PROD_CONFIGโ€‹

โ€ข Const ORDER_BOOK_PROD_CONFIG: ApiBaseUrls

An object containing production environment base URLs for each supported chainId.

See

https://api.cow.fi/docs/#/

Defined inโ€‹

external/cow-sdk/src/order-book/api.ts:38


ORDER_BOOK_STAGING_CONFIGโ€‹

โ€ข Const ORDER_BOOK_STAGING_CONFIG: ApiBaseUrls

An object containing staging environment base URLs for each supported chainId.

Defined inโ€‹

external/cow-sdk/src/order-book/api.ts:49


ORDER_PRIMARY_TYPEโ€‹

โ€ข Const ORDER_PRIMARY_TYPE: "Order"

Defined inโ€‹

external/cow-sdk/src/trading/types.ts:20


SUBGRAPH_PROD_CONFIGโ€‹

โ€ข Const SUBGRAPH_PROD_CONFIG: SubgraphApiBaseUrls

CoW Protocol Production Subgraph API configuration.

See

Defined inโ€‹

external/cow-sdk/src/subgraph/api.ts:24


SUBGRAPH_STAGING_CONFIGโ€‹

โ€ข Const SUBGRAPH_STAGING_CONFIG: SubgraphApiBaseUrls

CoW Protocol Staging Subgraph API configuration.

Deprecated

See

Defined inโ€‹

external/cow-sdk/src/subgraph/api.ts:38


TWAP_ADDRESSโ€‹

โ€ข Const TWAP_ADDRESS: "0x6cF1e9cA41f7611dEf408122793c358a3d11E5a5"

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:20


WRAPPED_NATIVE_CURRENCIESโ€‹

โ€ข Const WRAPPED_NATIVE_CURRENCIES: Record<SupportedChainId, string>

An object containing the addresses of wrapped native currencies for each supported chain.

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:59


logPrefixโ€‹

โ€ข Const logPrefix: "cow-sdk:"

Defined inโ€‹

external/cow-sdk/src/common/cow-error.ts:10

Functionsโ€‹

DEFAULT_TOKEN_FORMATTERโ€‹

โ–ธ DEFAULT_TOKEN_FORMATTER(address, amount): string

Parametersโ€‹

NameType
addressstring
amountBigNumber

Returnsโ€‹

string

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:21


buildAppDataโ€‹

โ–ธ buildAppData(ยซdestructuredยป, advancedParams?): Promise<AppDataInfo>

Parametersโ€‹

NameType
ยซdestructuredยปBuildAppDataParams
advancedParams?Partial<Omit<AppDataRootSchema, "version">>

Returnsโ€‹

Promise<AppDataInfo>

Defined inโ€‹

external/cow-sdk/src/trading/appDataUtils.ts:5


calculateUniqueOrderIdโ€‹

โ–ธ calculateUniqueOrderId(chainId, order, checkEthFlowOrderExists?, env?): Promise<string>

Parametersโ€‹

NameType
chainIdSupportedChainId
orderUnsignedOrder
checkEthFlowOrderExists?EthFlowOrderExistsCallback
env?CowEnv

Returnsโ€‹

Promise<string>

Defined inโ€‹

external/cow-sdk/src/trading/calculateUniqueOrderId.ts:16


createSetDomainVerifierTxโ€‹

โ–ธ createSetDomainVerifierTx(domain, verifier): string

Parametersโ€‹

NameType
domainstring
verifierstring

Returnsโ€‹

string

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:44


decodeParamsโ€‹

โ–ธ decodeParams(encoded): ConditionalOrderParams

Decode the ConditionalOrderParams for the conditional order.

Parametersโ€‹

NameTypeDescription
encodedstringThe encoded conditional order.

Returnsโ€‹

ConditionalOrderParams

The decoded conditional order.

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:68


encodeParamsโ€‹

โ–ธ encodeParams(params): string

Encode the ConditionalOrderParams for the conditional order.

Parametersโ€‹

NameTypeDescription
paramsConditionalOrderParamsThe ConditionalOrderParams struct representing the conditional order as taken from a merkle tree.

Returnsโ€‹

string

The ABI-encoded conditional order.

See

ConditionalOrderParams

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:58


formatEpochโ€‹

โ–ธ formatEpoch(epoch): string

Parametersโ€‹

NameType
epochnumber

Returnsโ€‹

string

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:97


fromStructToOrderโ€‹

โ–ธ fromStructToOrder(order): Order

Parametersโ€‹

NameType
orderDataStruct

Returnsโ€‹

Order

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:135


generateAppDataFromDocโ€‹

โ–ธ generateAppDataFromDoc(doc): Promise<Pick<AppDataInfo, "fullAppData" | "appDataKeccak256">>

Parametersโ€‹

NameType
docAppDataRootSchema

Returnsโ€‹

Promise<Pick<AppDataInfo, "fullAppData" | "appDataKeccak256">>

Defined inโ€‹

external/cow-sdk/src/trading/appDataUtils.ts:28


getBlockInfoโ€‹

โ–ธ getBlockInfo(provider): Promise<BlockInfo>

Parametersโ€‹

NameType
providerProvider

Returnsโ€‹

Promise<BlockInfo>

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:88


getCoWShedFactoryInterfaceโ€‹

โ–ธ getCoWShedFactoryInterface(): CoWShedFactoryInterface

Returnsโ€‹

CoWShedFactoryInterface

Defined inโ€‹

external/cow-sdk/src/cow-shed/contracts.ts:16


getCoWShedInterfaceโ€‹

โ–ธ getCoWShedInterface(): CoWShedInterface

Returnsโ€‹

CoWShedInterface

Defined inโ€‹

external/cow-sdk/src/cow-shed/contracts.ts:8


getDomainVerifierโ€‹

โ–ธ getDomainVerifier(safe, domain, chainId, provider): Promise<string>

Parametersโ€‹

NameType
safestring
domainstring
chainIdSupportedChainId
providerProvider

Returnsโ€‹

Promise<string>

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:31


getEthFlowTransactionโ€‹

โ–ธ getEthFlowTransaction(signer, appDataKeccak256, _params, networkCostsAmount?, checkEthFlowOrderExists?): Promise<{ orderId: string ; transaction: TransactionParams }>

Parametersโ€‹

NameTypeDefault value
signerSignerundefined
appDataKeccak256stringundefined
_paramsLimitTradeParametersFromQuoteundefined
networkCostsAmountstring'0'
checkEthFlowOrderExists?EthFlowOrderExistsCallbackundefined

Returnsโ€‹

Promise<{ orderId: string ; transaction: TransactionParams }>

Defined inโ€‹

external/cow-sdk/src/trading/getEthFlowTransaction.ts:17


getOrderToSignโ€‹

โ–ธ getOrderToSign(ยซdestructuredยป, limitOrderParams, appDataKeccak256): UnsignedOrder

Parametersโ€‹

NameType
ยซdestructuredยปOrderToSignParams
limitOrderParamsLimitTradeParameters
appDataKeccak256string

Returnsโ€‹

UnsignedOrder

Defined inโ€‹

external/cow-sdk/src/trading/getOrderToSign.ts:11


getPreSignTransactionโ€‹

โ–ธ getPreSignTransaction(signer, chainId, account, orderId): Promise<TransactionParams>

Parametersโ€‹

NameType
signerSigner
chainIdSupportedChainId
accountstring
orderIdstring

Returnsโ€‹

Promise<TransactionParams>

Defined inโ€‹

external/cow-sdk/src/trading/getPreSignTransaction.ts:9


getQuoteโ€‹

โ–ธ getQuote(_tradeParameters, trader, advancedSettings?, _orderBookApi?): Promise<{ orderBookApi: OrderBookApi ; result: QuoteResults }>

Parametersโ€‹

NameType
_tradeParametersTradeParameters
traderQuoterParameters
advancedSettings?SwapAdvancedSettings
_orderBookApi?OrderBookApi

Returnsโ€‹

Promise<{ orderBookApi: OrderBookApi ; result: QuoteResults }>

Defined inโ€‹

external/cow-sdk/src/trading/getQuote.ts:39


getQuoteAmountsAndCostsโ€‹

โ–ธ getQuoteAmountsAndCosts(params): QuoteAmountsAndCosts

Parametersโ€‹

NameType
paramsParams

Returnsโ€‹

QuoteAmountsAndCosts

Defined inโ€‹

external/cow-sdk/src/order-book/quoteAmountsAndCostsUtils.ts:14


getQuoteWithSignerโ€‹

โ–ธ getQuoteWithSigner(swapParameters, advancedSettings?, orderBookApi?): Promise<QuoteResultsWithSigner>

Parametersโ€‹

NameType
swapParametersSwapParameters
advancedSettings?SwapAdvancedSettings
orderBookApi?OrderBookApi

Returnsโ€‹

Promise<QuoteResultsWithSigner>

Defined inโ€‹

external/cow-sdk/src/trading/getQuote.ts:139


isComposableCowโ€‹

โ–ธ isComposableCow(handler, chainId): boolean

Parametersโ€‹

NameType
handlerstring
chainIdSupportedChainId

Returnsโ€‹

boolean

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:27


isExtensibleFallbackHandlerโ€‹

โ–ธ isExtensibleFallbackHandler(handler, chainId): boolean

Parametersโ€‹

NameType
handlerstring
chainIdSupportedChainId

Returnsโ€‹

boolean

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:23


isValidAbiโ€‹

โ–ธ isValidAbi(types, values): boolean

Helper method for validating ABI types.

Parametersโ€‹

NameTypeDescription
typesreadonly (string | ParamType)[]ABI types to validate against.
valuesany[]The values to validate.

Returnsโ€‹

boolean

Whether the values are valid ABI for the given types.

Defined inโ€‹

external/cow-sdk/src/composable/utils.ts:79


mapAddressToSupportedNetworksโ€‹

โ–ธ mapAddressToSupportedNetworks(address): Record<SupportedChainId, string>

Parametersโ€‹

NameType
addressstring

Returnsโ€‹

Record<SupportedChainId, string>

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:32


mapQuoteAmountsAndCostsโ€‹

โ–ธ mapQuoteAmountsAndCosts<T, R>(value, mapper): QuoteAmountsAndCosts<R>

Type parametersโ€‹

Name
T
R

Parametersโ€‹

NameType
valueQuoteAmountsAndCosts<T, { buyAmount: T ; sellAmount: T }>
mapper(value: T) => R

Returnsโ€‹

QuoteAmountsAndCosts<R>

Defined inโ€‹

external/cow-sdk/src/trading/utils.ts:44


mapSupportedNetworksโ€‹

โ–ธ mapSupportedNetworks<T>(value): Record<SupportedChainId, T>

Type parametersโ€‹

Name
T

Parametersโ€‹

NameType
value(chainId: SupportedChainId) => T

Returnsโ€‹

Record<SupportedChainId, T>

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:20

โ–ธ mapSupportedNetworks<T>(value): Record<SupportedChainId, T>

Type parametersโ€‹

Name
T

Parametersโ€‹

NameType
valueT

Returnsโ€‹

Record<SupportedChainId, T>

Defined inโ€‹

external/cow-sdk/src/common/consts.ts:21


postCoWProtocolTradeโ€‹

โ–ธ postCoWProtocolTrade(orderBookApi, signer, appData, params, networkCostsAmount?): Promise<string>

Parametersโ€‹

NameTypeDefault value
orderBookApiOrderBookApiundefined
signerSignerundefined
appDataAppDataInfoundefined
paramsLimitTradeParametersundefined
networkCostsAmountstring'0'

Returnsโ€‹

Promise<string>

Defined inโ€‹

external/cow-sdk/src/trading/postCoWProtocolTrade.ts:10


postLimitOrderโ€‹

โ–ธ postLimitOrder(params, advancedSettings?, _orderBookApi?): Promise<string>

Parametersโ€‹

NameType
paramsLimitOrderParameters
advancedSettings?LimitOrderAdvancedSettings
_orderBookApi?OrderBookApi

Returnsโ€‹

Promise<string>

Defined inโ€‹

external/cow-sdk/src/trading/postLimitOrder.ts:8


postSellNativeCurrencyOrderโ€‹

โ–ธ postSellNativeCurrencyOrder(orderBookApi, signer, appData, _params, networkCostsAmount?, checkEthFlowOrderExists?): Promise<{ orderId: string ; txHash: string }>

Parametersโ€‹

NameTypeDefault value
orderBookApiOrderBookApiundefined
signerSignerundefined
appDataPick<AppDataInfo, "fullAppData" | "appDataKeccak256">undefined
_paramsLimitTradeParametersFromQuoteundefined
networkCostsAmountstring'0'
checkEthFlowOrderExists?EthFlowOrderExistsCallbackundefined

Returnsโ€‹

Promise<{ orderId: string ; txHash: string }>

Defined inโ€‹

external/cow-sdk/src/trading/postSellNativeCurrencyOrder.ts:9


postSwapOrderโ€‹

โ–ธ postSwapOrder(params, advancedSettings?): Promise<string>

Parametersโ€‹

NameType
paramsSwapParameters
advancedSettings?SwapAdvancedSettings

Returnsโ€‹

Promise<string>

Defined inโ€‹

external/cow-sdk/src/trading/postSwapOrder.ts:7


postSwapOrderFromQuoteโ€‹

โ–ธ postSwapOrderFromQuote(ยซdestructuredยป): Promise<string>

Parametersโ€‹

NameType
ยซdestructuredยปQuoteResultsWithSigner

Returnsโ€‹

Promise<string>

Defined inโ€‹

external/cow-sdk/src/trading/postSwapOrder.ts:11


requestโ€‹

โ–ธ request<T>(baseUrl, ยซdestructuredยป, rateLimiter, backoffOpts): Promise<T>

Helper function to make a rate-limited request to an API.

Type parametersโ€‹

Name
T

Parametersโ€‹

NameTypeDescription
baseUrlstringThe base URL of the API.
ยซdestructuredยปFetchParams-
rateLimiterRateLimiterThe rate limiter to use.
backoffOptsPartial<IBackOffOptions>The backoff options to use.

Returnsโ€‹

Promise<T>

The response of the request.

Throws

If the API returns an error or if the request fails.

Defined inโ€‹

external/cow-sdk/src/order-book/request.ts:104


swapParamsToLimitOrderParamsโ€‹

โ–ธ swapParamsToLimitOrderParams(params, quoteId, amounts): LimitTradeParametersFromQuote

Parametersโ€‹

NameType
paramsTradeParameters
quoteIdnumber
amountsQuoteAmountsAndCosts<bigint, { buyAmount: bigint ; sellAmount: bigint }>

Returnsโ€‹

LimitTradeParametersFromQuote

Defined inโ€‹

external/cow-sdk/src/trading/utils.ts:7


transformDataToStructโ€‹

โ–ธ transformDataToStruct(data): TwapStruct

Transform parameters into a native struct.

Parametersโ€‹

NameTypeDescription
dataTwapDataAs passed by the consumer of the API.

Returnsโ€‹

TwapStruct

A formatted struct as expected by the smart contract.

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:538


transformStructToDataโ€‹

โ–ธ transformStructToData(struct): TwapData

Transform parameters into a TWAP order struct.

Parametersโ€‹

NameType
structTwapStruct

Returnsโ€‹

TwapData

A formatted struct as expected by the smart contract.

Defined inโ€‹

external/cow-sdk/src/composable/orderTypes/Twap.ts:580