diff --git a/package.json b/package.json index a356575..7529b5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cowprotocol/cow-sdk", - "version": "5.3.3", + "version": "5.4.0", "license": "(MIT OR Apache-2.0)", "files": [ "/dist" @@ -27,7 +27,7 @@ "prepare": "npm run build", "prepublishOnly": "npm test && npm run lint", "graphql:codegen": "graphql-codegen --config graphql-codegen.yml", - "swagger:codegen": " openapi --input https://raw.githubusercontent.com/cowprotocol/services/varbitrum/crates/orderbook/openapi.yml --output src/order-book/generated --exportServices false --exportCore false", + "swagger:codegen": " openapi --input https://raw.githubusercontent.com/cowprotocol/services/d8964a5751e8d2077c2db1502c2b429f5c6b50a4/crates/orderbook/openapi.yml --output src/order-book/generated --exportServices false --exportCore false", "typechain:codegen": "typechain --target ethers-v5 --out-dir ./src/composable/generated './abi/*.json'" }, "dependencies": { @@ -100,4 +100,4 @@ "typescript", "subgraph" ] -} +} \ No newline at end of file diff --git a/src/order-book/api.ts b/src/order-book/api.ts index 80ab75f..bf2e457 100644 --- a/src/order-book/api.ts +++ b/src/order-book/api.ts @@ -14,6 +14,7 @@ import { Address, AppDataHash, AppDataObject, + CompetitionOrderStatus, NativePriceResponse, Order, OrderCancellations, @@ -227,6 +228,13 @@ export class OrderBookApi { }) } + /** + * Get the order status while open + */ + getOrderCompetitionStatus(orderUid: UID, contextOverride: PartialApiContext = {}): Promise { + return this.fetch({ path: `/api/v1/orders/${orderUid}/status`, method: 'GET' }, contextOverride) + } + /** * Attempt to get an order by its unique identifier, `orderUid`, from multiple environments. * diff --git a/src/order-book/generated/index.ts b/src/order-book/generated/index.ts index c250c21..578a536 100644 --- a/src/order-book/generated/index.ts +++ b/src/order-book/generated/index.ts @@ -13,9 +13,11 @@ export type { BigUint } from './models/BigUint'; export { BuyTokenDestination } from './models/BuyTokenDestination'; export type { CallData } from './models/CallData'; export type { CompetitionAuction } from './models/CompetitionAuction'; +export { CompetitionOrderStatus } from './models/CompetitionOrderStatus'; export type { EcdsaSignature } from './models/EcdsaSignature'; export { EcdsaSigningScheme } from './models/EcdsaSigningScheme'; export type { EthflowData } from './models/EthflowData'; +export type { ExecutedAmounts } from './models/ExecutedAmounts'; export type { FeePolicy } from './models/FeePolicy'; export type { InteractionData } from './models/InteractionData'; export type { NativePriceResponse } from './models/NativePriceResponse'; diff --git a/src/order-book/generated/models/Auction.ts b/src/order-book/generated/models/Auction.ts index e672eed..d7ed91e 100644 --- a/src/order-book/generated/models/Auction.ts +++ b/src/order-book/generated/models/Auction.ts @@ -2,6 +2,7 @@ /* tslint:disable */ /* eslint-disable */ +import type { Address } from './Address'; import type { AuctionOrder } from './AuctionOrder'; import type { AuctionPrices } from './AuctionPrices'; @@ -35,5 +36,10 @@ export type Auction = { */ orders?: Array; prices?: AuctionPrices; + /** + * List of addresses on whose surplus will count towards the objective value of their solution (unlike other orders that were created by the solver). + * + */ + surplusCapturingJitOrderOwners?: Array
; }; diff --git a/src/order-book/generated/models/CompetitionOrderStatus.ts b/src/order-book/generated/models/CompetitionOrderStatus.ts new file mode 100644 index 0000000..df30e16 --- /dev/null +++ b/src/order-book/generated/models/CompetitionOrderStatus.ts @@ -0,0 +1,36 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ExecutedAmounts } from './ExecutedAmounts'; + +export type CompetitionOrderStatus = { + type: CompetitionOrderStatus.type; + /** + * A list of solvers who participated in the latest competition. The presence of executed amounts defines whether the solver provided a solution for the desired order. + * + */ + value?: Array<{ + /** + * Name of the solver. + */ + solver: string; + executedAmounts?: ExecutedAmounts; + }>; +}; + +export namespace CompetitionOrderStatus { + + export enum type { + OPEN = 'Open', + SCHEDULED = 'Scheduled', + ACTIVE = 'Active', + SOLVED = 'Solved', + EXECUTING = 'Executing', + TRADED = 'Traded', + CANCELLED = 'Cancelled', + } + + +} + diff --git a/src/order-book/generated/models/ExecutedAmounts.ts b/src/order-book/generated/models/ExecutedAmounts.ts new file mode 100644 index 0000000..75b1f87 --- /dev/null +++ b/src/order-book/generated/models/ExecutedAmounts.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { BigUint } from './BigUint'; + +export type ExecutedAmounts = { + sell: BigUint; + buy: BigUint; +}; + diff --git a/src/order-book/generated/models/OrderPostError.ts b/src/order-book/generated/models/OrderPostError.ts index 08cde42..ca600db 100644 --- a/src/order-book/generated/models/OrderPostError.ts +++ b/src/order-book/generated/models/OrderPostError.ts @@ -12,6 +12,7 @@ export namespace OrderPostError { export enum errorType { DUPLICATED_ORDER = 'DuplicatedOrder', QUOTE_NOT_FOUND = 'QuoteNotFound', + QUOTE_NOT_VERIFIED = 'QuoteNotVerified', INVALID_QUOTE = 'InvalidQuote', MISSING_FROM = 'MissingFrom', WRONG_OWNER = 'WrongOwner', diff --git a/src/order-book/generated/models/PriceEstimationError.ts b/src/order-book/generated/models/PriceEstimationError.ts index 0566edc..c084a7d 100644 --- a/src/order-book/generated/models/PriceEstimationError.ts +++ b/src/order-book/generated/models/PriceEstimationError.ts @@ -10,6 +10,7 @@ export type PriceEstimationError = { export namespace PriceEstimationError { export enum errorType { + QUOTE_NOT_VERIFIED = 'QuoteNotVerified', UNSUPPORTED_TOKEN = 'UnsupportedToken', ZERO_AMOUNT = 'ZeroAmount', UNSUPPORTED_ORDER_TYPE = 'UnsupportedOrderType', diff --git a/src/order-book/generated/models/Trade.ts b/src/order-book/generated/models/Trade.ts index 279fa82..3c37661 100644 --- a/src/order-book/generated/models/Trade.ts +++ b/src/order-book/generated/models/Trade.ts @@ -4,6 +4,7 @@ import type { Address } from './Address'; import type { BigUint } from './BigUint'; +import type { FeePolicy } from './FeePolicy'; import type { TokenAmount } from './TokenAmount'; import type { TransactionHash } from './TransactionHash'; import type { UID } from './UID'; @@ -53,5 +54,10 @@ export type Trade = { * Transaction hash of the corresponding settlement transaction containing the trade (if available). */ txHash: TransactionHash | null; + /** + * The fee policies that were used to compute the fees for this trade. Listed in the order they got applied. + * + */ + feePolicies?: Array; };