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.
- package/dist/src/constants/version.js +1 -1
- package/dist/src/models/Node.js +1 -0
- package/dist/src/utils/addressBalance.js +2 -6
- package/dist/src/utils/typeValidator.js +9 -2
- package/dist/types/src/constants/version.d.ts +1 -1
- package/dist/types/src/utils/typeValidator.d.ts +6 -0
- package/package.json +1 -1
package/dist/src/models/Node.js
CHANGED
|
@@ -49,7 +49,7 @@ const chainTokenProtocolMap = {
|
|
|
49
49
|
},
|
|
50
50
|
34443: {
|
|
51
51
|
// USDC on Mode
|
|
52
|
-
'
|
|
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
|
|
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
|
-
|
|
111
|
-
|
|
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.
|
|
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;
|