otomato-sdk 2.0.11 → 2.0.13

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,4 +1,4 @@
1
- export const SDK_VERSION = '2.0.11';
1
+ export const SDK_VERSION = '2.0.13';
2
2
  export function compareVersions(v1, v2) {
3
3
  // Split the version strings into parts
4
4
  const v1Parts = v1.split('.').map(Number);
@@ -71,6 +71,7 @@ export class Node {
71
71
  return this.state;
72
72
  }
73
73
  setParameter(key, value) {
74
+ console.log(`${key} - ${value}`);
74
75
  if (key in this.parameters) {
75
76
  const param = this.parameters[key];
76
77
  try {
@@ -49,7 +49,7 @@ const chainTokenProtocolMap = {
49
49
  },
50
50
  34443: {
51
51
  // USDC on Mode
52
- '0xd988097fb8612cc24eeC14542bC03424c656005f': [
52
+ '0xd988097fb8612cc24eec14542bc03424c656005f': [
53
53
  { protocol: PROTOCOLS.IONIC, token: '0x2BE717340023C9e14C1Bb12cb3ecBcfd3c3fB038' },
54
54
  { protocol: PROTOCOLS.WALLET, token: '0xd988097fb8612cc24eeC14542bC03424c656005f' },
55
55
  ],
@@ -88,11 +88,7 @@ function getBalanceInUnderlying(protocol, chainId, smartAccountAddress, contract
88
88
  const exRateBN = BigInt(rawExRate.toString());
89
89
  // For IONIC => scale = 18 - decimals + 6
90
90
  // For MOONWELL => you used scale=18. Let's handle them with logic or keep it simple
91
- let scale = 18 - decimals + 6;
92
- // If MOONWELL, you said "scale=18" in your snippet
93
- if (protocol === PROTOCOLS.MOONWELL) {
94
- scale = 18;
95
- }
91
+ let scale = 18;
96
92
  // Fix: BigInt(10) instead of 10n
97
93
  const TEN = BigInt(10);
98
94
  const divisor = TEN ** BigInt(scale);
@@ -107,8 +107,15 @@ function isValidValue(value) {
107
107
  }
108
108
  return false;
109
109
  }
110
- function isVariable(value) {
111
- return /\{\{(?:nodeMap\.[^.}]+\.(?:output|parameters(?:\.abi\.parameters)?)|external\.functions\.[^(}]+)\([^)]*\)\}\}/.test(value);
110
+ /**
111
+ * Checks if the string contains a pattern like {{ ANY_CONTENT }}.
112
+ * This version is very broad: any characters (including newlines)
113
+ * between the double braces will match.
114
+ */
115
+ export function isVariable(value) {
116
+ // The [\s\S] trick lets us match across multiple lines as well.
117
+ // The ? makes it non-greedy, so we only match up to the first "}}" we see.
118
+ return /\{\{[\s\S]*?\}\}/.test(value);
112
119
  }
113
120
  export function typeIsNumber(type) {
114
121
  switch (type) {
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "2.0.11";
1
+ export declare const SDK_VERSION = "2.0.13";
2
2
  export declare function compareVersions(v1: string, v2: string): number;
@@ -1,4 +1,10 @@
1
1
  export declare function validateType(expectedType: string, value: any): boolean;
2
+ /**
3
+ * Checks if the string contains a pattern like {{ ANY_CONTENT }}.
4
+ * This version is very broad: any characters (including newlines)
5
+ * between the double braces will match.
6
+ */
7
+ export declare function isVariable(value: string): boolean;
2
8
  export declare function typeIsNumber(type: string): boolean;
3
9
  export declare function isAddress(value: string): boolean;
4
10
  export declare function isValidUrl(value: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "An SDK for building and managing automations on Otomato",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/types/src/index.d.ts",