Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e16d20e996 | ||
|
|
bfab0f8538 | ||
|
|
4752a98456 | ||
|
|
e63a3ec6a9 | ||
|
|
4dc30d7d98 | ||
|
|
71f6825b00 | ||
|
|
d56b0bfccc | ||
|
|
39ff956076 | ||
|
|
faa22fc634 | ||
|
|
f5ce395371 | ||
|
|
b986d4cb5d | ||
|
|
9c39cd9255 | ||
|
|
43e2c44ac1 | ||
|
|
3507a74d60 | ||
|
|
97797d64f1 | ||
|
|
88d7207102 | ||
|
|
1616b014b3 | ||
|
|
c20538f6f7 | ||
|
|
e77c2dd78c | ||
|
|
6e7ce901ab | ||
|
|
3396ed6010 | ||
|
|
09ec89ae62 | ||
|
|
a7d78ff6eb | ||
|
|
868043a22b | ||
|
|
0310582056 | ||
|
|
629b9b486e | ||
|
|
500e2022c3 | ||
|
|
f8c2701751 | ||
|
|
d70ef05b54 | ||
|
|
4b1d4c7335 | ||
|
|
c79939e650 | ||
|
|
8f298ba2a0 | ||
|
|
da6311d584 | ||
|
|
d589adf208 | ||
|
|
dfbfaf12eb | ||
|
|
91989e1a2b | ||
|
|
86c2a96ed4 | ||
|
|
9f3dab39c0 | ||
|
|
a02687c9fb | ||
|
|
80399fefcd | ||
|
|
ff9a0b3d44 | ||
|
|
8df82af638 | ||
|
|
ddfcc5624c | ||
|
|
7b08fbb695 | ||
|
|
07d85783d8 | ||
|
|
f0d6fc0167 | ||
|
|
7b085307f8 | ||
|
|
e22a38dd9c | ||
|
|
2ceb727ee6 | ||
|
|
bc4e656745 | ||
|
|
6d2b3b8463 | ||
|
|
5369b6cb10 | ||
|
|
53fd71b732 | ||
|
|
63e38b3d1c | ||
|
|
cd98ac65f3 | ||
|
|
7bd0819cbb | ||
|
|
e84c2a5180 | ||
|
|
aabf4b3e45 | ||
|
|
0f67d3e54d | ||
|
|
8cbc36550b | ||
|
|
25c46f2a0d |
@@ -1 +1,3 @@
|
||||
Jaco <jacogr@gmail.com>
|
||||
github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> <action@github.com>
|
||||
github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Github Actions <action@github.com>
|
||||
|
||||
+36
-2
@@ -1,5 +1,39 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 7.5.1 Jan 23, 2022
|
||||
|
||||
Upgrade priority: Low. Recommended for users of the latest contract pallet and ink! versions.
|
||||
|
||||
Contributed:
|
||||
|
||||
- Add additional namespaced contract tests (Thanks to https://github.com/VargSupercolony)
|
||||
|
||||
Changes:
|
||||
|
||||
- Adjust `Registry` consistency, augment extensions
|
||||
- Add `.multi` support on `api.at(...).<section>.<method>`
|
||||
- Add support for ink! metadata V3 with payable constructors
|
||||
- Cleanup ink! metadata parsing, allowing for easier extension
|
||||
- Expose `contract.{query, tx}.<method>.meta`, aligning with API
|
||||
- Fix storage metadata, aligning method with decorated name
|
||||
- Adjust typegen, only using exportInterface
|
||||
- Added Kusama/Polkadot 9151 upgrade block (known types)
|
||||
- Update to latest Substrate, Kusama & Polkadot static metadata
|
||||
|
||||
|
||||
## 7.4.1 Jan 15, 2022
|
||||
|
||||
Upgrade priority: Medium. Required for all chains using `Range` and `RangeInclusive` types. Also includes better error handling for number conversions.
|
||||
|
||||
Changes:
|
||||
|
||||
- Asserts for invalid number format inputs (MAX_SAFE_INTEGER, float)
|
||||
- Ensure `Range/RangeInclusive` variant check does not fail on encoding
|
||||
- Ensure non-option calls in api-contract are marked as `@deprecated`
|
||||
- Added Kusama 9150 upgrade block (known types)
|
||||
- Update `@polkadot/util` to 8.3.2
|
||||
|
||||
|
||||
## 7.3.1 Jan 9, 2022
|
||||
|
||||
Upgrade priority: Low. Maintenance upgrade, tracking the latest `@polkadot` libraries.
|
||||
@@ -57,9 +91,9 @@ Changes:
|
||||
|
||||
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 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 restore old behavior. A full writeup of the rationale and other options can be found [in the FAQ](https://polkadot.js.org/docs/api/FAQ#since-upgrading-to-the-7x-series-typescript-augmentation-is-missing)
|
||||
|
||||
- **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.
|
||||
- **Breaking change** To cater for the above, chain-specific interfaces generated with older versions may not be compatible 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:
|
||||
|
||||
|
||||
+92
-91
@@ -1,91 +1,92 @@
|
||||
2752 Jaco
|
||||
83 Amaury Martiny
|
||||
36 Keith Ingram
|
||||
35 Stefanie Doll
|
||||
20 Luke Schoen
|
||||
15 Jeremías Díaz
|
||||
15 Xiliang Chen
|
||||
11 Ian He
|
||||
10 Axel Chalon
|
||||
5 Chevdor
|
||||
5 Jake Naviasky
|
||||
4 Alex Wang
|
||||
4 Alexander Popiak
|
||||
4 Joshy Orndorff
|
||||
4 Nantian
|
||||
4 Thibaut Sardan
|
||||
3 Alex D
|
||||
3 André Silva
|
||||
3 Antoine Estienne
|
||||
3 Arjan Zijderveld
|
||||
3 Ewa Kowalska
|
||||
3 hamidra
|
||||
3 Hamza Tokuchi
|
||||
3 Julien Eluard
|
||||
3 KarishmaBothara
|
||||
3 Miguel Hervas
|
||||
3 Shawn Tabrizi
|
||||
3 YJ
|
||||
2 Alexander Krupenkin
|
||||
2 Branan Riley
|
||||
2 Caio
|
||||
2 Jakub Pánik
|
||||
2 James Lefrère
|
||||
2 Keith Yeung
|
||||
2 Nikos Kontakis
|
||||
2 Paweł Nguyen
|
||||
2 sung wu
|
||||
2 Veliko
|
||||
2 Wei Tang
|
||||
2 扩散性百万甜面包
|
||||
1 Andreea Eftene
|
||||
1 Brad Larson
|
||||
1 chriswmercer
|
||||
1 codingsh
|
||||
1 Dan Forbes
|
||||
1 Daniel Maricic
|
||||
1 Daniel Savu
|
||||
1 David
|
||||
1 Denis Tsai
|
||||
1 djuanito.eth
|
||||
1 Drew Stone
|
||||
1 Dylan Galea
|
||||
1 flex
|
||||
1 Furqan A
|
||||
1 Gerben van de Wiel
|
||||
1 HackFisher
|
||||
1 Hoani Bryson
|
||||
1 Hyungsuk Kang
|
||||
1 icodezjb
|
||||
1 iiiiiiii
|
||||
1 JesseAbram
|
||||
1 Joey
|
||||
1 Jordan
|
||||
1 JQQQ
|
||||
1 Kian Paimani
|
||||
1 Krzysztof Jelski
|
||||
1 Lae
|
||||
1 Lezek123
|
||||
1 Lovesh Harchandani
|
||||
1 Mario Neises
|
||||
1 Mario Pino
|
||||
1 Mark Robert Henderson
|
||||
1 Matej Nemček
|
||||
1 Mokhtar Naamani
|
||||
1 Nazar Mokrynskyi
|
||||
1 Nikhil Ranjan
|
||||
1 Nikolay Volf
|
||||
1 Paul M Fox
|
||||
1 philipstanislaus
|
||||
1 qiuhao
|
||||
1 Rocco Musolino
|
||||
1 satellitex
|
||||
1 satellitex
|
||||
1 Satyam Agrawal
|
||||
1 Sean Young
|
||||
1 Sergei Pepyakin
|
||||
1 WoeOm
|
||||
1 Xat_MassacrE
|
||||
1 yjh
|
||||
1 Yuri
|
||||
1 Zeke Mostov
|
||||
2782 Jaco 7.5.1 (#4492)
|
||||
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
|
||||
36 Keith Ingram Storage deposit limit changes (#4370)
|
||||
35 Stefanie Doll Updated child storage parameters (#1709)
|
||||
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
|
||||
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
|
||||
15 Xiliang Chen add Authority origin (#3645)
|
||||
11 Ian He HttpProvider support clone() (#3949)
|
||||
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
|
||||
5 Chevdor Fix metadata package link (#3458)
|
||||
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
|
||||
4 Alex Wang fix issue that creates duplicate providers (#983)
|
||||
4 Alexander Popiak Add asset id in signing (#4009)
|
||||
4 Joshy Orndorff spelling; efect -> effect (#2295)
|
||||
4 Nantian fix bigint type (#3869)
|
||||
4 Thibaut Sardan no subscription for http (#3127)
|
||||
3 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
|
||||
3 André Silva add support for ValidationCodeHash (#3640)
|
||||
3 Antoine Estienne Adapted to display moonbeam author (#3108)
|
||||
3 Arjan Zijderveld Added `Emergency` to `ElectionPhase` (#3707)
|
||||
3 Ewa Kowalska Handle no council for bounties proposals (#3062)
|
||||
3 hamidra add support for n key entries for NMaps (#3886)
|
||||
3 Hamza Tokuchi more typos (#2532)
|
||||
3 Julien Eluard Fixed typos about module balances (#1402)
|
||||
3 KarishmaBothara Backward compatibility thing (#3511)
|
||||
3 Miguel Hervas Adding RT4 Types (#3007)
|
||||
3 Shawn Tabrizi Add `isReadyOrError` when connecting to API (#2577)
|
||||
3 YJ feat: Vote interface as U8a (#1061)
|
||||
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
|
||||
2 Branan Riley Add proxy type for Centrifuge (#3940)
|
||||
2 Caio Add `Range` and `RangeInclusive` types (#3791)
|
||||
2 Jakub Pánik All heads subscription (#1899)
|
||||
2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405)
|
||||
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
|
||||
2 Nikos Kontakis Add auction in shared types (#4085)
|
||||
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
|
||||
2 sung wu Update tx.md (#2485)
|
||||
2 Veliko Abi constructor takes different parameters (#3347)
|
||||
2 Wei Tang Use /usr/bin/env bash instead of /bin/bash (#2053)
|
||||
2 扩散性百万甜面包 Typo, deocrateMethod -> decorateMethod (#1594)
|
||||
1 Andreea Eftene Add storage deposit support (#4304)
|
||||
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
|
||||
1 chriswmercer little readme tweak (#279)
|
||||
1 codingsh #2182 - add: search for docs (#2232)
|
||||
1 Dan Forbes Add WeightToFeeCoefficient type (#2296)
|
||||
1 Daniel Maricic Fixed typo in README (#2402)
|
||||
1 Daniel Savu fix: Generate custom type definitions (#4224)
|
||||
1 David Don't log full error (#2952)
|
||||
1 Denis Tsai realign AccountKey20Junction to polkadot xcm's Junction enum (#3770)
|
||||
1 djuanito.eth Update fees to current constants (#2320)
|
||||
1 Drew Stone Update evm definitions to include vicinity (#2279)
|
||||
1 Dylan Galea Updated users of the polkadot-js/api (#2027)
|
||||
1 flex Change BeefySignedCommitment signatures type to EcdsaSignature (#4204)
|
||||
1 Furqan A fix: fixed 404 to the docs from the api readme (#3985)
|
||||
1 Gerben van de Wiel Adding some extra notes on changes in the specname (#2329)
|
||||
1 HackFisher fix OutboundLaneData types (#3992)
|
||||
1 Hoani Bryson Multiple Endpoint support for WsProvider (#2234)
|
||||
1 Hyungsuk Kang Update fees.ts (#1014)
|
||||
1 icodezjb Update SessionKeys (#3035)
|
||||
1 iiiiiiii Make unknownTypes externally accessible (#3263)
|
||||
1 JesseAbram added 07 Example showing how to make a transfer with allowed block permissions folder in docs (#1062)
|
||||
1 Joey don't throw error at `onSocketClose` (#4363)
|
||||
1 Jordan Allow typegen for custom RPCs (#2876)
|
||||
1 JQQQ Allow rpc expose definition/ metadata (#3488)
|
||||
1 Kian Paimani Update definitions.ts (#2514)
|
||||
1 Krzysztof Jelski Derive for bounties and descriptions (#2925)
|
||||
1 Lae Make sure awaiting on an api object won't stuck forever on error (#1763)
|
||||
1 Lezek123 BTreeSet and BTreeMap - encoding and serialization fixes (#3789)
|
||||
1 Lovesh Harchandani Fix name of "getBlock" in package "api-derive" and export it in "index.ts" (#2857)
|
||||
1 Mario Neises fix usage with typescript (#405)
|
||||
1 Mario Pino Add PolkaStats to API users (#1593)
|
||||
1 Mark Robert Henderson Update warnings.ts to have the latest URLs (#2720)
|
||||
1 Matej Nemček added Kodadot to @polkadot/api users section (#2220)
|
||||
1 Mokhtar Naamani Disable websocket outgoing message fragmentation for w3cwebsocket (#2738)
|
||||
1 Nazar Mokrynskyi Performance tweaks (#4143)
|
||||
1 Nikhil Ranjan add vestingPerBlock and vestingEndBlock in DeriveBalancesAll when doing calcBalances (#2563)
|
||||
1 Nikolay Volf Fix typo (#1730)
|
||||
1 Oleksandr Mykhailenko Add more complex namespaced contracts & test cases for them (#4472)
|
||||
1 Paul M Fox Basic BTreeMaps codec support (#1474)
|
||||
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
|
||||
1 qiuhao update DeriveCustom type (#2581)
|
||||
1 Rocco Musolino remove broken link (#2671)
|
||||
1 satellitex Add BTreeSet<V> Codec (#1639)
|
||||
1 satellitex Add traits replace rules. for invalid cases `::<type>` and `<type>::`. (#885)
|
||||
1 Satyam Agrawal update as per the 0.97.0-beta.38 release (#1617)
|
||||
1 Sean Young Solang requires u256 and i256 types (#2752)
|
||||
1 Sergei Pepyakin INK! -> ink! (#1347)
|
||||
1 WoeOm adapt Darwinia, Crab Network types (#3498)
|
||||
1 Xat_MassacrE Fix packages/types/src/codec/utils/encodeTypes.ts encodeSubTypes bug (#1544)
|
||||
1 yjh fix MetadataVersioned.asV12 (#2983)
|
||||
1 Yuri fixes #3693 Fix uniques return types (#3694)
|
||||
1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286)
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"sideEffects": false,
|
||||
"type": "commonjs",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"workspaces": [
|
||||
"packages/*"
|
||||
],
|
||||
@@ -31,15 +31,15 @@
|
||||
"test:watch": "polkadot-dev-run-test --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.7",
|
||||
"@babel/register": "^7.16.7",
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/register": "^7.16.9",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/dev": "^0.65.23",
|
||||
"@polkadot/dev": "^0.65.43",
|
||||
"@polkadot/typegen": "workspace:packages/typegen",
|
||||
"@types/jest": "^27.4.0",
|
||||
"copyfiles": "^2.4.1"
|
||||
},
|
||||
"resolutions": {
|
||||
"typescript": "^4.5.3"
|
||||
"typescript": "^4.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,15 +20,15 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api-base": "7.3.1",
|
||||
"@polkadot/rpc-augment": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-augment": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1"
|
||||
"@polkadot/api-base": "7.5.1",
|
||||
"@polkadot/rpc-augment": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-augment": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1022,6 +1022,11 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Para is not registered in our system.
|
||||
**/
|
||||
NotRegistered: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism
|
||||
* is disabled.
|
||||
**/
|
||||
PvfCheckDisabled: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given validator already has cast a vote.
|
||||
**/
|
||||
|
||||
@@ -574,6 +574,21 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A new head has been noted for a Para. `para_id`
|
||||
**/
|
||||
NewHeadNoted: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* The given validation code was rejected by the PVF pre-checking vote.
|
||||
* `code_hash` `para_id`
|
||||
**/
|
||||
PvfCheckAccepted: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
/**
|
||||
* The given validation code was accepted by the PVF pre-checking vote.
|
||||
* `code_hash` `para_id`
|
||||
**/
|
||||
PvfCheckRejected: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
/**
|
||||
* The given para either initiated or subscribed to a PVF check for the given validation
|
||||
* code. `code_hash` `para_id`
|
||||
**/
|
||||
PvfCheckStarted: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
|
||||
@@ -139,7 +139,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Set the balances of a given account.
|
||||
*
|
||||
* This will alter `FreeBalance` and `ReservedBalance` in storage. it will
|
||||
* also decrease the total issuance of the system (`TotalIssuance`).
|
||||
* also alter the total issuance of the system (`TotalIssuance`) appropriately.
|
||||
* If the new free or reserved balance is below the existential deposit,
|
||||
* it will reset the account nonce (`frame_system::AccountNonce`).
|
||||
*
|
||||
@@ -150,7 +150,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Transfer some liquid free balance to another account.
|
||||
*
|
||||
* `transfer` will set the `FreeBalance` of the sender and receiver.
|
||||
* It will decrease the total issuance of the system by the `TransferFee`.
|
||||
* If the sender's account is below the existential deposit as a result
|
||||
* of the transfer, the account will be reaped.
|
||||
*
|
||||
@@ -2133,7 +2132,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - be less than the number of possible candidates. Note that all current members and
|
||||
* runners-up are also automatically candidates for the next round.
|
||||
*
|
||||
* If `value` is more than `who`'s total balance, then the maximum of the two is used.
|
||||
* If `value` is more than `who`'s free balance, then the maximum of the two is used.
|
||||
*
|
||||
* The dispatch origin of this call must be signed.
|
||||
*
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -983,6 +983,11 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* Para is not registered in our system.
|
||||
**/
|
||||
NotRegistered: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism
|
||||
* is disabled.
|
||||
**/
|
||||
PvfCheckDisabled: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The given validator already has cast a vote.
|
||||
**/
|
||||
|
||||
@@ -552,6 +552,21 @@ declare module '@polkadot/api-base/types/events' {
|
||||
* A new head has been noted for a Para. `para_id`
|
||||
**/
|
||||
NewHeadNoted: AugmentedEvent<ApiType, [u32]>;
|
||||
/**
|
||||
* The given validation code was rejected by the PVF pre-checking vote.
|
||||
* `code_hash` `para_id`
|
||||
**/
|
||||
PvfCheckAccepted: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
/**
|
||||
* The given validation code was accepted by the PVF pre-checking vote.
|
||||
* `code_hash` `para_id`
|
||||
**/
|
||||
PvfCheckRejected: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
/**
|
||||
* The given para either initiated or subscribed to a PVF check for the given validation
|
||||
* code. `code_hash` `para_id`
|
||||
**/
|
||||
PvfCheckStarted: AugmentedEvent<ApiType, [H256, u32]>;
|
||||
/**
|
||||
* Generic event
|
||||
**/
|
||||
|
||||
@@ -139,7 +139,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Set the balances of a given account.
|
||||
*
|
||||
* This will alter `FreeBalance` and `ReservedBalance` in storage. it will
|
||||
* also decrease the total issuance of the system (`TotalIssuance`).
|
||||
* also alter the total issuance of the system (`TotalIssuance`) appropriately.
|
||||
* If the new free or reserved balance is below the existential deposit,
|
||||
* it will reset the account nonce (`frame_system::AccountNonce`).
|
||||
*
|
||||
@@ -150,7 +150,6 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* Transfer some liquid free balance to another account.
|
||||
*
|
||||
* `transfer` will set the `FreeBalance` of the sender and receiver.
|
||||
* It will decrease the total issuance of the system by the `TransferFee`.
|
||||
* If the sender's account is below the existential deposit as a result
|
||||
* of the transfer, the account will be reaped.
|
||||
*
|
||||
@@ -2075,7 +2074,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - be less than the number of possible candidates. Note that all current members and
|
||||
* runners-up are also automatically candidates for the next round.
|
||||
*
|
||||
* If `value` is more than `who`'s total balance, then the maximum of the two is used.
|
||||
* If `value` is more than `who`'s free balance, then the maximum of the two is used.
|
||||
*
|
||||
* The dispatch origin of this call must be signed.
|
||||
*
|
||||
|
||||
@@ -255,6 +255,12 @@ declare module '@polkadot/api-base/types/errors' {
|
||||
* No code could be found at the supplied code hash.
|
||||
**/
|
||||
CodeNotFound: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The contract's code was found to be invalid during validation or instrumentation.
|
||||
* A more detailed error can be found on the node console if debug messages are enabled
|
||||
* or in the debug buffer which is returned to RPC clients.
|
||||
**/
|
||||
CodeRejected: AugmentedError<ApiType>;
|
||||
/**
|
||||
* The code supplied to `instantiate_with_code` exceeds the limit specified in the
|
||||
* current schedule.
|
||||
|
||||
@@ -1624,7 +1624,7 @@ declare module '@polkadot/api-base/types/submittable' {
|
||||
* - be less than the number of possible candidates. Note that all current members and
|
||||
* runners-up are also automatically candidates for the next round.
|
||||
*
|
||||
* If `value` is more than `who`'s total balance, then the maximum of the two is used.
|
||||
* If `value` is more than `who`'s free balance, then the maximum of the two is used.
|
||||
*
|
||||
* The dispatch origin of this call must be signed.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/kusama/*.ts",
|
||||
"**/polkadot/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/kusama/*.ts",
|
||||
"**/polkadot/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-augment" }
|
||||
]
|
||||
}
|
||||
@@ -10,10 +10,10 @@
|
||||
"**/kusama/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-augment" }
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
"**/polkadot/*.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-augment" }
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/rpc-core": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"rxjs": "^7.5.1"
|
||||
"@polkadot/rpc-core": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" }
|
||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/types-create": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"@polkadot/util-crypto": "^8.3.1",
|
||||
"rxjs": "^7.5.1"
|
||||
"@polkadot/api": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/types-create": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "7.3.1",
|
||||
"@polkadot/keyring": "^8.3.1"
|
||||
"@polkadot/api-augment": "7.5.1",
|
||||
"@polkadot/keyring": "^8.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ interface JSONAbi {
|
||||
},
|
||||
V2: {
|
||||
spec: SpecDef;
|
||||
},
|
||||
V3: {
|
||||
spec: SpecDef;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,10 +59,10 @@ describe('Abi', (): void => {
|
||||
|
||||
it(`initializes from a contract ABI (${abiName})`, (): void => {
|
||||
try {
|
||||
const messageIds = (abi.V2 || abi.V1 || abi).spec.messages.map(({ label, name }) =>
|
||||
const messageIds = (abi.V3 || abi.V2 || abi.V1 || abi).spec.messages.map(({ label, name }) =>
|
||||
label || (
|
||||
Array.isArray(name)
|
||||
? name[0]
|
||||
? name.join('::')
|
||||
: name
|
||||
)
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ 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';
|
||||
import { convertVersions, enumVersions } from './toLatest';
|
||||
|
||||
const l = logger('Abi');
|
||||
|
||||
@@ -26,23 +26,18 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
|
||||
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 vx = enumVersions.find((v) => isObject(json[v]));
|
||||
const metadata = registry.createType('ContractMetadata',
|
||||
isObject(json.V2)
|
||||
? { V2: json.V2 }
|
||||
: isObject(json.V1)
|
||||
? { V1: json.V1 }
|
||||
: { V0: json }
|
||||
vx
|
||||
? { [vx]: json[vx] }
|
||||
: { V0: json }
|
||||
) as unknown as ContractMetadata;
|
||||
const converter = convertVersions.find(([v]) => metadata[`is${v}`]);
|
||||
|
||||
return metadata.isV2
|
||||
? metadata.asV2
|
||||
: metadata.isV1
|
||||
? v1ToLatest(registry, metadata.asV1)
|
||||
: v0ToLatest(registry, metadata.asV0);
|
||||
assert(converter, () => `Unable to convert ABI with version ${metadata.type} to latest`);
|
||||
|
||||
return converter[1](registry, metadata[`as${converter[0]}`]);
|
||||
}
|
||||
|
||||
function parseJson (json: Record<string, unknown>, chainProperties?: ChainProperties): [Record<string, unknown>, Registry, ContractMetadataLatest, ContractProjectInfo] {
|
||||
@@ -90,7 +85,8 @@ export class Abi {
|
||||
);
|
||||
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpecLatest, index) =>
|
||||
this.#createMessage(spec, index, {
|
||||
isConstructor: true
|
||||
isConstructor: true,
|
||||
isPayable: spec.payable.isTrue
|
||||
})
|
||||
);
|
||||
this.events = this.metadata.spec.events.map((spec: ContractEventSpecLatest, index) =>
|
||||
@@ -209,6 +205,7 @@ export class Abi {
|
||||
identifier,
|
||||
index,
|
||||
method: stringCamelCase(identifier),
|
||||
path: identifier.split('::').map((s) => stringCamelCase(s)),
|
||||
selector: spec.selector,
|
||||
toU8a: (params: unknown[]) =>
|
||||
this.#encodeArgs(spec, args, params)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { v0ToLatest, v1ToLatest } from '@polkadot/api-contract/Abi/toLatest';
|
||||
import { v0ToLatest, v1ToLatest, v2ToLatest, v3ToLatest } from '@polkadot/api-contract/Abi/toLatest';
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
|
||||
import abis from '../test/contracts';
|
||||
@@ -65,9 +65,58 @@ describe('v1ToLatest', (): void => {
|
||||
).toEqual(['flip', 'get']);
|
||||
});
|
||||
|
||||
it('has the correct messages with namespaced method name', (): void => {
|
||||
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_psp22.V1 });
|
||||
const latest = v1ToLatest(registry, contract.asV1);
|
||||
|
||||
expect(
|
||||
latest.spec.messages.map(({ label }) => label.toString())
|
||||
).toEqual([
|
||||
'PSP22Metadata::token_name', 'PSP22Metadata::token_symbol', 'PSP22Metadata::token_decimals', 'PSP22Mintable::mint', 'PSP22::decrease_allowance', 'PSP22::transfer', 'PSP22::approve', 'PSP22::allowance', 'PSP22::transfer_from', 'PSP22::balance_of', 'PSP22::increase_allowance', 'PSP22::total_supply', 'pause', 'unpause'
|
||||
]);
|
||||
});
|
||||
|
||||
it('has the correct constructor arguments', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors[0].args.map(({ label }) => label.toString())
|
||||
).toEqual(['init_value']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('v2ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V2: abis.ink_v2_flipper.V2 });
|
||||
const latest = v2ToLatest(registry, contract.asV2);
|
||||
|
||||
it('has the correct constructor flag', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors[0].payable.isTrue
|
||||
).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('v3ToLatest', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
const contract = registry.createType('ContractMetadata', { V3: abis.ink_v3_flipper.V3 });
|
||||
const latest = v3ToLatest(registry, contract.asV3);
|
||||
|
||||
it('has the correct constructor flags', (): void => {
|
||||
expect(
|
||||
latest.spec.constructors[0].payable.isTrue
|
||||
).toEqual(false);
|
||||
expect(
|
||||
latest.spec.constructors[1].payable.isTrue
|
||||
).toEqual(true);
|
||||
});
|
||||
|
||||
it('has the correct messages', (): void => {
|
||||
const contract = registry.createType('ContractMetadata', { V3: abis.ink_v3_traitErc20.V3 });
|
||||
const latest = v3ToLatest(registry, contract.asV3);
|
||||
|
||||
expect(
|
||||
latest.spec.messages.map(({ label }) => label.toString())
|
||||
).toEqual([
|
||||
'BaseErc20::total_supply', 'BaseErc20::balance_of', 'BaseErc20::allowance', 'BaseErc20::transfer', 'BaseErc20::approve', 'BaseErc20::transfer_from'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,16 +1,38 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1 } from '@polkadot/types/interfaces';
|
||||
import type { ContractMetadataLatest, ContractMetadataV3 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { v0ToV1 } from './toV1';
|
||||
import { v1ToV2 } from './toV2';
|
||||
import { v2ToV3 } from './toV3';
|
||||
|
||||
export function v1ToLatest (registry: Registry, v1: ContractMetadataV1): ContractMetadataLatest {
|
||||
return v1ToV2(registry, v1);
|
||||
type Versions = 'V3' | 'V2' | 'V1' | 'V0';
|
||||
|
||||
type Converter = (registry: Registry, vx: any) => ContractMetadataLatest;
|
||||
|
||||
// Helper to convert metadata from one step to the next
|
||||
function createConverter <I, O> (next: (registry: Registry, input: O) => ContractMetadataLatest, step: (registry: Registry, input: I) => O): (registry: Registry, input: I) => ContractMetadataLatest {
|
||||
return (registry: Registry, input: I): ContractMetadataLatest =>
|
||||
next(registry, step(registry, input));
|
||||
}
|
||||
|
||||
export function v0ToLatest (registry: Registry, v0: ContractMetadataV0): ContractMetadataLatest {
|
||||
return v1ToLatest(registry, v0ToV1(registry, v0));
|
||||
export function v3ToLatest (registry: Registry, v3: ContractMetadataV3): ContractMetadataLatest {
|
||||
return v3;
|
||||
}
|
||||
|
||||
export const v2ToLatest = createConverter(v3ToLatest, v2ToV3);
|
||||
export const v1ToLatest = createConverter(v2ToLatest, v1ToV2);
|
||||
export const v0ToLatest = createConverter(v1ToLatest, v0ToV1);
|
||||
|
||||
// The versions where an enum is used, aka V0 is missing
|
||||
// (Order from newest, i.e. we expect more on newest vs oldest)
|
||||
export const enumVersions = ['V3', 'V2', 'V1'];
|
||||
|
||||
export const convertVersions: [Versions, Converter][] = [
|
||||
['V3', v3ToLatest],
|
||||
['V2', v2ToLatest],
|
||||
['V1', v1ToLatest],
|
||||
['V0', v0ToLatest]
|
||||
];
|
||||
|
||||
@@ -7,8 +7,25 @@ import type { Registry } from '@polkadot/types/types';
|
||||
import { convertSiV0toV1 } from '@polkadot/types';
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
interface Named {
|
||||
name: unknown;
|
||||
}
|
||||
|
||||
function v0ToV1Names (all: Named[]): unknown[] {
|
||||
return all.map((e) =>
|
||||
objectSpread({}, e, {
|
||||
name: Array.isArray(e.name)
|
||||
? e.name
|
||||
: [e.name]
|
||||
}));
|
||||
}
|
||||
|
||||
export function v0ToV1 (registry: Registry, v0: ContractMetadataV0): ContractMetadataV1 {
|
||||
return registry.createType('ContractMetadataV1', objectSpread({}, v0, {
|
||||
spec: objectSpread({}, v0.spec, {
|
||||
constructors: v0ToV1Names(v0.spec.constructors),
|
||||
messages: v0ToV1Names(v0.spec.messages)
|
||||
}),
|
||||
types: convertSiV0toV1(registry, v0.types)
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ const ARG_TYPES = {
|
||||
function v1ToV2Label (entry: NamedEntry): { label: Text } {
|
||||
return objectSpread({}, entry, {
|
||||
label: Array.isArray(entry.name)
|
||||
? entry.name[0]
|
||||
? entry.name.join('::')
|
||||
: entry.name
|
||||
});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ContractMetadataV2, ContractMetadataV3 } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
export function v2ToV3 (registry: Registry, v2: ContractMetadataV2): ContractMetadataV3 {
|
||||
return registry.createType('ContractMetadataV3', objectSpread({}, v2, {
|
||||
spec: objectSpread({}, v2.spec, {
|
||||
constructors: v2.spec.constructors.map((c) =>
|
||||
// V3 introduces the payable flag on constructors, for <V3, it is always true
|
||||
registry.createType('ContractConstructorSpecV3', objectSpread({}, c, { payable: true }))
|
||||
)
|
||||
})
|
||||
}));
|
||||
}
|
||||
@@ -47,7 +47,7 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
this.abi.constructors.forEach((c): void => {
|
||||
if (isUndefined(this.#tx[c.method])) {
|
||||
this.#tx[c.method] = createBluePrintTx((o, p) => this.#deploy(c, o, p));
|
||||
this.#tx[c.method] = createBluePrintTx(c, (o, p) => this.#deploy(c, o, p));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
this.abi.constructors.forEach((c): void => {
|
||||
if (isUndefined(this.#tx[c.method])) {
|
||||
this.#tx[c.method] = createBluePrintTx((o, p) => this.#instantiate(c, o, p));
|
||||
this.#tx[c.method] = createBluePrintTx(c, (o, p) => this.#instantiate(c, o, p));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import { assert, BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefine
|
||||
import { Abi } from '../Abi';
|
||||
import { applyOnEvent, extractOptions, isOptions } from '../util';
|
||||
import { Base } from './Base';
|
||||
import { withMeta } from './util';
|
||||
|
||||
export interface ContractConstructor<ApiType extends ApiTypes> {
|
||||
new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId): Contract<ApiType>;
|
||||
@@ -29,18 +30,20 @@ const ERROR_NO_CALL = 'Your node does not expose the contracts.call RPC. This is
|
||||
|
||||
const l = logger('Contract');
|
||||
|
||||
function createQuery <ApiType extends ApiTypes> (fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: unknown[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> {
|
||||
return (origin: string | AccountId | Uint8Array, options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome> =>
|
||||
function createQuery <ApiType extends ApiTypes> (meta: AbiMessage, fn: (origin: string | AccountId | Uint8Array, options: ContractOptions, params: unknown[]) => ContractCallResult<ApiType, ContractCallOutcome>): ContractQuery<ApiType> {
|
||||
return withMeta(meta, (origin: string | AccountId | Uint8Array, options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome> =>
|
||||
isOptions(options)
|
||||
? fn(origin, options, params)
|
||||
: fn(origin, ...extractOptions<ContractOptions>(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> =>
|
||||
function createTx <ApiType extends ApiTypes> (meta: AbiMessage, fn: (options: ContractOptions, params: unknown[]) => SubmittableExtrinsic<ApiType>): ContractTx<ApiType> {
|
||||
return withMeta(meta, (options: bigint | string | number | BN | ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType> =>
|
||||
isOptions(options)
|
||||
? fn(options, params)
|
||||
: fn(...extractOptions<ContractOptions>(options, params));
|
||||
: fn(...extractOptions<ContractOptions>(options, params))
|
||||
);
|
||||
}
|
||||
|
||||
export class ContractSubmittableResult extends SubmittableResult {
|
||||
@@ -70,11 +73,11 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
|
||||
|
||||
this.abi.messages.forEach((m): void => {
|
||||
if (isUndefined(this.#tx[m.method])) {
|
||||
this.#tx[m.method] = createTx((o, p) => this.#exec(m, o, p));
|
||||
this.#tx[m.method] = createTx(m, (o, p) => this.#exec(m, o, p));
|
||||
}
|
||||
|
||||
if (isUndefined(this.#query[m.method])) {
|
||||
this.#query[m.method] = createQuery((f, o, p) => this.#read(m, o, p).send(f));
|
||||
this.#query[m.method] = createQuery(m, (f, o, p) => this.#read(m, o, p).send(f));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,23 +8,31 @@ import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { AbiMessage, BlueprintOptions, ContractCallOutcome, ContractOptions } from '../types';
|
||||
|
||||
export interface BlueprintDeploy<ApiType extends ApiTypes> {
|
||||
export interface MessageMeta {
|
||||
readonly meta: AbiMessage;
|
||||
}
|
||||
|
||||
export interface BlueprintDeploy<ApiType extends ApiTypes> extends MessageMeta {
|
||||
(options: BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
// @deprecated Use options form (to be dropped in a major update)
|
||||
(value: bigint | string | number | BN, gasLimit: bigint | string | number | BN, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
}
|
||||
|
||||
export interface ContractQuery<ApiType extends ApiTypes> {
|
||||
export interface ContractQuery<ApiType extends ApiTypes> extends MessageMeta {
|
||||
(origin: AccountId | string | Uint8Array, options: ContractOptions, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome>;
|
||||
// @deprecated Use options form (to be dropped in a major update)
|
||||
(origin: AccountId | string | Uint8Array, value: bigint | BN | string | number, gasLimit: bigint | BN | string | number, ...params: unknown[]): ContractCallResult<ApiType, ContractCallOutcome>;
|
||||
}
|
||||
|
||||
export interface ContractTx<ApiType extends ApiTypes> {
|
||||
export interface ContractTx<ApiType extends ApiTypes> extends MessageMeta {
|
||||
(options: ContractOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
// @deprecated Use options form (to be dropped in a major update)
|
||||
(value: bigint | BN | string | number, gasLimit: bigint | BN | string | number, ...params: unknown[]): SubmittableExtrinsic<ApiType>;
|
||||
}
|
||||
|
||||
export interface ContractGeneric<O, T> {
|
||||
(messageOrId: AbiMessage | string | number, options: O, ...params: unknown[]): T;
|
||||
// @deprecated Use options form (to be dropped in a major update)
|
||||
(messageOrId: AbiMessage | string | number, value: bigint | BN | string | number, gasLimit: bigint | BN | string | number, ...params: unknown[]): T;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { SubmittableResult } from '@polkadot/api';
|
||||
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
|
||||
import type { ApiTypes } from '@polkadot/api/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { AbiConstructor, BlueprintOptions } from '../types';
|
||||
import type { AbiConstructor, AbiMessage, BlueprintOptions } from '../types';
|
||||
import type { BlueprintDeploy, ContractGeneric } from './types';
|
||||
|
||||
import { Bytes } from '@polkadot/types';
|
||||
@@ -16,11 +16,18 @@ import { extractOptions, isOptions } from '../util';
|
||||
|
||||
export const EMPTY_SALT = new Uint8Array();
|
||||
|
||||
export function createBluePrintTx <ApiType extends ApiTypes, R extends SubmittableResult> (fn: (options: BlueprintOptions, params: unknown[]) => SubmittableExtrinsic<ApiType, R>): BlueprintDeploy<ApiType> {
|
||||
return (options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType, R> =>
|
||||
export function withMeta <T extends { meta: AbiMessage }> (meta: AbiMessage, creator: Omit<T, 'meta'>): T {
|
||||
(creator as T).meta = meta;
|
||||
|
||||
return creator as T;
|
||||
}
|
||||
|
||||
export function createBluePrintTx <ApiType extends ApiTypes, R extends SubmittableResult> (meta: AbiMessage, fn: (options: BlueprintOptions, params: unknown[]) => SubmittableExtrinsic<ApiType, R>): BlueprintDeploy<ApiType> {
|
||||
return withMeta(meta, (options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): SubmittableExtrinsic<ApiType, R> =>
|
||||
isOptions(options)
|
||||
? fn(options, params)
|
||||
: fn(...extractOptions<BlueprintOptions>(options, params));
|
||||
: fn(...extractOptions<BlueprintOptions>(options, params))
|
||||
);
|
||||
}
|
||||
|
||||
export function createBluePrintWithId <T> (fn: (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: unknown[]) => T): ContractGeneric<BlueprintOptions, T> {
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -0,0 +1,529 @@
|
||||
[
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 0,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"typeName": "Index"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "len",
|
||||
"typeName": "u32"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "lenEntries",
|
||||
"typeName": "u32"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 3,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"AccountId\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup7",
|
||||
"typeName": "VacantEntry",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId",
|
||||
"typeName": "T",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"typeName": "Index"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "prev",
|
||||
"typeName": "Index"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 8,
|
||||
"type": "{\"value\":\"u128\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 0,
|
||||
"type": "u128",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value",
|
||||
"typeName": "V"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex",
|
||||
"typeName": "KeyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 9,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(AccountId,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup7",
|
||||
"typeName": "VacantEntry",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 10,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"typeName": "T",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 10,
|
||||
"type": "(AccountId,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 11,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 12,
|
||||
"type": "bool",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 13,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"u32\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup7",
|
||||
"typeName": "VacantEntry",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"typeName": "T",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 14,
|
||||
"type": "{\"value\":\"u32\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value",
|
||||
"typeName": "V"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex",
|
||||
"typeName": "KeyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 15,
|
||||
"type": "{\"_enum\":{\"Vacant\":\"InkStorageCollectionsStashVacantEntry\",\"Occupied\":\"(u32,AccountId)\"}}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::stash::Entry",
|
||||
"sub": [
|
||||
{
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 7,
|
||||
"lookupName": "InkStorageCollectionsStashVacantEntry",
|
||||
"type": "Lookup7",
|
||||
"typeName": "VacantEntry",
|
||||
"index": 0,
|
||||
"name": "Vacant"
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 16,
|
||||
"type": "(u32,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
],
|
||||
"typeName": "T",
|
||||
"index": 1,
|
||||
"name": "Occupied"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Tuple",
|
||||
"lookupIndex": 16,
|
||||
"type": "(u32,AccountId)",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"type": "AccountId",
|
||||
"docs": [],
|
||||
"namespace": "ink_env::types::AccountId",
|
||||
"lookupNameRoot": "InkEnvAccountId"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Struct",
|
||||
"lookupIndex": 17,
|
||||
"type": "{\"value\":\"Null\",\"keyIndex\":\"u32\"}",
|
||||
"docs": [],
|
||||
"namespace": "ink_storage::collections::hashmap::ValueEntry",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 18,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "value",
|
||||
"typeName": "V"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 2,
|
||||
"type": "u32",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"name": "keyIndex",
|
||||
"typeName": "KeyIndex"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 18,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 19,
|
||||
"type": "Option<Text>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 11,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"info": "Result",
|
||||
"lookupIndex": 20,
|
||||
"type": "Result<Null, ContractsErrorsPsp22Psp22Error>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 18,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 21,
|
||||
"lookupName": "ContractsErrorsPsp22Psp22Error",
|
||||
"type": "Lookup21"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 21,
|
||||
"lookupName": "ContractsErrorsPsp22Psp22Error",
|
||||
"type": "{\"_enum\":{\"Custom\":\"Text\",\"InsufficientBalance\":\"Null\",\"InsufficientAllowance\":\"Null\",\"ZeroRecipientAddress\":\"Null\",\"ZeroSenderAddress\":\"Null\",\"SafeTransferCheckFailed\":\"Text\"}}",
|
||||
"docs": [],
|
||||
"namespace": "contracts::traits::errors::psp22::PSP22Error",
|
||||
"sub": [
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 11,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"typeName": "Text",
|
||||
"index": 0,
|
||||
"name": "Custom"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 1,
|
||||
"name": "InsufficientBalance"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 2,
|
||||
"name": "InsufficientAllowance"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 3,
|
||||
"name": "ZeroRecipientAddress"
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"type": "Null",
|
||||
"index": 4,
|
||||
"name": "ZeroSenderAddress"
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 11,
|
||||
"type": "Text",
|
||||
"docs": [],
|
||||
"namespace": "",
|
||||
"typeName": "Text",
|
||||
"index": 5,
|
||||
"name": "SafeTransferCheckFailed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Plain",
|
||||
"lookupIndex": 22,
|
||||
"type": "Bytes",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Option",
|
||||
"lookupIndex": 23,
|
||||
"type": "Option<AccountId>",
|
||||
"docs": [],
|
||||
"namespace": "Option",
|
||||
"sub": {
|
||||
"info": "Plain",
|
||||
"lookupIndex": 4,
|
||||
"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,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, TraitErc20Erc20Error>",
|
||||
"docs": [],
|
||||
"namespace": "Result",
|
||||
"sub": [
|
||||
{
|
||||
"name": "Ok",
|
||||
"info": "Null",
|
||||
"lookupIndex": 9,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"name": "Error",
|
||||
"docs": [],
|
||||
"info": "Si",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "TraitErc20Erc20Error",
|
||||
"type": "Lookup10"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"info": "Null",
|
||||
"lookupIndex": 9,
|
||||
"type": "Null",
|
||||
"docs": [],
|
||||
"namespace": ""
|
||||
},
|
||||
{
|
||||
"info": "Enum",
|
||||
"lookupIndex": 10,
|
||||
"lookupName": "TraitErc20Erc20Error",
|
||||
"type": "{\"_enum\":[\"InsufficientBalance\",\"InsufficientAllowance\"]}",
|
||||
"docs": [],
|
||||
"namespace": "trait_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"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -5,5 +5,6 @@ import { createVersionedExport } from '../util';
|
||||
import * as v0 from './v0';
|
||||
import * as v1 from './v1';
|
||||
import * as v2 from './v2';
|
||||
import * as v3 from './v3';
|
||||
|
||||
export default createVersionedExport({ v0, v1, v2 });
|
||||
export default createVersionedExport({ v0, v1, v2, v3 });
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as flipper } from './flipper.contract.json';
|
||||
// A complex contract example with traits.
|
||||
export { default as psp22 } from './psp22_minter_pauser.contract.json';
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"source": {
|
||||
"hash": "0xbb381c2fc980121b17c7b2bf2756d5964a12151cb846e0a9eff9cc337806456d",
|
||||
"language": "ink! 3.0.0-rc7",
|
||||
"compiler": "rustc 1.60.0-nightly",
|
||||
"wasm": "0x0061736d0100000001280860027f7f0060000060037f7f7f0060017f006000017f60017f017f60037f7f7f017f60017f017e02880106057365616c30107365616c5f7365745f73746f726167650002057365616c30107365616c5f6765745f73746f726167650006057365616c300a7365616c5f696e7075740000057365616c300b7365616c5f72657475726e0002057365616c30167365616c5f76616c75655f7472616e73666572726564000003656e76066d656d6f727902010210030a090400050103070001000608017f01418080040b071102066465706c6f7900080463616c6c000c0ac40b096102027f027e230041206b22002400200041106a22014200370300200042003703082000411036021c200041086a2000411c6a1004200028021c41114f0440000b2001290300210220002903082103200041206a2400410541042002200384501b0bc20101027f230041306b220224004101210302402000027f20014101714504404104100541ff01714105470d011a0b200241106a4200370300200241186a4200370300200241206a42003703002002420037030820024201370300200241808001360228200241086a41808004200241286a100120022802282201418180014f720d012002200136022c200241808004360228200241286a100741ff017122014102460d014100210320014100470b3a0001200020033a0000200241306a24000f0b000b4201027f230041106b22012400200141086a2000100d20012d0009210020012d00082102200141106a240041024101410220004101461b410020001b20024101711b0bd30202057f027e230041306b2200240020004180800136020c200041808004360208200041086a1009200020002903083703100240200041106a100a22054201832206a70d00200542807e8342002006501b22064280feffffff1f832205422088a721012005421888a721022005421088a7210302402006a741087641ff0171220441ed014704402004419b0147200341ff017141ae014772200241ff0171419d0147200141de004772720d02200041106a100741ff017122014102460d02100541ff01714105470d02200041286a4200370300200041206a4200370300200041186a4200370300200042003703102001410171200041106a100b0c010b200341ff017141cb0047200241ff0171419d0147722001411b47720d01200041286a4200370300200041206a4200370300200041186a4200370300200042003703104100200041106a100b0b200041306a24000f0b000b4101027f230041106b2201240020012000280204220236020c20002802002001410c6a10022002200128020c2202490440000b20002002360204200141106a24000b850102027f017e230041106b220124002001420437030841042102027f02400240034020012000100d20012d00004101710d01200141086a20026a20012d00013a0000200241016a22024108470d000b20012903082203a741044f0d01000b4101210241000c010b410021022003422088a70b2100200141106a24002002ad2000ad420886840b6b01017f230041306b220224004180800420003a0000200241286a200141186a290000370300200241206a200141106a290000370300200241186a200141086a2900003703002002420137030820022001290000370310200241106a4180800441011000200241306a24000b910302057f027e230041406a22002400024002400240100541ff01714105470d0020004180800136021c200041808004360218200041186a100920002000290318370320027f0240200041206a100a22054201832206a70d00200542807e8342002006501b22064280feffffff1f832205422088a721022005421888a721012005421088a721032006a741087641ff01712204412f470440200441e30047200341ff0171413a4772200141ff017141a50147200241d1004772720d014101210141000c020b200341ff017141860147200141ff017141db0047720d00410021014100200241d901460d011a0b4101210141010b0d00024020010440200041086a418002100620002d0009210120002d00084101710d01200041386a4200370300200041306a4200370300200041286a4200370300200042003703202001417f73410171200041206a100b0c040b200041106a4100100620002d0011210120002d0010410171450d020b20014105460d020b000b4180800420014101713a000041004180800441011003000b200041406b24000b3c01017f200020012802042202047f2001200241016b36020420012001280200220141016a36020020012d00000520010b3a000120002002453a00000b"
|
||||
},
|
||||
"contract": {
|
||||
"name": "flipper",
|
||||
"version": "3.0.0-rc7",
|
||||
"authors": [
|
||||
"Parity Technologies <admin@parity.io>"
|
||||
]
|
||||
},
|
||||
"V3": {
|
||||
"spec": {
|
||||
"constructors": [
|
||||
{
|
||||
"args": [
|
||||
{
|
||||
"label": "init_value",
|
||||
"type": {
|
||||
"displayName": [
|
||||
"bool"
|
||||
],
|
||||
"type": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
"Creates a new flipper smart contract initialized with the given value."
|
||||
],
|
||||
"label": "new",
|
||||
"payable": false,
|
||||
"selector": "0x9bae9d5e"
|
||||
},
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
"Creates a new flipper smart contract initialized to `false`."
|
||||
],
|
||||
"label": "default",
|
||||
"payable": true,
|
||||
"selector": "0xed4b9d1b"
|
||||
}
|
||||
],
|
||||
"docs": [],
|
||||
"events": [],
|
||||
"messages": [
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
" Flips the current value of the Flipper's boolean."
|
||||
],
|
||||
"label": "flip",
|
||||
"mutates": true,
|
||||
"payable": false,
|
||||
"returnType": null,
|
||||
"selector": "0x633aa551"
|
||||
},
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
" Returns the current value of the Flipper's boolean."
|
||||
],
|
||||
"label": "get",
|
||||
"mutates": false,
|
||||
"payable": false,
|
||||
"returnType": {
|
||||
"displayName": [
|
||||
"bool"
|
||||
],
|
||||
"type": 0
|
||||
},
|
||||
"selector": "0x2f865bd9"
|
||||
}
|
||||
]
|
||||
},
|
||||
"storage": {
|
||||
"struct": {
|
||||
"fields": [
|
||||
{
|
||||
"layout": {
|
||||
"cell": {
|
||||
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"ty": 0
|
||||
}
|
||||
},
|
||||
"name": "value"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"types": [
|
||||
{
|
||||
"id": 0,
|
||||
"type": {
|
||||
"def": {
|
||||
"primitive": "bool"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as flipper } from './flipper.contract.json';
|
||||
// A complex contract example with traits.
|
||||
export { default as traitErc20 } from './trait_erc20.contract.json';
|
||||
File diff suppressed because one or more lines are too long
@@ -40,6 +40,7 @@ export interface AbiMessage {
|
||||
isMutating?: boolean;
|
||||
isPayable?: boolean;
|
||||
method: string;
|
||||
path: string[];
|
||||
returnType?: TypeDef | null;
|
||||
selector: ContractSelector;
|
||||
toU8a: (params: unknown[]) => Uint8Array;
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
"mock.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-create" }
|
||||
{ "path": "../api/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-create/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -17,9 +17,9 @@
|
||||
"mock.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api" },
|
||||
{ "path": "../api-augment" },
|
||||
{ "path": "../api-contract" },
|
||||
{ "path": "../types" }
|
||||
{ "path": "../api/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../api-contract/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "7.3.1",
|
||||
"@polkadot/api-augment": "7.3.1",
|
||||
"@polkadot/api-base": "7.3.1",
|
||||
"@polkadot/rpc-core": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"@polkadot/util-crypto": "^8.3.1",
|
||||
"rxjs": "^7.5.1"
|
||||
"@polkadot/api": "7.5.1",
|
||||
"@polkadot/api-augment": "7.5.1",
|
||||
"@polkadot/api-base": "7.5.1",
|
||||
"@polkadot/rpc-core": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api": "7.3.1",
|
||||
"@polkadot/api-augment": "7.3.1",
|
||||
"@polkadot/rpc-augment": "7.3.1",
|
||||
"@polkadot/rpc-provider": "7.3.1",
|
||||
"@polkadot/types-support": "7.3.1"
|
||||
"@polkadot/api": "7.5.1",
|
||||
"@polkadot/api-augment": "7.5.1",
|
||||
"@polkadot/rpc-augment": "7.5.1",
|
||||
"@polkadot/rpc-provider": "7.5.1",
|
||||
"@polkadot/types-support": "7.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { AccountId } from '@polkadot/types/interfaces';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { HeaderExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
@@ -39,7 +38,7 @@ export function getHeader (instanceId: string, api: DeriveApi): (blockHash: Uint
|
||||
)
|
||||
]).pipe(
|
||||
map(([header, validators]) =>
|
||||
createHeaderExtended(header.registry as Registry, header, validators)
|
||||
createHeaderExtended(header.registry, header, validators)
|
||||
),
|
||||
catchError((): Observable<undefined> =>
|
||||
// where rpc.chain.getHeader throws, we will land here - it can happen that
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { SignedBlockExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
@@ -33,7 +32,7 @@ export function subscribeNewBlocks (instanceId: string, api: DeriveApi): () => O
|
||||
]);
|
||||
}),
|
||||
map(([header, block, events]) =>
|
||||
createSignedBlockExtended(block.registry as Registry, block, events, header.validators)
|
||||
createSignedBlockExtended(block.registry, block, events, header.validators)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Observable } from 'rxjs';
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { HeaderExtended } from '../type/types';
|
||||
import type { DeriveApi } from '../types';
|
||||
|
||||
@@ -35,7 +34,7 @@ export function subscribeNewHeads (instanceId: string, api: DeriveApi): () => Ob
|
||||
map(([header, validators]): HeaderExtended => {
|
||||
header.createdAtHash = header.hash;
|
||||
|
||||
return createHeaderExtended(header.registry as Registry, header, validators);
|
||||
return createHeaderExtended(header.registry, header, validators);
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api-derive', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/test/*",
|
||||
"**/checkTypes.manual.ts",
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/test/*",
|
||||
"**/checkTypes.manual.ts",
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../api-augment" },
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" }
|
||||
]
|
||||
}
|
||||
@@ -13,15 +13,15 @@
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api" },
|
||||
{ "path": "../api-augment" },
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../api-derive" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-augment" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-support" }
|
||||
{ "path": "../api/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../api-derive/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-support/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
+18
-18
@@ -20,29 +20,29 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api-augment": "7.3.1",
|
||||
"@polkadot/api-base": "7.3.1",
|
||||
"@polkadot/api-derive": "7.3.1",
|
||||
"@polkadot/keyring": "^8.3.1",
|
||||
"@polkadot/rpc-augment": "7.3.1",
|
||||
"@polkadot/rpc-core": "7.3.1",
|
||||
"@polkadot/rpc-provider": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-augment": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/types-create": "7.3.1",
|
||||
"@polkadot/types-known": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"@polkadot/util-crypto": "^8.3.1",
|
||||
"@polkadot/api-augment": "7.5.1",
|
||||
"@polkadot/api-base": "7.5.1",
|
||||
"@polkadot/api-derive": "7.5.1",
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/rpc-augment": "7.5.1",
|
||||
"@polkadot/rpc-core": "7.5.1",
|
||||
"@polkadot/rpc-provider": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-augment": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/types-create": "7.5.1",
|
||||
"@polkadot/types-known": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"rxjs": "^7.5.1"
|
||||
"rxjs": "^7.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/api-augment": "7.3.1",
|
||||
"@polkadot/types-support": "7.3.1"
|
||||
"@polkadot/api-augment": "7.5.1",
|
||||
"@polkadot/types-support": "7.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
const lazySection = (section: string) =>
|
||||
lazyMethods({}, Object.keys(query[section]), (method: string) =>
|
||||
blockHash
|
||||
? this._decorateStorageEntryAt(registry as Registry, query[section][method], decorateMethod, blockHash)
|
||||
? this._decorateStorageEntryAt(registry, query[section][method], decorateMethod, blockHash)
|
||||
: this._decorateStorageEntry(query[section][method], decorateMethod)
|
||||
);
|
||||
|
||||
@@ -526,7 +526,7 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
decorated.sizeAt = decorateMethod((blockHash: Hash | Uint8Array | string, ...args: unknown[]): Observable<u64> =>
|
||||
getQueryAt(blockHash).pipe(
|
||||
switchMap((q) =>
|
||||
this._rpcCore.state.getStorageSize(getArgs(args, q.creator.meta.registry as Registry), blockHash))));
|
||||
this._rpcCore.state.getStorageSize(getArgs(args, q.creator.meta.registry), blockHash))));
|
||||
|
||||
// .keys() & .entries() only available on map types
|
||||
if (creator.iterKey && creator.meta.type.isMap) {
|
||||
@@ -613,6 +613,15 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
this._retrieveMapKeys(creator, blockHash, args)));
|
||||
}
|
||||
|
||||
if (this.supportMulti && creator.meta.type.isMap) {
|
||||
// When using double map storage function, user need to pass double map key as an array
|
||||
decorated.multi = decorateMethod((args: unknown[]): Observable<Codec[]> =>
|
||||
creator.meta.type.asMap.hashers.length === 1
|
||||
? this._retrieveMulti(args.map((a) => [creator, [a]]), blockHash)
|
||||
: this._retrieveMulti(args.map((a) => [creator, a as unknown[]]), blockHash)
|
||||
);
|
||||
}
|
||||
|
||||
/* eslint-enable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment */
|
||||
|
||||
return this._decorateFunctionMeta(creator as unknown as MetaDecoration, decorated) as unknown as QueryableStorageEntry<ApiType>;
|
||||
@@ -647,17 +656,21 @@ export abstract class Decorate<ApiType extends ApiTypes> extends Events {
|
||||
}
|
||||
|
||||
// retrieve a set of values for a specific set of keys - here we chunk the keys into PAGE_SIZE sizes
|
||||
private _retrieveMulti (keys: [StorageEntry, unknown[]][]): Observable<Codec[]> {
|
||||
private _retrieveMulti (keys: [StorageEntry, unknown[]][], blockHash?: Uint8Array): Observable<Codec[]> {
|
||||
if (!keys.length) {
|
||||
return of([]);
|
||||
}
|
||||
|
||||
const queryCall = this.hasSubscriptions
|
||||
const queryCall = this.hasSubscriptions && !blockHash
|
||||
? this._rpcCore.state.subscribeStorage
|
||||
: this._rpcCore.state.queryStorageAt;
|
||||
|
||||
return combineLatest(
|
||||
arrayChunk(keys, PAGE_SIZE_V).map((keys) => queryCall(keys))
|
||||
arrayChunk(keys, PAGE_SIZE_V).map((k) =>
|
||||
blockHash
|
||||
? queryCall(k, blockHash)
|
||||
: queryCall(k)
|
||||
)
|
||||
).pipe(
|
||||
map(arrayFlatten)
|
||||
);
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/api', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import type { Observable, OperatorFunction } from 'rxjs';
|
||||
import type { Address, ApplyExtrinsicResult, Call, Extrinsic, ExtrinsicEra, ExtrinsicStatus, Hash, Header, Index, RuntimeDispatchInfo, SignerPayload } from '@polkadot/types/interfaces';
|
||||
import type { Callback, Codec, Constructor, IKeyringPair, ISubmittableResult, SignatureOptions } from '@polkadot/types/types';
|
||||
import type { CodecRegistry } from '@polkadot/types-codec/types';
|
||||
import type { Registry } from '@polkadot/types-codec/types';
|
||||
import type { ApiInterfaceRx, ApiTypes, PromiseOrObs, SignerResult } from '../types';
|
||||
import type { AddressOrPair, SignerOptions, SubmittableDryRunResult, SubmittableExtrinsic, SubmittablePaymentResult, SubmittableResultResult, SubmittableResultSubscription } from './types';
|
||||
|
||||
@@ -26,7 +26,7 @@ interface SubmittableOptions<ApiType extends ApiTypes> {
|
||||
|
||||
const identity = <T> (input: T): T => input;
|
||||
|
||||
function makeEraOptions (api: ApiInterfaceRx, registry: CodecRegistry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
|
||||
function makeEraOptions (api: ApiInterfaceRx, registry: Registry, partialOptions: Partial<SignerOptions>, { header, mortalLength, nonce }: { header: Header | null; mortalLength: number; nonce: Index }): SignatureOptions {
|
||||
if (!header) {
|
||||
if (isNumber(partialOptions.era)) {
|
||||
// since we have no header, it is immortal, remove any option overrides
|
||||
@@ -84,7 +84,7 @@ export function createClass <ApiType extends ApiTypes> ({ api, apiType, decorate
|
||||
|
||||
#transformResult: (input: ISubmittableResult) => ISubmittableResult = identity;
|
||||
|
||||
constructor (registry: CodecRegistry, extrinsic: Call | Extrinsic | Uint8Array | string) {
|
||||
constructor (registry: Registry, extrinsic: Call | Extrinsic | Uint8Array | string) {
|
||||
super(registry, extrinsic, { version: api.extrinsicType });
|
||||
|
||||
this.#ignoreStatusCb = apiType === 'rxjs';
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/checkTypes.manual.ts",
|
||||
"**/*.spec.ts",
|
||||
"**/test/**/*"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../api-derive/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-known/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"exclude": [
|
||||
"**/checkTypes.manual.ts",
|
||||
"**/*.spec.ts",
|
||||
"**/test/**/*"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../api-derive" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-known" }
|
||||
]
|
||||
}
|
||||
@@ -13,14 +13,14 @@
|
||||
"**/test/**/*"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../api" },
|
||||
{ "path": "../api-augment" },
|
||||
{ "path": "../api-base" },
|
||||
{ "path": "../api-derive" },
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-known" },
|
||||
{ "path": "../types-support" }
|
||||
{ "path": "../api/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../api-base/tsconfig.build.json" },
|
||||
{ "path": "../api-derive/tsconfig.build.json" },
|
||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-known/tsconfig.build.json" },
|
||||
{ "path": "../types-support/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/rpc-core": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1"
|
||||
"@polkadot/rpc-core": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-augment', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-codec" }
|
||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -20,18 +20,18 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/rpc-augment": "7.3.1",
|
||||
"@polkadot/rpc-provider": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"rxjs": "^7.5.1"
|
||||
"@polkadot/rpc-augment": "7.5.1",
|
||||
"@polkadot/rpc-provider": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"rxjs": "^7.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^8.3.1",
|
||||
"@polkadot/rpc-augment": "7.3.1"
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/rpc-augment": "7.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-core', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" }
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -12,9 +12,9 @@
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" }
|
||||
{ "path": "../rpc-core/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -20,20 +20,20 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/keyring": "^8.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-support": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"@polkadot/util-crypto": "^8.3.1",
|
||||
"@polkadot/x-fetch": "^8.3.1",
|
||||
"@polkadot/x-global": "^8.3.1",
|
||||
"@polkadot/x-ws": "^8.3.1",
|
||||
"@polkadot/keyring": "^8.3.3",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-support": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/util-crypto": "^8.3.3",
|
||||
"@polkadot/x-fetch": "^8.3.3",
|
||||
"@polkadot/x-global": "^8.3.3",
|
||||
"@polkadot/x-ws": "^8.3.3",
|
||||
"eventemitter3": "^4.0.7",
|
||||
"mock-socket": "^9.0.8",
|
||||
"nock": "^13.2.1"
|
||||
"mock-socket": "^9.1.0",
|
||||
"nock": "^13.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/rpc-provider', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-support" }
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-support/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
"**/*.spec.ts"
|
||||
],
|
||||
"references": [
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" }
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
"polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs",
|
||||
@@ -30,20 +30,20 @@
|
||||
"polkadot-types-internal-metadata": "./scripts/polkadot-types-internal-metadata.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.16.7",
|
||||
"@babel/register": "^7.16.7",
|
||||
"@babel/core": "^7.16.12",
|
||||
"@babel/register": "^7.16.9",
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/api": "7.3.1",
|
||||
"@polkadot/api-augment": "7.3.1",
|
||||
"@polkadot/rpc-augment": "7.3.1",
|
||||
"@polkadot/rpc-provider": "7.3.1",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-augment": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/types-create": "7.3.1",
|
||||
"@polkadot/types-support": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1",
|
||||
"@polkadot/x-ws": "^8.3.1",
|
||||
"@polkadot/api": "7.5.1",
|
||||
"@polkadot/api-augment": "7.5.1",
|
||||
"@polkadot/rpc-augment": "7.5.1",
|
||||
"@polkadot/rpc-provider": "7.5.1",
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-augment": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/types-create": "7.5.1",
|
||||
"@polkadot/types-support": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3",
|
||||
"@polkadot/x-ws": "^8.3.3",
|
||||
"handlebars": "^4.7.7",
|
||||
"websocket": "^1.0.34",
|
||||
"yargs": "^17.3.1"
|
||||
|
||||
@@ -16,7 +16,7 @@ import staticPolkadot from '@polkadot/types-support/metadata/static-polkadot';
|
||||
import staticSubstrate from '@polkadot/types-support/metadata/static-substrate';
|
||||
import { isString, stringify } from '@polkadot/util';
|
||||
|
||||
import { createImports, exportType, initMeta, readTemplate, writeFile } from '../util';
|
||||
import { createImports, exportInterface, initMeta, readTemplate, writeFile } from '../util';
|
||||
import { typeEncoders } from './tsDef';
|
||||
|
||||
const WITH_TYPEDEF = false;
|
||||
@@ -191,7 +191,7 @@ function generateLookupTypes (registry: Registry, filtered: [PortableType, TypeD
|
||||
typeDef.name = typeDef.lookupName;
|
||||
|
||||
return typeDef.lookupNameRoot && typeDef.lookupName
|
||||
? exportType(typeDef.lookupIndex, typeDef.lookupName, typeDef.lookupNameRoot)
|
||||
? exportInterface(typeDef.lookupIndex, typeDef.lookupName, typeDef.lookupNameRoot)
|
||||
: typeEncoders[typeDef.info](registry, imports.definitions, typeDef, imports);
|
||||
}).filter((t): t is string => !!t);
|
||||
|
||||
@@ -219,8 +219,8 @@ function generateLookup (destDir: string, entries: [string | undefined, HexStrin
|
||||
const { lookup, registry } = initMeta(staticMeta).metadata.asLatest;
|
||||
const filtered = getFilteredTypes(lookup, exclude);
|
||||
|
||||
generateLookupDefs(registry as Registry, filtered, destDir, subPath);
|
||||
generateLookupTypes(registry as Registry, filtered, destDir, subPath);
|
||||
generateLookupDefs(registry, filtered, destDir, subPath);
|
||||
generateLookupTypes(registry, filtered, destDir, subPath);
|
||||
|
||||
return exclude.concat(
|
||||
...filtered
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as defaultDefinitions from '@polkadot/types/interfaces/definitions';
|
||||
import { getTypeDef, TypeDefInfo } from '@polkadot/types-create';
|
||||
import { assert, isString, stringify, stringPascalCase } from '@polkadot/util';
|
||||
|
||||
import { createImports, exportInterface, exportType, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util';
|
||||
import { createImports, exportInterface, formatType, readTemplate, setImports, TypeImports, writeFile } from '../util';
|
||||
|
||||
interface Imports extends TypeImports {
|
||||
interfaces: [string, string][];
|
||||
@@ -204,11 +204,11 @@ function tsVec (registry: Registry, definitions: Record<string, ModuleTypes>, de
|
||||
if (def.info === TypeDefInfo.VecFixed) {
|
||||
setImports(definitions, imports, ['U8aFixed']);
|
||||
|
||||
return exportType(def.lookupIndex, def.name, 'U8aFixed');
|
||||
return exportInterface(def.lookupIndex, def.name, 'U8aFixed');
|
||||
} else {
|
||||
setImports(definitions, imports, ['Bytes']);
|
||||
|
||||
return exportType(def.lookupIndex, def.name, 'Bytes');
|
||||
return exportInterface(def.lookupIndex, def.name, 'Bytes');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/typegen', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import type { Registry } from '@polkadot/types/types';
|
||||
import type { CodecRegistry } from '@polkadot/types-codec/types';
|
||||
import type { TypeDef } from '@polkadot/types-create/types';
|
||||
|
||||
import Handlebars from 'handlebars';
|
||||
@@ -109,15 +108,7 @@ export function exportInterface (lookupIndex = -1, name = '', base: string, body
|
||||
return `${doc}export interface ${name} extends ${base} {${body.length ? '\n' : ''}${body}}`;
|
||||
}
|
||||
|
||||
// helper to create an `export type <Name> = <Base>`
|
||||
// but since we don't want type alias (TS doesn't preserve names) we use
|
||||
// interface here.
|
||||
/** @internal */
|
||||
export function exportType (lookupIndex = -1, name = '', base: string): string {
|
||||
return exportInterface(lookupIndex, name, base);
|
||||
}
|
||||
|
||||
function singleParamNotation (registry: CodecRegistry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
|
||||
function singleParamNotation (registry: Registry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
|
||||
const sub = (typeDef.sub as TypeDef);
|
||||
|
||||
setImports(definitions, imports, [wrapper, sub.lookupName]);
|
||||
@@ -125,7 +116,7 @@ function singleParamNotation (registry: CodecRegistry, wrapper: string, typeDef:
|
||||
return paramsNotation(wrapper, sub.lookupName || formatType(registry, definitions, sub.type, imports, withShortcut));
|
||||
}
|
||||
|
||||
function dualParamsNotation (registry: CodecRegistry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
|
||||
function dualParamsNotation (registry: Registry, wrapper: string, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean): string {
|
||||
const [a, b] = (typeDef.sub as TypeDef[]);
|
||||
|
||||
setImports(definitions, imports, [wrapper, a.lookupName, b.lookupName]);
|
||||
@@ -136,18 +127,18 @@ function dualParamsNotation (registry: CodecRegistry, wrapper: string, typeDef:
|
||||
]);
|
||||
}
|
||||
|
||||
const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => string> = {
|
||||
[TypeDefInfo.Compact]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
const formatters: Record<TypeDefInfo, (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => string> = {
|
||||
[TypeDefInfo.Compact]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'Compact', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.DoNotConstruct]: (registry: CodecRegistry, { lookupName }: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.DoNotConstruct]: (registry: Registry, { lookupName }: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
setImports(definitions, imports, ['DoNotConstruct']);
|
||||
|
||||
return 'DoNotConstruct';
|
||||
},
|
||||
|
||||
[TypeDefInfo.Enum]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Enum]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
if (typeDef.lookupName) {
|
||||
return typeDef.lookupName;
|
||||
}
|
||||
@@ -155,43 +146,43 @@ const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef
|
||||
throw new Error(`TypeDefInfo.Enum: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Int]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Int]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Int: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.UInt]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.UInt]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.UInt: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Null]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Null]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
setImports(definitions, imports, ['Null']);
|
||||
|
||||
return 'Null';
|
||||
},
|
||||
|
||||
[TypeDefInfo.Option]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Option]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'Option', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Plain]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Plain]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
setImports(definitions, imports, [typeDef.type]);
|
||||
|
||||
return typeDef.type;
|
||||
},
|
||||
|
||||
[TypeDefInfo.Range]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Range]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Range: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Set]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Set]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
throw new Error(`TypeDefInfo.Set: Not implemented on ${stringify(typeDef)}`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Si]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return formatType(registry, definitions, (registry as Registry).lookup.getTypeDef(typeDef.type), imports, withShortcut);
|
||||
[TypeDefInfo.Si]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return formatType(registry, definitions, (registry).lookup.getTypeDef(typeDef.type), imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Struct]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Struct]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
if (typeDef.lookupName) {
|
||||
return typeDef.lookupName;
|
||||
}
|
||||
@@ -208,7 +199,7 @@ const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef
|
||||
}${withShortcut ? ' ' : '\n '}} & Struct`;
|
||||
},
|
||||
|
||||
[TypeDefInfo.Tuple]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Tuple]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
const sub = typeDef.sub as TypeDef[];
|
||||
|
||||
setImports(definitions, imports, ['ITuple', ...sub.map(({ lookupName }) => lookupName)]);
|
||||
@@ -221,11 +212,11 @@ const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef
|
||||
}]`);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Vec]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Vec]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'Vec', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.VecFixed]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.VecFixed]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
const sub = (typeDef.sub as TypeDef);
|
||||
|
||||
if (sub.type === 'u8') {
|
||||
@@ -237,31 +228,31 @@ const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef
|
||||
return singleParamNotation(registry, 'Vec', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.BTreeMap]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.BTreeMap]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return dualParamsNotation(registry, 'BTreeMap', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.BTreeSet]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.BTreeSet]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'BTreeSet', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.HashMap]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.HashMap]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return dualParamsNotation(registry, 'HashMap', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Linkage]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Linkage]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'Linkage', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.Result]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.Result]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return dualParamsNotation(registry, 'Result', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.WrapperKeepOpaque]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.WrapperKeepOpaque]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'WrapperKeepOpaque', typeDef, definitions, imports, withShortcut);
|
||||
},
|
||||
|
||||
[TypeDefInfo.WrapperOpaque]: (registry: CodecRegistry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
[TypeDefInfo.WrapperOpaque]: (registry: Registry, typeDef: TypeDef, definitions: Record<string, ModuleTypes>, imports: TypeImports, withShortcut: boolean) => {
|
||||
return singleParamNotation(registry, 'WrapperOpaque', typeDef, definitions, imports, withShortcut);
|
||||
}
|
||||
};
|
||||
@@ -271,7 +262,7 @@ const formatters: Record<TypeDefInfo, (registry: CodecRegistry, typeDef: TypeDef
|
||||
*/
|
||||
/** @internal */
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export function formatType (registry: CodecRegistry, definitions: Record<string, ModuleTypes>, type: string | String | TypeDef, imports: TypeImports, withShortcut = false): string {
|
||||
export function formatType (registry: Registry, definitions: Record<string, ModuleTypes>, type: string | String | TypeDef, imports: TypeImports, withShortcut = false): string {
|
||||
let typeDef: TypeDef;
|
||||
|
||||
if (isString(type)) {
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../api/tsconfig.build.json" },
|
||||
{ "path": "../api-augment/tsconfig.build.json" },
|
||||
{ "path": "../rpc-augment/tsconfig.build.json" },
|
||||
{ "path": "../rpc-provider/tsconfig.build.json" },
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-augment/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" },
|
||||
{ "path": "../types-create/tsconfig.build.json" },
|
||||
{ "path": "../types-support/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "..",
|
||||
"outDir": "./build",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../api" },
|
||||
{ "path": "../api-augment" },
|
||||
{ "path": "../rpc-augment" },
|
||||
{ "path": "../rpc-provider" },
|
||||
{ "path": "../types" },
|
||||
{ "path": "../types-augment" },
|
||||
{ "path": "../types-codec" },
|
||||
{ "path": "../types-create" },
|
||||
{ "path": "../types-support" }
|
||||
]
|
||||
}
|
||||
@@ -20,12 +20,12 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-codec": "7.3.1",
|
||||
"@polkadot/util": "^8.3.1"
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-codec": "7.5.1",
|
||||
"@polkadot/util": "^8.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,10 @@ export default {
|
||||
CurrentHeadUpdated: 'u32',
|
||||
CodeUpgradeScheduled: 'u32',
|
||||
NewHeadNoted: 'u32',
|
||||
ActionQueued: '(u32,u32)'
|
||||
ActionQueued: '(u32,u32)',
|
||||
PvfCheckStarted: '(H256,u32)',
|
||||
PvfCheckAccepted: '(H256,u32)',
|
||||
PvfCheckRejected: '(H256,u32)'
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -2003,7 +2006,7 @@ export default {
|
||||
* Lookup621: polkadot_runtime_parachains::paras::pallet::Error<T>
|
||||
**/
|
||||
PolkadotRuntimeParachainsParasPalletError: {
|
||||
_enum: ['NotRegistered', 'CannotOnboard', 'CannotOffboard', 'CannotUpgrade', 'CannotDowngrade', 'PvfCheckStatementStale', 'PvfCheckStatementFuture', 'PvfCheckValidatorIndexOutOfBounds', 'PvfCheckInvalidSignature', 'PvfCheckDoubleVote', 'PvfCheckSubjectInvalid']
|
||||
_enum: ['NotRegistered', 'CannotOnboard', 'CannotOffboard', 'CannotUpgrade', 'CannotDowngrade', 'PvfCheckStatementStale', 'PvfCheckStatementFuture', 'PvfCheckValidatorIndexOutOfBounds', 'PvfCheckInvalidSignature', 'PvfCheckDoubleVote', 'PvfCheckSubjectInvalid', 'PvfCheckDisabled']
|
||||
},
|
||||
/**
|
||||
* Lookup623: polkadot_runtime_parachains::initializer::BufferedSessionChange
|
||||
|
||||
@@ -3561,8 +3561,11 @@ export default {
|
||||
setStorage: 'u64',
|
||||
setStoragePerByte: 'u64',
|
||||
clearStorage: 'u64',
|
||||
containsStorage: 'u64',
|
||||
getStorage: 'u64',
|
||||
getStoragePerByte: 'u64',
|
||||
takeStorage: 'u64',
|
||||
takeStoragePerByte: 'u64',
|
||||
transfer: 'u64',
|
||||
call: 'u64',
|
||||
callTransferSurcharge: 'u64',
|
||||
@@ -3586,7 +3589,7 @@ export default {
|
||||
* Lookup424: pallet_contracts::pallet::Error<T>
|
||||
**/
|
||||
PalletContractsError: {
|
||||
_enum: ['InvalidScheduleVersion', 'OutOfGas', 'OutputBufferTooSmall', 'TransferFailed', 'MaxCallDepthReached', 'ContractNotFound', 'CodeTooLarge', 'CodeNotFound', 'OutOfBounds', 'DecodingFailed', 'ContractTrapped', 'ValueTooLarge', 'TerminatedWhileReentrant', 'InputForwarded', 'RandomSubjectTooLong', 'TooManyTopics', 'DuplicateTopics', 'NoChainExtension', 'DeletionQueueFull', 'DuplicateContract', 'TerminatedInConstructor', 'DebugMessageInvalidUTF8', 'ReentranceDenied', 'StorageDepositNotEnoughFunds', 'StorageDepositLimitExhausted', 'CodeInUse', 'ContractReverted']
|
||||
_enum: ['InvalidScheduleVersion', 'OutOfGas', 'OutputBufferTooSmall', 'TransferFailed', 'MaxCallDepthReached', 'ContractNotFound', 'CodeTooLarge', 'CodeNotFound', 'OutOfBounds', 'DecodingFailed', 'ContractTrapped', 'ValueTooLarge', 'TerminatedWhileReentrant', 'InputForwarded', 'RandomSubjectTooLong', 'TooManyTopics', 'DuplicateTopics', 'NoChainExtension', 'DeletionQueueFull', 'DuplicateContract', 'TerminatedInConstructor', 'DebugMessageInvalidUTF8', 'ReentranceDenied', 'StorageDepositNotEnoughFunds', 'StorageDepositLimitExhausted', 'CodeInUse', 'ContractReverted', 'CodeRejected']
|
||||
},
|
||||
/**
|
||||
* Lookup425: pallet_sudo::pallet::Error<T>
|
||||
@@ -3908,20 +3911,20 @@ export default {
|
||||
repeat: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup503: pallet_lottery::pallet::Error<T>
|
||||
* Lookup504: pallet_lottery::pallet::Error<T>
|
||||
**/
|
||||
PalletLotteryError: {
|
||||
_enum: ['NotConfigured', 'InProgress', 'AlreadyEnded', 'InvalidCall', 'AlreadyParticipating', 'TooManyCalls', 'EncodingFailed']
|
||||
},
|
||||
/**
|
||||
* Lookup505: pallet_gilt::pallet::GiltBid<Balance, sp_core::crypto::AccountId32>
|
||||
* Lookup506: pallet_gilt::pallet::GiltBid<Balance, sp_core::crypto::AccountId32>
|
||||
**/
|
||||
PalletGiltGiltBid: {
|
||||
amount: 'u128',
|
||||
who: 'AccountId32'
|
||||
},
|
||||
/**
|
||||
* Lookup506: pallet_gilt::pallet::ActiveGiltsTotal<Balance>
|
||||
* Lookup507: pallet_gilt::pallet::ActiveGiltsTotal<Balance>
|
||||
**/
|
||||
PalletGiltActiveGiltsTotal: {
|
||||
frozen: 'u128',
|
||||
@@ -3930,7 +3933,7 @@ export default {
|
||||
target: 'Perquintill'
|
||||
},
|
||||
/**
|
||||
* Lookup507: pallet_gilt::pallet::ActiveGilt<Balance, sp_core::crypto::AccountId32, BlockNumber>
|
||||
* Lookup508: pallet_gilt::pallet::ActiveGilt<Balance, sp_core::crypto::AccountId32, BlockNumber>
|
||||
**/
|
||||
PalletGiltActiveGilt: {
|
||||
proportion: 'Perquintill',
|
||||
@@ -3939,13 +3942,13 @@ export default {
|
||||
expiry: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup508: pallet_gilt::pallet::Error<T>
|
||||
* Lookup509: pallet_gilt::pallet::Error<T>
|
||||
**/
|
||||
PalletGiltError: {
|
||||
_enum: ['DurationTooSmall', 'DurationTooBig', 'AmountTooSmall', 'BidTooLow', 'Unknown', 'NotOwner', 'NotExpired', 'NotFound']
|
||||
},
|
||||
/**
|
||||
* Lookup509: pallet_uniques::types::ClassDetails<sp_core::crypto::AccountId32, DepositBalance>
|
||||
* Lookup510: pallet_uniques::types::ClassDetails<sp_core::crypto::AccountId32, DepositBalance>
|
||||
**/
|
||||
PalletUniquesClassDetails: {
|
||||
owner: 'AccountId32',
|
||||
@@ -3960,7 +3963,7 @@ export default {
|
||||
isFrozen: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup511: pallet_uniques::types::InstanceDetails<sp_core::crypto::AccountId32, DepositBalance>
|
||||
* Lookup512: pallet_uniques::types::InstanceDetails<sp_core::crypto::AccountId32, DepositBalance>
|
||||
**/
|
||||
PalletUniquesInstanceDetails: {
|
||||
owner: 'AccountId32',
|
||||
@@ -3969,7 +3972,7 @@ export default {
|
||||
deposit: 'u128'
|
||||
},
|
||||
/**
|
||||
* Lookup512: pallet_uniques::types::ClassMetadata<DepositBalance, StringLimit>
|
||||
* Lookup513: pallet_uniques::types::ClassMetadata<DepositBalance, StringLimit>
|
||||
**/
|
||||
PalletUniquesClassMetadata: {
|
||||
deposit: 'u128',
|
||||
@@ -3977,7 +3980,7 @@ export default {
|
||||
isFrozen: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup513: pallet_uniques::types::InstanceMetadata<DepositBalance, StringLimit>
|
||||
* Lookup514: pallet_uniques::types::InstanceMetadata<DepositBalance, StringLimit>
|
||||
**/
|
||||
PalletUniquesInstanceMetadata: {
|
||||
deposit: 'u128',
|
||||
@@ -3985,13 +3988,13 @@ export default {
|
||||
isFrozen: 'bool'
|
||||
},
|
||||
/**
|
||||
* Lookup516: pallet_uniques::pallet::Error<T, I>
|
||||
* Lookup517: pallet_uniques::pallet::Error<T, I>
|
||||
**/
|
||||
PalletUniquesError: {
|
||||
_enum: ['NoPermission', 'Unknown', 'AlreadyExists', 'WrongOwner', 'BadWitness', 'InUse', 'Frozen', 'WrongDelegate', 'NoDelegate', 'Unapproved']
|
||||
},
|
||||
/**
|
||||
* Lookup518: pallet_transaction_storage::TransactionInfo
|
||||
* Lookup519: pallet_transaction_storage::TransactionInfo
|
||||
**/
|
||||
PalletTransactionStorageTransactionInfo: {
|
||||
_alias: {
|
||||
@@ -4003,13 +4006,13 @@ export default {
|
||||
blockChunks: 'u32'
|
||||
},
|
||||
/**
|
||||
* Lookup519: pallet_transaction_storage::pallet::Error<T>
|
||||
* Lookup520: pallet_transaction_storage::pallet::Error<T>
|
||||
**/
|
||||
PalletTransactionStorageError: {
|
||||
_enum: ['InsufficientFunds', 'NotConfigured', 'RenewedNotFound', 'EmptyTransaction', 'UnexpectedProof', 'InvalidProof', 'MissingProof', 'MissingStateData', 'DoubleCheck', 'ProofNotChecked', 'TransactionTooLarge', 'TooManyTransactions', 'BadContext']
|
||||
},
|
||||
/**
|
||||
* Lookup520: pallet_bags_list::list::Node<T>
|
||||
* Lookup521: pallet_bags_list::list::Node<T>
|
||||
**/
|
||||
PalletBagsListListNode: {
|
||||
id: 'AccountId32',
|
||||
@@ -4018,20 +4021,20 @@ export default {
|
||||
bagUpper: 'u64'
|
||||
},
|
||||
/**
|
||||
* Lookup521: pallet_bags_list::list::Bag<T>
|
||||
* Lookup522: pallet_bags_list::list::Bag<T>
|
||||
**/
|
||||
PalletBagsListListBag: {
|
||||
head: 'Option<AccountId32>',
|
||||
tail: 'Option<AccountId32>'
|
||||
},
|
||||
/**
|
||||
* Lookup523: pallet_bags_list::pallet::Error<T>
|
||||
* Lookup524: pallet_bags_list::pallet::Error<T>
|
||||
**/
|
||||
PalletBagsListError: {
|
||||
_enum: ['NotInSameBag', 'IdNotFound', 'NotHeavier']
|
||||
},
|
||||
/**
|
||||
* Lookup524: pallet_child_bounties::ChildBounty<sp_core::crypto::AccountId32, Balance, BlockNumber>
|
||||
* Lookup525: pallet_child_bounties::ChildBounty<sp_core::crypto::AccountId32, Balance, BlockNumber>
|
||||
**/
|
||||
PalletChildBountiesChildBounty: {
|
||||
parentBounty: 'u32',
|
||||
@@ -4041,7 +4044,7 @@ export default {
|
||||
status: 'PalletChildBountiesChildBountyStatus'
|
||||
},
|
||||
/**
|
||||
* Lookup525: pallet_child_bounties::ChildBountyStatus<sp_core::crypto::AccountId32, BlockNumber>
|
||||
* Lookup526: pallet_child_bounties::ChildBountyStatus<sp_core::crypto::AccountId32, BlockNumber>
|
||||
**/
|
||||
PalletChildBountiesChildBountyStatus: {
|
||||
_enum: {
|
||||
@@ -4060,13 +4063,13 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup527: pallet_child_bounties::pallet::Error<T>
|
||||
* Lookup528: pallet_child_bounties::pallet::Error<T>
|
||||
**/
|
||||
PalletChildBountiesError: {
|
||||
_enum: ['ParentBountyNotActive', 'InsufficientBountyBalance', 'TooManyChildBounties']
|
||||
},
|
||||
/**
|
||||
* Lookup529: sp_runtime::MultiSignature
|
||||
* Lookup530: sp_runtime::MultiSignature
|
||||
**/
|
||||
SpRuntimeMultiSignature: {
|
||||
_enum: {
|
||||
@@ -4076,42 +4079,42 @@ export default {
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Lookup530: sp_core::ecdsa::Signature
|
||||
* Lookup531: sp_core::ecdsa::Signature
|
||||
**/
|
||||
SpCoreEcdsaSignature: '[u8;65]',
|
||||
/**
|
||||
* Lookup533: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<T>
|
||||
* Lookup534: frame_system::extensions::check_non_zero_sender::CheckNonZeroSender<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckNonZeroSender: 'Null',
|
||||
/**
|
||||
* Lookup534: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
|
||||
* Lookup535: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckSpecVersion: 'Null',
|
||||
/**
|
||||
* Lookup535: frame_system::extensions::check_tx_version::CheckTxVersion<T>
|
||||
* Lookup536: frame_system::extensions::check_tx_version::CheckTxVersion<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckTxVersion: 'Null',
|
||||
/**
|
||||
* Lookup536: frame_system::extensions::check_genesis::CheckGenesis<T>
|
||||
* Lookup537: frame_system::extensions::check_genesis::CheckGenesis<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckGenesis: 'Null',
|
||||
/**
|
||||
* Lookup539: frame_system::extensions::check_nonce::CheckNonce<T>
|
||||
* Lookup540: frame_system::extensions::check_nonce::CheckNonce<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
|
||||
/**
|
||||
* Lookup540: frame_system::extensions::check_weight::CheckWeight<T>
|
||||
* Lookup541: frame_system::extensions::check_weight::CheckWeight<T>
|
||||
**/
|
||||
FrameSystemExtensionsCheckWeight: 'Null',
|
||||
/**
|
||||
* Lookup541: pallet_asset_tx_payment::ChargeAssetTxPayment<T>
|
||||
* Lookup542: pallet_asset_tx_payment::ChargeAssetTxPayment<T>
|
||||
**/
|
||||
PalletAssetTxPaymentChargeAssetTxPayment: {
|
||||
tip: 'Compact<u128>',
|
||||
assetId: 'Option<u32>'
|
||||
},
|
||||
/**
|
||||
* Lookup542: node_runtime::Runtime
|
||||
* Lookup543: node_runtime::Runtime
|
||||
**/
|
||||
NodeRuntimeRuntime: 'Null'
|
||||
};
|
||||
|
||||
@@ -74,7 +74,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly asNewHeadNoted: u32;
|
||||
readonly isActionQueued: boolean;
|
||||
readonly asActionQueued: ITuple<[u32, u32]>;
|
||||
readonly type: 'CurrentCodeUpdated' | 'CurrentHeadUpdated' | 'CodeUpgradeScheduled' | 'NewHeadNoted' | 'ActionQueued';
|
||||
readonly isPvfCheckStarted: boolean;
|
||||
readonly asPvfCheckStarted: ITuple<[H256, u32]>;
|
||||
readonly isPvfCheckAccepted: boolean;
|
||||
readonly asPvfCheckAccepted: ITuple<[H256, u32]>;
|
||||
readonly isPvfCheckRejected: boolean;
|
||||
readonly asPvfCheckRejected: ITuple<[H256, u32]>;
|
||||
readonly type: 'CurrentCodeUpdated' | 'CurrentHeadUpdated' | 'CodeUpgradeScheduled' | 'NewHeadNoted' | 'ActionQueued' | 'PvfCheckStarted' | 'PvfCheckAccepted' | 'PvfCheckRejected';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsUmpPalletEvent (96) */
|
||||
@@ -1981,7 +1987,8 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isPvfCheckInvalidSignature: boolean;
|
||||
readonly isPvfCheckDoubleVote: boolean;
|
||||
readonly isPvfCheckSubjectInvalid: boolean;
|
||||
readonly type: 'NotRegistered' | 'CannotOnboard' | 'CannotOffboard' | 'CannotUpgrade' | 'CannotDowngrade' | 'PvfCheckStatementStale' | 'PvfCheckStatementFuture' | 'PvfCheckValidatorIndexOutOfBounds' | 'PvfCheckInvalidSignature' | 'PvfCheckDoubleVote' | 'PvfCheckSubjectInvalid';
|
||||
readonly isPvfCheckDisabled: boolean;
|
||||
readonly type: 'NotRegistered' | 'CannotOnboard' | 'CannotOffboard' | 'CannotUpgrade' | 'CannotDowngrade' | 'PvfCheckStatementStale' | 'PvfCheckStatementFuture' | 'PvfCheckValidatorIndexOutOfBounds' | 'PvfCheckInvalidSignature' | 'PvfCheckDoubleVote' | 'PvfCheckSubjectInvalid' | 'PvfCheckDisabled';
|
||||
}
|
||||
|
||||
/** @name PolkadotRuntimeParachainsInitializerBufferedSessionChange (623) */
|
||||
|
||||
@@ -3889,8 +3889,11 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly setStorage: u64;
|
||||
readonly setStoragePerByte: u64;
|
||||
readonly clearStorage: u64;
|
||||
readonly containsStorage: u64;
|
||||
readonly getStorage: u64;
|
||||
readonly getStoragePerByte: u64;
|
||||
readonly takeStorage: u64;
|
||||
readonly takeStoragePerByte: u64;
|
||||
readonly transfer: u64;
|
||||
readonly call: u64;
|
||||
readonly callTransferSurcharge: u64;
|
||||
@@ -3940,7 +3943,8 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isStorageDepositLimitExhausted: boolean;
|
||||
readonly isCodeInUse: boolean;
|
||||
readonly isContractReverted: boolean;
|
||||
readonly type: 'InvalidScheduleVersion' | 'OutOfGas' | 'OutputBufferTooSmall' | 'TransferFailed' | 'MaxCallDepthReached' | 'ContractNotFound' | 'CodeTooLarge' | 'CodeNotFound' | 'OutOfBounds' | 'DecodingFailed' | 'ContractTrapped' | 'ValueTooLarge' | 'TerminatedWhileReentrant' | 'InputForwarded' | 'RandomSubjectTooLong' | 'TooManyTopics' | 'DuplicateTopics' | 'NoChainExtension' | 'DeletionQueueFull' | 'DuplicateContract' | 'TerminatedInConstructor' | 'DebugMessageInvalidUTF8' | 'ReentranceDenied' | 'StorageDepositNotEnoughFunds' | 'StorageDepositLimitExhausted' | 'CodeInUse' | 'ContractReverted';
|
||||
readonly isCodeRejected: boolean;
|
||||
readonly type: 'InvalidScheduleVersion' | 'OutOfGas' | 'OutputBufferTooSmall' | 'TransferFailed' | 'MaxCallDepthReached' | 'ContractNotFound' | 'CodeTooLarge' | 'CodeNotFound' | 'OutOfBounds' | 'DecodingFailed' | 'ContractTrapped' | 'ValueTooLarge' | 'TerminatedWhileReentrant' | 'InputForwarded' | 'RandomSubjectTooLong' | 'TooManyTopics' | 'DuplicateTopics' | 'NoChainExtension' | 'DeletionQueueFull' | 'DuplicateContract' | 'TerminatedInConstructor' | 'DebugMessageInvalidUTF8' | 'ReentranceDenied' | 'StorageDepositNotEnoughFunds' | 'StorageDepositLimitExhausted' | 'CodeInUse' | 'ContractReverted' | 'CodeRejected';
|
||||
}
|
||||
|
||||
/** @name PalletSudoError (425) */
|
||||
@@ -4358,7 +4362,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly repeat: bool;
|
||||
}
|
||||
|
||||
/** @name PalletLotteryError (503) */
|
||||
/** @name PalletLotteryError (504) */
|
||||
export interface PalletLotteryError extends Enum {
|
||||
readonly isNotConfigured: boolean;
|
||||
readonly isInProgress: boolean;
|
||||
@@ -4370,13 +4374,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotConfigured' | 'InProgress' | 'AlreadyEnded' | 'InvalidCall' | 'AlreadyParticipating' | 'TooManyCalls' | 'EncodingFailed';
|
||||
}
|
||||
|
||||
/** @name PalletGiltGiltBid (505) */
|
||||
/** @name PalletGiltGiltBid (506) */
|
||||
export interface PalletGiltGiltBid extends Struct {
|
||||
readonly amount: u128;
|
||||
readonly who: AccountId32;
|
||||
}
|
||||
|
||||
/** @name PalletGiltActiveGiltsTotal (506) */
|
||||
/** @name PalletGiltActiveGiltsTotal (507) */
|
||||
export interface PalletGiltActiveGiltsTotal extends Struct {
|
||||
readonly frozen: u128;
|
||||
readonly proportion: Perquintill;
|
||||
@@ -4384,7 +4388,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly target: Perquintill;
|
||||
}
|
||||
|
||||
/** @name PalletGiltActiveGilt (507) */
|
||||
/** @name PalletGiltActiveGilt (508) */
|
||||
export interface PalletGiltActiveGilt extends Struct {
|
||||
readonly proportion: Perquintill;
|
||||
readonly amount: u128;
|
||||
@@ -4392,7 +4396,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly expiry: u32;
|
||||
}
|
||||
|
||||
/** @name PalletGiltError (508) */
|
||||
/** @name PalletGiltError (509) */
|
||||
export interface PalletGiltError extends Enum {
|
||||
readonly isDurationTooSmall: boolean;
|
||||
readonly isDurationTooBig: boolean;
|
||||
@@ -4405,7 +4409,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'DurationTooSmall' | 'DurationTooBig' | 'AmountTooSmall' | 'BidTooLow' | 'Unknown' | 'NotOwner' | 'NotExpired' | 'NotFound';
|
||||
}
|
||||
|
||||
/** @name PalletUniquesClassDetails (509) */
|
||||
/** @name PalletUniquesClassDetails (510) */
|
||||
export interface PalletUniquesClassDetails extends Struct {
|
||||
readonly owner: AccountId32;
|
||||
readonly issuer: AccountId32;
|
||||
@@ -4419,7 +4423,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly isFrozen: bool;
|
||||
}
|
||||
|
||||
/** @name PalletUniquesInstanceDetails (511) */
|
||||
/** @name PalletUniquesInstanceDetails (512) */
|
||||
export interface PalletUniquesInstanceDetails extends Struct {
|
||||
readonly owner: AccountId32;
|
||||
readonly approved: Option<AccountId32>;
|
||||
@@ -4427,21 +4431,21 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly deposit: u128;
|
||||
}
|
||||
|
||||
/** @name PalletUniquesClassMetadata (512) */
|
||||
/** @name PalletUniquesClassMetadata (513) */
|
||||
export interface PalletUniquesClassMetadata extends Struct {
|
||||
readonly deposit: u128;
|
||||
readonly data: Bytes;
|
||||
readonly isFrozen: bool;
|
||||
}
|
||||
|
||||
/** @name PalletUniquesInstanceMetadata (513) */
|
||||
/** @name PalletUniquesInstanceMetadata (514) */
|
||||
export interface PalletUniquesInstanceMetadata extends Struct {
|
||||
readonly deposit: u128;
|
||||
readonly data: Bytes;
|
||||
readonly isFrozen: bool;
|
||||
}
|
||||
|
||||
/** @name PalletUniquesError (516) */
|
||||
/** @name PalletUniquesError (517) */
|
||||
export interface PalletUniquesError extends Enum {
|
||||
readonly isNoPermission: boolean;
|
||||
readonly isUnknown: boolean;
|
||||
@@ -4456,7 +4460,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NoPermission' | 'Unknown' | 'AlreadyExists' | 'WrongOwner' | 'BadWitness' | 'InUse' | 'Frozen' | 'WrongDelegate' | 'NoDelegate' | 'Unapproved';
|
||||
}
|
||||
|
||||
/** @name PalletTransactionStorageTransactionInfo (518) */
|
||||
/** @name PalletTransactionStorageTransactionInfo (519) */
|
||||
export interface PalletTransactionStorageTransactionInfo extends Struct {
|
||||
readonly chunkRoot: H256;
|
||||
readonly contentHash: H256;
|
||||
@@ -4464,7 +4468,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly blockChunks: u32;
|
||||
}
|
||||
|
||||
/** @name PalletTransactionStorageError (519) */
|
||||
/** @name PalletTransactionStorageError (520) */
|
||||
export interface PalletTransactionStorageError extends Enum {
|
||||
readonly isInsufficientFunds: boolean;
|
||||
readonly isNotConfigured: boolean;
|
||||
@@ -4482,7 +4486,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'InsufficientFunds' | 'NotConfigured' | 'RenewedNotFound' | 'EmptyTransaction' | 'UnexpectedProof' | 'InvalidProof' | 'MissingProof' | 'MissingStateData' | 'DoubleCheck' | 'ProofNotChecked' | 'TransactionTooLarge' | 'TooManyTransactions' | 'BadContext';
|
||||
}
|
||||
|
||||
/** @name PalletBagsListListNode (520) */
|
||||
/** @name PalletBagsListListNode (521) */
|
||||
export interface PalletBagsListListNode extends Struct {
|
||||
readonly id: AccountId32;
|
||||
readonly prev: Option<AccountId32>;
|
||||
@@ -4490,13 +4494,13 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly bagUpper: u64;
|
||||
}
|
||||
|
||||
/** @name PalletBagsListListBag (521) */
|
||||
/** @name PalletBagsListListBag (522) */
|
||||
export interface PalletBagsListListBag extends Struct {
|
||||
readonly head: Option<AccountId32>;
|
||||
readonly tail: Option<AccountId32>;
|
||||
}
|
||||
|
||||
/** @name PalletBagsListError (523) */
|
||||
/** @name PalletBagsListError (524) */
|
||||
export interface PalletBagsListError extends Enum {
|
||||
readonly isNotInSameBag: boolean;
|
||||
readonly isIdNotFound: boolean;
|
||||
@@ -4504,7 +4508,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'NotInSameBag' | 'IdNotFound' | 'NotHeavier';
|
||||
}
|
||||
|
||||
/** @name PalletChildBountiesChildBounty (524) */
|
||||
/** @name PalletChildBountiesChildBounty (525) */
|
||||
export interface PalletChildBountiesChildBounty extends Struct {
|
||||
readonly parentBounty: u32;
|
||||
readonly value: u128;
|
||||
@@ -4513,7 +4517,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly status: PalletChildBountiesChildBountyStatus;
|
||||
}
|
||||
|
||||
/** @name PalletChildBountiesChildBountyStatus (525) */
|
||||
/** @name PalletChildBountiesChildBountyStatus (526) */
|
||||
export interface PalletChildBountiesChildBountyStatus extends Enum {
|
||||
readonly isAdded: boolean;
|
||||
readonly isCuratorProposed: boolean;
|
||||
@@ -4533,7 +4537,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Added' | 'CuratorProposed' | 'Active' | 'PendingPayout';
|
||||
}
|
||||
|
||||
/** @name PalletChildBountiesError (527) */
|
||||
/** @name PalletChildBountiesError (528) */
|
||||
export interface PalletChildBountiesError extends Enum {
|
||||
readonly isParentBountyNotActive: boolean;
|
||||
readonly isInsufficientBountyBalance: boolean;
|
||||
@@ -4541,7 +4545,7 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'ParentBountyNotActive' | 'InsufficientBountyBalance' | 'TooManyChildBounties';
|
||||
}
|
||||
|
||||
/** @name SpRuntimeMultiSignature (529) */
|
||||
/** @name SpRuntimeMultiSignature (530) */
|
||||
export interface SpRuntimeMultiSignature extends Enum {
|
||||
readonly isEd25519: boolean;
|
||||
readonly asEd25519: SpCoreEd25519Signature;
|
||||
@@ -4552,34 +4556,34 @@ declare module '@polkadot/types/lookup' {
|
||||
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
|
||||
}
|
||||
|
||||
/** @name SpCoreEcdsaSignature (530) */
|
||||
/** @name SpCoreEcdsaSignature (531) */
|
||||
export interface SpCoreEcdsaSignature extends U8aFixed {}
|
||||
|
||||
/** @name FrameSystemExtensionsCheckNonZeroSender (533) */
|
||||
/** @name FrameSystemExtensionsCheckNonZeroSender (534) */
|
||||
export type FrameSystemExtensionsCheckNonZeroSender = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckSpecVersion (534) */
|
||||
/** @name FrameSystemExtensionsCheckSpecVersion (535) */
|
||||
export type FrameSystemExtensionsCheckSpecVersion = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckTxVersion (535) */
|
||||
/** @name FrameSystemExtensionsCheckTxVersion (536) */
|
||||
export type FrameSystemExtensionsCheckTxVersion = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckGenesis (536) */
|
||||
/** @name FrameSystemExtensionsCheckGenesis (537) */
|
||||
export type FrameSystemExtensionsCheckGenesis = Null;
|
||||
|
||||
/** @name FrameSystemExtensionsCheckNonce (539) */
|
||||
/** @name FrameSystemExtensionsCheckNonce (540) */
|
||||
export interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
|
||||
|
||||
/** @name FrameSystemExtensionsCheckWeight (540) */
|
||||
/** @name FrameSystemExtensionsCheckWeight (541) */
|
||||
export type FrameSystemExtensionsCheckWeight = Null;
|
||||
|
||||
/** @name PalletAssetTxPaymentChargeAssetTxPayment (541) */
|
||||
/** @name PalletAssetTxPaymentChargeAssetTxPayment (542) */
|
||||
export interface PalletAssetTxPaymentChargeAssetTxPayment extends Struct {
|
||||
readonly tip: Compact<u128>;
|
||||
readonly assetId: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name NodeRuntimeRuntime (542) */
|
||||
/** @name NodeRuntimeRuntime (543) */
|
||||
export type NodeRuntimeRuntime = Null;
|
||||
|
||||
} // declare module
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
|
||||
// Do not edit, auto-generated by @polkadot/dev
|
||||
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.3.1' };
|
||||
export const packageInfo = { name: '@polkadot/types-augment', path: 'auto', type: 'auto', version: '7.5.1' };
|
||||
|
||||
@@ -18,7 +18,7 @@ import type { StatementKind } from '@polkadot/types/interfaces/claims';
|
||||
import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
|
||||
import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus';
|
||||
import type { AliveContractInfo, CodeHash, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts';
|
||||
import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV2, ContractContractSpecV0, ContractContractSpecV2, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi';
|
||||
import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan';
|
||||
import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus';
|
||||
import type { AccountVote, AccountVoteSplit, AccountVoteStandard, Conviction, Delegations, PreimageStatus, PreimageStatusAvailable, PriorLock, PropIndex, Proposal, ProxyState, ReferendumIndex, ReferendumInfo, ReferendumInfoFinished, ReferendumInfoTo239, ReferendumStatus, Tally, Voting, VotingDelegating, VotingDirect, VotingDirectVote } from '@polkadot/types/interfaces/democracy';
|
||||
@@ -216,9 +216,13 @@ declare module '@polkadot/types/types/registry' {
|
||||
ContractCallRequest: ContractCallRequest;
|
||||
ContractConstructorSpecLatest: ContractConstructorSpecLatest;
|
||||
ContractConstructorSpecV0: ContractConstructorSpecV0;
|
||||
ContractConstructorSpecV1: ContractConstructorSpecV1;
|
||||
ContractConstructorSpecV2: ContractConstructorSpecV2;
|
||||
ContractConstructorSpecV3: ContractConstructorSpecV3;
|
||||
ContractContractSpecV0: ContractContractSpecV0;
|
||||
ContractContractSpecV1: ContractContractSpecV1;
|
||||
ContractContractSpecV2: ContractContractSpecV2;
|
||||
ContractContractSpecV3: ContractContractSpecV3;
|
||||
ContractCryptoHasher: ContractCryptoHasher;
|
||||
ContractDiscriminant: ContractDiscriminant;
|
||||
ContractDisplayName: ContractDisplayName;
|
||||
@@ -227,6 +231,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
ContractEventParamSpecV2: ContractEventParamSpecV2;
|
||||
ContractEventSpecLatest: ContractEventSpecLatest;
|
||||
ContractEventSpecV0: ContractEventSpecV0;
|
||||
ContractEventSpecV1: ContractEventSpecV1;
|
||||
ContractEventSpecV2: ContractEventSpecV2;
|
||||
ContractExecResult: ContractExecResult;
|
||||
ContractExecResultErr: ContractExecResultErr;
|
||||
@@ -254,12 +259,14 @@ declare module '@polkadot/types/types/registry' {
|
||||
ContractMessageParamSpecV2: ContractMessageParamSpecV2;
|
||||
ContractMessageSpecLatest: ContractMessageSpecLatest;
|
||||
ContractMessageSpecV0: ContractMessageSpecV0;
|
||||
ContractMessageSpecV1: ContractMessageSpecV1;
|
||||
ContractMessageSpecV2: ContractMessageSpecV2;
|
||||
ContractMetadata: ContractMetadata;
|
||||
ContractMetadataLatest: ContractMetadataLatest;
|
||||
ContractMetadataV0: ContractMetadataV0;
|
||||
ContractMetadataV1: ContractMetadataV1;
|
||||
ContractMetadataV2: ContractMetadataV2;
|
||||
ContractMetadataV3: ContractMetadataV3;
|
||||
ContractProject: ContractProject;
|
||||
ContractProjectContract: ContractProjectContract;
|
||||
ContractProjectInfo: ContractProjectInfo;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../rpc-core" },
|
||||
{ "path": "../types" }
|
||||
{ "path": "../types/tsconfig.build.json" },
|
||||
{ "path": "../types-codec/tsconfig.build.json" }
|
||||
]
|
||||
}
|
||||
@@ -20,16 +20,16 @@
|
||||
"./detectPackage.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "7.3.1",
|
||||
"version": "7.5.1",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.16.7",
|
||||
"@polkadot/util": "^8.3.1"
|
||||
"@polkadot/util": "^8.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/types": "7.3.1",
|
||||
"@polkadot/types-augment": "7.3.1",
|
||||
"@polkadot/types-support": "7.3.1",
|
||||
"@polkadot/util-crypto": "^8.3.1"
|
||||
"@polkadot/types": "7.5.1",
|
||||
"@polkadot/types-augment": "7.5.1",
|
||||
"@polkadot/types-support": "7.5.1",
|
||||
"@polkadot/util-crypto": "^8.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecRegistry, IU8a, IVec } from '../types';
|
||||
import type { AnyJson, Codec, IU8a, IVec, Registry } from '../types';
|
||||
|
||||
import { compactToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
|
||||
|
||||
@@ -16,13 +16,13 @@ import { compareArray } from '../utils/compareArray';
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export abstract class AbstractArray<T extends Codec> extends Array<T> implements IVec<T> {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
readonly initialU8aLength?: number;
|
||||
|
||||
protected constructor (registry: CodecRegistry, values: T[], initialU8aLength?: number) {
|
||||
protected constructor (registry: Registry, values: T[], initialU8aLength?: number) {
|
||||
super(values.length);
|
||||
|
||||
// explicitly set the values here - this removes the need for any extra allocations
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyNumber, CodecRegistry, INumber, IU8a, UIntBitLength } from '../types';
|
||||
import type { AnyNumber, INumber, IU8a, Registry, UIntBitLength } from '../types';
|
||||
|
||||
import { assert, BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isBn, isHex, isU8a, u8aToBn } from '@polkadot/util';
|
||||
import { assert, BN, BN_BILLION, BN_HUNDRED, BN_MILLION, BN_QUINTILL, BN_ZERO, bnToBn, bnToHex, bnToU8a, formatBalance, formatNumber, hexToBn, isBn, isHex, isNumber, isString, isU8a, u8aToBn } from '@polkadot/util';
|
||||
|
||||
export const DEFAULT_UINT_BITS = 64;
|
||||
|
||||
@@ -32,6 +32,10 @@ function decodeAbstractInt (value: AnyNumber, bitLength: UIntBitLength, isNegati
|
||||
return value.toString();
|
||||
} else if (isHex(value, -1, true)) {
|
||||
return hexToBn(value, { isLe: false, isNegative }).toString();
|
||||
} else if (isNumber(value)) {
|
||||
assert(value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER && Math.floor(value) === value, 'Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1');
|
||||
} else if (isString(value)) {
|
||||
assert(!(value.includes('.') || value.includes(',') || value.includes('e')), 'String should not contain decimal points or scientific notation');
|
||||
}
|
||||
|
||||
return bnToBn(value).toString();
|
||||
@@ -43,7 +47,7 @@ function decodeAbstractInt (value: AnyNumber, bitLength: UIntBitLength, isNegati
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export abstract class AbstractInt extends BN implements INumber {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
@@ -53,7 +57,7 @@ export abstract class AbstractInt extends BN implements INumber {
|
||||
|
||||
readonly #isSigned: boolean;
|
||||
|
||||
constructor (registry: CodecRegistry, value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isSigned = false) {
|
||||
constructor (registry: Registry, value: AnyNumber = 0, bitLength: UIntBitLength = DEFAULT_UINT_BITS, isSigned = false) {
|
||||
// Construct via a string, which will be passed in the BN constructor.
|
||||
// It would be ideal to actually return a BN, but there is an issue:
|
||||
// https://github.com/indutny/bn.js/issues/206
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, BareOpts, Codec, CodecRegistry, IU8a } from '../types';
|
||||
import type { AnyJson, BareOpts, Codec, IU8a, Registry } from '../types';
|
||||
|
||||
/**
|
||||
* @name Base
|
||||
* @description A type extends the Base class, when it holds a value
|
||||
*/
|
||||
export abstract class Base<T extends Codec> implements Codec {
|
||||
readonly #registry: CodecRegistry;
|
||||
readonly #registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
@@ -17,7 +17,7 @@ export abstract class Base<T extends Codec> implements Codec {
|
||||
|
||||
readonly #raw: T;
|
||||
|
||||
protected constructor (registry: CodecRegistry, value: T, initialU8aLength?: number) {
|
||||
protected constructor (registry: Registry, value: T, initialU8aLength?: number) {
|
||||
this.#registry = registry;
|
||||
this.#raw = value;
|
||||
this.initialU8aLength = initialU8aLength;
|
||||
@@ -48,7 +48,7 @@ export abstract class Base<T extends Codec> implements Codec {
|
||||
return this.#raw.isEmpty;
|
||||
}
|
||||
|
||||
public get registry (): CodecRegistry {
|
||||
public get registry (): Registry {
|
||||
return this.#registry;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,11 @@ describe('Compact', (): void => {
|
||||
const registry = new TypeRegistry();
|
||||
|
||||
describe('constructor', (): void => {
|
||||
it('fails on > MAX_SAFE_INTEGER', (): void => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
|
||||
expect(() => new Compact(registry, 'u128', 9007199254740999)).toThrow(/integer <= Number.MAX_SAFE_INTEGER/);
|
||||
});
|
||||
|
||||
it('has support for BigInt', (): void => {
|
||||
expect(
|
||||
new Compact(registry, 'u128', 123456789000123456789n).toHuman()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, AnyNumber, CodecClass, CodecRegistry, ICompact, INumber, IU8a } from '../types';
|
||||
import type { AnyJson, AnyNumber, CodecClass, ICompact, INumber, IU8a, Registry } from '../types';
|
||||
|
||||
import { compactFromU8a, compactToU8a, isBigInt, isBn, isNumber, isString } from '@polkadot/util';
|
||||
|
||||
@@ -18,7 +18,7 @@ import { typeToConstructor } from '../utils';
|
||||
* a number and making the compact representation thereof
|
||||
*/
|
||||
export class Compact<T extends INumber> implements ICompact<T> {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
@@ -28,7 +28,7 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
|
||||
readonly #raw: T;
|
||||
|
||||
constructor (registry: CodecRegistry, Type: CodecClass<T> | string, value: Compact<T> | AnyNumber = 0) {
|
||||
constructor (registry: Registry, Type: CodecClass<T> | string, value: Compact<T> | AnyNumber = 0) {
|
||||
this.registry = registry;
|
||||
this.#Type = typeToConstructor(registry, Type);
|
||||
|
||||
@@ -40,14 +40,14 @@ export class Compact<T extends INumber> implements ICompact<T> {
|
||||
|
||||
public static with<T extends INumber> (Type: CodecClass<T> | string): CodecClass<Compact<T>> {
|
||||
return class extends Compact<T> {
|
||||
constructor (registry: CodecRegistry, value?: Compact<T> | AnyNumber) {
|
||||
constructor (registry: Registry, value?: Compact<T> | AnyNumber) {
|
||||
super(registry, Type, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
public static decodeCompact<T extends INumber> (registry: CodecRegistry, Type: CodecClass<T>, value: Compact<T> | AnyNumber): [T, number] {
|
||||
public static decodeCompact<T extends INumber> (registry: Registry, Type: CodecClass<T>, value: Compact<T> | AnyNumber): [T, number] {
|
||||
if (value instanceof Compact) {
|
||||
return [new Type(registry, value.#raw), 0];
|
||||
} else if (value instanceof Type) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, CodecRegistry, IU8a } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, IU8a, Registry } from '../types';
|
||||
|
||||
/**
|
||||
* @name DoNotConstruct
|
||||
@@ -10,13 +10,13 @@ import type { AnyJson, Codec, CodecClass, CodecRegistry, IU8a } from '../types';
|
||||
* An unknown type that fails on construction with the type info
|
||||
*/
|
||||
export class DoNotConstruct implements Codec {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
#neverError: Error;
|
||||
|
||||
constructor (registry: CodecRegistry, typeName = 'DoNotConstruct') {
|
||||
constructor (registry: Registry, typeName = 'DoNotConstruct') {
|
||||
this.registry = registry;
|
||||
this.#neverError = new Error(`DoNotConstruct: Cannot construct unknown type ${typeName}`);
|
||||
|
||||
@@ -25,7 +25,7 @@ export class DoNotConstruct implements Codec {
|
||||
|
||||
public static with (typeName?: string): CodecClass {
|
||||
return class extends DoNotConstruct {
|
||||
constructor (registry: CodecRegistry) {
|
||||
constructor (registry: Registry) {
|
||||
super(registry, typeName);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { CodecRegistry } from '@polkadot/types-codec/types';
|
||||
import type { Registry } from '@polkadot/types-codec/types';
|
||||
|
||||
import { TypeRegistry } from '@polkadot/types';
|
||||
import { Enum, Null, Text, U32 } from '@polkadot/types-codec';
|
||||
@@ -129,7 +129,7 @@ describe('Enum', (): void => {
|
||||
class B extends Null { }
|
||||
class C extends Null { }
|
||||
class Test extends Enum {
|
||||
constructor (registry: CodecRegistry, value?: string, index?: number) {
|
||||
constructor (registry: Registry, value?: string, index?: number) {
|
||||
super(registry, {
|
||||
a: A,
|
||||
b: B,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, CodecRegistry, IEnum, IU8a } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, IEnum, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isHex, isNumber, isObject, isString, isU8a, isUndefined, objectProperties, stringCamelCase, stringify, stringPascalCase, u8aConcat, u8aToHex, u8aToU8a } from '@polkadot/util';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Null } from './Null';
|
||||
|
||||
// export interface, this is used in Enum.with, so required as public by TS
|
||||
export interface EnumCodecClass<T = Codec> {
|
||||
new(registry: CodecRegistry, value?: any, index?: number): T;
|
||||
new(registry: Registry, value?: any, index?: number): T;
|
||||
}
|
||||
|
||||
interface EntryDef {
|
||||
@@ -38,7 +38,7 @@ function isRustEnum (def: Record<string, string | CodecClass> | Record<string, n
|
||||
return true;
|
||||
}
|
||||
|
||||
function extractDef (registry: CodecRegistry, _def: Record<string, string | CodecClass> | Record<string, number> | string[]): { def: TypesDef; isBasic: boolean; isIndexed: boolean } {
|
||||
function extractDef (registry: Registry, _def: Record<string, string | CodecClass> | Record<string, number> | string[]): { def: TypesDef; isBasic: boolean; isIndexed: boolean } {
|
||||
const def: TypesDef = {};
|
||||
let isBasic: boolean;
|
||||
let isIndexed: boolean;
|
||||
@@ -81,7 +81,7 @@ function extractDef (registry: CodecRegistry, _def: Record<string, string | Code
|
||||
};
|
||||
}
|
||||
|
||||
function createFromValue (registry: CodecRegistry, def: TypesDef, index = 0, value?: unknown): Decoded {
|
||||
function createFromValue (registry: Registry, def: TypesDef, index = 0, value?: unknown): Decoded {
|
||||
const entry = Object.values(def).find((e) => e.index === index);
|
||||
|
||||
assert(!isUndefined(entry), () => `Unable to create Enum via index ${index}, in ${Object.keys(def).join(', ')}`);
|
||||
@@ -94,7 +94,7 @@ function createFromValue (registry: CodecRegistry, def: TypesDef, index = 0, val
|
||||
};
|
||||
}
|
||||
|
||||
function decodeFromJSON (registry: CodecRegistry, def: TypesDef, key: string, value?: unknown): Decoded {
|
||||
function decodeFromJSON (registry: Registry, def: TypesDef, key: string, value?: unknown): Decoded {
|
||||
// JSON comes in the form of { "<type (camelCase)>": "<value for type>" }, here we
|
||||
// additionally force to lower to ensure forward compat
|
||||
const keys = Object.keys(def).map((k) => k.toLowerCase());
|
||||
@@ -110,7 +110,7 @@ function decodeFromJSON (registry: CodecRegistry, def: TypesDef, key: string, va
|
||||
}
|
||||
}
|
||||
|
||||
function decodeEnum (registry: CodecRegistry, def: TypesDef, value?: unknown, index?: number): Decoded {
|
||||
function decodeEnum (registry: Registry, def: TypesDef, value?: unknown, index?: number): Decoded {
|
||||
// NOTE We check the index path first, before looking at values - this allows treating
|
||||
// the optional indexes before anything else, more-specific > less-specific
|
||||
if (isNumber(index)) {
|
||||
@@ -145,7 +145,7 @@ function decodeEnum (registry: CodecRegistry, def: TypesDef, value?: unknown, in
|
||||
* an extension to enum where the value type is determined by the actual index.
|
||||
*/
|
||||
export class Enum implements IEnum {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
@@ -163,7 +163,7 @@ export class Enum implements IEnum {
|
||||
|
||||
readonly #raw: Codec;
|
||||
|
||||
constructor (registry: CodecRegistry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number) {
|
||||
constructor (registry: Registry, Types: Record<string, string | CodecClass> | Record<string, number> | string[], value?: unknown, index?: number) {
|
||||
const { def, isBasic, isIndexed } = extractDef(registry, Types);
|
||||
|
||||
// shortcut isU8a as used in SCALE decoding
|
||||
@@ -199,7 +199,7 @@ export class Enum implements IEnum {
|
||||
}
|
||||
|
||||
return class extends Enum {
|
||||
constructor (registry: CodecRegistry, value?: unknown, index?: number) {
|
||||
constructor (registry: Registry, value?: unknown, index?: number) {
|
||||
super(registry, Types, value, index);
|
||||
|
||||
objectProperties(this, isKeys, (_, i) => this.type === keys[i]);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2022 @polkadot/types-codec authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { AnyNumber, CodecClass, CodecRegistry, UIntBitLength } from '../types';
|
||||
import type { AnyNumber, CodecClass, Registry, UIntBitLength } from '../types';
|
||||
|
||||
import { AbstractInt } from '../abstract/AbstractInt';
|
||||
|
||||
@@ -16,13 +16,13 @@ import { AbstractInt } from '../abstract/AbstractInt';
|
||||
* @noInheritDoc
|
||||
*/
|
||||
export class Int extends AbstractInt {
|
||||
constructor (registry: CodecRegistry, value: AnyNumber = 0, bitLength?: UIntBitLength) {
|
||||
constructor (registry: Registry, value: AnyNumber = 0, bitLength?: UIntBitLength) {
|
||||
super(registry, value, bitLength, true);
|
||||
}
|
||||
|
||||
public static with (bitLength: UIntBitLength, typeName?: string): CodecClass<Int> {
|
||||
return class extends Int {
|
||||
constructor (registry: CodecRegistry, value?: AnyNumber) {
|
||||
constructor (registry: Registry, value?: AnyNumber) {
|
||||
super(registry, value, bitLength);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { Codec, CodecRegistry, IU8a } from '../types';
|
||||
import type { Codec, IU8a, Registry } from '../types';
|
||||
|
||||
import { isNull } from '@polkadot/util';
|
||||
|
||||
@@ -12,14 +12,14 @@ import { isNull } from '@polkadot/util';
|
||||
* Implements a type that does not contain anything (apart from `null`)
|
||||
*/
|
||||
export class Null implements Codec {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
// Added for compatibility reasons, e.g. see Option
|
||||
public readonly initialU8aLength = 0;
|
||||
|
||||
constructor (registry: CodecRegistry) {
|
||||
constructor (registry: Registry) {
|
||||
this.registry = registry;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { HexString } from '@polkadot/util/types';
|
||||
import type { AnyJson, Codec, CodecClass, CodecRegistry, IOption, IU8a } from '../types';
|
||||
import type { AnyJson, Codec, CodecClass, IOption, IU8a, Registry } from '../types';
|
||||
|
||||
import { assert, isCodec, isNull, isU8a, isUndefined, u8aToHex } from '@polkadot/util';
|
||||
|
||||
@@ -10,7 +10,7 @@ import { typeToConstructor } from '../utils';
|
||||
import { Null } from './Null';
|
||||
|
||||
/** @internal */
|
||||
function decodeOption (registry: CodecRegistry, Type: CodecClass, value?: unknown): Codec {
|
||||
function decodeOption (registry: Registry, Type: CodecClass, value?: unknown): Codec {
|
||||
// In the case of an option, unwrap the inner
|
||||
if (value instanceof Option) {
|
||||
value = value.value;
|
||||
@@ -41,7 +41,7 @@ function decodeOption (registry: CodecRegistry, Type: CodecClass, value?: unknow
|
||||
* with a value if/as required/found.
|
||||
*/
|
||||
export class Option<T extends Codec> implements IOption<T> {
|
||||
public readonly registry: CodecRegistry;
|
||||
public readonly registry: Registry;
|
||||
|
||||
public createdAtHash?: IU8a;
|
||||
|
||||
@@ -51,7 +51,7 @@ export class Option<T extends Codec> implements IOption<T> {
|
||||
|
||||
readonly #raw: T;
|
||||
|
||||
constructor (registry: CodecRegistry, typeName: CodecClass<T> | string, value?: unknown) {
|
||||
constructor (registry: Registry, typeName: CodecClass<T> | string, value?: unknown) {
|
||||
const Type = typeToConstructor(registry, typeName);
|
||||
const decoded = isU8a(value) && value.length && !isCodec(value)
|
||||
? value[0] === 0
|
||||
@@ -70,7 +70,7 @@ export class Option<T extends Codec> implements IOption<T> {
|
||||
|
||||
public static with<O extends Codec> (Type: CodecClass<O> | string): CodecClass<Option<O>> {
|
||||
return class extends Option<O> {
|
||||
constructor (registry: CodecRegistry, value?: unknown) {
|
||||
constructor (registry: Registry, value?: unknown) {
|
||||
super(registry, Type, value);
|
||||
}
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user