@curvefi/llamalend-api 1.0.3 → 1.0.6

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.
@@ -9,7 +9,7 @@ jobs:
9
9
  - uses: actions/checkout@v2
10
10
  - uses: actions/setup-node@v2
11
11
  with:
12
- node-version: '20'
13
- - run: npm install
12
+ node-version: '22'
13
+ - run: npm ci
14
14
  - run: npm run build
15
15
  - run: npm run lint
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - name: Checkout code
14
- uses: actions/checkout@v2
14
+ uses: actions/checkout@v4
15
15
  - name: get-npm-version
16
16
  id: package-version
17
17
  uses: martinbeentjes/npm-get-version-action@main
@@ -38,18 +38,22 @@ jobs:
38
38
 
39
39
  publish:
40
40
  runs-on: ubuntu-latest
41
+ permissions:
42
+ contents: read
43
+ id-token: write
41
44
  steps:
42
- - uses: actions/checkout@v2
43
- - name: Setup .npmrc file to publish to npm
44
- uses: actions/setup-node@v1
45
+ - uses: actions/checkout@v4
46
+ - name: Setup node version
47
+ uses: actions/setup-node@v4
45
48
  with:
46
- node-version: '12.x'
49
+ node-version: '22'
50
+ cache: npm
47
51
  registry-url: 'https://registry.npmjs.org'
48
52
  - name: Install modules
49
- run: npm install
53
+ run: npm ci
50
54
  - name: Build
51
55
  run: npm run build
52
56
  - name: Publish to npm
53
57
  run: npm publish --access public
54
58
  env:
55
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
59
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,87 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import globals from "globals";
3
+ import parser from "vue-eslint-parser";
4
+ import typescriptEslint from "@typescript-eslint/eslint-plugin";
5
+ import tsParser from "@typescript-eslint/parser";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+ import js from "@eslint/js";
9
+ import { FlatCompat } from "@eslint/eslintrc";
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+ const compat = new FlatCompat({
14
+ baseDirectory: __dirname,
15
+ recommendedConfig: js.configs.recommended,
16
+ allConfig: js.configs.all
17
+ });
18
+
19
+ export default defineConfig([{
20
+ extends: compat.extends("eslint:recommended"),
21
+
22
+ languageOptions: {
23
+ globals: {
24
+ ...globals.browser,
25
+ },
26
+
27
+ parser: parser,
28
+ ecmaVersion: 5,
29
+ sourceType: "module",
30
+
31
+ parserOptions: {
32
+ parser: "babel-eslint",
33
+ allowImportExportEverywhere: false,
34
+ },
35
+ },
36
+
37
+ rules: {
38
+ "func-names": 0,
39
+ "no-nested-ternary": 0,
40
+ "max-len": 0,
41
+ "arrow-parens": ["error", "always"],
42
+ "no-underscore-dangle": 0,
43
+
44
+ "comma-dangle": ["error", {
45
+ arrays: "always-multiline",
46
+ objects: "always-multiline",
47
+ imports: "always-multiline",
48
+ exports: "always-multiline",
49
+ functions: "never",
50
+ }],
51
+
52
+ "no-use-before-define": ["error", "nofunc"],
53
+
54
+ "no-empty": ["error", {
55
+ allowEmptyCatch: true,
56
+ }],
57
+
58
+ "no-mixed-operators": ["error", {
59
+ allowSamePrecedence: true,
60
+ }],
61
+
62
+ indent: ["error", 4, {
63
+ flatTernaryExpressions: true,
64
+ SwitchCase: 1,
65
+ }],
66
+ },
67
+ }, {
68
+ files: ["**/*.ts"],
69
+
70
+ extends: compat.extends(
71
+ "plugin:@typescript-eslint/eslint-recommended",
72
+ "plugin:@typescript-eslint/recommended",
73
+ ),
74
+
75
+ plugins: {
76
+ "@typescript-eslint": typescriptEslint,
77
+ },
78
+
79
+ languageOptions: {
80
+ parser: tsParser,
81
+ },
82
+
83
+ rules: {
84
+ "@typescript-eslint/no-explicit-any": "warn",
85
+ "@typescript-eslint/ban-ts-comment": "off",
86
+ },
87
+ }]);
@@ -1,31 +1,30 @@
1
- var Cache = /** @class */ (function () {
2
- function Cache() {
1
+ class Cache {
2
+ constructor() {
3
3
  this.cache = new Map();
4
4
  }
5
- Cache.getInstance = function () {
5
+ static getInstance() {
6
6
  if (!Cache.instance) {
7
7
  Cache.instance = new Cache();
8
8
  }
9
9
  return Cache.instance;
10
- };
11
- Cache.prototype.set = function (key, value) {
10
+ }
11
+ set(key, value) {
12
12
  this.cache.set(key, value);
13
- };
14
- Cache.prototype.get = function (key) {
13
+ }
14
+ get(key) {
15
15
  return this.cache.get(key);
16
- };
17
- Cache.prototype.has = function (key) {
16
+ }
17
+ has(key) {
18
18
  return this.cache.has(key);
19
- };
20
- Cache.prototype.printCache = function () {
19
+ }
20
+ printCache() {
21
21
  console.log(this.cache);
22
- };
23
- Cache.prototype.clear = function () {
22
+ }
23
+ clear() {
24
24
  this.cache.clear();
25
- };
26
- return Cache;
27
- }());
28
- export var cacheKey = function (contractAddress, methodName, param) {
29
- return "".concat(contractAddress, "-").concat(methodName, "-").concat(param ? param : '|');
25
+ }
26
+ }
27
+ export const cacheKey = (contractAddress, methodName, param) => {
28
+ return `${contractAddress}-${methodName}-${param ? param : '|'}`;
30
29
  };
31
- export var cacheStats = Cache.getInstance();
30
+ export const cacheStats = Cache.getInstance();
@@ -1 +1 @@
1
- export var L2Networks = [10, 8453]; // 42161 (arbitrum) is L2 network, but does not need a change to estimateGas.
1
+ export const L2Networks = [10, 8453]; // 42161 (arbitrum) is L2 network, but does not need a change to estimateGas.