@acala-network/chopsticks-core 1.5.2 → 1.6.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.
Files changed (52) hide show
  1. package/dist/cjs/api.js +6 -15
  2. package/dist/cjs/blockchain/block-builder.js +3 -1
  3. package/dist/cjs/blockchain/block.js +5 -12
  4. package/dist/cjs/blockchain/head-state.js +4 -9
  5. package/dist/cjs/blockchain/index.js +6 -15
  6. package/dist/cjs/blockchain/storage-layer.js +5 -12
  7. package/dist/cjs/blockchain/txpool.js +17 -17
  8. package/dist/cjs/chopsticks-provider.js +5 -12
  9. package/dist/cjs/env.d.ts +25 -47
  10. package/dist/cjs/env.js +8 -19
  11. package/dist/cjs/genesis-provider.js +5 -12
  12. package/dist/cjs/logger.d.ts +3 -2
  13. package/dist/cjs/offchain.js +1 -3
  14. package/dist/cjs/rpc/dev/new-block.d.ts +9 -53
  15. package/dist/cjs/rpc/dev/set-head.d.ts +1 -1
  16. package/dist/cjs/rpc/index.d.ts +1 -1
  17. package/dist/cjs/rpc/rpc-spec/chainHead_v1.js +33 -7
  18. package/dist/cjs/rpc/rpc-spec/index.d.ts +1 -1
  19. package/dist/cjs/rpc/rpc-spec/index.js +8 -19
  20. package/dist/cjs/rpc/shared.d.ts +2 -2
  21. package/dist/cjs/rpc/shared.js +1 -3
  22. package/dist/cjs/rpc/substrate/index.d.ts +1 -6
  23. package/dist/cjs/rpc/substrate/index.js +8 -19
  24. package/dist/cjs/rpc/substrate/payment.js +7 -4
  25. package/dist/cjs/schema/index.d.ts +6 -52
  26. package/dist/cjs/schema/index.js +1 -1
  27. package/dist/cjs/utils/index.d.ts +5 -0
  28. package/dist/cjs/utils/index.js +9 -0
  29. package/dist/cjs/utils/key-cache.js +1 -3
  30. package/dist/cjs/wasm-executor/browser-wasm-executor.js +8 -19
  31. package/dist/cjs/wasm-executor/index.js +8 -19
  32. package/dist/cjs/wasm-executor/node-wasm-executor.js +8 -19
  33. package/dist/esm/blockchain/block-builder.js +4 -2
  34. package/dist/esm/blockchain/txpool.js +12 -3
  35. package/dist/esm/env.d.ts +25 -47
  36. package/dist/esm/logger.d.ts +3 -2
  37. package/dist/esm/rpc/dev/new-block.d.ts +9 -53
  38. package/dist/esm/rpc/dev/set-head.d.ts +1 -1
  39. package/dist/esm/rpc/index.d.ts +1 -1
  40. package/dist/esm/rpc/index.js +1 -1
  41. package/dist/esm/rpc/rpc-spec/chainHead_v1.js +33 -7
  42. package/dist/esm/rpc/rpc-spec/index.d.ts +1 -1
  43. package/dist/esm/rpc/rpc-spec/index.js +1 -1
  44. package/dist/esm/rpc/shared.d.ts +2 -2
  45. package/dist/esm/rpc/substrate/index.d.ts +1 -6
  46. package/dist/esm/rpc/substrate/index.js +1 -6
  47. package/dist/esm/rpc/substrate/payment.js +8 -5
  48. package/dist/esm/schema/index.d.ts +6 -52
  49. package/dist/esm/schema/index.js +1 -1
  50. package/dist/esm/utils/index.d.ts +5 -0
  51. package/dist/esm/utils/index.js +10 -1
  52. package/package.json +65 -61
