otomato-sdk 1.5.68 → 1.5.70

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.
@@ -0,0 +1,19 @@
1
+ export const SDK_VERSION = '1.5.70';
2
+ export function compareVersions(v1, v2) {
3
+ // Split the version strings into parts
4
+ const v1Parts = v1.split('.').map(Number);
5
+ const v2Parts = v2.split('.').map(Number);
6
+ // Determine the maximum length to compare all parts
7
+ const len = Math.max(v1Parts.length, v2Parts.length);
8
+ // Compare each part
9
+ for (let i = 0; i < len; i++) {
10
+ const v1Part = v1Parts[i] || 0; // Default to 0 if undefined
11
+ const v2Part = v2Parts[i] || 0;
12
+ if (v1Part > v2Part)
13
+ return 1; // v1 is greater
14
+ if (v1Part < v2Part)
15
+ return -1; // v2 is greater
16
+ // If equal, continue to the next part
17
+ }
18
+ return 0; // Versions are equal
19
+ }
package/dist/src/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // Exporting constants
2
2
  export * from './constants/Blocks.js';
3
3
  export * from './constants/chains.js';
4
+ export * from './constants/version.js';
4
5
  export * from './constants/tokens.js';
5
6
  export * from './constants/WorkflowTemplates.js';
6
7
  // Exporting models
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { ethers } from 'ethers';
11
- import { CHAINS } from '../constants/chains';
11
+ import { CHAINS } from '../constants/chains.js';
12
12
  class RPCServices {
13
13
  constructor() {
14
14
  this.rpcUrls = {}; // Store the RPC URLs
@@ -18,11 +18,12 @@ class RPCServices {
18
18
  this.rpcUrls = Object.assign(Object.assign({}, this.rpcUrls), rpcs);
19
19
  }
20
20
  setRPCsFromTMS(env) {
21
+ console.log(CHAINS);
21
22
  if (env.MODE_HTTPS_PROVIDER) {
22
- this.rpcUrls[CHAINS.MODE] = env.MODE_HTTPS_PROVIDER; // Chain ID 43334 is for Mode network
23
+ this.rpcUrls[CHAINS.MODE] = env.MODE_HTTPS_PROVIDER;
23
24
  }
24
25
  if (env.INFURA_HTTPS_PROVIDER) {
25
- this.rpcUrls[CHAINS.ETHEREUM] = env.INFURA_HTTPS_PROVIDER; // Chain ID 1 is for Ethereum mainnet
26
+ this.rpcUrls[CHAINS.ETHEREUM] = env.INFURA_HTTPS_PROVIDER;
26
27
  }
27
28
  }
28
29
  // Function to get the RPC URL for a specific chainId
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const SDK_VERSION = "1.5.70";
2
+ export declare function compareVersions(v1: string, v2: string): number;
@@ -1,5 +1,6 @@
1
1
  export * from './constants/Blocks.js';
2
2
  export * from './constants/chains.js';
3
+ export * from './constants/version.js';
3
4
  export * from './constants/tokens.js';
4
5
  export * from './constants/WorkflowTemplates.js';
5
6
  export * from './models/Action.js';
@@ -1,4 +1,4 @@
1
- import { Token } from '../constants/tokens';
1
+ import { Token } from '../constants/tokens.js';
2
2
  declare class RPCServices {
3
3
  private rpcUrls;
4
4
  setRPCs(rpcs: {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "otomato-sdk",
3
- "version": "1.5.68",
3
+ "version": "1.5.70",
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",
7
7
  "type": "module",
8
8
  "prepublishOnly": "npm run build; npm run test",
9
9
  "scripts": {
10
+ "prebuild": "node update-sdk-version.js",
10
11
  "build": "npx tsc",
11
12
  "test": "mocha --config .mocharc.json"
12
13
  },