@1delta/bridge-configs 0.1.0 → 0.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/configs/cowswap/swap/route.ts"],"names":[],"mappings":"AAiDA,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM;;;eAwDjB"}
1
+ {"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/configs/cowswap/swap/route.ts"],"names":[],"mappings":"AA+CA,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM;;;eAwDjB"}
@@ -10,17 +10,16 @@ async function setupSdk(chainId) {
10
10
  const walletClient = getWalletClient();
11
11
  if (!walletClient)
12
12
  throw new Error('Wallet client not initialized');
13
- const provider = getViemProvider({ chainId });
13
+ const provider = await getViemProvider({ chainId });
14
14
  const adapter = new ViemAdapter({
15
15
  provider,
16
16
  walletClient,
17
17
  });
18
- setGlobalAdapter(adapter);
19
18
  const options = undefined;
20
19
  const tradingSdk = new TradingSdk({
21
20
  chainId: cowChainId,
22
21
  appCode: '1delta',
23
- }, options, undefined);
22
+ }, options, adapter);
24
23
  return tradingSdk;
25
24
  }
26
25
  export async function getCowSwapQuote(fromChainId, fromTokenAddress, fromTokenDecimals, toTokenAddress, toTokenDecimals, amountIn, fromAddress, toAddress, slippage) {
@@ -46,7 +45,7 @@ export async function getCowSwapQuote(fromChainId, fromTokenAddress, fromTokenDe
46
45
  const originalPostSwapOrderFromQuote = quote.postSwapOrderFromQuote.bind(quote);
47
46
  quote.postSwapOrderFromQuote = async (advancedSettings, signingStepManager) => {
48
47
  const walletClient = getWalletClient();
49
- const provider = getViemProvider({ chainId: fromChainId });
48
+ const provider = await getViemProvider({ chainId: fromChainId });
50
49
  const adapter = new ViemAdapter({
51
50
  provider,
52
51
  walletClient,
@@ -21,7 +21,7 @@ export const zenlinkConfig = {
21
21
  const { fromChainId, toChainId, toAddress } = params;
22
22
  if (fromChainId !== toChainId)
23
23
  throw new CrossChainBusinessException(ERROR_CODES.NOT_SUPPORT);
24
- const publicClient = getViemProvider({ chainId: fromChainId });
24
+ const publicClient = await getViemProvider({ chainId: fromChainId });
25
25
  const gasPrice = Number(await publicClient.getGasPrice());
26
26
  const receiver = toAddress === '' ? zeroAddress : toAddress;
27
27
  return { ...params, gasPrice, receiver, estimatedDuration: 0 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1delta/bridge-configs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Bridge and aggregator configurations for 1Delta",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "viem": "^2.33.0",
18
18
  "lodash": "^4.17.21",
19
19
  "axios": "^1.10.0",
20
- "@1delta/lib-utils": "0.1.0",
21
- "@1delta/bridge-core": "0.1.0"
20
+ "@1delta/bridge-core": "0.1.1",
21
+ "@1delta/lib-utils": "0.1.1"
22
22
  },
23
23
  "scripts": {
24
24
  "build": "tsc --project tsconfig.json",