openchain-nodejs-ts-yxl 1.1.1 → 1.1.2

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/index.d.ts CHANGED
@@ -1346,7 +1346,6 @@ export interface BlockFeesResult {
1346
1346
  fees: {
1347
1347
  base_reserve: string;
1348
1348
  gas_price: string;
1349
- [key: string]: any;
1350
1349
  };
1351
1350
  }
1352
1351
 
package/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+
2
3
  const createBufferPolyfill = require('./lib/common/buffer-polyfill');
3
4
  createBufferPolyfill();
4
5
 
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ // 预先导入所有操作类型模块
4
+ const accountSetMetadata = require('./accountSetMetadata');
5
+ const accountSetPrivilege = require('./accountSetPrivilege');
6
+ const activateAccount = require('./activateAccount');
7
+ const contractCreate = require('./contractCreate');
8
+ const contractInvokeByAsset = require('./contractInvokeByAsset');
9
+ const contractInvokeByCcer = require('./contractInvokeByCcer');
10
+ const createLog = require('./createLog');
11
+ const ctp10TokenApprove = require('./ctp10TokenApprove');
12
+ const ctp10TokenAssign = require('./ctp10TokenAssign');
13
+ const ctp10TokenChangeOwner = require('./ctp10TokenChangeOwner');
14
+ const ctp10TokenIssue = require('./ctp10TokenIssue');
15
+ const ctp10TokenTransfer = require('./ctp10TokenTransfer');
16
+ const ctp10TokenTransferFrom = require('./ctp10TokenTransferFrom');
17
+ const issueAsset = require('./issueAsset');
18
+ const payAsset = require('./payAsset');
19
+ const payCoin = require('./payCoin');
20
+
21
+ // 创建操作类型到模块的映射表
22
+ const operationModules = {
23
+ accountSetMetadata,
24
+ accountSetPrivilege,
25
+ activateAccount,
26
+ contractCreate,
27
+ contractInvokeByAsset,
28
+ contractInvokeByCcer,
29
+ createLog,
30
+ ctp10TokenApprove,
31
+ ctp10TokenAssign,
32
+ ctp10TokenChangeOwner,
33
+ ctp10TokenIssue,
34
+ ctp10TokenTransfer,
35
+ ctp10TokenTransferFrom,
36
+ issueAsset,
37
+ payAsset,
38
+ payCoin
39
+ };
40
+
41
+ /**
42
+ * 获取操作模块
43
+ * @param {string} type - 操作类型名称
44
+ * @returns {Function} - 操作模块函数
45
+ */
46
+ module.exports = function getOperationModule(type) {
47
+ const module = operationModules[type];
48
+ if (!module) {
49
+ throw new Error(`Operation type '${type}' not found. Available types: ${Object.keys(operationModules).join(', ')}`);
50
+ }
51
+ return module;
52
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openchain-nodejs-ts-yxl",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "openchain sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -13,9 +13,12 @@
13
13
  ],
14
14
  "author": "OpenChain",
15
15
  "license": "ISC",
16
+ "engines": {
17
+ "node": ">=18.0.0"
18
+ },
16
19
  "dependencies": {
17
- "axios": "^1.6.2",
18
- "bignumber.js": "^7.2.1",
20
+ "axios": "^1.8.2",
21
+ "bignumber.js": "^9.1.2",
19
22
  "buffer-to-uint8array": "^1.1.0",
20
23
  "co-wrap-all": "^1.0.0",
21
24
  "humps": "^2.0.1",
@@ -23,16 +26,19 @@
23
26
  "json-bigint": "^0.2.3",
24
27
  "long": "^4.0.0",
25
28
  "merge-descriptors": "^1.0.1",
26
- "protobufjs": "^6.8.8",
29
+ "protobufjs": "^7.2.4",
27
30
  "yxchain-encryption-nodejs": "^1.0.2"
28
31
  },
29
32
  "devDependencies": {
30
- "chai": "^4.1.2",
31
- "mocha": "^5.2.0"
33
+ "chai": "^4.3.0",
34
+ "mocha": "^10.0.0"
32
35
  },
33
36
  "repository": {
34
37
  "type": "git",
35
38
  "url": "",
36
39
  "web": ""
40
+ },
41
+ "directories": {
42
+ "lib": "lib"
37
43
  }
38
44
  }