@shapeshiftoss/types 8.6.1 → 8.6.2
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/cjs/.tsbuildinfo +1 -0
- package/dist/{base.d.ts → cjs/base.d.ts} +3 -0
- package/dist/cjs/base.js +34 -0
- package/dist/{cowSwap.d.ts → cjs/cowSwap.d.ts} +3 -1
- package/dist/cjs/cowSwap.js +129 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/market.js +12 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/utility.js +7 -0
- package/dist/cjs/zerion.js +31 -0
- package/dist/esm/.tsbuildinfo +1 -0
- package/dist/esm/base.d.ts +75 -0
- package/dist/esm/cowSwap.d.ts +272 -0
- package/dist/{cowSwap.js → esm/cowSwap.js} +2 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/market.d.ts +36 -0
- package/dist/esm/utility.d.ts +31 -0
- package/dist/esm/zerion.d.ts +5 -0
- package/package.json +20 -8
- package/CHANGELOG.md +0 -665
- package/dist/index.js +0 -5
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{market.d.ts → cjs/market.d.ts} +0 -0
- /package/dist/{utility.d.ts → cjs/utility.d.ts} +0 -0
- /package/dist/{zerion.d.ts → cjs/zerion.d.ts} +0 -0
- /package/dist/{base.js → esm/base.js} +0 -0
- /package/dist/{market.js → esm/market.js} +0 -0
- /package/dist/{utility.js → esm/utility.js} +0 -0
- /package/dist/{zerion.js → esm/zerion.js} +0 -0
|
@@ -0,0 +1,272 @@
|
|
|
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.js';
|
|
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;
|
|
@@ -117,6 +117,8 @@ export var CowNetwork;
|
|
|
117
117
|
CowNetwork["Xdai"] = "xdai";
|
|
118
118
|
CowNetwork["ArbitrumOne"] = "arbitrum_one";
|
|
119
119
|
CowNetwork["Base"] = "base";
|
|
120
|
+
CowNetwork["Avalanche"] = "avalanche";
|
|
121
|
+
CowNetwork["Polygon"] = "polygon";
|
|
120
122
|
})(CowNetwork || (CowNetwork = {}));
|
|
121
123
|
export const isLegacyAppData = (appData) => {
|
|
122
124
|
return appData.version === 'v0.4.0';
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,5 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/types",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.2",
|
|
4
4
|
"description": "Common types shared across packages",
|
|
5
5
|
"repository": "https://github.com/shapeshift/web",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/cjs/index.js",
|
|
9
|
+
"module": "dist/esm/index.js",
|
|
10
|
+
"types": "dist/esm/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"require": "./dist/cjs/index.js",
|
|
15
|
+
"types": "./dist/esm/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
9
18
|
"files": [
|
|
10
19
|
"dist"
|
|
11
20
|
],
|
|
@@ -13,11 +22,14 @@
|
|
|
13
22
|
"access": "public"
|
|
14
23
|
},
|
|
15
24
|
"scripts": {
|
|
16
|
-
"build": "yarn clean && yarn run -T tsc --build",
|
|
17
|
-
"clean": "rm -rf dist
|
|
18
|
-
"dev": "yarn run -T tsc --build --watch"
|
|
25
|
+
"build": "yarn clean && yarn run -T tsc --build && yarn postbuild",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"dev": "yarn run -T tsc --build --watch",
|
|
28
|
+
"postbuild": "yarn postbuild:esm && yarn postbuild:cjs",
|
|
29
|
+
"postbuild:esm": "yarn run -T tsc-esm-fix --target=dist/esm --ext=.js",
|
|
30
|
+
"postbuild:cjs": "echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json"
|
|
19
31
|
},
|
|
20
32
|
"devDependencies": {
|
|
21
|
-
"@shapeshiftoss/caip": "
|
|
33
|
+
"@shapeshiftoss/caip": "workspace:^"
|
|
22
34
|
}
|
|
23
|
-
}
|
|
35
|
+
}
|