@storagehub/types-bundle 0.1.1 → 0.1.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.
- package/README.md +38 -0
- package/dist/definitions.js +15 -14
- package/dist/definitions.js.map +1 -0
- package/dist/rpc.js +65 -48
- package/dist/rpc.js.map +1 -0
- package/dist/runtime.js +193 -140
- package/dist/runtime.js.map +1 -0
- package/dist/types/rpc.d.ts +4 -1
- package/dist/types.js +108 -83
- package/dist/types.js.map +1 -0
- package/package.json +7 -7
- package/tsconfig.json +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# `@storagehub/types-bundle`
|
|
2
|
+
|
|
3
|
+
This package provides bundled type definitions for the Storage Hub Runtime, designed to work with the Polkadot{.js} API. It includes custom types, RPC definitions, and runtime interfaces.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
The `types-bundle` package contains all the necessary type definitions and overrides required for interacting with the Storage Hub Runtime using the Polkadot{.js} API. This includes:
|
|
8
|
+
|
|
9
|
+
- Custom types specific to Storage Hub
|
|
10
|
+
- RPC definitions for custom RPC methods
|
|
11
|
+
- Runtime interfaces for the Storage Hub Runtime
|
|
12
|
+
|
|
13
|
+
## Available Scripts
|
|
14
|
+
|
|
15
|
+
The following scripts are available for development and maintenance:
|
|
16
|
+
|
|
17
|
+
- `pnpm fmt`: Format the codebase using Biome.
|
|
18
|
+
- `pnpm fmt:fix`: Format and fix the codebase using Biome.
|
|
19
|
+
- `pnpm tsc`: Run TypeScript compiler without emitting files.
|
|
20
|
+
- `pnpm build`: Build the TypeScript project.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
To use the bundled types in your project, import the `types-bundle` package and configure the Polkadot{.js} API to use the custom types.
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { ApiPromise, WsProvider } from '@polkadot/api';
|
|
28
|
+
import { typesBundle } from '@storagehub/types-bundle';
|
|
29
|
+
const provider = new WsProvider('ws://localhost:9944');
|
|
30
|
+
const api = await ApiPromise.create({
|
|
31
|
+
provider,
|
|
32
|
+
typesBundle
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## CI/CD Workflow
|
|
37
|
+
|
|
38
|
+
TODO
|
package/dist/definitions.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { rpcDefinitions } from "./rpc";
|
|
2
|
-
import { runtime } from "./runtime";
|
|
3
|
-
import { ALL_TYPES } from "./types";
|
|
1
|
+
import { rpcDefinitions } from "./rpc.js";
|
|
2
|
+
import { runtime } from "./runtime.js";
|
|
3
|
+
import { ALL_TYPES } from "./types.js";
|
|
4
4
|
export const storageHubDefinitions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
rpc: rpcDefinitions,
|
|
6
|
+
runtime,
|
|
7
|
+
types: [
|
|
8
|
+
{
|
|
9
|
+
minmax: [0, undefined],
|
|
10
|
+
types: ALL_TYPES
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
13
|
};
|
|
14
14
|
export const types = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
spec: {
|
|
16
|
+
"storage-hub-runtime": storageHubDefinitions
|
|
17
|
+
}
|
|
18
18
|
};
|
|
19
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,MAAM,CAAC,MAAM,qBAAqB,GAA6B;IAC7D,GAAG,EAAE,cAAc;IACnB,OAAO;IACP,KAAK,EAAE;QACL;YACE,MAAM,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC;YACtB,KAAK,EAAE,SAAS;SACjB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAuB;IACvC,IAAI,EAAE;QACJ,qBAAqB,EAAE,qBAAqB;KAC7C;CACF,CAAC"}
|
package/dist/rpc.js
CHANGED
|
@@ -1,55 +1,72 @@
|
|
|
1
1
|
export const rpcDefinitions = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
name: "location",
|
|
12
|
-
type: "String"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "owner",
|
|
16
|
-
type: "AccountId32"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "bucket_id",
|
|
20
|
-
type: "H256"
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
type: "FileMetadata"
|
|
2
|
+
storagehubclient: {
|
|
3
|
+
loadFileInStorage: {
|
|
4
|
+
description:
|
|
5
|
+
"Load a file in the local storage. This is the first step when uploading a file.",
|
|
6
|
+
params: [
|
|
7
|
+
{
|
|
8
|
+
name: "file_path",
|
|
9
|
+
type: "String"
|
|
24
10
|
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
name: "file_key",
|
|
30
|
-
type: "H256"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
name: "file_path",
|
|
34
|
-
type: "String"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
type: "SaveFileToDisk"
|
|
11
|
+
{
|
|
12
|
+
name: "location",
|
|
13
|
+
type: "String"
|
|
38
14
|
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
type: "H256"
|
|
15
|
+
{
|
|
16
|
+
name: "owner",
|
|
17
|
+
type: "AccountId32"
|
|
43
18
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
name: "seed",
|
|
49
|
-
type: "String"
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
type: "String"
|
|
19
|
+
{
|
|
20
|
+
name: "bucket_id",
|
|
21
|
+
type: "H256"
|
|
53
22
|
}
|
|
23
|
+
],
|
|
24
|
+
type: "FileMetadata"
|
|
25
|
+
},
|
|
26
|
+
saveFileToDisk: {
|
|
27
|
+
description: "Save a file from the local storage to the disk.",
|
|
28
|
+
params: [
|
|
29
|
+
{
|
|
30
|
+
name: "file_key",
|
|
31
|
+
type: "H256"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "file_path",
|
|
35
|
+
type: "String"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
type: "SaveFileToDisk"
|
|
39
|
+
},
|
|
40
|
+
getForestRoot: {
|
|
41
|
+
description: "Get the root of the forest trie.",
|
|
42
|
+
params: [
|
|
43
|
+
{
|
|
44
|
+
name: "key",
|
|
45
|
+
type: "Option<String>"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
type: "H256"
|
|
49
|
+
},
|
|
50
|
+
insertBcsvKeys: {
|
|
51
|
+
description: "Generate and insert new keys of type BCSV into the keystore.",
|
|
52
|
+
params: [
|
|
53
|
+
{
|
|
54
|
+
name: "seed",
|
|
55
|
+
type: "Option<String>"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
type: "String"
|
|
59
|
+
},
|
|
60
|
+
removeBcsvKeys: {
|
|
61
|
+
description: "Remove keys of BCSV type for the Blockchain Service.",
|
|
62
|
+
params: [
|
|
63
|
+
{
|
|
64
|
+
name: "keystore_path",
|
|
65
|
+
type: "String"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
type: "()"
|
|
54
69
|
}
|
|
70
|
+
}
|
|
55
71
|
};
|
|
72
|
+
//# sourceMappingURL=rpc.js.map
|
package/dist/rpc.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpc.js","sourceRoot":"","sources":["../src/rpc.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAqE;IAC9F,gBAAgB,EAAE;QAChB,iBAAiB,EAAE;YACjB,WAAW,EACT,iFAAiF;YACnF,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;iBACf;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;iBACf;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,IAAI,EAAE,aAAa;iBACpB;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,MAAM;iBACb;aACF;YACD,IAAI,EAAE,cAAc;SACrB;QACD,cAAc,EAAE;YACd,WAAW,EAAE,iDAAiD;YAC9D,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,MAAM;iBACb;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,IAAI,EAAE,gBAAgB;SACvB;QACD,aAAa,EAAE;YACb,WAAW,EAAE,kCAAkC;YAC/C,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,gBAAgB;iBACvB;aACF;YACD,IAAI,EAAE,MAAM;SACb;QACD,cAAc,EAAE;YACd,WAAW,EAAE,8DAA8D;YAC3E,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,gBAAgB;iBACvB;aACF;YACD,IAAI,EAAE,QAAQ;SACf;QACD,cAAc,EAAE;YACd,WAAW,EAAE,sDAAsD;YACnE,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,eAAe;oBACrB,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,IAAI,EAAE,IAAI;SACX;KACF;CACF,CAAC"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,151 +1,204 @@
|
|
|
1
1
|
const FILE_SYSTEM_V1 = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
query_earliest_file_volunteer_block: {
|
|
3
|
+
description: "Query the earliest block number that a BSP can volunteer for a file.",
|
|
4
|
+
params: [
|
|
5
|
+
{
|
|
6
|
+
name: "bspId",
|
|
7
|
+
type: "BackupStorageProviderId"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "fileKey",
|
|
11
|
+
type: "H256"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
type: "Result<BlockNumber, QueryFileEarliestVolunteerBlockError>"
|
|
15
|
+
},
|
|
16
|
+
query_bsp_confirm_chunks_to_prove_for_file: {
|
|
17
|
+
description: "Query the chunks that a BSP needs to prove to confirm that it is storing a file.",
|
|
18
|
+
params: [
|
|
19
|
+
{
|
|
20
|
+
name: "bspId",
|
|
21
|
+
type: "BackupStorageProviderId"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "fileKey",
|
|
25
|
+
type: "H256"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
type: "Result<Vec<ChunkId>, QueryBspConfirmChunksToProveForFileError>"
|
|
29
|
+
}
|
|
30
30
|
};
|
|
31
31
|
const PROOFS_DEALER_V1 = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
type: "BlockNumber"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
type: "Result<Vec<(Key, Option<TrieRemoveMutation>)>, GetCheckpointChallengesError>"
|
|
56
|
-
},
|
|
57
|
-
get_challenge_period: {
|
|
58
|
-
description: "Get the challenge period for a given Provider.",
|
|
59
|
-
params: [
|
|
60
|
-
{
|
|
61
|
-
name: "providerId",
|
|
62
|
-
type: "ProviderId"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
type: "Result<BlockNumber, GetChallengePeriodError>"
|
|
66
|
-
},
|
|
67
|
-
get_checkpoint_challenge_period: {
|
|
68
|
-
description: "Get the checkpoint challenge period.",
|
|
69
|
-
params: [],
|
|
32
|
+
get_last_tick_provider_submitted_proof: {
|
|
33
|
+
description: "Get the last tick for which the submitter submitted a proof.",
|
|
34
|
+
params: [
|
|
35
|
+
{
|
|
36
|
+
name: "providerId",
|
|
37
|
+
type: "ProviderId"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
type: "Result<BlockNumber, GetLastTickProviderSubmittedProofError>"
|
|
41
|
+
},
|
|
42
|
+
get_last_checkpoint_challenge_tick: {
|
|
43
|
+
description: "Get the last checkpoint challenge tick.",
|
|
44
|
+
params: [],
|
|
45
|
+
type: "BlockNumber"
|
|
46
|
+
},
|
|
47
|
+
get_checkpoint_challenges: {
|
|
48
|
+
description: "Get checkpoint challenges for a given block.",
|
|
49
|
+
params: [
|
|
50
|
+
{
|
|
51
|
+
name: "tick",
|
|
70
52
|
type: "BlockNumber"
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
name: "providerId",
|
|
81
|
-
type: "ProviderId"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "count",
|
|
85
|
-
type: "u32"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
type: "Vec<Key>"
|
|
89
|
-
},
|
|
90
|
-
get_forest_challenges_from_seed: {
|
|
91
|
-
description: "Get forest challenges from a seed.",
|
|
92
|
-
params: [
|
|
93
|
-
{
|
|
94
|
-
name: "seed",
|
|
95
|
-
type: "RandomnessOutput"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: "providerId",
|
|
99
|
-
type: "ProviderId"
|
|
100
|
-
}
|
|
101
|
-
],
|
|
102
|
-
type: "Vec<Key>"
|
|
103
|
-
},
|
|
104
|
-
get_current_tick: {
|
|
105
|
-
description: "Get the current tick.",
|
|
106
|
-
params: [],
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
type: "Result<Vec<(Key, Option<TrieRemoveMutation>)>, GetCheckpointChallengesError>"
|
|
56
|
+
},
|
|
57
|
+
get_challenge_seed: {
|
|
58
|
+
description: "Get the seed for a given challenge tick.",
|
|
59
|
+
params: [
|
|
60
|
+
{
|
|
61
|
+
name: "tick",
|
|
107
62
|
type: "BlockNumber"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
type: "
|
|
118
|
-
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
type: "Result<RandomnessOutput, GetChallengeSeedError>"
|
|
66
|
+
},
|
|
67
|
+
get_challenge_period: {
|
|
68
|
+
description: "Get the challenge period for a given Provider.",
|
|
69
|
+
params: [
|
|
70
|
+
{
|
|
71
|
+
name: "providerId",
|
|
72
|
+
type: "ProviderId"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
type: "Result<BlockNumber, GetChallengePeriodError>"
|
|
76
|
+
},
|
|
77
|
+
get_checkpoint_challenge_period: {
|
|
78
|
+
description: "Get the checkpoint challenge period.",
|
|
79
|
+
params: [],
|
|
80
|
+
type: "BlockNumber"
|
|
81
|
+
},
|
|
82
|
+
get_challenges_from_seed: {
|
|
83
|
+
description: "Get challenges from a seed.",
|
|
84
|
+
params: [
|
|
85
|
+
{
|
|
86
|
+
name: "seed",
|
|
87
|
+
type: "RandomnessOutput"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "providerId",
|
|
91
|
+
type: "ProviderId"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "count",
|
|
95
|
+
type: "u32"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
type: "Vec<Key>"
|
|
99
|
+
},
|
|
100
|
+
get_forest_challenges_from_seed: {
|
|
101
|
+
description: "Get forest challenges from a seed.",
|
|
102
|
+
params: [
|
|
103
|
+
{
|
|
104
|
+
name: "seed",
|
|
105
|
+
type: "RandomnessOutput"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "providerId",
|
|
109
|
+
type: "ProviderId"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
type: "Vec<Key>"
|
|
113
|
+
},
|
|
114
|
+
get_current_tick: {
|
|
115
|
+
description: "Get the current tick.",
|
|
116
|
+
params: [],
|
|
117
|
+
type: "BlockNumber"
|
|
118
|
+
},
|
|
119
|
+
get_next_deadline_tick: {
|
|
120
|
+
description: "Get the next deadline tick.",
|
|
121
|
+
params: [
|
|
122
|
+
{
|
|
123
|
+
name: "providerId",
|
|
124
|
+
type: "ProviderId"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
type: "Result<BlockNumber, GetNextDeadlineTickError>"
|
|
128
|
+
}
|
|
119
129
|
};
|
|
120
130
|
const STORAGE_PROVIDERS_V1 = {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
get_bsp_info: {
|
|
132
|
+
description: "Get the BSP info for a given BSP ID.",
|
|
133
|
+
params: [
|
|
134
|
+
{
|
|
135
|
+
name: "bspId",
|
|
136
|
+
type: "BackupStorageProviderId"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
type: "Result<BackupStorageProvider, GetBspInfoError>"
|
|
140
|
+
},
|
|
141
|
+
get_storage_provider_id: {
|
|
142
|
+
description: "Get the Storage Provider ID for a given Account ID.",
|
|
143
|
+
params: [
|
|
144
|
+
{
|
|
145
|
+
name: "who",
|
|
146
|
+
type: "AccountId"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
type: "Option<StorageProviderId>"
|
|
150
|
+
}
|
|
131
151
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
152
|
+
const PAYMENT_STREAMS_V1 = {
|
|
153
|
+
get_users_with_debt_over_threshold: {
|
|
154
|
+
description: "Get the users that have a debt to the provider greater than the threshold.",
|
|
155
|
+
params: [
|
|
156
|
+
{
|
|
157
|
+
name: "providerId",
|
|
158
|
+
type: "ProviderId"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "threshold",
|
|
162
|
+
type: "Balance"
|
|
163
|
+
}
|
|
138
164
|
],
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
165
|
+
type: "Result<Vec<AccountId>, GetUsersWithDebtOverThresholdError>"
|
|
166
|
+
},
|
|
167
|
+
get_users_of_payment_streams_of_provider: {
|
|
168
|
+
description: "Get the payment streams of a provider.",
|
|
169
|
+
params: [
|
|
170
|
+
{
|
|
171
|
+
name: "providerId",
|
|
172
|
+
type: "ProviderId"
|
|
173
|
+
}
|
|
144
174
|
],
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
175
|
+
type: "Vec<AccountId>"
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
export const runtime = {
|
|
179
|
+
FileSystemApi: [
|
|
180
|
+
{
|
|
181
|
+
methods: FILE_SYSTEM_V1,
|
|
182
|
+
version: 1
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
ProofsDealerApi: [
|
|
186
|
+
{
|
|
187
|
+
methods: PROOFS_DEALER_V1,
|
|
188
|
+
version: 1
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
StorageProvidersApi: [
|
|
192
|
+
{
|
|
193
|
+
methods: STORAGE_PROVIDERS_V1,
|
|
194
|
+
version: 1
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
PaymentStreamsApi: [
|
|
198
|
+
{
|
|
199
|
+
methods: PAYMENT_STREAMS_V1,
|
|
200
|
+
version: 1
|
|
201
|
+
}
|
|
202
|
+
]
|
|
151
203
|
};
|
|
204
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAAmC;IACrD,mCAAmC,EAAE;QACnC,WAAW,EAAE,sEAAsE;QACnF,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,yBAAyB;aAChC;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,MAAM;aACb;SACF;QACD,IAAI,EAAE,2DAA2D;KAClE;IACD,0CAA0C,EAAE;QAC1C,WAAW,EAAE,kFAAkF;QAC/F,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,yBAAyB;aAChC;YACD;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,MAAM;aACb;SACF;QACD,IAAI,EAAE,gEAAgE;KACvE;CACF,CAAC;AAEF,MAAM,gBAAgB,GAAm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AO,EAAE,cAAc;YACvB,OAAO,EAAE,CAAC;SACX;KACF;IACD,eAAe,EAAE;QACf;YACE,OAAO,EAAE,gBAAgB;YACzB,OAAO,EAAE,CAAC;SACX;KACF;IACD,mBAAmB,EAAE;QACnB;YACE,OAAO,EAAE,oBAAoB;YAC7B,OAAO,EAAE,CAAC;SACX;KACF;IACD,iBAAiB,EAAE;QACjB;YACE,OAAO,EAAE,kBAAkB;YAC3B,OAAO,EAAE,CAAC;SACX;KACF;CACF,CAAC"}
|
package/dist/types/rpc.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { DefinitionRpc, DefinitionRpcSub } from "@polkadot/types/types";
|
|
2
|
-
export declare const rpcDefinitions: Record<
|
|
2
|
+
export declare const rpcDefinitions: Record<
|
|
3
|
+
string,
|
|
4
|
+
Record<string, DefinitionRpc | DefinitionRpcSub>
|
|
5
|
+
>;
|
package/dist/types.js
CHANGED
|
@@ -1,86 +1,111 @@
|
|
|
1
1
|
export const ALL_TYPES = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
ProviderId: "H256",
|
|
22
|
-
Key: "H256",
|
|
23
|
-
RandomnessOutput: "H256",
|
|
24
|
-
TrieRemoveMutation: {},
|
|
25
|
-
BackupStorageProviderId: "H256",
|
|
26
|
-
StorageData: "u32",
|
|
27
|
-
MerklePatriciaRoot: "H256",
|
|
28
|
-
ChunkId: "u64",
|
|
29
|
-
BackupStorageProvider: {
|
|
30
|
-
capacity: "StorageData",
|
|
31
|
-
data_used: "StorageData",
|
|
32
|
-
multiaddresses: "BoundedVec<u8, 5>",
|
|
33
|
-
root: "MerklePatriciaRoot",
|
|
34
|
-
last_capacity_change: "BlockNumber",
|
|
35
|
-
owner_account: "AccountId",
|
|
36
|
-
payment_account: "AccountId"
|
|
37
|
-
},
|
|
38
|
-
GetLastTickProviderSubmittedProofError: {
|
|
39
|
-
_enum: {
|
|
40
|
-
ProviderNotRegistered: null,
|
|
41
|
-
ProviderNeverSubmittedProof: null,
|
|
42
|
-
InternalApiError: null
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
GetCheckpointChallengesError: {
|
|
46
|
-
_enum: {
|
|
47
|
-
TickGreaterThanLastCheckpointTick: null,
|
|
48
|
-
NoCheckpointChallengesInTick: null,
|
|
49
|
-
InternalApiError: null
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
GetChallengePeriodError: {
|
|
53
|
-
_enum: {
|
|
54
|
-
ProviderNotRegistered: null
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
GetBspInfoError: {
|
|
58
|
-
_enum: {
|
|
59
|
-
BspNotRegistered: null,
|
|
60
|
-
InternalApiError: null
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
GetNextDeadlineTickError: {
|
|
64
|
-
_enum: {
|
|
65
|
-
ProviderNotRegistered: null,
|
|
66
|
-
ProviderNotInitialised: null,
|
|
67
|
-
ArithmeticOverflow: null,
|
|
68
|
-
InternalApiError: null
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
QueryFileEarliestVolunteerBlockError: {
|
|
72
|
-
_enum: {
|
|
73
|
-
FailedToEncodeFingerprint: null,
|
|
74
|
-
FailedToEncodeBsp: null,
|
|
75
|
-
ThresholdArithmeticError: null,
|
|
76
|
-
StorageRequestNotFound: null,
|
|
77
|
-
InternalError: null
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
QueryBspConfirmChunksToProveForFileError: {
|
|
81
|
-
_enum: {
|
|
82
|
-
StorageRequestNotFound: null,
|
|
83
|
-
InternalError: null
|
|
84
|
-
}
|
|
2
|
+
FileMetadata: {
|
|
3
|
+
owner: "Vec<u8>",
|
|
4
|
+
bucket_id: "Vec<u8>",
|
|
5
|
+
location: "Vec<u8>",
|
|
6
|
+
file_size: "u64",
|
|
7
|
+
fingerprint: "[u8; 32]"
|
|
8
|
+
},
|
|
9
|
+
IncompleteFileStatus: {
|
|
10
|
+
file_metadata: "FileMetadata",
|
|
11
|
+
stored_chunks: "u64",
|
|
12
|
+
total_chunks: "u64"
|
|
13
|
+
},
|
|
14
|
+
SaveFileToDisk: {
|
|
15
|
+
_enum: {
|
|
16
|
+
FileNotFound: null,
|
|
17
|
+
Success: "FileMetadata",
|
|
18
|
+
IncompleteFile: "IncompleteFileStatus"
|
|
85
19
|
}
|
|
20
|
+
},
|
|
21
|
+
ProviderId: "H256",
|
|
22
|
+
Key: "H256",
|
|
23
|
+
RandomnessOutput: "H256",
|
|
24
|
+
TrieRemoveMutation: {},
|
|
25
|
+
BackupStorageProviderId: "H256",
|
|
26
|
+
MainStorageProviderId: "H256",
|
|
27
|
+
StorageData: "u32",
|
|
28
|
+
MerklePatriciaRoot: "H256",
|
|
29
|
+
ChunkId: "u64",
|
|
30
|
+
BackupStorageProvider: {
|
|
31
|
+
capacity: "StorageData",
|
|
32
|
+
data_used: "StorageData",
|
|
33
|
+
multiaddresses: "BoundedVec<u8, 5>",
|
|
34
|
+
root: "MerklePatriciaRoot",
|
|
35
|
+
last_capacity_change: "BlockNumber",
|
|
36
|
+
owner_account: "AccountId",
|
|
37
|
+
payment_account: "AccountId"
|
|
38
|
+
},
|
|
39
|
+
StorageProviderId: {
|
|
40
|
+
_enum: {
|
|
41
|
+
BackupStorageProvider: "BackupStorageProviderId",
|
|
42
|
+
MainStorageProvider: "MainStorageProviderId"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
GetLastTickProviderSubmittedProofError: {
|
|
46
|
+
_enum: {
|
|
47
|
+
ProviderNotRegistered: null,
|
|
48
|
+
ProviderNeverSubmittedProof: null,
|
|
49
|
+
InternalApiError: null
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
GetCheckpointChallengesError: {
|
|
53
|
+
_enum: {
|
|
54
|
+
TickGreaterThanLastCheckpointTick: null,
|
|
55
|
+
NoCheckpointChallengesInTick: null,
|
|
56
|
+
InternalApiError: null
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
GetChallengeSeedError: {
|
|
60
|
+
_enum: {
|
|
61
|
+
TickBeyondLastSeedStored: null,
|
|
62
|
+
TickIsInTheFuture: null,
|
|
63
|
+
InternalApiError: null
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
GetChallengePeriodError: {
|
|
67
|
+
_enum: {
|
|
68
|
+
ProviderNotRegistered: null,
|
|
69
|
+
InternalApiError: null
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
GetBspInfoError: {
|
|
73
|
+
_enum: {
|
|
74
|
+
BspNotRegistered: null,
|
|
75
|
+
InternalApiError: null
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
GetNextDeadlineTickError: {
|
|
79
|
+
_enum: {
|
|
80
|
+
ProviderNotRegistered: null,
|
|
81
|
+
ProviderNotInitialised: null,
|
|
82
|
+
ArithmeticOverflow: null,
|
|
83
|
+
InternalApiError: null
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
QueryFileEarliestVolunteerBlockError: {
|
|
87
|
+
_enum: {
|
|
88
|
+
FailedToEncodeFingerprint: null,
|
|
89
|
+
FailedToEncodeBsp: null,
|
|
90
|
+
ThresholdArithmeticError: null,
|
|
91
|
+
StorageRequestNotFound: null,
|
|
92
|
+
InternalError: null
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
QueryBspConfirmChunksToProveForFileError: {
|
|
96
|
+
_enum: {
|
|
97
|
+
StorageRequestNotFound: null,
|
|
98
|
+
InternalError: null
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
GetUsersWithDebtOverThresholdError: {
|
|
102
|
+
_enum: {
|
|
103
|
+
ProviderNotRegistered: null,
|
|
104
|
+
ProviderWithoutPaymentStreams: null,
|
|
105
|
+
AmountToChargeOverflow: null,
|
|
106
|
+
DebtOverflow: null,
|
|
107
|
+
InternalApiError: null
|
|
108
|
+
}
|
|
109
|
+
}
|
|
86
110
|
};
|
|
111
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAkB;IACtC,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,SAAS;QACpB,QAAQ,EAAE,SAAS;QACnB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,UAAU;KACxB;IACD,oBAAoB,EAAE;QACpB,aAAa,EAAE,cAAc;QAC7B,aAAa,EAAE,KAAK;QACpB,YAAY,EAAE,KAAK;KACpB;IACD,cAAc,EAAE;QACd,KAAK,EAAE;YACL,YAAY,EAAE,IAAI;YAClB,OAAO,EAAE,cAAc;YACvB,cAAc,EAAE,sBAAsB;SACvC;KACF;IACD,UAAU,EAAE,MAAM;IAClB,GAAG,EAAE,MAAM;IACX,gBAAgB,EAAE,MAAM;IACxB,kBAAkB,EAAE,EAAE;IACtB,uBAAuB,EAAE,MAAM;IAC/B,qBAAqB,EAAE,MAAM;IAC7B,WAAW,EAAE,KAAK;IAClB,kBAAkB,EAAE,MAAM;IAC1B,OAAO,EAAE,KAAK;IACd,qBAAqB,EAAE;QACrB,QAAQ,EAAE,aAAa;QACvB,SAAS,EAAE,aAAa;QACxB,cAAc,EAAE,mBAAmB;QACnC,IAAI,EAAE,oBAAoB;QAC1B,oBAAoB,EAAE,aAAa;QACnC,aAAa,EAAE,WAAW;QAC1B,eAAe,EAAE,WAAW;KAC7B;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE;YACL,qBAAqB,EAAE,yBAAyB;YAChD,mBAAmB,EAAE,uBAAuB;SAC7C;KACF;IACD,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1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storagehub/types-bundle",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Bundle definitions for Polkadot{.js} app & api",
|
|
5
5
|
"private": false,
|
|
6
6
|
"scripts": {
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@polkadot/api": "12.
|
|
26
|
-
"@polkadot/api-base": "12.
|
|
27
|
-
"@polkadot/rpc-core": "12.
|
|
28
|
-
"@polkadot/typegen": "12.
|
|
29
|
-
"@polkadot/types": "
|
|
30
|
-
"@polkadot/types-codec": "12.
|
|
25
|
+
"@polkadot/api": "12.4.2",
|
|
26
|
+
"@polkadot/api-base": "12.4.2",
|
|
27
|
+
"@polkadot/rpc-core": "12.4.2",
|
|
28
|
+
"@polkadot/typegen": "12.4.2",
|
|
29
|
+
"@polkadot/types": "12.4.2",
|
|
30
|
+
"@polkadot/types-codec": "12.4.2",
|
|
31
31
|
"typescript": "5.5.4"
|
|
32
32
|
}
|
|
33
33
|
}
|