@defisaver/automation-sdk 1.2.22 → 1.2.23

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.
@@ -239,11 +239,11 @@ function parseLiquityBondProtection(position, parseData) {
239
239
  };
240
240
  return _position;
241
241
  }
242
- function parseExchangeDca(position, parseData) {
242
+ function parseExchangeDca(position, parseData, chainId) {
243
243
  const _position = cloneDeep(position);
244
244
  const { subStruct } = parseData.subscriptionEventData;
245
245
  _position.strategyData.decoded.triggerData = triggerService.exchangeTimestampTrigger.decode(subStruct.triggerData);
246
- _position.strategyData.decoded.subData = subDataService.exchangeDcaSubData.decode(subStruct.subData);
246
+ _position.strategyData.decoded.subData = subDataService.exchangeDcaSubData.decode(subStruct.subData, chainId);
247
247
  return _position;
248
248
  }
249
249
  function parseExchangeLimitOrder(position, parseData, chainId) {
@@ -75,7 +75,7 @@ export declare const liquityPaybackUsingChickenBondSubData: {
75
75
  };
76
76
  export declare const exchangeDcaSubData: {
77
77
  encode: (fromToken: EthereumAddress, toToken: EthereumAddress, amount: string, interval: number) => string[];
78
- decode: (subData: string[]) => {
78
+ decode: (subData: string[], chainId: ChainId) => {
79
79
  fromToken: string;
80
80
  toToken: string;
81
81
  amount: string;
@@ -188,10 +188,10 @@ export const exchangeDcaSubData = {
188
188
  const intervalEncoded = mockedWeb3.eth.abi.encodeParameter('uint256', interval);
189
189
  return [sellTokenEncoded, buyTokenEncoded, amountEncoded, intervalEncoded];
190
190
  },
191
- decode: (subData) => {
191
+ decode: (subData, chainId) => {
192
192
  const fromToken = mockedWeb3.eth.abi.decodeParameter('address', subData[0]).toString();
193
193
  const toToken = mockedWeb3.eth.abi.decodeParameter('address', subData[1]).toString();
194
- const amount = assetAmountInEth(mockedWeb3.eth.abi.decodeParameter('uint256', subData[2]).toString(), getAssetInfoByAddress(fromToken).symbol);
194
+ const amount = assetAmountInEth(mockedWeb3.eth.abi.decodeParameter('uint256', subData[2]).toString(), getAssetInfoByAddress(fromToken, chainId).symbol);
195
195
  const interval = mockedWeb3.eth.abi.decodeParameter('uint256', subData[3]).toString();
196
196
  return {
197
197
  fromToken,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/automation-sdk",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/index.js",