@acala-network/chopsticks 0.9.2-2 → 0.9.2-4

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 (71) hide show
  1. package/dist/cjs/context.js +0 -4
  2. package/dist/cjs/plugins/decode-key/cli.js +30 -0
  3. package/dist/cjs/plugins/decode-key/index.js +12 -24
  4. package/dist/cjs/plugins/dry-run/rpc.js +11 -21
  5. package/dist/cjs/plugins/follow-chain/cli.js +106 -0
  6. package/dist/cjs/plugins/follow-chain/index.js +12 -100
  7. package/dist/cjs/plugins/index.js +21 -14
  8. package/dist/cjs/plugins/new-block/index.js +14 -35
  9. package/dist/cjs/plugins/new-block/rpc.js +55 -0
  10. package/dist/cjs/plugins/run-block/cli.js +84 -0
  11. package/dist/cjs/plugins/run-block/index.js +12 -229
  12. package/dist/cjs/plugins/run-block/rpc.js +159 -0
  13. package/dist/cjs/plugins/set-block-build-mode/index.js +14 -17
  14. package/dist/cjs/plugins/set-block-build-mode/rpc.js +21 -0
  15. package/dist/cjs/plugins/set-head/index.js +14 -21
  16. package/dist/cjs/plugins/set-head/rpc.js +29 -0
  17. package/dist/cjs/plugins/set-runtime-log-level/index.js +14 -17
  18. package/dist/cjs/plugins/set-runtime-log-level/rpc.js +21 -0
  19. package/dist/cjs/plugins/set-storage/index.js +13 -18
  20. package/dist/cjs/plugins/set-storage/rpc.js +23 -0
  21. package/dist/cjs/plugins/time-travel/index.js +14 -13
  22. package/dist/cjs/plugins/time-travel/rpc.js +17 -0
  23. package/dist/cjs/rpc/index.js +5 -5
  24. package/dist/cjs/schema/index.js +8 -0
  25. package/dist/esm/context.js +0 -4
  26. package/dist/esm/plugins/decode-key/cli.js +20 -0
  27. package/dist/esm/plugins/decode-key/index.js +1 -20
  28. package/dist/esm/plugins/dry-run/rpc.js +1 -4
  29. package/dist/esm/plugins/follow-chain/cli.js +91 -0
  30. package/dist/esm/plugins/follow-chain/index.js +1 -91
  31. package/dist/esm/plugins/index.js +15 -10
  32. package/dist/esm/plugins/new-block/index.js +1 -66
  33. package/dist/esm/plugins/new-block/rpc.js +82 -0
  34. package/dist/esm/plugins/run-block/cli.js +74 -0
  35. package/dist/esm/plugins/run-block/index.js +2 -222
  36. package/dist/esm/plugins/run-block/rpc.js +148 -0
  37. package/dist/esm/plugins/set-block-build-mode/index.js +1 -26
  38. package/dist/esm/plugins/set-block-build-mode/rpc.js +28 -0
  39. package/dist/esm/plugins/set-head/index.js +1 -29
  40. package/dist/esm/plugins/set-head/rpc.js +33 -0
  41. package/dist/esm/plugins/set-runtime-log-level/index.js +1 -25
  42. package/dist/esm/plugins/set-runtime-log-level/rpc.js +25 -0
  43. package/dist/esm/plugins/set-storage/index.js +1 -37
  44. package/dist/esm/plugins/set-storage/rpc.js +37 -0
  45. package/dist/esm/plugins/time-travel/index.js +1 -21
  46. package/dist/esm/plugins/time-travel/rpc.js +21 -0
  47. package/dist/esm/rpc/index.js +6 -6
  48. package/dist/esm/schema/index.js +2 -0
  49. package/dist/types/plugins/decode-key/cli.d.ts +2 -0
  50. package/dist/types/plugins/decode-key/index.d.ts +1 -2
  51. package/dist/types/plugins/dry-run/rpc.d.ts +0 -1
  52. package/dist/types/plugins/follow-chain/cli.d.ts +2 -0
  53. package/dist/types/plugins/follow-chain/index.d.ts +1 -2
  54. package/dist/types/plugins/index.d.ts +3 -2
  55. package/dist/types/plugins/new-block/index.d.ts +1 -71
  56. package/dist/types/plugins/new-block/rpc.d.ts +128 -0
  57. package/dist/types/plugins/run-block/cli.d.ts +2 -0
  58. package/dist/types/plugins/run-block/index.d.ts +2 -141
  59. package/dist/types/plugins/run-block/rpc.d.ts +139 -0
  60. package/dist/types/plugins/set-block-build-mode/index.d.ts +1 -18
  61. package/dist/types/plugins/set-block-build-mode/rpc.d.ts +20 -0
  62. package/dist/types/plugins/set-head/index.d.ts +1 -18
  63. package/dist/types/plugins/set-head/rpc.d.ts +21 -0
  64. package/dist/types/plugins/set-runtime-log-level/index.d.ts +1 -17
  65. package/dist/types/plugins/set-runtime-log-level/rpc.d.ts +17 -0
  66. package/dist/types/plugins/set-storage/index.d.ts +1 -28
  67. package/dist/types/plugins/set-storage/rpc.d.ts +28 -0
  68. package/dist/types/plugins/time-travel/index.d.ts +1 -17
  69. package/dist/types/plugins/time-travel/rpc.d.ts +17 -0
  70. package/dist/types/schema/index.d.ts +2 -0
  71. package/package.json +3 -3
