@storagehub/api-augment 0.1.0
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/README.md +54 -0
- package/biome.json +10 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/augment-api-consts.js +6 -0
- package/dist/interfaces/augment-api-consts.js.map +1 -0
- package/dist/interfaces/augment-api-errors.js +6 -0
- package/dist/interfaces/augment-api-errors.js.map +1 -0
- package/dist/interfaces/augment-api-events.js +6 -0
- package/dist/interfaces/augment-api-events.js.map +1 -0
- package/dist/interfaces/augment-api-query.js +6 -0
- package/dist/interfaces/augment-api-query.js.map +1 -0
- package/dist/interfaces/augment-api-rpc.js +6 -0
- package/dist/interfaces/augment-api-rpc.js.map +1 -0
- package/dist/interfaces/augment-api-runtime.js +6 -0
- package/dist/interfaces/augment-api-runtime.js.map +1 -0
- package/dist/interfaces/augment-api-tx.js +6 -0
- package/dist/interfaces/augment-api-tx.js.map +1 -0
- package/dist/interfaces/augment-api.js +10 -0
- package/dist/interfaces/augment-api.js.map +1 -0
- package/dist/interfaces/augment-types.js +6 -0
- package/dist/interfaces/augment-types.js.map +1 -0
- package/dist/interfaces/definitions.js +2 -0
- package/dist/interfaces/definitions.js.map +1 -0
- package/dist/interfaces/index.js +4 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/lookup.js +4504 -0
- package/dist/interfaces/lookup.js.map +1 -0
- package/dist/interfaces/registry.js +6 -0
- package/dist/interfaces/registry.js.map +1 -0
- package/dist/interfaces/storagehubclient/definitions.js +7 -0
- package/dist/interfaces/storagehubclient/definitions.js.map +1 -0
- package/dist/interfaces/storagehubclient/index.js +4 -0
- package/dist/interfaces/storagehubclient/index.js.map +1 -0
- package/dist/interfaces/storagehubclient/runtime.js +152 -0
- package/dist/interfaces/storagehubclient/runtime.js.map +1 -0
- package/dist/interfaces/storagehubclient/types.js +4 -0
- package/dist/interfaces/storagehubclient/types.js.map +1 -0
- package/dist/interfaces/types-lookup.js +6 -0
- package/dist/interfaces/types-lookup.js.map +1 -0
- package/dist/interfaces/types.js +4 -0
- package/dist/interfaces/types.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/interfaces/augment-api-consts.d.ts +556 -0
- package/dist/types/interfaces/augment-api-errors.d.ts +1195 -0
- package/dist/types/interfaces/augment-api-events.d.ts +2070 -0
- package/dist/types/interfaces/augment-api-query.d.ts +1439 -0
- package/dist/types/interfaces/augment-api-rpc.d.ts +718 -0
- package/dist/types/interfaces/augment-api-runtime.d.ts +441 -0
- package/dist/types/interfaces/augment-api-tx.d.ts +3039 -0
- package/dist/types/interfaces/augment-api.d.ts +7 -0
- package/dist/types/interfaces/augment-types.d.ts +1285 -0
- package/dist/types/interfaces/definitions.d.ts +1 -0
- package/dist/types/interfaces/index.d.ts +1 -0
- package/dist/types/interfaces/lookup.d.ts +4179 -0
- package/dist/types/interfaces/registry.d.ts +272 -0
- package/dist/types/interfaces/storagehubclient/definitions.d.ts +6 -0
- package/dist/types/interfaces/storagehubclient/index.d.ts +1 -0
- package/dist/types/interfaces/storagehubclient/runtime.d.ts +2 -0
- package/dist/types/interfaces/storagehubclient/types.d.ts +198 -0
- package/dist/types/interfaces/types-lookup.d.ts +4457 -0
- package/dist/types/interfaces/types.d.ts +1 -0
- package/package.json +38 -0
- package/scripts/scrapeMetadata.ts +77 -0
- package/src/index.ts +3 -0
- package/src/interfaces/augment-api-consts.ts +570 -0
- package/src/interfaces/augment-api-errors.ts +1203 -0
- package/src/interfaces/augment-api-events.ts +1836 -0
- package/src/interfaces/augment-api-query.ts +1975 -0
- package/src/interfaces/augment-api-rpc.ts +1201 -0
- package/src/interfaces/augment-api-runtime.ts +707 -0
- package/src/interfaces/augment-api-tx.ts +3418 -0
- package/src/interfaces/augment-api.ts +10 -0
- package/src/interfaces/augment-types.ts +2508 -0
- package/src/interfaces/definitions.ts +1 -0
- package/src/interfaces/index.ts +4 -0
- package/src/interfaces/lookup.ts +4511 -0
- package/src/interfaces/registry.ts +546 -0
- package/src/interfaces/storagehubclient/definitions.ts +7 -0
- package/src/interfaces/storagehubclient/index.ts +4 -0
- package/src/interfaces/storagehubclient/runtime.ts +156 -0
- package/src/interfaces/storagehubclient/types.ts +241 -0
- package/src/interfaces/types-lookup.ts +5623 -0
- package/src/interfaces/types.ts +4 -0
- package/storagehub.json +1 -0
- package/tsconfig.json +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @storagehub/api-augment
|
|
2
|
+
|
|
3
|
+
This package is used to generate TypeScript types for the Storage Hub Runtime using the Polkadot{.js} typegen package. It automates the process of:
|
|
4
|
+
|
|
5
|
+
1. Launching a local Storage Hub node
|
|
6
|
+
2. Fetching the metadata blob
|
|
7
|
+
3. Running the blob through the Polkadot{.js} typegen package to create TypeScript type interfaces
|
|
8
|
+
|
|
9
|
+
> [!TIP]
|
|
10
|
+
> For more information on this process, see the [Polkadot{.js} docs](https://polkadot.js.org/docs/api/examples/promise/typegen)
|
|
11
|
+
|
|
12
|
+
## Generating
|
|
13
|
+
|
|
14
|
+
To generate the types, run the following commands:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
pnpm i
|
|
18
|
+
pnpm scrape
|
|
19
|
+
pnpm generate:all
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Importing into Files for Type Completion
|
|
23
|
+
|
|
24
|
+
At the top of your file, add:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import "@storagehub/api-augment";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
>[!TIP]
|
|
31
|
+
> This step is also achievable by running `pnpm typegen` from within the `/test` folder.
|
|
32
|
+
|
|
33
|
+
## Available Scripts
|
|
34
|
+
|
|
35
|
+
In addition to the generation scripts, the following scripts are available:
|
|
36
|
+
|
|
37
|
+
- `pnpm fmt`: Format the codebase using Biome.
|
|
38
|
+
- `pnpm fmt:fix`: Format and fix the codebase using Biome.
|
|
39
|
+
- `pnpm tsc`: Run TypeScript compiler without emitting files.
|
|
40
|
+
- `pnpm build`: Build the TypeScript project.
|
|
41
|
+
- `pnpm scrape`: Scrape metadata from the local Storage Hub node.
|
|
42
|
+
- `pnpm generate:all`: Generate all types (definitions and metadata).
|
|
43
|
+
- `pnpm generate:defs`: Generate type definitions.
|
|
44
|
+
- `pnpm generate:meta`: Generate metadata types.
|
|
45
|
+
|
|
46
|
+
## CI/CD Workflow
|
|
47
|
+
|
|
48
|
+
### `api-augment-publish.yml`
|
|
49
|
+
|
|
50
|
+
This workflow will publish the `@storagehub/api-augment` at a given git hash.
|
|
51
|
+
|
|
52
|
+
### `api-augment-update.yml`
|
|
53
|
+
|
|
54
|
+
This workflow will update the `api-augment` package and raise a PR with the changes.
|
package/biome.json
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,8BAA8B,CAAC;AACtC,OAAO,6BAA6B,CAAC;AACrC,OAAO,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/api-base/types/consts";
|
|
6
|
+
//# sourceMappingURL=augment-api-consts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-consts.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-consts.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/api-base/types/errors";
|
|
6
|
+
//# sourceMappingURL=augment-api-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-errors.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-errors.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/api-base/types/events";
|
|
6
|
+
//# sourceMappingURL=augment-api-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-events.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-events.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/api-base/types/storage";
|
|
6
|
+
//# sourceMappingURL=augment-api-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-query.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-query.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/rpc-core/types/jsonrpc";
|
|
6
|
+
//# sourceMappingURL=augment-api-rpc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-rpc.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-rpc.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,kCAAkC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/api-base/types/calls";
|
|
6
|
+
//# sourceMappingURL=augment-api-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-runtime.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-runtime.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/api-base/types/submittable";
|
|
6
|
+
//# sourceMappingURL=augment-api-tx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api-tx.js","sourceRoot":"","sources":["../../src/interfaces/augment-api-tx.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
import "./augment-api-consts.js";
|
|
4
|
+
import "./augment-api-errors.js";
|
|
5
|
+
import "./augment-api-events.js";
|
|
6
|
+
import "./augment-api-query.js";
|
|
7
|
+
import "./augment-api-tx.js";
|
|
8
|
+
import "./augment-api-rpc.js";
|
|
9
|
+
import "./augment-api-runtime.js";
|
|
10
|
+
//# sourceMappingURL=augment-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-api.js","sourceRoot":"","sources":["../../src/interfaces/augment-api.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,oBAAoB;AAEpB,OAAO,yBAAyB,CAAC;AACjC,OAAO,yBAAyB,CAAC;AACjC,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
// import type lookup before we augment - in some environments
|
|
4
|
+
// this is required to allow for ambient/previous definitions
|
|
5
|
+
import "@polkadot/types/types/registry";
|
|
6
|
+
//# sourceMappingURL=augment-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"augment-types.js","sourceRoot":"","sources":["../../src/interfaces/augment-types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,oBAAoB;AAEpB,8DAA8D;AAC9D,6DAA6D;AAC7D,OAAO,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/interfaces/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,oBAAoB;AAEpB,cAAc,YAAY,CAAC"}
|