@cowprotocol/sdk-bridging 0.12.0 → 0.12.1

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.js CHANGED
@@ -3804,7 +3804,7 @@ var HOOK_DAPP_BRIDGE_PROVIDER_PREFIX2 = "cow-sdk://bridging/providers";
3804
3804
  var BungeeTxDataBytesIndices = {
3805
3805
  across: {
3806
3806
  // bridgeERC20To
3807
- ["0x792ebcb9".toLowerCase()]: {
3807
+ ["0xcc54d224".toLowerCase()]: {
3808
3808
  inputAmount: {
3809
3809
  bytes_startIndex: 8,
3810
3810
  // first 8 bytes are the routeId, followed by the function selector
@@ -3814,20 +3814,10 @@ var BungeeTxDataBytesIndices = {
3814
3814
  // first two characters are 0x and 8 bytes = 16 chars for the amount
3815
3815
  bytesString_length: 32 * 2
3816
3816
  // 32 bytes = 64 chars for the amount
3817
- },
3818
- outputAmount: {
3819
- bytes_startIndex: 488,
3820
- // outputAmount is part of the AcrossBridgeData struct in SocketGateway AcrossV3 impl
3821
- bytes_length: 32,
3822
- // 32 bytes of amount
3823
- bytesString_startIndex: 2 + 488 * 2,
3824
- // first two characters are 0x and 484 bytes = 968 chars for the amount
3825
- bytesString_length: 32 * 2
3826
- // 32 bytes = 64 chars for the amount
3827
3817
  }
3828
3818
  },
3829
3819
  // bridgeNativeTo
3830
- ["0xe421f352".toLowerCase()]: {
3820
+ ["0xa3b8bfba".toLowerCase()]: {
3831
3821
  inputAmount: {
3832
3822
  bytes_startIndex: 8,
3833
3823
  // first 8 bytes are the routeId, followed by the function selector
@@ -3837,16 +3827,6 @@ var BungeeTxDataBytesIndices = {
3837
3827
  // first two characters are 0x and 8 bytes = 16 chars for the amount
3838
3828
  bytesString_length: 32 * 2
3839
3829
  // 32 bytes = 64 chars for the amount
3840
- },
3841
- outputAmount: {
3842
- bytes_startIndex: 392,
3843
- // outputAmount is part of the AcrossBridgeData struct in SocketGateway AcrossV3 impl
3844
- bytes_length: 32,
3845
- // 32 bytes of amount
3846
- bytesString_startIndex: 2 + 392 * 2,
3847
- // first two characters are 0x and 484 bytes = 968 chars for the amount
3848
- bytesString_length: 32 * 2
3849
- // 32 bytes = 64 chars for the amount
3850
3830
  }
3851
3831
  }
3852
3832
  },
@@ -4720,13 +4700,9 @@ async function createBungeeDepositCall(params) {
4720
4700
  throw new Error(`createBungeeDepositCall() no params for function [${functionSelector}]`);
4721
4701
  }
4722
4702
  const inputAmountStartIndex = functionParams.inputAmount.bytes_startIndex;
4723
- let modifyOutputAmount = false;
4724
- let outputAmountStartIndex = 0;
4703
+ const modifyOutputAmount = false;
4704
+ const outputAmountStartIndex = 0;
4725
4705
  const nativeTokenExtraFee = 0n;
4726
- if (bridge === "across" /* Across */) {
4727
- modifyOutputAmount = true;
4728
- outputAmountStartIndex = functionParams.outputAmount.bytes_startIndex;
4729
- }
4730
4706
  const modifyCalldataParams = adapter.utils.encodeAbi(
4731
4707
  ["uint256", "bool", "uint256"],
4732
4708
  [inputAmountStartIndex, modifyOutputAmount, outputAmountStartIndex]
package/dist/index.mjs CHANGED
@@ -3754,7 +3754,7 @@ var HOOK_DAPP_BRIDGE_PROVIDER_PREFIX2 = "cow-sdk://bridging/providers";
3754
3754
  var BungeeTxDataBytesIndices = {
3755
3755
  across: {
3756
3756
  // bridgeERC20To
3757
- ["0x792ebcb9".toLowerCase()]: {
3757
+ ["0xcc54d224".toLowerCase()]: {
3758
3758
  inputAmount: {
3759
3759
  bytes_startIndex: 8,
3760
3760
  // first 8 bytes are the routeId, followed by the function selector
@@ -3764,20 +3764,10 @@ var BungeeTxDataBytesIndices = {
3764
3764
  // first two characters are 0x and 8 bytes = 16 chars for the amount
3765
3765
  bytesString_length: 32 * 2
3766
3766
  // 32 bytes = 64 chars for the amount
3767
- },
3768
- outputAmount: {
3769
- bytes_startIndex: 488,
3770
- // outputAmount is part of the AcrossBridgeData struct in SocketGateway AcrossV3 impl
3771
- bytes_length: 32,
3772
- // 32 bytes of amount
3773
- bytesString_startIndex: 2 + 488 * 2,
3774
- // first two characters are 0x and 484 bytes = 968 chars for the amount
3775
- bytesString_length: 32 * 2
3776
- // 32 bytes = 64 chars for the amount
3777
3767
  }
3778
3768
  },
3779
3769
  // bridgeNativeTo
3780
- ["0xe421f352".toLowerCase()]: {
3770
+ ["0xa3b8bfba".toLowerCase()]: {
3781
3771
  inputAmount: {
3782
3772
  bytes_startIndex: 8,
3783
3773
  // first 8 bytes are the routeId, followed by the function selector
@@ -3787,16 +3777,6 @@ var BungeeTxDataBytesIndices = {
3787
3777
  // first two characters are 0x and 8 bytes = 16 chars for the amount
3788
3778
  bytesString_length: 32 * 2
3789
3779
  // 32 bytes = 64 chars for the amount
3790
- },
3791
- outputAmount: {
3792
- bytes_startIndex: 392,
3793
- // outputAmount is part of the AcrossBridgeData struct in SocketGateway AcrossV3 impl
3794
- bytes_length: 32,
3795
- // 32 bytes of amount
3796
- bytesString_startIndex: 2 + 392 * 2,
3797
- // first two characters are 0x and 484 bytes = 968 chars for the amount
3798
- bytesString_length: 32 * 2
3799
- // 32 bytes = 64 chars for the amount
3800
3780
  }
3801
3781
  }
3802
3782
  },
@@ -4670,13 +4650,9 @@ async function createBungeeDepositCall(params) {
4670
4650
  throw new Error(`createBungeeDepositCall() no params for function [${functionSelector}]`);
4671
4651
  }
4672
4652
  const inputAmountStartIndex = functionParams.inputAmount.bytes_startIndex;
4673
- let modifyOutputAmount = false;
4674
- let outputAmountStartIndex = 0;
4653
+ const modifyOutputAmount = false;
4654
+ const outputAmountStartIndex = 0;
4675
4655
  const nativeTokenExtraFee = 0n;
4676
- if (bridge === "across" /* Across */) {
4677
- modifyOutputAmount = true;
4678
- outputAmountStartIndex = functionParams.outputAmount.bytes_startIndex;
4679
- }
4680
4656
  const modifyCalldataParams = adapter.utils.encodeAbi(
4681
4657
  ["uint256", "bool", "uint256"],
4682
4658
  [inputAmountStartIndex, modifyOutputAmount, outputAmountStartIndex]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-bridging",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
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.3.6",
20
19
  "@cowprotocol/sdk-common": "0.4.0",
21
20
  "@cowprotocol/sdk-contracts-ts": "0.8.1",
22
- "@cowprotocol/sdk-config": "0.6.2",
21
+ "@cowprotocol/sdk-cow-shed": "0.2.8",
23
22
  "@cowprotocol/sdk-order-book": "0.4.4",
24
23
  "@cowprotocol/sdk-trading": "0.7.1",
25
- "@cowprotocol/sdk-cow-shed": "0.2.8",
26
- "@cowprotocol/sdk-weiroll": "0.1.11"
24
+ "@cowprotocol/sdk-weiroll": "0.1.11",
25
+ "@cowprotocol/sdk-config": "0.6.2",
26
+ "@cowprotocol/sdk-app-data": "4.3.6"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/jest": "^29.4.0",
@@ -38,8 +38,8 @@
38
38
  "tsup": "^7.2.0",
39
39
  "typescript": "^5.2.2",
40
40
  "viem": "^2.28.4",
41
- "@cow-sdk/typescript-config": "0.0.0-beta.0",
42
41
  "@cowprotocol/sdk-ethers-v5-adapter": "0.3.0",
42
+ "@cow-sdk/typescript-config": "0.0.0-beta.0",
43
43
  "@cowprotocol/sdk-ethers-v6-adapter": "0.3.0",
44
44
  "@cowprotocol/sdk-order-signing": "0.1.21",
45
45
  "@cowprotocol/sdk-viem-adapter": "0.3.0"
@@ -51,7 +51,8 @@
51
51
  "test": "jest",
52
52
  "test:coverage": "jest --coverage --json --outputFile=jest.results.json && npx coveralls < ./coverage/lcov.info",
53
53
  "test:coverage:html": "jest --silent=false --coverage --coverageReporters html",
54
- "test:bungeeGnosisBridge": "yarn test --testPathPattern=BungeeGnosisBridge",
54
+ "test:bungeeGnosisBridge": "jest --testPathPattern=BungeeGnosisBridge",
55
+ "test:bungeeAcrossBridge": "jest --testPathPattern=BungeeAcrossBridge",
55
56
  "typecheck": "tsc --noEmit"
56
57
  }
57
58
  }