@@ -0,0 +1,17 @@
1
+ import { Context } from '@acala-network/chopsticks-core';
2
+ /**
3
+ * Set runtime log level.
4
+ *
5
+ * This function is a dev rpc handler. Use `dev_setRuntimeLogLevel` as the method name when calling it.
6
+ *
7
+ * @param context - The context object of the rpc handler
8
+ * @param runtimeLogLevel - The runtime log level to set
9
+ *
10
+ * @example Set runtime log level to 1
11
+ * ```ts
12
+ * import { WsProvider } from '@polkadot/rpc-provider'
13
+ * const ws = new WsProvider(`ws://localhost:8000`)
14
+ * await ws.send('dev_setRuntimeLogLevel', [1])
15
+ * ```
16
+ */
17
+ export declare const rpc: (context: Context, [runtimeLogLevel]: [number]) => Promise<void>;
@@ -1,28 +1 @@
1
- import { Context, StorageValues } from '@acala-network/chopsticks-core';
2
- import { HexString } from '@polkadot/util/types';
3
- /**
4
- * Set storage values.
5
- *
6
- * This function is a dev rpc handler. Use `dev_setStorage` as the method name when calling it.
7
- *
8
- * @param context - The context object of the rpc handler
9
- * @param params - The parameters of the rpc handler
10
- *
11
- * @example
12
- * ```ts
13
- * import { WsProvider } from '@polkadot/rpc-provider'
14
- * import { Keyring } from '@polkadot/keyring'
15
- *
16
- * const ws = new WsProvider(`ws://localhost:8000`)
17
- * const keyring = new Keyring({ type: 'ed25519' })
18
- * const bob = keyring.addFromUri('//Bob')
19
- *
20
- * const storage = {
21
- * System: {
22
- * Account: [[[bob.address], { data: { free: 100000 }, nonce: 1 }]],
23
- * },
24
- * }
25
- * await ws.send('dev_setStorage', [storage])
26
- * ```
27
- */
28
- export declare const rpc: (context: Context, params: [StorageValues, HexString?]) => Promise<`0x${string}`>;
1
+ export * from './rpc.js';
@@ -0,0 +1,28 @@
1
+ import { Context, StorageValues } from '@acala-network/chopsticks-core';
2
+ import { HexString } from '@polkadot/util/types';
3
+ /**
4
+ * Set storage values.
5
+ *
6
+ * This function is a dev rpc handler. Use `dev_setStorage` as the method name when calling it.
7
+ *
8
+ * @param context - The context object of the rpc handler
9
+ * @param params - The parameters of the rpc handler
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * import { WsProvider } from '@polkadot/rpc-provider'
14
+ * import { Keyring } from '@polkadot/keyring'
15
+ *
16
+ * const ws = new WsProvider(`ws://localhost:8000`)
17
+ * const keyring = new Keyring({ type: 'ed25519' })
18
+ * const bob = keyring.addFromUri('//Bob')
19
+ *
20
+ * const storage = {
21
+ * System: {
22
+ * Account: [[[bob.address], { data: { free: 100000 }, nonce: 1 }]],
23
+ * },
24
+ * }
25
+ * await ws.send('dev_setStorage', [storage])
26
+ * ```
27
+ */
28
+ export declare const rpc: (context: Context, params: [StorageValues, HexString?]) => Promise<`0x${string}`>;
@@ -1,17 +1 @@
1
- import { Context } from '@acala-network/chopsticks-core';
2
- /**
3
- * Travel to a specific time.
4
- *
5
- * This function is a dev rpc handler. Use `dev_timeTravel` as the method name when calling it.
6
- *
7
- * @param context - The context object of the rpc handler
8
- * @param date - Timestamp or date string to set
9
- *
10
- * @example
11
- * ```ts
12
- * import { WsProvider } from '@polkadot/rpc-provider'
13
- * const ws = new WsProvider(`ws://localhost:8000`)
14
- * await ws.send('dev_timeTravel', ['Jan 1, 2023'])
15
- * ```
16
- */
17
- export declare const rpc: (context: Context, [date]: [string | number]) => Promise<number>;
1
+ export * from './rpc.js';
@@ -0,0 +1,17 @@
1
+ import { Context } from '@acala-network/chopsticks-core';
2
+ /**
3
+ * Travel to a specific time.
4
+ *
5
+ * This function is a dev rpc handler. Use `dev_timeTravel` as the method name when calling it.
6
+ *
7
+ * @param context - The context object of the rpc handler
8
+ * @param date - Timestamp or date string to set
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { WsProvider } from '@polkadot/rpc-provider'
13
+ * const ws = new WsProvider(`ws://localhost:8000`)
14
+ * await ws.send('dev_timeTravel', ['Jan 1, 2023'])
15
+ * ```
16
+ */
17
+ export declare const rpc: (context: Context, [date]: [string | number]) => Promise<number>;
@@ -1,5 +1,7 @@
1
1
  import { BuildBlockMode } from '@acala-network/chopsticks-core';
2
2
  import { z } from 'zod';
3
+ export declare const zHex: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
4
+ export declare const zHash: z.ZodIntersection<z.ZodString, z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>>;
3
5
  export declare const configSchema: z.ZodObject<{
4
6
  port: z.ZodOptional<z.ZodNumber>;
5
7
  endpoint: z.ZodOptional<z.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acala-network/chopsticks",
3
- "version": "0.9.2-2",
3
+ "version": "0.9.2-4",
4
4
  "author": "Acala Developers <hello@acala.network>",
5
5
  "license": "Apache-2.0",
6
6
  "bin": "./chopsticks.cjs",
@@ -14,8 +14,8 @@
14
14
  "docs:prep": "typedoc"
15
15
  },
16
16
  "dependencies": {
17
- "@acala-network/chopsticks-core": "0.9.2-2",
18
- "@acala-network/chopsticks-db": "0.9.2-2",
17
+ "@acala-network/chopsticks-core": "0.9.2-4",
18
+ "@acala-network/chopsticks-db": "0.9.2-4",
19
19
  "@pnpm/npm-conf": "^2.2.2",
20
20
  "axios": "^1.6.0",
21
21
  "dotenv": "^16.3.1",