Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7752f3c18 | ||
|
|
3a06775f9f | ||
|
|
936b5d9b72 | ||
|
|
523f1622b5 | ||
|
|
a2c027b7b7 | ||
|
|
d13f66eb5b | ||
|
|
9f400ea15c | ||
|
|
c0e841031a | ||
|
|
34f6b7b560 | ||
|
|
55fe455713 | ||
|
|
2a004e32bc | ||
|
|
bde574ff3d | ||
|
|
9c41b52175 | ||
|
|
c78d1dd149 | ||
|
|
714760963a | ||
|
|
094382373c | ||
|
|
2790d1d744 | ||
|
|
67ee8b08d9 | ||
|
|
aa704210f8 | ||
|
|
4ea8e72927 | ||
|
|
817bb3f2aa | ||
|
|
1550eb18a6 | ||
|
|
5d01220a0e | ||
|
|
e81e24fa5f | ||
|
|
bb75aa8f74 | ||
|
|
3d4511607f | ||
|
|
fe27d8059e | ||
|
|
ba24a7080c | ||
|
|
9fd061be48 | ||
|
|
1c78464e23 | ||
|
|
8f1eec6522 | ||
|
|
c60e77fef1 | ||
|
|
1a4d915652 | ||
|
|
aca7acbdbe | ||
|
|
8fe3e49ecd | ||
|
|
fcee83d803 | ||
|
|
2b2bad6725 | ||
|
|
f8ebd5fdfa | ||
|
|
8c5a164635 | ||
|
|
6d1b9cbfb2 | ||
|
|
6518166252 | ||
|
|
4913cf65fd | ||
|
|
7b8a6e89d9 | ||
|
|
664e9e8f26 | ||
|
|
5062ee602f | ||
|
|
f11feb4363 | ||
|
|
4e433446e2 | ||
|
|
c89e551fe6 | ||
|
|
a9282ced12 | ||
|
|
85e13cc2b1 | ||
|
|
43203195b4 | ||
|
|
1e472eebc9 | ||
|
|
30db589eee | ||
|
|
51b61158b7 | ||
|
|
7b7034cad3 | ||
|
|
d3a05c0da0 | ||
|
|
a33e10f0b9 | ||
|
|
27f564841d | ||
|
|
5c8bad5bb9 | ||
|
|
1113f6cfdd | ||
|
|
1753ee5395 | ||
|
|
6c27c94b4a | ||
|
|
f02d3af3d2 | ||
|
|
890dd391dc | ||
|
|
7982c416e7 | ||
|
|
e4eee7edcd | ||
|
|
cffab6900d | ||
|
|
8487558450 | ||
|
|
736fd536f9 | ||
|
|
cbb5a021a0 | ||
|
|
da7f32d96f | ||
|
|
591784cd65 | ||
|
|
ddd2f2dfe5 | ||
|
|
56f297d3b9 | ||
|
|
fa7669f0af | ||
|
|
2aa8525fe7 | ||
|
|
9254c5781f | ||
|
|
e13f3bea65 | ||
|
|
59c2327768 | ||
|
|
4b0c6aa515 | ||
|
|
6276e45155 | ||
|
|
c7cb1d84ab | ||
|
|
1a6025e012 | ||
|
|
83655c92c4 | ||
|
|
63a55d2f8a | ||
|
|
c32953b2ea | ||
|
|
e51cd1a2f7 | ||
|
|
e58694566e | ||
|
|
248561ca14 | ||
|
|
d4a9b43e88 | ||
|
|
f717663f50 | ||
|
|
49ebae9a55 | ||
|
|
7a1419e73a | ||
|
|
d15d05918c | ||
|
|
969151c4a7 | ||
|
|
23717bb180 | ||
|
|
e32ac213b9 | ||
|
|
584cbb994b | ||
|
|
dcb7760a0e | ||
|
|
fd6ba08f58 | ||
|
|
a30329b47d | ||
|
|
610f03d006 | ||
|
|
1cc9756d0e | ||
|
|
bf753cb858 | ||
|
|
9a2cd1c446 | ||
|
|
4a7bfe96e1 | ||
|
|
7c51354186 | ||
|
|
8a7707eb41 | ||
|
|
88eac8e654 | ||
|
|
c637d699bc | ||
|
|
d2450a9382 | ||
|
|
4dd6b82471 | ||
|
|
93ce2210da | ||
|
|
2463b52381 | ||
|
|
bc1cdc17e0 | ||
|
|
47ddfd75f7 | ||
|
|
9643a2e026 | ||
|
|
5ceaa53c59 | ||
|
|
edc09b56b4 | ||
|
|
9b940738d4 | ||
|
|
b86610381a | ||
|
|
dfe4bb32f0 | ||
|
|
b81c73b6ec | ||
|
|
9bb2549d0b | ||
|
|
ab90f8bd41 | ||
|
|
221712753f | ||
|
|
ed28a990af | ||
|
|
055f32d1d9 | ||
|
|
a175ce87d7 | ||
|
|
f0f1714b12 | ||
|
|
3778bd893b | ||
|
|
d4436e19fa | ||
|
|
4cf93fd4c0 | ||
|
|
6d94896764 | ||
|
|
bacb757d7d | ||
|
|
7be3cc949f | ||
|
|
41cc8b34aa | ||
|
|
4bbba5bb35 | ||
|
|
feae323f5c | ||
|
|
b363833a9f | ||
|
|
f083ea3861 | ||
|
|
f62e7f8bf9 | ||
|
|
fedb0a3f09 | ||
|
|
38928448bf | ||
|
|
cfbde5f6bd | ||
|
|
4b0e0bc6d3 | ||
|
|
9acb79f500 | ||
|
|
5dc0b38881 | ||
|
|
fab6f7e883 | ||
|
|
66e635e909 | ||
|
|
6e496d5a3c | ||
|
|
ca172c9a53 | ||
|
|
e9b83a9ff6 | ||
|
|
cf18d97b3a | ||
|
|
0b1c715408 | ||
|
|
5d493e1a03 | ||
|
|
e5437ef9e9 | ||
|
|
b56bed39e1 | ||
|
|
e789f91850 | ||
|
|
a236eb9453 | ||
|
|
7ef01b8534 | ||
|
|
0e58545a9d | ||
|
|
c474123777 | ||
|
|
93edfcf560 | ||
|
|
e5a67d82fa | ||
|
|
194f6aece1 | ||
|
|
3b4fef8f6e | ||
|
|
6c7323ee3a | ||
|
|
a97b50decb | ||
|
|
52accf6444 | ||
|
|
5b8eb231cc | ||
|
|
5ea62367d3 | ||
|
|
49a034a1a0 | ||
|
|
62a476cb4c | ||
|
|
b283673812 | ||
|
|
b6a075fefb | ||
|
|
afa844ae01 | ||
|
|
353ef59a1c | ||
|
|
6228999e6f | ||
|
|
56db42fedf | ||
|
|
df44693e5d | ||
|
|
cfa25f8dda | ||
|
|
bc8934f3c3 | ||
|
|
bc67c72e9b | ||
|
|
22d85e745a | ||
|
|
60ba2952f7 | ||
|
|
bb10d2813f | ||
|
|
80b581f0df | ||
|
|
ef37c421ac | ||
|
|
6e1e8e622b | ||
|
|
ec38a1510f | ||
|
|
e550ca5a71 | ||
|
|
80241f732f | ||
|
|
84fc0be12e | ||
|
|
e1f14e8a83 | ||
|
|
1155724604 | ||
|
|
3bb9541943 | ||
|
|
25288f664a | ||
|
|
879c5d7b44 | ||
|
|
cdaec1953c | ||
|
|
f4bf7a9c52 | ||
|
|
7b46c6aa15 | ||
|
|
d28f4ccfa0 | ||
|
|
e5b05dc700 | ||
|
|
bf9831753e | ||
|
|
5e1670dbae | ||
|
|
0d0a230c86 | ||
|
|
9989b69b46 | ||
|
|
66693253ef | ||
|
|
cbffc37dcf | ||
|
|
74ee42ed66 | ||
|
|
f642e2399f | ||
|
|
8cefb055db | ||
|
|
1f31756019 | ||
|
|
4d6a1da6d5 | ||
|
|
d62e720627 | ||
|
|
4af4470998 | ||
|
|
8bb6218132 | ||
|
|
f4197f8752 | ||
|
|
7cfad3b1c4 | ||
|
|
ff67a659b6 | ||
|
|
a5c69a42fc | ||
|
|
3facbf00eb | ||
|
|
5a6eece6d6 | ||
|
|
9219fa3197 | ||
|
|
32b9a39b1e | ||
|
|
61a7fe6307 | ||
|
|
ca755d3e0d | ||
|
|
442dba42ba | ||
|
|
ba80dd8873 | ||
|
|
1d35302dca | ||
|
|
39c3121437 | ||
|
|
d7de1d84fb | ||
|
|
0ee1dfb353 | ||
|
|
0a6f1d87d4 | ||
|
|
b7c563391c | ||
|
|
b648c4ba6c | ||
|
|
0eb995c9a1 | ||
|
|
936d14ffea | ||
|
|
72c7a0a34b | ||
|
|
8402013e97 | ||
|
|
fde6b72974 | ||
|
|
d98d4d6908 | ||
|
|
ed384666ee | ||
|
|
4e64e3d654 | ||
|
|
72b4b51915 | ||
|
|
81f5bf96f5 | ||
|
|
e935281b77 | ||
|
|
e132330c0b | ||
|
|
21594aa660 | ||
|
|
6fb7989b41 | ||
|
|
1f38a38bd5 | ||
|
|
e918aa8b14 | ||
|
|
4a33b18ac4 | ||
|
|
cb97fd1a48 | ||
|
|
51600bc560 | ||
|
|
12344ed980 | ||
|
|
0b6773a744 | ||
|
|
17a38e9c09 | ||
|
|
70499fe6ac | ||
|
|
64493e0091 | ||
|
|
ae3efb31f8 | ||
|
|
6da58d0698 | ||
|
|
07f40c1429 | ||
|
|
f5f67e795e | ||
|
|
5b0652c272 | ||
|
|
53ef5f7c56 | ||
|
|
71f99875e4 | ||
|
|
a097075bfe | ||
|
|
527f840950 | ||
|
|
7fadc7eedb | ||
|
|
35663319d9 | ||
|
|
b9d9670d18 | ||
|
|
fd027f452c | ||
|
|
10a6e03f85 | ||
|
|
522eb8359f | ||
|
|
d1fd7f75af | ||
|
|
bb61b1e6ac | ||
|
|
7c17baa5be | ||
|
|
9e7c0a1959 | ||
|
|
db2e97bf66 | ||
|
|
057f6b6041 | ||
|
|
ca82336087 | ||
|
|
761ceaeaa3 | ||
|
|
0cbca0adb8 | ||
|
|
d24db4fd6a | ||
|
|
4a893b9feb | ||
|
|
71a0a84f26 | ||
|
|
44d241f489 | ||
|
|
a4cb5f558d | ||
|
|
aef4d07c48 | ||
|
|
6a5f1bbbf4 | ||
|
|
e60ef2d677 | ||
|
|
f4622d05db | ||
|
|
47d7900809 | ||
|
|
2c86e9347b | ||
|
|
5827d298ad | ||
|
|
60e0f69920 | ||
|
|
97f1ee17b0 | ||
|
|
85215a308d | ||
|
|
89fa4edcf7 | ||
|
|
ec42fb9bff | ||
|
|
96d696dbf3 | ||
|
|
b7992ecc0b | ||
|
|
0acae6e158 | ||
|
|
6afea5043e | ||
|
|
c9ee8d9942 | ||
|
|
55f4e150c0 | ||
|
|
3e3e9c5f5a | ||
|
|
66215890dd | ||
|
|
bf6c7ee0c3 | ||
|
|
f726edf725 | ||
|
|
d917861a77 | ||
|
|
12a54efde5 | ||
|
|
9ae87bed78 | ||
|
|
7f5a52258c | ||
|
|
2c212e6b4d | ||
|
|
3d75744a20 | ||
|
|
d2ff259989 | ||
|
|
cac2ef30a1 | ||
|
|
ea38dedcc1 | ||
|
|
0bd632e612 | ||
|
|
4ce7163bb1 | ||
|
|
72fbd3f829 | ||
|
|
f20fadb51c | ||
|
|
0e0183dc99 | ||
|
|
fa71e129c2 | ||
|
|
cb68842da6 | ||
|
|
44f348ecc5 | ||
|
|
891a6106f0 | ||
|
|
90fcc234a9 | ||
|
|
72fcd97cdb | ||
|
|
2ded2052b7 | ||
|
|
a8da5707f2 | ||
|
|
f508668c46 | ||
|
|
15ed0723f1 | ||
|
|
c9b0502542 | ||
|
|
0d5a841a81 | ||
|
|
e47b8c1e73 | ||
|
|
50fe50d1a8 | ||
|
|
9e4669b8b4 | ||
|
|
1e383315e2 | ||
|
|
6f66eb2b66 | ||
|
|
0864340ae2 | ||
|
|
a3f5c65b5d | ||
|
|
7f94137b2d | ||
|
|
d65587f58d | ||
|
|
8959455401 | ||
|
|
8e40e38bd6 | ||
|
|
c646717576 | ||
|
|
4e7d6f03f5 | ||
|
|
cc3f258a5b | ||
|
|
4c776c260d | ||
|
|
f2c636217c | ||
|
|
d7ab3bfbc1 | ||
|
|
567504329d | ||
|
|
5eb3534d8e | ||
|
|
806fda67e9 | ||
|
|
5578d5d0ab | ||
|
|
39c540d453 | ||
|
|
36a244fd75 | ||
|
|
84a0ab816e | ||
|
|
e305f2c11a | ||
|
|
ed773dd158 | ||
|
|
18056a8edd | ||
|
|
96f3ce5b35 | ||
|
|
e7a78ae908 | ||
|
|
295c9219c2 | ||
|
|
99dc85ab4a | ||
|
|
16876cd0a0 | ||
|
|
cb65fb450f | ||
|
|
5bc2ad81f9 | ||
|
|
03b98774bc | ||
|
|
fb49f6bbe9 | ||
|
|
eb792102c8 | ||
|
|
a12a258112 | ||
|
|
018dd8a1c7 | ||
|
|
7a100db4b4 | ||
|
|
858a1d13c4 | ||
|
|
aa1630627a | ||
|
|
c3af40ef50 | ||
|
|
16534d6e5b | ||
|
|
eeb5f766da | ||
|
|
03f41704c4 | ||
|
|
6b0c5fad2d | ||
|
|
51165bf759 | ||
|
|
7f45d995de | ||
|
|
e7b9c40dd9 | ||
|
|
e7b66ceb89 | ||
|
|
d053b86e23 | ||
|
|
6a12aceae2 | ||
|
|
7c6b64c6c8 | ||
|
|
5495501e0c | ||
|
|
6b7824fe4f | ||
|
|
5f0b350a95 | ||
|
|
85269716dd | ||
|
|
5b9f1544a3 | ||
|
|
9943bda41f | ||
|
|
b99e7a3cdb | ||
|
|
1e491579c1 | ||
|
|
ef83cfbdc1 | ||
|
|
d10407a44f | ||
|
|
068af8b2ab | ||
|
|
d9f4d3e08b | ||
|
|
fa79f35ec2 | ||
|
|
8c2c2afc37 | ||
|
|
5157d8c3f0 | ||
|
|
bb303361e2 | ||
|
|
ad587b0673 | ||
|
|
ae5cf270f0 | ||
|
|
9fc33ac53a | ||
|
|
60d4da934a | ||
|
|
550d17d349 | ||
|
|
ce8a2b5e4f | ||
|
|
4c4994e63c | ||
|
|
df9b6959d1 | ||
|
|
6a583ee594 | ||
|
|
affa6ab1bd | ||
|
|
407aca37c1 | ||
|
|
246dfaf943 | ||
|
|
a05fff302f | ||
|
|
d45a9cfe58 | ||
|
|
32881d73a0 | ||
|
|
e568ffe23f | ||
|
|
8475130a22 | ||
|
|
a7e824ff09 | ||
|
|
9d5fb2bf72 | ||
|
|
2cf0e306dd | ||
|
|
72d5330727 | ||
|
|
1c3bdda08f | ||
|
|
668ad3dfe5 | ||
|
|
651afaeb9a | ||
|
|
5036aa9ef4 | ||
|
|
3598cc25f4 | ||
|
|
987a2ec2df | ||
|
|
389c4c5255 | ||
|
|
493287cedf | ||
|
|
fe52dc8006 | ||
|
|
f26008ab95 | ||
|
|
0952720237 | ||
|
|
04058fe95e | ||
|
|
eb96371e59 | ||
|
|
a313fe13e7 | ||
|
|
243c263485 | ||
|
|
311d8b792c | ||
|
|
878f631745 | ||
|
|
d7753839a2 | ||
|
|
fc74d88bbb | ||
|
|
47bbeee14b | ||
|
|
ba01620ba1 | ||
|
|
6e66387a8d | ||
|
|
c58687b3c6 | ||
|
|
2801088b0a | ||
|
|
fc5af92a03 | ||
|
|
8f8bb2aa23 | ||
|
|
3f69b3fc73 | ||
|
|
4ea170a83a | ||
|
|
26649c429a | ||
|
|
7c57778389 | ||
|
|
dbb5d66de3 | ||
|
|
6bc92a6d31 | ||
|
|
6462327ea5 | ||
|
|
3b4c2ac323 | ||
|
|
d0ecfdafc1 | ||
|
|
870bb8d3cb | ||
|
|
2fdb68d3bc | ||
|
|
6ef410e375 | ||
|
|
962c741139 | ||
|
|
598e69002a | ||
|
|
f6e50f14b5 | ||
|
|
caec49a8dc |
+20
-1
@@ -1,11 +1,14 @@
|
||||
33
|
||||
39
|
||||
|
||||
1.4.2
|
||||
1.6.2
|
||||
1.11.2
|
||||
1.12.2
|
||||
1.17.2
|
||||
1.31.2
|
||||
|
||||
2.8.2
|
||||
|
||||
3.2.2
|
||||
3.2.3
|
||||
3.3.2
|
||||
@@ -17,6 +20,7 @@
|
||||
3.9.2
|
||||
3.9.3
|
||||
3.10.2
|
||||
|
||||
4.0.2
|
||||
4.0.3
|
||||
4.6.2
|
||||
@@ -29,3 +33,18 @@
|
||||
5.5.2
|
||||
5.8.2
|
||||
5.8.3
|
||||
|
||||
6.0.2
|
||||
6.0.3
|
||||
6.0.4
|
||||
6.0.5
|
||||
6.1.2
|
||||
|
||||
6.4.2
|
||||
6.5.2
|
||||
6.7.2
|
||||
6.9.2
|
||||
6.10.2
|
||||
6.10.3
|
||||
|
||||
7.0.2
|
||||
+15
-1
@@ -1,3 +1,17 @@
|
||||
checks:
|
||||
argument-count:
|
||||
config:
|
||||
threshold: 5
|
||||
method-complexity:
|
||||
config:
|
||||
threshold: 7
|
||||
method-count:
|
||||
config:
|
||||
threshold: 25
|
||||
method-lines:
|
||||
config:
|
||||
threshold: 30
|
||||
|
||||
exclude_patterns:
|
||||
- "**/*.spec.js"
|
||||
- "**/*.spec.ts"
|
||||
@@ -5,7 +19,7 @@ exclude_patterns:
|
||||
- "**/*.test.ts"
|
||||
- "docs/**/*.js"
|
||||
- "docs/**/*.ts"
|
||||
- "packages/api/src/augment/"
|
||||
- "packages/*-augment/"
|
||||
- "packages/typegen/scripts"
|
||||
- "packages/typegen/src"
|
||||
- "packages/types/src/interfaces/"
|
||||
|
||||
+2
-8
@@ -6,18 +6,12 @@ const base = require('@polkadot/dev/config/eslint.cjs');
|
||||
module.exports = {
|
||||
...base,
|
||||
ignorePatterns: [
|
||||
'.eslintrc.js',
|
||||
'.github/**',
|
||||
'.vscode/**',
|
||||
'.yarn/**',
|
||||
'**/build/*',
|
||||
'**/coverage/*',
|
||||
'**/node_modules/*'
|
||||
...base.ignorePatterns
|
||||
],
|
||||
parserOptions: {
|
||||
...base.parserOptions,
|
||||
project: [
|
||||
'./tsconfig.json'
|
||||
'./tsconfig.eslint.json'
|
||||
]
|
||||
},
|
||||
rules: {
|
||||
|
||||
@@ -2,7 +2,7 @@ name: 'Lock Threads'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1/2 * * *'
|
||||
- cron: '10 1/3 * * *'
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 2/2 * * *'
|
||||
- cron: '55 1/3 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
+2
-1
@@ -21,6 +21,7 @@ tmp/
|
||||
cc-test-reporter
|
||||
lerna-debug.log*
|
||||
npm-debug.log*
|
||||
package-lock.json
|
||||
tsconfig*buildinfo
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
package-lock.json
|
||||
|
||||
+347
@@ -1,5 +1,352 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 7.0.2 Dec 21, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for applications where collective derives with aliasses are being used.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix alias module mapping in collective derives
|
||||
- Update `dispathchQueue` derive to align with latest Substrate
|
||||
- Update to latest Substrate metadata
|
||||
|
||||
|
||||
## 7.0.1 Dec 20, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for TS users with their own non-Polkadot/Kusama chains.
|
||||
|
||||
- **Breaking changes** For TS users the default API augmentation is now optional. This means that the API, for TypeScript, is not decorated by default with the Substrate types and encpoints. TS users should add a singular `import '@polkadot/api-augment';` in their code to retore old behavior.
|
||||
|
||||
- **Breaking change** To cater for the above, chain-specific interfaces generated with older versions may not be compaitible with the current version of the API. Additionally, TS interfaces generated with this version of the API is not compatible with older API versions.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add contracts storage deposit support (Thanks to https://github.com/statictype)
|
||||
- Do not throw error on socket closes (Thanks to https://github.com/xcaptain)
|
||||
|
||||
Changes:
|
||||
|
||||
- Split `@polkadot/types-{codec, create}` packages from `types`
|
||||
- Extract `@polkadot/{api, rpc, types}-augment` (now optional, TS-user applied)
|
||||
- Rework build steps to use TS project references
|
||||
- Add Polkadot 9140 upgrade block
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
|
||||
|
||||
## 6.12.1 Dec 13, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users of contracts on the current Substrate master version and TS users who generate metadata v14 interfaces.
|
||||
|
||||
Changes:
|
||||
|
||||
- Add support for contracts V2 ABI metadata
|
||||
- `CheckNonZeroSender` signed extension support
|
||||
- Remove old-style capabilities detection (unneeded with metadata v14+)
|
||||
- Generated TS Enum interfaces now expose the `type` (with allowed values)
|
||||
- Split local & package imports in generated TS interfaces
|
||||
- Add Kusama 9130 upgrade block
|
||||
- Internal maintainability cleanups
|
||||
|
||||
|
||||
## 6.11.1 Dec 5, 2021
|
||||
|
||||
Upgrade priority: Low. Maintenance upgrade, tracking the latest `@polkadot` libraries.
|
||||
|
||||
Changes:
|
||||
|
||||
- Align `state_traceBlock` RPC with Substrate
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.10.3 Nov 30, 2021
|
||||
|
||||
Upgrade priority: Medium. Recommended for 6.10.x users
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix ss58Prefix extraction
|
||||
|
||||
|
||||
## 6.10.2 Nov 30, 2021
|
||||
|
||||
Upgrade priority: Low. Aligns TS augmentation and decoration with older behavior for ALL_CAPS identifiers.
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust augmentation interface consistency with top-level declarations
|
||||
- Update `@polkadot/util` to 8.0.4 with adjusted `stringCamelCase`
|
||||
|
||||
|
||||
## 6.10.1 Nov 29, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users of `HttpProvider` and for chains generating types using TS augmentation.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix for HttpProvider init (RPC sections with only subscriptions)
|
||||
- Re-order imports in lookup type augmentation interfaces
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.9.2 Nov 22, 2021
|
||||
|
||||
Upgrade priority: Medium. Pulls in `@polkadot/util-crypto` fix for TS projects.
|
||||
|
||||
Changes:
|
||||
|
||||
- Update `@polkadot/util-crypto` with TS compilation work-around
|
||||
|
||||
|
||||
## 6.9.1 Nov 21, 2021
|
||||
|
||||
Upgrade priority: Medium. Recommended for metadata v14 parachains. For TS users, the package now support TypeScript 4.5.2 and allows extraction of user types from metadata v14.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Lookup TS generation for all metadata v14 chains (Thanks to https://github.com/savudani8)
|
||||
- Update `BeefySignedCommitment` type (Thanks to https://github.com/czl1378)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust runtime `*::{Call, Event}` matching for metadata v14
|
||||
- Adjust derive decoration with (optional) known methods
|
||||
- Expose `*{Call, Event, Error}` TS types for metadata v14
|
||||
- Align Option `.toJSON` output with Substrate input
|
||||
- Optimize Enum, Struct, Option & Number decoding paths
|
||||
- Ajust PascalCase conversions with function from util
|
||||
- Prepare pre-v13 types for optional injection
|
||||
- Adjustments for TS 4.5.2 support (flatten type infers)
|
||||
|
||||
|
||||
## 6.8.1 Nov 11, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for chains with non-MultiSignature variants where `paymentInfo` is required.
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `paymentInfo` signatures to cater for non-MultiSignature variants
|
||||
- Remove `::generic::` from names & namespaces under metadata v14
|
||||
- Add Polkadot 9122 upgrade block
|
||||
- Cleanup Polkadot/Kusama/Westend/Rococo known types (>= v14 metadata)
|
||||
- Internal `decorateMethod{Promise, Rx}` renamed to `to{Promise, Rx}Method`
|
||||
- Add RPC provider-level LRU for historic requests
|
||||
- Add optional known runtime version param to internal `rx.queryAt`
|
||||
|
||||
|
||||
## 6.7.2 Nov 9, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for chains on metadata v14 with non-default `Address` implementations.
|
||||
|
||||
Changes:
|
||||
|
||||
- Detect `AccountId` & `Address` types via `SpRuntime*` definitions
|
||||
- Adjust api-derive call ordering when using `.queryAt`
|
||||
|
||||
|
||||
## 6.7.1 Nov 7, 2021
|
||||
|
||||
Upgrade priority: Low. Internal maintenance updates, focussed on internal optimizations.
|
||||
|
||||
Changelog:
|
||||
|
||||
- Optimize Extrinsic & block handling (Thanks to https://github.com/nazar-pc)
|
||||
- Add `account::AccountId20` mapping (Thanks to https://github.com/joelamouche)
|
||||
|
||||
Changes:
|
||||
|
||||
- Use new-gen `voteLockingPeriod` in democracy derives (as available)
|
||||
- Dynamically inject getters for `Extrinsic` payloads
|
||||
- Optimize caching for complex constructed type classes per registry
|
||||
- Convert metadata, rpc and api to use lazy decoration
|
||||
- Split u8a decoding paths for `Vec` (different from general path)
|
||||
- Keep track of initial u8a decoded length inside base Codecs
|
||||
- Extract multi property assignments for `Struct`, `Set`, `Json` & `Enum`
|
||||
- Move `PortableRegistry` location inside `@polkadot/types/metadata`
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.6.1 Nov 1, 2021
|
||||
|
||||
Upgrade priority: Low. Internal maintenance updates.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix construction for `palletVersion` keys with correct prefix
|
||||
- Add Polkadot `EthereumAddress` as a known `PortableRegistry` override
|
||||
- De-dupe `PortableRegistry` namespace splitting operations
|
||||
- Optimize internal `AbstractArray` & `Struct` u8a decoding
|
||||
- Shortcut `Struct` construction from `Struct` instance
|
||||
- Use internal `lookupName` in `createClass` (allows deeply recursive lookups)
|
||||
- Codec `toHex()` will now correctly return the TS `HexString` type
|
||||
- Update known upgrade blocks for Westend & Kusama
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.5.2 Oct 26, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users with `.at` queries on unknown blocks.
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `toHuman` on `Call` to return names & (not only) values
|
||||
- Allow for optional known `RuntimeVersion` to short-circuit `api.at`
|
||||
- Ensure `Struct` decodes fully on `null` input (equivalent to `undefined` & `{}`)
|
||||
|
||||
|
||||
## 6.5.1 Oct 24, 2021
|
||||
|
||||
Upgrade priority: Low. Internal maintenance upgrades.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add `Auction` to Polkadot pre-0.9.11 `ProxyType` (Thanks to https://github.com/wirednkod)
|
||||
|
||||
Changes:
|
||||
|
||||
- Ecah module now exposes the Substrate-added `palletVersion` storage item
|
||||
- Adjust Websocket `maxReceivedFrameSize` under Node
|
||||
- `TypeDef` structures now contain the `typeName` from metadata v14 on fields
|
||||
- Fix browser bundle imports for xcm-mapping (move to `types-known`)
|
||||
- Expose all extracted type names in `PortableRegistry`
|
||||
- Adjust `toJSON` (Ascii) output detection on `Raw`
|
||||
- Adjust `api.rpc.*.*.raw(..args)` return to the actual over-the-wire JSON result
|
||||
- Remove `api.rpc.*.*.json(..args)` since it now overlaps with new `.raw`
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.4.2 Oct 18, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for Westmint runtime 500+
|
||||
|
||||
Changes:
|
||||
|
||||
- Ensure `SignerPayload` correctly serializes `Option` with `None`
|
||||
- Add Ethereum `BlockV{0, 1, 2}` types, aligning with latest Frontier
|
||||
- Additional tests for metadata serialization/de-serialization
|
||||
|
||||
|
||||
## 6.4.1 Oct 17, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9110+
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust Statemint known types for version 4+
|
||||
- Adjust balance derives to return multiple vesting schedules
|
||||
- Adjust crowdloan derives to use paged key retrieval
|
||||
- Ensure account indices (derived) are `Accountindex` types
|
||||
- Adjust metadata v14 to include top-level type field from metadata
|
||||
- Filter metadata v14 unused enum fields in TS generation
|
||||
- Adjust derives to use more metadata v14 types on returns
|
||||
- Add Kusama & Polkadot upgrade blocks for 9100/9110
|
||||
- Align contract usage with latrest `PortableRegistry` (remove old-generation)
|
||||
- Adjust contracts `InstantiateReturnValue` type (no rent projection after 267)
|
||||
- Adjust for eslint v8 checks
|
||||
- Don't run any online tests on CI by default (uncontrolled external dependencies)
|
||||
|
||||
|
||||
## 6.3.1 Oct 9, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9100+
|
||||
|
||||
Changes:
|
||||
|
||||
- Mark `api.query.*.*.at` as deprecated (use `api.at`)
|
||||
- Expose `queryMulti`, `findError` and `findCall` on `api.at`
|
||||
- Optimize parallel metadata retrieval/decoration
|
||||
- Rework derive `.at` to ensure no additional metadata calls
|
||||
- Adjust Xcm types for Kusama, Polkadot, Westend (V1 & V2 usage)
|
||||
- Fix Xcm Fungibility type
|
||||
- Add upgrade blocks for Westend
|
||||
- Prepare for v14 metadata swap in Kusama/Polkadot (9110 runtime)
|
||||
- Adjust metadata wilcard path matching (event extraction)
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.2.1 Oct 4, 2021
|
||||
|
||||
Upgrade priority: Low. Maintenance updates.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Cater for new asset fee payment extension (Thanks to https://github.com/apopiak)
|
||||
|
||||
Changes:
|
||||
|
||||
- Extend error messages for malformed `queryMulti` inputs
|
||||
- Correctly handle non-map queries passed to `queryMulti` in map form
|
||||
- Use new metadata v14 lookup type in derive results
|
||||
- Adjust definitions to infer TS types in `.multi` queries
|
||||
- Fix TS lookup enum generation with nested Option & Tuple
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.1.2 Sep 29, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for 6.x users using historic queries.
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix `.at` queries/decoration for pre-V13 metadata
|
||||
- Added `BridgeMessageId` & `SpecVersion` types for bridges
|
||||
- Added `WrapperOpaque` encoding/decoding (as per latest Substrate)
|
||||
- Bump static metadata for latest Substrate, Polkadot & Kusama
|
||||
|
||||
|
||||
## 6.1.1 Sep 27, 2021
|
||||
|
||||
Upgrade priority: Low. Minor maintenance changes from the 6.0.x versions.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Adjust bridges `OutboundLaneData` type (Thanks to https://github.com/HackFisher)
|
||||
- Fix README 404 (Thanks to https://github.com/nblogist)
|
||||
|
||||
Changes:
|
||||
|
||||
- Add `childstate_getStorageEntries` RPC
|
||||
- Allow for scale-info v0 -> v1 conversion
|
||||
|
||||
|
||||
## 6.0.5 Sep 20, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for all users on 6.0.4 using `api.query.*.*.at` calls
|
||||
|
||||
Changes:
|
||||
|
||||
- Revert cross-registry (now-inactive) change introduced in 6.0.3
|
||||
- Ensure `Option` is correctly imported for TS query generation
|
||||
|
||||
|
||||
## 6.0.4 Sep 20, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for all users on 6.0.3 using `api.query.*.*.at` calls
|
||||
|
||||
Changes:
|
||||
|
||||
- `api.query.<module>.<method>.at` will now use `at.at(<hash>)`
|
||||
- Use and expose `metadata/util/getSiName` to get human type names
|
||||
|
||||
|
||||
## 6.0.3 Sep 19, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for all users on 6.0.2 using `api.query.*.*.at` calls
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix `api.query.<module>.<method>.at` queries
|
||||
- Adjust typegen formatting for metadata documentation
|
||||
|
||||
|
||||
## 6.0.2 Sep 18, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for all users on 6.0.1, especially those using `api.query.substrate.*` calls
|
||||
|
||||
Changes:
|
||||
|
||||
- Fix `api.query.substrate.*` key generation
|
||||
|
||||
|
||||
## 6.0.1 Sep 18, 2021
|
||||
|
||||
Upgrade priority: Low. Recommended for users of the latest Substrate/Polkadot with Metadata v14.
|
||||
|
||||
+3
-4
@@ -6,13 +6,12 @@ const config = require('@polkadot/dev/config/jest.cjs');
|
||||
module.exports = {
|
||||
...config,
|
||||
moduleNameMapper: {
|
||||
'@polkadot/api-(contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
|
||||
'@polkadot/api-(augment|base|contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
|
||||
// eslint-disable-next-line sort-keys
|
||||
'@polkadot/api(.*)$': '<rootDir>/packages/api/src/$1',
|
||||
'@polkadot/metadata(.*)$': '<rootDir>/packages/metadata/src/$1',
|
||||
'@polkadot/rpc-(core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2',
|
||||
'@polkadot/rpc-(augment|core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2',
|
||||
'@polkadot/typegen(.*)$': '<rootDir>/packages/typegen/src/$1',
|
||||
'@polkadot/types-(known|support)(.*)$': '<rootDir>/packages/types-$1/src/$2',
|
||||
'@polkadot/types-(augment|codec|create|known|support)(.*)$': '<rootDir>/packages/types-$1/src/$2',
|
||||
// eslint-disable-next-line sort-keys
|
||||
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
|
||||
},
|
||||
|
||||
+20
-14
@@ -1,40 +1,46 @@
|
||||
{
|
||||
"repository": "https://github.com/polkadot-js/api",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api#readme",
|
||||
"license": "Apache-2",
|
||||
"packageManager": "yarn@3.0.1",
|
||||
"private": true,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/polkadot-js/api.git"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "7.0.2",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
"resolutions": {
|
||||
"typescript": "^4.4.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yarn build:interfaces && polkadot-dev-build-ts",
|
||||
"build:extra": "(cd packages/typegen && copyfiles scripts/* build)",
|
||||
"build:interfaces": "polkadot-types-internal-interfaces",
|
||||
"build:release": "polkadot-ci-ghact-build",
|
||||
"build:rollup": "polkadot-exec-rollup --config",
|
||||
"docs:metadata": "polkadot-types-internal-metadata",
|
||||
"chain:info": "polkadot-types-chain-info",
|
||||
"lint": "polkadot-dev-run-lint",
|
||||
"clean": "polkadot-dev-clean-build",
|
||||
"docs:metadata": "polkadot-types-internal-metadata",
|
||||
"lint": "polkadot-dev-run-lint",
|
||||
"postinstall": "polkadot-dev-yarn-only",
|
||||
"test": "polkadot-dev-run-test --coverage --forceExit --runInBand --testPathIgnorePatterns e2e",
|
||||
"test:one": "polkadot-dev-run-test --detectOpenHandles --forceExit",
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.5",
|
||||
"@babel/register": "^7.15.3",
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/dev": "^0.62.67",
|
||||
"@polkadot/ts": "^0.4.8",
|
||||
"@babel/core": "^7.16.5",
|
||||
"@babel/register": "^7.16.5",
|
||||
"@babel/runtime": "^7.16.5",
|
||||
"@polkadot/dev": "^0.64.11",
|
||||
"@polkadot/ts": "^0.4.20",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.0.1",
|
||||
"@types/jest": "^27.0.3",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"version": "6.0.1",
|
||||
"packageManager": "yarn@3.0.1"
|
||||
"resolutions": {
|
||||
"typescript": "^4.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,3 @@
|
||||
# @polkadot/api-augment
|
||||
|
||||
Generated augmentation.
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"contributors": [],
|
||||
"description": "API generated augmentation",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-augment#readme",
|
||||
"license": "Apache-2.0",
|
||||
"maintainers": [],
|
||||
"name": "@polkadot/api-augment",
|
||||
"repository": {
|
||||
"directory": "packages/api-augment",
|
||||
"type": "git",
|
||||
"url": "https://github.com/polkadot-js/api.git"
|
||||
},
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.0.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.5",
|
||||
"@polkadot/api-base": "7.0.2",
|
||||
"@polkadot/rpc-augment": "7.0.2",
|
||||
"@polkadot/types": "7.0.2",
|
||||
"@polkadot/types-augment": "7.0.2",
|
||||
"@polkadot/types-codec": "7.0.2",
|
||||
"@polkadot/util": "^8.2.2"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,24 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api/types';
|
||||
import type { U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types';
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { Codec } from '@polkadot/types-codec/types';
|
||||
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
|
||||
import type { Codec } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api/types/consts' {
|
||||
export interface AugmentedConsts<ApiType> {
|
||||
declare module '@polkadot/api-base/types/consts' {
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
assets: {
|
||||
/**
|
||||
* The amount of funds that must be reserved when creating a new approval.
|
||||
**/
|
||||
approvalDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount of funds that must be reserved for a non-provider asset account to be
|
||||
* maintained.
|
||||
**/
|
||||
assetAccountDeposit: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The basic amount of funds that must be reserved for an asset.
|
||||
**/
|
||||
@@ -63,6 +68,62 @@ declare module '@polkadot/api/types/consts' {
|
||||
* the probability of a slot being empty).
|
||||
**/
|
||||
expectedBlockTime: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Max number of authorities allowed
|
||||
**/
|
||||
maxAuthorities: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* The list of thresholds separating the various bags.
|
||||
*
|
||||
* Ids are separated into unsorted bags according to their vote weight. This specifies the
|
||||
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
|
||||
* is less than or equal to its upper threshold.
|
||||
*
|
||||
* When ids are iterated, higher bags are iterated completely before lower bags. This means
|
||||
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
|
||||
* weight, but peer ids within a particular bag are sorted in insertion order.
|
||||
*
|
||||
* # Expressing the constant
|
||||
*
|
||||
* This constant must be sorted in strictly increasing order. Duplicate items are not
|
||||
* permitted.
|
||||
*
|
||||
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
|
||||
* specified within the bag. For any two threshold lists, if one ends with
|
||||
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
|
||||
* will behave identically.
|
||||
*
|
||||
* # Calculation
|
||||
*
|
||||
* It is recommended to generate the set of thresholds in a geometric series, such that
|
||||
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
|
||||
* constant_ratio).max(threshold[k] + 1)` for all `k`.
|
||||
*
|
||||
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
|
||||
* iteration is strictly in insertion order.
|
||||
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is equal to 2.
|
||||
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
|
||||
* the procedure given above, then the constant ratio is approximately equal to 1.248.
|
||||
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
|
||||
* into bag 0, an id with weight 2 will fall into bag 1, etc.
|
||||
*
|
||||
* # Migration
|
||||
*
|
||||
* In the event that this list ever changes, a copy of the old bags list must be retained.
|
||||
* With that `List::migrate` can be called, which will perform the appropriate migration.
|
||||
**/
|
||||
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
@@ -89,7 +150,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
};
|
||||
bounties: {
|
||||
/**
|
||||
* Percentage of the curator fee that will be reserved upfront as deposit for bounty curator.
|
||||
* Percentage of the curator fee that will be reserved upfront as deposit for bounty
|
||||
* curator.
|
||||
**/
|
||||
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -109,11 +171,13 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
bountyValueMinimum: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount held on deposit per byte within bounty description.
|
||||
* The amount held on deposit per byte within the tip report reason or bounty description.
|
||||
**/
|
||||
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum acceptable reason length.
|
||||
*
|
||||
* Benchmarks depend on this value, be sure to update weights file when changing this value
|
||||
**/
|
||||
maximumReasonLength: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -121,14 +185,26 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
contracts: {
|
||||
childBounties: {
|
||||
/**
|
||||
* The deposit that must be placed into the contract's account to instantiate it.
|
||||
* This is in **addition** to the [`pallet_balances::Pallet::ExistenialDeposit`].
|
||||
* The minimum balance for a contract's account can be queried using
|
||||
* [`Pallet::subsistence_threshold`].
|
||||
* Percentage of child-bounty value to be reserved as curator deposit
|
||||
* when curator fee is zero.
|
||||
**/
|
||||
contractDeposit: u128 & AugmentedConst<ApiType>;
|
||||
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Minimum value for a child-bounty.
|
||||
**/
|
||||
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum number of child-bounties that can be added to a parent bounty.
|
||||
**/
|
||||
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
contracts: {
|
||||
/**
|
||||
* The maximum number of tries that can be queued for deletion.
|
||||
**/
|
||||
@@ -137,6 +213,21 @@ declare module '@polkadot/api/types/consts' {
|
||||
* The maximum amount of weight that can be consumed per block for lazy trie removal.
|
||||
**/
|
||||
deletionWeightLimit: u64 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount of balance a caller has to pay for each byte of storage.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* Changing this value for an existing chain might need a storage migration.
|
||||
**/
|
||||
depositPerByte: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The amount of balance a caller has to pay for each storage item.
|
||||
* # Note
|
||||
*
|
||||
* Changing this value for an existing chain might need a storage migration.
|
||||
**/
|
||||
depositPerItem: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Cost schedule and limits.
|
||||
**/
|
||||
@@ -279,6 +370,15 @@ declare module '@polkadot/api/types/consts' {
|
||||
* Duration of the unsigned phase.
|
||||
**/
|
||||
unsignedPhase: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The maximum number of voters to put in the snapshot. At the moment, snapshots are only
|
||||
* over a single block, but once multi-block elections are introduced they will take place
|
||||
* over multiple blocks.
|
||||
*
|
||||
* Also, note the data type: If the voters are represented by a `u32` in `type
|
||||
* CompactSolution`, the same `u32` is used here to ensure bounds are respected.
|
||||
**/
|
||||
voterSnapshotPerBlock: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
@@ -330,11 +430,6 @@ declare module '@polkadot/api/types/consts' {
|
||||
* Must be no greater than `MaxQueueLen`.
|
||||
**/
|
||||
fifoQueueLen: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The issuance to ignore. This is subtracted from the `Currency`'s `total_issuance` to get
|
||||
* the issuance by which we inflate or deflate the gilt.
|
||||
**/
|
||||
ignoredIssuance: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of blocks between consecutive attempts to issue more gilts in an effort to
|
||||
* get to the target amount to be frozen.
|
||||
@@ -377,6 +472,16 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
grandpa: {
|
||||
/**
|
||||
* Max Authorities in use
|
||||
**/
|
||||
maxAuthorities: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Generic const
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
identity: {
|
||||
/**
|
||||
* The amount held on deposit for a registered identity
|
||||
@@ -583,16 +688,20 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
challengePeriod: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum candidate intake per round.
|
||||
* The maximum number of candidates that we accept per round.
|
||||
**/
|
||||
maxCandidateIntake: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of times a member may vote the wrong way (or not at all, when they are a skeptic)
|
||||
* before they become suspended.
|
||||
* The maximum duration of the payout lock.
|
||||
**/
|
||||
maxLockDuration: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The number of times a member may vote the wrong way (or not at all, when they are a
|
||||
* skeptic) before they become suspended.
|
||||
**/
|
||||
maxStrikes: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The societies's module id
|
||||
* The societies's pallet id
|
||||
**/
|
||||
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -696,6 +805,8 @@ declare module '@polkadot/api/types/consts' {
|
||||
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* Maximum acceptable reason length.
|
||||
*
|
||||
* Benchmarks depend on this value, be sure to update weights file when changing this value
|
||||
**/
|
||||
maximumReasonLength: u32 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
@@ -716,6 +827,30 @@ declare module '@polkadot/api/types/consts' {
|
||||
[key: string]: Codec;
|
||||
};
|
||||
transactionPayment: {
|
||||
/**
|
||||
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
|
||||
* `priority`
|
||||
*
|
||||
* This value is multipled by the `final_fee` to obtain a "virtual tip" that is later
|
||||
* added to a tip component in regular `priority` calculations.
|
||||
* It means that a `Normal` transaction can front-run a similarly-sized `Operational`
|
||||
* extrinsic (with no tip), by including a tip value greater than the virtual tip.
|
||||
*
|
||||
* ```rust,ignore
|
||||
* // For `Normal`
|
||||
* let priority = priority_calc(tip);
|
||||
*
|
||||
* // For `Operational`
|
||||
* let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;
|
||||
* let priority = priority_calc(tip + virtual_tip);
|
||||
* ```
|
||||
*
|
||||
* Note that since we use `final_fee` the multiplier applies also to the regular `tip`
|
||||
* sent with the transaction. So, not only does the transaction get a priority bump based
|
||||
* on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`
|
||||
* transactions.
|
||||
**/
|
||||
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
|
||||
/**
|
||||
* The fee to be paid for making a transaction; the per-byte portion.
|
||||
**/
|
||||
@@ -820,9 +955,5 @@ declare module '@polkadot/api/types/consts' {
|
||||
**/
|
||||
[key: string]: Codec;
|
||||
};
|
||||
}
|
||||
|
||||
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
|
||||
[key: string]: QueryableModuleConsts;
|
||||
}
|
||||
}
|
||||
} // AugmentedConsts
|
||||
} // declare module
|
||||
@@ -1,11 +1,15 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api/types';
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
|
||||
declare module '@polkadot/api/types/errors' {
|
||||
export interface AugmentedErrors<ApiType> {
|
||||
declare module '@polkadot/api-base/types/errors' {
|
||||
export interface AugmentedErrors<ApiType extends ApiTypes> {
|
||||
assets: {
|
||||
/**
|
||||
* The asset-account already exists.
|
||||
**/
|
||||
AlreadyExists: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Invalid metadata given.
|
||||
**/
|
||||
@@ -18,10 +22,6 @@ declare module '@polkadot/api/types/errors' {
|
||||
* Account balance must be greater than or equal to the transfer amount.
|
||||
**/
|
||||
BalanceLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Balance should be non-zero.
|
||||
**/
|
||||
BalanceZero: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The origin account is frozen.
|
||||
**/
|
||||
@@ -34,13 +34,22 @@ declare module '@polkadot/api/types/errors' {
|
||||
* Minimum balance should be non-zero.
|
||||
**/
|
||||
MinBalanceZero: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The account to alter does not exist.
|
||||
**/
|
||||
NoAccount: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The asset-account doesn't have an associated deposit.
|
||||
**/
|
||||
NoDeposit: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The signing account has no permission to do the operation.
|
||||
**/
|
||||
NoPermission: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No provider reference exists to allow a non-zero balance of a non-self-sufficient
|
||||
* asset.
|
||||
* Unable to increment the consumer reference counters on the account. Either no provider
|
||||
* reference exists to allow a non-zero balance of a non-self-sufficient asset, or the
|
||||
* maximum number of consumers has been reached.
|
||||
**/
|
||||
NoProvider: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -51,6 +60,10 @@ declare module '@polkadot/api/types/errors' {
|
||||
* The given asset ID is unknown.
|
||||
**/
|
||||
Unknown: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The operation would result in funds being burned.
|
||||
**/
|
||||
WouldBurn: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The source account would not survive the transfer and it needs to stay alive.
|
||||
**/
|
||||
@@ -112,6 +125,24 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Id not found in list.
|
||||
**/
|
||||
IdNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* An Id does not have a greater vote weight than another Id.
|
||||
**/
|
||||
NotHeavier: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Attempted to place node in front of a node in another bag.
|
||||
**/
|
||||
NotInSameBag: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* Beneficiary account must pre-exist
|
||||
@@ -151,6 +182,10 @@ declare module '@polkadot/api/types/errors' {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
bounties: {
|
||||
/**
|
||||
* The bounty cannot be closed because it has active child-bounties.
|
||||
**/
|
||||
HasActiveChildBounty: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Proposer's balance is too low.
|
||||
**/
|
||||
@@ -193,13 +228,29 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* The bounty balance is not enough to add new child-bounty.
|
||||
**/
|
||||
InsufficientBountyBalance: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The parent bounty is not in active state.
|
||||
**/
|
||||
ParentBountyNotActive: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Number of child-bounties exceeds limit `MaxActiveChildBountyCount`.
|
||||
**/
|
||||
TooManyChildBounties: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
contracts: {
|
||||
/**
|
||||
* Performing the requested transfer would have brought the contract below
|
||||
* the subsistence threshold. No transfer is allowed to do this. Use `seal_terminate`
|
||||
* to recover a deposit.
|
||||
* Code removal was denied because the code is still in use by at least one contract.
|
||||
**/
|
||||
BelowSubsistenceThreshold: AugmentedError<ApiType>;
|
||||
CodeInUse: AugmentedError<ApiType>;
|
||||
/**
|
||||
* No code could be found at the supplied code hash.
|
||||
**/
|
||||
@@ -213,6 +264,13 @@ declare module '@polkadot/api/types/errors' {
|
||||
* No contract was found at the specified address.
|
||||
**/
|
||||
ContractNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The contract ran to completion but decided to revert its storage changes.
|
||||
* Please note that this error is only returned from extrinsics. When called directly
|
||||
* or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags
|
||||
* to determine whether a reversion has taken place.
|
||||
**/
|
||||
ContractReverted: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Contract trapped during execution.
|
||||
**/
|
||||
@@ -254,11 +312,6 @@ declare module '@polkadot/api/types/errors' {
|
||||
* of what is specified in the schedule.
|
||||
**/
|
||||
MaxCallDepthReached: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The newly created contract is below the subsistence threshold after executing
|
||||
* its contructor. No contracts are allowed to exist below that threshold.
|
||||
**/
|
||||
NewContractNotFunded: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The chain does not provide a chain extension. Calling the chain extension results
|
||||
* in this error. Note that this usually shouldn't happen as deploying such contracts
|
||||
@@ -286,12 +339,13 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
ReentranceDenied: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A storage modification exhausted the 32bit type that holds the storage size.
|
||||
*
|
||||
* This can either happen when the accumulated storage in bytes is too large or
|
||||
* when number of storage items is too large.
|
||||
* More storage was created than allowed by the storage deposit limit.
|
||||
**/
|
||||
StorageExhausted: AugmentedError<ApiType>;
|
||||
StorageDepositLimitExhausted: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Origin doesn't have enough balance to pay the required storage deposits.
|
||||
**/
|
||||
StorageDepositNotEnoughFunds: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A contract self destructed in its constructor.
|
||||
*
|
||||
@@ -308,9 +362,8 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
TooManyTopics: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Performing the requested transfer failed for a reason originating in the
|
||||
* chosen currency implementation of the runtime. Most probably the balance is
|
||||
* too low or locks are placed on it.
|
||||
* Performing the requested transfer failed. Probably because there isn't enough
|
||||
* free balance in the sender's account.
|
||||
**/
|
||||
TransferFailed: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -892,6 +945,36 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
preimage: {
|
||||
/**
|
||||
* Preimage has already been noted on-chain.
|
||||
**/
|
||||
AlreadyNoted: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The user is not authorized to perform this action.
|
||||
**/
|
||||
NotAuthorized: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The preimage cannot be removed since it has not yet been noted.
|
||||
**/
|
||||
NotNoted: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The preimage request cannot be removed since no outstanding requests exist.
|
||||
**/
|
||||
NotRequested: AugmentedError<ApiType>;
|
||||
/**
|
||||
* A preimage may not be removed when there are outstanding requests.
|
||||
**/
|
||||
Requested: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Preimage is too large to store on-chain.
|
||||
**/
|
||||
TooLarge: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Generic error
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
proxy: {
|
||||
/**
|
||||
* Account is already a proxy.
|
||||
@@ -1151,6 +1234,10 @@ declare module '@polkadot/api/types/errors' {
|
||||
* The user has enough bond and thus cannot be chilled forcefully by an external person.
|
||||
**/
|
||||
CannotChillOther: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Commission is too low. Must be at least `MinCommission`.
|
||||
**/
|
||||
CommissionTooLow: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Duplicate index.
|
||||
**/
|
||||
@@ -1172,7 +1259,9 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
IncorrectSlashingSpans: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Can not bond with value less than minimum required.
|
||||
* Cannot have a validator or nominator role, with value less than the minimum defined by
|
||||
* governance (see `MinValidatorBond` and `MinNominatorBond`). If unbonding is the
|
||||
* intention, `chill` first to remove one's role as validator/nominator.
|
||||
**/
|
||||
InsufficientBond: AugmentedError<ApiType>;
|
||||
/**
|
||||
@@ -1237,6 +1326,10 @@ declare module '@polkadot/api/types/errors' {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
system: {
|
||||
/**
|
||||
* The origin filter prevent the call to be dispatched.
|
||||
**/
|
||||
CallFiltered: AugmentedError<ApiType>;
|
||||
/**
|
||||
* Failed to extract the runtime version from the new runtime.
|
||||
*
|
||||
@@ -1515,9 +1608,5 @@ declare module '@polkadot/api/types/errors' {
|
||||
**/
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface DecoratedErrors<ApiType extends ApiTypes> extends AugmentedErrors<ApiType> {
|
||||
[key: string]: ModuleErrors<ApiType>;
|
||||
}
|
||||
}
|
||||
} // AugmentedErrors
|
||||
} // declare module
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// for the API, we decorate not only the endpoints, but all types
|
||||
import '@polkadot/rpc-augment';
|
||||
import '@polkadot/types-augment';
|
||||
// the augmentated types (on top of @polkadot/api-base)
|
||||
import './consts';
|
||||
import './errors';
|
||||
import './events';
|
||||
import './query';
|
||||
import './tx';
|
||||
@@ -1,19 +1,21 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes } from '@polkadot/api/types';
|
||||
import type { BTreeMap, Bytes, Data, Null, Option, U8aFixed, Vec, bool, u128, u32, u64, u8 } from '@polkadot/types';
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Data } from '@polkadot/types';
|
||||
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetBalance, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeGenericDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
|
||||
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
|
||||
import type { Observable } from '@polkadot/types/types';
|
||||
|
||||
declare module '@polkadot/api/types/storage' {
|
||||
export interface AugmentedQueries<ApiType> {
|
||||
declare module '@polkadot/api-base/types/storage' {
|
||||
export interface AugmentedQueries<ApiType extends ApiTypes> {
|
||||
assets: {
|
||||
/**
|
||||
* The number of units of assets held by any given account.
|
||||
* The holdings of a specific account for a specific asset.
|
||||
**/
|
||||
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<PalletAssetsAssetBalance>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
|
||||
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<PalletAssetsAssetAccount>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
|
||||
/**
|
||||
* Approved balance transfers. First balance is the amount approved for transfer. Second
|
||||
* is the amount of `T::Currency` reserved for storing this.
|
||||
@@ -33,6 +35,20 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
authorityDiscovery: {
|
||||
/**
|
||||
* Keys of the current authority set.
|
||||
**/
|
||||
keys: AugmentedQuery<ApiType, () => Observable<Vec<SpAuthorityDiscoveryAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Keys of the next authority set.
|
||||
**/
|
||||
nextKeys: AugmentedQuery<ApiType, () => Observable<Vec<SpAuthorityDiscoveryAppPublic>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
authorship: {
|
||||
/**
|
||||
* Author of current block.
|
||||
@@ -135,7 +151,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
/**
|
||||
* Randomness under construction.
|
||||
*
|
||||
* We make a tradeoff between storage accesses and list length.
|
||||
* We make a trade-off between storage accesses and list length.
|
||||
* We store the under-construction randomness in segments of up to
|
||||
* `UNDER_CONSTRUCTION_SEGMENT_LENGTH`.
|
||||
*
|
||||
@@ -153,6 +169,28 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForListNodes: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A bag stored in storage.
|
||||
*
|
||||
* Stores a `Bag` struct, which stores head and tail pointers to itself.
|
||||
**/
|
||||
listBags: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<PalletBagsListListBag>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
|
||||
/**
|
||||
* A single node, within some bag.
|
||||
*
|
||||
* Nodes store links forward and back within their respective bags.
|
||||
**/
|
||||
listNodes: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletBagsListListNode>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* The balance of an account.
|
||||
@@ -206,6 +244,33 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Child-bounties that have been added.
|
||||
**/
|
||||
childBounties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletChildBountiesChildBounty>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* Number of total child bounties.
|
||||
**/
|
||||
childBountyCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The description of each child-bounty.
|
||||
**/
|
||||
childBountyDescriptions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The cumulative child-bounty curator fee for each parent bounty.
|
||||
**/
|
||||
childrenCuratorFees: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Number of child-bounties per parent bounty.
|
||||
* Map of parent bounty index to number of child bounties.
|
||||
**/
|
||||
parentChildBounties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
contracts: {
|
||||
/**
|
||||
* The subtrie counter.
|
||||
@@ -228,6 +293,10 @@ declare module '@polkadot/api/types/storage' {
|
||||
* stored in said trie. Therefore this operation is performed lazily in `on_initialize`.
|
||||
**/
|
||||
deletionQueue: AugmentedQuery<ApiType, () => Observable<Vec<PalletContractsStorageDeletedContract>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A mapping between an original code hash and its owner information.
|
||||
**/
|
||||
ownerInfoOf: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletContractsWasmOwnerInfo>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
|
||||
/**
|
||||
* A mapping from an original code hash to the original code, untouched by instrumentation.
|
||||
**/
|
||||
@@ -409,7 +478,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
* Twox note: the key of the map is an auto-incrementing index which users cannot inspect or
|
||||
* affect; we shouldn't need a cryptographically secure hasher.
|
||||
**/
|
||||
signedSubmissionsMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<PalletElectionProviderMultiPhaseSignedSignedSubmission>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
signedSubmissionsMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletElectionProviderMultiPhaseSignedSignedSubmission>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Snapshot data of the round.
|
||||
*
|
||||
@@ -582,10 +651,10 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
keys: AugmentedQuery<ApiType, () => Observable<Vec<PalletImOnlineSr25519AppSr25519Public>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* For each session index, we keep a mapping of `AuthIndex` to
|
||||
* `offchain::OpaqueNetworkState`.
|
||||
* For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to
|
||||
* `WrapperOpaque<BoundedOpaqueNetworkState>`.
|
||||
**/
|
||||
receivedHeartbeats: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
receivedHeartbeats: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<WrapperOpaque<PalletImOnlineBoundedOpaqueNetworkState>>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -687,6 +756,20 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
preimage: {
|
||||
/**
|
||||
* The preimages stored by this pallet.
|
||||
**/
|
||||
preimageFor: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Bytes>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
|
||||
/**
|
||||
* The request status of a given hash.
|
||||
**/
|
||||
statusFor: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletPreimageRequestStatus>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
proxy: {
|
||||
/**
|
||||
* The announcements made by the proxy (key).
|
||||
@@ -741,7 +824,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
/**
|
||||
* Items to be executed, indexed by the block number that they should be executed on.
|
||||
**/
|
||||
agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletSchedulerScheduledV2>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletSchedulerScheduledV3>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* Lookup from identity to the block number and index of the task.
|
||||
**/
|
||||
@@ -765,7 +848,9 @@ declare module '@polkadot/api/types/storage' {
|
||||
/**
|
||||
* Indices of disabled validators.
|
||||
*
|
||||
* The set is cleared when `on_session_ending` returns a new set of identities.
|
||||
* The vec is always kept sorted so that we can find whether a given validator is
|
||||
* disabled using binary search. It gets cleared when `on_session_ending` returns
|
||||
* a new set of identities.
|
||||
**/
|
||||
disabledValidators: AugmentedQuery<ApiType, () => Observable<Vec<u32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -897,11 +982,11 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
chillThreshold: AugmentedQuery<ApiType, () => Observable<Option<Percent>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A tracker to keep count of the number of items in the `Nominators` map.
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForNominators: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* A tracker to keep count of the number of items in the `Validators` map.
|
||||
* Counter for the related counted storage map
|
||||
**/
|
||||
counterForValidators: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
@@ -1011,6 +1096,12 @@ declare module '@polkadot/api/types/storage' {
|
||||
* When this value is not set, no limits are enforced.
|
||||
**/
|
||||
maxValidatorsCount: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The minimum amount of commission that validators can set.
|
||||
*
|
||||
* If set to `0`, no limit exists.
|
||||
**/
|
||||
minCommission: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Minimum number of staking participants before emergency conditions are imposed.
|
||||
**/
|
||||
@@ -1025,14 +1116,24 @@ declare module '@polkadot/api/types/storage' {
|
||||
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The map from nominator stash key to the set of stash keys of all validators to nominate.
|
||||
*
|
||||
* When updating this storage item, you must also update the `CounterForNominators`.
|
||||
**/
|
||||
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
* All slashing events on nominators, mapped by era to the highest slash value of the era.
|
||||
**/
|
||||
nominatorSlashInEra: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
|
||||
/**
|
||||
* Indices of validators that have offended in the active era and whether they are currently
|
||||
* disabled.
|
||||
*
|
||||
* This value should be a superset of disabled validators since not all offences lead to the
|
||||
* validator being disabled (if there was no slash). This is needed to track the percentage of
|
||||
* validators that have offended in the current era, ensuring a new era is forced if
|
||||
* `OffendingValidatorsThreshold` is reached. The vec is always kept sorted so that we can find
|
||||
* whether a given validator has previously offended using binary search. It gets cleared when
|
||||
* the era ends.
|
||||
**/
|
||||
offendingValidators: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u32, bool]>>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Where the reward payment should be made. Keyed by stash.
|
||||
**/
|
||||
@@ -1069,8 +1170,6 @@ declare module '@polkadot/api/types/storage' {
|
||||
validatorCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The map from (wannabe) validator stash key to the preferences of that validator.
|
||||
*
|
||||
* When updating this storage item, you must also update the `CounterForValidators`.
|
||||
**/
|
||||
validators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletStakingValidatorPrefs>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
|
||||
/**
|
||||
@@ -1087,7 +1186,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
/**
|
||||
* The `AccountId` of the sudo key.
|
||||
**/
|
||||
key: AugmentedQuery<ApiType, () => Observable<AccountId32>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
key: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* Generic query
|
||||
**/
|
||||
@@ -1113,7 +1212,7 @@ declare module '@polkadot/api/types/storage' {
|
||||
/**
|
||||
* Digest of the current block, also part of the block header.
|
||||
**/
|
||||
digest: AugmentedQuery<ApiType, () => Observable<SpRuntimeGenericDigest>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
digest: AugmentedQuery<ApiType, () => Observable<SpRuntimeDigest>, []> & QueryableStorageEntry<ApiType, []>;
|
||||
/**
|
||||
* The number of events in the `Events<T>` list.
|
||||
**/
|
||||
@@ -1335,6 +1434,11 @@ declare module '@polkadot/api/types/storage' {
|
||||
* Details of an asset class.
|
||||
**/
|
||||
class: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesClassDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
|
||||
/**
|
||||
* The classes owned by any given account; set out this way so that classes owned by a single
|
||||
* account can be enumerated.
|
||||
**/
|
||||
classAccount: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
|
||||
/**
|
||||
* Metadata of an asset class.
|
||||
**/
|
||||
@@ -1364,9 +1468,5 @@ declare module '@polkadot/api/types/storage' {
|
||||
**/
|
||||
[key: string]: QueryableStorageEntry<ApiType>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
|
||||
[key: string]: QueryableModuleStorage<ApiType>;
|
||||
}
|
||||
}
|
||||
} // AugmentedQueries
|
||||
} // declare module
|
||||
@@ -1,15 +1,15 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types';
|
||||
import type { Bytes, Compact, Data, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
|
||||
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
|
||||
import type { ApiTypes } from '@polkadot/api-base/types';
|
||||
import type { Data } from '@polkadot/types';
|
||||
import type { Bytes, Compact, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
|
||||
import type { AccountId32, Call, H256, MultiAddress, Perbill, Percent, Perquintill } from '@polkadot/types/interfaces/runtime';
|
||||
import type { NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpCoreChangesTrieChangesTrieConfiguration, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeGenericHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
import type { AnyNumber, ITuple } from '@polkadot/types/types';
|
||||
import type { FrameSupportScheduleMaybeHashed, NodeRuntimeOriginCaller, NodeRuntimeProxyType, NodeRuntimeSessionKeys, PalletAssetsDestroyWitness, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletElectionProviderMultiPhaseRawSolution, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenRenouncing, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletImOnlineHeartbeat, PalletImOnlineSr25519AppSr25519Signature, PalletMultisigTimepoint, PalletSocietyJudgement, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletUniquesDestroyWitness, PalletVestingVestingInfo, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusSlotsEquivocationProof, SpFinalityGrandpaEquivocationProof, SpNposElectionsSupport, SpRuntimeHeader, SpSessionMembershipProof, SpTransactionStorageProofTransactionStorageProof } from '@polkadot/types/lookup';
|
||||
|
||||
declare module '@polkadot/api/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType> {
|
||||
declare module '@polkadot/api-base/types/submittable' {
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
assets: {
|
||||
/**
|
||||
* Approve an amount of asset for transfer by a delegated third-party account.
|
||||
@@ -33,13 +33,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
approveTransfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u64>]>;
|
||||
approveTransfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, delegate: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Reduce the balance of `who` by as much as possible up to `amount` assets of `id`.
|
||||
*
|
||||
* Origin must be Signed and the sender should be the Manager of the asset `id`.
|
||||
*
|
||||
* Bails with `BalanceZero` if the `who` is already dead.
|
||||
* Bails with `NoAccount` if the `who` is already dead.
|
||||
*
|
||||
* - `id`: The identifier of the asset to have some amount burned.
|
||||
* - `who`: The account to be debited from.
|
||||
@@ -51,7 +51,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Weight: `O(1)`
|
||||
* Modes: Post-existence of `who`; Pre & post Zombie-status of `who`.
|
||||
**/
|
||||
burn: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u64>]>;
|
||||
burn: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Cancel all of some asset approved for delegated transfer by a third-party account.
|
||||
*
|
||||
@@ -103,7 +103,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
create: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, u64]>;
|
||||
create: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, u128]>;
|
||||
/**
|
||||
* Destroy a class of fungible assets.
|
||||
*
|
||||
@@ -149,7 +149,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceAssetStatus: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: Compact<u64> | AnyNumber | Uint8Array, isSufficient: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, MultiAddress, MultiAddress, Compact<u64>, bool, bool]>;
|
||||
forceAssetStatus: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, issuer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, admin: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, freezer: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, minBalance: Compact<u128> | AnyNumber | Uint8Array, isSufficient: bool | boolean | Uint8Array, isFrozen: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, MultiAddress, MultiAddress, Compact<u128>, bool, bool]>;
|
||||
/**
|
||||
* Cancel all of some asset approved for delegated transfer by a third-party account.
|
||||
*
|
||||
@@ -201,7 +201,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
forceCreate: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, isSufficient: bool | boolean | Uint8Array, minBalance: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, bool, Compact<u64>]>;
|
||||
forceCreate: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, isSufficient: bool | boolean | Uint8Array, minBalance: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, bool, Compact<u128>]>;
|
||||
/**
|
||||
* Force the metadata for an asset to some value.
|
||||
*
|
||||
@@ -240,7 +240,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of
|
||||
* `dest`.
|
||||
**/
|
||||
forceTransfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, Compact<u64>]>;
|
||||
forceTransfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Disallow further unprivileged transfers from an account.
|
||||
*
|
||||
@@ -280,7 +280,18 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Weight: `O(1)`
|
||||
* Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`.
|
||||
**/
|
||||
mint: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u64>]>;
|
||||
mint: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Return the deposit (if any) of an asset account.
|
||||
*
|
||||
* The origin must be Signed.
|
||||
*
|
||||
* - `id`: The identifier of the asset for the account to be created.
|
||||
* - `allow_burn`: If `true` then assets may be destroyed in order to complete the refund.
|
||||
*
|
||||
* Emits `Refunded` event when successful.
|
||||
**/
|
||||
refund: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, allowBurn: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, bool]>;
|
||||
/**
|
||||
* Set the metadata for an asset.
|
||||
*
|
||||
@@ -340,6 +351,18 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
thawAsset: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
/**
|
||||
* Create an asset account for non-provider assets.
|
||||
*
|
||||
* A deposit will be taken from the signer account.
|
||||
*
|
||||
* - `origin`: Must be Signed; the signer account must have sufficient funds for a deposit
|
||||
* to be taken.
|
||||
* - `id`: The identifier of the asset for the account to be created.
|
||||
*
|
||||
* Emits `Touched` event when successful.
|
||||
**/
|
||||
touch: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
/**
|
||||
* Move some assets from the sender account to another.
|
||||
*
|
||||
@@ -360,7 +383,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of
|
||||
* `target`.
|
||||
**/
|
||||
transfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u64>]>;
|
||||
transfer: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Transfer some asset balance from a previously delegated account to some third-party
|
||||
* account.
|
||||
@@ -381,7 +404,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Weight: `O(1)`
|
||||
**/
|
||||
transferApproved: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, destination: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, Compact<u64>]>;
|
||||
transferApproved: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, owner: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, destination: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Move some assets from the sender account to another, keeping the sender account alive.
|
||||
*
|
||||
@@ -402,7 +425,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of
|
||||
* `target`.
|
||||
**/
|
||||
transferKeepAlive: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u64> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u64>]>;
|
||||
transferKeepAlive: AugmentedSubmittable<(id: Compact<u32> | AnyNumber | Uint8Array, target: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Change the Owner of an asset.
|
||||
*
|
||||
@@ -425,7 +448,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
/**
|
||||
* Provide a set of uncles.
|
||||
**/
|
||||
setUncles: AugmentedSubmittable<(newUncles: Vec<SpRuntimeGenericHeader> | (SpRuntimeGenericHeader | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<SpRuntimeGenericHeader>]>;
|
||||
setUncles: AugmentedSubmittable<(newUncles: Vec<SpRuntimeHeader> | (SpRuntimeHeader | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<SpRuntimeHeader>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -438,7 +461,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Multiple calls to this method will replace any existing planned config change that had
|
||||
* not been enacted yet.
|
||||
**/
|
||||
planConfigChange: AugmentedSubmittable<(config: SpConsensusBabeDigestsNextConfigDescriptor | { Unused0: any } | { V1: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [SpConsensusBabeDigestsNextConfigDescriptor]>;
|
||||
planConfigChange: AugmentedSubmittable<(config: SpConsensusBabeDigestsNextConfigDescriptor | { V1: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [SpConsensusBabeDigestsNextConfigDescriptor]>;
|
||||
/**
|
||||
* Report authority equivocation/misbehavior. This method will verify
|
||||
* the equivocation proof and validate the given key ownership proof
|
||||
@@ -462,6 +485,34 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
bagsList: {
|
||||
/**
|
||||
* Move the caller's Id directly in front of `lighter`.
|
||||
*
|
||||
* The dispatch origin for this call must be _Signed_ and can only be called by the Id of
|
||||
* the account going in front of `lighter`.
|
||||
*
|
||||
* Only works if
|
||||
* - both nodes are within the same bag,
|
||||
* - and `origin` has a greater `VoteWeight` than `lighter`.
|
||||
**/
|
||||
putInFrontOf: AugmentedSubmittable<(lighter: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Declare that some `dislocated` account has, through rewards or penalties, sufficiently
|
||||
* changed its weight that it should properly fall into a different bag than its current
|
||||
* one.
|
||||
*
|
||||
* Anyone can call this function about any potentially dislocated account.
|
||||
*
|
||||
* Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then
|
||||
* it is a noop and fees are still collected from `origin`.
|
||||
**/
|
||||
rebag: AugmentedSubmittable<(dislocated: AccountId32 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
balances: {
|
||||
/**
|
||||
* Exactly as `transfer`, except the origin must be root and the source account may be
|
||||
@@ -472,6 +523,12 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # </weight>
|
||||
**/
|
||||
forceTransfer: AugmentedSubmittable<(source: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Unreserve some balance from a user by force.
|
||||
*
|
||||
* Can only be called by ROOT.
|
||||
**/
|
||||
forceUnreserve: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, u128]>;
|
||||
/**
|
||||
* Set the balances of a given account.
|
||||
*
|
||||
@@ -481,16 +538,6 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* it will reset the account nonce (`frame_system::AccountNonce`).
|
||||
*
|
||||
* The dispatch origin for this call is `root`.
|
||||
*
|
||||
* # <weight>
|
||||
* - Independent of the arguments.
|
||||
* - Contains a limited number of reads and writes.
|
||||
* ---------------------
|
||||
* - Base Weight:
|
||||
* - Creating: 27.56 µs
|
||||
* - Killing: 35.11 µs
|
||||
* - DB Weight: 1 Read, 1 Write to `who`
|
||||
* # </weight>
|
||||
**/
|
||||
setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, newFree: Compact<u128> | AnyNumber | Uint8Array, newReserved: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>, Compact<u128>]>;
|
||||
/**
|
||||
@@ -518,8 +565,6 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - `transfer_keep_alive` works the same way as `transfer`, but has an additional check
|
||||
* that the transfer will not kill the origin account.
|
||||
* ---------------------------------
|
||||
* - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
|
||||
* - DB Weight: 1 Read and 1 Write to destination account
|
||||
* - Origin account is already in memory, so no DB operations for them.
|
||||
* # </weight>
|
||||
**/
|
||||
@@ -551,11 +596,6 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* 99% of the time you want [`transfer`] instead.
|
||||
*
|
||||
* [`transfer`]: struct.Pallet.html#method.transfer
|
||||
* # <weight>
|
||||
* - Cheaper than transfer because account cannot be killed.
|
||||
* - Base Weight: 51.4 µs
|
||||
* - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already)
|
||||
* #</weight>
|
||||
**/
|
||||
transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
@@ -587,7 +627,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
approveBounty: AugmentedSubmittable<(bountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>]>;
|
||||
/**
|
||||
* Award bounty to a beneficiary account. The beneficiary will be able to claim the funds after a delay.
|
||||
* Award bounty to a beneficiary account. The beneficiary will be able to claim the funds
|
||||
* after a delay.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of this bounty.
|
||||
*
|
||||
@@ -667,8 +708,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* This function can only be called by the `RejectOrigin` a signed origin.
|
||||
*
|
||||
* If this function is called by the `RejectOrigin`, we assume that the curator is malicious
|
||||
* or inactive. As a result, we will slash the curator when possible.
|
||||
* If this function is called by the `RejectOrigin`, we assume that the curator is
|
||||
* malicious or inactive. As a result, we will slash the curator when possible.
|
||||
*
|
||||
* If the origin is the curator, we take this as a sign they are unable to do their job and
|
||||
* they willingly give up. We could slash them, but for now we allow them to recover their
|
||||
@@ -688,17 +729,195 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
childBounties: {
|
||||
/**
|
||||
* Accept the curator role for the child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of this
|
||||
* child-bounty.
|
||||
*
|
||||
* A deposit will be reserved from the curator and refund upon
|
||||
* successful payout or cancellation.
|
||||
*
|
||||
* Fee for curator is deducted from curator fee of parent bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in "CuratorProposed" state, for processing the
|
||||
* call. And state of child-bounty is moved to "Active" on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
acceptCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Add a new child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be the curator of parent
|
||||
* bounty and the parent bounty must be in "active" state.
|
||||
*
|
||||
* Child-bounty gets added successfully & fund gets transferred from
|
||||
* parent bounty to child-bounty account, if parent bounty has enough
|
||||
* funds, else the call fails.
|
||||
*
|
||||
* Upper bound to maximum number of active child-bounties that can be
|
||||
* added are managed via runtime trait config
|
||||
* [`Config::MaxActiveChildBountyCount`].
|
||||
*
|
||||
* If the call is success, the status of child-bounty is updated to
|
||||
* "Added".
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty for which child-bounty is being added.
|
||||
* - `value`: Value for executing the proposal.
|
||||
* - `description`: Text description for the child-bounty.
|
||||
**/
|
||||
addChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u128>, Bytes]>;
|
||||
/**
|
||||
* Award child-bounty to a beneficiary.
|
||||
*
|
||||
* The beneficiary will be able to claim the funds after a delay.
|
||||
*
|
||||
* The dispatch origin for this call must be the master curator or
|
||||
* curator of this child-bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in active state, for processing the call. And
|
||||
* state of child-bounty is moved to "PendingPayout" on successful call
|
||||
* completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
* - `beneficiary`: Beneficiary account.
|
||||
**/
|
||||
awardChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress]>;
|
||||
/**
|
||||
* Claim the payout from an awarded child-bounty after payout delay.
|
||||
*
|
||||
* The dispatch origin for this call may be any signed origin.
|
||||
*
|
||||
* Call works independent of parent bounty state, No need for parent
|
||||
* bounty to be in active state.
|
||||
*
|
||||
* The Beneficiary is paid out with agreed bounty value. Curator fee is
|
||||
* paid & curator deposit is unreserved.
|
||||
*
|
||||
* Child-bounty must be in "PendingPayout" state, for processing the
|
||||
* call. And instance of child-bounty is removed from the state on
|
||||
* successful call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
claimChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Cancel a proposed or active child-bounty. Child-bounty account funds
|
||||
* are transferred to parent bounty account. The child-bounty curator
|
||||
* deposit may be unreserved if possible.
|
||||
*
|
||||
* The dispatch origin for this call must be either parent curator or
|
||||
* `T::RejectOrigin`.
|
||||
*
|
||||
* If the state of child-bounty is `Active`, curator deposit is
|
||||
* unreserved.
|
||||
*
|
||||
* If the state of child-bounty is `PendingPayout`, call fails &
|
||||
* returns `PendingPayout` error.
|
||||
*
|
||||
* For the origin other than T::RejectOrigin, parent bounty must be in
|
||||
* active state, for this child-bounty call to work. For origin
|
||||
* T::RejectOrigin execution is forced.
|
||||
*
|
||||
* Instance of child-bounty is removed from the state on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
closeChildBounty: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Propose curator for funded child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call must be curator of parent bounty.
|
||||
*
|
||||
* Parent bounty must be in active state, for this child-bounty call to
|
||||
* work.
|
||||
*
|
||||
* Child-bounty must be in "Added" state, for processing the call. And
|
||||
* state of child-bounty is moved to "CuratorProposed" on successful
|
||||
* call completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
* - `curator`: Address of child-bounty curator.
|
||||
* - `fee`: payment fee to child-bounty curator for execution.
|
||||
**/
|
||||
proposeCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array, curator: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, fee: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>, MultiAddress, Compact<u128>]>;
|
||||
/**
|
||||
* Unassign curator from a child-bounty.
|
||||
*
|
||||
* The dispatch origin for this call can be either `RejectOrigin`, or
|
||||
* the curator of the parent bounty, or any signed origin.
|
||||
*
|
||||
* For the origin other than T::RejectOrigin and the child-bounty
|
||||
* curator, parent-bounty must be in active state, for this call to
|
||||
* work. We allow child-bounty curator and T::RejectOrigin to execute
|
||||
* this call irrespective of the parent-bounty state.
|
||||
*
|
||||
* If this function is called by the `RejectOrigin` or the
|
||||
* parent-bounty curator, we assume that the child-bounty curator is
|
||||
* malicious or inactive. As a result, child-bounty curator deposit is
|
||||
* slashed.
|
||||
*
|
||||
* If the origin is the child-bounty curator, we take this as a sign
|
||||
* that they are unable to do their job, and are willingly giving up.
|
||||
* We could slash the deposit, but for now we allow them to unreserve
|
||||
* their deposit and exit without issue. (We may want to change this if
|
||||
* it is abused.)
|
||||
*
|
||||
* Finally, the origin can be anyone iff the child-bounty curator is
|
||||
* "inactive". Expiry update due of parent bounty is used to estimate
|
||||
* inactive state of child-bounty curator.
|
||||
*
|
||||
* This allows anyone in the community to call out that a child-bounty
|
||||
* curator is not doing their due diligence, and we should pick a new
|
||||
* one. In this case the child-bounty curator deposit is slashed.
|
||||
*
|
||||
* State of child-bounty is moved to Added state on successful call
|
||||
* completion.
|
||||
*
|
||||
* - `parent_bounty_id`: Index of parent bounty.
|
||||
* - `child_bounty_id`: Index of child bounty.
|
||||
**/
|
||||
unassignCurator: AugmentedSubmittable<(parentBountyId: Compact<u32> | AnyNumber | Uint8Array, childBountyId: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u32>, Compact<u32>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
contracts: {
|
||||
/**
|
||||
* Makes a call to an account, optionally transferring some balance.
|
||||
*
|
||||
* # Parameters
|
||||
*
|
||||
* * `dest`: Address of the contract to call.
|
||||
* * `value`: The balance to transfer from the `origin` to `dest`.
|
||||
* * `gas_limit`: The gas limit enforced when executing the constructor.
|
||||
* * `storage_deposit_limit`: The maximum amount of balance that can be charged from the
|
||||
* caller to pay for the storage consumed.
|
||||
* * `data`: The input data to pass to the contract.
|
||||
*
|
||||
* * If the account is a smart-contract account, the associated code will be
|
||||
* executed and any value will be transferred.
|
||||
* * If the account is a regular account, any value will be transferred.
|
||||
* * If no account exists and the call value is not less than `existential_deposit`,
|
||||
* a regular account will be created and any value will be transferred.
|
||||
**/
|
||||
call: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, gasLimit: Compact<u64> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>, Compact<u64>, Bytes]>;
|
||||
call: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array, gasLimit: Compact<u64> | AnyNumber | Uint8Array, storageDepositLimit: Option<Compact<u128>> | null | object | string | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>, Compact<u64>, Option<Compact<u128>>, Bytes]>;
|
||||
/**
|
||||
* Instantiates a contract from a previously deployed wasm binary.
|
||||
*
|
||||
@@ -706,17 +925,21 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* code deployment step. Instead, the `code_hash` of an on-chain deployed wasm binary
|
||||
* must be supplied.
|
||||
**/
|
||||
instantiate: AugmentedSubmittable<(endowment: Compact<u128> | AnyNumber | Uint8Array, gasLimit: Compact<u64> | AnyNumber | Uint8Array, codeHash: H256 | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, Compact<u64>, H256, Bytes, Bytes]>;
|
||||
instantiate: AugmentedSubmittable<(value: Compact<u128> | AnyNumber | Uint8Array, gasLimit: Compact<u64> | AnyNumber | Uint8Array, storageDepositLimit: Option<Compact<u128>> | null | object | string | Uint8Array, codeHash: H256 | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, Compact<u64>, Option<Compact<u128>>, H256, Bytes, Bytes]>;
|
||||
/**
|
||||
* Instantiates a new contract from the supplied `code` optionally transferring
|
||||
* some balance.
|
||||
*
|
||||
* This is the only function that can deploy new code to the chain.
|
||||
* This dispatchable has the same effect as calling [`Self::upload_code`] +
|
||||
* [`Self::instantiate`]. Bundling them together provides efficiency gains. Please
|
||||
* also check the documentation of [`Self::upload_code`].
|
||||
*
|
||||
* # Parameters
|
||||
*
|
||||
* * `endowment`: The balance to transfer from the `origin` to the newly created contract.
|
||||
* * `value`: The balance to transfer from the `origin` to the newly created contract.
|
||||
* * `gas_limit`: The gas limit enforced when executing the constructor.
|
||||
* * `storage_deposit_limit`: The maximum amount of balance that can be charged/reserved
|
||||
* from the caller to pay for the storage consumed.
|
||||
* * `code`: The contract code to deploy in raw bytes.
|
||||
* * `data`: The input data to pass to the contract constructor.
|
||||
* * `salt`: Used for the address derivation. See [`Pallet::contract_address`].
|
||||
@@ -728,10 +951,36 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - If the `code_hash` already exists on the chain the underlying `code` will be shared.
|
||||
* - The destination address is computed based on the sender, code_hash and the salt.
|
||||
* - The smart-contract account is created at the computed address.
|
||||
* - The `endowment` is transferred to the new account.
|
||||
* - The `value` is transferred to the new account.
|
||||
* - The `deploy` function is executed in the context of the newly-created account.
|
||||
**/
|
||||
instantiateWithCode: AugmentedSubmittable<(endowment: Compact<u128> | AnyNumber | Uint8Array, gasLimit: Compact<u64> | AnyNumber | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, Compact<u64>, Bytes, Bytes, Bytes]>;
|
||||
instantiateWithCode: AugmentedSubmittable<(value: Compact<u128> | AnyNumber | Uint8Array, gasLimit: Compact<u64> | AnyNumber | Uint8Array, storageDepositLimit: Option<Compact<u128>> | null | object | string | Uint8Array, code: Bytes | string | Uint8Array, data: Bytes | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Compact<u128>, Compact<u64>, Option<Compact<u128>>, Bytes, Bytes, Bytes]>;
|
||||
/**
|
||||
* Remove the code stored under `code_hash` and refund the deposit to its owner.
|
||||
*
|
||||
* A code can only be removed by its original uploader (its owner) and only if it is
|
||||
* not used by any contract.
|
||||
**/
|
||||
removeCode: AugmentedSubmittable<(codeHash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Upload new `code` without instantiating a contract from it.
|
||||
*
|
||||
* If the code does not already exist a deposit is reserved from the caller
|
||||
* and unreserved only when [`Self::remove_code`] is called. The size of the reserve
|
||||
* depends on the instrumented size of the the supplied `code`.
|
||||
*
|
||||
* If the code already exists in storage it will still return `Ok` and upgrades
|
||||
* the in storage version to the current
|
||||
* [`InstructionWeights::version`](InstructionWeights).
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* Anyone can instantiate a contract from any uploaded code and thus prevent its removal.
|
||||
* To avoid this situation a constructor could employ access control so that it can
|
||||
* only be instantiated by permissioned entities. The same is true when uploading
|
||||
* through [`Self::instantiate_with_code`].
|
||||
**/
|
||||
uploadCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array, storageDepositLimit: Option<Compact<u128>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, Option<Compact<u128>>]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -847,6 +1096,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but
|
||||
* the weight estimations rely on it to estimate dispatchable weight.
|
||||
*
|
||||
* # WARNING:
|
||||
*
|
||||
* The `pallet-collective` can also be managed by logic outside of the pallet through the
|
||||
* implementation of the trait [`ChangeMembers`].
|
||||
* Any call to `set_members` must be careful that the member set doesn't get out of sync
|
||||
* with other logic managing the member set.
|
||||
*
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(MP + N)` where:
|
||||
@@ -2064,6 +2320,36 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
preimage: {
|
||||
/**
|
||||
* Register a preimage on-chain.
|
||||
*
|
||||
* If the preimage was previously requested, no fees or deposits are taken for providing
|
||||
* the preimage. Otherwise, a deposit is taken proportional to the size of the preimage.
|
||||
**/
|
||||
notePreimage: AugmentedSubmittable<(bytes: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Request a preimage be uploaded to the chain without paying any fees or deposits.
|
||||
*
|
||||
* If the preimage requests has already been provided on-chain, we unreserve any deposit
|
||||
* a user may have paid, and take the control of the preimage out of their hands.
|
||||
**/
|
||||
requestPreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Clear an unrequested preimage from the runtime storage.
|
||||
**/
|
||||
unnotePreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Clear a previously made request for a preimage.
|
||||
*
|
||||
* NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`.
|
||||
**/
|
||||
unrequestPreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H256]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
proxy: {
|
||||
/**
|
||||
* Register a proxy account for the sender that is able to make calls on its behalf.
|
||||
@@ -2469,43 +2755,16 @@ declare module '@polkadot/api/types/submittable' {
|
||||
scheduler: {
|
||||
/**
|
||||
* Cancel an anonymously scheduled task.
|
||||
*
|
||||
* # <weight>
|
||||
* - S = Number of already scheduled calls
|
||||
* - Base Weight: 22.15 + 2.869 * S µs
|
||||
* - DB Weight:
|
||||
* - Read: Agenda
|
||||
* - Write: Agenda, Lookup
|
||||
* - Will use base weight of 100 which should be good for up to 30 scheduled calls
|
||||
* # </weight>
|
||||
**/
|
||||
cancel: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, index: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, u32]>;
|
||||
/**
|
||||
* Cancel a named scheduled task.
|
||||
*
|
||||
* # <weight>
|
||||
* - S = Number of already scheduled calls
|
||||
* - Base Weight: 24.91 + 2.907 * S µs
|
||||
* - DB Weight:
|
||||
* - Read: Agenda, Lookup
|
||||
* - Write: Agenda, Lookup
|
||||
* - Will use base weight of 100 which should be good for up to 30 scheduled calls
|
||||
* # </weight>
|
||||
**/
|
||||
cancelNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Anonymously schedule a task.
|
||||
*
|
||||
* # <weight>
|
||||
* - S = Number of already scheduled calls
|
||||
* - Base Weight: 22.29 + .126 * S µs
|
||||
* - DB Weight:
|
||||
* - Read: Agenda
|
||||
* - Write: Agenda
|
||||
* - Will use base weight of 25 which should be good for up to 30 scheduled calls
|
||||
* # </weight>
|
||||
**/
|
||||
schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
|
||||
schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
|
||||
/**
|
||||
* Anonymously schedule a task after a delay.
|
||||
*
|
||||
@@ -2513,20 +2772,11 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Same as [`schedule`].
|
||||
* # </weight>
|
||||
**/
|
||||
scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
|
||||
scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
|
||||
/**
|
||||
* Schedule a named task.
|
||||
*
|
||||
* # <weight>
|
||||
* - S = Number of already scheduled calls
|
||||
* - Base Weight: 29.6 + .159 * S µs
|
||||
* - DB Weight:
|
||||
* - Read: Agenda, Lookup
|
||||
* - Write: Agenda, Lookup
|
||||
* - Will use base weight of 35 which should be good for more than 30 scheduled calls
|
||||
* # </weight>
|
||||
**/
|
||||
scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
|
||||
scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
|
||||
/**
|
||||
* Schedule a named task after a delay.
|
||||
*
|
||||
@@ -2534,7 +2784,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Same as [`schedule_named`](Self::schedule_named).
|
||||
* # </weight>
|
||||
**/
|
||||
scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, Call]>;
|
||||
scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option<ITuple<[u32, u32]>> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32, Option<ITuple<[u32, u32]>>, u8, FrameSupportScheduleMaybeHashed]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -2543,13 +2793,17 @@ declare module '@polkadot/api/types/submittable' {
|
||||
session: {
|
||||
/**
|
||||
* Removes any session key(s) of the function caller.
|
||||
*
|
||||
* This doesn't take effect until the next session.
|
||||
*
|
||||
* The dispatch origin of this function must be signed.
|
||||
* The dispatch origin of this function must be Signed and the account must be either be
|
||||
* convertible to a validator ID using the chain's typical addressing system (this usually
|
||||
* means being a controller account) or directly convertible into a validator ID (which
|
||||
* usually means being a stash account).
|
||||
*
|
||||
* # <weight>
|
||||
* - Complexity: `O(1)` in number of key types.
|
||||
* Actual cost depends on the number of length of `T::Keys::key_ids()` which is fixed.
|
||||
* - Complexity: `O(1)` in number of key types. Actual cost depends on the number of length
|
||||
* of `T::Keys::key_ids()` which is fixed.
|
||||
* - DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`
|
||||
* - DbWrites: `NextKeys`, `origin account`
|
||||
* - DbWrites per key id: `KeyOwner`
|
||||
@@ -2564,8 +2818,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* The dispatch origin of this function must be signed.
|
||||
*
|
||||
* # <weight>
|
||||
* - Complexity: `O(1)`
|
||||
* Actual cost depends on the number of length of `T::Keys::key_ids()` which is fixed.
|
||||
* - Complexity: `O(1)`. Actual cost depends on the number of length of
|
||||
* `T::Keys::key_ids()` which is fixed.
|
||||
* - DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`
|
||||
* - DbWrites: `origin account`, `NextKeys`
|
||||
* - DbReads per key id: `KeyOwner`
|
||||
@@ -2599,12 +2853,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - One storage read to retrieve all current candidates. O(C)
|
||||
* - One storage read to retrieve all members. O(M)
|
||||
* - Storage Writes:
|
||||
* - One storage mutate to add a new bid to the vector O(B) (TODO: possible optimization w/ read)
|
||||
* - One storage mutate to add a new bid to the vector O(B) (TODO: possible optimization
|
||||
* w/ read)
|
||||
* - Up to one storage removal if bid.len() > MAX_BID_COUNT. O(1)
|
||||
* - Notable Computation:
|
||||
* - O(B + C + log M) search to check user is not already a part of society.
|
||||
* - O(log B) search to insert the new bid sorted.
|
||||
* - External Module Operations:
|
||||
* - External Pallet Operations:
|
||||
* - One balance reserve operation. O(X)
|
||||
* - Up to one balance unreserve operation if bids.len() > MAX_BID_COUNT.
|
||||
* - Events:
|
||||
@@ -2638,7 +2893,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* Found the society.
|
||||
*
|
||||
* This is done as a discrete action in order to allow for the
|
||||
* module to be included into a running chain and can only be done once.
|
||||
* pallet to be included into a running chain and can only be done once.
|
||||
*
|
||||
* The dispatch origin for this call must be from the _FounderSetOrigin_.
|
||||
*
|
||||
@@ -2712,13 +2967,14 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Parameters:
|
||||
* - `who` - The suspended member to be judged.
|
||||
* - `forgive` - A boolean representing whether the suspension judgement origin
|
||||
* forgives (`true`) or rejects (`false`) a suspended member.
|
||||
* - `forgive` - A boolean representing whether the suspension judgement origin forgives
|
||||
* (`true`) or rejects (`false`) a suspended member.
|
||||
*
|
||||
* # <weight>
|
||||
* Key: B (len of bids), M (len of members)
|
||||
* - One storage read to check `who` is a suspended member. O(1)
|
||||
* - Up to one storage write O(M) with O(log M) binary search to add a member back to society.
|
||||
* - Up to one storage write O(M) with O(log M) binary search to add a member back to
|
||||
* society.
|
||||
* - Up to 3 storage removals O(1) to clean up a removed member.
|
||||
* - Up to one storage write O(B) with O(B) search to remove vouched bid from bids.
|
||||
* - Up to one additional event if unvouch takes place.
|
||||
@@ -2732,7 +2988,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
/**
|
||||
* Transfer the first matured payout for the sender and remove it from the records.
|
||||
*
|
||||
* NOTE: This extrinsic needs to be called multiple times to claim multiple matured payouts.
|
||||
* NOTE: This extrinsic needs to be called multiple times to claim multiple matured
|
||||
* payouts.
|
||||
*
|
||||
* Payment: The member will receive a payment equal to their first matured
|
||||
* payout to their free balance.
|
||||
@@ -2834,8 +3091,8 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* Parameters:
|
||||
* - `candidate`: The candidate that the member would like to bid on.
|
||||
* - `approve`: A boolean which says if the candidate should be
|
||||
* approved (`true`) or rejected (`false`).
|
||||
* - `approve`: A boolean which says if the candidate should be approved (`true`) or
|
||||
* rejected (`false`).
|
||||
*
|
||||
* # <weight>
|
||||
* Key: C (len of candidates), M (len of members)
|
||||
@@ -2879,13 +3136,14 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* - One storage read to retrieve all current candidates. O(C)
|
||||
* - Storage Writes:
|
||||
* - One storage write to insert vouching status to the member. O(1)
|
||||
* - One storage mutate to add a new bid to the vector O(B) (TODO: possible optimization w/ read)
|
||||
* - One storage mutate to add a new bid to the vector O(B) (TODO: possible optimization
|
||||
* w/ read)
|
||||
* - Up to one storage removal if bid.len() > MAX_BID_COUNT. O(1)
|
||||
* - Notable Computation:
|
||||
* - O(log M) search to check sender is a member.
|
||||
* - O(B + C + log M) search to check user is not already a part of society.
|
||||
* - O(log B) search to insert the new bid sorted.
|
||||
* - External Module Operations:
|
||||
* - External Pallet Operations:
|
||||
* - One balance reserve operation. O(X)
|
||||
* - Up to one balance unreserve operation if bids.len() > MAX_BID_COUNT.
|
||||
* - Events:
|
||||
@@ -3124,22 +3382,18 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
payoutStakers: AugmentedSubmittable<(validatorStash: AccountId32 | string | Uint8Array, era: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
|
||||
/**
|
||||
* Remove all data structure concerning a staker/stash once its balance is at the minimum.
|
||||
* This is essentially equivalent to `withdraw_unbonded` except it can be called by anyone
|
||||
* and the target `stash` must have no funds left beyond the ED.
|
||||
* Remove all data structures concerning a staker/stash once it is at a state where it can
|
||||
* be considered `dust` in the staking system. The requirements are:
|
||||
*
|
||||
* This can be called from any origin.
|
||||
* 1. the `total_balance` of the stash is below existential deposit.
|
||||
* 2. or, the `ledger.total` of the stash is below existential deposit.
|
||||
*
|
||||
* - `stash`: The stash account to reap. Its balance must be zero.
|
||||
* The former can happen in cases like a slash; the latter when a fully unbonded account
|
||||
* is still receiving staking rewards in `RewardDestination::Staked`.
|
||||
*
|
||||
* # <weight>
|
||||
* Complexity: O(S) where S is the number of slashing spans on the account.
|
||||
* DB Weight:
|
||||
* - Reads: Stash Account, Bonded, Slashing Spans, Locks
|
||||
* - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,
|
||||
* Stash Account, Locks
|
||||
* - Writes Each: SpanSlash * S
|
||||
* # </weight>
|
||||
* It can be called by anyone, as long as `stash` meets the above requirements.
|
||||
*
|
||||
* Refunds the transaction fees upon successful execution.
|
||||
**/
|
||||
reapStash: AugmentedSubmittable<(stash: AccountId32 | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [AccountId32, u32]>;
|
||||
/**
|
||||
@@ -3239,7 +3493,7 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
setPayee: AugmentedSubmittable<(payee: PalletStakingRewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | { None: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletStakingRewardDestination]>;
|
||||
/**
|
||||
* Update the various staking limits this pallet.
|
||||
* Update the various staking configurations .
|
||||
*
|
||||
* * `min_nominator_bond`: The minimum active bond needed to be a nominator.
|
||||
* * `min_validator_bond`: The minimum active bond needed to be a validator.
|
||||
@@ -3247,13 +3501,17 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* set to `None`, no limit is enforced.
|
||||
* * `max_validator_count`: The max number of users who can be a validator at once. When
|
||||
* set to `None`, no limit is enforced.
|
||||
* * `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which
|
||||
* should be filled in order for the `chill_other` transaction to work.
|
||||
* * `min_commission`: The minimum amount of commission that each validators must maintain.
|
||||
* This is checked only upon calling `validate`. Existing validators are not affected.
|
||||
*
|
||||
* Origin must be Root to call this function.
|
||||
*
|
||||
* NOTE: Existing nominators and validators will not be affected by this update.
|
||||
* to kick people under the new limits, `chill_other` should be called.
|
||||
**/
|
||||
setStakingLimits: AugmentedSubmittable<(minNominatorBond: u128 | AnyNumber | Uint8Array, minValidatorBond: u128 | AnyNumber | Uint8Array, maxNominatorCount: Option<u32> | null | object | string | Uint8Array, maxValidatorCount: Option<u32> | null | object | string | Uint8Array, threshold: Option<Percent> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u128, Option<u32>, Option<u32>, Option<Percent>]>;
|
||||
setStakingConfigs: AugmentedSubmittable<(minNominatorBond: u128 | AnyNumber | Uint8Array, minValidatorBond: u128 | AnyNumber | Uint8Array, maxNominatorCount: Option<u32> | null | object | string | Uint8Array, maxValidatorCount: Option<u32> | null | object | string | Uint8Array, chillThreshold: Option<Percent> | null | object | string | Uint8Array, minCommission: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u128, Option<u32>, Option<u32>, Option<Percent>, Perbill]>;
|
||||
/**
|
||||
* Sets the ideal number of validators.
|
||||
*
|
||||
@@ -3387,24 +3645,10 @@ declare module '@polkadot/api/types/submittable' {
|
||||
*
|
||||
* **NOTE:** We rely on the Root origin to provide us the number of subkeys under
|
||||
* the prefix we are removing to accurately calculate the weight of this function.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(P)` where `P` amount of keys with prefix `prefix`
|
||||
* - `P` storage deletions.
|
||||
* - Base Weight: 0.834 * P µs
|
||||
* - Writes: Number of subkeys + 1
|
||||
* # </weight>
|
||||
**/
|
||||
killPrefix: AugmentedSubmittable<(prefix: Bytes | string | Uint8Array, subkeys: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32]>;
|
||||
/**
|
||||
* Kill some items from storage.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(IK)` where `I` length of `keys` and `K` length of one key
|
||||
* - `I` storage deletions.
|
||||
* - Base Weight: .378 * i µs
|
||||
* - Writes: Number of items
|
||||
* # </weight>
|
||||
**/
|
||||
killStorage: AugmentedSubmittable<(keys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>]>;
|
||||
/**
|
||||
@@ -3424,19 +3668,6 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # </weight>
|
||||
**/
|
||||
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Set the new changes trie configuration.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(1)`
|
||||
* - 1 storage write or delete (codec `O(1)`).
|
||||
* - 1 call to `deposit_log`: Uses `append` API, so O(1)
|
||||
* - Base Weight: 7.218 µs
|
||||
* - DB Weight:
|
||||
* - Writes: Changes Trie, System Digest
|
||||
* # </weight>
|
||||
**/
|
||||
setChangesTrieConfig: AugmentedSubmittable<(changesTrieConfig: Option<SpCoreChangesTrieChangesTrieConfiguration> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<SpCoreChangesTrieChangesTrieConfiguration>]>;
|
||||
/**
|
||||
* Set the new runtime code.
|
||||
*
|
||||
@@ -3466,25 +3697,10 @@ declare module '@polkadot/api/types/submittable' {
|
||||
setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
|
||||
/**
|
||||
* Set the number of pages in the WebAssembly environment's heap.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(1)`
|
||||
* - 1 storage write.
|
||||
* - Base Weight: 1.405 µs
|
||||
* - 1 write to HEAP_PAGES
|
||||
* - 1 digest item
|
||||
* # </weight>
|
||||
**/
|
||||
setHeapPages: AugmentedSubmittable<(pages: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64]>;
|
||||
/**
|
||||
* Set some items of storage.
|
||||
*
|
||||
* # <weight>
|
||||
* - `O(I)` where `I` length of `items`
|
||||
* - `I` storage writes (`O(1)`).
|
||||
* - Base Weight: 0.568 * i µs
|
||||
* - Writes: Number of items
|
||||
* # </weight>
|
||||
**/
|
||||
setStorage: AugmentedSubmittable<(items: Vec<ITuple<[Bytes, Bytes]>> | ([Bytes | string | Uint8Array, Bytes | string | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[Bytes, Bytes]>>]>;
|
||||
/**
|
||||
@@ -3602,6 +3818,13 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but
|
||||
* the weight estimations rely on it to estimate dispatchable weight.
|
||||
*
|
||||
* # WARNING:
|
||||
*
|
||||
* The `pallet-collective` can also be managed by logic outside of the pallet through the
|
||||
* implementation of the trait [`ChangeMembers`].
|
||||
* Any call to `set_members` must be careful that the member set doesn't get out of sync
|
||||
* with other logic managing the member set.
|
||||
*
|
||||
* # <weight>
|
||||
* ## Weight
|
||||
* - `O(MP + N)` where:
|
||||
@@ -4360,6 +4583,19 @@ declare module '@polkadot/api/types/submittable' {
|
||||
* # </weight>
|
||||
**/
|
||||
batchAll: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Call>]>;
|
||||
/**
|
||||
* Dispatches a function call with a provided origin.
|
||||
*
|
||||
* The dispatch origin for this call must be _Root_.
|
||||
*
|
||||
* # <weight>
|
||||
* - O(1).
|
||||
* - Limited storage reads.
|
||||
* - One DB write (event).
|
||||
* - Weight of derivative `call` execution + T::WeightInfo::dispatch_as().
|
||||
* # </weight>
|
||||
**/
|
||||
dispatchAs: AugmentedSubmittable<(asOrigin: NodeRuntimeOriginCaller | { system: any } | { Void: any } | { Council: any } | { TechnicalCommittee: any } | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [NodeRuntimeOriginCaller, Call]>;
|
||||
/**
|
||||
* Generic tx
|
||||
**/
|
||||
@@ -4470,10 +4706,5 @@ declare module '@polkadot/api/types/submittable' {
|
||||
**/
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SubmittableExtrinsics<ApiType extends ApiTypes> extends AugmentedSubmittables<ApiType> {
|
||||
(extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType>;
|
||||
[key: string]: SubmittableModuleExtrinsics<ApiType>;
|
||||
}
|
||||
}
|
||||
} // AugmentedSubmittables
|
||||
} // declare module
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './augment';
|
||||
|
||||
export { packageInfo } from './packageInfo';
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { packageInfo as baseInfo } from '@polkadot/api-base/packageInfo';
|
||||
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
|
||||
import { packageInfo as codecInfo } from '@polkadot/types-codec/packageInfo';
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [baseInfo, typesInfo, codecInfo]);
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/api-augment authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', version: '7.0.2' };
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-augment" }
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,3 @@
|
||||
# @polkadot/api-base
|
||||
|
||||
API Base interfaces
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"contributors": [],
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-base#readme",
|
||||
"license": "Apache-2.0",
|
||||
"maintainers": [],
|
||||
"name": "@polkadot/api-base",
|
||||
"repository": {
|
||||
"directory": "packages/api-base",
|
||||
"type": "git",
|
||||
"url": "https://github.com/polkadot-js/api.git"
|
||||
},
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.0.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.5",
|
||||
"@polkadot/rpc-core": "7.0.2",
|
||||
"@polkadot/types": "7.0.2",
|
||||
"@polkadot/util": "^8.2.2",
|
||||
"rxjs": "^7.4.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { packageInfo } from './packageInfo';
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { packageInfo as rpcInfo } from '@polkadot/rpc-core/packageInfo';
|
||||
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
|
||||
import { detectPackage } from '@polkadot/util';
|
||||
|
||||
import { packageInfo } from './packageInfo';
|
||||
|
||||
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [rpcInfo, typesInfo]);
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import './detectPackage';
|
||||
|
||||
export * from './bundle';
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', version: '7.0.2' };
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '@polkadot/api-base/types';
|
||||
import type { RpcInterface } from '@polkadot/rpc-core/types';
|
||||
import type { Metadata } from '@polkadot/types';
|
||||
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
|
||||
import type { Registry, Signer } from '@polkadot/types/types';
|
||||
|
||||
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
|
||||
export interface ApiInterfaceRx {
|
||||
consts: QueryableConsts<'rxjs'>;
|
||||
extrinsicType: number;
|
||||
genesisHash?: Hash;
|
||||
hasSubscriptions: boolean;
|
||||
registry: Registry;
|
||||
runtimeMetadata: Metadata;
|
||||
runtimeVersion: RuntimeVersion;
|
||||
query: QueryableStorage<'rxjs'>;
|
||||
queryAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableStorage<'rxjs'>>;
|
||||
queryMulti: QueryableStorageMulti<'rxjs'>;
|
||||
rpc: DecoratedRpc<'rxjs', RpcInterface>;
|
||||
tx: SubmittableExtrinsics<'rxjs'>;
|
||||
signer?: Signer;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/api authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
@@ -17,10 +17,15 @@ export type VoidFn = () => void;
|
||||
|
||||
export type UnsubscribePromise = Promise<VoidFn>;
|
||||
|
||||
// FIXME The day TS has higher-kinded types, we can remove this hardcoded stuff
|
||||
export type PromiseOrObs<ApiType extends ApiTypes, T> = ApiType extends 'rxjs'
|
||||
? Observable<T>
|
||||
: Promise<T>;
|
||||
export type PromiseOrObs<ApiType extends ApiTypes, T> =
|
||||
ApiType extends 'rxjs'
|
||||
? Observable<T>
|
||||
: Promise<T>;
|
||||
|
||||
export type MethodResult<ApiType extends ApiTypes, F extends AnyFunction> =
|
||||
ApiType extends 'rxjs'
|
||||
? RxResult<F>
|
||||
: PromiseResult<F>;
|
||||
|
||||
// Here are the return types of these parts of the api:
|
||||
// - api.query.*.*: no exact typings
|
||||
@@ -39,15 +44,9 @@ export interface PromiseResult<F extends AnyFunction> {
|
||||
(...args: Parameters<F>): Promise<ObsInnerType<ReturnType<F>>>;
|
||||
(...args: Push<Parameters<F>, Callback<ObsInnerType<ReturnType<F>>>>): UnsubscribePromise;
|
||||
<T extends Codec | Codec[]>(...args: Parameters<F>): Promise<T>;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
<T extends Codec | Codec[]>(...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
|
||||
}
|
||||
|
||||
// FIXME The day TS has higher-kinded types, we can remove this hardcoded stuff
|
||||
export type MethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
|
||||
? RxResult<F>
|
||||
: PromiseResult<F>;
|
||||
|
||||
// In the abstract `decorateMethod` in Base.ts, we can also pass in some meta-
|
||||
// information. This describes it.
|
||||
export interface DecorateMethodOptions {
|
||||
@@ -64,4 +63,5 @@ export interface PaginationOptions<A = unknown> {
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type DecorateMethod<ApiType extends ApiTypes> = <Method extends (...args: any[]) => Observable<any>>(method: Method, options?: DecorateMethodOptions) => any;
|
||||
export type DecorateMethod<ApiType extends ApiTypes, T = any> =
|
||||
<M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { PalletConstantMetadataLatest } from '@polkadot/types/interfaces';
|
||||
import type { Codec } from '@polkadot/types/types';
|
||||
import type { ApiTypes } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedConsts<ApiType extends ApiTypes> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
|
||||
// when non-augmented, we need to at least have Codec results
|
||||
[key: string]: QueryableModuleConsts;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export interface AugmentedConst<ApiType extends ApiTypes> {
|
||||
meta: PalletConstantMetadataLatest;
|
||||
}
|
||||
|
||||
export interface QueryableModuleConsts {
|
||||
[key: string]: Codec;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
|
||||
type DeriveCreator = (instanceId: string, api: unknown) => (...args: unknown[]) => Observable<any>;
|
||||
|
||||
export type DeriveCustom = Record<string, Record<string, DeriveCreator>>;
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { IsError } from '@polkadot/types/metadata/decorate/types';
|
||||
import type { ApiTypes } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedErrors<ApiType extends ApiTypes> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
export interface DecoratedErrors<ApiType extends ApiTypes> extends AugmentedErrors<ApiType> {
|
||||
// when non-augmented, we need to at least have Codec results
|
||||
[key: string]: ModuleErrors<ApiType>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedError<ApiType extends ApiTypes> = IsError;
|
||||
|
||||
export interface ModuleErrors<ApiType extends ApiTypes> {
|
||||
[key: string]: AugmentedError<ApiType>;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { IsEvent } from '@polkadot/types/metadata/decorate/types';
|
||||
import type { AnyTuple } from '@polkadot/types/types';
|
||||
import type { ApiTypes } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedEvents<ApiType extends ApiTypes> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
export interface DecoratedEvents<ApiType extends ApiTypes> extends AugmentedEvents<ApiType> {
|
||||
// when non-augmented, we need to at least have Codec results
|
||||
[key: string]: ModuleEvents<ApiType>;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export type AugmentedEvent<ApiType extends ApiTypes, T extends AnyTuple = AnyTuple> = IsEvent<T>;
|
||||
|
||||
export interface ModuleEvents<ApiType extends ApiTypes> {
|
||||
[key: string]: AugmentedEvent<ApiType, AnyTuple>;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright 2017-2021 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// These are augmented, do an augmentation export
|
||||
export * from '@polkadot/api-base/types/consts';
|
||||
export * from '@polkadot/api-base/types/errors';
|
||||
export * from '@polkadot/api-base/types/events';
|
||||
export * from '@polkadot/api-base/types/storage';
|
||||
export * from '@polkadot/api-base/types/submittable';
|
||||
|
||||
// normal exports
|
||||
export * from './api';
|
||||
export * from './base';
|
||||
export * from './derive';
|
||||
export * from './rpc';
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AnyFunction, Callback, DefinitionRpc } from '@polkadot/types/types';
|
||||
|
||||
import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base';
|
||||
|
||||
export type { AugmentedRpc } from '@polkadot/rpc-core/types';
|
||||
|
||||
export interface RxRpcResult<F extends AnyFunction> extends RxResult<F> {
|
||||
raw <T> (...args: Parameters<F>): Observable<T>;
|
||||
meta: DefinitionRpc;
|
||||
}
|
||||
|
||||
export interface PromiseRpcResult<F extends AnyFunction> extends PromiseResult<F> {
|
||||
raw <T> (...args: Parameters<F>): Promise<T>;
|
||||
raw <T> (...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
|
||||
meta: DefinitionRpc;
|
||||
}
|
||||
|
||||
export type RpcMethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
|
||||
? RxRpcResult<F>
|
||||
: PromiseRpcResult<F>;
|
||||
|
||||
export type DecoratedRpcSection<ApiType extends ApiTypes, Section> = {
|
||||
[M in keyof Section]: Section[M] extends AnyFunction
|
||||
? RpcMethodResult<ApiType, Section[M]>
|
||||
: never
|
||||
}
|
||||
|
||||
export type DecoratedRpc<ApiType extends ApiTypes, AllSections> = {
|
||||
[S in keyof AllSections]: DecoratedRpcSection<ApiType, AllSections[S]>
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { StorageKey, u64 } from '@polkadot/types';
|
||||
import type { Hash } from '@polkadot/types/interfaces';
|
||||
import type { StorageEntry } from '@polkadot/types/primitive/types';
|
||||
import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@polkadot/types/types';
|
||||
import type { ApiTypes, DropLast, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedQueries<ApiType extends ApiTypes> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
|
||||
// when non-augmented, we need to at least have Codec results
|
||||
[key: string]: QueryableModuleStorage<ApiType>;
|
||||
}
|
||||
|
||||
export interface QueryableStorageAt<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
|
||||
[key: string]: QueryableModuleStorageAt<ApiType>;
|
||||
}
|
||||
|
||||
type AsCodec<R extends Codec | any> = R extends Codec
|
||||
? R
|
||||
: Codec;
|
||||
|
||||
type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
|
||||
|
||||
interface StorageEntryObservableMulti<R extends Codec = Codec> {
|
||||
<T extends Codec = R>(args: (unknown[] | unknown)[]): Observable<T[]>;
|
||||
}
|
||||
|
||||
interface StorageEntryPromiseMulti<R extends Codec = Codec> {
|
||||
<T extends Codec = R>(args: (unknown[] | unknown)[]): Promise<T[]>;
|
||||
<T extends Codec = R>(args: (unknown[] | unknown)[], callback: Callback<T[]>): UnsubscribePromise;
|
||||
}
|
||||
|
||||
export interface StorageEntryPromiseOverloads {
|
||||
(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<Codec>;
|
||||
<T extends Codec>(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<T>;
|
||||
<T extends Codec>(callback: Callback<T>): UnsubscribePromise;
|
||||
<T extends Codec>(arg: unknown, callback: Callback<T>): UnsubscribePromise;
|
||||
<T extends Codec>(arg1: unknown, arg2: unknown, callback: Callback<T>): UnsubscribePromise;
|
||||
<T extends Codec>(arg1: unknown, arg2: unknown, arg3: unknown, callback: Callback<T>): UnsubscribePromise;
|
||||
}
|
||||
|
||||
export interface StorageEntryPromiseOverloadsAt {
|
||||
(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<Codec>;
|
||||
<T extends Codec>(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<T>;
|
||||
}
|
||||
|
||||
// This is the most generic typings we can have for a storage entry function
|
||||
export type GenericStorageEntryFunction = (...args: unknown[]) => Observable<Codec>
|
||||
|
||||
export type QueryableStorageEntry<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> =
|
||||
ApiType extends 'rxjs'
|
||||
? AugmentedQuery<'rxjs', GenericStorageEntryFunction, A>
|
||||
: AugmentedQuery<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloads;
|
||||
|
||||
export type QueryableStorageEntryAt<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> =
|
||||
ApiType extends 'rxjs'
|
||||
? AugmentedQueryAt<'rxjs', GenericStorageEntryFunction, A>
|
||||
: AugmentedQueryAt<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloadsAt;
|
||||
|
||||
export interface StorageEntryBase<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> extends StorageEntryBaseAt<ApiType, F, A> {
|
||||
/**
|
||||
* @deprecated Use api.at(<blockHash>)
|
||||
*/
|
||||
at: <T extends Codec | any = ReturnCodec<F>>(hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, T>;
|
||||
creator: StorageEntry;
|
||||
/**
|
||||
* @deprecated Use api.at(<blockHash>)
|
||||
*/
|
||||
entriesAt: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
|
||||
entriesPaged: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
|
||||
/**
|
||||
* @deprecated Use api.at(<blockHash>)
|
||||
*/
|
||||
keysAt: <K extends AnyTuple = A> (hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
|
||||
keysPaged: <K extends AnyTuple = A> (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
|
||||
/**
|
||||
* @deprecated The underlying RPC this been marked unsafe and is generally not exposed
|
||||
*/
|
||||
range: <T extends Codec | any = ReturnCodec<F>>([from, to]: [Hash | Uint8Array | string, Hash | Uint8Array | string | undefined] | [Hash | Uint8Array | string], ...args: Parameters<F>) => PromiseOrObs<ApiType, [Hash, T][]>;
|
||||
/**
|
||||
* @deprecated Use api.at(<blockHash>)
|
||||
*/
|
||||
sizeAt: (hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
|
||||
multi: ApiType extends 'rxjs'
|
||||
? StorageEntryObservableMulti<ReturnCodec<F>>
|
||||
: StorageEntryPromiseMulti<ReturnCodec<F>>;
|
||||
}
|
||||
|
||||
export interface StorageEntryBaseAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> {
|
||||
entries: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
|
||||
hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>;
|
||||
is: (key: IStorageKey<AnyTuple>) => key is IStorageKey<A>;
|
||||
key: (...args: Parameters<F>) => string;
|
||||
keyPrefix: (...args: DropLast<Parameters<F>>) => string;
|
||||
keys: <K extends AnyTuple = A> (...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
|
||||
size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
|
||||
}
|
||||
|
||||
export interface QueryableModuleStorage<ApiType extends ApiTypes> {
|
||||
[key: string]: QueryableStorageEntry<ApiType, AnyTuple>;
|
||||
}
|
||||
|
||||
export interface QueryableModuleStorageAt<ApiType extends ApiTypes> {
|
||||
[key: string]: QueryableStorageEntryAt<ApiType, AnyTuple>;
|
||||
}
|
||||
|
||||
export type QueryableStorageMultiArg<ApiType extends ApiTypes> =
|
||||
QueryableStorageEntry<ApiType> |
|
||||
[QueryableStorageEntry<ApiType>, ...unknown[]];
|
||||
|
||||
export interface QueryableStorageMultiBase<ApiType extends ApiTypes> {
|
||||
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Observable<T>;
|
||||
}
|
||||
|
||||
export interface QueryableStorageMultiPromise<ApiType extends ApiTypes> {
|
||||
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[], callback: Callback<T>): UnsubscribePromise;
|
||||
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Promise<T>;
|
||||
}
|
||||
|
||||
export type QueryableStorageMulti<ApiType extends ApiTypes> =
|
||||
ApiType extends 'rxjs'
|
||||
? QueryableStorageMultiBase<ApiType>
|
||||
: QueryableStorageMultiPromise<ApiType>;
|
||||
|
||||
export type AugmentedQuery<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBase<ApiType, F, A>;
|
||||
|
||||
export type AugmentedQueryAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBaseAt<ApiType, F, A>;
|
||||
|
||||
// backwards compatibility-only
|
||||
export type AugmentedQueryDoubleMap<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = AugmentedQuery<ApiType, F, A>;
|
||||
@@ -0,0 +1,93 @@
|
||||
// Copyright 2017-2021 @polkadot/api-base authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AccountId, Address, ApplyExtrinsicResult, Call, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces';
|
||||
import type { AnyFunction, AnyNumber, AnyTuple, Callback, CallBase, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@polkadot/types/types';
|
||||
import type { ApiTypes, PromiseOrObs } from './base';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
|
||||
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
|
||||
// augmented
|
||||
}
|
||||
|
||||
export interface SubmittableExtrinsics<ApiType extends ApiTypes> extends AugmentedSubmittables<ApiType> {
|
||||
(extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType>;
|
||||
// when non-augmented, we need to at least have Codec results
|
||||
[key: string]: SubmittableModuleExtrinsics<ApiType>;
|
||||
}
|
||||
|
||||
export type AddressOrPair = IKeyringPair | string | AccountId | Address;
|
||||
|
||||
export type AugmentedSubmittable<T extends AnyFunction, A extends AnyTuple = AnyTuple> = T & CallBase<A>;
|
||||
|
||||
export interface SignerOptions {
|
||||
blockHash: Uint8Array | string;
|
||||
era?: IExtrinsicEra | number;
|
||||
nonce: AnyNumber | Codec;
|
||||
signer?: Signer;
|
||||
tip?: AnyNumber;
|
||||
assetId?: AnyNumber;
|
||||
}
|
||||
|
||||
export type SubmittableDryRunResult<ApiType extends ApiTypes> =
|
||||
ApiType extends 'rxjs'
|
||||
? Observable<ApplyExtrinsicResult>
|
||||
: Promise<ApplyExtrinsicResult>;
|
||||
|
||||
export interface SubmittableExtrinsicFunction<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> extends CallBase<A> {
|
||||
(...params: any[]): SubmittableExtrinsic<ApiType>;
|
||||
}
|
||||
|
||||
export interface SubmittableModuleExtrinsics<ApiType extends ApiTypes> {
|
||||
// only with is<Type> augmentation
|
||||
[key: string]: SubmittableExtrinsicFunction<ApiType>;
|
||||
}
|
||||
|
||||
export type SubmittablePaymentResult<ApiType extends ApiTypes> =
|
||||
ApiType extends 'rxjs'
|
||||
? Observable<RuntimeDispatchInfo>
|
||||
: Promise<RuntimeDispatchInfo>;
|
||||
|
||||
export type SubmittableResultResult<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> =
|
||||
ApiType extends 'rxjs'
|
||||
? Observable<R>
|
||||
: Promise<Hash>;
|
||||
|
||||
export type SubmittableResultSubscription<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> =
|
||||
ApiType extends 'rxjs'
|
||||
? Observable<R>
|
||||
: Promise<() => void>;
|
||||
|
||||
export interface SubmittableResultValue {
|
||||
dispatchError?: DispatchError;
|
||||
dispatchInfo?: DispatchInfo;
|
||||
events?: EventRecord[];
|
||||
internalError?: Error;
|
||||
status: ExtrinsicStatus;
|
||||
}
|
||||
|
||||
export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> extends Extrinsic {
|
||||
dryRun (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableDryRunResult<ApiType>;
|
||||
|
||||
paymentInfo (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittablePaymentResult<ApiType>;
|
||||
|
||||
send (): SubmittableResultResult<ApiType>;
|
||||
|
||||
send (statusCb: Callback<R>): SubmittableResultSubscription<ApiType, R>;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
sign (account: IKeyringPair, _options?: Partial<SignerOptions>): this;
|
||||
|
||||
signAsync (account: AddressOrPair, _options?: Partial<SignerOptions>): PromiseOrObs<ApiType, this>;
|
||||
|
||||
signAndSend (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableResultResult<ApiType, R>;
|
||||
|
||||
signAndSend (account: AddressOrPair, statusCb: Callback<R>): SubmittableResultSubscription<ApiType>;
|
||||
|
||||
signAndSend (account: AddressOrPair, options: Partial<SignerOptions>, statusCb?: Callback<R>): SubmittableResultSubscription<ApiType, R>;
|
||||
|
||||
withResultTransform (transform: (input: ISubmittableResult) => ISubmittableResult): this;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../types" }
|
||||
]
|
||||
}
|
||||
@@ -1,28 +1,34 @@
|
||||
{
|
||||
"name": "@polkadot/api-contract",
|
||||
"version": "6.0.1",
|
||||
"type": "module",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"contributors": [],
|
||||
"description": "Interfaces for interacting with contracts and contract ABIs",
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"license": "Apache-2.0",
|
||||
"maintainers": [],
|
||||
"name": "@polkadot/api-contract",
|
||||
"repository": {
|
||||
"directory": "packages/api-contract",
|
||||
"type": "git",
|
||||
"url": "https://github.com/polkadot-js/api.git"
|
||||
},
|
||||
"sideEffects": [
|
||||
"./detectPackage.js",
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"repository": "github:polkadot-js/api",
|
||||
"bugs": "https://github.com/polkadot-js/api/issues",
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"type": "module",
|
||||
"version": "7.0.2",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.15.4",
|
||||
"@polkadot/api": "6.0.1",
|
||||
"@polkadot/types": "6.0.1",
|
||||
"@polkadot/util": "^7.4.1",
|
||||
"rxjs": "^7.3.0"
|
||||
"@babel/runtime": "^7.16.5",
|
||||
"@polkadot/api": "7.0.2",
|
||||
"@polkadot/types": "7.0.2",
|
||||
"@polkadot/types-create": "7.0.2",
|
||||
"@polkadot/util": "^8.2.2",
|
||||
"@polkadot/util-crypto": "^8.2.2",
|
||||
"rxjs": "^7.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
interface JSONAbi {
|
||||
source: {
|
||||
compiler: string,
|
||||
hash: string,
|
||||
language: string,
|
||||
wasm: string
|
||||
},
|
||||
spec: {
|
||||
messages: {
|
||||
name: string[] | string
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
describe('Abi', (): void => {
|
||||
Object.entries(abis).forEach(([abiName, abi]) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
try {
|
||||
const messageIds = (abi as JSONAbi).spec.messages.map(({ name }) => Array.isArray(name) ? name[0] : name);
|
||||
const inkAbi = new Abi(abis[abiName]);
|
||||
|
||||
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('has the correct hash for the source', (): void => {
|
||||
const bundle = abis.ink_flipperBundle as JSONAbi;
|
||||
const abi = new Abi(bundle as any);
|
||||
|
||||
// manual
|
||||
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
|
||||
|
||||
// the Codec hash
|
||||
expect(bundle.source.hash).toEqual(abi.project.source.wasm.hash.toHex());
|
||||
|
||||
// the hash as per the actual Abi
|
||||
expect(bundle.source.hash).toEqual(abi.project.source.wasmHash.toHex());
|
||||
});
|
||||
});
|
||||
@@ -1,198 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Bytes } from '@polkadot/types';
|
||||
import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractProject } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, Codec } from '@polkadot/types/types';
|
||||
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types';
|
||||
|
||||
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { MetaRegistry } from './MetaRegistry';
|
||||
|
||||
const l = logger('Abi');
|
||||
|
||||
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
|
||||
const message = isNumber(messageOrId)
|
||||
? list[messageOrId]
|
||||
: isString(messageOrId)
|
||||
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
|
||||
: messageOrId;
|
||||
|
||||
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
|
||||
}
|
||||
|
||||
export class Abi {
|
||||
readonly #events: AbiEvent[];
|
||||
|
||||
public readonly constructors: AbiConstructor[];
|
||||
|
||||
public readonly json: AnyJson;
|
||||
|
||||
public readonly messages: AbiMessage[];
|
||||
|
||||
public readonly project: ContractProject;
|
||||
|
||||
public readonly registry: MetaRegistry;
|
||||
|
||||
constructor (abiJson: AnyJson, chainProperties?: ChainProperties) {
|
||||
const json = isString(abiJson)
|
||||
? JSON.parse(abiJson) as AnyJson
|
||||
: abiJson;
|
||||
|
||||
assert(isObject(json) && !Array.isArray(json) && json.metadataVersion && isObject(json.spec) && !Array.isArray(json.spec) && Array.isArray(json.spec.constructors) && Array.isArray(json.spec.messages), 'Invalid JSON ABI structure supplied, expected a recent metadata version');
|
||||
|
||||
this.json = json;
|
||||
this.registry = new MetaRegistry(json.metadataVersion as string, chainProperties);
|
||||
this.project = this.registry.createType('ContractProject', json);
|
||||
|
||||
this.registry.setMetaTypes(this.project.types);
|
||||
|
||||
this.project.types.forEach((_, index) =>
|
||||
this.registry.getMetaTypeDef({ type: this.registry.createType('Si0LookupTypeId', index + this.registry.typeOffset) })
|
||||
);
|
||||
this.constructors = this.project.spec.constructors.map((spec: ContractConstructorSpec, index) =>
|
||||
this.#createMessage(spec, index, {
|
||||
isConstructor: true
|
||||
})
|
||||
);
|
||||
this.#events = this.project.spec.events.map((spec: ContractEventSpec, index) =>
|
||||
this.#createEvent(spec, index)
|
||||
);
|
||||
this.messages = this.project.spec.messages.map((spec: ContractMessageSpec, index): AbiMessage => {
|
||||
const typeSpec = spec.returnType.unwrapOr(null);
|
||||
|
||||
return this.#createMessage(spec, index, {
|
||||
isMutating: spec.mutates.isTrue,
|
||||
isPayable: spec.payable.isTrue,
|
||||
returnType: typeSpec
|
||||
? this.registry.getMetaTypeDef(typeSpec)
|
||||
: null
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning: Unstable API, bound to change
|
||||
*/
|
||||
public decodeEvent (data: Bytes | Uint8Array): DecodedEvent {
|
||||
const index = data[0];
|
||||
const event = this.#events[index];
|
||||
|
||||
assert(event, () => `Unable to find event with index ${index}`);
|
||||
|
||||
return event.fromU8a(data.subarray(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning: Unstable API, bound to change
|
||||
*/
|
||||
public decodeConstructor (data: Uint8Array): DecodedMessage {
|
||||
return this.#decodeMessage('message', this.constructors, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning: Unstable API, bound to change
|
||||
*/
|
||||
public decodeMessage (data: Uint8Array): DecodedMessage {
|
||||
return this.#decodeMessage('message', this.messages, data);
|
||||
}
|
||||
|
||||
public findConstructor (constructorOrId: AbiConstructor | string | number): AbiConstructor {
|
||||
return findMessage(this.constructors, constructorOrId);
|
||||
}
|
||||
|
||||
public findMessage (messageOrId: AbiMessage | string | number): AbiMessage {
|
||||
return findMessage(this.messages, messageOrId);
|
||||
}
|
||||
|
||||
#createArgs = (args: ContractMessageParamSpec[], spec: unknown): AbiParam[] => {
|
||||
return args.map((arg, index): AbiParam => {
|
||||
try {
|
||||
assert(isObject(arg.type), 'Invalid type definition found');
|
||||
|
||||
return {
|
||||
name: stringCamelCase(arg.name),
|
||||
type: this.registry.getMetaTypeDef(arg.type)
|
||||
};
|
||||
} catch (error) {
|
||||
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
#createEvent = (spec: ContractEventSpec, index: number): AbiEvent => {
|
||||
const args = this.#createArgs(spec.args, spec);
|
||||
const event = {
|
||||
args,
|
||||
docs: spec.docs.map((d) => d.toString()),
|
||||
fromU8a: (data: Uint8Array): DecodedEvent => ({
|
||||
args: this.#decodeArgs(args, data),
|
||||
event
|
||||
}),
|
||||
identifier: spec.name.toString(),
|
||||
index
|
||||
};
|
||||
|
||||
return event;
|
||||
}
|
||||
|
||||
#createMessage = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
||||
const args = this.#createArgs(spec.args, spec);
|
||||
const identifier = spec.name.toString();
|
||||
const message = {
|
||||
...add,
|
||||
args,
|
||||
docs: spec.docs.map((d) => d.toString()),
|
||||
fromU8a: (data: Uint8Array): DecodedMessage => ({
|
||||
args: this.#decodeArgs(args, data),
|
||||
message
|
||||
}),
|
||||
identifier,
|
||||
index,
|
||||
method: stringCamelCase(identifier),
|
||||
selector: spec.selector,
|
||||
toU8a: (params: unknown[]) =>
|
||||
this.#encodeArgs(spec, args, params)
|
||||
};
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
#decodeArgs = (args: AbiParam[], data: Uint8Array): Codec[] => {
|
||||
// for decoding we expect the input to be just the arg data, no selectors
|
||||
// no length added (this allows use with events as well)
|
||||
let offset = 0;
|
||||
|
||||
return args.map(({ type }): Codec => {
|
||||
const value = this.registry.createType(type.type as 'Text', data.subarray(offset));
|
||||
|
||||
offset += value.encodedLength;
|
||||
|
||||
return value;
|
||||
});
|
||||
}
|
||||
|
||||
#decodeMessage = (type: 'constructor' | 'message', list: AbiMessage[], data: Uint8Array): DecodedMessage => {
|
||||
const [, trimmed] = compactStripLength(data);
|
||||
const selector = trimmed.subarray(0, 4);
|
||||
const message = list.find((m) => m.selector.eq(selector));
|
||||
|
||||
assert(message, `Unable to find ${type} with selector ${u8aToHex(selector)}`);
|
||||
|
||||
return message.fromU8a(trimmed.subarray(4));
|
||||
}
|
||||
|
||||
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: unknown[]): Uint8Array => {
|
||||
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`);
|
||||
|
||||
return compactAddLength(
|
||||
u8aConcat(
|
||||
this.registry.createType('ContractSelector', selector).toU8a(),
|
||||
...args.map(({ type }, index) => this.registry.createType(type.type as 'Text', data[index]).toU8a())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { TypeDefInfo } from '@polkadot/types/types';
|
||||
import { blake2AsHex } from '@polkadot/util-crypto';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
interface SpecDef {
|
||||
messages: {
|
||||
label: string;
|
||||
name: string[] | string
|
||||
}[]
|
||||
}
|
||||
|
||||
interface JSONAbi {
|
||||
source: {
|
||||
compiler: string,
|
||||
hash: string,
|
||||
language: string,
|
||||
wasm: string
|
||||
},
|
||||
spec: SpecDef;
|
||||
V1: {
|
||||
spec: SpecDef;
|
||||
},
|
||||
V2: {
|
||||
spec: SpecDef;
|
||||
}
|
||||
}
|
||||
|
||||
function stringifyInfo (key: string, value: unknown): unknown {
|
||||
return key === 'info'
|
||||
? TypeDefInfo[value as number]
|
||||
: value;
|
||||
}
|
||||
|
||||
function stringifyJson (registry: Registry): string {
|
||||
const defs = registry.lookup.types.map(({ id }) =>
|
||||
registry.lookup.getTypeDef(id)
|
||||
);
|
||||
|
||||
return JSON.stringify(defs, stringifyInfo, 2);
|
||||
}
|
||||
|
||||
describe('Abi', (): void => {
|
||||
describe('ABI', (): void => {
|
||||
Object.entries(abis).forEach(([abiName, _abi]) => {
|
||||
const abi = _abi as unknown as JSONAbi;
|
||||
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
try {
|
||||
const messageIds = (abi.V2 || abi.V1 || abi).spec.messages.map(({ label, name }) =>
|
||||
label || (
|
||||
Array.isArray(name)
|
||||
? name[0]
|
||||
: name
|
||||
)
|
||||
);
|
||||
const inkAbi = new Abi(abis[abiName]);
|
||||
|
||||
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('TypeDef', (): void => {
|
||||
Object.keys(abis).forEach((abiName) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
const abi = new Abi(abis[abiName]);
|
||||
const json = stringifyJson(abi.registry);
|
||||
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
expect(JSON.parse(json)).toEqual(require(cmpPath));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
console.error(json);
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
fs.writeFileSync(cmpPath, json, { flag: 'w' });
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('has the correct hash for the source', (): void => {
|
||||
const abi = new Abi(abis.ink_v0_flipperBundle);
|
||||
const bundle = abis.ink_v0_flipperBundle as unknown as JSONAbi;
|
||||
|
||||
// manual
|
||||
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
|
||||
|
||||
// the Codec hash
|
||||
expect(bundle.source.hash).toEqual(abi.info.source.wasm.hash.toHex());
|
||||
|
||||
// the hash as per the actual Abi
|
||||
expect(bundle.source.hash).toEqual(abi.info.source.wasmHash.toHex());
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,256 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Bytes } from '@polkadot/types';
|
||||
import type { ChainProperties, ContractConstructorSpecLatest, ContractEventSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces';
|
||||
import type { Codec, Registry } from '@polkadot/types/types';
|
||||
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types';
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { TypeDefInfo } from '@polkadot/types-create';
|
||||
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
import { v0ToLatest, v1ToLatest } from './toLatest';
|
||||
|
||||
const l = logger('Abi');
|
||||
|
||||
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
|
||||
|
||||
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
|
||||
const message = isNumber(messageOrId)
|
||||
? list[messageOrId]
|
||||
: isString(messageOrId)
|
||||
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
|
||||
: messageOrId;
|
||||
|
||||
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
|
||||
}
|
||||
|
||||
// FIXME: This is still workable with V0, V1 & V2, but certainly is not a scalable
|
||||
// approach (right at this point don't quite have better ideas that is not as complex
|
||||
// as the conversion tactics in the runtime Metadata)
|
||||
function getLatestMeta (registry: Registry, json: Record<string, unknown>): ContractMetadataLatest {
|
||||
const metadata = registry.createType('ContractMetadata',
|
||||
isObject(json.V2)
|
||||
? { V2: json.V2 }
|
||||
: isObject(json.V1)
|
||||
? { V1: json.V1 }
|
||||
: { V0: json }
|
||||
) as unknown as ContractMetadata;
|
||||
|
||||
return metadata.isV2
|
||||
? metadata.asV2
|
||||
: metadata.isV1
|
||||
? v1ToLatest(registry, metadata.asV1)
|
||||
: v0ToLatest(registry, metadata.asV0);
|
||||
}
|
||||
|
||||
function parseJson (json: Record<string, unknown>, chainProperties?: ChainProperties): [Record<string, unknown>, Registry, ContractMetadataLatest, ContractProjectInfo] {
|
||||
const registry = new TypeRegistry();
|
||||
const info = registry.createType('ContractProjectInfo', json) as unknown as ContractProjectInfo;
|
||||
const latest = getLatestMeta(registry, json);
|
||||
const lookup = registry.createType('PortableRegistry', { types: latest.types });
|
||||
|
||||
// attach the lookup to the registry - now the types are known
|
||||
registry.setLookup(lookup);
|
||||
|
||||
if (chainProperties) {
|
||||
registry.setChainProperties(chainProperties);
|
||||
}
|
||||
|
||||
// warm-up the actual type, pre-use
|
||||
lookup.types.forEach(({ id }) =>
|
||||
lookup.getTypeDef(id)
|
||||
);
|
||||
|
||||
return [json, registry, latest, info];
|
||||
}
|
||||
|
||||
export class Abi {
|
||||
public readonly events: AbiEvent[];
|
||||
|
||||
public readonly constructors: AbiConstructor[];
|
||||
|
||||
public readonly info: ContractProjectInfo;
|
||||
|
||||
public readonly json: Record<string, unknown>;
|
||||
|
||||
public readonly messages: AbiMessage[];
|
||||
|
||||
public readonly metadata: ContractMetadataLatest;
|
||||
|
||||
public readonly registry: Registry;
|
||||
|
||||
constructor (abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties) {
|
||||
[this.json, this.registry, this.metadata, this.info] = parseJson(
|
||||
isString(abiJson)
|
||||
? JSON.parse(abiJson) as Record<string, unknown>
|
||||
: abiJson,
|
||||
chainProperties
|
||||
);
|
||||
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpecLatest, index) =>
|
||||
this.#createMessage(spec, index, {
|
||||
isConstructor: true
|
||||
})
|
||||
);
|
||||
this.events = this.metadata.spec.events.map((spec: ContractEventSpecLatest, index) =>
|
||||
this.#createEvent(spec, index)
|
||||
);
|
||||
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpecLatest, index): AbiMessage => {
|
||||
const typeSpec = spec.returnType.unwrapOr(null);
|
||||
|
||||
return this.#createMessage(spec, index, {
|
||||
isMutating: spec.mutates.isTrue,
|
||||
isPayable: spec.payable.isTrue,
|
||||
returnType: typeSpec
|
||||
? this.registry.lookup.getTypeDef(typeSpec.type)
|
||||
: null
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning: Unstable API, bound to change
|
||||
*/
|
||||
public decodeEvent (data: Bytes | Uint8Array): DecodedEvent {
|
||||
const index = data[0];
|
||||
const event = this.events[index];
|
||||
|
||||
assert(event, () => `Unable to find event with index ${index}`);
|
||||
|
||||
return event.fromU8a(data.subarray(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning: Unstable API, bound to change
|
||||
*/
|
||||
public decodeConstructor (data: Uint8Array): DecodedMessage {
|
||||
return this.#decodeMessage('message', this.constructors, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Warning: Unstable API, bound to change
|
||||
*/
|
||||
public decodeMessage (data: Uint8Array): DecodedMessage {
|
||||
return this.#decodeMessage('message', this.messages, data);
|
||||
}
|
||||
|
||||
public findConstructor (constructorOrId: AbiConstructor | string | number): AbiConstructor {
|
||||
return findMessage(this.constructors, constructorOrId);
|
||||
}
|
||||
|
||||
public findMessage (messageOrId: AbiMessage | string | number): AbiMessage {
|
||||
return findMessage(this.messages, messageOrId);
|
||||
}
|
||||
|
||||
#createArgs = (args: ContractMessageParamSpecLatest[], spec: unknown): AbiParam[] => {
|
||||
return args.map(({ label, type }, index): AbiParam => {
|
||||
try {
|
||||
assert(isObject(type), 'Invalid type definition found');
|
||||
|
||||
const displayName = type.displayName.length
|
||||
? type.displayName[type.displayName.length - 1].toString()
|
||||
: undefined;
|
||||
const camelName = stringCamelCase(label);
|
||||
|
||||
if (displayName && PRIMITIVE_ALWAYS.includes(displayName)) {
|
||||
return {
|
||||
name: camelName,
|
||||
type: {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: displayName
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const typeDef = this.registry.lookup.getTypeDef(type.type);
|
||||
|
||||
return {
|
||||
name: camelName,
|
||||
type: displayName && !typeDef.type.startsWith(displayName)
|
||||
? { displayName, ...typeDef }
|
||||
: typeDef
|
||||
};
|
||||
} catch (error) {
|
||||
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
|
||||
|
||||
throw error;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
#createEvent = (spec: ContractEventSpecLatest, index: number): AbiEvent => {
|
||||
const args = this.#createArgs(spec.args, spec);
|
||||
const event = {
|
||||
args,
|
||||
docs: spec.docs.map((d) => d.toString()),
|
||||
fromU8a: (data: Uint8Array): DecodedEvent => ({
|
||||
args: this.#decodeArgs(args, data),
|
||||
event
|
||||
}),
|
||||
identifier: spec.label.toString(),
|
||||
index
|
||||
};
|
||||
|
||||
return event;
|
||||
};
|
||||
|
||||
#createMessage = (spec: ContractMessageSpecLatest | ContractConstructorSpecLatest, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
|
||||
const args = this.#createArgs(spec.args, spec);
|
||||
const identifier = spec.label.toString();
|
||||
const message = {
|
||||
...add,
|
||||
args,
|
||||
docs: spec.docs.map((d) => d.toString()),
|
||||
fromU8a: (data: Uint8Array): DecodedMessage => ({
|
||||
args: this.#decodeArgs(args, data),
|
||||
message
|
||||
}),
|
||||
identifier,
|
||||
index,
|
||||
method: stringCamelCase(identifier),
|
||||
selector: spec.selector,
|
||||
toU8a: (params: unknown[]) =>
|
||||
this.#encodeArgs(spec, args, params)
|
||||
};
|
||||
|
||||
return message;
|
||||
};
|
||||
|
||||
#decodeArgs = (args: AbiParam[], data: Uint8Array): Codec[] => {
|
||||
// for decoding we expect the input to be just the arg data, no selectors
|
||||
// no length added (this allows use with events as well)
|
||||
let offset = 0;
|
||||
|
||||
return args.map(({ type: { lookupName, type } }): Codec => {
|
||||
const value = this.registry.createType(lookupName || type, data.subarray(offset));
|
||||
|
||||
offset += value.encodedLength;
|
||||
|
||||
return value;
|
||||
});
|
||||
};
|
||||
|
||||
#decodeMessage = (type: 'constructor' | 'message', list: AbiMessage[], data: Uint8Array): DecodedMessage => {
|
||||
const [, trimmed] = compactStripLength(data);
|
||||
const selector = trimmed.subarray(0, 4);
|
||||
const message = list.find((m) => m.selector.eq(selector));
|
||||
|
||||
assert(message, `Unable to find ${type} with selector ${u8aToHex(selector)}`);
|
||||
|
||||
return message.fromU8a(trimmed.subarray(4));
|
||||
};
|
||||
|
||||
#encodeArgs = ({ label, selector }: ContractMessageSpecLatest | ContractConstructorSpecLatest, args: AbiParam[], data: unknown[]): Uint8Array => {
|
||||
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
|
||||
|
||||
return compactAddLength(
|
||||
u8aConcat(
|
||||
this.registry.createType('ContractSelector', selector).toU8a(),
|
||||
...args.map(({ type: { lookupName, type } }, index) =>
|
||||
this.registry.createType(lookupName || type, data[index]).toU8a()
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { v0ToLatest, v1ToLatest } from '@polkadot/api-contract/Abi/toLatest';
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
|
||||
describe('v0ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V0: abis.ink_v0_erc20 });
|
||||
const latest = v0ToLatest(registry, contract.asV0);
|
||||
|
||||
it('has the correct constructors', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors.map(({ label }) => label.toString())
|
||||
).toEqual(['new']);
|
||||
});
|
||||
|
||||
it('has the correct messages', (): void => {
|
||||
expect(
|
||||
latest.spec.messages.map(({ label }) => label.toString())
|
||||
).toEqual(['total_supply', 'balance_of', 'allowance', 'transfer', 'approve', 'transfer_from']);
|
||||
});
|
||||
|
||||
it('has the correct events', (): void => {
|
||||
expect(
|
||||
latest.spec.events.map(({ label }) => label.toString())
|
||||
).toEqual(['Transfer', 'Approval']);
|
||||
});
|
||||
|
||||
it('has the correct constructor arguments', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors[0].args.map(({ label }) => label.toString())
|
||||
).toEqual(['initial_supply']);
|
||||
});
|
||||
|
||||
it('has the correct message arguments', (): void => {
|
||||
expect(
|
||||
latest.spec.messages[1].args.map(({ label }) => label.toString())
|
||||
).toEqual(['owner']);
|
||||
});
|
||||
|
||||
it('has the correct event arguments', (): void => {
|
||||
expect(
|
||||
latest.spec.events[0].args.map(({ label }) => label.toString())
|
||||
).toEqual(['from', 'to', 'value']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('v1ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_flipper.V1 });
|
||||
const latest = v1ToLatest(registry, contract.asV1);
|
||||
|
||||
it('has the correct constructors', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors.map(({ label }) => label.toString())
|
||||
).toEqual(['new', 'default']);
|
||||
});
|
||||
|
||||
it('has the correct messages', (): void => {
|
||||
expect(
|
||||
latest.spec.messages.map(({ label }) => label.toString())
|
||||
).toEqual(['flip', 'get']);
|
||||
});
|
||||
|
||||
it('has the correct constructor arguments', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors[0].args.map(({ label }) => label.toString())
|
||||
).toEqual(['init_value']);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { v0ToV1 } from './toV1';
|
||||
import { v1ToV2 } from './toV2';
|
||||
|
||||
export function v1ToLatest (registry: Registry, v1: ContractMetadataV1): ContractMetadataLatest {
|
||||
return v1ToV2(registry, v1);
|
||||
}
|
||||
|
||||
export function v0ToLatest (registry: Registry, v0: ContractMetadataV0): ContractMetadataLatest {
|
||||
return v1ToLatest(registry, v0ToV1(registry, v0));
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ContractMetadataV0, ContractMetadataV1 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { convertSiV0toV1 } from '@polkadot/types';
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
export function v0ToV1 (registry: Registry, v0: ContractMetadataV0): ContractMetadataV1 {
|
||||
return registry.createType('ContractMetadataV1', objectSpread({}, v0, {
|
||||
types: convertSiV0toV1(registry, v0.types)
|
||||
}));
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Text } from '@polkadot/types';
|
||||
import type { ContractConstructorSpecV0, ContractEventSpecV0, ContractMessageSpecV0, ContractMetadataV1, ContractMetadataV2 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
type WithArgs = keyof typeof ARG_TYPES;
|
||||
|
||||
interface NamedEntry {
|
||||
name: Text | Text[];
|
||||
}
|
||||
|
||||
type GetArgsType<T extends WithArgs> = T extends 'ContractConstructorSpec'
|
||||
? ContractConstructorSpecV0
|
||||
: T extends ContractEventSpecV0
|
||||
? ContractEventSpecV0
|
||||
: ContractMessageSpecV0;
|
||||
|
||||
interface ArgsEntry <T extends WithArgs> extends NamedEntry {
|
||||
args: GetArgsType<T>['args'][0][];
|
||||
}
|
||||
|
||||
const ARG_TYPES = {
|
||||
ContractConstructorSpec: 'ContractMessageParamSpecV2',
|
||||
ContractEventSpec: 'ContractEventParamSpecV2',
|
||||
ContractMessageSpec: 'ContractMessageParamSpecV2'
|
||||
};
|
||||
|
||||
function v1ToV2Label (entry: NamedEntry): { label: Text } {
|
||||
return objectSpread({}, entry, {
|
||||
label: Array.isArray(entry.name)
|
||||
? entry.name[0]
|
||||
: entry.name
|
||||
});
|
||||
}
|
||||
|
||||
function v1ToV2Labels <T extends WithArgs> (registry: Registry, outType: T, all: ArgsEntry<T>[]): unknown[] {
|
||||
return all.map((e) =>
|
||||
registry.createType(`${outType}V2`, objectSpread(v1ToV2Label(e), {
|
||||
args: e.args.map((a) =>
|
||||
registry.createType(ARG_TYPES[outType], v1ToV2Label(a))
|
||||
)
|
||||
}))
|
||||
);
|
||||
}
|
||||
|
||||
export function v1ToV2 (registry: Registry, v1: ContractMetadataV1): ContractMetadataV2 {
|
||||
return registry.createType('ContractMetadataV2', objectSpread({}, v1, {
|
||||
spec: objectSpread({}, v1.spec, {
|
||||
constructors: v1ToV2Labels(registry, 'ContractConstructorSpec', v1.spec.constructors),
|
||||
events: v1ToV2Labels(registry, 'ContractEventSpec', v1.spec.events),
|
||||
messages: v1ToV2Labels(registry, 'ContractMessageSpec', v1.spec.messages)
|
||||
})
|
||||
}));
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { TypeDefInfo } from '@polkadot/types/types';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
import { Abi } from '.';
|
||||
|
||||
function stringifyInfo (key: string, value: unknown): unknown {
|
||||
return key === 'info'
|
||||
? TypeDefInfo[value as number]
|
||||
: value;
|
||||
}
|
||||
|
||||
describe('MetaRegistry', (): void => {
|
||||
Object.keys(abis).forEach((abiName) => {
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
const abi = new Abi(abis[abiName]);
|
||||
const json = JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo, 2);
|
||||
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
expect(JSON.parse(json)).toEqual(require(cmpPath));
|
||||
} catch (error) {
|
||||
if (process.env.GITHUB_REPOSITORY) {
|
||||
console.error(JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo));
|
||||
|
||||
throw error;
|
||||
}
|
||||
|
||||
fs.writeFileSync(cmpPath, json, { flag: 'w' });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('stores base project as JSON', (): void => {
|
||||
expect(new Abi(abis.ink_dns).json).toEqual(abis.ink_dns);
|
||||
});
|
||||
});
|
||||
@@ -1,252 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ChainProperties, ContractDisplayName, Si0Field, Si0LookupTypeId, Si0Type, Si0TypeDefArray, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0Variant } from '@polkadot/types/interfaces';
|
||||
import type { InterfaceTypes, TypeDef } from '@polkadot/types/types';
|
||||
|
||||
import { TypeDefInfo, TypeRegistry, withTypeString } from '@polkadot/types';
|
||||
import { assert, isUndefined } from '@polkadot/util';
|
||||
|
||||
interface PartialTypeSpec {
|
||||
readonly type: Si0LookupTypeId;
|
||||
readonly displayName?: ContractDisplayName;
|
||||
}
|
||||
|
||||
// convert the offset into project-specific, index-1
|
||||
export function getRegistryOffset (id: Si0LookupTypeId, typeOffset: number): number {
|
||||
return id.toNumber() - typeOffset;
|
||||
}
|
||||
|
||||
const PRIMITIVE_ALIAS: Record<string, keyof InterfaceTypes> = {
|
||||
Char: 'u32', // Rust char is 4-bytes
|
||||
Str: 'Text'
|
||||
};
|
||||
|
||||
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
|
||||
|
||||
// TODO Replace usages with PortableRegistry
|
||||
export class MetaRegistry extends TypeRegistry {
|
||||
public readonly metaTypeDefs: TypeDef[] = [];
|
||||
|
||||
public readonly typeOffset;
|
||||
|
||||
#siTypes: Si0Type[] = [];
|
||||
|
||||
constructor (metadataVersion: string, chainProperties?: ChainProperties) {
|
||||
super();
|
||||
|
||||
const [major, minor] = metadataVersion.split('.').map((n) => parseInt(n, 10));
|
||||
|
||||
// type indexes are 1-based pre 0.7 and 0-based post
|
||||
this.typeOffset = (major === 0 && minor < 7) ? 1 : 0;
|
||||
|
||||
if (chainProperties) {
|
||||
this.setChainProperties(chainProperties);
|
||||
}
|
||||
}
|
||||
|
||||
public setMetaTypes (metaTypes: Si0Type[]): void {
|
||||
this.#siTypes = metaTypes;
|
||||
}
|
||||
|
||||
public getMetaTypeDef (typeSpec: PartialTypeSpec): TypeDef {
|
||||
const offset = getRegistryOffset(typeSpec.type, this.typeOffset);
|
||||
let typeDef = this.metaTypeDefs[offset];
|
||||
|
||||
if (!typeDef) {
|
||||
typeDef = this.#extract(this.#getMetaType(typeSpec.type), typeSpec.type);
|
||||
|
||||
this.metaTypeDefs[offset] = typeDef;
|
||||
}
|
||||
|
||||
if (typeSpec.displayName && typeSpec.displayName.length) {
|
||||
const displayName = typeSpec.displayName[typeSpec.displayName.length - 1].toString();
|
||||
|
||||
if (!typeDef.type.startsWith(displayName)) {
|
||||
typeDef = {
|
||||
...typeDef,
|
||||
displayName,
|
||||
type: PRIMITIVE_ALWAYS.includes(displayName)
|
||||
? displayName
|
||||
: typeDef.type
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Here we protect against the following cases
|
||||
// - No displayName present, these are generally known primitives
|
||||
// - displayName === type, these generate circular references
|
||||
// - displayName Option & type Option<...something...>
|
||||
if (typeDef.displayName && !this.hasType(typeDef.displayName) && !(typeDef.type === typeDef.displayName || typeDef.type.startsWith(`${typeDef.displayName}<`))) {
|
||||
this.register({ [typeDef.displayName]: typeDef.type });
|
||||
}
|
||||
|
||||
return typeDef;
|
||||
}
|
||||
|
||||
#getMetaType = (id: Si0LookupTypeId): Si0Type => {
|
||||
const type = this.#siTypes[getRegistryOffset(id, this.typeOffset)];
|
||||
|
||||
assert(!isUndefined(type), () => `getMetaType:: Unable to find ${id.toNumber()} in type values`);
|
||||
|
||||
return this.createType('Si0Type', type);
|
||||
}
|
||||
|
||||
#extract = (type: Si0Type, id: Si0LookupTypeId): TypeDef => {
|
||||
const path = [...type.path];
|
||||
const isPrimitivePath = !!path.length && (
|
||||
(path.length > 2 && path[0].eq('ink_env') && path[1].eq('types')) ||
|
||||
PRIMITIVE_ALWAYS.includes(path[path.length - 1].toString())
|
||||
);
|
||||
let typeDef: Omit<TypeDef, 'type'>;
|
||||
|
||||
if (isPrimitivePath) {
|
||||
typeDef = this.#extractPrimitivePath(type);
|
||||
} else if (type.def.isPrimitive) {
|
||||
typeDef = this.#extractPrimitive(type);
|
||||
} else if (type.def.isComposite) {
|
||||
typeDef = this.#extractFields(type.def.asComposite.fields);
|
||||
} else if (type.def.isVariant) {
|
||||
typeDef = this.#extractVariant(type.def.asVariant, id);
|
||||
} else if (type.def.isArray) {
|
||||
typeDef = this.#extractArray(type.def.asArray);
|
||||
} else if (type.def.isSequence) {
|
||||
typeDef = this.#extractSequence(type.def.asSequence, id);
|
||||
} else if (type.def.isTuple) {
|
||||
typeDef = this.#extractTuple(type.def.asTuple);
|
||||
} else {
|
||||
throw new Error(`Invalid ink! type at index ${id.toString()}`);
|
||||
}
|
||||
|
||||
const displayName = path.pop()?.toString();
|
||||
|
||||
return withTypeString(this, {
|
||||
...(displayName
|
||||
? { displayName }
|
||||
: {}
|
||||
),
|
||||
...(path.length > 1
|
||||
? { namespace: path.map((s) => s.toString()).join('::') }
|
||||
: {}
|
||||
),
|
||||
...(type.params.length > 0
|
||||
? { sub: type.params.map((type) => this.getMetaTypeDef({ type })) }
|
||||
: {}
|
||||
),
|
||||
...typeDef
|
||||
});
|
||||
}
|
||||
|
||||
#extractArray = ({ len: length, type }: Si0TypeDefArray): Omit<TypeDef, 'type'> => {
|
||||
assert(!length || length.toNumber() <= 256, 'MetaRegistry: Only support for [Type; <length>], where length <= 256');
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.VecFixed,
|
||||
length: length.toNumber(),
|
||||
sub: this.getMetaTypeDef({ type })
|
||||
};
|
||||
}
|
||||
|
||||
#extractFields = (fields: Si0Field[]): Omit<TypeDef, 'type'> => {
|
||||
const [isStruct, isTuple] = fields.reduce(([isAllNamed, isAllUnnamed], { name }) => ([
|
||||
isAllNamed && name.isSome,
|
||||
isAllUnnamed && name.isNone
|
||||
]),
|
||||
[true, true]);
|
||||
|
||||
assert(isTuple || isStruct, 'Invalid fields type detected, expected either Tuple or Struct');
|
||||
|
||||
const sub = fields.map(({ name, type }) => ({
|
||||
...this.getMetaTypeDef({ type }),
|
||||
...(name.isSome
|
||||
? { name: name.unwrap().toString() }
|
||||
: {}
|
||||
)
|
||||
}));
|
||||
|
||||
return isTuple && sub.length === 1
|
||||
? sub[0]
|
||||
: {
|
||||
// check for tuple first (no fields may be available)
|
||||
info: isTuple
|
||||
? TypeDefInfo.Tuple
|
||||
: TypeDefInfo.Struct,
|
||||
sub
|
||||
};
|
||||
}
|
||||
|
||||
#extractPrimitive = (type: Si0Type): TypeDef => {
|
||||
const typeStr = type.def.asPrimitive.type.toString();
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: PRIMITIVE_ALIAS[typeStr] || typeStr.toLowerCase()
|
||||
};
|
||||
}
|
||||
|
||||
#extractPrimitivePath = (type: Si0Type): TypeDef => {
|
||||
return {
|
||||
info: TypeDefInfo.Plain,
|
||||
type: type.path[type.path.length - 1].toString()
|
||||
};
|
||||
}
|
||||
|
||||
#extractSequence = ({ type }: Si0TypeDefSequence, id: Si0LookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
assert(!!type, () => `ContractRegistry: Invalid sequence type found at id ${id.toString()}`);
|
||||
|
||||
return {
|
||||
info: TypeDefInfo.Vec,
|
||||
sub: this.getMetaTypeDef({ type })
|
||||
};
|
||||
}
|
||||
|
||||
#extractTuple = (ids: Si0TypeDefTuple): Omit<TypeDef, 'type'> => {
|
||||
return ids.length === 1
|
||||
? this.getMetaTypeDef({ type: ids[0] })
|
||||
: {
|
||||
info: TypeDefInfo.Tuple,
|
||||
sub: ids.map((type) => this.getMetaTypeDef({ type }))
|
||||
};
|
||||
}
|
||||
|
||||
#extractVariant = ({ variants }: Si0TypeDefVariant, id: Si0LookupTypeId): Omit<TypeDef, 'type'> => {
|
||||
const { params, path } = this.#getMetaType(id);
|
||||
const specialVariant = path[0].toString();
|
||||
|
||||
return specialVariant === 'Option'
|
||||
? {
|
||||
info: TypeDefInfo.Option,
|
||||
sub: this.getMetaTypeDef({ type: params[0] })
|
||||
}
|
||||
: specialVariant === 'Result'
|
||||
? {
|
||||
info: TypeDefInfo.Result,
|
||||
sub: params.map((type, index) => ({
|
||||
name: ['Ok', 'Error'][index],
|
||||
...this.getMetaTypeDef({ type })
|
||||
}))
|
||||
}
|
||||
: {
|
||||
info: TypeDefInfo.Enum,
|
||||
sub: this.#extractVariantSub(variants)
|
||||
};
|
||||
}
|
||||
|
||||
#extractVariantSub = (variants: Si0Variant[]): TypeDef[] => {
|
||||
return variants.every(({ fields }) => fields.length === 0)
|
||||
? variants.map(({ discriminant, name }) => ({
|
||||
...(
|
||||
discriminant.isSome
|
||||
? { ext: { discriminant: discriminant.unwrap().toNumber() } }
|
||||
: {}
|
||||
),
|
||||
info: TypeDefInfo.Plain,
|
||||
name: name.toString(),
|
||||
type: 'Null'
|
||||
}))
|
||||
: variants.map(({ fields, name }) => withTypeString(this, {
|
||||
...this.#extractFields(fields),
|
||||
name: name.toString()
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
|
||||
import type { AnyJson, Registry } from '@polkadot/types/types';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { assert, isFunction } from '@polkadot/util';
|
||||
@@ -14,19 +14,22 @@ export abstract class Base<ApiType extends ApiTypes> {
|
||||
|
||||
public readonly api: ApiBase<ApiType>;
|
||||
|
||||
public readonly registry: Registry;
|
||||
|
||||
protected readonly _decorateMethod: DecorateMethod<ApiType>;
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, decorateMethod: DecorateMethod<ApiType>) {
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, decorateMethod: DecorateMethod<ApiType>) {
|
||||
this.abi = abi instanceof Abi
|
||||
? abi
|
||||
: new Abi(abi, api.registry.getChainProperties());
|
||||
this.api = api;
|
||||
this.registry = this.abi.registry;
|
||||
|
||||
this._decorateMethod = decorateMethod;
|
||||
|
||||
assert(!!(api && api.isConnected && api.tx && api.tx.contracts && Object.keys(api.tx.contracts).length), 'Your API has not been initialized correctly and it not decorated with the runtime interfaces for contracts as retrieved from the on-chain runtime');
|
||||
assert(!!(api && api.isConnected && api.tx), 'Your API has not been initialized correctly and is not connected to a chain');
|
||||
assert(!!(api.tx.contracts && Object.keys(api.tx.contracts).length), 'You need to connect to a chain with a runtime that supports contracts');
|
||||
assert(isFunction(api.tx.contracts.instantiateWithCode), 'You need to connect to a chain with a runtime with a V3 contracts module. The runtime does not expose api.tx.contracts.instantiateWithCode');
|
||||
}
|
||||
|
||||
public get registry (): Registry {
|
||||
return this.api.registry;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
|
||||
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
|
||||
import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { AbiConstructor, BlueprintOptions } from '../types';
|
||||
import type { MapConstructorExec } from './types';
|
||||
|
||||
@@ -18,6 +18,10 @@ import { Base } from './Base';
|
||||
import { Contract } from './Contract';
|
||||
import { createBluePrintTx, encodeSalt } from './util';
|
||||
|
||||
export interface BlueprintConstructor<ApiType extends ApiTypes> {
|
||||
new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array): Blueprint<ApiType>;
|
||||
}
|
||||
|
||||
export class BlueprintSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
|
||||
public readonly contract?: Contract<ApiType>;
|
||||
|
||||
@@ -36,7 +40,7 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
readonly #tx: MapConstructorExec<ApiType> = {};
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, codeHash: string | Hash | Uint8Array, decorateMethod: DecorateMethod<ApiType>) {
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array, decorateMethod: DecorateMethod<ApiType>) {
|
||||
super(api, abi, decorateMethod);
|
||||
|
||||
this.codeHash = this.registry.createType('Hash', codeHash);
|
||||
@@ -53,18 +57,29 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
}
|
||||
|
||||
#deploy = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, BlueprintSubmittableResult<ApiType>> => {
|
||||
return this.api.tx.contracts
|
||||
.instantiate(
|
||||
value,
|
||||
gasLimit,
|
||||
this.codeHash,
|
||||
this.abi.findConstructor(constructorOrId).toU8a(params),
|
||||
encodeSalt(salt)
|
||||
)
|
||||
const hasStorageDeposit = this.api.tx.contracts.instantiate.meta.args.length === 6;
|
||||
const storageDepositLimit = null;
|
||||
const tx = hasStorageDeposit
|
||||
? this.api.tx.contracts.instantiate(value, gasLimit, storageDepositLimit, this.codeHash, this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt))
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore old style without storage deposit
|
||||
: this.api.tx.contracts.instantiate(value, gasLimit, this.codeHash, this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt));
|
||||
|
||||
return tx
|
||||
.withResultTransform((result: ISubmittableResult) =>
|
||||
new BlueprintSubmittableResult(result, applyOnEvent(result, ['Instantiated'], ([record]: EventRecord[]) =>
|
||||
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
|
||||
))
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function extendBlueprint <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): BlueprintConstructor<ApiType> {
|
||||
return class extends Blueprint<ApiType> {
|
||||
static __BlueprintType = type;
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array) {
|
||||
super(api, abi, codeHash, decorateMethod);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,25 +4,32 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import { decorateMethodPromise } from '@polkadot/api';
|
||||
import { toPromiseMethod } from '@polkadot/api';
|
||||
|
||||
import contractFlipper from '../../test/contracts/ink/flipper.contract.json';
|
||||
import abiFlipper from '../../test/contracts/ink/flipper.json';
|
||||
import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json';
|
||||
import v0abiFlipper from '../test/contracts/ink/v0/flipper.json';
|
||||
import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json';
|
||||
import { Code } from './Code';
|
||||
import { mockApi } from './mock';
|
||||
|
||||
const wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts/ink/flipper.wasm'));
|
||||
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../test/contracts/ink/v0/flipper.wasm'));
|
||||
|
||||
describe('Code', (): void => {
|
||||
it('can construct with an individual ABI/WASM combo', (): void => {
|
||||
expect(
|
||||
() => new Code(mockApi, abiFlipper, wasmFlipper, decorateMethodPromise)
|
||||
() => new Code(mockApi, v0abiFlipper as Record<string, unknown>, v0wasmFlipper, toPromiseMethod)
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it('can construct with an .contract ABI', (): void => {
|
||||
it('can construct with an .contract ABI (v0)', (): void => {
|
||||
expect(
|
||||
() => new Code(mockApi, contractFlipper, null, decorateMethodPromise)
|
||||
() => new Code(mockApi, v0contractFlipper as Record<string, unknown>, null, toPromiseMethod)
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it.only('can construct with an .contract ABI (v1)', (): void => {
|
||||
expect(
|
||||
() => new Code(mockApi, v1contractFlipper as Record<string, unknown>, null, toPromiseMethod)
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
|
||||
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
|
||||
import type { EventRecord } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { AccountId, EventRecord } from '@polkadot/types/interfaces';
|
||||
import type { ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { Codec } from '@polkadot/types-codec/types';
|
||||
import type { AbiConstructor, BlueprintOptions } from '../types';
|
||||
import type { MapConstructorExec } from './types';
|
||||
|
||||
@@ -19,6 +20,10 @@ import { Blueprint } from './Blueprint';
|
||||
import { Contract } from './Contract';
|
||||
import { createBluePrintTx, encodeSalt } from './util';
|
||||
|
||||
export interface CodeConstructor<ApiType extends ApiTypes> {
|
||||
new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined): Code<ApiType>;
|
||||
}
|
||||
|
||||
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
|
||||
public readonly blueprint?: Blueprint<ApiType>;
|
||||
public readonly contract?: Contract<ApiType>;
|
||||
@@ -36,11 +41,11 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
readonly #tx: MapConstructorExec<ApiType> = {};
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
|
||||
super(api, abi, decorateMethod);
|
||||
|
||||
this.code = isWasm(this.abi.project.source.wasm)
|
||||
? this.abi.project.source.wasm
|
||||
this.code = isWasm(this.abi.info.source.wasm)
|
||||
? this.abi.info.source.wasm
|
||||
: u8aToU8a(wasm);
|
||||
|
||||
assert(isWasm(this.code), 'No WASM code provided');
|
||||
@@ -57,24 +62,34 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
}
|
||||
|
||||
#instantiate = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
|
||||
return this.api.tx.contracts
|
||||
.instantiateWithCode(
|
||||
value,
|
||||
gasLimit,
|
||||
compactAddLength(this.code),
|
||||
this.abi.findConstructor(constructorOrId).toU8a(params),
|
||||
encodeSalt(salt)
|
||||
)
|
||||
.withResultTransform((result: ISubmittableResult) =>
|
||||
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
|
||||
records.reduce<[Blueprint<ApiType>?, Contract<ApiType>?]>(([blueprint, contract], { event }) =>
|
||||
this.api.events.contracts.Instantiated.is(event)
|
||||
? [blueprint, new Contract<ApiType>(this.api, this.abi, event.data[1], this._decorateMethod)]
|
||||
: this.api.events.contracts.CodeStored.is(event)
|
||||
? [new Blueprint<ApiType>(this.api, this.abi, event.data[0], this._decorateMethod), contract]
|
||||
: [blueprint, contract],
|
||||
[])
|
||||
) || []))
|
||||
);
|
||||
}
|
||||
const hasStorageDeposit = this.api.tx.contracts.instantiateWithCode.meta.args.length === 6;
|
||||
const storageDepositLimit = null;
|
||||
const tx = hasStorageDeposit
|
||||
? this.api.tx.contracts.instantiateWithCode(value, gasLimit, storageDepositLimit, compactAddLength(this.code), this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt))
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore old style without storage deposit
|
||||
: this.api.tx.contracts.instantiateWithCode(value, gasLimit, compactAddLength(this.code), this.abi.findConstructor(constructorOrId).toU8a(params), encodeSalt(salt));
|
||||
|
||||
return tx.withResultTransform((result: ISubmittableResult) =>
|
||||
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
|
||||
records.reduce<[Blueprint<ApiType>?, Contract<ApiType>?]>(([blueprint, contract], { event }) =>
|
||||
this.api.events.contracts.Instantiated.is(event)
|
||||
? [blueprint, new Contract<ApiType>(this.api, this.abi, (event as unknown as { data: [Codec, AccountId] }).data[1], this._decorateMethod)]
|
||||
: this.api.events.contracts.CodeStored.is(event)
|
||||
? [new Blueprint<ApiType>(this.api, this.abi, (event as unknown as { data: [AccountId] }).data[0], this._decorateMethod), contract]
|
||||
: [blueprint, contract],
|
||||
[])
|
||||
) || []))
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export function extendCode <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): CodeConstructor<ApiType> {
|
||||
return class extends Code<ApiType> {
|
||||
static __CodeType = type;
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
|
||||
super(api, abi, wasm, decorateMethod);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
|
||||
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
|
||||
import type { Bytes } from '@polkadot/types';
|
||||
import type { AccountId, EventRecord, Weight } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson, ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { AccountId, ContractExecResult, EventRecord, Weight } from '@polkadot/types/interfaces';
|
||||
import type { ISubmittableResult } from '@polkadot/types/types';
|
||||
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent } from '../types';
|
||||
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types';
|
||||
|
||||
@@ -13,13 +13,16 @@ import { map } from 'rxjs';
|
||||
|
||||
import { SubmittableResult } from '@polkadot/api';
|
||||
import { ApiBase } from '@polkadot/api/base';
|
||||
import { createTypeUnsafe } from '@polkadot/types';
|
||||
import { assert, BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { applyOnEvent, extractOptions, isOptions } from '../util';
|
||||
import { Base } from './Base';
|
||||
|
||||
export interface ContractConstructor<ApiType extends ApiTypes> {
|
||||
new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId): Contract<ApiType>;
|
||||
}
|
||||
|
||||
// As per Rust, 5 * GAS_PER_SEC
|
||||
const MAX_CALL_GAS = new BN(5_000_000_000_000).isub(BN_ONE);
|
||||
const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is most probably due to a runtime configuration.';
|
||||
@@ -30,14 +33,14 @@ function createQuery <ApiType extends ApiTypes> (fn: (origin: string | AccountId
|
||||
return (origin: string | AccountId | Uint8Array, options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome> =>
|
||||
isOptions(options)
|
||||
? fn(origin, options, params)
|
||||
: fn(origin, ...extractOptions(options, params));
|
||||
: fn(origin, ...extractOptions<ContractOptions>(options, params));
|
||||
}
|
||||
|
||||
function createTx <ApiType extends ApiTypes> (fn: (options: ContractOptions, params: unknown[]) => SubmittableExtrinsic<ApiType>): ContractTx<ApiType> {
|
||||
return (options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType> =>
|
||||
isOptions(options)
|
||||
? fn(options, params)
|
||||
: fn(...extractOptions(options, params));
|
||||
: fn(...extractOptions<ContractOptions>(options, params));
|
||||
}
|
||||
|
||||
export class ContractSubmittableResult extends SubmittableResult {
|
||||
@@ -60,7 +63,7 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
readonly #tx: MapMessageTx<ApiType> = {};
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, address: string | AccountId, decorateMethod: DecorateMethod<ApiType>) {
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId, decorateMethod: DecorateMethod<ApiType>) {
|
||||
super(api, abi, decorateMethod);
|
||||
|
||||
this.address = this.registry.createType('AccountId', address);
|
||||
@@ -97,37 +100,38 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
? isCall
|
||||
? MAX_CALL_GAS
|
||||
: (this.api.consts.system.blockWeights
|
||||
? this.api.consts.system.blockWeights.maxBlock
|
||||
? (this.api.consts.system.blockWeights as unknown as { maxBlock: Weight }).maxBlock
|
||||
: this.api.consts.system.maximumBlockWeight as Weight
|
||||
).muln(64).div(BN_HUNDRED)
|
||||
: gasLimit;
|
||||
}
|
||||
};
|
||||
|
||||
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): SubmittableExtrinsic<ApiType> => {
|
||||
return this.api.tx.contracts
|
||||
.call(
|
||||
this.address,
|
||||
value,
|
||||
this.#getGas(gasLimit),
|
||||
this.abi.findMessage(messageOrId).toU8a(params)
|
||||
)
|
||||
.withResultTransform((result: ISubmittableResult) =>
|
||||
// ContractEmitted is the current generation, ContractExecution is the previous generation
|
||||
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
|
||||
records
|
||||
.map(({ event: { data: [, data] } }): DecodedEvent | null => {
|
||||
try {
|
||||
return this.abi.decodeEvent(data as Bytes);
|
||||
} catch (error) {
|
||||
l.error(`Unable to decode contract event: ${(error as Error).message}`);
|
||||
const hasStorageDeposit = this.api.tx.contracts.call.meta.args.length === 5;
|
||||
const storageDepositLimit = null;
|
||||
const tx = hasStorageDeposit
|
||||
? this.api.tx.contracts.call(this.address, value, this.#getGas(gasLimit), storageDepositLimit, this.abi.findMessage(messageOrId).toU8a(params))
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore old style without storage deposit
|
||||
: this.api.tx.contracts.call(this.address, value, this.#getGas(gasLimit), this.abi.findMessage(messageOrId).toU8a(params));
|
||||
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter((decoded): decoded is DecodedEvent => !!decoded)
|
||||
))
|
||||
);
|
||||
}
|
||||
return tx.withResultTransform((result: ISubmittableResult) =>
|
||||
// ContractEmitted is the current generation, ContractExecution is the previous generation
|
||||
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
|
||||
records
|
||||
.map(({ event: { data: [, data] } }): DecodedEvent | null => {
|
||||
try {
|
||||
return this.abi.decodeEvent(data as Bytes);
|
||||
} catch (error) {
|
||||
l.error(`Unable to decode contract event: ${(error as Error).message}`);
|
||||
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.filter((decoded): decoded is DecodedEvent => !!decoded)
|
||||
))
|
||||
);
|
||||
};
|
||||
|
||||
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
|
||||
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
|
||||
@@ -136,29 +140,37 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
send: this._decorateMethod((origin: string | AccountId | Uint8Array) =>
|
||||
this.api.rx.rpc.contracts
|
||||
.call({
|
||||
dest: this.address,
|
||||
gasLimit: this.#getGas(gasLimit, true),
|
||||
inputData: message.toU8a(params),
|
||||
origin,
|
||||
value
|
||||
})
|
||||
.pipe(
|
||||
map(({ debugMessage, gasConsumed, gasRequired, result }): ContractCallOutcome => ({
|
||||
debugMessage,
|
||||
gasConsumed,
|
||||
gasRequired: gasRequired && !gasRequired.isZero()
|
||||
? gasRequired
|
||||
: gasConsumed,
|
||||
output: result.isOk && message.returnType
|
||||
? createTypeUnsafe(this.registry, message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
|
||||
: null,
|
||||
result
|
||||
}))
|
||||
)
|
||||
send: this._decorateMethod((origin: string | AccountId | Uint8Array) => {
|
||||
const hasStorageDeposit = this.api.tx.contracts.call.meta.args.length === 5;
|
||||
const rpc = hasStorageDeposit
|
||||
? this.api.rx.rpc.contracts.call({ dest: this.address, gasLimit: this.#getGas(gasLimit, true), inputData: message.toU8a(params), origin, value })
|
||||
: this.api.rx.rpc.contracts.call({ dest: this.address, gasLimit: this.#getGas(gasLimit, true), inputData: message.toU8a(params), origin, value });
|
||||
|
||||
const mapFn = ({ debugMessage, gasConsumed, gasRequired, result }: ContractExecResult): ContractCallOutcome => ({
|
||||
debugMessage,
|
||||
gasConsumed,
|
||||
gasRequired: gasRequired && !gasRequired.isZero()
|
||||
? gasRequired
|
||||
: gasConsumed,
|
||||
output: result.isOk && message.returnType
|
||||
? this.abi.registry.createTypeUnsafe(message.returnType.lookupName || message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
|
||||
: null,
|
||||
result
|
||||
});
|
||||
|
||||
return rpc.pipe(map(mapFn));
|
||||
}
|
||||
)
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function extendContract <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): ContractConstructor<ApiType> {
|
||||
return class extends Contract<ApiType> {
|
||||
static __ContractType = type;
|
||||
|
||||
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
|
||||
super(api, abi, address, decorateMethod);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/api authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { Blueprint, BlueprintSubmittableResult } from './Blueprint';
|
||||
export { Code, CodeSubmittableResult } from './Code';
|
||||
export { Contract } from './Contract';
|
||||
export { Blueprint, BlueprintSubmittableResult, extendBlueprint } from './Blueprint';
|
||||
export { Code, CodeSubmittableResult, extendCode } from './Code';
|
||||
export { Contract, extendContract } from './Contract';
|
||||
|
||||
@@ -20,14 +20,14 @@ export function createBluePrintTx <ApiType extends ApiTypes, R extends Submittab
|
||||
return (options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType, R> =>
|
||||
isOptions(options)
|
||||
? fn(options, params)
|
||||
: fn(...extractOptions(options, params));
|
||||
: fn(...extractOptions<BlueprintOptions>(options, params));
|
||||
}
|
||||
|
||||
export function createBluePrintWithId <T> (fn: (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: unknown[]) => T): ContractGeneric<BlueprintOptions, T> {
|
||||
return (constructorOrId: AbiConstructor | string | number, options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): T =>
|
||||
isOptions(options)
|
||||
? fn(constructorOrId, options, params)
|
||||
: fn(constructorOrId, ...extractOptions(options, params));
|
||||
: fn(constructorOrId, ...extractOptions<BlueprintOptions>(options, params));
|
||||
}
|
||||
|
||||
export function encodeSalt (salt: Uint8Array | string | null = randomAsU8a()): Uint8Array {
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
|
||||
export { Abi } from './Abi';
|
||||
export { packageInfo } from './packageInfo';
|
||||
export { Blueprint as BlueprintPromise, Code as CodePromise, Contract as ContractPromise } from './promise';
|
||||
export { Blueprint as BlueprintRx, Code as CodeRx, Contract as ContractRx } from './rx';
|
||||
|
||||
export * from './promise';
|
||||
export * from './rx';
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
|
||||
// Simple non-runnable checks to test type definitions in the editor itself
|
||||
|
||||
import '@polkadot/api-augment';
|
||||
|
||||
import { ApiPromise } from '@polkadot/api';
|
||||
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
|
||||
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
|
||||
|
||||
import abiIncrementer from '../test/contracts/ink/incrementer.json';
|
||||
import { BlueprintPromise, ContractPromise } from '.';
|
||||
import abiIncrementer from './test/contracts/ink/v0/incrementer.json';
|
||||
|
||||
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
const blueprint = new BlueprintPromise(api, abiIncrementer, '0x1234');
|
||||
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
|
||||
|
||||
// new style
|
||||
await blueprint.tx.new({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
|
||||
@@ -21,7 +23,7 @@ async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<
|
||||
}
|
||||
|
||||
async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
|
||||
const contract = new ContractPromise(api, abiIncrementer, '0x1234');
|
||||
const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
|
||||
|
||||
// queries
|
||||
await contract.query.get(pairs.alice.address, {});
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Auto-generated by @polkadot/dev, do not edit
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '6.0.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', version: '7.0.2' };
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Hash } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { ApiPromise, decorateMethodPromise } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Blueprint as BaseBlueprint } from '../base';
|
||||
|
||||
export class Blueprint extends BaseBlueprint<'promise'> {
|
||||
constructor (api: ApiPromise, abi: AnyJson | Abi, codeHash: string | Hash) {
|
||||
super(api, abi, codeHash, decorateMethodPromise);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@polkadot/api';
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { decorateMethodPromise } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Code as BaseCode } from '../base';
|
||||
|
||||
export class Code extends BaseCode<'promise'> {
|
||||
constructor (api: ApiPromise, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
|
||||
super(api, abi, wasm, decorateMethodPromise);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { ApiPromise, decorateMethodPromise } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Contract as BaseContract } from '../base';
|
||||
|
||||
export class Contract extends BaseContract<'promise'> {
|
||||
constructor (api: ApiPromise, abi: AnyJson | Abi, address: string | AccountId) {
|
||||
super(api, abi, address, decorateMethodPromise);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,27 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { Blueprint } from './Blueprint';
|
||||
export { Code } from './Code';
|
||||
export { Contract } from './Contract';
|
||||
import type { AccountId, Hash } from '@polkadot/types/interfaces';
|
||||
|
||||
import { ApiPromise, toPromiseMethod } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Blueprint, Code, Contract } from '../base';
|
||||
|
||||
export class BlueprintPromise extends Blueprint<'promise'> {
|
||||
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash) {
|
||||
super(api, abi, codeHash, toPromiseMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export class CodePromise extends Code<'promise'> {
|
||||
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
|
||||
super(api, abi, wasm, toPromiseMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export class ContractPromise extends Contract<'promise'> {
|
||||
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
|
||||
super(api, abi, address, toPromiseMethod);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Hash } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { ApiRx, decorateMethodRx } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Blueprint as BaseBlueprint } from '../base';
|
||||
|
||||
export class Blueprint extends BaseBlueprint<'rxjs'> {
|
||||
constructor (api: ApiRx, abi: AnyJson | Abi, codeHash: string | Hash) {
|
||||
super(api, abi, codeHash, decorateMethodRx);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiRx } from '@polkadot/api';
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { decorateMethodRx } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Code as BaseCode } from '../base';
|
||||
|
||||
export class Code extends BaseCode<'rxjs'> {
|
||||
constructor (api: ApiRx, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
|
||||
super(api, abi, wasm, decorateMethodRx);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { AnyJson } from '@polkadot/types/types';
|
||||
|
||||
import { ApiRx, decorateMethodRx } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Contract as BaseContract } from '../base';
|
||||
|
||||
export class Contract extends BaseContract<'rxjs'> {
|
||||
constructor (api: ApiRx, abi: AnyJson | Abi, address: string | AccountId) {
|
||||
super(api, abi, address, decorateMethodRx);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,27 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { Blueprint } from './Blueprint';
|
||||
export { Code } from './Code';
|
||||
export { Contract } from './Contract';
|
||||
import type { AccountId, Hash } from '@polkadot/types/interfaces';
|
||||
|
||||
import { ApiRx, toRxMethod } from '@polkadot/api';
|
||||
|
||||
import { Abi } from '../Abi';
|
||||
import { Blueprint, Code, Contract } from '../base';
|
||||
|
||||
export class BlueprintRx extends Blueprint<'rxjs'> {
|
||||
constructor (api: ApiRx, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash) {
|
||||
super(api, abi, codeHash, toRxMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export class CodeRx extends Code<'rxjs'> {
|
||||
constructor (api: ApiRx, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
|
||||
super(api, abi, wasm, toRxMethod);
|
||||
}
|
||||
}
|
||||
|
||||
export class ContractRx extends Contract<'rxjs'> {
|
||||
constructor (api: ApiRx, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
|
||||
super(api, abi, address, toRxMethod);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 2,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "Hash",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::Hash",
|
||||
"lookupNameRoot": "InkEnvHash"
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,232 @@
|
||||
[
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"lookupName": "InkStorageCollectionsStashEntry",
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"Hash\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup7",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "Hash",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::Hash",
|
||||
"lookupNameRoot": "InkEnvHash",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "Hash",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::Hash",
|
||||
"lookupNameRoot": "InkEnvHash"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 5,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"AccountId\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 9,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 9,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 10,
|
||||
"type": "Result<Null, DnsError>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 11,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 12,
|
||||
"lookupName": "DnsError",
|
||||
"type": "Lookup12"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 11,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 12,
|
||||
"lookupName": "DnsError",
|
||||
"type": "{\"_enum\":[\"NameAlreadyExists\",\"CallerIsNotOwner\"]}",
|
||||
"docs": [],
|
||||
"namespace": "dns::dns::Error",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "NameAlreadyExists"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "CallerIsNotOwner"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 13,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 9,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,252 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 2,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 6,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 9,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"u128\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 12,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 13,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,412 @@
|
||||
[
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup4",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 5,
|
||||
"type": "{\"value\":\"AccountId\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 7,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 8,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 8,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 9,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup4",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 10,
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 11,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup4",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 12,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 12,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 13,
|
||||
"type": "{\"value\":\"bool\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 14,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 14,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 15,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 6,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 16,
|
||||
"type": "Result<Null, Erc721Error>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 17,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 18,
|
||||
"lookupName": "Erc721Error",
|
||||
"type": "Lookup18"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 17,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 18,
|
||||
"lookupName": "Erc721Error",
|
||||
"type": "{\"_enum\":[\"NotOwner\",\"NotApproved\",\"TokenExists\",\"TokenNotFound\",\"CannotInsert\",\"CannotRemove\",\"CannotFetchValue\",\"NotAllowed\"]}",
|
||||
"docs": [],
|
||||
"namespace": "erc721::erc721::Error",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "NotOwner"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "NotApproved"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "TokenExists"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "TokenNotFound"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 4,
|
||||
"name": "CannotInsert"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 5,
|
||||
"name": "CannotRemove"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 6,
|
||||
"name": "CannotFetchValue"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 7,
|
||||
"name": "NotAllowed"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,560 @@
|
||||
[
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 4,
|
||||
"type": "(u32,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 4,
|
||||
"type": "(u32,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 6,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 9,
|
||||
"type": "{\"value\":\"Null\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 11,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 12,
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 13,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"MultisigPlainMultisigPlainTransaction\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 14,
|
||||
"lookupName": "MultisigPlainMultisigPlainTransaction",
|
||||
"type": "Lookup14",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 14,
|
||||
"lookupName": "MultisigPlainMultisigPlainTransaction",
|
||||
"type": "{\"callee\":\"AccountId\",\"selector\":\"[u8;4]\",\"input\":\"Bytes\",\"transferredValue\":\"u128\",\"gasLimit\":\"u64\"}",
|
||||
"docs": [],
|
||||
"namespace": "multisig_plain::multisig_plain::Transaction",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"name": "callee"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 15,
|
||||
"type": "[u8;4]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
"name": "selector"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "input"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 17,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "transferredValue"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 18,
|
||||
"type": "u64",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "gasLimit"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 15,
|
||||
"type": "[u8;4]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 4,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 17,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 18,
|
||||
"type": "u64",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 19,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Vec",
|
||||
"lookupIndex": 20,
|
||||
"type": "Vec<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 21,
|
||||
"type": "(u32,MultisigPlainMultisigPlainConfirmationStatus)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 22,
|
||||
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
|
||||
"type": "Lookup22"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 22,
|
||||
"lookupName": "MultisigPlainMultisigPlainConfirmationStatus",
|
||||
"type": "{\"_enum\":{\"Confirmed\":\"Null\",\"ConfirmationsNeeded\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "multisig_plain::multisig_plain::ConfirmationStatus",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "Confirmed"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "ConfirmationsNeeded"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 23,
|
||||
"type": "Result<Null, Null>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 24,
|
||||
"type": "Result<Bytes, Null>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 25,
|
||||
"type": "Result<Option<Bytes>, Null>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Option",
|
||||
"lookupIndex": 26,
|
||||
"type": "Option<Bytes>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"info": "Null",
|
||||
"lookupIndex": 10,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 26,
|
||||
"type": "Option<Bytes>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 16,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 0,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,204 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 0,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 1,
|
||||
"type": "{\"offsetKey\":\"InkPrimitivesKey\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::lazy::mapping::Mapping",
|
||||
"sub": [
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "InkPrimitivesKey",
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
"typeName": "Key",
|
||||
"name": "offsetKey"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 3,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "InkPrimitivesKey",
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
"typeName": "[u8;32]"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 6,
|
||||
"type": "{\"offsetKey\":\"InkPrimitivesKey\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::lazy::mapping::Mapping",
|
||||
"sub": [
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "InkPrimitivesKey",
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
"typeName": "Key",
|
||||
"name": "offsetKey"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 7,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 8,
|
||||
"type": "Result<Null, Erc20Error>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 9,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "Erc20Error",
|
||||
"type": "Lookup10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 9,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "Erc20Error",
|
||||
"type": "{\"_enum\":[\"InsufficientBalance\",\"InsufficientAllowance\"]}",
|
||||
"docs": [],
|
||||
"namespace": "erc20::erc20::Error",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "InsufficientBalance"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "InsufficientAllowance"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 11,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 0,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u256",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,54 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u256",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 3,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "AccountId",
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,303 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"lookupName": "EnumExampleEnumExampleVariant",
|
||||
"type": "{\"_enum\":{\"None\":\"Null\",\"Weekday\":\"EnumExampleEnumExampleWeekday\",\"TupleMaybeSigned\":\"EnumExampleEnumExampleTupleMaybeSigned\",\"NamedMaybeSigned\":\"EnumExampleEnumExampleNamedMaybeSigned\",\"Color\":\"EnumExampleEnumExampleColor\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Variant",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "None"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "EnumExampleEnumExampleWeekday",
|
||||
"type": "Lookup5",
|
||||
"index": 1,
|
||||
"name": "Weekday"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
|
||||
"type": "Lookup6",
|
||||
"index": 2,
|
||||
"name": "TupleMaybeSigned"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
|
||||
"type": "Lookup7",
|
||||
"index": 3,
|
||||
"name": "NamedMaybeSigned"
|
||||
},
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "EnumExampleEnumExampleColor",
|
||||
"type": "Lookup8",
|
||||
"index": 4,
|
||||
"name": "Color"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 5,
|
||||
"lookupName": "EnumExampleEnumExampleWeekday",
|
||||
"type": "{\"_enum\":[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"]}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Weekday",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "Monday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "Tuesday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "Wednesday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "Thursday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 4,
|
||||
"name": "Friday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 5,
|
||||
"name": "Saturday"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 6,
|
||||
"name": "Sunday"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 6,
|
||||
"lookupName": "EnumExampleEnumExampleTupleMaybeSigned",
|
||||
"type": "{\"_enum\":{\"Signed\":\"i32\",\"Unsigned\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::TupleMaybeSigned",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 0,
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"index": 1,
|
||||
"name": "Unsigned"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "EnumExampleEnumExampleNamedMaybeSigned",
|
||||
"type": "{\"_enum\":{\"Signed\":\"{\\\"value\\\":\\\"i32\\\"}\",\"Unsigned\":\"{\\\"value\\\":\\\"u32\\\"}\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::NamedMaybeSigned",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "i32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"type": "{\"value\":\"i32\"}",
|
||||
"index": 0,
|
||||
"name": "Signed"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
}
|
||||
],
|
||||
"type": "{\"value\":\"u32\"}",
|
||||
"index": 1,
|
||||
"name": "Unsigned"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "EnumExampleEnumExampleColor",
|
||||
"type": "{\"_enum\":{\"Red\":\"Null\",\"Blue\":\"Null\",\"Green\":\"Null\",\"Yellow\":\"Null\",\"Rgb\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\"}\",\"Rgba\":\"{\\\"r\\\":\\\"u8\\\",\\\"g\\\":\\\"u8\\\",\\\"b\\\":\\\"u8\\\",\\\"a\\\":\\\"u8\\\"}\"}}",
|
||||
"docs": [],
|
||||
"namespace": "enum_example::enum_example::Color",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "Red"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "Blue"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "Green"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "Yellow"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "b"
|
||||
}
|
||||
],
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\"}",
|
||||
"index": 4,
|
||||
"name": "Rgb"
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "r"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "g"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "a"
|
||||
}
|
||||
],
|
||||
"type": "{\"r\":\"u8\",\"g\":\"u8\",\"b\":\"u8\",\"a\":\"u8\"}",
|
||||
"index": 5,
|
||||
"name": "Rgba"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,27 @@
|
||||
[
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "RecursiveMyEnum",
|
||||
"type": "{\"_enum\":{\"A\":\"Null\",\"B\":\"RecursiveMyEnum\"}}",
|
||||
"docs": [],
|
||||
"namespace": "recursive::MyEnum",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 0,
|
||||
"name": "A"
|
||||
},
|
||||
{
|
||||
"info": "Si",
|
||||
"lookupIndex": 1,
|
||||
"lookupName": "RecursiveMyEnum",
|
||||
"type": "Lookup1",
|
||||
"typeName": "MyEnum",
|
||||
"index": 1,
|
||||
"name": "B"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,259 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 2,
|
||||
"lookupName": "InkStorageCollectionsStashHeader",
|
||||
"type": "{\"lastVacant\":\"u32\",\"len\":\"u32\",\"lenEntries\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Header",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lastVacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 4,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "VecFixed",
|
||||
"lookupIndex": 6,
|
||||
"type": "[u8;32]",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"length": 32,
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 7,
|
||||
"type": "u8",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "{\"next\":\"u32\",\"prev\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::VacantEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "next"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 9,
|
||||
"lookupName": "InkStorageCollectionsHashmapValueEntry",
|
||||
"type": "{\"value\":\"u128\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 1,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 3,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 8,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup8",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 11,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 12,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 13,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 14,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 5,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import ink from './ink';
|
||||
import solang from './solang';
|
||||
import user from './user';
|
||||
|
||||
const all: Record<string, Record<string, unknown>> = {};
|
||||
|
||||
Object.entries({ ink, solang, user }).forEach(([type, abis]) =>
|
||||
Object.entries(abis).forEach(([name, abi]): void => {
|
||||
all[`${type}_${name}`] = abi;
|
||||
})
|
||||
);
|
||||
|
||||
export default all;
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { createVersionedExport } from '../util';
|
||||
import * as v0 from './v0';
|
||||
import * as v1 from './v1';
|
||||
import * as v2 from './v2';
|
||||
|
||||
export default createVersionedExport({ v0, v1, v2 });
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user