@acala-network/chopsticks-core 1.0.1 → 1.0.2-1

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,11 @@
1
+ import { HexString } from '@polkadot/util/types';
2
+ import { Handler } from '../shared.js';
3
+ /**
4
+ * @param context
5
+ * @param params - [`blockhash`]
6
+ *
7
+ * @return Block extrinsics
8
+ */
9
+ export declare const archive_unstable_body: Handler<[HexString], HexString[]>;
10
+ export declare const archive_unstable_hashByHeight: Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
11
+ export declare const archive_unstable_call: Handler<[`0x${string}`, `0x${string}`, `0x${string}`], `0x${string}`>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ archive_unstable_body: function() {
13
+ return archive_unstable_body;
14
+ },
15
+ archive_unstable_call: function() {
16
+ return archive_unstable_call;
17
+ },
18
+ archive_unstable_hashByHeight: function() {
19
+ return archive_unstable_hashByHeight;
20
+ }
21
+ });
22
+ const _shared = require("../shared.js");
23
+ const _chain = require("./chain.js");
24
+ const _state = require("./state.js");
25
+ const archive_unstable_body = async (context, [hash])=>{
26
+ const block = await context.chain.getBlock(hash);
27
+ if (!block) {
28
+ throw new _shared.ResponseError(1, `Block ${hash} not found`);
29
+ }
30
+ return await block.extrinsics;
31
+ };
32
+ const archive_unstable_hashByHeight = _chain.chain_getBlockHash;
33
+ const archive_unstable_call = _state.state_call;
@@ -41,7 +41,6 @@ export declare const chain_getFinalizedHead: Handler<void, HexString>;
41
41
  export declare const chain_subscribeNewHead: Handler<void, string>;
42
42
  export declare const chain_subscribeFinalizedHeads: Handler<void, string>;
43
43
  export declare const chain_unsubscribeNewHead: Handler<[string], void>;
44
- export declare const archive_unstable_hashByHeight: Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
45
44
  export declare const chain_getHead: Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
46
45
  export declare const chain_subscribeNewHeads: Handler<void, string>;
47
46
  export declare const chain_unsubscribeNewHeads: Handler<[string], void>;
@@ -9,9 +9,6 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- archive_unstable_hashByHeight: function() {
13
- return archive_unstable_hashByHeight;
14
- },
15
12
  chain_getBlock: function() {
16
13
  return chain_getBlock;
17
14
  },
