@cowprotocol/cow-sdk 2.0.0-alpha.1 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/chains.d.ts +5 -5
- package/dist/common/configs.d.ts +17 -17
- package/dist/common/cow-error.d.ts +5 -5
- package/dist/common/index.d.ts +4 -0
- package/dist/common/ipfs.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +29 -0
- package/dist/index.modern.mjs.map +1 -0
- package/dist/index.module.js +29 -0
- package/dist/index.module.js.map +1 -0
- package/dist/metadata/api.d.ts +42 -56
- package/dist/metadata/index.d.ts +2 -2
- package/dist/metadata/types.d.ts +22 -22
- package/dist/metadata/utils/appData.d.ts +3 -3
- package/dist/metadata/utils/ipfs.d.ts +16 -16
- package/dist/order-book/api.d.ts +31 -31
- package/dist/order-book/generated/OrderBookClient.d.ts +10 -10
- package/dist/order-book/generated/core/ApiError.d.ts +10 -10
- package/dist/order-book/generated/core/ApiRequestOptions.d.ts +13 -13
- package/dist/order-book/generated/core/ApiResult.d.ts +7 -7
- package/dist/order-book/generated/core/BaseHttpRequest.d.ts +8 -8
- package/dist/order-book/generated/core/CancelablePromise.d.ts +26 -26
- package/dist/order-book/generated/core/FetchHttpRequest.d.ts +14 -14
- package/dist/order-book/generated/core/OpenAPI.d.ts +16 -16
- package/dist/order-book/generated/core/request.d.ts +13 -13
- package/dist/order-book/generated/index.d.ts +50 -50
- package/dist/order-book/generated/models/Address.d.ts +4 -4
- package/dist/order-book/generated/models/AmountEstimate.d.ts +16 -16
- package/dist/order-book/generated/models/AppData.d.ts +4 -4
- package/dist/order-book/generated/models/Auction.d.ts +40 -40
- package/dist/order-book/generated/models/BigUint.d.ts +4 -4
- package/dist/order-book/generated/models/BuyTokenDestination.d.ts +7 -7
- package/dist/order-book/generated/models/EcdsaSignature.d.ts +4 -4
- package/dist/order-book/generated/models/EcdsaSigningScheme.d.ts +7 -7
- package/dist/order-book/generated/models/EthflowData.d.ts +20 -20
- package/dist/order-book/generated/models/FeeAndQuoteBuyResponse.d.ts +9 -9
- package/dist/order-book/generated/models/FeeAndQuoteError.d.ts +12 -12
- package/dist/order-book/generated/models/FeeAndQuoteSellResponse.d.ts +9 -9
- package/dist/order-book/generated/models/FeeInformation.d.ts +17 -17
- package/dist/order-book/generated/models/NativePriceResponse.d.ts +10 -10
- package/dist/order-book/generated/models/OnchainOrderData.d.ts +30 -30
- package/dist/order-book/generated/models/Order.d.ts +3 -3
- package/dist/order-book/generated/models/OrderCancellation.d.ts +13 -13
- package/dist/order-book/generated/models/OrderCancellationError.d.ts +15 -15
- package/dist/order-book/generated/models/OrderCancellations.d.ts +18 -18
- package/dist/order-book/generated/models/OrderClass.d.ts +8 -8
- package/dist/order-book/generated/models/OrderCreation.d.ts +25 -25
- package/dist/order-book/generated/models/OrderKind.d.ts +7 -7
- package/dist/order-book/generated/models/OrderMetaData.d.ts +86 -86
- package/dist/order-book/generated/models/OrderParameters.d.ts +60 -60
- package/dist/order-book/generated/models/OrderPostError.d.ts +27 -27
- package/dist/order-book/generated/models/OrderQuoteRequest.d.ts +47 -47
- package/dist/order-book/generated/models/OrderQuoteResponse.d.ts +23 -23
- package/dist/order-book/generated/models/OrderQuoteSide.d.ts +30 -30
- package/dist/order-book/generated/models/OrderQuoteValidity.d.ts +14 -14
- package/dist/order-book/generated/models/OrderStatus.d.ts +10 -10
- package/dist/order-book/generated/models/PreSignature.d.ts +4 -4
- package/dist/order-book/generated/models/PriceQuality.d.ts +9 -9
- package/dist/order-book/generated/models/ReplaceOrderError.d.ts +29 -29
- package/dist/order-book/generated/models/SellTokenSource.d.ts +8 -8
- package/dist/order-book/generated/models/Signature.d.ts +6 -6
- package/dist/order-book/generated/models/SigningScheme.d.ts +9 -9
- package/dist/order-book/generated/models/SolverCompetitionResponse.d.ts +28 -28
- package/dist/order-book/generated/models/SolverSettlement.d.ts +34 -34
- package/dist/order-book/generated/models/TokenAmount.d.ts +4 -4
- package/dist/order-book/generated/models/Trade.d.ts +51 -51
- package/dist/order-book/generated/models/TransactionHash.d.ts +4 -4
- package/dist/order-book/generated/models/UID.d.ts +7 -7
- package/dist/order-book/generated/models/VersionResponse.d.ts +18 -18
- package/dist/order-book/generated/services/DefaultService.d.ts +164 -164
- package/dist/order-book/index.d.ts +3 -3
- package/dist/order-book/transformOrder.d.ts +3 -3
- package/dist/order-book/types.d.ts +4 -4
- package/dist/package.json +12 -5
- package/dist/subgraph/api.d.ts +18 -18
- package/dist/subgraph/graphql.d.ts +3195 -3195
- package/dist/subgraph/index.d.ts +1 -1
- package/dist/subgraph/queries.d.ts +3 -3
- package/package.json +12 -5
- package/dist/common/chains.js +0 -10
- package/dist/common/chains.js.map +0 -1
- package/dist/common/configs.js +0 -7
- package/dist/common/configs.js.map +0 -1
- package/dist/common/cow-error.js +0 -12
- package/dist/common/cow-error.js.map +0 -1
- package/dist/common/ipfs.js +0 -6
- package/dist/common/ipfs.js.map +0 -1
- package/dist/metadata/api.js +0 -149
- package/dist/metadata/api.js.map +0 -1
- package/dist/metadata/index.js +0 -6
- package/dist/metadata/index.js.map +0 -1
- package/dist/metadata/types.js +0 -3
- package/dist/metadata/types.js.map +0 -1
- package/dist/metadata/utils/appData.js +0 -36
- package/dist/metadata/utils/appData.js.map +0 -1
- package/dist/metadata/utils/ipfs.js +0 -45
- package/dist/metadata/utils/ipfs.js.map +0 -1
- package/dist/order-book/api.js +0 -127
- package/dist/order-book/api.js.map +0 -1
- package/dist/order-book/generated/OrderBookClient.js +0 -24
- package/dist/order-book/generated/OrderBookClient.js.map +0 -1
- package/dist/order-book/generated/core/ApiError.js +0 -16
- package/dist/order-book/generated/core/ApiError.js.map +0 -1
- package/dist/order-book/generated/core/ApiRequestOptions.js +0 -3
- package/dist/order-book/generated/core/ApiRequestOptions.js.map +0 -1
- package/dist/order-book/generated/core/ApiResult.js +0 -3
- package/dist/order-book/generated/core/ApiResult.js.map +0 -1
- package/dist/order-book/generated/core/BaseHttpRequest.js +0 -10
- package/dist/order-book/generated/core/BaseHttpRequest.js.map +0 -1
- package/dist/order-book/generated/core/CancelablePromise.js +0 -95
- package/dist/order-book/generated/core/CancelablePromise.js.map +0 -1
- package/dist/order-book/generated/core/FetchHttpRequest.js +0 -21
- package/dist/order-book/generated/core/FetchHttpRequest.js.map +0 -1
- package/dist/order-book/generated/core/OpenAPI.js +0 -15
- package/dist/order-book/generated/core/OpenAPI.js.map +0 -1
- package/dist/order-book/generated/core/request.js +0 -254
- package/dist/order-book/generated/core/request.js.map +0 -1
- package/dist/order-book/generated/index.js +0 -48
- package/dist/order-book/generated/index.js.map +0 -1
- package/dist/order-book/generated/models/Address.js +0 -6
- package/dist/order-book/generated/models/Address.js.map +0 -1
- package/dist/order-book/generated/models/AmountEstimate.js +0 -6
- package/dist/order-book/generated/models/AmountEstimate.js.map +0 -1
- package/dist/order-book/generated/models/AppData.js +0 -6
- package/dist/order-book/generated/models/AppData.js.map +0 -1
- package/dist/order-book/generated/models/Auction.js +0 -6
- package/dist/order-book/generated/models/Auction.js.map +0 -1
- package/dist/order-book/generated/models/BigUint.js +0 -6
- package/dist/order-book/generated/models/BigUint.js.map +0 -1
- package/dist/order-book/generated/models/BuyTokenDestination.js +0 -15
- package/dist/order-book/generated/models/BuyTokenDestination.js.map +0 -1
- package/dist/order-book/generated/models/EcdsaSignature.js +0 -6
- package/dist/order-book/generated/models/EcdsaSignature.js.map +0 -1
- package/dist/order-book/generated/models/EcdsaSigningScheme.js +0 -15
- package/dist/order-book/generated/models/EcdsaSigningScheme.js.map +0 -1
- package/dist/order-book/generated/models/EthflowData.js +0 -6
- package/dist/order-book/generated/models/EthflowData.js.map +0 -1
- package/dist/order-book/generated/models/FeeAndQuoteBuyResponse.js +0 -6
- package/dist/order-book/generated/models/FeeAndQuoteBuyResponse.js.map +0 -1
- package/dist/order-book/generated/models/FeeAndQuoteError.js +0 -17
- package/dist/order-book/generated/models/FeeAndQuoteError.js.map +0 -1
- package/dist/order-book/generated/models/FeeAndQuoteSellResponse.js +0 -6
- package/dist/order-book/generated/models/FeeAndQuoteSellResponse.js.map +0 -1
- package/dist/order-book/generated/models/FeeInformation.js +0 -6
- package/dist/order-book/generated/models/FeeInformation.js.map +0 -1
- package/dist/order-book/generated/models/NativePriceResponse.js +0 -6
- package/dist/order-book/generated/models/NativePriceResponse.js.map +0 -1
- package/dist/order-book/generated/models/OnchainOrderData.js +0 -22
- package/dist/order-book/generated/models/OnchainOrderData.js.map +0 -1
- package/dist/order-book/generated/models/Order.js +0 -6
- package/dist/order-book/generated/models/Order.js.map +0 -1
- package/dist/order-book/generated/models/OrderCancellation.js +0 -6
- package/dist/order-book/generated/models/OrderCancellation.js.map +0 -1
- package/dist/order-book/generated/models/OrderCancellationError.js +0 -20
- package/dist/order-book/generated/models/OrderCancellationError.js.map +0 -1
- package/dist/order-book/generated/models/OrderCancellations.js +0 -6
- package/dist/order-book/generated/models/OrderCancellations.js.map +0 -1
- package/dist/order-book/generated/models/OrderClass.js +0 -16
- package/dist/order-book/generated/models/OrderClass.js.map +0 -1
- package/dist/order-book/generated/models/OrderCreation.js +0 -6
- package/dist/order-book/generated/models/OrderCreation.js.map +0 -1
- package/dist/order-book/generated/models/OrderKind.js +0 -15
- package/dist/order-book/generated/models/OrderKind.js.map +0 -1
- package/dist/order-book/generated/models/OrderMetaData.js +0 -6
- package/dist/order-book/generated/models/OrderMetaData.js.map +0 -1
- package/dist/order-book/generated/models/OrderParameters.js +0 -6
- package/dist/order-book/generated/models/OrderParameters.js.map +0 -1
- package/dist/order-book/generated/models/OrderPostError.js +0 -32
- package/dist/order-book/generated/models/OrderPostError.js.map +0 -1
- package/dist/order-book/generated/models/OrderQuoteRequest.js +0 -6
- package/dist/order-book/generated/models/OrderQuoteRequest.js.map +0 -1
- package/dist/order-book/generated/models/OrderQuoteResponse.js +0 -6
- package/dist/order-book/generated/models/OrderQuoteResponse.js.map +0 -1
- package/dist/order-book/generated/models/OrderQuoteSide.js +0 -14
- package/dist/order-book/generated/models/OrderQuoteSide.js.map +0 -1
- package/dist/order-book/generated/models/OrderQuoteValidity.js +0 -6
- package/dist/order-book/generated/models/OrderQuoteValidity.js.map +0 -1
- package/dist/order-book/generated/models/OrderStatus.js +0 -18
- package/dist/order-book/generated/models/OrderStatus.js.map +0 -1
- package/dist/order-book/generated/models/PreSignature.js +0 -6
- package/dist/order-book/generated/models/PreSignature.js.map +0 -1
- package/dist/order-book/generated/models/PriceQuality.js +0 -17
- package/dist/order-book/generated/models/PriceQuality.js.map +0 -1
- package/dist/order-book/generated/models/ReplaceOrderError.js +0 -34
- package/dist/order-book/generated/models/ReplaceOrderError.js.map +0 -1
- package/dist/order-book/generated/models/SellTokenSource.js +0 -16
- package/dist/order-book/generated/models/SellTokenSource.js.map +0 -1
- package/dist/order-book/generated/models/Signature.js +0 -6
- package/dist/order-book/generated/models/Signature.js.map +0 -1
- package/dist/order-book/generated/models/SigningScheme.js +0 -17
- package/dist/order-book/generated/models/SigningScheme.js.map +0 -1
- package/dist/order-book/generated/models/SolverCompetitionResponse.js +0 -6
- package/dist/order-book/generated/models/SolverCompetitionResponse.js.map +0 -1
- package/dist/order-book/generated/models/SolverSettlement.js +0 -6
- package/dist/order-book/generated/models/SolverSettlement.js.map +0 -1
- package/dist/order-book/generated/models/TokenAmount.js +0 -6
- package/dist/order-book/generated/models/TokenAmount.js.map +0 -1
- package/dist/order-book/generated/models/Trade.js +0 -6
- package/dist/order-book/generated/models/Trade.js.map +0 -1
- package/dist/order-book/generated/models/TransactionHash.js +0 -6
- package/dist/order-book/generated/models/TransactionHash.js.map +0 -1
- package/dist/order-book/generated/models/UID.js +0 -6
- package/dist/order-book/generated/models/UID.js.map +0 -1
- package/dist/order-book/generated/models/VersionResponse.js +0 -6
- package/dist/order-book/generated/models/VersionResponse.js.map +0 -1
- package/dist/order-book/generated/services/DefaultService.js +0 -314
- package/dist/order-book/generated/services/DefaultService.js.map +0 -1
- package/dist/order-book/index.js +0 -7
- package/dist/order-book/index.js.map +0 -1
- package/dist/order-book/transformOrder.js +0 -37
- package/dist/order-book/transformOrder.js.map +0 -1
- package/dist/order-book/types.js +0 -3
- package/dist/order-book/types.js.map +0 -1
- package/dist/subgraph/api.js +0 -65
- package/dist/subgraph/api.js.map +0 -1
- package/dist/subgraph/graphql.js +0 -421
- package/dist/subgraph/graphql.js.map +0 -1
- package/dist/subgraph/index.js +0 -5
- package/dist/subgraph/index.js.map +0 -1
- package/dist/subgraph/queries.js +0 -35
- package/dist/subgraph/queries.js.map +0 -1
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { BigUint } from './BigUint';
|
|
3
|
-
import type { EthflowData } from './EthflowData';
|
|
4
|
-
import type { OnchainOrderData } from './OnchainOrderData';
|
|
5
|
-
import type { OrderClass } from './OrderClass';
|
|
6
|
-
import type { OrderStatus } from './OrderStatus';
|
|
7
|
-
import type { TokenAmount } from './TokenAmount';
|
|
8
|
-
import type { UID } from './UID';
|
|
9
|
-
/**
|
|
10
|
-
* Extra order data that is returned to users when querying orders
|
|
11
|
-
* but not provided by users when creating orders.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export type OrderMetaData = {
|
|
15
|
-
/**
|
|
16
|
-
* Creation time of the order. Encoded as ISO 8601 UTC.
|
|
17
|
-
*/
|
|
18
|
-
creationDate: string;
|
|
19
|
-
class: OrderClass;
|
|
20
|
-
owner: Address;
|
|
21
|
-
uid: UID;
|
|
22
|
-
/**
|
|
23
|
-
* Amount of sellToken available for the settlement contract to spend on behalf of the owner. Null if API was unable to fetch balance or if the order status isn't Open.
|
|
24
|
-
*/
|
|
25
|
-
availableBalance?: TokenAmount | null;
|
|
26
|
-
/**
|
|
27
|
-
* The total amount of sellToken that has been executed for this order including fees.
|
|
28
|
-
*/
|
|
29
|
-
executedSellAmount: BigUint;
|
|
30
|
-
/**
|
|
31
|
-
* The total amount of sellToken that has been executed for this order without fees.
|
|
32
|
-
*/
|
|
33
|
-
executedSellAmountBeforeFees: BigUint;
|
|
34
|
-
/**
|
|
35
|
-
* The total amount of buyToken that has been executed for this order.
|
|
36
|
-
*/
|
|
37
|
-
executedBuyAmount: BigUint;
|
|
38
|
-
/**
|
|
39
|
-
* The total amount of fees that have been executed for this order.
|
|
40
|
-
*/
|
|
41
|
-
executedFeeAmount: BigUint;
|
|
42
|
-
/**
|
|
43
|
-
* Has this order been invalidated?
|
|
44
|
-
*/
|
|
45
|
-
invalidated: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Order status
|
|
48
|
-
*/
|
|
49
|
-
status: OrderStatus;
|
|
50
|
-
/**
|
|
51
|
-
* Amount that the signed fee would be without subsidies
|
|
52
|
-
*/
|
|
53
|
-
fullFeeAmount?: TokenAmount;
|
|
54
|
-
/**
|
|
55
|
-
* Liquidity orders are functionally the same as normal smart contract orders but are not
|
|
56
|
-
* placed with the intent of actively getting traded. Instead they facilitate the
|
|
57
|
-
* trade of normal orders by allowing them to be matched against liquidity orders which
|
|
58
|
-
* uses less gas and can have better prices than external liquidity.
|
|
59
|
-
* As such liquidity orders will only be used in order to improve settlement of normal
|
|
60
|
-
* orders. They should not be expected to be traded otherwise and should not expect to get
|
|
61
|
-
* surplus.
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
|
-
isLiquidityOrder?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* For ethflow orders - order that are placed onchain with native eth -, this field
|
|
67
|
-
* contains a struct with two variables user_valid_to and is_refunded
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
ethflowData?: EthflowData;
|
|
71
|
-
/**
|
|
72
|
-
* TODO: smth related to ETH flow
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
onchainUser?: Address;
|
|
76
|
-
/**
|
|
77
|
-
* There is some data only available for orders that are placed onchain. This data
|
|
78
|
-
* can be found in this object
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
onchainOrderData?: OnchainOrderData;
|
|
82
|
-
/**
|
|
83
|
-
* Surplus fee that the limit order was executed with.
|
|
84
|
-
*/
|
|
85
|
-
executedSurplusFee?: BigUint | null;
|
|
86
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { BigUint } from './BigUint';
|
|
3
|
+
import type { EthflowData } from './EthflowData';
|
|
4
|
+
import type { OnchainOrderData } from './OnchainOrderData';
|
|
5
|
+
import type { OrderClass } from './OrderClass';
|
|
6
|
+
import type { OrderStatus } from './OrderStatus';
|
|
7
|
+
import type { TokenAmount } from './TokenAmount';
|
|
8
|
+
import type { UID } from './UID';
|
|
9
|
+
/**
|
|
10
|
+
* Extra order data that is returned to users when querying orders
|
|
11
|
+
* but not provided by users when creating orders.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export type OrderMetaData = {
|
|
15
|
+
/**
|
|
16
|
+
* Creation time of the order. Encoded as ISO 8601 UTC.
|
|
17
|
+
*/
|
|
18
|
+
creationDate: string;
|
|
19
|
+
class: OrderClass;
|
|
20
|
+
owner: Address;
|
|
21
|
+
uid: UID;
|
|
22
|
+
/**
|
|
23
|
+
* Amount of sellToken available for the settlement contract to spend on behalf of the owner. Null if API was unable to fetch balance or if the order status isn't Open.
|
|
24
|
+
*/
|
|
25
|
+
availableBalance?: TokenAmount | null;
|
|
26
|
+
/**
|
|
27
|
+
* The total amount of sellToken that has been executed for this order including fees.
|
|
28
|
+
*/
|
|
29
|
+
executedSellAmount: BigUint;
|
|
30
|
+
/**
|
|
31
|
+
* The total amount of sellToken that has been executed for this order without fees.
|
|
32
|
+
*/
|
|
33
|
+
executedSellAmountBeforeFees: BigUint;
|
|
34
|
+
/**
|
|
35
|
+
* The total amount of buyToken that has been executed for this order.
|
|
36
|
+
*/
|
|
37
|
+
executedBuyAmount: BigUint;
|
|
38
|
+
/**
|
|
39
|
+
* The total amount of fees that have been executed for this order.
|
|
40
|
+
*/
|
|
41
|
+
executedFeeAmount: BigUint;
|
|
42
|
+
/**
|
|
43
|
+
* Has this order been invalidated?
|
|
44
|
+
*/
|
|
45
|
+
invalidated: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Order status
|
|
48
|
+
*/
|
|
49
|
+
status: OrderStatus;
|
|
50
|
+
/**
|
|
51
|
+
* Amount that the signed fee would be without subsidies
|
|
52
|
+
*/
|
|
53
|
+
fullFeeAmount?: TokenAmount;
|
|
54
|
+
/**
|
|
55
|
+
* Liquidity orders are functionally the same as normal smart contract orders but are not
|
|
56
|
+
* placed with the intent of actively getting traded. Instead they facilitate the
|
|
57
|
+
* trade of normal orders by allowing them to be matched against liquidity orders which
|
|
58
|
+
* uses less gas and can have better prices than external liquidity.
|
|
59
|
+
* As such liquidity orders will only be used in order to improve settlement of normal
|
|
60
|
+
* orders. They should not be expected to be traded otherwise and should not expect to get
|
|
61
|
+
* surplus.
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
isLiquidityOrder?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* For ethflow orders - order that are placed onchain with native eth -, this field
|
|
67
|
+
* contains a struct with two variables user_valid_to and is_refunded
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
ethflowData?: EthflowData;
|
|
71
|
+
/**
|
|
72
|
+
* TODO: smth related to ETH flow
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
onchainUser?: Address;
|
|
76
|
+
/**
|
|
77
|
+
* There is some data only available for orders that are placed onchain. This data
|
|
78
|
+
* can be found in this object
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
onchainOrderData?: OnchainOrderData;
|
|
82
|
+
/**
|
|
83
|
+
* Surplus fee that the limit order was executed with.
|
|
84
|
+
*/
|
|
85
|
+
executedSurplusFee?: BigUint | null;
|
|
86
|
+
};
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { AppData } from './AppData';
|
|
3
|
-
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
4
|
-
import type { OrderKind } from './OrderKind';
|
|
5
|
-
import type { SellTokenSource } from './SellTokenSource';
|
|
6
|
-
import type { SigningScheme } from './SigningScheme';
|
|
7
|
-
import type { TokenAmount } from './TokenAmount';
|
|
8
|
-
/**
|
|
9
|
-
* Order parameters.
|
|
10
|
-
*/
|
|
11
|
-
export type OrderParameters = {
|
|
12
|
-
/**
|
|
13
|
-
* ERC20 token to be sold
|
|
14
|
-
*/
|
|
15
|
-
sellToken: Address;
|
|
16
|
-
/**
|
|
17
|
-
* ERC20 token to be bought
|
|
18
|
-
*/
|
|
19
|
-
buyToken: Address;
|
|
20
|
-
/**
|
|
21
|
-
* An optional address to receive the proceeds of the trade instead of the
|
|
22
|
-
* owner (i.e. the order signer).
|
|
23
|
-
*
|
|
24
|
-
*/
|
|
25
|
-
receiver?: Address | null;
|
|
26
|
-
/**
|
|
27
|
-
* Amount of sellToken to be sold in atoms
|
|
28
|
-
*/
|
|
29
|
-
sellAmount: TokenAmount;
|
|
30
|
-
/**
|
|
31
|
-
* Amount of buyToken to be bought in atoms
|
|
32
|
-
*/
|
|
33
|
-
buyAmount: TokenAmount;
|
|
34
|
-
/**
|
|
35
|
-
* Unix timestamp until the order is valid. uint32.
|
|
36
|
-
*/
|
|
37
|
-
validTo: number;
|
|
38
|
-
/**
|
|
39
|
-
* Arbitrary application specific data that can be added to an order. This can
|
|
40
|
-
* also be used to ensure uniqueness between two orders with otherwise the
|
|
41
|
-
* exact same parameters.
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
appData: AppData;
|
|
45
|
-
/**
|
|
46
|
-
* Fees: feeRatio * sellAmount + minimal_fee in atoms
|
|
47
|
-
*/
|
|
48
|
-
feeAmount: TokenAmount;
|
|
49
|
-
/**
|
|
50
|
-
* The kind is either a buy or sell order
|
|
51
|
-
*/
|
|
52
|
-
kind: OrderKind;
|
|
53
|
-
/**
|
|
54
|
-
* Is this a fill-or-kill order or a partially fillable order?
|
|
55
|
-
*/
|
|
56
|
-
partiallyFillable: boolean;
|
|
57
|
-
sellTokenBalance?: SellTokenSource;
|
|
58
|
-
buyTokenBalance?: BuyTokenDestination;
|
|
59
|
-
signingScheme?: SigningScheme;
|
|
60
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { AppData } from './AppData';
|
|
3
|
+
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
4
|
+
import type { OrderKind } from './OrderKind';
|
|
5
|
+
import type { SellTokenSource } from './SellTokenSource';
|
|
6
|
+
import type { SigningScheme } from './SigningScheme';
|
|
7
|
+
import type { TokenAmount } from './TokenAmount';
|
|
8
|
+
/**
|
|
9
|
+
* Order parameters.
|
|
10
|
+
*/
|
|
11
|
+
export type OrderParameters = {
|
|
12
|
+
/**
|
|
13
|
+
* ERC20 token to be sold
|
|
14
|
+
*/
|
|
15
|
+
sellToken: Address;
|
|
16
|
+
/**
|
|
17
|
+
* ERC20 token to be bought
|
|
18
|
+
*/
|
|
19
|
+
buyToken: Address;
|
|
20
|
+
/**
|
|
21
|
+
* An optional address to receive the proceeds of the trade instead of the
|
|
22
|
+
* owner (i.e. the order signer).
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
receiver?: Address | null;
|
|
26
|
+
/**
|
|
27
|
+
* Amount of sellToken to be sold in atoms
|
|
28
|
+
*/
|
|
29
|
+
sellAmount: TokenAmount;
|
|
30
|
+
/**
|
|
31
|
+
* Amount of buyToken to be bought in atoms
|
|
32
|
+
*/
|
|
33
|
+
buyAmount: TokenAmount;
|
|
34
|
+
/**
|
|
35
|
+
* Unix timestamp until the order is valid. uint32.
|
|
36
|
+
*/
|
|
37
|
+
validTo: number;
|
|
38
|
+
/**
|
|
39
|
+
* Arbitrary application specific data that can be added to an order. This can
|
|
40
|
+
* also be used to ensure uniqueness between two orders with otherwise the
|
|
41
|
+
* exact same parameters.
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
appData: AppData;
|
|
45
|
+
/**
|
|
46
|
+
* Fees: feeRatio * sellAmount + minimal_fee in atoms
|
|
47
|
+
*/
|
|
48
|
+
feeAmount: TokenAmount;
|
|
49
|
+
/**
|
|
50
|
+
* The kind is either a buy or sell order
|
|
51
|
+
*/
|
|
52
|
+
kind: OrderKind;
|
|
53
|
+
/**
|
|
54
|
+
* Is this a fill-or-kill order or a partially fillable order?
|
|
55
|
+
*/
|
|
56
|
+
partiallyFillable: boolean;
|
|
57
|
+
sellTokenBalance?: SellTokenSource;
|
|
58
|
+
buyTokenBalance?: BuyTokenDestination;
|
|
59
|
+
signingScheme?: SigningScheme;
|
|
60
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export type OrderPostError = {
|
|
2
|
-
errorType: OrderPostError.errorType;
|
|
3
|
-
description: string;
|
|
4
|
-
};
|
|
5
|
-
export declare namespace OrderPostError {
|
|
6
|
-
enum errorType {
|
|
7
|
-
DUPLICATE_ORDER = "DuplicateOrder",
|
|
8
|
-
INSUFFICIENT_FEE = "InsufficientFee",
|
|
9
|
-
INSUFFICIENT_ALLOWANCE = "InsufficientAllowance",
|
|
10
|
-
INSUFFICIENT_BALANCE = "InsufficientBalance",
|
|
11
|
-
INSUFFICIENT_VALID_TO = "InsufficientValidTo",
|
|
12
|
-
EXCESSIVE_VALID_TO = "ExcessiveValidTo",
|
|
13
|
-
INVALID_SIGNATURE = "InvalidSignature",
|
|
14
|
-
TRANSFER_ETH_TO_CONTRACT = "TransferEthToContract",
|
|
15
|
-
TRANSFER_SIMULATION_FAILED = "TransferSimulationFailed",
|
|
16
|
-
UNSUPPORTED_TOKEN = "UnsupportedToken",
|
|
17
|
-
WRONG_OWNER = "WrongOwner",
|
|
18
|
-
MISSING_FROM = "MissingFrom",
|
|
19
|
-
SAME_BUY_AND_SELL_TOKEN = "SameBuyAndSellToken",
|
|
20
|
-
ZERO_AMOUNT = "ZeroAmount",
|
|
21
|
-
UNSUPPORTED_BUY_TOKEN_DESTINATION = "UnsupportedBuyTokenDestination",
|
|
22
|
-
UNSUPPORTED_SELL_TOKEN_SOURCE = "UnsupportedSellTokenSource",
|
|
23
|
-
UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType",
|
|
24
|
-
UNSUPPORTED_SIGNATURE = "UnsupportedSignature",
|
|
25
|
-
TOO_MANY_LIMIT_ORDERS = "TooManyLimitOrders"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
export type OrderPostError = {
|
|
2
|
+
errorType: OrderPostError.errorType;
|
|
3
|
+
description: string;
|
|
4
|
+
};
|
|
5
|
+
export declare namespace OrderPostError {
|
|
6
|
+
enum errorType {
|
|
7
|
+
DUPLICATE_ORDER = "DuplicateOrder",
|
|
8
|
+
INSUFFICIENT_FEE = "InsufficientFee",
|
|
9
|
+
INSUFFICIENT_ALLOWANCE = "InsufficientAllowance",
|
|
10
|
+
INSUFFICIENT_BALANCE = "InsufficientBalance",
|
|
11
|
+
INSUFFICIENT_VALID_TO = "InsufficientValidTo",
|
|
12
|
+
EXCESSIVE_VALID_TO = "ExcessiveValidTo",
|
|
13
|
+
INVALID_SIGNATURE = "InvalidSignature",
|
|
14
|
+
TRANSFER_ETH_TO_CONTRACT = "TransferEthToContract",
|
|
15
|
+
TRANSFER_SIMULATION_FAILED = "TransferSimulationFailed",
|
|
16
|
+
UNSUPPORTED_TOKEN = "UnsupportedToken",
|
|
17
|
+
WRONG_OWNER = "WrongOwner",
|
|
18
|
+
MISSING_FROM = "MissingFrom",
|
|
19
|
+
SAME_BUY_AND_SELL_TOKEN = "SameBuyAndSellToken",
|
|
20
|
+
ZERO_AMOUNT = "ZeroAmount",
|
|
21
|
+
UNSUPPORTED_BUY_TOKEN_DESTINATION = "UnsupportedBuyTokenDestination",
|
|
22
|
+
UNSUPPORTED_SELL_TOKEN_SOURCE = "UnsupportedSellTokenSource",
|
|
23
|
+
UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType",
|
|
24
|
+
UNSUPPORTED_SIGNATURE = "UnsupportedSignature",
|
|
25
|
+
TOO_MANY_LIMIT_ORDERS = "TooManyLimitOrders"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { AppData } from './AppData';
|
|
3
|
-
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
4
|
-
import type { OrderQuoteSide } from './OrderQuoteSide';
|
|
5
|
-
import type { OrderQuoteValidity } from './OrderQuoteValidity';
|
|
6
|
-
import type { PriceQuality } from './PriceQuality';
|
|
7
|
-
import type { SellTokenSource } from './SellTokenSource';
|
|
8
|
-
import type { SigningScheme } from './SigningScheme';
|
|
9
|
-
/**
|
|
10
|
-
* Request fee and price quote.
|
|
11
|
-
*/
|
|
12
|
-
export type OrderQuoteRequest = (OrderQuoteSide & OrderQuoteValidity & {
|
|
13
|
-
/**
|
|
14
|
-
* ERC20 token to be sold
|
|
15
|
-
*/
|
|
16
|
-
sellToken: Address;
|
|
17
|
-
/**
|
|
18
|
-
* ERC20 token to be bought
|
|
19
|
-
*/
|
|
20
|
-
buyToken: Address;
|
|
21
|
-
/**
|
|
22
|
-
* An optional address to receive the proceeds of the trade instead of the
|
|
23
|
-
* owner (i.e. the order signer).
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
receiver?: Address | null;
|
|
27
|
-
/**
|
|
28
|
-
* Arbitrary application specific data that can be added to an order. This can
|
|
29
|
-
* also be used to ensure uniqueness between two orders with otherwise the
|
|
30
|
-
* exact same parameters.
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
appData?: AppData;
|
|
34
|
-
/**
|
|
35
|
-
* Is this a fill-or-kill order or a partially fillable order?
|
|
36
|
-
*/
|
|
37
|
-
partiallyFillable?: boolean;
|
|
38
|
-
sellTokenBalance?: SellTokenSource;
|
|
39
|
-
buyTokenBalance?: BuyTokenDestination;
|
|
40
|
-
from: Address;
|
|
41
|
-
priceQuality?: PriceQuality;
|
|
42
|
-
signingScheme?: SigningScheme;
|
|
43
|
-
/**
|
|
44
|
-
* Flag to signal whether the order is intended for onchain order placement. Only valid for non ECDSA-signed orders
|
|
45
|
-
*/
|
|
46
|
-
onchainOrder?: any;
|
|
47
|
-
});
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { AppData } from './AppData';
|
|
3
|
+
import type { BuyTokenDestination } from './BuyTokenDestination';
|
|
4
|
+
import type { OrderQuoteSide } from './OrderQuoteSide';
|
|
5
|
+
import type { OrderQuoteValidity } from './OrderQuoteValidity';
|
|
6
|
+
import type { PriceQuality } from './PriceQuality';
|
|
7
|
+
import type { SellTokenSource } from './SellTokenSource';
|
|
8
|
+
import type { SigningScheme } from './SigningScheme';
|
|
9
|
+
/**
|
|
10
|
+
* Request fee and price quote.
|
|
11
|
+
*/
|
|
12
|
+
export type OrderQuoteRequest = (OrderQuoteSide & OrderQuoteValidity & {
|
|
13
|
+
/**
|
|
14
|
+
* ERC20 token to be sold
|
|
15
|
+
*/
|
|
16
|
+
sellToken: Address;
|
|
17
|
+
/**
|
|
18
|
+
* ERC20 token to be bought
|
|
19
|
+
*/
|
|
20
|
+
buyToken: Address;
|
|
21
|
+
/**
|
|
22
|
+
* An optional address to receive the proceeds of the trade instead of the
|
|
23
|
+
* owner (i.e. the order signer).
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
receiver?: Address | null;
|
|
27
|
+
/**
|
|
28
|
+
* Arbitrary application specific data that can be added to an order. This can
|
|
29
|
+
* also be used to ensure uniqueness between two orders with otherwise the
|
|
30
|
+
* exact same parameters.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
appData?: AppData;
|
|
34
|
+
/**
|
|
35
|
+
* Is this a fill-or-kill order or a partially fillable order?
|
|
36
|
+
*/
|
|
37
|
+
partiallyFillable?: boolean;
|
|
38
|
+
sellTokenBalance?: SellTokenSource;
|
|
39
|
+
buyTokenBalance?: BuyTokenDestination;
|
|
40
|
+
from: Address;
|
|
41
|
+
priceQuality?: PriceQuality;
|
|
42
|
+
signingScheme?: SigningScheme;
|
|
43
|
+
/**
|
|
44
|
+
* Flag to signal whether the order is intended for onchain order placement. Only valid for non ECDSA-signed orders
|
|
45
|
+
*/
|
|
46
|
+
onchainOrder?: any;
|
|
47
|
+
});
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { Address } from './Address';
|
|
2
|
-
import type { OrderParameters } from './OrderParameters';
|
|
3
|
-
/**
|
|
4
|
-
* An order quoted by the back end that can be directly signed and
|
|
5
|
-
* submitted to the order creation backend.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export type OrderQuoteResponse = {
|
|
9
|
-
quote: OrderParameters;
|
|
10
|
-
from?: Address;
|
|
11
|
-
/**
|
|
12
|
-
* Expiration date of the offered fee. Order service might not accept
|
|
13
|
-
* the fee after this expiration date. Encoded as ISO 8601 UTC.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
expiration: string;
|
|
17
|
-
/**
|
|
18
|
-
* Order ID linked to a quote to enable providing more metadata when analyzing
|
|
19
|
-
* order slippage.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
id?: number;
|
|
23
|
-
};
|
|
1
|
+
import type { Address } from './Address';
|
|
2
|
+
import type { OrderParameters } from './OrderParameters';
|
|
3
|
+
/**
|
|
4
|
+
* An order quoted by the back end that can be directly signed and
|
|
5
|
+
* submitted to the order creation backend.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export type OrderQuoteResponse = {
|
|
9
|
+
quote: OrderParameters;
|
|
10
|
+
from?: Address;
|
|
11
|
+
/**
|
|
12
|
+
* Expiration date of the offered fee. Order service might not accept
|
|
13
|
+
* the fee after this expiration date. Encoded as ISO 8601 UTC.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
expiration: string;
|
|
17
|
+
/**
|
|
18
|
+
* Order ID linked to a quote to enable providing more metadata when analyzing
|
|
19
|
+
* order slippage.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
id?: number;
|
|
23
|
+
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import type { TokenAmount } from './TokenAmount';
|
|
2
|
-
/**
|
|
3
|
-
* The buy or sell side when quoting an order.
|
|
4
|
-
*/
|
|
5
|
-
export type OrderQuoteSide = ({
|
|
6
|
-
kind: OrderQuoteSide.kind;
|
|
7
|
-
/**
|
|
8
|
-
* The total amount that is available for the order. From this value, the fee
|
|
9
|
-
* is deducted and the buy amount is calculated.
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
sellAmountBeforeFee: TokenAmount;
|
|
13
|
-
} | {
|
|
14
|
-
kind: OrderQuoteSide.kind;
|
|
15
|
-
/**
|
|
16
|
-
* The sell amount for the order.
|
|
17
|
-
*/
|
|
18
|
-
sellAmountAfterFee: TokenAmount;
|
|
19
|
-
} | {
|
|
20
|
-
kind: OrderQuoteSide.kind;
|
|
21
|
-
/**
|
|
22
|
-
* The buy amount for the order.
|
|
23
|
-
*/
|
|
24
|
-
buyAmountAfterFee: TokenAmount;
|
|
25
|
-
});
|
|
26
|
-
export declare namespace OrderQuoteSide {
|
|
27
|
-
enum kind {
|
|
28
|
-
SELL = "sell"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
import type { TokenAmount } from './TokenAmount';
|
|
2
|
+
/**
|
|
3
|
+
* The buy or sell side when quoting an order.
|
|
4
|
+
*/
|
|
5
|
+
export type OrderQuoteSide = ({
|
|
6
|
+
kind: OrderQuoteSide.kind;
|
|
7
|
+
/**
|
|
8
|
+
* The total amount that is available for the order. From this value, the fee
|
|
9
|
+
* is deducted and the buy amount is calculated.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
sellAmountBeforeFee: TokenAmount;
|
|
13
|
+
} | {
|
|
14
|
+
kind: OrderQuoteSide.kind;
|
|
15
|
+
/**
|
|
16
|
+
* The sell amount for the order.
|
|
17
|
+
*/
|
|
18
|
+
sellAmountAfterFee: TokenAmount;
|
|
19
|
+
} | {
|
|
20
|
+
kind: OrderQuoteSide.kind;
|
|
21
|
+
/**
|
|
22
|
+
* The buy amount for the order.
|
|
23
|
+
*/
|
|
24
|
+
buyAmountAfterFee: TokenAmount;
|
|
25
|
+
});
|
|
26
|
+
export declare namespace OrderQuoteSide {
|
|
27
|
+
enum kind {
|
|
28
|
+
SELL = "sell"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The validity for the order
|
|
3
|
-
*/
|
|
4
|
-
export type OrderQuoteValidity = ({
|
|
5
|
-
/**
|
|
6
|
-
* Unix timestamp until the order is valid. uint32.
|
|
7
|
-
*/
|
|
8
|
-
validTo?: number;
|
|
9
|
-
} | {
|
|
10
|
-
/**
|
|
11
|
-
* Number of seconds that the order should be valid for. uint32.
|
|
12
|
-
*/
|
|
13
|
-
validFor?: number;
|
|
14
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* The validity for the order
|
|
3
|
+
*/
|
|
4
|
+
export type OrderQuoteValidity = ({
|
|
5
|
+
/**
|
|
6
|
+
* Unix timestamp until the order is valid. uint32.
|
|
7
|
+
*/
|
|
8
|
+
validTo?: number;
|
|
9
|
+
} | {
|
|
10
|
+
/**
|
|
11
|
+
* Number of seconds that the order should be valid for. uint32.
|
|
12
|
+
*/
|
|
13
|
+
validFor?: number;
|
|
14
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The current order status
|
|
3
|
-
*/
|
|
4
|
-
export declare enum OrderStatus {
|
|
5
|
-
PRESIGNATURE_PENDING = "presignaturePending",
|
|
6
|
-
OPEN = "open",
|
|
7
|
-
FULFILLED = "fulfilled",
|
|
8
|
-
CANCELLED = "cancelled",
|
|
9
|
-
EXPIRED = "expired"
|
|
10
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The current order status
|
|
3
|
+
*/
|
|
4
|
+
export declare enum OrderStatus {
|
|
5
|
+
PRESIGNATURE_PENDING = "presignaturePending",
|
|
6
|
+
OPEN = "open",
|
|
7
|
+
FULFILLED = "fulfilled",
|
|
8
|
+
CANCELLED = "cancelled",
|
|
9
|
+
EXPIRED = "expired"
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Empty signature bytes. Used for "presign" signatures.
|
|
3
|
-
*/
|
|
4
|
-
export type PreSignature = string;
|
|
1
|
+
/**
|
|
2
|
+
* Empty signature bytes. Used for "presign" signatures.
|
|
3
|
+
*/
|
|
4
|
+
export type PreSignature = string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How good should the price estimate be?
|
|
3
|
-
* Note that orders are supposed to be created from "optimal" price estimates.
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
export declare enum PriceQuality {
|
|
7
|
-
FAST = "fast",
|
|
8
|
-
OPTIMAL = "optimal"
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* How good should the price estimate be?
|
|
3
|
+
* Note that orders are supposed to be created from "optimal" price estimates.
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PriceQuality {
|
|
7
|
+
FAST = "fast",
|
|
8
|
+
OPTIMAL = "optimal"
|
|
9
|
+
}
|