@cowprotocol/sdk-bridging 0.12.1 → 1.1.0
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/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +64 -59
- package/dist/index.mjs +46 -42
- package/package.json +11 -11
package/dist/index.d.mts
CHANGED
|
@@ -27,6 +27,10 @@ interface WithBuyToken {
|
|
|
27
27
|
}
|
|
28
28
|
type WithQuoter = Omit<QuoterParameters, 'chainId'>;
|
|
29
29
|
type WithTrader = Pick<TraderParameters, 'signer'>;
|
|
30
|
+
type WithSwapAndBrideSlippage = Partial<{
|
|
31
|
+
swapSlippageBps: cowAppDataLatestScheme.SlippageBips;
|
|
32
|
+
bridgeSlippageBps: cowAppDataLatestScheme.SlippageBips;
|
|
33
|
+
}>;
|
|
30
34
|
/**
|
|
31
35
|
* Parameters for getting a bridge quote
|
|
32
36
|
*/
|
|
@@ -34,7 +38,7 @@ type QuoteBridgeRequest = {
|
|
|
34
38
|
kind: OrderKind;
|
|
35
39
|
amount: bigint;
|
|
36
40
|
owner?: AccountAddress;
|
|
37
|
-
} & WithSellToken & WithBuyToken & WithQuoter & WithTrader & TradeOptionalParameters;
|
|
41
|
+
} & WithSellToken & WithBuyToken & WithQuoter & WithTrader & Omit<TradeOptionalParameters, 'slippageBps'> & WithSwapAndBrideSlippage;
|
|
38
42
|
type QuoteBridgeRequestWithoutAmount = Omit<QuoteBridgeRequest, 'amount'>;
|
|
39
43
|
interface BridgeQuoteResult {
|
|
40
44
|
/**
|
|
@@ -635,6 +639,7 @@ declare const DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION = 200000;
|
|
|
635
639
|
declare const COW_SHED_PROXY_CREATION_GAS = 360000;
|
|
636
640
|
declare const DEFAULT_EXTRA_GAS_PROXY_CREATION = 400000;
|
|
637
641
|
declare const HOOK_DAPP_BRIDGE_PROVIDER_PREFIX = "cow-sdk://bridging/providers";
|
|
642
|
+
declare const DEFAULT_BRIDGE_SLIPPAGE_BPS = 50;
|
|
638
643
|
|
|
639
644
|
interface GetCrossChainOrderParams {
|
|
640
645
|
chainId: SupportedChainId;
|
|
@@ -1296,4 +1301,4 @@ declare class NearIntentsBridgeProvider implements ReceiverAccountBridgeProvider
|
|
|
1296
1301
|
} | null>;
|
|
1297
1302
|
}
|
|
1298
1303
|
|
|
1299
|
-
export { AcrossBridgeProvider, type AcrossBridgeProviderOptions, type AcrossQuoteResult, type BestQuoteProgressCallback, type BestQuoteProviderContext, type BridgeCallDetails, type BridgeCosts, type BridgeDeposit, type BridgeHook, BridgeOrderParsingError, type BridgeProvider, BridgeProviderError, type BridgeProviderInfo, BridgeProviderQuoteError, type BridgeProviderType, type BridgeQuoteAmountsAndCosts, type BridgeQuoteAndPost, BridgeQuoteErrorPriorities, BridgeQuoteErrors, type BridgeQuoteResult, type BridgeQuoteResults, BridgeStatus, type BridgeStatusResult, type BridgingDepositParams, BridgingSdk, BungeeBridgeProvider, type BungeeBridgeProviderOptions, type BungeeQuoteResult, type BuyTokensParams, COW_SHED_PROXY_CREATION_GAS, type CrossChainOrder, type CrossChainQuoteAndPost, DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION, DEFAULT_EXTRA_GAS_PROXY_CREATION, DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION, type DefaultBridgeProvider, type GetProviderBuyTokens, HOOK_DAPP_BRIDGE_PROVIDER_PREFIX, type HookBridgeProvider, type MultiQuoteOptions, type MultiQuoteProgressCallback, type MultiQuoteRequest, type MultiQuoteResult, NearIntentsBridgeProvider, type NearIntentsBridgeProviderOptions, type NearIntentsQuoteResult, type ProviderQuoteContext, type QuoteBridgeRequest, type QuoteBridgeRequestWithoutAmount, RAW_PROVIDERS_FILES_PATH, type ReceiverAccountBridgeProvider, assertIsBridgeQuoteAndPost, assertIsQuoteAndPost, getCrossChainOrder, getPostHooks, isAppDoc, isBridgeQuoteAndPost, isHookBridgeProvider, isQuoteAndPost, isReceiverAccountBridgeProvider };
|
|
1304
|
+
export { AcrossBridgeProvider, type AcrossBridgeProviderOptions, type AcrossQuoteResult, type BestQuoteProgressCallback, type BestQuoteProviderContext, type BridgeCallDetails, type BridgeCosts, type BridgeDeposit, type BridgeHook, BridgeOrderParsingError, type BridgeProvider, BridgeProviderError, type BridgeProviderInfo, BridgeProviderQuoteError, type BridgeProviderType, type BridgeQuoteAmountsAndCosts, type BridgeQuoteAndPost, BridgeQuoteErrorPriorities, BridgeQuoteErrors, type BridgeQuoteResult, type BridgeQuoteResults, BridgeStatus, type BridgeStatusResult, type BridgingDepositParams, BridgingSdk, BungeeBridgeProvider, type BungeeBridgeProviderOptions, type BungeeQuoteResult, type BuyTokensParams, COW_SHED_PROXY_CREATION_GAS, type CrossChainOrder, type CrossChainQuoteAndPost, DEFAULT_BRIDGE_SLIPPAGE_BPS, DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION, DEFAULT_EXTRA_GAS_PROXY_CREATION, DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION, type DefaultBridgeProvider, type GetProviderBuyTokens, HOOK_DAPP_BRIDGE_PROVIDER_PREFIX, type HookBridgeProvider, type MultiQuoteContext, type MultiQuoteOptions, type MultiQuoteProgressCallback, type MultiQuoteRequest, type MultiQuoteResult, NearIntentsBridgeProvider, type NearIntentsBridgeProviderOptions, type NearIntentsQuoteResult, type ProviderQuoteContext, type QuoteBridgeRequest, type QuoteBridgeRequestWithoutAmount, RAW_PROVIDERS_FILES_PATH, type ReceiverAccountBridgeProvider, assertIsBridgeQuoteAndPost, assertIsQuoteAndPost, getCrossChainOrder, getPostHooks, isAppDoc, isBridgeQuoteAndPost, isHookBridgeProvider, isQuoteAndPost, isReceiverAccountBridgeProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,10 @@ interface WithBuyToken {
|
|
|
27
27
|
}
|
|
28
28
|
type WithQuoter = Omit<QuoterParameters, 'chainId'>;
|
|
29
29
|
type WithTrader = Pick<TraderParameters, 'signer'>;
|
|
30
|
+
type WithSwapAndBrideSlippage = Partial<{
|
|
31
|
+
swapSlippageBps: cowAppDataLatestScheme.SlippageBips;
|
|
32
|
+
bridgeSlippageBps: cowAppDataLatestScheme.SlippageBips;
|
|
33
|
+
}>;
|
|
30
34
|
/**
|
|
31
35
|
* Parameters for getting a bridge quote
|
|
32
36
|
*/
|
|
@@ -34,7 +38,7 @@ type QuoteBridgeRequest = {
|
|
|
34
38
|
kind: OrderKind;
|
|
35
39
|
amount: bigint;
|
|
36
40
|
owner?: AccountAddress;
|
|
37
|
-
} & WithSellToken & WithBuyToken & WithQuoter & WithTrader & TradeOptionalParameters;
|
|
41
|
+
} & WithSellToken & WithBuyToken & WithQuoter & WithTrader & Omit<TradeOptionalParameters, 'slippageBps'> & WithSwapAndBrideSlippage;
|
|
38
42
|
type QuoteBridgeRequestWithoutAmount = Omit<QuoteBridgeRequest, 'amount'>;
|
|
39
43
|
interface BridgeQuoteResult {
|
|
40
44
|
/**
|
|
@@ -635,6 +639,7 @@ declare const DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION = 200000;
|
|
|
635
639
|
declare const COW_SHED_PROXY_CREATION_GAS = 360000;
|
|
636
640
|
declare const DEFAULT_EXTRA_GAS_PROXY_CREATION = 400000;
|
|
637
641
|
declare const HOOK_DAPP_BRIDGE_PROVIDER_PREFIX = "cow-sdk://bridging/providers";
|
|
642
|
+
declare const DEFAULT_BRIDGE_SLIPPAGE_BPS = 50;
|
|
638
643
|
|
|
639
644
|
interface GetCrossChainOrderParams {
|
|
640
645
|
chainId: SupportedChainId;
|
|
@@ -1296,4 +1301,4 @@ declare class NearIntentsBridgeProvider implements ReceiverAccountBridgeProvider
|
|
|
1296
1301
|
} | null>;
|
|
1297
1302
|
}
|
|
1298
1303
|
|
|
1299
|
-
export { AcrossBridgeProvider, type AcrossBridgeProviderOptions, type AcrossQuoteResult, type BestQuoteProgressCallback, type BestQuoteProviderContext, type BridgeCallDetails, type BridgeCosts, type BridgeDeposit, type BridgeHook, BridgeOrderParsingError, type BridgeProvider, BridgeProviderError, type BridgeProviderInfo, BridgeProviderQuoteError, type BridgeProviderType, type BridgeQuoteAmountsAndCosts, type BridgeQuoteAndPost, BridgeQuoteErrorPriorities, BridgeQuoteErrors, type BridgeQuoteResult, type BridgeQuoteResults, BridgeStatus, type BridgeStatusResult, type BridgingDepositParams, BridgingSdk, BungeeBridgeProvider, type BungeeBridgeProviderOptions, type BungeeQuoteResult, type BuyTokensParams, COW_SHED_PROXY_CREATION_GAS, type CrossChainOrder, type CrossChainQuoteAndPost, DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION, DEFAULT_EXTRA_GAS_PROXY_CREATION, DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION, type DefaultBridgeProvider, type GetProviderBuyTokens, HOOK_DAPP_BRIDGE_PROVIDER_PREFIX, type HookBridgeProvider, type MultiQuoteOptions, type MultiQuoteProgressCallback, type MultiQuoteRequest, type MultiQuoteResult, NearIntentsBridgeProvider, type NearIntentsBridgeProviderOptions, type NearIntentsQuoteResult, type ProviderQuoteContext, type QuoteBridgeRequest, type QuoteBridgeRequestWithoutAmount, RAW_PROVIDERS_FILES_PATH, type ReceiverAccountBridgeProvider, assertIsBridgeQuoteAndPost, assertIsQuoteAndPost, getCrossChainOrder, getPostHooks, isAppDoc, isBridgeQuoteAndPost, isHookBridgeProvider, isQuoteAndPost, isReceiverAccountBridgeProvider };
|
|
1304
|
+
export { AcrossBridgeProvider, type AcrossBridgeProviderOptions, type AcrossQuoteResult, type BestQuoteProgressCallback, type BestQuoteProviderContext, type BridgeCallDetails, type BridgeCosts, type BridgeDeposit, type BridgeHook, BridgeOrderParsingError, type BridgeProvider, BridgeProviderError, type BridgeProviderInfo, BridgeProviderQuoteError, type BridgeProviderType, type BridgeQuoteAmountsAndCosts, type BridgeQuoteAndPost, BridgeQuoteErrorPriorities, BridgeQuoteErrors, type BridgeQuoteResult, type BridgeQuoteResults, BridgeStatus, type BridgeStatusResult, type BridgingDepositParams, BridgingSdk, BungeeBridgeProvider, type BungeeBridgeProviderOptions, type BungeeQuoteResult, type BuyTokensParams, COW_SHED_PROXY_CREATION_GAS, type CrossChainOrder, type CrossChainQuoteAndPost, DEFAULT_BRIDGE_SLIPPAGE_BPS, DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION, DEFAULT_EXTRA_GAS_PROXY_CREATION, DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION, type DefaultBridgeProvider, type GetProviderBuyTokens, HOOK_DAPP_BRIDGE_PROVIDER_PREFIX, type HookBridgeProvider, type MultiQuoteContext, type MultiQuoteOptions, type MultiQuoteProgressCallback, type MultiQuoteRequest, type MultiQuoteResult, NearIntentsBridgeProvider, type NearIntentsBridgeProviderOptions, type NearIntentsQuoteResult, type ProviderQuoteContext, type QuoteBridgeRequest, type QuoteBridgeRequestWithoutAmount, RAW_PROVIDERS_FILES_PATH, type ReceiverAccountBridgeProvider, assertIsBridgeQuoteAndPost, assertIsQuoteAndPost, getCrossChainOrder, getPostHooks, isAppDoc, isBridgeQuoteAndPost, isHookBridgeProvider, isQuoteAndPost, isReceiverAccountBridgeProvider };
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
BridgingSdk: () => BridgingSdk,
|
|
41
41
|
BungeeBridgeProvider: () => BungeeBridgeProvider,
|
|
42
42
|
COW_SHED_PROXY_CREATION_GAS: () => COW_SHED_PROXY_CREATION_GAS,
|
|
43
|
+
DEFAULT_BRIDGE_SLIPPAGE_BPS: () => DEFAULT_BRIDGE_SLIPPAGE_BPS,
|
|
43
44
|
DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION: () => DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION,
|
|
44
45
|
DEFAULT_EXTRA_GAS_PROXY_CREATION: () => DEFAULT_EXTRA_GAS_PROXY_CREATION,
|
|
45
46
|
DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION: () => DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION,
|
|
@@ -164,6 +165,7 @@ var DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION = 2e5;
|
|
|
164
165
|
var COW_SHED_PROXY_CREATION_GAS = 36e4;
|
|
165
166
|
var DEFAULT_EXTRA_GAS_PROXY_CREATION = 4e5;
|
|
166
167
|
var HOOK_DAPP_BRIDGE_PROVIDER_PREFIX = "cow-sdk://bridging/providers";
|
|
168
|
+
var DEFAULT_BRIDGE_SLIPPAGE_BPS = 50;
|
|
167
169
|
|
|
168
170
|
// src/BridgingSdk/findBridgeProviderFromHook.ts
|
|
169
171
|
function findBridgeProviderFromHook(fullAppData, providers) {
|
|
@@ -233,7 +235,7 @@ async function getCrossChainOrder(params) {
|
|
|
233
235
|
|
|
234
236
|
// src/BridgingSdk/BridgingSdk.ts
|
|
235
237
|
var import_sdk_trading2 = require("@cowprotocol/sdk-trading");
|
|
236
|
-
var
|
|
238
|
+
var import_sdk_order_book3 = require("@cowprotocol/sdk-order-book");
|
|
237
239
|
var import_sdk_config3 = require("@cowprotocol/sdk-config");
|
|
238
240
|
var import_sdk_common5 = require("@cowprotocol/sdk-common");
|
|
239
241
|
|
|
@@ -538,7 +540,9 @@ async function getSwapQuote(params) {
|
|
|
538
540
|
sellTokenAddress,
|
|
539
541
|
buyTokenChainId: _buyTokenChainId,
|
|
540
542
|
buyTokenAddress: _buyTokenAddress,
|
|
543
|
+
bridgeSlippageBps: _bridgeSlippageBps,
|
|
541
544
|
amount,
|
|
545
|
+
swapSlippageBps,
|
|
542
546
|
...rest
|
|
543
547
|
} = swapAndBridgeRequest;
|
|
544
548
|
const { sellTokenAddress: intermediateToken, sellTokenDecimals: intermediaryTokenDecimals } = bridgeRequestWithoutAmount;
|
|
@@ -550,6 +554,7 @@ async function getSwapQuote(params) {
|
|
|
550
554
|
buyToken: intermediateToken,
|
|
551
555
|
buyTokenDecimals: intermediaryTokenDecimals,
|
|
552
556
|
amount: amount.toString(),
|
|
557
|
+
slippageBps: swapSlippageBps,
|
|
553
558
|
signer
|
|
554
559
|
};
|
|
555
560
|
const { signer: _, ...swapParamsToLog } = swapParams;
|
|
@@ -880,6 +885,7 @@ var SingleQuoteStrategy = class extends BaseSingleQuoteStrategy {
|
|
|
880
885
|
};
|
|
881
886
|
|
|
882
887
|
// src/BridgingSdk/utils.ts
|
|
888
|
+
var import_sdk_order_book2 = require("@cowprotocol/sdk-order-book");
|
|
883
889
|
function validateCrossChainRequest(sellTokenChainId, buyTokenChainId) {
|
|
884
890
|
if (sellTokenChainId === buyTokenChainId) {
|
|
885
891
|
throw new BridgeProviderError(
|
|
@@ -966,6 +972,9 @@ function resolveProvidersToQuery(providerDappIds, providers) {
|
|
|
966
972
|
function getErrorPriority(error) {
|
|
967
973
|
if (!error)
|
|
968
974
|
return 0;
|
|
975
|
+
if (error instanceof import_sdk_order_book2.OrderBookApiError) {
|
|
976
|
+
return 10;
|
|
977
|
+
}
|
|
969
978
|
if (error instanceof BridgeProviderQuoteError) {
|
|
970
979
|
return BridgeQuoteErrorPriorities[error.message] ?? 0;
|
|
971
980
|
}
|
|
@@ -983,6 +992,34 @@ function isBetterError(error1, error2) {
|
|
|
983
992
|
return priority1 > priority2;
|
|
984
993
|
}
|
|
985
994
|
|
|
995
|
+
// src/BridgingSdk/strategies/utils.ts
|
|
996
|
+
async function fetchMultiQuote(context, tradingSdk, intermediateTokensCache) {
|
|
997
|
+
const { provider, quoteBridgeRequest, advancedSettings, providerTimeout } = context;
|
|
998
|
+
const supportedNetworks = await provider.getNetworks();
|
|
999
|
+
const destinationNetwork = supportedNetworks.find((i) => i.id === quoteBridgeRequest.buyTokenChainId);
|
|
1000
|
+
if (!destinationNetwork)
|
|
1001
|
+
return;
|
|
1002
|
+
const baseParams = {
|
|
1003
|
+
swapAndBridgeRequest: quoteBridgeRequest,
|
|
1004
|
+
advancedSettings,
|
|
1005
|
+
tradingSdk,
|
|
1006
|
+
quoteSigner: advancedSettings?.quoteSigner
|
|
1007
|
+
};
|
|
1008
|
+
const request = intermediateTokensCache ? {
|
|
1009
|
+
...baseParams,
|
|
1010
|
+
intermediateTokensCache
|
|
1011
|
+
} : baseParams;
|
|
1012
|
+
const quote = await Promise.race([
|
|
1013
|
+
getQuoteWithBridge(provider, request),
|
|
1014
|
+
createBridgeRequestTimeoutPromise(providerTimeout, `Provider ${provider.info.dappId}`)
|
|
1015
|
+
]);
|
|
1016
|
+
return {
|
|
1017
|
+
providerDappId: provider.info.dappId,
|
|
1018
|
+
quote,
|
|
1019
|
+
error: void 0
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
|
|
986
1023
|
// src/BridgingSdk/strategies/MultiQuoteStrategy.ts
|
|
987
1024
|
var DEFAULT_TOTAL_TIMEOUT_MS = 4e4;
|
|
988
1025
|
var DEFAULT_PROVIDER_TIMEOUT_MS = 2e4;
|
|
@@ -1032,28 +1069,12 @@ var MultiQuoteStrategy = class extends BaseMultiQuoteStrategy {
|
|
|
1032
1069
|
return results;
|
|
1033
1070
|
}
|
|
1034
1071
|
createProviderQuotePromise(context, tradingSdk) {
|
|
1035
|
-
const { provider,
|
|
1072
|
+
const { provider, onQuoteResult, results, index } = context;
|
|
1036
1073
|
return (async () => {
|
|
1037
1074
|
try {
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
tradingSdk,
|
|
1042
|
-
quoteSigner: advancedSettings?.quoteSigner
|
|
1043
|
-
};
|
|
1044
|
-
const request = this.intermediateTokensCache ? {
|
|
1045
|
-
...baseParams,
|
|
1046
|
-
intermediateTokensCache: this.intermediateTokensCache
|
|
1047
|
-
} : baseParams;
|
|
1048
|
-
const quote = await Promise.race([
|
|
1049
|
-
getQuoteWithBridge(provider, request),
|
|
1050
|
-
createBridgeRequestTimeoutPromise(providerTimeout, `Provider ${provider.info.dappId}`)
|
|
1051
|
-
]);
|
|
1052
|
-
const result = {
|
|
1053
|
-
providerDappId: provider.info.dappId,
|
|
1054
|
-
quote,
|
|
1055
|
-
error: void 0
|
|
1056
|
-
};
|
|
1075
|
+
const result = await fetchMultiQuote(context, tradingSdk, this.intermediateTokensCache);
|
|
1076
|
+
if (!result)
|
|
1077
|
+
return;
|
|
1057
1078
|
results[index] = result;
|
|
1058
1079
|
safeCallProgressiveCallback(onQuoteResult, result);
|
|
1059
1080
|
} catch (error) {
|
|
@@ -1107,29 +1128,12 @@ var BestQuoteStrategy = class extends BaseBestQuoteStrategy {
|
|
|
1107
1128
|
return bestResult.current || bestError.current;
|
|
1108
1129
|
}
|
|
1109
1130
|
createBestQuoteProviderPromise(context, tradingSdk) {
|
|
1110
|
-
const { provider,
|
|
1131
|
+
const { provider, onQuoteResult, bestResult, bestError } = context;
|
|
1111
1132
|
return (async () => {
|
|
1112
1133
|
try {
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
tradingSdk,
|
|
1117
|
-
provider,
|
|
1118
|
-
quoteSigner: advancedSettings?.quoteSigner
|
|
1119
|
-
};
|
|
1120
|
-
const request = this.intermediateTokensCache ? {
|
|
1121
|
-
...baseParams,
|
|
1122
|
-
intermediateTokensCache: this.intermediateTokensCache
|
|
1123
|
-
} : baseParams;
|
|
1124
|
-
const quote = await Promise.race([
|
|
1125
|
-
getQuoteWithBridge(provider, request),
|
|
1126
|
-
createBridgeRequestTimeoutPromise(providerTimeout, `Provider ${provider.info.dappId}`)
|
|
1127
|
-
]);
|
|
1128
|
-
const result = {
|
|
1129
|
-
providerDappId: provider.info.dappId,
|
|
1130
|
-
quote,
|
|
1131
|
-
error: void 0
|
|
1132
|
-
};
|
|
1134
|
+
const result = await fetchMultiQuote(context, tradingSdk, this.intermediateTokensCache);
|
|
1135
|
+
if (!result)
|
|
1136
|
+
return;
|
|
1133
1137
|
if (isBetterQuote(result, bestResult.current)) {
|
|
1134
1138
|
bestResult.current = result;
|
|
1135
1139
|
safeCallBestQuoteCallback(onQuoteResult, result);
|
|
@@ -1180,7 +1184,7 @@ var BridgingSdk = class {
|
|
|
1180
1184
|
(0, import_sdk_common5.enableLogging)(options.enableLogging);
|
|
1181
1185
|
}
|
|
1182
1186
|
const tradingSdk = options.tradingSdk ?? new import_sdk_trading2.TradingSdk();
|
|
1183
|
-
const orderBookApi = tradingSdk?.options.orderBookApi ?? new
|
|
1187
|
+
const orderBookApi = tradingSdk?.options.orderBookApi ?? new import_sdk_order_book3.OrderBookApi();
|
|
1184
1188
|
this.config = {
|
|
1185
1189
|
...restOptions,
|
|
1186
1190
|
providers,
|
|
@@ -1573,13 +1577,13 @@ var ACROSS_MATH_CONTRACT_ADDRESSES = {
|
|
|
1573
1577
|
|
|
1574
1578
|
// src/providers/across/util.ts
|
|
1575
1579
|
var import_sdk_config5 = require("@cowprotocol/sdk-config");
|
|
1576
|
-
var
|
|
1580
|
+
var import_sdk_order_book4 = require("@cowprotocol/sdk-order-book");
|
|
1577
1581
|
var import_sdk_common8 = require("@cowprotocol/sdk-common");
|
|
1578
1582
|
var PCT_100_PERCENT = 10n ** 18n;
|
|
1579
1583
|
function toBridgeQuoteResult(request, slippageBps, suggestedFees) {
|
|
1580
1584
|
const { kind } = request;
|
|
1581
1585
|
return {
|
|
1582
|
-
isSell: kind ===
|
|
1586
|
+
isSell: kind === import_sdk_order_book4.OrderKind.SELL,
|
|
1583
1587
|
amountsAndCosts: toAmountsAndCosts(request, slippageBps, suggestedFees),
|
|
1584
1588
|
quoteTimestamp: Number(suggestedFees.timestamp),
|
|
1585
1589
|
expectedFillTimeSeconds: Number(suggestedFees.estimatedFillTimeSec),
|
|
@@ -1596,9 +1600,9 @@ function toBridgeQuoteResult(request, slippageBps, suggestedFees) {
|
|
|
1596
1600
|
}
|
|
1597
1601
|
function toAmountsAndCosts(request, slippageBps, suggestedFees) {
|
|
1598
1602
|
const { amount, sellTokenDecimals, buyTokenDecimals } = request;
|
|
1599
|
-
const sellAmountBeforeFeeBig = (0,
|
|
1603
|
+
const sellAmountBeforeFeeBig = (0, import_sdk_order_book4.getBigNumber)(amount, sellTokenDecimals);
|
|
1600
1604
|
const sellAmountBeforeFee = sellAmountBeforeFeeBig.big;
|
|
1601
|
-
const buyAmountBeforeFee = (0,
|
|
1605
|
+
const buyAmountBeforeFee = (0, import_sdk_order_book4.getBigNumber)(sellAmountBeforeFeeBig.num, buyTokenDecimals).big;
|
|
1602
1606
|
const totalRelayerFeePct = BigInt(suggestedFees.totalRelayFee.pct);
|
|
1603
1607
|
const buyAmountAfterFee = applyPctFee(buyAmountBeforeFee, totalRelayerFeePct);
|
|
1604
1608
|
const feeSellToken = sellAmountBeforeFee - applyPctFee(sellAmountBeforeFee, totalRelayerFeePct);
|
|
@@ -3639,7 +3643,7 @@ async function getGasLimitEstimationForHook({
|
|
|
3639
3643
|
var import_sdk_common12 = require("@cowprotocol/sdk-common");
|
|
3640
3644
|
var import_sdk_config6 = require("@cowprotocol/sdk-config");
|
|
3641
3645
|
var import_sdk_cow_shed = require("@cowprotocol/sdk-cow-shed");
|
|
3642
|
-
var
|
|
3646
|
+
var import_sdk_order_book5 = require("@cowprotocol/sdk-order-book");
|
|
3643
3647
|
var ACROSS_HOOK_DAPP_ID = `${HOOK_DAPP_BRIDGE_PROVIDER_PREFIX}/across`;
|
|
3644
3648
|
var ACROSS_SUPPORTED_NETWORKS = [import_sdk_config6.mainnet, import_sdk_config6.polygon, import_sdk_config6.arbitrumOne, import_sdk_config6.base, import_sdk_config6.optimism];
|
|
3645
3649
|
var SLIPPAGE_TOLERANCE_BPS = 0;
|
|
@@ -3676,7 +3680,7 @@ var AcrossBridgeProvider = class {
|
|
|
3676
3680
|
};
|
|
3677
3681
|
}
|
|
3678
3682
|
async getIntermediateTokens(request) {
|
|
3679
|
-
if (request.kind !==
|
|
3683
|
+
if (request.kind !== import_sdk_order_book5.OrderKind.SELL) {
|
|
3680
3684
|
throw new BridgeProviderQuoteError("ONLY_SELL_ORDER_SUPPORTED" /* ONLY_SELL_ORDER_SUPPORTED */, { kind: request.kind });
|
|
3681
3685
|
}
|
|
3682
3686
|
const { sellTokenChainId, buyTokenChainId, buyTokenAddress } = request;
|
|
@@ -3797,7 +3801,7 @@ var AcrossBridgeProvider = class {
|
|
|
3797
3801
|
};
|
|
3798
3802
|
|
|
3799
3803
|
// src/providers/bungee/BungeeBridgeProvider.ts
|
|
3800
|
-
var
|
|
3804
|
+
var import_sdk_order_book7 = require("@cowprotocol/sdk-order-book");
|
|
3801
3805
|
|
|
3802
3806
|
// src/providers/bungee/const/misc.ts
|
|
3803
3807
|
var HOOK_DAPP_BRIDGE_PROVIDER_PREFIX2 = "cow-sdk://bridging/providers";
|
|
@@ -3883,13 +3887,13 @@ var BungeeBridgeNames = {
|
|
|
3883
3887
|
};
|
|
3884
3888
|
|
|
3885
3889
|
// src/providers/bungee/util.ts
|
|
3886
|
-
var
|
|
3890
|
+
var import_sdk_order_book6 = require("@cowprotocol/sdk-order-book");
|
|
3887
3891
|
function toBridgeQuoteResult2(request, slippageBps, bungeeQuoteWithBuildTx) {
|
|
3888
3892
|
const { kind } = request;
|
|
3889
3893
|
const { bungeeQuote, buildTx } = bungeeQuoteWithBuildTx;
|
|
3890
3894
|
return {
|
|
3891
3895
|
id: bungeeQuoteWithBuildTx.bungeeQuote.route.quoteId.toString(),
|
|
3892
|
-
isSell: kind ===
|
|
3896
|
+
isSell: kind === import_sdk_order_book6.OrderKind.SELL,
|
|
3893
3897
|
amountsAndCosts: toAmountsAndCosts2(request, slippageBps, bungeeQuote),
|
|
3894
3898
|
quoteTimestamp: Number(bungeeQuote.quoteTimestamp),
|
|
3895
3899
|
expectedFillTimeSeconds: Number(bungeeQuote.route.estimatedTime),
|
|
@@ -3911,10 +3915,10 @@ function toBridgeQuoteResult2(request, slippageBps, bungeeQuoteWithBuildTx) {
|
|
|
3911
3915
|
}
|
|
3912
3916
|
function toAmountsAndCosts2(request, slippageBps, bungeeQuote) {
|
|
3913
3917
|
const { amount, sellTokenDecimals, buyTokenDecimals } = request;
|
|
3914
|
-
const sellAmountBeforeFeeBig = (0,
|
|
3918
|
+
const sellAmountBeforeFeeBig = (0, import_sdk_order_book6.getBigNumber)(amount, sellTokenDecimals);
|
|
3915
3919
|
const sellAmountBeforeFee = sellAmountBeforeFeeBig.big;
|
|
3916
3920
|
const buyAmountFromBungeeQuote = bungeeQuote.route.output.amount;
|
|
3917
|
-
const buyAmountBeforeFee = (0,
|
|
3921
|
+
const buyAmountBeforeFee = (0, import_sdk_order_book6.getBigNumber)(buyAmountFromBungeeQuote, buyTokenDecimals).big;
|
|
3918
3922
|
const buyAmountAfterFee = buyAmountBeforeFee;
|
|
3919
3923
|
const feeSellToken = bungeeQuote.route.routeDetails.routeFee.amount;
|
|
3920
3924
|
const feeBuyToken = sellAmountBeforeFee > 0n ? BigInt(feeSellToken) * buyAmountBeforeFee / sellAmountBeforeFee : 0n;
|
|
@@ -4815,7 +4819,7 @@ var BungeeBridgeProvider = class {
|
|
|
4815
4819
|
};
|
|
4816
4820
|
}
|
|
4817
4821
|
async getIntermediateTokens(request) {
|
|
4818
|
-
if (request.kind !==
|
|
4822
|
+
if (request.kind !== import_sdk_order_book7.OrderKind.SELL) {
|
|
4819
4823
|
throw new BridgeProviderQuoteError("ONLY_SELL_ORDER_SUPPORTED" /* ONLY_SELL_ORDER_SUPPORTED */, { kind: request.kind });
|
|
4820
4824
|
}
|
|
4821
4825
|
return this.api.getIntermediateTokens({
|
|
@@ -4943,7 +4947,7 @@ var BungeeBridgeProvider = class {
|
|
|
4943
4947
|
var import_sdk_common17 = require("@cowprotocol/sdk-common");
|
|
4944
4948
|
var import_sdk_config12 = require("@cowprotocol/sdk-config");
|
|
4945
4949
|
var import_sdk_cow_shed3 = require("@cowprotocol/sdk-cow-shed");
|
|
4946
|
-
var
|
|
4950
|
+
var import_sdk_order_book8 = require("@cowprotocol/sdk-order-book");
|
|
4947
4951
|
var import_one_click_sdk_typescript2 = require("@defuse-protocol/one-click-sdk-typescript");
|
|
4948
4952
|
|
|
4949
4953
|
// src/providers/near-intents/NearIntentsApi.ts
|
|
@@ -5154,7 +5158,7 @@ var NearIntentsBridgeProvider = class {
|
|
|
5154
5158
|
};
|
|
5155
5159
|
}
|
|
5156
5160
|
async getIntermediateTokens(request) {
|
|
5157
|
-
if (request.kind !==
|
|
5161
|
+
if (request.kind !== import_sdk_order_book8.OrderKind.SELL) {
|
|
5158
5162
|
throw new BridgeProviderQuoteError("ONLY_SELL_ORDER_SUPPORTED" /* ONLY_SELL_ORDER_SUPPORTED */, { kind: request.kind });
|
|
5159
5163
|
}
|
|
5160
5164
|
const { sellTokenChainId, buyTokenChainId, buyTokenAddress, sellTokenAddress } = request;
|
|
@@ -5201,7 +5205,7 @@ var NearIntentsBridgeProvider = class {
|
|
|
5201
5205
|
const quoteResponse = await this.api.getQuote({
|
|
5202
5206
|
dry: false,
|
|
5203
5207
|
swapType: import_one_click_sdk_typescript2.QuoteRequest.swapType.FLEX_INPUT,
|
|
5204
|
-
slippageTolerance: request.
|
|
5208
|
+
slippageTolerance: request.bridgeSlippageBps ?? DEFAULT_BRIDGE_SLIPPAGE_BPS,
|
|
5205
5209
|
originAsset: sellToken.assetId,
|
|
5206
5210
|
depositType: import_one_click_sdk_typescript2.QuoteRequest.depositType.ORIGIN_CHAIN,
|
|
5207
5211
|
destinationAsset: buyToken.assetId,
|
|
@@ -5227,7 +5231,7 @@ var NearIntentsBridgeProvider = class {
|
|
|
5227
5231
|
return {
|
|
5228
5232
|
id: recoveredDepositAddress.quoteHash,
|
|
5229
5233
|
signature: quoteResponse.signature,
|
|
5230
|
-
isSell: request.kind ===
|
|
5234
|
+
isSell: request.kind === import_sdk_order_book8.OrderKind.SELL,
|
|
5231
5235
|
depositAddress: quote.depositAddress,
|
|
5232
5236
|
quoteTimestamp: new Date(isoDate).getTime(),
|
|
5233
5237
|
expectedFillTimeSeconds: quote.timeEstimate,
|
|
@@ -5375,6 +5379,7 @@ var NearIntentsBridgeProvider = class {
|
|
|
5375
5379
|
BridgingSdk,
|
|
5376
5380
|
BungeeBridgeProvider,
|
|
5377
5381
|
COW_SHED_PROXY_CREATION_GAS,
|
|
5382
|
+
DEFAULT_BRIDGE_SLIPPAGE_BPS,
|
|
5378
5383
|
DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION,
|
|
5379
5384
|
DEFAULT_EXTRA_GAS_PROXY_CREATION,
|
|
5380
5385
|
DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION,
|
package/dist/index.mjs
CHANGED
|
@@ -104,6 +104,7 @@ var DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION = 2e5;
|
|
|
104
104
|
var COW_SHED_PROXY_CREATION_GAS = 36e4;
|
|
105
105
|
var DEFAULT_EXTRA_GAS_PROXY_CREATION = 4e5;
|
|
106
106
|
var HOOK_DAPP_BRIDGE_PROVIDER_PREFIX = "cow-sdk://bridging/providers";
|
|
107
|
+
var DEFAULT_BRIDGE_SLIPPAGE_BPS = 50;
|
|
107
108
|
|
|
108
109
|
// src/BridgingSdk/findBridgeProviderFromHook.ts
|
|
109
110
|
function findBridgeProviderFromHook(fullAppData, providers) {
|
|
@@ -482,7 +483,9 @@ async function getSwapQuote(params) {
|
|
|
482
483
|
sellTokenAddress,
|
|
483
484
|
buyTokenChainId: _buyTokenChainId,
|
|
484
485
|
buyTokenAddress: _buyTokenAddress,
|
|
486
|
+
bridgeSlippageBps: _bridgeSlippageBps,
|
|
485
487
|
amount,
|
|
488
|
+
swapSlippageBps,
|
|
486
489
|
...rest
|
|
487
490
|
} = swapAndBridgeRequest;
|
|
488
491
|
const { sellTokenAddress: intermediateToken, sellTokenDecimals: intermediaryTokenDecimals } = bridgeRequestWithoutAmount;
|
|
@@ -494,6 +497,7 @@ async function getSwapQuote(params) {
|
|
|
494
497
|
buyToken: intermediateToken,
|
|
495
498
|
buyTokenDecimals: intermediaryTokenDecimals,
|
|
496
499
|
amount: amount.toString(),
|
|
500
|
+
slippageBps: swapSlippageBps,
|
|
497
501
|
signer
|
|
498
502
|
};
|
|
499
503
|
const { signer: _, ...swapParamsToLog } = swapParams;
|
|
@@ -824,6 +828,7 @@ var SingleQuoteStrategy = class extends BaseSingleQuoteStrategy {
|
|
|
824
828
|
};
|
|
825
829
|
|
|
826
830
|
// src/BridgingSdk/utils.ts
|
|
831
|
+
import { OrderBookApiError } from "@cowprotocol/sdk-order-book";
|
|
827
832
|
function validateCrossChainRequest(sellTokenChainId, buyTokenChainId) {
|
|
828
833
|
if (sellTokenChainId === buyTokenChainId) {
|
|
829
834
|
throw new BridgeProviderError(
|
|
@@ -910,6 +915,9 @@ function resolveProvidersToQuery(providerDappIds, providers) {
|
|
|
910
915
|
function getErrorPriority(error) {
|
|
911
916
|
if (!error)
|
|
912
917
|
return 0;
|
|
918
|
+
if (error instanceof OrderBookApiError) {
|
|
919
|
+
return 10;
|
|
920
|
+
}
|
|
913
921
|
if (error instanceof BridgeProviderQuoteError) {
|
|
914
922
|
return BridgeQuoteErrorPriorities[error.message] ?? 0;
|
|
915
923
|
}
|
|
@@ -927,6 +935,34 @@ function isBetterError(error1, error2) {
|
|
|
927
935
|
return priority1 > priority2;
|
|
928
936
|
}
|
|
929
937
|
|
|
938
|
+
// src/BridgingSdk/strategies/utils.ts
|
|
939
|
+
async function fetchMultiQuote(context, tradingSdk, intermediateTokensCache) {
|
|
940
|
+
const { provider, quoteBridgeRequest, advancedSettings, providerTimeout } = context;
|
|
941
|
+
const supportedNetworks = await provider.getNetworks();
|
|
942
|
+
const destinationNetwork = supportedNetworks.find((i) => i.id === quoteBridgeRequest.buyTokenChainId);
|
|
943
|
+
if (!destinationNetwork)
|
|
944
|
+
return;
|
|
945
|
+
const baseParams = {
|
|
946
|
+
swapAndBridgeRequest: quoteBridgeRequest,
|
|
947
|
+
advancedSettings,
|
|
948
|
+
tradingSdk,
|
|
949
|
+
quoteSigner: advancedSettings?.quoteSigner
|
|
950
|
+
};
|
|
951
|
+
const request = intermediateTokensCache ? {
|
|
952
|
+
...baseParams,
|
|
953
|
+
intermediateTokensCache
|
|
954
|
+
} : baseParams;
|
|
955
|
+
const quote = await Promise.race([
|
|
956
|
+
getQuoteWithBridge(provider, request),
|
|
957
|
+
createBridgeRequestTimeoutPromise(providerTimeout, `Provider ${provider.info.dappId}`)
|
|
958
|
+
]);
|
|
959
|
+
return {
|
|
960
|
+
providerDappId: provider.info.dappId,
|
|
961
|
+
quote,
|
|
962
|
+
error: void 0
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
|
|
930
966
|
// src/BridgingSdk/strategies/MultiQuoteStrategy.ts
|
|
931
967
|
var DEFAULT_TOTAL_TIMEOUT_MS = 4e4;
|
|
932
968
|
var DEFAULT_PROVIDER_TIMEOUT_MS = 2e4;
|
|
@@ -976,28 +1012,12 @@ var MultiQuoteStrategy = class extends BaseMultiQuoteStrategy {
|
|
|
976
1012
|
return results;
|
|
977
1013
|
}
|
|
978
1014
|
createProviderQuotePromise(context, tradingSdk) {
|
|
979
|
-
const { provider,
|
|
1015
|
+
const { provider, onQuoteResult, results, index } = context;
|
|
980
1016
|
return (async () => {
|
|
981
1017
|
try {
|
|
982
|
-
const
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
tradingSdk,
|
|
986
|
-
quoteSigner: advancedSettings?.quoteSigner
|
|
987
|
-
};
|
|
988
|
-
const request = this.intermediateTokensCache ? {
|
|
989
|
-
...baseParams,
|
|
990
|
-
intermediateTokensCache: this.intermediateTokensCache
|
|
991
|
-
} : baseParams;
|
|
992
|
-
const quote = await Promise.race([
|
|
993
|
-
getQuoteWithBridge(provider, request),
|
|
994
|
-
createBridgeRequestTimeoutPromise(providerTimeout, `Provider ${provider.info.dappId}`)
|
|
995
|
-
]);
|
|
996
|
-
const result = {
|
|
997
|
-
providerDappId: provider.info.dappId,
|
|
998
|
-
quote,
|
|
999
|
-
error: void 0
|
|
1000
|
-
};
|
|
1018
|
+
const result = await fetchMultiQuote(context, tradingSdk, this.intermediateTokensCache);
|
|
1019
|
+
if (!result)
|
|
1020
|
+
return;
|
|
1001
1021
|
results[index] = result;
|
|
1002
1022
|
safeCallProgressiveCallback(onQuoteResult, result);
|
|
1003
1023
|
} catch (error) {
|
|
@@ -1051,29 +1071,12 @@ var BestQuoteStrategy = class extends BaseBestQuoteStrategy {
|
|
|
1051
1071
|
return bestResult.current || bestError.current;
|
|
1052
1072
|
}
|
|
1053
1073
|
createBestQuoteProviderPromise(context, tradingSdk) {
|
|
1054
|
-
const { provider,
|
|
1074
|
+
const { provider, onQuoteResult, bestResult, bestError } = context;
|
|
1055
1075
|
return (async () => {
|
|
1056
1076
|
try {
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
tradingSdk,
|
|
1061
|
-
provider,
|
|
1062
|
-
quoteSigner: advancedSettings?.quoteSigner
|
|
1063
|
-
};
|
|
1064
|
-
const request = this.intermediateTokensCache ? {
|
|
1065
|
-
...baseParams,
|
|
1066
|
-
intermediateTokensCache: this.intermediateTokensCache
|
|
1067
|
-
} : baseParams;
|
|
1068
|
-
const quote = await Promise.race([
|
|
1069
|
-
getQuoteWithBridge(provider, request),
|
|
1070
|
-
createBridgeRequestTimeoutPromise(providerTimeout, `Provider ${provider.info.dappId}`)
|
|
1071
|
-
]);
|
|
1072
|
-
const result = {
|
|
1073
|
-
providerDappId: provider.info.dappId,
|
|
1074
|
-
quote,
|
|
1075
|
-
error: void 0
|
|
1076
|
-
};
|
|
1077
|
+
const result = await fetchMultiQuote(context, tradingSdk, this.intermediateTokensCache);
|
|
1078
|
+
if (!result)
|
|
1079
|
+
return;
|
|
1077
1080
|
if (isBetterQuote(result, bestResult.current)) {
|
|
1078
1081
|
bestResult.current = result;
|
|
1079
1082
|
safeCallBestQuoteCallback(onQuoteResult, result);
|
|
@@ -5160,7 +5163,7 @@ var NearIntentsBridgeProvider = class {
|
|
|
5160
5163
|
const quoteResponse = await this.api.getQuote({
|
|
5161
5164
|
dry: false,
|
|
5162
5165
|
swapType: QuoteRequest.swapType.FLEX_INPUT,
|
|
5163
|
-
slippageTolerance: request.
|
|
5166
|
+
slippageTolerance: request.bridgeSlippageBps ?? DEFAULT_BRIDGE_SLIPPAGE_BPS,
|
|
5164
5167
|
originAsset: sellToken.assetId,
|
|
5165
5168
|
depositType: QuoteRequest.depositType.ORIGIN_CHAIN,
|
|
5166
5169
|
destinationAsset: buyToken.assetId,
|
|
@@ -5333,6 +5336,7 @@ export {
|
|
|
5333
5336
|
BridgingSdk,
|
|
5334
5337
|
BungeeBridgeProvider,
|
|
5335
5338
|
COW_SHED_PROXY_CREATION_GAS,
|
|
5339
|
+
DEFAULT_BRIDGE_SLIPPAGE_BPS,
|
|
5336
5340
|
DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION,
|
|
5337
5341
|
DEFAULT_EXTRA_GAS_PROXY_CREATION,
|
|
5338
5342
|
DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cowprotocol/sdk-bridging",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Bridging for CoW Protocol",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@defuse-protocol/one-click-sdk-typescript": "0.1.1-0.2",
|
|
18
18
|
"json-stable-stringify": "^1.3.0",
|
|
19
|
+
"@cowprotocol/sdk-app-data": "4.4.0",
|
|
19
20
|
"@cowprotocol/sdk-common": "0.4.0",
|
|
20
|
-
"@cowprotocol/sdk-contracts-ts": "0.8.1",
|
|
21
|
-
"@cowprotocol/sdk-cow-shed": "0.2.8",
|
|
22
|
-
"@cowprotocol/sdk-order-book": "0.4.4",
|
|
23
|
-
"@cowprotocol/sdk-trading": "0.7.1",
|
|
24
|
-
"@cowprotocol/sdk-weiroll": "0.1.11",
|
|
25
21
|
"@cowprotocol/sdk-config": "0.6.2",
|
|
26
|
-
"@cowprotocol/sdk-
|
|
22
|
+
"@cowprotocol/sdk-contracts-ts": "1.0.0",
|
|
23
|
+
"@cowprotocol/sdk-cow-shed": "0.2.9",
|
|
24
|
+
"@cowprotocol/sdk-order-book": "0.5.0",
|
|
25
|
+
"@cowprotocol/sdk-weiroll": "0.1.11",
|
|
26
|
+
"@cowprotocol/sdk-trading": "0.7.3"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/jest": "^29.4.0",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"tsup": "^7.2.0",
|
|
39
39
|
"typescript": "^5.2.2",
|
|
40
40
|
"viem": "^2.28.4",
|
|
41
|
-
"@cowprotocol/sdk-ethers-v5-adapter": "0.3.0",
|
|
42
41
|
"@cow-sdk/typescript-config": "0.0.0-beta.0",
|
|
43
|
-
"@cowprotocol/sdk-ethers-
|
|
44
|
-
"@cowprotocol/sdk-
|
|
45
|
-
"@cowprotocol/sdk-
|
|
42
|
+
"@cowprotocol/sdk-ethers-v5-adapter": "0.3.0",
|
|
43
|
+
"@cowprotocol/sdk-viem-adapter": "0.3.0",
|
|
44
|
+
"@cowprotocol/sdk-order-signing": "0.1.23",
|
|
45
|
+
"@cowprotocol/sdk-ethers-v6-adapter": "0.3.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|