@@ -112,7 +109,6 @@ const chain_subscribeFinalizedHeads = async (context, _params, { subscribe })=>{
112
109
  const chain_unsubscribeNewHead = async (_context, [subid], { unsubscribe })=>{
113
110
  unsubscribe(subid);
114
111
  };
115
- const archive_unstable_hashByHeight = chain_getBlockHash;
116
112
  const chain_getHead = chain_getBlockHash;
117
113
  const chain_subscribeNewHeads = chain_subscribeNewHead;
118
114
  const chain_unsubscribeNewHeads = chain_unsubscribeNewHead;
@@ -1,8 +1,10 @@
1
+ import * as ArchiveRPC from './archive.js';
1
2
  import * as AuthorRPC from './author.js';
2
3
  import * as ChainRPC from './chain.js';
3
4
  import * as PaymentRPC from './payment.js';
4
5
  import * as StateRPC from './state.js';
5
6
  import * as SystemRPC from './system.js';
7
+ export { ArchiveRPC };
6
8
  export { AuthorRPC };
7
9
  export { ChainRPC };
8
10
  export { PaymentRPC };
@@ -55,7 +57,6 @@ declare const handlers: {
55
57
  chain_subscribeNewHead: import("../shared.js").Handler<void, string>;
56
58
  chain_subscribeFinalizedHeads: import("../shared.js").Handler<void, string>;
57
59
  chain_unsubscribeNewHead: import("../shared.js").Handler<[string], void>;
58
- archive_unstable_hashByHeight: import("../shared.js").Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
59
60
  chain_getHead: import("../shared.js").Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
60
61
  chain_subscribeNewHeads: import("../shared.js").Handler<void, string>;
61
62
  chain_unsubscribeNewHeads: import("../shared.js").Handler<[string], void>;
@@ -64,5 +65,8 @@ declare const handlers: {
64
65
  author_submitAndWatchExtrinsic: import("../shared.js").Handler<[import("@polkadot/util/types").HexString], string>;
65
66
  author_unwatchExtrinsic: import("../shared.js").Handler<[string], void>;
66
67
  author_pendingExtrinsics: import("../shared.js").Handler<void, import("@polkadot/util/types").HexString[]>;
68
+ archive_unstable_body: import("../shared.js").Handler<[import("@polkadot/util/types").HexString], import("@polkadot/util/types").HexString[]>;
69
+ archive_unstable_hashByHeight: import("../shared.js").Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
70
+ archive_unstable_call: import("../shared.js").Handler<[`0x${string}`, `0x${string}`, `0x${string}`], `0x${string}`>;
67
71
  };
68
72
  export default handlers;
@@ -9,6 +9,9 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ ArchiveRPC: function() {
13
+ return _archive;
14
+ },
12
15
  AuthorRPC: function() {
13
16
  return _author;
14
17
  },
@@ -28,6 +31,7 @@ _export(exports, {
28
31
  return _default;
29
32
  }
30
33
  });
34
+ const _archive = /*#__PURE__*/ _interop_require_wildcard(require("./archive.js"));
31
35
  const _author = /*#__PURE__*/ _interop_require_wildcard(require("./author.js"));
32
36
  const _chain = /*#__PURE__*/ _interop_require_wildcard(require("./chain.js"));
33
37
  const _payment = /*#__PURE__*/ _interop_require_wildcard(require("./payment.js"));
@@ -75,6 +79,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
75
79
  return newObj;
76
80
  }
