@cowprotocol/sdk-bridging 4.1.3 → 4.2.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/README.md +6 -0
- package/dist/index.js +264 -169
- package/dist/index.mjs +219 -124
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
# SDK Bridging
|
|
6
6
|
|
|
7
|
+
## Test coverage
|
|
8
|
+
|
|
9
|
+
| Statements | Branches | Functions | Lines |
|
|
10
|
+
| --------------------------- | ----------------------- | ------------------------- | ----------------- |
|
|
11
|
+
|  |  |  |  |
|
|
12
|
+
|
|
7
13
|
This package provides bridging functionality for the CoW Protocol SDK, enabling cross-chain token transfers and interactions. It integrates with various bridge providers to facilitate seamless asset movement across supported blockchain networks.
|
|
8
14
|
|
|
9
15
|
## Installation
|
package/dist/index.js
CHANGED
|
@@ -236,7 +236,7 @@ async function getCrossChainOrder(params) {
|
|
|
236
236
|
// src/BridgingSdk/BridgingSdk.ts
|
|
237
237
|
var import_sdk_trading2 = require("@cowprotocol/sdk-trading");
|
|
238
238
|
var import_sdk_order_book3 = require("@cowprotocol/sdk-order-book");
|
|
239
|
-
var
|
|
239
|
+
var import_sdk_config4 = require("@cowprotocol/sdk-config");
|
|
240
240
|
var import_sdk_common8 = require("@cowprotocol/sdk-common");
|
|
241
241
|
|
|
242
242
|
// src/BridgingSdk/helpers.ts
|
|
@@ -313,6 +313,7 @@ function getHookMockForCostEstimation(gasLimit) {
|
|
|
313
313
|
var import_sdk_common6 = require("@cowprotocol/sdk-common");
|
|
314
314
|
|
|
315
315
|
// src/BridgingSdk/determineIntermediateToken.ts
|
|
316
|
+
var import_sdk_config3 = require("@cowprotocol/sdk-config");
|
|
316
317
|
var import_sdk_common5 = require("@cowprotocol/sdk-common");
|
|
317
318
|
|
|
318
319
|
// src/BridgingSdk/tokenPriority.ts
|
|
@@ -320,72 +321,161 @@ var import_sdk_config2 = require("@cowprotocol/sdk-config");
|
|
|
320
321
|
var import_sdk_common4 = require("@cowprotocol/sdk-common");
|
|
321
322
|
var PRIORITY_STABLECOIN_TOKENS = {
|
|
322
323
|
[import_sdk_config2.SupportedChainId.MAINNET]: /* @__PURE__ */ new Set([
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
{
|
|
325
|
+
chainId: import_sdk_config2.SupportedChainId.MAINNET,
|
|
326
|
+
address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
327
|
+
decimals: 6,
|
|
328
|
+
symbol: "USDC"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
chainId: import_sdk_config2.SupportedChainId.MAINNET,
|
|
332
|
+
address: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
333
|
+
decimals: 6,
|
|
334
|
+
symbol: "USDT"
|
|
335
|
+
}
|
|
327
336
|
]),
|
|
328
337
|
[import_sdk_config2.SupportedChainId.BNB]: /* @__PURE__ */ new Set([
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
338
|
+
{
|
|
339
|
+
chainId: import_sdk_config2.SupportedChainId.BNB,
|
|
340
|
+
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
341
|
+
decimals: 18,
|
|
342
|
+
symbol: "USDC"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
chainId: import_sdk_config2.SupportedChainId.BNB,
|
|
346
|
+
address: "0x55d398326f99059ff775485246999027b3197955",
|
|
347
|
+
decimals: 18,
|
|
348
|
+
symbol: "USDT"
|
|
349
|
+
}
|
|
333
350
|
]),
|
|
334
351
|
[import_sdk_config2.SupportedChainId.GNOSIS_CHAIN]: /* @__PURE__ */ new Set([
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
352
|
+
{
|
|
353
|
+
chainId: import_sdk_config2.SupportedChainId.GNOSIS_CHAIN,
|
|
354
|
+
address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
355
|
+
decimals: 6,
|
|
356
|
+
symbol: "USDC"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
chainId: import_sdk_config2.SupportedChainId.GNOSIS_CHAIN,
|
|
360
|
+
address: "0x2a22f9c3b484c3629090feed35f17ff8f88f76f0",
|
|
361
|
+
decimals: 6,
|
|
362
|
+
symbol: "USDC.e"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
chainId: import_sdk_config2.SupportedChainId.GNOSIS_CHAIN,
|
|
366
|
+
address: "0x4ecaba5870353805a9f068101a40e0f32ed605c6",
|
|
367
|
+
decimals: 6,
|
|
368
|
+
symbol: "USDT"
|
|
369
|
+
}
|
|
341
370
|
]),
|
|
342
371
|
[import_sdk_config2.SupportedChainId.POLYGON]: /* @__PURE__ */ new Set([
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
372
|
+
{
|
|
373
|
+
chainId: import_sdk_config2.SupportedChainId.POLYGON,
|
|
374
|
+
address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
|
|
375
|
+
decimals: 6,
|
|
376
|
+
symbol: "USDC"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
chainId: import_sdk_config2.SupportedChainId.POLYGON,
|
|
380
|
+
address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
|
|
381
|
+
decimals: 6,
|
|
382
|
+
symbol: "USDT"
|
|
383
|
+
}
|
|
347
384
|
]),
|
|
348
385
|
[import_sdk_config2.SupportedChainId.BASE]: /* @__PURE__ */ new Set([
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
386
|
+
{
|
|
387
|
+
chainId: import_sdk_config2.SupportedChainId.BASE,
|
|
388
|
+
address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
389
|
+
decimals: 6,
|
|
390
|
+
symbol: "USDC"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
chainId: import_sdk_config2.SupportedChainId.BASE,
|
|
394
|
+
address: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
|
|
395
|
+
decimals: 6,
|
|
396
|
+
symbol: "USDT"
|
|
397
|
+
}
|
|
353
398
|
]),
|
|
354
399
|
[import_sdk_config2.SupportedChainId.ARBITRUM_ONE]: /* @__PURE__ */ new Set([
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
400
|
+
{
|
|
401
|
+
chainId: import_sdk_config2.SupportedChainId.ARBITRUM_ONE,
|
|
402
|
+
address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
|
|
403
|
+
decimals: 6,
|
|
404
|
+
symbol: "USDC"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
chainId: import_sdk_config2.SupportedChainId.ARBITRUM_ONE,
|
|
408
|
+
address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
|
|
409
|
+
decimals: 6,
|
|
410
|
+
symbol: "USDT"
|
|
411
|
+
}
|
|
359
412
|
]),
|
|
360
413
|
[import_sdk_config2.SupportedChainId.AVALANCHE]: /* @__PURE__ */ new Set([
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
414
|
+
{
|
|
415
|
+
chainId: import_sdk_config2.SupportedChainId.AVALANCHE,
|
|
416
|
+
address: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
417
|
+
decimals: 6,
|
|
418
|
+
symbol: "USDC"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
chainId: import_sdk_config2.SupportedChainId.AVALANCHE,
|
|
422
|
+
address: "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7",
|
|
423
|
+
decimals: 6,
|
|
424
|
+
symbol: "USDT"
|
|
425
|
+
}
|
|
365
426
|
]),
|
|
366
427
|
[import_sdk_config2.SupportedChainId.LINEA]: /* @__PURE__ */ new Set([
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
428
|
+
{
|
|
429
|
+
chainId: import_sdk_config2.SupportedChainId.LINEA,
|
|
430
|
+
address: "0x176211869ca2b568f2a7d4ee941e073a821ee1ff",
|
|
431
|
+
decimals: 6,
|
|
432
|
+
symbol: "USDC"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
chainId: import_sdk_config2.SupportedChainId.LINEA,
|
|
436
|
+
address: "0xa219439258ca9da29e9cc4ce5596924745e12b93",
|
|
437
|
+
decimals: 6,
|
|
438
|
+
symbol: "USDT"
|
|
439
|
+
}
|
|
371
440
|
]),
|
|
372
441
|
[import_sdk_config2.SupportedChainId.SEPOLIA]: /* @__PURE__ */ new Set([
|
|
373
|
-
|
|
374
|
-
|
|
442
|
+
{
|
|
443
|
+
chainId: import_sdk_config2.SupportedChainId.SEPOLIA,
|
|
444
|
+
address: "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
|
|
445
|
+
decimals: 6,
|
|
446
|
+
symbol: "USDC"
|
|
447
|
+
}
|
|
375
448
|
])
|
|
376
449
|
};
|
|
377
|
-
function
|
|
450
|
+
function getStablecoinPriorityToken(chainId, tokenAddress) {
|
|
378
451
|
const chainTokens = PRIORITY_STABLECOIN_TOKENS[chainId];
|
|
379
452
|
if (!chainTokens)
|
|
380
|
-
return
|
|
381
|
-
|
|
453
|
+
return void 0;
|
|
454
|
+
const key = (0, import_sdk_common4.getAddressKey)(tokenAddress);
|
|
455
|
+
for (const token of chainTokens) {
|
|
456
|
+
if ((0, import_sdk_common4.getAddressKey)(token.address) === key)
|
|
457
|
+
return token;
|
|
458
|
+
}
|
|
459
|
+
return void 0;
|
|
460
|
+
}
|
|
461
|
+
function isStablecoinPriorityToken(chainId, tokenAddress) {
|
|
462
|
+
return getStablecoinPriorityToken(chainId, tokenAddress) !== void 0;
|
|
382
463
|
}
|
|
383
464
|
function isCorrelatedToken(tokenAddress, correlatedTokens) {
|
|
384
465
|
return correlatedTokens.has((0, import_sdk_common4.getAddressKey)(tokenAddress));
|
|
385
466
|
}
|
|
386
467
|
|
|
387
468
|
// src/BridgingSdk/determineIntermediateToken.ts
|
|
388
|
-
async function determineIntermediateToken(
|
|
469
|
+
async function determineIntermediateToken(context) {
|
|
470
|
+
const {
|
|
471
|
+
sourceChainId,
|
|
472
|
+
sourceTokenAddress,
|
|
473
|
+
destinationChainId,
|
|
474
|
+
destinationTokenAddress,
|
|
475
|
+
intermediateTokens,
|
|
476
|
+
getCorrelatedTokens,
|
|
477
|
+
allowIntermediateEqSellToken
|
|
478
|
+
} = context;
|
|
389
479
|
const firstToken = intermediateTokens[0];
|
|
390
480
|
if (intermediateTokens.length === 0 || !firstToken) {
|
|
391
481
|
throw new BridgeProviderQuoteError("NO_INTERMEDIATE_TOKENS" /* NO_INTERMEDIATE_TOKENS */, { intermediateTokens });
|
|
@@ -394,26 +484,29 @@ async function determineIntermediateToken(sourceChainId, sourceTokenAddress, int
|
|
|
394
484
|
return firstToken;
|
|
395
485
|
}
|
|
396
486
|
const correlatedTokens = await resolveCorrelatedTokens(sourceChainId, getCorrelatedTokens);
|
|
397
|
-
const sellTokenLike = { chainId: sourceChainId, address: sourceTokenAddress };
|
|
398
|
-
const isSellNativeOrWrapped = (0, import_sdk_common5.isNativeToken)(sellTokenLike) || (0, import_sdk_common5.isWrappedNativeToken)(sellTokenLike);
|
|
399
487
|
const filteredTokens = allowIntermediateEqSellToken ? intermediateTokens : intermediateTokens.filter((token) => !(0, import_sdk_common5.areAddressesEqual)(token.address, sourceTokenAddress));
|
|
488
|
+
const destinationStableCoin = (0, import_sdk_config3.isSupportedChain)(destinationChainId) ? getStablecoinPriorityToken(destinationChainId, destinationTokenAddress) : void 0;
|
|
400
489
|
const tokensWithPriority = filteredTokens.map((token) => {
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
|
|
404
|
-
|
|
490
|
+
const isStableCoin = isStablecoinPriorityToken(token.chainId, token.address);
|
|
491
|
+
if (destinationStableCoin && isStableCoin) {
|
|
492
|
+
const matchesDestinationTokenSymbol = !!token.symbol && token.symbol.toLowerCase() === destinationStableCoin?.symbol?.toLowerCase();
|
|
493
|
+
if (matchesDestinationTokenSymbol) {
|
|
494
|
+
return { token, priority: 6 /* STABLECOIN_MATCHES_DESTINATION */ };
|
|
405
495
|
}
|
|
406
496
|
}
|
|
407
|
-
if (
|
|
408
|
-
return { token, priority:
|
|
497
|
+
if ((0, import_sdk_common5.areAddressesEqual)(token.address, sourceTokenAddress)) {
|
|
498
|
+
return { token, priority: 5 /* MATCHES_SELL */ };
|
|
499
|
+
}
|
|
500
|
+
if (isStableCoin) {
|
|
501
|
+
return { token, priority: 4 /* STABLECOIN */ };
|
|
409
502
|
}
|
|
410
503
|
if (isCorrelatedToken(token.address, correlatedTokens)) {
|
|
411
|
-
return { token, priority: 3 /*
|
|
504
|
+
return { token, priority: 3 /* CORRELATED */ };
|
|
412
505
|
}
|
|
413
|
-
if ((0, import_sdk_common5.isNativeToken)(token)
|
|
414
|
-
return { token, priority: 2 /*
|
|
506
|
+
if ((0, import_sdk_common5.isNativeToken)(token)) {
|
|
507
|
+
return { token, priority: 2 /* NATIVE */ };
|
|
415
508
|
}
|
|
416
|
-
return { token, priority: 1 /*
|
|
509
|
+
return { token, priority: 1 /* OTHER */ };
|
|
417
510
|
});
|
|
418
511
|
tokensWithPriority.sort((a, b) => {
|
|
419
512
|
if (a.priority !== b.priority) {
|
|
@@ -468,13 +561,15 @@ async function getIntermediateSwapResult({
|
|
|
468
561
|
quoteBridgeRequest: swapAndBridgeRequest,
|
|
469
562
|
intermediateTokensCache: params.intermediateTokensCache
|
|
470
563
|
});
|
|
471
|
-
const intermediateToken = await determineIntermediateToken(
|
|
472
|
-
sellTokenChainId,
|
|
473
|
-
sellTokenAddress,
|
|
564
|
+
const intermediateToken = await determineIntermediateToken({
|
|
565
|
+
sourceChainId: sellTokenChainId,
|
|
566
|
+
sourceTokenAddress: sellTokenAddress,
|
|
567
|
+
destinationChainId: buyTokenChainId,
|
|
568
|
+
destinationTokenAddress: buyTokenAddress,
|
|
474
569
|
intermediateTokens,
|
|
475
|
-
params.advancedSettings?.getCorrelatedTokens,
|
|
570
|
+
getCorrelatedTokens: params.advancedSettings?.getCorrelatedTokens,
|
|
476
571
|
allowIntermediateEqSellToken
|
|
477
|
-
);
|
|
572
|
+
});
|
|
478
573
|
(0, import_sdk_common6.log)(`Using ${intermediateToken?.name ?? intermediateToken?.address} as intermediate tokens`);
|
|
479
574
|
const bridgeRequestWithoutAmount = {
|
|
480
575
|
...swapAndBridgeRequest,
|
|
@@ -1262,7 +1357,7 @@ var BridgingSdk = class {
|
|
|
1262
1357
|
* Get the available sources networks for the bridging.
|
|
1263
1358
|
*/
|
|
1264
1359
|
async getSourceNetworks() {
|
|
1265
|
-
return
|
|
1360
|
+
return import_sdk_config4.ALL_SUPPORTED_CHAINS;
|
|
1266
1361
|
}
|
|
1267
1362
|
/**
|
|
1268
1363
|
* Get the available target networks for the bridging.
|
|
@@ -1558,56 +1653,56 @@ var COW_TRADE_EVENT_INTERFACE = () => {
|
|
|
1558
1653
|
};
|
|
1559
1654
|
|
|
1560
1655
|
// src/providers/across/const/contracts.ts
|
|
1561
|
-
var
|
|
1656
|
+
var import_sdk_config5 = require("@cowprotocol/sdk-config");
|
|
1562
1657
|
var ACROSS_SPOOK_CONTRACT_ADDRESSES = {
|
|
1563
1658
|
// https://docs.across.to/reference/contract-addresses/mainnet-chain-id-1
|
|
1564
|
-
[
|
|
1659
|
+
[import_sdk_config5.SupportedChainId.MAINNET]: "0x5c7BCd6E7De5423a257D81B442095A1a6ced35C5",
|
|
1565
1660
|
// https://docs.across.to/reference/contract-addresses/arbitrum-chain-id-42161-1
|
|
1566
|
-
[
|
|
1661
|
+
[import_sdk_config5.SupportedChainId.ARBITRUM_ONE]: "0xe35e9842fceaca96570b734083f4a58e8f7c5f2a",
|
|
1567
1662
|
// https://docs.across.to/reference/contract-addresses/base-chain-id-8453
|
|
1568
|
-
[
|
|
1663
|
+
[import_sdk_config5.SupportedChainId.BASE]: "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64",
|
|
1569
1664
|
// // https://docs.across.to/reference/contract-addresses/mainnet-chain-id-1
|
|
1570
|
-
[
|
|
1665
|
+
[import_sdk_config5.SupportedChainId.SEPOLIA]: "0x5ef6C01E11889d86803e0B23e3cB3F9E9d97B662",
|
|
1571
1666
|
// https://docs.across.to/reference/contract-addresses/polygon-chain-id-137
|
|
1572
|
-
[
|
|
1667
|
+
[import_sdk_config5.SupportedChainId.POLYGON]: "0x9295ee1d8C5b022Be115A2AD3c30C72E34e7F096",
|
|
1573
1668
|
// https://docs.across.to/reference/contract-addresses/bnb-smart-chain
|
|
1574
|
-
[
|
|
1669
|
+
[import_sdk_config5.SupportedChainId.BNB]: "0x4e8E101924eDE233C13e2D8622DC8aED2872d505",
|
|
1575
1670
|
// https://docs.across.to/reference/contract-addresses/linea-chain-id-59144
|
|
1576
|
-
[
|
|
1671
|
+
[import_sdk_config5.SupportedChainId.LINEA]: "0x7E63A5f1a8F0B4d0934B2f2327DAED3F6bb2ee75",
|
|
1577
1672
|
// https://docs.across.to/reference/contract-addresses/plasma
|
|
1578
|
-
[
|
|
1673
|
+
[import_sdk_config5.SupportedChainId.PLASMA]: "0x50039fAEfebef707cFD94D6d462fE6D10B39207a",
|
|
1579
1674
|
// https://docs.across.to/reference/contract-addresses/ink-chain-id-57073
|
|
1580
|
-
[
|
|
1675
|
+
[import_sdk_config5.SupportedChainId.INK]: "0xeF684C38F94F48775959ECf2012D7E864ffb9dd4",
|
|
1581
1676
|
// https://docs.across.to/reference/contract-addresses/optimism-chain-id-10
|
|
1582
|
-
[
|
|
1677
|
+
[import_sdk_config5.AdditionalTargetChainId.OPTIMISM]: "0x6f26Bf09B1C792e3228e5467807a900A503c0281",
|
|
1583
1678
|
// Not supported chains
|
|
1584
1679
|
// TODO: This first integration is a draft, some of this chains might be supported, so we will need to update here as we iterate on the provider
|
|
1585
|
-
[
|
|
1586
|
-
[
|
|
1587
|
-
[
|
|
1588
|
-
[
|
|
1680
|
+
[import_sdk_config5.SupportedChainId.GNOSIS_CHAIN]: void 0,
|
|
1681
|
+
[import_sdk_config5.SupportedChainId.AVALANCHE]: void 0,
|
|
1682
|
+
[import_sdk_config5.AdditionalTargetChainId.BITCOIN]: void 0,
|
|
1683
|
+
[import_sdk_config5.SupportedChainId.SOLANA]: void 0
|
|
1589
1684
|
};
|
|
1590
1685
|
var ACROSS_MATH_CONTRACT_ADDRESSES = {
|
|
1591
|
-
[
|
|
1592
|
-
[
|
|
1593
|
-
[
|
|
1686
|
+
[import_sdk_config5.SupportedChainId.MAINNET]: "0xf2ae6728b6f146556977Af0A68bFbf5bADA22863",
|
|
1687
|
+
[import_sdk_config5.SupportedChainId.ARBITRUM_ONE]: "0x5771A4b4029832e79a75De7B485E5fBbec28848f",
|
|
1688
|
+
[import_sdk_config5.SupportedChainId.BASE]: "0xd4e943dc6ddc885f6229ce33c2e3dfe402a12c81",
|
|
1594
1689
|
// Not supported chains
|
|
1595
1690
|
// TODO: This first integration is a draft, some of this chains might be supported, so we will need to update here as we iterate on the provider
|
|
1596
|
-
[
|
|
1597
|
-
[
|
|
1598
|
-
[
|
|
1599
|
-
[
|
|
1600
|
-
[
|
|
1691
|
+
[import_sdk_config5.SupportedChainId.GNOSIS_CHAIN]: void 0,
|
|
1692
|
+
[import_sdk_config5.SupportedChainId.SEPOLIA]: void 0,
|
|
1693
|
+
[import_sdk_config5.SupportedChainId.POLYGON]: void 0,
|
|
1694
|
+
[import_sdk_config5.SupportedChainId.AVALANCHE]: void 0,
|
|
1695
|
+
[import_sdk_config5.SupportedChainId.BNB]: void 0,
|
|
1601
1696
|
// TODO: confirm
|
|
1602
|
-
[
|
|
1697
|
+
[import_sdk_config5.SupportedChainId.LINEA]: void 0,
|
|
1603
1698
|
// TODO: confirm
|
|
1604
|
-
[
|
|
1699
|
+
[import_sdk_config5.SupportedChainId.PLASMA]: void 0,
|
|
1605
1700
|
// TODO: confirm
|
|
1606
|
-
[
|
|
1701
|
+
[import_sdk_config5.SupportedChainId.INK]: void 0,
|
|
1607
1702
|
// TODO: confirm
|
|
1608
|
-
[
|
|
1609
|
-
[
|
|
1610
|
-
[
|
|
1703
|
+
[import_sdk_config5.AdditionalTargetChainId.OPTIMISM]: void 0,
|
|
1704
|
+
[import_sdk_config5.AdditionalTargetChainId.BITCOIN]: void 0,
|
|
1705
|
+
[import_sdk_config5.SupportedChainId.SOLANA]: void 0
|
|
1611
1706
|
};
|
|
1612
1707
|
|
|
1613
1708
|
// src/providers/across/util.ts
|
|
@@ -3677,11 +3772,11 @@ async function getGasLimitEstimationForHook({
|
|
|
3677
3772
|
|
|
3678
3773
|
// src/providers/across/AcrossBridgeProvider.ts
|
|
3679
3774
|
var import_sdk_common15 = require("@cowprotocol/sdk-common");
|
|
3680
|
-
var
|
|
3775
|
+
var import_sdk_config6 = require("@cowprotocol/sdk-config");
|
|
3681
3776
|
var import_sdk_cow_shed = require("@cowprotocol/sdk-cow-shed");
|
|
3682
3777
|
var import_sdk_order_book5 = require("@cowprotocol/sdk-order-book");
|
|
3683
3778
|
var ACROSS_HOOK_DAPP_ID = `${HOOK_DAPP_BRIDGE_PROVIDER_PREFIX}/across`;
|
|
3684
|
-
var ACROSS_SUPPORTED_NETWORKS = [
|
|
3779
|
+
var ACROSS_SUPPORTED_NETWORKS = [import_sdk_config6.mainnet, import_sdk_config6.polygon, import_sdk_config6.arbitrumOne, import_sdk_config6.base, import_sdk_config6.optimism];
|
|
3685
3780
|
var SLIPPAGE_TOLERANCE_BPS = 0;
|
|
3686
3781
|
var providerType = "HookBridgeProvider";
|
|
3687
3782
|
var AcrossBridgeProvider = class {
|
|
@@ -3788,7 +3883,7 @@ var AcrossBridgeProvider = class {
|
|
|
3788
3883
|
throw new Error("Not implemented");
|
|
3789
3884
|
}
|
|
3790
3885
|
async getBridgingParams(chainId, order, txHash, settlementContractOverride) {
|
|
3791
|
-
if (!(0,
|
|
3886
|
+
if (!(0, import_sdk_config6.isSupportedChain)(chainId)) {
|
|
3792
3887
|
return null;
|
|
3793
3888
|
}
|
|
3794
3889
|
const orderUid = order.uid;
|
|
@@ -4034,69 +4129,69 @@ var getBungeeBridgeFromDisplayName = (displayName) => {
|
|
|
4034
4129
|
};
|
|
4035
4130
|
|
|
4036
4131
|
// src/providers/bungee/const/contracts.ts
|
|
4037
|
-
var
|
|
4132
|
+
var import_sdk_config7 = require("@cowprotocol/sdk-config");
|
|
4038
4133
|
var BUNGEE_COWSWAP_LIB_ADDRESS = "0x75b6ba5fcab20848ca00f132d253638fea82e598";
|
|
4039
4134
|
var BungeeCowswapLibAddresses = {
|
|
4040
|
-
[
|
|
4041
|
-
[
|
|
4042
|
-
[
|
|
4043
|
-
[
|
|
4044
|
-
[
|
|
4045
|
-
[
|
|
4046
|
-
[
|
|
4135
|
+
[import_sdk_config7.SupportedChainId.MAINNET]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4136
|
+
[import_sdk_config7.SupportedChainId.GNOSIS_CHAIN]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4137
|
+
[import_sdk_config7.SupportedChainId.ARBITRUM_ONE]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4138
|
+
[import_sdk_config7.SupportedChainId.BASE]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4139
|
+
[import_sdk_config7.SupportedChainId.AVALANCHE]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4140
|
+
[import_sdk_config7.SupportedChainId.POLYGON]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4141
|
+
[import_sdk_config7.SupportedChainId.BNB]: void 0,
|
|
4047
4142
|
// TODO: confirm
|
|
4048
|
-
[
|
|
4143
|
+
[import_sdk_config7.SupportedChainId.LINEA]: void 0,
|
|
4049
4144
|
// TODO: confirm
|
|
4050
|
-
[
|
|
4145
|
+
[import_sdk_config7.SupportedChainId.PLASMA]: void 0,
|
|
4051
4146
|
// TODO: confirm
|
|
4052
|
-
[
|
|
4147
|
+
[import_sdk_config7.SupportedChainId.INK]: void 0,
|
|
4053
4148
|
// TODO: confirm
|
|
4054
|
-
[
|
|
4055
|
-
[
|
|
4056
|
-
[
|
|
4057
|
-
[
|
|
4149
|
+
[import_sdk_config7.SupportedChainId.SEPOLIA]: void 0,
|
|
4150
|
+
[import_sdk_config7.AdditionalTargetChainId.OPTIMISM]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4151
|
+
[import_sdk_config7.AdditionalTargetChainId.BITCOIN]: void 0,
|
|
4152
|
+
[import_sdk_config7.SupportedChainId.SOLANA]: void 0
|
|
4058
4153
|
};
|
|
4059
4154
|
var SOCKET_VERIFIER_ADDRESS = "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D";
|
|
4060
4155
|
var SocketVerifierAddresses = {
|
|
4061
|
-
[
|
|
4062
|
-
[
|
|
4063
|
-
[
|
|
4064
|
-
[
|
|
4065
|
-
[
|
|
4066
|
-
[
|
|
4067
|
-
[
|
|
4156
|
+
[import_sdk_config7.SupportedChainId.MAINNET]: SOCKET_VERIFIER_ADDRESS,
|
|
4157
|
+
[import_sdk_config7.SupportedChainId.GNOSIS_CHAIN]: SOCKET_VERIFIER_ADDRESS,
|
|
4158
|
+
[import_sdk_config7.SupportedChainId.ARBITRUM_ONE]: SOCKET_VERIFIER_ADDRESS,
|
|
4159
|
+
[import_sdk_config7.SupportedChainId.BASE]: SOCKET_VERIFIER_ADDRESS,
|
|
4160
|
+
[import_sdk_config7.SupportedChainId.AVALANCHE]: SOCKET_VERIFIER_ADDRESS,
|
|
4161
|
+
[import_sdk_config7.SupportedChainId.POLYGON]: SOCKET_VERIFIER_ADDRESS,
|
|
4162
|
+
[import_sdk_config7.SupportedChainId.BNB]: void 0,
|
|
4068
4163
|
// TODO: confirm
|
|
4069
|
-
[
|
|
4164
|
+
[import_sdk_config7.SupportedChainId.LINEA]: void 0,
|
|
4070
4165
|
// TODO: confirm
|
|
4071
|
-
[
|
|
4166
|
+
[import_sdk_config7.SupportedChainId.PLASMA]: void 0,
|
|
4072
4167
|
// TODO: confirm
|
|
4073
|
-
[
|
|
4168
|
+
[import_sdk_config7.SupportedChainId.INK]: void 0,
|
|
4074
4169
|
// TODO: confirm
|
|
4075
|
-
[
|
|
4076
|
-
[
|
|
4077
|
-
[
|
|
4078
|
-
[
|
|
4170
|
+
[import_sdk_config7.SupportedChainId.SEPOLIA]: void 0,
|
|
4171
|
+
[import_sdk_config7.AdditionalTargetChainId.OPTIMISM]: SOCKET_VERIFIER_ADDRESS,
|
|
4172
|
+
[import_sdk_config7.AdditionalTargetChainId.BITCOIN]: void 0,
|
|
4173
|
+
[import_sdk_config7.SupportedChainId.SOLANA]: void 0
|
|
4079
4174
|
};
|
|
4080
4175
|
var BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS = "0xD06a673fe1fa27B1b9E5BA0be980AB15Dbce85cc";
|
|
4081
4176
|
var BungeeApproveAndBridgeV1Addresses = {
|
|
4082
|
-
[
|
|
4083
|
-
[
|
|
4084
|
-
[
|
|
4085
|
-
[
|
|
4086
|
-
[
|
|
4087
|
-
[
|
|
4088
|
-
[
|
|
4177
|
+
[import_sdk_config7.SupportedChainId.MAINNET]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4178
|
+
[import_sdk_config7.SupportedChainId.GNOSIS_CHAIN]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4179
|
+
[import_sdk_config7.SupportedChainId.ARBITRUM_ONE]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4180
|
+
[import_sdk_config7.SupportedChainId.BASE]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4181
|
+
[import_sdk_config7.SupportedChainId.AVALANCHE]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4182
|
+
[import_sdk_config7.SupportedChainId.POLYGON]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4183
|
+
[import_sdk_config7.SupportedChainId.BNB]: void 0,
|
|
4089
4184
|
// TODO: confirm
|
|
4090
|
-
[
|
|
4185
|
+
[import_sdk_config7.SupportedChainId.LINEA]: void 0,
|
|
4091
4186
|
// TODO: confirm
|
|
4092
|
-
[
|
|
4187
|
+
[import_sdk_config7.SupportedChainId.PLASMA]: void 0,
|
|
4093
4188
|
// TODO: confirm
|
|
4094
|
-
[
|
|
4189
|
+
[import_sdk_config7.SupportedChainId.INK]: void 0,
|
|
4095
4190
|
// TODO: confirm
|
|
4096
|
-
[
|
|
4097
|
-
[
|
|
4098
|
-
[
|
|
4099
|
-
[
|
|
4191
|
+
[import_sdk_config7.SupportedChainId.SEPOLIA]: void 0,
|
|
4192
|
+
[import_sdk_config7.AdditionalTargetChainId.OPTIMISM]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4193
|
+
[import_sdk_config7.AdditionalTargetChainId.BITCOIN]: void 0,
|
|
4194
|
+
[import_sdk_config7.SupportedChainId.SOLANA]: void 0
|
|
4100
4195
|
};
|
|
4101
4196
|
|
|
4102
4197
|
// src/providers/bungee/abi.ts
|
|
@@ -4737,7 +4832,7 @@ var BungeeApi = class {
|
|
|
4737
4832
|
};
|
|
4738
4833
|
|
|
4739
4834
|
// src/providers/bungee/createBungeeDepositCall.ts
|
|
4740
|
-
var
|
|
4835
|
+
var import_sdk_config8 = require("@cowprotocol/sdk-config");
|
|
4741
4836
|
var import_sdk_common17 = require("@cowprotocol/sdk-common");
|
|
4742
4837
|
async function createBungeeDepositCall(params) {
|
|
4743
4838
|
const adapter = (0, import_sdk_common17.getGlobalAdapter)();
|
|
@@ -4778,7 +4873,7 @@ async function createBungeeDepositCall(params) {
|
|
|
4778
4873
|
fullData
|
|
4779
4874
|
// data
|
|
4780
4875
|
]);
|
|
4781
|
-
const value = (0, import_sdk_common17.areAddressesEqual)(request.sellTokenAddress,
|
|
4876
|
+
const value = (0, import_sdk_common17.areAddressesEqual)(request.sellTokenAddress, import_sdk_config8.ETH_ADDRESS) ? BigInt(bridgeInputAmount) : 0n;
|
|
4782
4877
|
const finalValue = value + nativeTokenExtraFee;
|
|
4783
4878
|
const to = BungeeApproveAndBridgeV1Addresses[request.sellTokenChainId];
|
|
4784
4879
|
if (!to) {
|
|
@@ -4827,11 +4922,11 @@ async function getBridgingStatusFromEvents(events, getAcrossStatus) {
|
|
|
4827
4922
|
}
|
|
4828
4923
|
|
|
4829
4924
|
// src/providers/bungee/BungeeBridgeProvider.ts
|
|
4830
|
-
var
|
|
4925
|
+
var import_sdk_config9 = require("@cowprotocol/sdk-config");
|
|
4831
4926
|
var import_sdk_cow_shed2 = require("@cowprotocol/sdk-cow-shed");
|
|
4832
4927
|
var import_sdk_common18 = require("@cowprotocol/sdk-common");
|
|
4833
4928
|
var BUNGEE_HOOK_DAPP_ID = `${HOOK_DAPP_BRIDGE_PROVIDER_PREFIX2}/bungee`;
|
|
4834
|
-
var BUNGEE_SUPPORTED_NETWORKS = [
|
|
4929
|
+
var BUNGEE_SUPPORTED_NETWORKS = [import_sdk_config9.mainnet, import_sdk_config9.polygon, import_sdk_config9.arbitrumOne, import_sdk_config9.base, import_sdk_config9.optimism, import_sdk_config9.avalanche, import_sdk_config9.gnosisChain];
|
|
4835
4930
|
var SLIPPAGE_TOLERANCE_BPS2 = 0;
|
|
4836
4931
|
var providerType2 = "HookBridgeProvider";
|
|
4837
4932
|
var BungeeBridgeProvider = class {
|
|
@@ -4986,13 +5081,13 @@ var BungeeBridgeProvider = class {
|
|
|
4986
5081
|
}
|
|
4987
5082
|
isExtraGasRequired(request) {
|
|
4988
5083
|
const { sellTokenChainId, buyTokenChainId } = request;
|
|
4989
|
-
return sellTokenChainId ===
|
|
5084
|
+
return sellTokenChainId === import_sdk_config9.SupportedChainId.MAINNET && buyTokenChainId === import_sdk_config9.SupportedChainId.GNOSIS_CHAIN;
|
|
4990
5085
|
}
|
|
4991
5086
|
};
|
|
4992
5087
|
|
|
4993
5088
|
// src/providers/near-intents/NearIntentsBridgeProvider.ts
|
|
4994
5089
|
var import_sdk_common20 = require("@cowprotocol/sdk-common");
|
|
4995
|
-
var
|
|
5090
|
+
var import_sdk_config12 = require("@cowprotocol/sdk-config");
|
|
4996
5091
|
var import_sdk_cow_shed3 = require("@cowprotocol/sdk-cow-shed");
|
|
4997
5092
|
var import_sdk_order_book8 = require("@cowprotocol/sdk-order-book");
|
|
4998
5093
|
var import_one_click_sdk_typescript2 = require("@defuse-protocol/one-click-sdk-typescript");
|
|
@@ -5064,33 +5159,33 @@ var NearIntentsApi = class _NearIntentsApi {
|
|
|
5064
5159
|
};
|
|
5065
5160
|
|
|
5066
5161
|
// src/providers/near-intents/const/index.ts
|
|
5067
|
-
var
|
|
5162
|
+
var import_sdk_config10 = require("@cowprotocol/sdk-config");
|
|
5068
5163
|
var NEAR_INTENTS_HOOK_DAPP_ID = `${HOOK_DAPP_BRIDGE_PROVIDER_PREFIX}/near-intents`;
|
|
5069
5164
|
var NEAR_INTENTS_SUPPORTED_NETWORKS = [
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5165
|
+
import_sdk_config10.arbitrumOne,
|
|
5166
|
+
import_sdk_config10.avalanche,
|
|
5167
|
+
import_sdk_config10.base,
|
|
5168
|
+
import_sdk_config10.bnb,
|
|
5169
|
+
import_sdk_config10.gnosisChain,
|
|
5170
|
+
import_sdk_config10.mainnet,
|
|
5171
|
+
import_sdk_config10.optimism,
|
|
5172
|
+
import_sdk_config10.polygon,
|
|
5173
|
+
import_sdk_config10.plasma,
|
|
5174
|
+
import_sdk_config10.bitcoin,
|
|
5175
|
+
import_sdk_config10.solana
|
|
5081
5176
|
];
|
|
5082
5177
|
var NEAR_INTENTS_BLOCKCHAIN_CHAIN_IDS = {
|
|
5083
|
-
arb:
|
|
5084
|
-
avax:
|
|
5085
|
-
base:
|
|
5086
|
-
bsc:
|
|
5087
|
-
eth:
|
|
5088
|
-
gnosis:
|
|
5089
|
-
op:
|
|
5090
|
-
pol:
|
|
5091
|
-
plasma:
|
|
5092
|
-
btc:
|
|
5093
|
-
sol:
|
|
5178
|
+
arb: import_sdk_config10.arbitrumOne.id,
|
|
5179
|
+
avax: import_sdk_config10.avalanche.id,
|
|
5180
|
+
base: import_sdk_config10.base.id,
|
|
5181
|
+
bsc: import_sdk_config10.bnb.id,
|
|
5182
|
+
eth: import_sdk_config10.mainnet.id,
|
|
5183
|
+
gnosis: import_sdk_config10.gnosisChain.id,
|
|
5184
|
+
op: import_sdk_config10.optimism.id,
|
|
5185
|
+
pol: import_sdk_config10.polygon.id,
|
|
5186
|
+
plasma: import_sdk_config10.plasma.id,
|
|
5187
|
+
btc: import_sdk_config10.bitcoin.id,
|
|
5188
|
+
sol: import_sdk_config10.solana.id
|
|
5094
5189
|
};
|
|
5095
5190
|
var NEAR_INTENTS_STATUS_TO_COW_STATUS = {
|
|
5096
5191
|
KNOWN_DEPOSIT_TX: "in_progress" /* IN_PROGRESS */,
|
|
@@ -5108,7 +5203,7 @@ var ATTESTATOR_ADDRESS = "0x0073DD100b51C555E41B2a452E5933ef76F42790";
|
|
|
5108
5203
|
// src/providers/near-intents/util.ts
|
|
5109
5204
|
var import_json_stable_stringify3 = __toESM(require("json-stable-stringify"));
|
|
5110
5205
|
var import_sdk_common19 = require("@cowprotocol/sdk-common");
|
|
5111
|
-
var
|
|
5206
|
+
var import_sdk_config11 = require("@cowprotocol/sdk-config");
|
|
5112
5207
|
var calculateDeadline = (seconds) => {
|
|
5113
5208
|
const secs = Number(seconds);
|
|
5114
5209
|
if (!Number.isFinite(secs)) {
|
|
@@ -5120,13 +5215,13 @@ var calculateDeadline = (seconds) => {
|
|
|
5120
5215
|
var resolveTokenAddress = (chainId, contractAddress) => {
|
|
5121
5216
|
const isBtcNative = chainId === NEAR_INTENTS_BLOCKCHAIN_CHAIN_IDS.btc && (!contractAddress || contractAddress === "coin");
|
|
5122
5217
|
if (isBtcNative)
|
|
5123
|
-
return
|
|
5218
|
+
return import_sdk_config11.BTC_CURRENCY_ADDRESS;
|
|
5124
5219
|
if (contractAddress)
|
|
5125
5220
|
return contractAddress;
|
|
5126
5221
|
if (chainId === NEAR_INTENTS_BLOCKCHAIN_CHAIN_IDS.sol)
|
|
5127
|
-
return
|
|
5128
|
-
if ((0,
|
|
5129
|
-
return
|
|
5222
|
+
return import_sdk_config11.SOL_NATIVE_CURRENCY_ADDRESS;
|
|
5223
|
+
if ((0, import_sdk_config11.isEvmChain)(chainId))
|
|
5224
|
+
return import_sdk_config11.ETH_ADDRESS;
|
|
5130
5225
|
return null;
|
|
5131
5226
|
};
|
|
5132
5227
|
var adaptToken = (token) => {
|
|
@@ -5278,7 +5373,7 @@ var NearIntentsBridgeProvider = class {
|
|
|
5278
5373
|
validFor,
|
|
5279
5374
|
owner
|
|
5280
5375
|
} = request;
|
|
5281
|
-
if ((0, import_sdk_common20.areAddressesEqual)(sellTokenAddress,
|
|
5376
|
+
if ((0, import_sdk_common20.areAddressesEqual)(sellTokenAddress, import_sdk_config12.BTC_CURRENCY_ADDRESS) || (0, import_sdk_common20.areAddressesEqual)(sellTokenAddress, import_sdk_config12.SOL_NATIVE_CURRENCY_ADDRESS)) {
|
|
5282
5377
|
throw new BridgeProviderQuoteError("NO_ROUTES" /* NO_ROUTES */);
|
|
5283
5378
|
}
|
|
5284
5379
|
const tokens = await this.api.getTokens();
|
package/dist/index.mjs
CHANGED
|
@@ -256,79 +256,169 @@ function getHookMockForCostEstimation(gasLimit) {
|
|
|
256
256
|
import { getGlobalAdapter as getGlobalAdapter2, jsonWithBigintReplacer as jsonWithBigintReplacer2, log as log2 } from "@cowprotocol/sdk-common";
|
|
257
257
|
|
|
258
258
|
// src/BridgingSdk/determineIntermediateToken.ts
|
|
259
|
-
import {
|
|
259
|
+
import { isSupportedChain } from "@cowprotocol/sdk-config";
|
|
260
|
+
import { areAddressesEqual, getAddressKey as getAddressKey3, isNativeToken } from "@cowprotocol/sdk-common";
|
|
260
261
|
|
|
261
262
|
// src/BridgingSdk/tokenPriority.ts
|
|
262
263
|
import { SupportedChainId } from "@cowprotocol/sdk-config";
|
|
263
264
|
import { getAddressKey as getAddressKey2 } from "@cowprotocol/sdk-common";
|
|
264
265
|
var PRIORITY_STABLECOIN_TOKENS = {
|
|
265
266
|
[SupportedChainId.MAINNET]: /* @__PURE__ */ new Set([
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
{
|
|
268
|
+
chainId: SupportedChainId.MAINNET,
|
|
269
|
+
address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
270
|
+
decimals: 6,
|
|
271
|
+
symbol: "USDC"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
chainId: SupportedChainId.MAINNET,
|
|
275
|
+
address: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
276
|
+
decimals: 6,
|
|
277
|
+
symbol: "USDT"
|
|
278
|
+
}
|
|
270
279
|
]),
|
|
271
280
|
[SupportedChainId.BNB]: /* @__PURE__ */ new Set([
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
281
|
+
{
|
|
282
|
+
chainId: SupportedChainId.BNB,
|
|
283
|
+
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
284
|
+
decimals: 18,
|
|
285
|
+
symbol: "USDC"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
chainId: SupportedChainId.BNB,
|
|
289
|
+
address: "0x55d398326f99059ff775485246999027b3197955",
|
|
290
|
+
decimals: 18,
|
|
291
|
+
symbol: "USDT"
|
|
292
|
+
}
|
|
276
293
|
]),
|
|
277
294
|
[SupportedChainId.GNOSIS_CHAIN]: /* @__PURE__ */ new Set([
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
295
|
+
{
|
|
296
|
+
chainId: SupportedChainId.GNOSIS_CHAIN,
|
|
297
|
+
address: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
|
|
298
|
+
decimals: 6,
|
|
299
|
+
symbol: "USDC"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
chainId: SupportedChainId.GNOSIS_CHAIN,
|
|
303
|
+
address: "0x2a22f9c3b484c3629090feed35f17ff8f88f76f0",
|
|
304
|
+
decimals: 6,
|
|
305
|
+
symbol: "USDC.e"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
chainId: SupportedChainId.GNOSIS_CHAIN,
|
|
309
|
+
address: "0x4ecaba5870353805a9f068101a40e0f32ed605c6",
|
|
310
|
+
decimals: 6,
|
|
311
|
+
symbol: "USDT"
|
|
312
|
+
}
|
|
284
313
|
]),
|
|
285
314
|
[SupportedChainId.POLYGON]: /* @__PURE__ */ new Set([
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
315
|
+
{
|
|
316
|
+
chainId: SupportedChainId.POLYGON,
|
|
317
|
+
address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
|
|
318
|
+
decimals: 6,
|
|
319
|
+
symbol: "USDC"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
chainId: SupportedChainId.POLYGON,
|
|
323
|
+
address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
|
|
324
|
+
decimals: 6,
|
|
325
|
+
symbol: "USDT"
|
|
326
|
+
}
|
|
290
327
|
]),
|
|
291
328
|
[SupportedChainId.BASE]: /* @__PURE__ */ new Set([
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
329
|
+
{
|
|
330
|
+
chainId: SupportedChainId.BASE,
|
|
331
|
+
address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
|
|
332
|
+
decimals: 6,
|
|
333
|
+
symbol: "USDC"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
chainId: SupportedChainId.BASE,
|
|
337
|
+
address: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
|
|
338
|
+
decimals: 6,
|
|
339
|
+
symbol: "USDT"
|
|
340
|
+
}
|
|
296
341
|
]),
|
|
297
342
|
[SupportedChainId.ARBITRUM_ONE]: /* @__PURE__ */ new Set([
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
343
|
+
{
|
|
344
|
+
chainId: SupportedChainId.ARBITRUM_ONE,
|
|
345
|
+
address: "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
|
|
346
|
+
decimals: 6,
|
|
347
|
+
symbol: "USDC"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
chainId: SupportedChainId.ARBITRUM_ONE,
|
|
351
|
+
address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
|
|
352
|
+
decimals: 6,
|
|
353
|
+
symbol: "USDT"
|
|
354
|
+
}
|
|
302
355
|
]),
|
|
303
356
|
[SupportedChainId.AVALANCHE]: /* @__PURE__ */ new Set([
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
357
|
+
{
|
|
358
|
+
chainId: SupportedChainId.AVALANCHE,
|
|
359
|
+
address: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
|
|
360
|
+
decimals: 6,
|
|
361
|
+
symbol: "USDC"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
chainId: SupportedChainId.AVALANCHE,
|
|
365
|
+
address: "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7",
|
|
366
|
+
decimals: 6,
|
|
367
|
+
symbol: "USDT"
|
|
368
|
+
}
|
|
308
369
|
]),
|
|
309
370
|
[SupportedChainId.LINEA]: /* @__PURE__ */ new Set([
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
371
|
+
{
|
|
372
|
+
chainId: SupportedChainId.LINEA,
|
|
373
|
+
address: "0x176211869ca2b568f2a7d4ee941e073a821ee1ff",
|
|
374
|
+
decimals: 6,
|
|
375
|
+
symbol: "USDC"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
chainId: SupportedChainId.LINEA,
|
|
379
|
+
address: "0xa219439258ca9da29e9cc4ce5596924745e12b93",
|
|
380
|
+
decimals: 6,
|
|
381
|
+
symbol: "USDT"
|
|
382
|
+
}
|
|
314
383
|
]),
|
|
315
384
|
[SupportedChainId.SEPOLIA]: /* @__PURE__ */ new Set([
|
|
316
|
-
|
|
317
|
-
|
|
385
|
+
{
|
|
386
|
+
chainId: SupportedChainId.SEPOLIA,
|
|
387
|
+
address: "0x1c7d4b196cb0c7b01d743fbc6116a902379c7238",
|
|
388
|
+
decimals: 6,
|
|
389
|
+
symbol: "USDC"
|
|
390
|
+
}
|
|
318
391
|
])
|
|
319
392
|
};
|
|
320
|
-
function
|
|
393
|
+
function getStablecoinPriorityToken(chainId, tokenAddress) {
|
|
321
394
|
const chainTokens = PRIORITY_STABLECOIN_TOKENS[chainId];
|
|
322
395
|
if (!chainTokens)
|
|
323
|
-
return
|
|
324
|
-
|
|
396
|
+
return void 0;
|
|
397
|
+
const key = getAddressKey2(tokenAddress);
|
|
398
|
+
for (const token of chainTokens) {
|
|
399
|
+
if (getAddressKey2(token.address) === key)
|
|
400
|
+
return token;
|
|
401
|
+
}
|
|
402
|
+
return void 0;
|
|
403
|
+
}
|
|
404
|
+
function isStablecoinPriorityToken(chainId, tokenAddress) {
|
|
405
|
+
return getStablecoinPriorityToken(chainId, tokenAddress) !== void 0;
|
|
325
406
|
}
|
|
326
407
|
function isCorrelatedToken(tokenAddress, correlatedTokens) {
|
|
327
408
|
return correlatedTokens.has(getAddressKey2(tokenAddress));
|
|
328
409
|
}
|
|
329
410
|
|
|
330
411
|
// src/BridgingSdk/determineIntermediateToken.ts
|
|
331
|
-
async function determineIntermediateToken(
|
|
412
|
+
async function determineIntermediateToken(context) {
|
|
413
|
+
const {
|
|
414
|
+
sourceChainId,
|
|
415
|
+
sourceTokenAddress,
|
|
416
|
+
destinationChainId,
|
|
417
|
+
destinationTokenAddress,
|
|
418
|
+
intermediateTokens,
|
|
419
|
+
getCorrelatedTokens,
|
|
420
|
+
allowIntermediateEqSellToken
|
|
421
|
+
} = context;
|
|
332
422
|
const firstToken = intermediateTokens[0];
|
|
333
423
|
if (intermediateTokens.length === 0 || !firstToken) {
|
|
334
424
|
throw new BridgeProviderQuoteError("NO_INTERMEDIATE_TOKENS" /* NO_INTERMEDIATE_TOKENS */, { intermediateTokens });
|
|
@@ -337,26 +427,29 @@ async function determineIntermediateToken(sourceChainId, sourceTokenAddress, int
|
|
|
337
427
|
return firstToken;
|
|
338
428
|
}
|
|
339
429
|
const correlatedTokens = await resolveCorrelatedTokens(sourceChainId, getCorrelatedTokens);
|
|
340
|
-
const sellTokenLike = { chainId: sourceChainId, address: sourceTokenAddress };
|
|
341
|
-
const isSellNativeOrWrapped = isNativeToken(sellTokenLike) || isWrappedNativeToken(sellTokenLike);
|
|
342
430
|
const filteredTokens = allowIntermediateEqSellToken ? intermediateTokens : intermediateTokens.filter((token) => !areAddressesEqual(token.address, sourceTokenAddress));
|
|
431
|
+
const destinationStableCoin = isSupportedChain(destinationChainId) ? getStablecoinPriorityToken(destinationChainId, destinationTokenAddress) : void 0;
|
|
343
432
|
const tokensWithPriority = filteredTokens.map((token) => {
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
|
|
347
|
-
|
|
433
|
+
const isStableCoin = isStablecoinPriorityToken(token.chainId, token.address);
|
|
434
|
+
if (destinationStableCoin && isStableCoin) {
|
|
435
|
+
const matchesDestinationTokenSymbol = !!token.symbol && token.symbol.toLowerCase() === destinationStableCoin?.symbol?.toLowerCase();
|
|
436
|
+
if (matchesDestinationTokenSymbol) {
|
|
437
|
+
return { token, priority: 6 /* STABLECOIN_MATCHES_DESTINATION */ };
|
|
348
438
|
}
|
|
349
439
|
}
|
|
350
|
-
if (
|
|
351
|
-
return { token, priority:
|
|
440
|
+
if (areAddressesEqual(token.address, sourceTokenAddress)) {
|
|
441
|
+
return { token, priority: 5 /* MATCHES_SELL */ };
|
|
442
|
+
}
|
|
443
|
+
if (isStableCoin) {
|
|
444
|
+
return { token, priority: 4 /* STABLECOIN */ };
|
|
352
445
|
}
|
|
353
446
|
if (isCorrelatedToken(token.address, correlatedTokens)) {
|
|
354
|
-
return { token, priority: 3 /*
|
|
447
|
+
return { token, priority: 3 /* CORRELATED */ };
|
|
355
448
|
}
|
|
356
|
-
if (isNativeToken(token)
|
|
357
|
-
return { token, priority: 2 /*
|
|
449
|
+
if (isNativeToken(token)) {
|
|
450
|
+
return { token, priority: 2 /* NATIVE */ };
|
|
358
451
|
}
|
|
359
|
-
return { token, priority: 1 /*
|
|
452
|
+
return { token, priority: 1 /* OTHER */ };
|
|
360
453
|
});
|
|
361
454
|
tokensWithPriority.sort((a, b) => {
|
|
362
455
|
if (a.priority !== b.priority) {
|
|
@@ -411,13 +504,15 @@ async function getIntermediateSwapResult({
|
|
|
411
504
|
quoteBridgeRequest: swapAndBridgeRequest,
|
|
412
505
|
intermediateTokensCache: params.intermediateTokensCache
|
|
413
506
|
});
|
|
414
|
-
const intermediateToken = await determineIntermediateToken(
|
|
415
|
-
sellTokenChainId,
|
|
416
|
-
sellTokenAddress,
|
|
507
|
+
const intermediateToken = await determineIntermediateToken({
|
|
508
|
+
sourceChainId: sellTokenChainId,
|
|
509
|
+
sourceTokenAddress: sellTokenAddress,
|
|
510
|
+
destinationChainId: buyTokenChainId,
|
|
511
|
+
destinationTokenAddress: buyTokenAddress,
|
|
417
512
|
intermediateTokens,
|
|
418
|
-
params.advancedSettings?.getCorrelatedTokens,
|
|
513
|
+
getCorrelatedTokens: params.advancedSettings?.getCorrelatedTokens,
|
|
419
514
|
allowIntermediateEqSellToken
|
|
420
|
-
);
|
|
515
|
+
});
|
|
421
516
|
log2(`Using ${intermediateToken?.name ?? intermediateToken?.address} as intermediate tokens`);
|
|
422
517
|
const bridgeRequestWithoutAmount = {
|
|
423
518
|
...swapAndBridgeRequest,
|
|
@@ -1501,56 +1596,56 @@ var COW_TRADE_EVENT_INTERFACE = () => {
|
|
|
1501
1596
|
};
|
|
1502
1597
|
|
|
1503
1598
|
// src/providers/across/const/contracts.ts
|
|
1504
|
-
import { AdditionalTargetChainId, SupportedChainId as
|
|
1599
|
+
import { AdditionalTargetChainId, SupportedChainId as SupportedChainId3 } from "@cowprotocol/sdk-config";
|
|
1505
1600
|
var ACROSS_SPOOK_CONTRACT_ADDRESSES = {
|
|
1506
1601
|
// https://docs.across.to/reference/contract-addresses/mainnet-chain-id-1
|
|
1507
|
-
[
|
|
1602
|
+
[SupportedChainId3.MAINNET]: "0x5c7BCd6E7De5423a257D81B442095A1a6ced35C5",
|
|
1508
1603
|
// https://docs.across.to/reference/contract-addresses/arbitrum-chain-id-42161-1
|
|
1509
|
-
[
|
|
1604
|
+
[SupportedChainId3.ARBITRUM_ONE]: "0xe35e9842fceaca96570b734083f4a58e8f7c5f2a",
|
|
1510
1605
|
// https://docs.across.to/reference/contract-addresses/base-chain-id-8453
|
|
1511
|
-
[
|
|
1606
|
+
[SupportedChainId3.BASE]: "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64",
|
|
1512
1607
|
// // https://docs.across.to/reference/contract-addresses/mainnet-chain-id-1
|
|
1513
|
-
[
|
|
1608
|
+
[SupportedChainId3.SEPOLIA]: "0x5ef6C01E11889d86803e0B23e3cB3F9E9d97B662",
|
|
1514
1609
|
// https://docs.across.to/reference/contract-addresses/polygon-chain-id-137
|
|
1515
|
-
[
|
|
1610
|
+
[SupportedChainId3.POLYGON]: "0x9295ee1d8C5b022Be115A2AD3c30C72E34e7F096",
|
|
1516
1611
|
// https://docs.across.to/reference/contract-addresses/bnb-smart-chain
|
|
1517
|
-
[
|
|
1612
|
+
[SupportedChainId3.BNB]: "0x4e8E101924eDE233C13e2D8622DC8aED2872d505",
|
|
1518
1613
|
// https://docs.across.to/reference/contract-addresses/linea-chain-id-59144
|
|
1519
|
-
[
|
|
1614
|
+
[SupportedChainId3.LINEA]: "0x7E63A5f1a8F0B4d0934B2f2327DAED3F6bb2ee75",
|
|
1520
1615
|
// https://docs.across.to/reference/contract-addresses/plasma
|
|
1521
|
-
[
|
|
1616
|
+
[SupportedChainId3.PLASMA]: "0x50039fAEfebef707cFD94D6d462fE6D10B39207a",
|
|
1522
1617
|
// https://docs.across.to/reference/contract-addresses/ink-chain-id-57073
|
|
1523
|
-
[
|
|
1618
|
+
[SupportedChainId3.INK]: "0xeF684C38F94F48775959ECf2012D7E864ffb9dd4",
|
|
1524
1619
|
// https://docs.across.to/reference/contract-addresses/optimism-chain-id-10
|
|
1525
1620
|
[AdditionalTargetChainId.OPTIMISM]: "0x6f26Bf09B1C792e3228e5467807a900A503c0281",
|
|
1526
1621
|
// Not supported chains
|
|
1527
1622
|
// TODO: This first integration is a draft, some of this chains might be supported, so we will need to update here as we iterate on the provider
|
|
1528
|
-
[
|
|
1529
|
-
[
|
|
1623
|
+
[SupportedChainId3.GNOSIS_CHAIN]: void 0,
|
|
1624
|
+
[SupportedChainId3.AVALANCHE]: void 0,
|
|
1530
1625
|
[AdditionalTargetChainId.BITCOIN]: void 0,
|
|
1531
|
-
[
|
|
1626
|
+
[SupportedChainId3.SOLANA]: void 0
|
|
1532
1627
|
};
|
|
1533
1628
|
var ACROSS_MATH_CONTRACT_ADDRESSES = {
|
|
1534
|
-
[
|
|
1535
|
-
[
|
|
1536
|
-
[
|
|
1629
|
+
[SupportedChainId3.MAINNET]: "0xf2ae6728b6f146556977Af0A68bFbf5bADA22863",
|
|
1630
|
+
[SupportedChainId3.ARBITRUM_ONE]: "0x5771A4b4029832e79a75De7B485E5fBbec28848f",
|
|
1631
|
+
[SupportedChainId3.BASE]: "0xd4e943dc6ddc885f6229ce33c2e3dfe402a12c81",
|
|
1537
1632
|
// Not supported chains
|
|
1538
1633
|
// TODO: This first integration is a draft, some of this chains might be supported, so we will need to update here as we iterate on the provider
|
|
1539
|
-
[
|
|
1540
|
-
[
|
|
1541
|
-
[
|
|
1542
|
-
[
|
|
1543
|
-
[
|
|
1634
|
+
[SupportedChainId3.GNOSIS_CHAIN]: void 0,
|
|
1635
|
+
[SupportedChainId3.SEPOLIA]: void 0,
|
|
1636
|
+
[SupportedChainId3.POLYGON]: void 0,
|
|
1637
|
+
[SupportedChainId3.AVALANCHE]: void 0,
|
|
1638
|
+
[SupportedChainId3.BNB]: void 0,
|
|
1544
1639
|
// TODO: confirm
|
|
1545
|
-
[
|
|
1640
|
+
[SupportedChainId3.LINEA]: void 0,
|
|
1546
1641
|
// TODO: confirm
|
|
1547
|
-
[
|
|
1642
|
+
[SupportedChainId3.PLASMA]: void 0,
|
|
1548
1643
|
// TODO: confirm
|
|
1549
|
-
[
|
|
1644
|
+
[SupportedChainId3.INK]: void 0,
|
|
1550
1645
|
// TODO: confirm
|
|
1551
1646
|
[AdditionalTargetChainId.OPTIMISM]: void 0,
|
|
1552
1647
|
[AdditionalTargetChainId.BITCOIN]: void 0,
|
|
1553
|
-
[
|
|
1648
|
+
[SupportedChainId3.SOLANA]: void 0
|
|
1554
1649
|
};
|
|
1555
1650
|
|
|
1556
1651
|
// src/providers/across/util.ts
|
|
@@ -3626,7 +3721,7 @@ import {
|
|
|
3626
3721
|
mainnet,
|
|
3627
3722
|
optimism,
|
|
3628
3723
|
polygon,
|
|
3629
|
-
isSupportedChain
|
|
3724
|
+
isSupportedChain as isSupportedChain2
|
|
3630
3725
|
} from "@cowprotocol/sdk-config";
|
|
3631
3726
|
import { CowShedSdk } from "@cowprotocol/sdk-cow-shed";
|
|
3632
3727
|
import { OrderKind as OrderKind3 } from "@cowprotocol/sdk-order-book";
|
|
@@ -3738,7 +3833,7 @@ var AcrossBridgeProvider = class {
|
|
|
3738
3833
|
throw new Error("Not implemented");
|
|
3739
3834
|
}
|
|
3740
3835
|
async getBridgingParams(chainId, order, txHash, settlementContractOverride) {
|
|
3741
|
-
if (!
|
|
3836
|
+
if (!isSupportedChain2(chainId)) {
|
|
3742
3837
|
return null;
|
|
3743
3838
|
}
|
|
3744
3839
|
const orderUid = order.uid;
|
|
@@ -3984,69 +4079,69 @@ var getBungeeBridgeFromDisplayName = (displayName) => {
|
|
|
3984
4079
|
};
|
|
3985
4080
|
|
|
3986
4081
|
// src/providers/bungee/const/contracts.ts
|
|
3987
|
-
import { AdditionalTargetChainId as AdditionalTargetChainId2, SupportedChainId as
|
|
4082
|
+
import { AdditionalTargetChainId as AdditionalTargetChainId2, SupportedChainId as SupportedChainId5 } from "@cowprotocol/sdk-config";
|
|
3988
4083
|
var BUNGEE_COWSWAP_LIB_ADDRESS = "0x75b6ba5fcab20848ca00f132d253638fea82e598";
|
|
3989
4084
|
var BungeeCowswapLibAddresses = {
|
|
3990
|
-
[
|
|
3991
|
-
[
|
|
3992
|
-
[
|
|
3993
|
-
[
|
|
3994
|
-
[
|
|
3995
|
-
[
|
|
3996
|
-
[
|
|
4085
|
+
[SupportedChainId5.MAINNET]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4086
|
+
[SupportedChainId5.GNOSIS_CHAIN]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4087
|
+
[SupportedChainId5.ARBITRUM_ONE]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4088
|
+
[SupportedChainId5.BASE]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4089
|
+
[SupportedChainId5.AVALANCHE]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4090
|
+
[SupportedChainId5.POLYGON]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4091
|
+
[SupportedChainId5.BNB]: void 0,
|
|
3997
4092
|
// TODO: confirm
|
|
3998
|
-
[
|
|
4093
|
+
[SupportedChainId5.LINEA]: void 0,
|
|
3999
4094
|
// TODO: confirm
|
|
4000
|
-
[
|
|
4095
|
+
[SupportedChainId5.PLASMA]: void 0,
|
|
4001
4096
|
// TODO: confirm
|
|
4002
|
-
[
|
|
4097
|
+
[SupportedChainId5.INK]: void 0,
|
|
4003
4098
|
// TODO: confirm
|
|
4004
|
-
[
|
|
4099
|
+
[SupportedChainId5.SEPOLIA]: void 0,
|
|
4005
4100
|
[AdditionalTargetChainId2.OPTIMISM]: BUNGEE_COWSWAP_LIB_ADDRESS,
|
|
4006
4101
|
[AdditionalTargetChainId2.BITCOIN]: void 0,
|
|
4007
|
-
[
|
|
4102
|
+
[SupportedChainId5.SOLANA]: void 0
|
|
4008
4103
|
};
|
|
4009
4104
|
var SOCKET_VERIFIER_ADDRESS = "0xa27A3f5A96DF7D8Be26EE2790999860C00eb688D";
|
|
4010
4105
|
var SocketVerifierAddresses = {
|
|
4011
|
-
[
|
|
4012
|
-
[
|
|
4013
|
-
[
|
|
4014
|
-
[
|
|
4015
|
-
[
|
|
4016
|
-
[
|
|
4017
|
-
[
|
|
4106
|
+
[SupportedChainId5.MAINNET]: SOCKET_VERIFIER_ADDRESS,
|
|
4107
|
+
[SupportedChainId5.GNOSIS_CHAIN]: SOCKET_VERIFIER_ADDRESS,
|
|
4108
|
+
[SupportedChainId5.ARBITRUM_ONE]: SOCKET_VERIFIER_ADDRESS,
|
|
4109
|
+
[SupportedChainId5.BASE]: SOCKET_VERIFIER_ADDRESS,
|
|
4110
|
+
[SupportedChainId5.AVALANCHE]: SOCKET_VERIFIER_ADDRESS,
|
|
4111
|
+
[SupportedChainId5.POLYGON]: SOCKET_VERIFIER_ADDRESS,
|
|
4112
|
+
[SupportedChainId5.BNB]: void 0,
|
|
4018
4113
|
// TODO: confirm
|
|
4019
|
-
[
|
|
4114
|
+
[SupportedChainId5.LINEA]: void 0,
|
|
4020
4115
|
// TODO: confirm
|
|
4021
|
-
[
|
|
4116
|
+
[SupportedChainId5.PLASMA]: void 0,
|
|
4022
4117
|
// TODO: confirm
|
|
4023
|
-
[
|
|
4118
|
+
[SupportedChainId5.INK]: void 0,
|
|
4024
4119
|
// TODO: confirm
|
|
4025
|
-
[
|
|
4120
|
+
[SupportedChainId5.SEPOLIA]: void 0,
|
|
4026
4121
|
[AdditionalTargetChainId2.OPTIMISM]: SOCKET_VERIFIER_ADDRESS,
|
|
4027
4122
|
[AdditionalTargetChainId2.BITCOIN]: void 0,
|
|
4028
|
-
[
|
|
4123
|
+
[SupportedChainId5.SOLANA]: void 0
|
|
4029
4124
|
};
|
|
4030
4125
|
var BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS = "0xD06a673fe1fa27B1b9E5BA0be980AB15Dbce85cc";
|
|
4031
4126
|
var BungeeApproveAndBridgeV1Addresses = {
|
|
4032
|
-
[
|
|
4033
|
-
[
|
|
4034
|
-
[
|
|
4035
|
-
[
|
|
4036
|
-
[
|
|
4037
|
-
[
|
|
4038
|
-
[
|
|
4127
|
+
[SupportedChainId5.MAINNET]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4128
|
+
[SupportedChainId5.GNOSIS_CHAIN]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4129
|
+
[SupportedChainId5.ARBITRUM_ONE]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4130
|
+
[SupportedChainId5.BASE]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4131
|
+
[SupportedChainId5.AVALANCHE]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4132
|
+
[SupportedChainId5.POLYGON]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4133
|
+
[SupportedChainId5.BNB]: void 0,
|
|
4039
4134
|
// TODO: confirm
|
|
4040
|
-
[
|
|
4135
|
+
[SupportedChainId5.LINEA]: void 0,
|
|
4041
4136
|
// TODO: confirm
|
|
4042
|
-
[
|
|
4137
|
+
[SupportedChainId5.PLASMA]: void 0,
|
|
4043
4138
|
// TODO: confirm
|
|
4044
|
-
[
|
|
4139
|
+
[SupportedChainId5.INK]: void 0,
|
|
4045
4140
|
// TODO: confirm
|
|
4046
|
-
[
|
|
4141
|
+
[SupportedChainId5.SEPOLIA]: void 0,
|
|
4047
4142
|
[AdditionalTargetChainId2.OPTIMISM]: BUNGEE_APPROVE_AND_BRIDGE_V1_ADDRESS,
|
|
4048
4143
|
[AdditionalTargetChainId2.BITCOIN]: void 0,
|
|
4049
|
-
[
|
|
4144
|
+
[SupportedChainId5.SOLANA]: void 0
|
|
4050
4145
|
};
|
|
4051
4146
|
|
|
4052
4147
|
// src/providers/bungee/abi.ts
|
|
@@ -4785,7 +4880,7 @@ import {
|
|
|
4785
4880
|
mainnet as mainnet2,
|
|
4786
4881
|
optimism as optimism2,
|
|
4787
4882
|
polygon as polygon2,
|
|
4788
|
-
SupportedChainId as
|
|
4883
|
+
SupportedChainId as SupportedChainId6
|
|
4789
4884
|
} from "@cowprotocol/sdk-config";
|
|
4790
4885
|
import { CowShedSdk as CowShedSdk2 } from "@cowprotocol/sdk-cow-shed";
|
|
4791
4886
|
import { setGlobalAdapter as setGlobalAdapter3 } from "@cowprotocol/sdk-common";
|
|
@@ -4945,7 +5040,7 @@ var BungeeBridgeProvider = class {
|
|
|
4945
5040
|
}
|
|
4946
5041
|
isExtraGasRequired(request) {
|
|
4947
5042
|
const { sellTokenChainId, buyTokenChainId } = request;
|
|
4948
|
-
return sellTokenChainId ===
|
|
5043
|
+
return sellTokenChainId === SupportedChainId6.MAINNET && buyTokenChainId === SupportedChainId6.GNOSIS_CHAIN;
|
|
4949
5044
|
}
|
|
4950
5045
|
};
|
|
4951
5046
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cowprotocol/sdk-bridging",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Bridging for CoW Protocol",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,19 +21,18 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@defuse-protocol/one-click-sdk-typescript": "0.1.1-0.2",
|
|
23
23
|
"json-stable-stringify": "^1.3.0",
|
|
24
|
-
"@cowprotocol/sdk-
|
|
25
|
-
"@cowprotocol/sdk-
|
|
26
|
-
"@cowprotocol/sdk-config": "2.3.
|
|
27
|
-
"@cowprotocol/sdk-contracts-ts": "3.
|
|
28
|
-
"@cowprotocol/sdk-
|
|
29
|
-
"@cowprotocol/sdk-
|
|
30
|
-
"@cowprotocol/sdk-trading": "2.
|
|
31
|
-
"@cowprotocol/sdk-
|
|
24
|
+
"@cowprotocol/sdk-common": "0.12.0",
|
|
25
|
+
"@cowprotocol/sdk-app-data": "5.3.0",
|
|
26
|
+
"@cowprotocol/sdk-config": "2.3.1",
|
|
27
|
+
"@cowprotocol/sdk-contracts-ts": "3.2.0",
|
|
28
|
+
"@cowprotocol/sdk-cow-shed": "0.4.0",
|
|
29
|
+
"@cowprotocol/sdk-order-book": "4.0.0",
|
|
30
|
+
"@cowprotocol/sdk-trading": "2.2.0",
|
|
31
|
+
"@cowprotocol/sdk-weiroll": "0.2.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/jest": "^29.4.0",
|
|
35
35
|
"@types/node": "^20.17.31",
|
|
36
|
-
"coveralls": "^3.1.1",
|
|
37
36
|
"ethers": "^5.7.2",
|
|
38
37
|
"ethers-v5": "npm:ethers@^5.7.2",
|
|
39
38
|
"ethers-v6": "npm:ethers@^6.13.7",
|
|
@@ -43,18 +42,19 @@
|
|
|
43
42
|
"tsup": "^7.2.0",
|
|
44
43
|
"typescript": "^5.2.2",
|
|
45
44
|
"viem": "^2.28.4",
|
|
45
|
+
"@cowprotocol/sdk-ethers-v5-adapter": "0.4.10",
|
|
46
46
|
"@cow-sdk/typescript-config": "0.0.0-beta.0",
|
|
47
|
-
"@cowprotocol/sdk-ethers-v6-adapter": "0.4.
|
|
48
|
-
"@cowprotocol/sdk-
|
|
49
|
-
"@cowprotocol/sdk-
|
|
50
|
-
"@cowprotocol/sdk-viem-adapter": "0.3.23"
|
|
47
|
+
"@cowprotocol/sdk-ethers-v6-adapter": "0.4.10",
|
|
48
|
+
"@cowprotocol/sdk-viem-adapter": "0.3.24",
|
|
49
|
+
"@cowprotocol/sdk-order-signing": "1.1.0"
|
|
51
50
|
},
|
|
52
51
|
"scripts": {
|
|
53
52
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
54
53
|
"lint": "eslint src/**/*.ts",
|
|
55
54
|
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
56
55
|
"test": "jest",
|
|
57
|
-
"test:coverage": "jest --coverage
|
|
56
|
+
"test:coverage": "jest --coverage",
|
|
57
|
+
"coverage:badges": "istanbul-badges-readme --exitCode=1",
|
|
58
58
|
"test:coverage:html": "jest --silent=false --coverage --coverageReporters html",
|
|
59
59
|
"test:bungeeGnosisBridge": "jest --testPathPattern=BungeeGnosisBridge",
|
|
60
60
|
"test:bungeeAcrossBridge": "jest --testPathPattern=BungeeAcrossBridge",
|