@shapeshiftoss/types 8.6.4-alpha.0 → 8.6.4
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/CHANGELOG.md +665 -0
- package/package.json +4 -4
- package/dist/cjs/.tsbuildinfo +0 -1
- package/dist/cjs/base.d.ts +0 -75
- package/dist/cjs/base.js +0 -34
- package/dist/cjs/cowSwap.d.ts +0 -272
- package/dist/cjs/cowSwap.js +0 -129
- package/dist/cjs/index.d.ts +0 -5
- package/dist/cjs/index.js +0 -21
- package/dist/cjs/market.d.ts +0 -36
- package/dist/cjs/market.js +0 -12
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/utility.d.ts +0 -31
- package/dist/cjs/utility.js +0 -7
- package/dist/cjs/zerion.d.ts +0 -5
- package/dist/cjs/zerion.js +0 -31
- package/dist/esm/.tsbuildinfo +0 -1
- package/dist/esm/base.d.ts +0 -75
- package/dist/esm/base.js +0 -31
- package/dist/esm/cowSwap.d.ts +0 -272
- package/dist/esm/cowSwap.js +0 -125
- package/dist/esm/index.d.ts +0 -5
- package/dist/esm/index.js +0 -5
- package/dist/esm/market.d.ts +0 -36
- package/dist/esm/market.js +0 -9
- package/dist/esm/utility.d.ts +0 -31
- package/dist/esm/utility.js +0 -6
- package/dist/esm/zerion.d.ts +0 -5
- package/dist/esm/zerion.js +0 -27
package/dist/cjs/cowSwap.d.ts
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import type { AppDataRootSchema as AppDataRootSchemaLegacy } from '@cowprotocol/app-data/dist/generatedTypes/v0.4.0';
|
|
2
|
-
import type { AppDataRootSchema as AppDataRootSchemaLatest } from '@cowprotocol/app-data/dist/generatedTypes/v1.3.0';
|
|
3
|
-
import type { Nominal } from '@shapeshiftoss/caip';
|
|
4
|
-
import type { TypedDataField } from 'ethers5';
|
|
5
|
-
import type { Address } from 'viem';
|
|
6
|
-
import type { KnownChainIds } from './base';
|
|
7
|
-
export type AppDataHash = Nominal<string, 'AppDataHash'>;
|
|
8
|
-
export type AppData = Nominal<string, 'AppData'>;
|
|
9
|
-
export type OrderId = Nominal<string, 'OrderId'>;
|
|
10
|
-
export type CowSwapQuoteId = Nominal<number, 'CowSwapQuoteId'>;
|
|
11
|
-
export declare enum TypedDataPrimaryType {
|
|
12
|
-
Order = "Order",
|
|
13
|
-
OrderCancellations = "OrderCancellations"
|
|
14
|
-
}
|
|
15
|
-
export declare enum OrderKind {
|
|
16
|
-
BUY = "buy",
|
|
17
|
-
SELL = "sell"
|
|
18
|
-
}
|
|
19
|
-
export declare enum SellTokenSource {
|
|
20
|
-
ERC20 = "erc20",
|
|
21
|
-
INTERNAL = "internal",
|
|
22
|
-
EXTERNAL = "external"
|
|
23
|
-
}
|
|
24
|
-
export declare enum BuyTokenDestination {
|
|
25
|
-
ERC20 = "erc20",
|
|
26
|
-
INTERNAL = "internal"
|
|
27
|
-
}
|
|
28
|
-
export declare enum SigningScheme {
|
|
29
|
-
EIP712 = "eip712",
|
|
30
|
-
ETHSIGN = "ethsign",
|
|
31
|
-
PRESIGN = "presign",
|
|
32
|
-
EIP1271 = "eip1271"
|
|
33
|
-
}
|
|
34
|
-
export declare enum EcdsaSigningScheme {
|
|
35
|
-
EIP712 = "eip712",
|
|
36
|
-
ETHSIGN = "ethsign"
|
|
37
|
-
}
|
|
38
|
-
export declare enum OrderClass {
|
|
39
|
-
MARKET = "market",
|
|
40
|
-
LIMIT = "limit",
|
|
41
|
-
LIQUIDITY = "liquidity"
|
|
42
|
-
}
|
|
43
|
-
export declare enum PlacementError {
|
|
44
|
-
QUOTE_NOT_FOUND = "QuoteNotFound",
|
|
45
|
-
VALID_TO_TOO_FAR_IN_FUTURE = "ValidToTooFarInFuture",
|
|
46
|
-
PRE_VALIDATION_ERROR = "PreValidationError"
|
|
47
|
-
}
|
|
48
|
-
export declare enum OrderQuoteSideKindSell {
|
|
49
|
-
SELL = "sell"
|
|
50
|
-
}
|
|
51
|
-
export declare enum OrderQuoteSideKindBuy {
|
|
52
|
-
BUY = "buy"
|
|
53
|
-
}
|
|
54
|
-
export declare enum PriceQuality {
|
|
55
|
-
FAST = "fast",
|
|
56
|
-
OPTIMAL = "optimal",
|
|
57
|
-
VERIFIED = "verified"
|
|
58
|
-
}
|
|
59
|
-
export declare enum OrderError {
|
|
60
|
-
DUPLICATED_ORDER = "DuplicatedOrder",
|
|
61
|
-
QUOTE_NOT_FOUND = "QuoteNotFound",
|
|
62
|
-
QUOTE_NOT_VERIFIED = "QuoteNotVerified",
|
|
63
|
-
INVALID_QUOTE = "InvalidQuote",
|
|
64
|
-
MISSING_FROM = "MissingFrom",
|
|
65
|
-
WRONG_OWNER = "WrongOwner",
|
|
66
|
-
INVALID_EIP1271SIGNATURE = "InvalidEip1271Signature",
|
|
67
|
-
INSUFFICIENT_BALANCE = "InsufficientBalance",
|
|
68
|
-
INSUFFICIENT_ALLOWANCE = "InsufficientAllowance",
|
|
69
|
-
INVALID_SIGNATURE = "InvalidSignature",
|
|
70
|
-
SELL_AMOUNT_OVERFLOW = "SellAmountOverflow",
|
|
71
|
-
TRANSFER_SIMULATION_FAILED = "TransferSimulationFailed",
|
|
72
|
-
ZERO_AMOUNT = "ZeroAmount",
|
|
73
|
-
INCOMPATIBLE_SIGNING_SCHEME = "IncompatibleSigningScheme",
|
|
74
|
-
TOO_MANY_LIMIT_ORDERS = "TooManyLimitOrders",
|
|
75
|
-
TOO_MUCH_GAS = "TooMuchGas",
|
|
76
|
-
UNSUPPORTED_BUY_TOKEN_DESTINATION = "UnsupportedBuyTokenDestination",
|
|
77
|
-
UNSUPPORTED_SELL_TOKEN_SOURCE = "UnsupportedSellTokenSource",
|
|
78
|
-
UNSUPPORTED_ORDER_TYPE = "UnsupportedOrderType",
|
|
79
|
-
INSUFFICIENT_VALID_TO = "InsufficientValidTo",
|
|
80
|
-
EXCESSIVE_VALID_TO = "ExcessiveValidTo",
|
|
81
|
-
INVALID_NATIVE_SELL_TOKEN = "InvalidNativeSellToken",
|
|
82
|
-
SAME_BUY_AND_SELL_TOKEN = "SameBuyAndSellToken",
|
|
83
|
-
UNSUPPORTED_TOKEN = "UnsupportedToken",
|
|
84
|
-
INVALID_APP_DATA = "InvalidAppData",
|
|
85
|
-
APP_DATA_HASH_MISMATCH = "AppDataHashMismatch",
|
|
86
|
-
APPDATA_FROM_MISMATCH = "AppdataFromMismatch",
|
|
87
|
-
SELL_AMOUNT_DOES_NOT_COVER_FEE = "SellAmountDoesNotCoverFee",
|
|
88
|
-
NO_LIQUIDITY = "NoLiquidity"
|
|
89
|
-
}
|
|
90
|
-
export declare enum CompetitionOrderStatusType {
|
|
91
|
-
OPEN = "open",
|
|
92
|
-
SCHEDULED = "scheduled",
|
|
93
|
-
ACTIVE = "active",
|
|
94
|
-
SOLVED = "solved",
|
|
95
|
-
EXECUTING = "executing",
|
|
96
|
-
TRADED = "traded",
|
|
97
|
-
CANCELLED = "cancelled"
|
|
98
|
-
}
|
|
99
|
-
export declare enum OrderStatus {
|
|
100
|
-
PRESIGNATURE_PENDING = "presignaturePending",
|
|
101
|
-
OPEN = "open",
|
|
102
|
-
FULFILLED = "fulfilled",
|
|
103
|
-
CANCELLED = "cancelled",
|
|
104
|
-
EXPIRED = "expired"
|
|
105
|
-
}
|
|
106
|
-
export type OrderCreation = {
|
|
107
|
-
sellToken: Address;
|
|
108
|
-
buyToken: Address;
|
|
109
|
-
receiver?: Address | null;
|
|
110
|
-
sellAmount: string;
|
|
111
|
-
buyAmount: string;
|
|
112
|
-
validTo: number;
|
|
113
|
-
feeAmount: string;
|
|
114
|
-
kind: OrderKind;
|
|
115
|
-
partiallyFillable: boolean;
|
|
116
|
-
sellTokenBalance?: SellTokenSource;
|
|
117
|
-
buyTokenBalance?: BuyTokenDestination;
|
|
118
|
-
signingScheme: SigningScheme;
|
|
119
|
-
signature: string;
|
|
120
|
-
from?: Address | null;
|
|
121
|
-
quoteId?: CowSwapQuoteId | null;
|
|
122
|
-
appData: AppData | AppDataHash;
|
|
123
|
-
appDataHash?: AppDataHash | null;
|
|
124
|
-
};
|
|
125
|
-
export type UnsignedOrderCreation = Omit<OrderCreation, 'signature'> & Partial<Pick<OrderCreation, 'signature'>>;
|
|
126
|
-
export type EthflowData = {
|
|
127
|
-
refundTxHash: string | null;
|
|
128
|
-
userValidTo: number;
|
|
129
|
-
};
|
|
130
|
-
export type OnchainOrderData = {
|
|
131
|
-
sender: Address;
|
|
132
|
-
placementError?: PlacementError;
|
|
133
|
-
};
|
|
134
|
-
export type OrderMetaData = {
|
|
135
|
-
creationDate: string;
|
|
136
|
-
class: OrderClass;
|
|
137
|
-
owner: Address;
|
|
138
|
-
uid: string;
|
|
139
|
-
availableBalance?: string | null;
|
|
140
|
-
sellAmount: string;
|
|
141
|
-
executedSellAmount: string;
|
|
142
|
-
executedSellAmountBeforeFees: string;
|
|
143
|
-
executedBuyAmount: string;
|
|
144
|
-
isLiquidityOrder?: boolean;
|
|
145
|
-
ethflowData?: EthflowData;
|
|
146
|
-
onchainUser?: Address;
|
|
147
|
-
onchainOrderData?: OnchainOrderData;
|
|
148
|
-
executedSurplusFee?: string | null;
|
|
149
|
-
fullAppData?: string | null;
|
|
150
|
-
};
|
|
151
|
-
export type Order = OrderCreation & OrderMetaData & {
|
|
152
|
-
status: OrderStatus;
|
|
153
|
-
};
|
|
154
|
-
export type OrderParameters = {
|
|
155
|
-
sellToken: Address;
|
|
156
|
-
buyToken: Address;
|
|
157
|
-
receiver?: Address | null;
|
|
158
|
-
sellAmount: string;
|
|
159
|
-
buyAmount: string;
|
|
160
|
-
validTo: number;
|
|
161
|
-
appData: AppDataHash;
|
|
162
|
-
feeAmount: string;
|
|
163
|
-
kind: OrderKind;
|
|
164
|
-
partiallyFillable: boolean;
|
|
165
|
-
sellTokenBalance?: SellTokenSource;
|
|
166
|
-
buyTokenBalance?: BuyTokenDestination;
|
|
167
|
-
signingScheme?: SigningScheme;
|
|
168
|
-
};
|
|
169
|
-
export type OrderQuoteResponse = {
|
|
170
|
-
quote: OrderParameters;
|
|
171
|
-
from?: Address;
|
|
172
|
-
expiration: string;
|
|
173
|
-
id?: CowSwapQuoteId;
|
|
174
|
-
verified: boolean;
|
|
175
|
-
};
|
|
176
|
-
export type OrderQuoteSide = {
|
|
177
|
-
kind: OrderQuoteSideKindSell;
|
|
178
|
-
sellAmountBeforeFee: string;
|
|
179
|
-
} | {
|
|
180
|
-
kind: OrderQuoteSideKindSell;
|
|
181
|
-
sellAmountAfterFee: string;
|
|
182
|
-
} | {
|
|
183
|
-
kind: OrderQuoteSideKindBuy;
|
|
184
|
-
buyAmountAfterFee: string;
|
|
185
|
-
};
|
|
186
|
-
export type OrderQuoteValidity = {
|
|
187
|
-
validTo?: number;
|
|
188
|
-
} | {
|
|
189
|
-
validFor?: number;
|
|
190
|
-
};
|
|
191
|
-
export type OrderQuoteRequest = OrderQuoteSide & OrderQuoteValidity & {
|
|
192
|
-
sellToken: Address;
|
|
193
|
-
buyToken: Address;
|
|
194
|
-
receiver?: Address | null;
|
|
195
|
-
appData?: AppData | AppDataHash;
|
|
196
|
-
appDataHash?: AppDataHash;
|
|
197
|
-
sellTokenBalance?: SellTokenSource;
|
|
198
|
-
buyTokenBalance?: BuyTokenDestination;
|
|
199
|
-
from: Address;
|
|
200
|
-
priceQuality?: PriceQuality;
|
|
201
|
-
signingScheme?: SigningScheme;
|
|
202
|
-
onchainOrder?: any;
|
|
203
|
-
};
|
|
204
|
-
export type OrderCancellation = {
|
|
205
|
-
orderUids: string[];
|
|
206
|
-
signature: string;
|
|
207
|
-
signingScheme: EcdsaSigningScheme;
|
|
208
|
-
};
|
|
209
|
-
export type ExecutedAmounts = {
|
|
210
|
-
sell: string;
|
|
211
|
-
buy: string;
|
|
212
|
-
};
|
|
213
|
-
export type CompetitionOrderStatus = {
|
|
214
|
-
type: CompetitionOrderStatusType;
|
|
215
|
-
value?: {
|
|
216
|
-
solver: string;
|
|
217
|
-
executedAmounts?: ExecutedAmounts;
|
|
218
|
-
}[];
|
|
219
|
-
};
|
|
220
|
-
export type Quote = {
|
|
221
|
-
sellAmount?: string;
|
|
222
|
-
buyAmount?: string;
|
|
223
|
-
fee?: string;
|
|
224
|
-
};
|
|
225
|
-
export type PriceImprovement = {
|
|
226
|
-
factor: number;
|
|
227
|
-
maxVolumeFactor: number;
|
|
228
|
-
quote: Quote;
|
|
229
|
-
};
|
|
230
|
-
export type Surplus = {
|
|
231
|
-
factor: number;
|
|
232
|
-
maxVolumeFactor: number;
|
|
233
|
-
};
|
|
234
|
-
export type Volume = {
|
|
235
|
-
factor: number;
|
|
236
|
-
};
|
|
237
|
-
export type FeePolicy = Surplus | Volume | PriceImprovement;
|
|
238
|
-
export type ExecutedProtocolFee = {
|
|
239
|
-
policy?: FeePolicy;
|
|
240
|
-
amount?: string;
|
|
241
|
-
token?: Address;
|
|
242
|
-
};
|
|
243
|
-
export type Trade = {
|
|
244
|
-
blockNumber: number;
|
|
245
|
-
logIndex: number;
|
|
246
|
-
orderUid: string;
|
|
247
|
-
owner: Address;
|
|
248
|
-
sellToken: Address;
|
|
249
|
-
buyToken: Address;
|
|
250
|
-
sellAmount: string;
|
|
251
|
-
sellAmountBeforeFees: string;
|
|
252
|
-
buyAmount: string;
|
|
253
|
-
txHash: string | null;
|
|
254
|
-
executedProtocolFees?: ExecutedProtocolFee[];
|
|
255
|
-
};
|
|
256
|
-
export type CowSwapError = {
|
|
257
|
-
errorType: OrderError;
|
|
258
|
-
description: string;
|
|
259
|
-
data?: unknown;
|
|
260
|
-
};
|
|
261
|
-
export declare enum CowNetwork {
|
|
262
|
-
Mainnet = "mainnet",
|
|
263
|
-
Xdai = "xdai",
|
|
264
|
-
ArbitrumOne = "arbitrum_one",
|
|
265
|
-
Base = "base",
|
|
266
|
-
Avalanche = "avalanche",
|
|
267
|
-
Polygon = "polygon"
|
|
268
|
-
}
|
|
269
|
-
export type CowChainId = KnownChainIds.EthereumMainnet | KnownChainIds.GnosisMainnet | KnownChainIds.ArbitrumMainnet;
|
|
270
|
-
export type TypedDataTypes = Record<string, TypedDataField[]>;
|
|
271
|
-
export type ParsedAppData = AppDataRootSchemaLatest | AppDataRootSchemaLegacy;
|
|
272
|
-
export declare const isLegacyAppData: (appData: ParsedAppData) => appData is AppDataRootSchemaLegacy;
|
package/dist/cjs/cowSwap.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLegacyAppData = exports.CowNetwork = exports.OrderStatus = exports.CompetitionOrderStatusType = exports.OrderError = exports.PriceQuality = exports.OrderQuoteSideKindBuy = exports.OrderQuoteSideKindSell = exports.PlacementError = exports.OrderClass = exports.EcdsaSigningScheme = exports.SigningScheme = exports.BuyTokenDestination = exports.SellTokenSource = exports.OrderKind = exports.TypedDataPrimaryType = void 0;
|
|
4
|
-
// The following are lifted directly out of the cowprotocol source code because ethers version conflicts prevent us importing the SDK directly.
|
|
5
|
-
// https://github.dev/cowprotocol/cow-sdk/blob/main/src/order-book/generated/models/
|
|
6
|
-
var TypedDataPrimaryType;
|
|
7
|
-
(function (TypedDataPrimaryType) {
|
|
8
|
-
TypedDataPrimaryType["Order"] = "Order";
|
|
9
|
-
TypedDataPrimaryType["OrderCancellations"] = "OrderCancellations";
|
|
10
|
-
})(TypedDataPrimaryType || (exports.TypedDataPrimaryType = TypedDataPrimaryType = {}));
|
|
11
|
-
var OrderKind;
|
|
12
|
-
(function (OrderKind) {
|
|
13
|
-
OrderKind["BUY"] = "buy";
|
|
14
|
-
OrderKind["SELL"] = "sell";
|
|
15
|
-
})(OrderKind || (exports.OrderKind = OrderKind = {}));
|
|
16
|
-
var SellTokenSource;
|
|
17
|
-
(function (SellTokenSource) {
|
|
18
|
-
SellTokenSource["ERC20"] = "erc20";
|
|
19
|
-
SellTokenSource["INTERNAL"] = "internal";
|
|
20
|
-
SellTokenSource["EXTERNAL"] = "external";
|
|
21
|
-
})(SellTokenSource || (exports.SellTokenSource = SellTokenSource = {}));
|
|
22
|
-
var BuyTokenDestination;
|
|
23
|
-
(function (BuyTokenDestination) {
|
|
24
|
-
BuyTokenDestination["ERC20"] = "erc20";
|
|
25
|
-
BuyTokenDestination["INTERNAL"] = "internal";
|
|
26
|
-
})(BuyTokenDestination || (exports.BuyTokenDestination = BuyTokenDestination = {}));
|
|
27
|
-
var SigningScheme;
|
|
28
|
-
(function (SigningScheme) {
|
|
29
|
-
SigningScheme["EIP712"] = "eip712";
|
|
30
|
-
SigningScheme["ETHSIGN"] = "ethsign";
|
|
31
|
-
SigningScheme["PRESIGN"] = "presign";
|
|
32
|
-
SigningScheme["EIP1271"] = "eip1271";
|
|
33
|
-
})(SigningScheme || (exports.SigningScheme = SigningScheme = {}));
|
|
34
|
-
var EcdsaSigningScheme;
|
|
35
|
-
(function (EcdsaSigningScheme) {
|
|
36
|
-
EcdsaSigningScheme["EIP712"] = "eip712";
|
|
37
|
-
EcdsaSigningScheme["ETHSIGN"] = "ethsign";
|
|
38
|
-
})(EcdsaSigningScheme || (exports.EcdsaSigningScheme = EcdsaSigningScheme = {}));
|
|
39
|
-
var OrderClass;
|
|
40
|
-
(function (OrderClass) {
|
|
41
|
-
OrderClass["MARKET"] = "market";
|
|
42
|
-
OrderClass["LIMIT"] = "limit";
|
|
43
|
-
OrderClass["LIQUIDITY"] = "liquidity";
|
|
44
|
-
})(OrderClass || (exports.OrderClass = OrderClass = {}));
|
|
45
|
-
var PlacementError;
|
|
46
|
-
(function (PlacementError) {
|
|
47
|
-
PlacementError["QUOTE_NOT_FOUND"] = "QuoteNotFound";
|
|
48
|
-
PlacementError["VALID_TO_TOO_FAR_IN_FUTURE"] = "ValidToTooFarInFuture";
|
|
49
|
-
PlacementError["PRE_VALIDATION_ERROR"] = "PreValidationError";
|
|
50
|
-
})(PlacementError || (exports.PlacementError = PlacementError = {}));
|
|
51
|
-
var OrderQuoteSideKindSell;
|
|
52
|
-
(function (OrderQuoteSideKindSell) {
|
|
53
|
-
OrderQuoteSideKindSell["SELL"] = "sell";
|
|
54
|
-
})(OrderQuoteSideKindSell || (exports.OrderQuoteSideKindSell = OrderQuoteSideKindSell = {}));
|
|
55
|
-
var OrderQuoteSideKindBuy;
|
|
56
|
-
(function (OrderQuoteSideKindBuy) {
|
|
57
|
-
OrderQuoteSideKindBuy["BUY"] = "buy";
|
|
58
|
-
})(OrderQuoteSideKindBuy || (exports.OrderQuoteSideKindBuy = OrderQuoteSideKindBuy = {}));
|
|
59
|
-
var PriceQuality;
|
|
60
|
-
(function (PriceQuality) {
|
|
61
|
-
PriceQuality["FAST"] = "fast";
|
|
62
|
-
PriceQuality["OPTIMAL"] = "optimal";
|
|
63
|
-
PriceQuality["VERIFIED"] = "verified";
|
|
64
|
-
})(PriceQuality || (exports.PriceQuality = PriceQuality = {}));
|
|
65
|
-
var OrderError;
|
|
66
|
-
(function (OrderError) {
|
|
67
|
-
OrderError["DUPLICATED_ORDER"] = "DuplicatedOrder";
|
|
68
|
-
OrderError["QUOTE_NOT_FOUND"] = "QuoteNotFound";
|
|
69
|
-
OrderError["QUOTE_NOT_VERIFIED"] = "QuoteNotVerified";
|
|
70
|
-
OrderError["INVALID_QUOTE"] = "InvalidQuote";
|
|
71
|
-
OrderError["MISSING_FROM"] = "MissingFrom";
|
|
72
|
-
OrderError["WRONG_OWNER"] = "WrongOwner";
|
|
73
|
-
OrderError["INVALID_EIP1271SIGNATURE"] = "InvalidEip1271Signature";
|
|
74
|
-
OrderError["INSUFFICIENT_BALANCE"] = "InsufficientBalance";
|
|
75
|
-
OrderError["INSUFFICIENT_ALLOWANCE"] = "InsufficientAllowance";
|
|
76
|
-
OrderError["INVALID_SIGNATURE"] = "InvalidSignature";
|
|
77
|
-
OrderError["SELL_AMOUNT_OVERFLOW"] = "SellAmountOverflow";
|
|
78
|
-
OrderError["TRANSFER_SIMULATION_FAILED"] = "TransferSimulationFailed";
|
|
79
|
-
OrderError["ZERO_AMOUNT"] = "ZeroAmount";
|
|
80
|
-
OrderError["INCOMPATIBLE_SIGNING_SCHEME"] = "IncompatibleSigningScheme";
|
|
81
|
-
OrderError["TOO_MANY_LIMIT_ORDERS"] = "TooManyLimitOrders";
|
|
82
|
-
OrderError["TOO_MUCH_GAS"] = "TooMuchGas";
|
|
83
|
-
OrderError["UNSUPPORTED_BUY_TOKEN_DESTINATION"] = "UnsupportedBuyTokenDestination";
|
|
84
|
-
OrderError["UNSUPPORTED_SELL_TOKEN_SOURCE"] = "UnsupportedSellTokenSource";
|
|
85
|
-
OrderError["UNSUPPORTED_ORDER_TYPE"] = "UnsupportedOrderType";
|
|
86
|
-
OrderError["INSUFFICIENT_VALID_TO"] = "InsufficientValidTo";
|
|
87
|
-
OrderError["EXCESSIVE_VALID_TO"] = "ExcessiveValidTo";
|
|
88
|
-
OrderError["INVALID_NATIVE_SELL_TOKEN"] = "InvalidNativeSellToken";
|
|
89
|
-
OrderError["SAME_BUY_AND_SELL_TOKEN"] = "SameBuyAndSellToken";
|
|
90
|
-
OrderError["UNSUPPORTED_TOKEN"] = "UnsupportedToken";
|
|
91
|
-
OrderError["INVALID_APP_DATA"] = "InvalidAppData";
|
|
92
|
-
OrderError["APP_DATA_HASH_MISMATCH"] = "AppDataHashMismatch";
|
|
93
|
-
OrderError["APPDATA_FROM_MISMATCH"] = "AppdataFromMismatch";
|
|
94
|
-
// Not documented in API docs, but exists.
|
|
95
|
-
// Most likely non-exhaustive, see https://github.com/cowprotocol/contracts/blob/aaffdc55b2a13738b7c32de96f487d3eb5b4f8c6/src/ts/api.ts#L110
|
|
96
|
-
OrderError["SELL_AMOUNT_DOES_NOT_COVER_FEE"] = "SellAmountDoesNotCoverFee";
|
|
97
|
-
OrderError["NO_LIQUIDITY"] = "NoLiquidity";
|
|
98
|
-
})(OrderError || (exports.OrderError = OrderError = {}));
|
|
99
|
-
var CompetitionOrderStatusType;
|
|
100
|
-
(function (CompetitionOrderStatusType) {
|
|
101
|
-
CompetitionOrderStatusType["OPEN"] = "open";
|
|
102
|
-
CompetitionOrderStatusType["SCHEDULED"] = "scheduled";
|
|
103
|
-
CompetitionOrderStatusType["ACTIVE"] = "active";
|
|
104
|
-
CompetitionOrderStatusType["SOLVED"] = "solved";
|
|
105
|
-
CompetitionOrderStatusType["EXECUTING"] = "executing";
|
|
106
|
-
CompetitionOrderStatusType["TRADED"] = "traded";
|
|
107
|
-
CompetitionOrderStatusType["CANCELLED"] = "cancelled";
|
|
108
|
-
})(CompetitionOrderStatusType || (exports.CompetitionOrderStatusType = CompetitionOrderStatusType = {}));
|
|
109
|
-
var OrderStatus;
|
|
110
|
-
(function (OrderStatus) {
|
|
111
|
-
OrderStatus["PRESIGNATURE_PENDING"] = "presignaturePending";
|
|
112
|
-
OrderStatus["OPEN"] = "open";
|
|
113
|
-
OrderStatus["FULFILLED"] = "fulfilled";
|
|
114
|
-
OrderStatus["CANCELLED"] = "cancelled";
|
|
115
|
-
OrderStatus["EXPIRED"] = "expired";
|
|
116
|
-
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
|
117
|
-
var CowNetwork;
|
|
118
|
-
(function (CowNetwork) {
|
|
119
|
-
CowNetwork["Mainnet"] = "mainnet";
|
|
120
|
-
CowNetwork["Xdai"] = "xdai";
|
|
121
|
-
CowNetwork["ArbitrumOne"] = "arbitrum_one";
|
|
122
|
-
CowNetwork["Base"] = "base";
|
|
123
|
-
CowNetwork["Avalanche"] = "avalanche";
|
|
124
|
-
CowNetwork["Polygon"] = "polygon";
|
|
125
|
-
})(CowNetwork || (exports.CowNetwork = CowNetwork = {}));
|
|
126
|
-
const isLegacyAppData = (appData) => {
|
|
127
|
-
return appData.version === 'v0.4.0';
|
|
128
|
-
};
|
|
129
|
-
exports.isLegacyAppData = isLegacyAppData;
|
package/dist/cjs/index.d.ts
DELETED
package/dist/cjs/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./cowSwap"), exports);
|
|
18
|
-
__exportStar(require("./base"), exports);
|
|
19
|
-
__exportStar(require("./market"), exports);
|
|
20
|
-
__exportStar(require("./utility"), exports);
|
|
21
|
-
__exportStar(require("./zerion"), exports);
|
package/dist/cjs/market.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { AssetId } from '@shapeshiftoss/caip';
|
|
2
|
-
export type MarketData = {
|
|
3
|
-
price: string;
|
|
4
|
-
marketCap: string;
|
|
5
|
-
volume: string;
|
|
6
|
-
changePercent24Hr: number;
|
|
7
|
-
supply?: string;
|
|
8
|
-
maxSupply?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare enum HistoryTimeframe {
|
|
11
|
-
HOUR = "1H",
|
|
12
|
-
DAY = "24H",
|
|
13
|
-
WEEK = "1W",
|
|
14
|
-
MONTH = "1M",
|
|
15
|
-
YEAR = "1Y",
|
|
16
|
-
ALL = "All"
|
|
17
|
-
}
|
|
18
|
-
export type HistoryData = {
|
|
19
|
-
price: number;
|
|
20
|
-
date: number;
|
|
21
|
-
};
|
|
22
|
-
export type PriceHistoryArgs = {
|
|
23
|
-
assetId: string;
|
|
24
|
-
timeframe: HistoryTimeframe;
|
|
25
|
-
};
|
|
26
|
-
export type MarketDataArgs = {
|
|
27
|
-
assetId: string;
|
|
28
|
-
};
|
|
29
|
-
export type FindAllMarketType = (args: FindAllMarketArgs) => Promise<MarketCapResult>;
|
|
30
|
-
export type PriceHistoryType = (args: PriceHistoryArgs) => Promise<HistoryData[]>;
|
|
31
|
-
export type FindAllMarketArgs = {
|
|
32
|
-
count: number;
|
|
33
|
-
};
|
|
34
|
-
export type MarketCapResult = {
|
|
35
|
-
[k: AssetId]: MarketData;
|
|
36
|
-
};
|
package/dist/cjs/market.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HistoryTimeframe = void 0;
|
|
4
|
-
var HistoryTimeframe;
|
|
5
|
-
(function (HistoryTimeframe) {
|
|
6
|
-
HistoryTimeframe["HOUR"] = "1H";
|
|
7
|
-
HistoryTimeframe["DAY"] = "24H";
|
|
8
|
-
HistoryTimeframe["WEEK"] = "1W";
|
|
9
|
-
HistoryTimeframe["MONTH"] = "1M";
|
|
10
|
-
HistoryTimeframe["YEAR"] = "1Y";
|
|
11
|
-
HistoryTimeframe["ALL"] = "All";
|
|
12
|
-
})(HistoryTimeframe || (exports.HistoryTimeframe = HistoryTimeframe = {}));
|
package/dist/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type": "commonjs"}
|
package/dist/cjs/utility.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Further reading on ideas behind these utility types
|
|
3
|
-
*
|
|
4
|
-
* See: https://stackoverflow.com/questions/55904032/how-to-get-optional-property-from-union
|
|
5
|
-
*/
|
|
6
|
-
/** Get specific type for key(K) in union(T) */
|
|
7
|
-
export type ValueOfUnion<T, K> = T extends unknown ? (K extends keyof T ? T[K] : undefined) : never;
|
|
8
|
-
/** Get all keys in union(T) as union */
|
|
9
|
-
export type KeysOfUnion<T> = T extends unknown ? keyof T : never;
|
|
10
|
-
/**
|
|
11
|
-
* Create mapping of all keys in union(T) with proper type values
|
|
12
|
-
*
|
|
13
|
-
* _note: `| keyof T` index is simply to tell typescript that T is definitely a sub type of KeysOfUnion_
|
|
14
|
-
*/
|
|
15
|
-
export type UnionMapping<T> = {
|
|
16
|
-
[K in KeysOfUnion<T> | keyof T]: ValueOfUnion<T, K>;
|
|
17
|
-
};
|
|
18
|
-
/** Pick out the elements we know for sure and make everything else optional */
|
|
19
|
-
export type UnionMerge<T> = Pick<UnionMapping<T>, keyof T> & Partial<UnionMapping<T>>;
|
|
20
|
-
/** Adds all possible values of union(T) as a nested object under a `chainSpecific` key */
|
|
21
|
-
export type ChainSpecific<T, M> = UnionMerge<T extends unknown ? (T extends keyof M ? {
|
|
22
|
-
chainSpecific: M[T];
|
|
23
|
-
} : undefined) : never>;
|
|
24
|
-
export type PartialRecord<K extends keyof any, V> = Partial<Record<K, V>>;
|
|
25
|
-
export type NestedArray<T> = PartialRecord<keyof any, PartialRecord<keyof any, T[]>>;
|
|
26
|
-
type Head<T extends string> = T extends `${infer First}.${string}` ? First : T;
|
|
27
|
-
type Tail<T extends string> = T extends `${string}.${infer Rest}` ? Rest : never;
|
|
28
|
-
export type DeepPick<T, K extends string> = T extends object ? {
|
|
29
|
-
[P in Extract<Head<K>, keyof T>]: Tail<Extract<K, `${P}.${string}`>> extends never ? T[P] : DeepPick<T[P], Tail<Extract<K, `${P}.${string}`>>>;
|
|
30
|
-
} : T;
|
|
31
|
-
export {};
|
package/dist/cjs/utility.js
DELETED
package/dist/cjs/zerion.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ChainId } from '@shapeshiftoss/caip';
|
|
2
|
-
export declare const ZERION_CHAINS: readonly ["avalanche", "binance-smart-chain", "ethereum", "optimism", "polygon", "arbitrum", "xdai", "base"];
|
|
3
|
-
export type ZerionChainId = (typeof ZERION_CHAINS)[number];
|
|
4
|
-
export declare const ZERION_CHAINS_MAP: Record<ZerionChainId, ChainId>;
|
|
5
|
-
export declare const zerionChainIdToChainId: (chainId: ZerionChainId) => ChainId | undefined;
|
package/dist/cjs/zerion.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zerionChainIdToChainId = exports.ZERION_CHAINS_MAP = exports.ZERION_CHAINS = void 0;
|
|
4
|
-
const caip_1 = require("@shapeshiftoss/caip");
|
|
5
|
-
exports.ZERION_CHAINS = [
|
|
6
|
-
// shapeshift supported
|
|
7
|
-
'avalanche',
|
|
8
|
-
'binance-smart-chain',
|
|
9
|
-
'ethereum',
|
|
10
|
-
'optimism',
|
|
11
|
-
'polygon',
|
|
12
|
-
'arbitrum',
|
|
13
|
-
'xdai',
|
|
14
|
-
'base',
|
|
15
|
-
// not yet
|
|
16
|
-
// 'aurora',
|
|
17
|
-
// 'fantom',
|
|
18
|
-
// 'solana',
|
|
19
|
-
];
|
|
20
|
-
exports.ZERION_CHAINS_MAP = {
|
|
21
|
-
avalanche: caip_1.avalancheChainId,
|
|
22
|
-
'binance-smart-chain': caip_1.bscChainId,
|
|
23
|
-
ethereum: caip_1.ethChainId,
|
|
24
|
-
optimism: caip_1.optimismChainId,
|
|
25
|
-
polygon: caip_1.polygonChainId,
|
|
26
|
-
arbitrum: caip_1.arbitrumChainId,
|
|
27
|
-
xdai: caip_1.gnosisChainId,
|
|
28
|
-
base: caip_1.baseChainId,
|
|
29
|
-
};
|
|
30
|
-
const zerionChainIdToChainId = (chainId) => exports.ZERION_CHAINS_MAP[chainId];
|
|
31
|
-
exports.zerionChainIdToChainId = zerionChainIdToChainId;
|