@ocap/proto 1.6.3 → 1.6.10

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/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generate by [js2dts@0.3.3](https://github.com/whxaxes/js2dts#readme)
2
2
 
3
- declare const _Lib: any;
3
+ declare const _Lib: object;
4
4
  export = _Lib;
5
5
 
6
6
  declare namespace Enums {
@@ -48,7 +48,6 @@ declare namespace Enums {
48
48
  INVALID_DEPOSITOR = 46,
49
49
  INVALID_WITHDRAWER = 47,
50
50
  INVALID_EXPIRY_DATE = 49,
51
- INVALID_DEPOSIT = 50,
52
51
  INVALID_CUSTODIAN = 51,
53
52
  INSUFFICIENT_GAS = 52,
54
53
  INVALID_SWAP = 53,
@@ -72,6 +71,12 @@ declare namespace Enums {
72
71
  INVALID_CANDIDATE_STATE = 71,
73
72
  VALIDATOR_NOT_FOUND = 72,
74
73
  VALIDATOR_NOT_CHANGED = 73,
74
+ INVALID_FACTORY_STATE = 74,
75
+ INVALID_FACTORY_PROPS = 75,
76
+ INVALID_FACTORY_INPUT = 76,
77
+ INVALID_TOKEN = 77,
78
+ INVALID_ROLLUP = 78,
79
+ INVALID_BLOCK = 79,
75
80
  FORBIDDEN = 403,
76
81
  INTERNAL = 500,
77
82
  TIMEOUT = 504,
@@ -116,6 +121,9 @@ declare namespace Enums {
116
121
  ROLE_VC = 14,
117
122
  ROLE_BLOCKLET = 15,
118
123
  ROLE_REGISTRY = 16,
124
+ ROLE_TOKEN = 17,
125
+ ROLE_FACTORY = 18,
126
+ ROLE_ROLLUP = 19,
119
127
  ROLE_ANY = 63,
120
128
  }
121
129
 
@@ -182,30 +190,37 @@ declare namespace Enums {
182
190
 
183
191
  export enum SupportedTxs {
184
192
  0 = AccountMigrateTx,
185
- 1 = AcquireAssetTx,
186
- 2 = ActivateProtocolTx,
187
- 3 = ApproveWithdrawTx,
188
- 4 = ConsumeAssetTx,
193
+ 1 = AcquireAssetV2Tx,
194
+ 2 = AcquireAssetV3Tx,
195
+ 3 = ClaimBlockRewardTx,
196
+ 4 = ClaimStakeTx,
189
197
  5 = CreateAssetTx,
190
- 6 = DeactivateProtocolTx,
191
- 7 = DeclareTx,
192
- 8 = DelegateTx,
193
- 9 = DeployProtocolTx,
194
- 10 = DepositTokenTx,
195
- 11 = ExchangeTx,
196
- 12 = PokeTx,
197
- 13 = RefuelTx,
198
- 14 = RetrieveSwapTx,
199
- 15 = RevokeDelegateTx,
200
- 16 = RevokeSwapTx,
201
- 17 = RevokeWithdrawTx,
202
- 18 = SetupSwapTx,
203
- 19 = TransferTx,
204
- 20 = UpdateAssetTx,
205
- 21 = UpdateConsensusParamsTx,
206
- 22 = UpdateValidatorTx,
207
- 23 = UpgradeNodeTx,
208
- 24 = WithdrawTokenTx,
198
+ 6 = CreateFactoryTx,
199
+ 7 = CreateRollupBlockTx,
200
+ 8 = CreateRollupTx,
201
+ 9 = CreateTokenTx,
202
+ 10 = DeclareTx,
203
+ 11 = DelegateTx,
204
+ 12 = DepositTokenV2Tx,
205
+ 13 = ExchangeTx,
206
+ 14 = ExchangeV2Tx,
207
+ 15 = JoinRollupTx,
208
+ 16 = LeaveRollupTx,
209
+ 17 = MigrateRollupContractTx,
210
+ 18 = MigrateRollupTokenTx,
211
+ 19 = MintAssetTx,
212
+ 20 = PauseRollupTx,
213
+ 21 = ResumeRollupTx,
214
+ 22 = RevokeDelegateTx,
215
+ 23 = RevokeStakeTx,
216
+ 24 = StakeTx,
217
+ 25 = TransferTx,
218
+ 26 = TransferV2Tx,
219
+ 27 = TransferV3Tx,
220
+ 28 = UpdateAssetTx,
221
+ 29 = UpdateRollupTx,
222
+ 30 = UpgradeNodeTx,
223
+ 31 = WithdrawTokenV2Tx,
209
224
  }
210
225
 
211
226
  export enum SupportedStakes {}
@@ -272,7 +287,6 @@ declare namespace Messages {
272
287
  46 = INVALID_DEPOSITOR,
273
288
  47 = INVALID_WITHDRAWER,
274
289
  49 = INVALID_EXPIRY_DATE,
275
- 50 = INVALID_DEPOSIT,
276
290
  51 = INVALID_CUSTODIAN,
277
291
  52 = INSUFFICIENT_GAS,
278
292
  53 = INVALID_SWAP,
@@ -296,6 +310,12 @@ declare namespace Messages {
296
310
  71 = INVALID_CANDIDATE_STATE,
297
311
  72 = VALIDATOR_NOT_FOUND,
298
312
  73 = VALIDATOR_NOT_CHANGED,
313
+ 74 = INVALID_FACTORY_STATE,
314
+ 75 = INVALID_FACTORY_PROPS,
315
+ 76 = INVALID_FACTORY_INPUT,
316
+ 77 = INVALID_TOKEN,
317
+ 78 = INVALID_ROLLUP,
318
+ 79 = INVALID_BLOCK,
299
319
  403 = FORBIDDEN,
300
320
  500 = INTERNAL,
301
321
  504 = TIMEOUT,
@@ -340,6 +360,9 @@ declare namespace Messages {
340
360
  14 = ROLE_VC,
341
361
  15 = ROLE_BLOCKLET,
342
362
  16 = ROLE_REGISTRY,
363
+ 17 = ROLE_TOKEN,
364
+ 18 = ROLE_FACTORY,
365
+ 19 = ROLE_ROLLUP,
343
366
  63 = ROLE_ANY,
344
367
  }
345
368
 
package/lib/proto.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare const forgeTypes: any;
2
+ export const vendorTypes: {};
3
+ export { forgeTypes as types };
package/lib/proto.js CHANGED
@@ -1,15 +1,15 @@
1
+ /* eslint-disable import/extensions */
1
2
  /* eslint-disable prefer-object-spread */
2
3
  // Auto generated code, DO NOT EDIT
3
4
 
4
5
  const enumPb = require('./gen/enum_pb.js');
5
- const rpcPb = require('./gen/rpc_pb.js');
6
6
  const statePb = require('./gen/state_pb.js');
7
7
  const traceTypePb = require('./gen/trace-type_pb.js');
8
8
  const txPb = require('./gen/tx_pb.js');
9
9
  const typePb = require('./gen/type_pb.js');
10
10
  const vendorPb = require('./gen/vendor_pb.js');
11
11
 
12
- const forgeTypes = Object.assign({}, enumPb, rpcPb, statePb, traceTypePb, txPb, typePb);
12
+ const forgeTypes = Object.assign({}, enumPb, statePb, traceTypePb, txPb, typePb);
13
13
  const vendorTypes = Object.assign({}, vendorPb);
14
14
 
15
15
  module.exports = {
@@ -0,0 +1,2 @@
1
+ declare function _exports(proto: object, json: object, urls?: object): object;
2
+ export = _exports;
package/lib/provider.js CHANGED
@@ -94,7 +94,7 @@ module.exports = function createProvider(proto, json, urls = {}) {
94
94
  if (stakeTypePattern.test(type)) {
95
95
  typeUrl = `fg:x:${lowerUnder(`Stake${type.replace(stakeTypePattern, '')}`)}`;
96
96
  }
97
- if (['TransactionInfo', 'TxStatus'].includes(type)) {
97
+ if (['TransactionInfo'].includes(type)) {
98
98
  typeUrl = `fg:x:${lowerUnder(type)}`;
99
99
  }
100
100
  if (type === 'AssetFactoryState') {
@@ -188,10 +188,25 @@ module.exports = function createProvider(proto, json, urls = {}) {
188
188
  */
189
189
  messages,
190
190
 
191
- transactions: enums.SupportedTxs.filter(
192
- (x) => ['DeployProtocolTx', 'ActivateProtocolTx', 'DeactivateProtocolTx'].includes(x) === false
193
- ),
194
- multiSignTxs: ['ExchangeTx', 'ConsumeAssetTx', 'DeclareTx', 'DeclareNodeTx'].filter(x => enums.SupportedTxs.includes(x)), // prettier-ignore
191
+ transactions: enums.SupportedTxs,
192
+ multiSignTxs: ['ExchangeV2Tx'].filter((x) => enums.SupportedTxs.includes(x)),
193
+ multiSignV2Txs: [
194
+ 'TransferV3Tx',
195
+ 'AcquireAssetV3Tx',
196
+ 'StakeTx',
197
+ 'UpdateRollupTx',
198
+ 'JoinRollupTx',
199
+ 'LeaveRollupTx',
200
+ 'PauseRollupTx',
201
+ 'ResumeRollupTx',
202
+ 'DepositTokenV2Tx',
203
+ 'WithdrawTokenV2Tx',
204
+ 'CreateRollupBlockTx',
205
+ 'ClaimBlockRewardTx',
206
+ 'MigrateRollupContractTx',
207
+ 'MigrateRollupTokenTx',
208
+ 'CreateAssetTx',
209
+ ].filter((x) => enums.SupportedTxs.includes(x)),
195
210
 
196
211
  stakes: enums.SupportedStakes,
197
212
  compactSpec,
package/package.json CHANGED
@@ -1,25 +1,24 @@
1
1
  {
2
2
  "name": "@ocap/proto",
3
3
  "description": "Static modules generated from forge-sdk protobuf files",
4
- "version": "1.6.3",
4
+ "version": "1.6.10",
5
5
  "author": {
6
6
  "name": "wangshijun",
7
7
  "email": "shijun@arcblock.io",
8
8
  "url": "https://github.com/wangshijun"
9
9
  },
10
10
  "bugs": {
11
- "url": "https://github.com/ArcBlock/ocap-js/issues",
11
+ "url": "https://github.com/ArcBlock/asset-chain/issues",
12
12
  "email": "shijun@arcblock.io"
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
17
  "devDependencies": {
18
- "any-json": "^3.1.0",
19
- "jest": "^26.6.3",
20
- "prettier": "^2.2.1"
18
+ "jest": "^27.3.1",
19
+ "prettier": "^2.3.2"
21
20
  },
22
- "homepage": "https://github.com/ArcBlock/ocap-js/tree/master/core/proto",
21
+ "homepage": "https://github.com/ArcBlock/asset-chain/tree/master/core/proto",
23
22
  "keywords": [
24
23
  "blockchain",
25
24
  "arcblock",
@@ -33,7 +32,7 @@
33
32
  ],
34
33
  "repository": {
35
34
  "type": "git",
36
- "url": "https://github.com/ArcBlock/ocap-js/tree/master/core/proto"
35
+ "url": "https://github.com/ArcBlock/asset-chain/tree/master/core/proto"
37
36
  },
38
37
  "scripts": {
39
38
  "lint": "eslint tests lib/*.js",
@@ -41,13 +40,12 @@
41
40
  "build": "make build",
42
41
  "gen-proto": "node tools/gen-proto.js",
43
42
  "gen-dts": "j2d lib/index.js && node tools/gen-dts.js && bash tools/patch-dts.sh && prettier --write lib/*.d.ts",
44
- "gen-status": "bash ./tools/gen-status.sh",
45
- "test": "node tools/jest.js",
46
- "coverage": "npm run test -- --coverage --collectCoverageFrom=lib/*.js --collectCoverageFrom=!lib/gen/*.js"
43
+ "test": "jest --forceExit --detectOpenHandles",
44
+ "coverage": "npm run test -- --coverage"
47
45
  },
48
46
  "dependencies": {
49
- "debug": "^4.3.1",
47
+ "debug": "^4.3.3",
50
48
  "lodash": "^4.17.21"
51
49
  },
52
- "gitHead": "5246168dbbc268a3e6f95c3992d9d343647ca25b"
50
+ "gitHead": "ab272e8db3a15c6571cc7fae7cc3d3e0fdd4bdb1"
53
51
  }