@defisaver/automation-sdk 1.2.21 → 1.2.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/automation-sdk",
3
- "version": "1.2.21",
3
+ "version": "1.2.22",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/index.js",
@@ -330,13 +330,13 @@ function parseLiquityBondProtection(position: Position.Automated, parseData: Par
330
330
  return _position;
331
331
  }
332
332
 
333
- function parseExchangeDca(position: Position.Automated, parseData: ParseData): Position.Automated {
333
+ function parseExchangeDca(position: Position.Automated, parseData: ParseData, chainId: ChainId): Position.Automated {
334
334
  const _position = cloneDeep(position);
335
335
 
336
336
  const { subStruct } = parseData.subscriptionEventData;
337
337
 
338
338
  _position.strategyData.decoded.triggerData = triggerService.exchangeTimestampTrigger.decode(subStruct.triggerData);
339
- _position.strategyData.decoded.subData = subDataService.exchangeDcaSubData.decode(subStruct.subData);
339
+ _position.strategyData.decoded.subData = subDataService.exchangeDcaSubData.decode(subStruct.subData, chainId);
340
340
 
341
341
  return _position;
342
342
  }
@@ -262,10 +262,10 @@ export const exchangeDcaSubData = {
262
262
 
263
263
  return [sellTokenEncoded, buyTokenEncoded, amountEncoded, intervalEncoded];
264
264
  },
265
- decode: (subData: SubData) => {
265
+ decode: (subData: SubData, chainId: ChainId) => {
266
266
  const fromToken = mockedWeb3.eth.abi.decodeParameter('address', subData[0]).toString();
267
267
  const toToken = mockedWeb3.eth.abi.decodeParameter('address', subData[1]).toString();
268
- const amount = assetAmountInEth(mockedWeb3.eth.abi.decodeParameter('uint256', subData[2]).toString(), getAssetInfoByAddress(fromToken).symbol);
268
+ const amount = assetAmountInEth(mockedWeb3.eth.abi.decodeParameter('uint256', subData[2]).toString(), getAssetInfoByAddress(fromToken, chainId).symbol);
269
269
  const interval = mockedWeb3.eth.abi.decodeParameter('uint256', subData[3]).toString();
270
270
  return {
271
271
  fromToken,