77
81
  const handlers = {
82
+ ..._archive,
78
83
  ..._author,
79
84
  ..._chain,
80
85
  ..._payment,
@@ -0,0 +1,11 @@
1
+ import { HexString } from '@polkadot/util/types';
2
+ import { Handler } from '../shared.js';
3
+ /**
4
+ * @param context
5
+ * @param params - [`blockhash`]
6
+ *
7
+ * @return Block extrinsics
8
+ */
9
+ export declare const archive_unstable_body: Handler<[HexString], HexString[]>;
10
+ export declare const archive_unstable_hashByHeight: Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
11
+ export declare const archive_unstable_call: Handler<[`0x${string}`, `0x${string}`, `0x${string}`], `0x${string}`>;
@@ -0,0 +1,17 @@
1
+ import { ResponseError } from '../shared.js';
2
+ import { chain_getBlockHash } from './chain.js';
3
+ import { state_call } from './state.js';
4
+ /**
5
+ * @param context
6
+ * @param params - [`blockhash`]
7
+ *
8
+ * @return Block extrinsics
9
+ */ export const archive_unstable_body = async (context, [hash])=>{
10
+ const block = await context.chain.getBlock(hash);
11
+ if (!block) {
12
+ throw new ResponseError(1, `Block ${hash} not found`);
13
+ }
14
+ return await block.extrinsics;
15
+ };
16
+ export const archive_unstable_hashByHeight = chain_getBlockHash;
17
+ export const archive_unstable_call = state_call;
@@ -41,7 +41,6 @@ export declare const chain_getFinalizedHead: Handler<void, HexString>;
41
41
  export declare const chain_subscribeNewHead: Handler<void, string>;
42
42
  export declare const chain_subscribeFinalizedHeads: Handler<void, string>;
43
43
  export declare const chain_unsubscribeNewHead: Handler<[string], void>;
44
- export declare const archive_unstable_hashByHeight: Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
45
44
  export declare const chain_getHead: Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
46
45
  export declare const chain_subscribeNewHeads: Handler<void, string>;
47
46
  export declare const chain_unsubscribeNewHeads: Handler<[string], void>;
@@ -83,7 +83,6 @@ export const chain_subscribeFinalizedHeads = async (context, _params, { subscrib
83
83
  export const chain_unsubscribeNewHead = async (_context, [subid], { unsubscribe })=>{
84
84
  unsubscribe(subid);
85
85
  };
86
- export const archive_unstable_hashByHeight = chain_getBlockHash;
87
86
  export const chain_getHead = chain_getBlockHash;
88
87
  export const chain_subscribeNewHeads = chain_subscribeNewHead;
89
88
  export const chain_unsubscribeNewHeads = chain_unsubscribeNewHead;
@@ -1,8 +1,10 @@
1
+ import * as ArchiveRPC from './archive.js';
1
2
  import * as AuthorRPC from './author.js';
2
3
  import * as ChainRPC from './chain.js';
3
4
  import * as PaymentRPC from './payment.js';
4
5
  import * as StateRPC from './state.js';
5
6
  import * as SystemRPC from './system.js';
7
+ export { ArchiveRPC };
6
8
  export { AuthorRPC };
7
9
  export { ChainRPC };
8
10
  export { PaymentRPC };
@@ -55,7 +57,6 @@ declare const handlers: {
55
57
  chain_subscribeNewHead: import("../shared.js").Handler<void, string>;
56
58
  chain_subscribeFinalizedHeads: import("../shared.js").Handler<void, string>;
57
59
  chain_unsubscribeNewHead: import("../shared.js").Handler<[string], void>;
58
- archive_unstable_hashByHeight: import("../shared.js").Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
59
60
  chain_getHead: import("../shared.js").Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
60
61
  chain_subscribeNewHeads: import("../shared.js").Handler<void, string>;
61
62
  chain_unsubscribeNewHeads: import("../shared.js").Handler<[string], void>;
@@ -64,5 +65,8 @@ declare const handlers: {
64
65
  author_submitAndWatchExtrinsic: import("../shared.js").Handler<[import("@polkadot/util/types").HexString], string>;
65
66
  author_unwatchExtrinsic: import("../shared.js").Handler<[string], void>;
66
67
  author_pendingExtrinsics: import("../shared.js").Handler<void, import("@polkadot/util/types").HexString[]>;
68
+ archive_unstable_body: import("../shared.js").Handler<[import("@polkadot/util/types").HexString], import("@polkadot/util/types").HexString[]>;
69
+ archive_unstable_hashByHeight: import("../shared.js").Handler<[number | `0x${string}` | `0x${string}`[] | number[] | null], `0x${string}` | (`0x${string}` | null)[] | null>;
70
+ archive_unstable_call: import("../shared.js").Handler<[`0x${string}`, `0x${string}`, `0x${string}`], `0x${string}`>;
67
71
  };
68
72
  export default handlers;
@@ -1,14 +1,17 @@
1
+ import * as ArchiveRPC from './archive.js';
1
2
  import * as AuthorRPC from './author.js';
2
3
  import * as ChainRPC from './chain.js';
3
4
  import * as PaymentRPC from './payment.js';
4
5
  import * as StateRPC from './state.js';
5
6
  import * as SystemRPC from './system.js';
7
+ export { ArchiveRPC };
6
8
  export { AuthorRPC };
7
9
  export { ChainRPC };
8
10
  export { PaymentRPC };
9
11
  export { StateRPC };
10
12
  export { SystemRPC };
11
13
  const handlers = {
14
+ ...ArchiveRPC,
12
15
  ...AuthorRPC,
13
16
  ...ChainRPC,
14
17
  ...PaymentRPC,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks-core",
3
- "version": "1.0.1",
3
+ "version": "1.0.2-1",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "depcheck": "npx depcheck"
12
12
  },
13
13
  "dependencies": {
14
- "@acala-network/chopsticks-executor": "1.0.1",
14
+ "@acala-network/chopsticks-executor": "1.0.2-1",
15
15
  "@polkadot/rpc-provider": "^14.0.1",
16
16
  "@polkadot/types": "^14.0.1",
17
17
  "@polkadot/types-codec": "^14.0.1",