From e5bedeae0043253d5586cfa6d3e76d7a4e1aaf58 Mon Sep 17 00:00:00 2001 From: Leandro Date: Wed, 6 Mar 2024 16:05:41 +0000 Subject: [PATCH] feat: update orderbook api types (#201) * feat: update to latest services release * chore: graphql build updates --- package.json | 2 +- src/order-book/generated/index.ts | 1 - .../generated/models/OrderPostError.ts | 3 +- .../generated/models/ReplaceOrderError.ts | 36 ------------------- src/subgraph/graphql.ts | 7 ++++ 5 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 src/order-book/generated/models/ReplaceOrderError.ts diff --git a/package.json b/package.json index 8e45f438..abf9b7f9 100644 --- a/package.json +++ b/package.json @@ -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/v2.245.1/crates/orderbook/openapi.yml --output src/order-book/generated --exportServices false --exportCore false", + "swagger:codegen": " openapi --input https://raw.githubusercontent.com/cowprotocol/services/v2.248.0/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": { diff --git a/src/order-book/generated/index.ts b/src/order-book/generated/index.ts index 2e2f79d9..51873a33 100644 --- a/src/order-book/generated/index.ts +++ b/src/order-book/generated/index.ts @@ -41,7 +41,6 @@ export type { PreSignature } from './models/PreSignature'; export { PriceEstimationError } from './models/PriceEstimationError'; export { PriceQuality } from './models/PriceQuality'; export type { ProtocolAppData } from './models/ProtocolAppData'; -export { ReplaceOrderError } from './models/ReplaceOrderError'; export { SellTokenSource } from './models/SellTokenSource'; export type { Signature } from './models/Signature'; export { SigningScheme } from './models/SigningScheme'; diff --git a/src/order-book/generated/models/OrderPostError.ts b/src/order-book/generated/models/OrderPostError.ts index 64e48dea..0567bbfb 100644 --- a/src/order-book/generated/models/OrderPostError.ts +++ b/src/order-book/generated/models/OrderPostError.ts @@ -24,7 +24,8 @@ export namespace OrderPostError { TRANSFER_SIMULATION_FAILED = 'TransferSimulationFailed', ZERO_AMOUNT = 'ZeroAmount', INCOMPATIBLE_SIGNING_SCHEME = 'IncompatibleSigningScheme', - TOO_MANY_LIMIT_ORDERS_UNSUPPORTED_BUY_TOKEN_DESTINATION = 'TooManyLimitOrders UnsupportedBuyTokenDestination', + TOO_MANY_LIMIT_ORDERS = 'TooManyLimitOrders', + UNSUPPORTED_BUY_TOKEN_DESTINATION = 'UnsupportedBuyTokenDestination', UNSUPPORTED_SELL_TOKEN_SOURCE = 'UnsupportedSellTokenSource', UNSUPPORTED_ORDER_TYPE = 'UnsupportedOrderType', INSUFFICIENT_VALID_TO = 'InsufficientValidTo', diff --git a/src/order-book/generated/models/ReplaceOrderError.ts b/src/order-book/generated/models/ReplaceOrderError.ts deleted file mode 100644 index 0a48f995..00000000 --- a/src/order-book/generated/models/ReplaceOrderError.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ - -export type ReplaceOrderError = { - errorType: ReplaceOrderError.errorType; - description: string; -}; - -export namespace ReplaceOrderError { - - export enum errorType { - ALREADY_CANCELLED = 'AlreadyCancelled', - ORDER_FULLY_EXECUTED = 'OrderFullyExecuted', - ORDER_EXPIRED = 'OrderExpired', - ON_CHAIN_ORDER = 'OnChainOrder', - DUPLICATED_ORDER = 'DuplicatedOrder', - INSUFFICIENT_FEE = 'InsufficientFee', - INSUFFICIENT_ALLOWANCE = 'InsufficientAllowance', - INSUFFICIENT_BALANCE = 'InsufficientBalance', - INSUFFICIENT_VALID_TO = 'InsufficientValidTo', - EXCESSIVE_VALID_TO = 'ExcessiveValidTo', - INVALID_SIGNATURE = 'InvalidSignature', - TRANSFER_SIMULATION_FAILED = 'TransferSimulationFailed', - UNSUPPORTED_TOKEN = 'UnsupportedToken', - WRONG_OWNER = 'WrongOwner', - SAME_BUY_AND_SELL_TOKEN = 'SameBuyAndSellToken', - ZERO_AMOUNT = 'ZeroAmount', - UNSUPPORTED_BUY_TOKEN_DESTINATION = 'UnsupportedBuyTokenDestination', - UNSUPPORTED_SELL_TOKEN_SOURCE = 'UnsupportedSellTokenSource', - UNSUPPORTED_ORDER_TYPE = 'UnsupportedOrderType', - } - - -} - diff --git a/src/subgraph/graphql.ts b/src/subgraph/graphql.ts index df4ecbfc..0f27e48b 100644 --- a/src/subgraph/graphql.ts +++ b/src/subgraph/graphql.ts @@ -16,6 +16,11 @@ export type Scalars = { Int8: any; }; +export enum Aggregation_Interval { + Day = 'day', + Hour = 'hour' +} + export type BlockChangedFilter = { number_gte: Scalars['Int']; }; @@ -3337,6 +3342,8 @@ export type _Block_ = { hash?: Maybe; /** The block number */ number: Scalars['Int']; + /** The hash of the parent block */ + parentHash?: Maybe; /** Integer representation of the timestamp stored in blocks for the chain */ timestamp?: Maybe; };