@@ -5,62 +5,18 @@ declare const schema: z.ZodObject<{
5
5
  to: z.ZodOptional<z.ZodNumber>;
6
6
  dmp: z.ZodOptional<z.ZodArray<z.ZodObject<{
7
7
  sentAt: z.ZodNumber;
8
- msg: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
9
- }, "strip", z.ZodTypeAny, {
10
- msg: `0x${string}`;
11
- sentAt: number;
12
- }, {
13
- msg: `0x${string}`;
14
- sentAt: number;
15
- }>, "many">>;
16
- ump: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>>;
17
- hrmp: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodArray<z.ZodObject<{
8
+ msg: z.ZodCustom<`0x${string}`, `0x${string}`>;
9
+ }, z.core.$strip>>>;
10
+ ump: z.ZodOptional<z.ZodRecord<z.ZodNumber, z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>>>;
11
+ hrmp: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodArray<z.ZodObject<{
18
12
  sentAt: z.ZodNumber;
19
- data: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
20
- }, "strip", z.ZodTypeAny, {
21
- data: `0x${string}`;
22
- sentAt: number;
23
- }, {
24
- data: `0x${string}`;
25
- sentAt: number;
26
- }>, "many">>>;
27
- transactions: z.ZodOptional<z.ZodArray<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, "many">>;
13
+ data: z.ZodCustom<`0x${string}`, `0x${string}`>;
14
+ }, z.core.$strip>>>>;
15
+ transactions: z.ZodOptional<z.ZodArray<z.ZodCustom<`0x${string}`, `0x${string}`>>>;
28
16
  unsafeBlockHeight: z.ZodOptional<z.ZodNumber>;
29
- relayChainStateOverrides: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodUnion<[z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, z.ZodNull]>], null>, "many">>;
17
+ relayChainStateOverrides: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodCustom<`0x${string}`, `0x${string}`>, z.ZodUnion<readonly [z.ZodCustom<`0x${string}`, `0x${string}`>, z.ZodNull]>], null>>>;
30
18
  relayParentNumber: z.ZodOptional<z.ZodNumber>;
31
- }, "strip", z.ZodTypeAny, {
32
- transactions?: `0x${string}`[] | undefined;
33
- unsafeBlockHeight?: number | undefined;
34
- relayChainStateOverrides?: [`0x${string}`, `0x${string}` | null][] | undefined;
35
- relayParentNumber?: number | undefined;
36
- ump?: Record<number, `0x${string}`[]> | undefined;
37
- dmp?: {
38
- msg: `0x${string}`;
39
- sentAt: number;
40
- }[] | undefined;
41
- hrmp?: Record<string | number, {
42
- data: `0x${string}`;
43
- sentAt: number;
44
- }[]> | undefined;
45
- count?: number | undefined;
46
- to?: number | undefined;
47
- }, {
48
- transactions?: `0x${string}`[] | undefined;
49
- unsafeBlockHeight?: number | undefined;
50
- relayChainStateOverrides?: [`0x${string}`, `0x${string}` | null][] | undefined;
51
- relayParentNumber?: number | undefined;
52
- ump?: Record<number, `0x${string}`[]> | undefined;
53
- dmp?: {
54
- msg: `0x${string}`;
55
- sentAt: number;
56
- }[] | undefined;
57
- hrmp?: Record<string | number, {
58
- data: `0x${string}`;
59
- sentAt: number;
60
- }[]> | undefined;
61
- count?: number | undefined;
62
- to?: number | undefined;
63
- }>;
19
+ }, z.core.$strip>;
64
20
  type Params = z.infer<typeof schema>;
65
21
  export interface NewBlockParams {
66
22
  /**
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { type Context } from '../shared.js';
3
- declare const schema: z.ZodUnion<[z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>, z.ZodNumber]>;
3
+ declare const schema: z.ZodUnion<[z.ZodIntersection<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>, z.ZodNumber]>;
4
4
  type Params = z.infer<typeof schema>;
5
5
  /**
6
6
  * Set head.
@@ -2,6 +2,6 @@ import dev from './dev/index.js';
2
2
  import type { Handlers } from './shared.js';
3
3
  import substrate from './substrate/index.js';
4
4
  export declare const allHandlers: Handlers;
5
- export { substrate, dev };
6
5
  export type { Context, Handler, Handlers, SubscriptionManager } from './shared.js';
7
6
  export { ResponseError } from './shared.js';
7
+ export { dev, substrate };
@@ -10,5 +10,5 @@ export const allHandlers = {
10
10
  methods: Object.keys(allHandlers).sort()
11
11
  })
12
12
  };
13
- export { substrate, dev };
14
13
  export { ResponseError } from './shared.js';
14
+ export { dev, substrate };
@@ -6,6 +6,28 @@ const logger = defaultLogger.child({
6
6
  name: 'rpc-chainHead_v1'
7
7
  });
8
8
  const following = new Map();
9
+ const runtimeSpec = (runtime)=>({
10
+ type: 'valid',
11
+ spec: {
12
+ specName: runtime.specName,
13
+ implName: runtime.implName,
14
+ specVersion: runtime.specVersion,
15
+ implVersion: runtime.implVersion,
16
+ transactionVersion: runtime.transactionVersion,
17
+ apis: Object.fromEntries(runtime.apis)
18
+ }
19
+ });
20
+ const invalidRuntimeSpec = (error)=>({
21
+ type: 'invalid',
22
+ error: error instanceof Error ? error.message : String(error)
23
+ });
24
+ const getRuntimeSpec = async (runtime)=>{
25
+ try {
26
+ return runtimeSpec(await runtime);
27
+ } catch (error) {
28
+ return invalidRuntimeSpec(error);
29
+ }
30
+ };
9
31
  /**
10
32
  * Start a chainHead follow subscription
11
33
  *
@@ -20,12 +42,16 @@ const following = new Map();
20
42
  hash: block.hash
21
43
  }, 'chainHead_v1_follow');
22
44
  const getNewRuntime = async ()=>{
23
- const [runtime, previousRuntime] = await Promise.all([
24
- block.runtimeVersion,
25
- block.parentBlock.then((b)=>b?.runtimeVersion)
26
- ]);
27
- const hasNewRuntime = runtime.implVersion !== previousRuntime?.implVersion || runtime.specVersion !== previousRuntime.specVersion;
28
- return hasNewRuntime ? runtime : null;
45
+ try {
46
+ const [runtime, previousRuntime] = await Promise.all([
47
+ block.runtimeVersion,
48
+ block.parentBlock.then((b)=>b?.runtimeVersion)
49
+ ]);
50
+ const hasNewRuntime = runtime.implVersion !== previousRuntime?.implVersion || runtime.specVersion !== previousRuntime.specVersion;
51
+ return hasNewRuntime ? runtimeSpec(runtime) : null;
52
+ } catch (error) {
53
+ return invalidRuntimeSpec(error);
54
+ }
29
55
  };
30
56
  const newRuntime = withRuntime ? await getNewRuntime() : null;
31
57
  callback({
@@ -73,7 +99,7 @@ const following = new Map();
73
99
  finalizedBlockHashes: [
74
100
  context.chain.head.hash
75
101
  ],
76
- finalizedBlockRuntime: withRuntime ? await context.chain.head.runtimeVersion : null
102
+ finalizedBlockRuntime: withRuntime ? await getRuntimeSpec(context.chain.head.runtimeVersion) : null
77
103
  });
78
104
  callback({
79
105
  event: 'bestBlockChanged',
@@ -2,7 +2,7 @@ import * as ArchiveV1RPC from './archive_v1.js';
2
2
  import * as ChainHeadV1RPC from './chainHead_v1.js';
3
3
  import * as ChainSpecV1RPC from './chainSpec_v1.js';
4
4
  import * as TransactionV1RPC from './transaction_v1.js';
5
- export { ChainHeadV1RPC, TransactionV1RPC, ChainSpecV1RPC };
5
+ export { ChainHeadV1RPC, ChainSpecV1RPC, TransactionV1RPC };
6
6
  declare const handlers: {
7
7
  chainSpec_v1_chainName: import("../shared.js").Handler<[], string>;
8
8
  chainSpec_v1_genesisHash: import("../shared.js").Handler<[], import("@polkadot/util/types").HexString>;
@@ -2,7 +2,7 @@ import * as ArchiveV1RPC from './archive_v1.js';
2
2
  import * as ChainHeadV1RPC from './chainHead_v1.js';
3
3
  import * as ChainSpecV1RPC from './chainSpec_v1.js';
4
4
  import * as TransactionV1RPC from './transaction_v1.js';
5
- export { ChainHeadV1RPC, TransactionV1RPC, ChainSpecV1RPC };
5
+ export { ChainHeadV1RPC, ChainSpecV1RPC, TransactionV1RPC };
6
6
  const handlers = {
7
7
  ...ArchiveV1RPC,
8
8
  ...ChainHeadV1RPC,
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import type { Blockchain } from '../blockchain/index.js';
3
3
  export declare const logger: import("pino").Logger<never, boolean>;
4
- export declare const zHex: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
5
- export declare const zHash: z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
4
+ export declare const zHex: z.ZodCustom<`0x${string}`, `0x${string}`>;
5
+ export declare const zHash: z.ZodIntersection<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
6
6
  export declare class ResponseError extends Error {
7
7
  code: number;
8
8
  constructor(code: number, message: string);
@@ -4,12 +4,7 @@ import * as ChainRPC from './chain.js';
4
4
  import * as PaymentRPC from './payment.js';
5
5
  import * as StateRPC from './state.js';
6
6
  import * as SystemRPC from './system.js';
7
- export { ArchiveRPC };
8
- export { AuthorRPC };
9
- export { ChainRPC };
10
- export { PaymentRPC };
11
- export { StateRPC };
12
- export { SystemRPC };
7
+ export { ArchiveRPC, AuthorRPC, ChainRPC, PaymentRPC, StateRPC, SystemRPC };
13
8
  declare const handlers: {
14
9
  system_localPeerId: () => Promise<string>;
15
10
  system_nodeRoles: () => Promise<string[]>;
@@ -4,12 +4,7 @@ import * as ChainRPC from './chain.js';
4
4
  import * as PaymentRPC from './payment.js';
5
5
  import * as StateRPC from './state.js';
6
6
  import * as SystemRPC from './system.js';
7
- export { ArchiveRPC };
8
- export { AuthorRPC };
9
- export { ChainRPC };
10
- export { PaymentRPC };
11
- export { StateRPC };
12
- export { SystemRPC };
7
+ export { ArchiveRPC, AuthorRPC, ChainRPC, PaymentRPC, StateRPC, SystemRPC };
13
8
  const handlers = {
14
9
  ...ArchiveRPC,
15
10
  ...AuthorRPC,
@@ -1,4 +1,5 @@
1
- import { hexToU8a } from '@polkadot/util';
1
+ import { hexToU8a, u8aToHex } from '@polkadot/util';
2
+ import { isGeneralExtrinsic } from '../../utils/index.js';
2
3
  import { ResponseError } from '../shared.js';
3
4
  /**
4
5
  * @param context
@@ -13,8 +14,9 @@ import { ResponseError } from '../shared.js';
13
14
  const registry = await block.registry;
14
15
  const tx = hexToU8a(extrinsic);
15
16
  const resp = await block.call('TransactionPaymentApi_query_fee_details', [
16
- registry.createType('Extrinsic', tx).toHex(),
17
- registry.createType('u32', tx.byteLength).toHex()
17
+ // polkadot.js cannot always decode a general (v5) extrinsic; the runtime takes its bytes as they are
18
+ isGeneralExtrinsic(tx) ? extrinsic : registry.createType('Extrinsic', tx).toHex(),
19
+ u8aToHex(registry.createType('u32', tx.byteLength).toU8a())
18
20
  ]);
19
21
  return resp.result;
20
22
  };
@@ -31,8 +33,9 @@ import { ResponseError } from '../shared.js';
31
33
  const registry = await block.registry;
32
34
  const tx = hexToU8a(extrinsic);
33
35
  const resp = await block.call('TransactionPaymentApi_query_info', [
34
- registry.createType('Extrinsic', tx).toHex(),
35
- registry.createType('u32', tx.byteLength).toHex()
36
+ // polkadot.js cannot always decode a general (v5) extrinsic; the runtime takes its bytes as they are
37
+ isGeneralExtrinsic(tx) ? extrinsic : registry.createType('Extrinsic', tx).toHex(),
38
+ u8aToHex(registry.createType('u32', tx.byteLength).toU8a())
36
39
  ]);
37
40
  return resp.result;
38
41
  };
@@ -4,59 +4,13 @@ export declare const genesisSchema: z.ZodObject<{
4
4
  name: z.ZodString;
5
5
  properties: z.ZodObject<{
6
6
  ss58Format: z.ZodOptional<z.ZodNumber>;
7
- tokenDecimals: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodArray<z.ZodNumber, "many">]>>;
8
- tokenSymbol: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
9
- }, "strip", z.ZodTypeAny, {
10
- ss58Format?: number | undefined;
11
- tokenDecimals?: number | number[] | undefined;
12
- tokenSymbol?: string | string[] | undefined;
13
- }, {
14
- ss58Format?: number | undefined;
15
- tokenDecimals?: number | number[] | undefined;
16
- tokenSymbol?: string | string[] | undefined;
17
- }>;
7
+ tokenDecimals: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodArray<z.ZodNumber>]>>;
8
+ tokenSymbol: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
9
+ }, z.core.$strip>;
18
10
  genesis: z.ZodObject<{
19
11
  raw: z.ZodObject<{
20
12
  top: z.ZodRecord<z.ZodString, z.ZodString>;
21
- }, "strip", z.ZodTypeAny, {
22
- top: Record<string, string>;
23
- }, {
24
- top: Record<string, string>;
25
- }>;
26
- }, "strip", z.ZodTypeAny, {
27
- raw: {
28
- top: Record<string, string>;
29
- };
30
- }, {
31
- raw: {
32
- top: Record<string, string>;
33
- };
34
- }>;
35
- }, "strip", z.ZodTypeAny, {
36
- name: string;
37
- id: string;
38
- properties: {
39
- ss58Format?: number | undefined;
40
- tokenDecimals?: number | number[] | undefined;
41
- tokenSymbol?: string | string[] | undefined;
42
- };
43
- genesis: {
44
- raw: {
45
- top: Record<string, string>;
46
- };
47
- };
48
- }, {
49
- name: string;
50
- id: string;
51
- properties: {
52
- ss58Format?: number | undefined;
53
- tokenDecimals?: number | number[] | undefined;
54
- tokenSymbol?: string | string[] | undefined;
55
- };
56
- genesis: {
57
- raw: {
58
- top: Record<string, string>;
59
- };
60
- };
61
- }>;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>;
15
+ }, z.core.$strip>;
62
16
  export type Genesis = z.infer<typeof genesisSchema>;
@@ -15,7 +15,7 @@ export const genesisSchema = z.object({
15
15
  }),
16
16
  genesis: z.object({
17
17
  raw: z.object({
18
- top: z.record(z.string())
18
+ top: z.record(z.string(), z.string())
19
19
  })
20
20
  })
21
21
  });
@@ -10,6 +10,11 @@ export type ProcessKey = (key: StorageKey<any>) => any;
10
10
  export declare function fetchKeys(getKeys: GetKeys, processKey: ProcessKey): Promise<void>;
11
11
  export declare function fetchKeysToArray(getKeys: GetKeys): Promise<StorageKey<any>[]>;
12
12
  export declare const compactHex: (value: Uint8Array) => HexString;
13
+ /**
14
+ * Whether `extrinsic` is a general (v5) extrinsic, read from its preamble byte. polkadot.js cannot always decode one: it
15
+ * skips the payload of a transaction extension it does not know, such as VerifySignature.
16
+ */
17
+ export declare const isGeneralExtrinsic: (extrinsic: HexString | Uint8Array) => boolean;
13
18
  export declare const getParaId: (chain: Blockchain) => Promise<import("@polkadot/types").U32>;
14
19
  export declare const isUrl: (url: string) => boolean;
15
20
  export type Deferred<T> = {
@@ -1,4 +1,5 @@
1
- import { compactStripLength, u8aToHex } from '@polkadot/util';
1
+ import { GENERAL_EXTRINSIC, TYPE_MASK } from '@polkadot/types/extrinsic/constants';
2
+ import { compactFromU8a, compactStripLength, u8aToHex, u8aToU8a } from '@polkadot/util';
2
3
  import { hexAddPrefix, hexStripPrefix } from '@polkadot/util/hex';
3
4
  import { getAuraSlotDuration } from '../wasm-executor/index.js';
4
5
  export * from './decoder.js';
@@ -29,6 +30,14 @@ export async function fetchKeysToArray(getKeys) {
29
30
  export const compactHex = (value)=>{
30
31
  return u8aToHex(compactStripLength(value)[1]);
31
32
  };
33
+ /**
34
+ * Whether `extrinsic` is a general (v5) extrinsic, read from its preamble byte. polkadot.js cannot always decode one: it
35
+ * skips the payload of a transaction extension it does not know, such as VerifySignature.
36
+ */ export const isGeneralExtrinsic = (extrinsic)=>{
37
+ const u8a = u8aToU8a(extrinsic);
38
+ const [offset] = compactFromU8a(u8a);
39
+ return (u8a[offset] & TYPE_MASK) === GENERAL_EXTRINSIC;
40
+ };
32
41
  export const getParaId = async (chain)=>{
33
42
  const meta = await chain.head.meta;
34
43
  const id = await chain.head.read('u32', meta.query.parachainInfo.parachainId);
package/package.json CHANGED
@@ -1,62 +1,66 @@
1
1
  {
2
- "name": "@acala-network/chopsticks-core",
3
- "version": "1.5.2",
4
- "author": "Acala Developers <hello@acala.network>",
5
- "license": "Apache-2.0",
6
- "type": "module",
7
- "engines": {
8
- "node": ">=v22"
9
- },
10
- "scripts": {
11
- "clean": "rm -rf dist tsconfig.tsbuildinfo",
12
- "build": "yarn clean && ../../package-build.sh",
13
- "docs:prep": "typedoc",
14
- "depcheck": "npx depcheck"
15
- },
16
- "dependencies": {
17
- "@acala-network/chopsticks-executor": "1.5.2",
18
- "@polkadot/rpc-provider": "^16.4.1",
19
- "@polkadot/types": "^16.4.1",
20
- "@polkadot/types-codec": "^16.4.1",
21
- "@polkadot/types-known": "^16.4.1",
22
- "@polkadot/util": "^14.0.1",
23
- "@polkadot/util-crypto": "^14.0.1",
24
- "comlink": "^4.4.2",
25
- "eventemitter3": "^5.0.1",
26
- "lodash": "^4.18.1",
27
- "lru-cache": "^11.1.0",
28
- "pino": "^9.7.0",
29
- "pino-pretty": "^13.0.0",
30
- "rxjs": "^7.8.2",
31
- "zod": "^3.25.76"
32
- },
33
- "devDependencies": {
34
- "@swc/cli": "0.7.10",
35
- "@swc/core": "^1.12.14",
36
- "@types/lodash": "^4.17.20",
37
- "typescript": "^5.8.3",
38
- "vitest": "^4.1.11"
39
- },
40
- "files": [
41
- "dist/esm/**",
42
- "dist/cjs/**"
43
- ],
44
- "main": "./dist/cjs/index.js",
45
- "module": "./dist/esm/index.js",
46
- "exports": {
47
- ".": {
48
- "require": "./dist/cjs/index.js",
49
- "import": "./dist/esm/index.js",
50
- "default": "./dist/esm/index.js"
51
- },
52
- "./*": {
53
- "require": "./dist/cjs/*.js",
54
- "import": "./dist/esm/*.js",
55
- "default": "./dist/esm/*.js"
56
- }
57
- },
58
- "browser": {
59
- "./dist/cjs/wasm-executor/node-worker.js": "./dist/cjs/wasm-executor/browser-worker.js",
60
- "./dist/esm/wasm-executor/node-worker.js": "./dist/esm/wasm-executor/browser-worker.js"
61
- }
62
- }
2
+ "name": "@acala-network/chopsticks-core",
3
+ "version": "1.6.1",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/AcalaNetwork/chopsticks"
7
+ },
8
+ "author": "Acala Developers <hello@acala.network>",
9
+ "license": "Apache-2.0",
10
+ "type": "module",
11
+ "engines": {
12
+ "node": ">=v24"
13
+ },
14
+ "scripts": {
15
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
16
+ "build": "bun run clean && ../../package-build.sh",
17
+ "docs:prep": "typedoc",
18
+ "depcheck": "bunx depcheck"
19
+ },
20
+ "dependencies": {
21
+ "@acala-network/chopsticks-executor": "1.6.1",
22
+ "@polkadot/rpc-provider": "^17.0.2",
23
+ "@polkadot/types": "^17.0.2",
24
+ "@polkadot/types-codec": "^17.0.2",
25
+ "@polkadot/types-known": "^17.0.2",
26
+ "@polkadot/util": "^14.0.3",
27
+ "@polkadot/util-crypto": "^14.0.3",
28
+ "comlink": "^4.4.2",
29
+ "eventemitter3": "^5.0.4",
30
+ "lodash": "^4.18.1",
31
+ "lru-cache": "^11.5.3",
32
+ "pino": "^10.4.0",
33
+ "pino-pretty": "^13.2.0",
34
+ "rxjs": "^7.8.2",
35
+ "zod": "^4.6.7"
36
+ },
37
+ "devDependencies": {
38
+ "@swc/cli": "0.8.2",
39
+ "@swc/core": "^1.16.22",
40
+ "@types/lodash": "^4.17.27",
41
+ "typescript": "^6.0.3",
42
+ "vitest": "^5.1.0"
43
+ },
44
+ "files": [
45
+ "dist/esm/**",
46
+ "dist/cjs/**"
47
+ ],
48
+ "main": "./dist/cjs/index.js",
49
+ "module": "./dist/esm/index.js",
50
+ "exports": {
51
+ ".": {
52
+ "require": "./dist/cjs/index.js",
53
+ "import": "./dist/esm/index.js",
54
+ "default": "./dist/esm/index.js"
55
+ },
56
+ "./*": {
57
+ "require": "./dist/cjs/*.js",
58
+ "import": "./dist/esm/*.js",
59
+ "default": "./dist/esm/*.js"
60
+ }
61
+ },
62
+ "browser": {
63
+ "./dist/cjs/wasm-executor/node-worker.js": "./dist/cjs/wasm-executor/browser-worker.js",
64
+ "./dist/esm/wasm-executor/node-worker.js": "./dist/esm/wasm-executor/browser-worker.js"
65
+ }
66
+ }