Compare commits

...
826 Commits
Author SHA1 Message Date
github-actions[bot] afc4ebcd43 [CI Skip] release/stable 8.8.2
skip-checks: true
2022-06-14 13:26:09 +00:00
Jaco a93c4e16d3 8.8.2 (#4937) 2022-06-14 16:16:43 +03:00
github-actions[bot] dd0da859e4 [CI Skip] release/beta 8.8.2-2
skip-checks: true
2022-06-14 09:35:05 +00:00
Jaco 7c75f7b923 Adjust sanitize (#4935)
* Adjust sanitize

* Update packages/types-codec/src/utils/sanitize.ts
2022-06-14 12:27:28 +03:00
github-actions[bot] f2e8b7702b [CI Skip] release/beta 8.8.2-1
skip-checks: true
2022-06-14 08:57:44 +00:00
Jaco dc01f6d4a0 Update to latest Substrate metadata (#4934)
* Update to latest Substrate metadata

* linting
2022-06-14 11:47:58 +03:00
github-actions[bot] f023b81b77 [CI Skip] release/beta 8.8.2-0
skip-checks: true
2022-06-14 04:33:45 +00:00
Jaco ebb47f0865 Bump dev (#4932) 2022-06-14 07:25:40 +03:00
github-actions[bot] e23d44d3f5 [CI Skip] release/stable 8.8.1
skip-checks: true
2022-06-12 09:03:06 +00:00
Jaco 0a444be04c 8.8.1 (#4929) 2022-06-12 11:53:39 +03:00
github-actions[bot] 1abb7085d6 [CI Skip] release/beta 8.7.2-19
skip-checks: true
2022-06-12 08:23:17 +00:00
Jaco bda5cda4bf Update issue template (#4928) 2022-06-12 11:13:50 +03:00
github-actions[bot] fe7e313f21 [CI Skip] release/beta 8.7.2-18
skip-checks: true
2022-06-12 07:44:29 +00:00
Jaco 31971b5d2c Correct handling for storage Option<Option<Type>> (#4927)
* Correct handling for storage Option<Option<Type>>

* Adjust
2022-06-12 10:36:41 +03:00
github-actions[bot] 54efaa665d [CI Skip] release/beta 8.7.2-17
skip-checks: true
2022-06-11 05:53:00 +00:00
Jaco ddb435219d Bump deps (& issue template) (#4924) 2022-06-11 08:44:02 +03:00
github-actions[bot] 6ceb381ed0 [CI Skip] release/beta 8.7.2-16
skip-checks: true
2022-06-10 09:57:20 +00:00
Jaco 6a82ab1efd Add Polkadot & Westend upgrade blocks (#4922)
* Add Polkadot & Westend upgrade blocks

* Correct versions

* Adjust CHANGELOG
2022-06-10 12:49:20 +03:00
github-actions[bot] 8e3cef8dbc [CI Skip] release/beta 8.7.2-15
skip-checks: true
2022-06-10 08:30:59 +00:00
Jaco 5fcfb1277d Align IEventData interfaces (#4921) 2022-06-10 11:22:13 +03:00
github-actions[bot] 61ca15c143 [CI Skip] release/beta 8.7.2-14
skip-checks: true
2022-06-10 06:49:23 +00:00
Jaco 0930a5e0dc Expose partial runtimeVersion on api.at (#4920) 2022-06-10 09:41:22 +03:00
github-actions[bot] 03824f4600 [CI Skip] release/beta 8.7.2-13
skip-checks: true
2022-06-10 06:05:39 +00:00
Jaco 1e785b50da Adjust named enum fields augmentation (#4919)
* Adjust named enum fields augmentation

* Named tuples

* Adjust sanitize for symbol

* Explicit check

* Remove unused code

* Adjust expansion

* Adjust (only keep to named tuples this round)

* Pass struct
2022-06-10 08:57:16 +03:00
github-actions[bot] daeb86a7af [CI Skip] release/beta 8.7.2-12
skip-checks: true
2022-06-09 10:52:26 +00:00
Jaco 7461527448 Cater for named event fields (#4915)
* Cater for named event fields

* Adjust name extraction

* Rebuild with named events

* Empty object

* Adjust

* Additional

* Adjust
2022-06-09 13:44:31 +03:00
github-actions[bot] 322ac0861d [CI Skip] release/beta 8.7.2-11
skip-checks: true
2022-06-08 17:14:09 +00:00
Jaco 52cd06917d Pass Range/WrapperOpaque names via options (#4911) 2022-06-08 20:04:01 +03:00
github-actions[bot] 767eb1fa15 [CI Skip] release/beta 8.7.2-10
skip-checks: true
2022-06-08 13:54:48 +00:00
Jaco 60640b4c6c Update derive.bagsList to detect voterList pallet (#4910)
* Update `derive.bagsList` to detect `voterList` pallet

* Adjust

* Adjust
2022-06-08 16:45:48 +03:00
github-actions[bot] dfd45e866b [CI Skip] release/beta 8.7.2-9
skip-checks: true
2022-06-08 11:40:15 +00:00
Jaco dafa9ccc2c assert for blockHash alongside era override (#4909)
* assert for blockHash alongside era override

* typo
2022-06-08 14:31:08 +03:00
github-actions[bot] aeb76aea9a [CI Skip] release/beta 8.7.2-8
skip-checks: true
2022-06-08 10:48:06 +00:00
Jaco 436e48aab2 Align DispatchError (#4907) 2022-06-08 13:38:38 +03:00
github-actions[bot] 0871458312 [CI Skip] release/beta 8.7.2-7
skip-checks: true
2022-06-08 09:36:14 +00:00
Jaco 7edff67240 Split rpc.system.* definitions (#4906) 2022-06-08 12:28:03 +03:00
github-actions[bot] 89a2ff2cda [CI Skip] release/beta 8.7.2-6
skip-checks: true
2022-06-08 08:41:03 +00:00
Jaco d0fbecb0c4 Bump dev (#4905) 2022-06-08 11:31:40 +03:00
github-actions[bot] ed8802e605 [CI Skip] release/beta 8.7.2-5
skip-checks: true
2022-06-08 07:23:43 +00:00
Jaco 791e76546a Workaround for default calls on chains with non-standard indexes (#4904) 2022-06-08 10:15:48 +03:00
github-actions[bot] 804b58139a [CI Skip] release/beta 8.7.2-4
skip-checks: true
2022-06-07 19:39:26 +00:00
Raphael Flechtner ec746648c7 fix: typegen disconnect ws on success (#4901)
* fix: typegen disconnect ws on success

* fix: check for error onclose
2022-06-07 22:30:23 +03:00
github-actions[bot] 4cd8d5c60b [CI Skip] release/beta 8.7.2-3
skip-checks: true
2022-06-07 11:52:23 +00:00
Jaco df74330b67 Adjust AbstractInt asserts (#4898)
* Adjust AbstractInt asserts

* Adjust

* Number.isInteger
2022-06-07 14:43:39 +03:00
github-actions[bot] ea36b6d486 [CI Skip] release/beta 8.7.2-2
skip-checks: true
2022-06-06 07:37:12 +00:00
Jaco a210a7314d Use Result<.., ...> instead of specific enum (#4895) 2022-06-06 10:28:50 +03:00
github-actions[bot] 2d5d8e6713 [CI Skip] release/beta 8.7.2-1
skip-checks: true
2022-06-06 05:48:31 +00:00
Jaco 56a3d4ece8 DispatchError{U8, U8a} aliasing (w/ contracts RPC) (#4894)
* DispatchError{U8, U8a} aliasing (w/ contracts RPC)

* Rename
2022-06-06 08:40:35 +03:00
github-actions[bot] 3336f5530c [CI Skip] release/beta 8.7.2-0
skip-checks: true
2022-06-06 04:06:56 +00:00
Jaco f96b9c6d19 Optimization for value returns on merged queries (#4893)
* Optimization for value returns on merged queries

* Adjust

* Flatten
2022-06-06 06:58:00 +03:00
github-actions[bot] e7996e478a [CI Skip] release/stable 8.7.1
skip-checks: true
2022-06-04 05:51:08 +00:00
Jaco a695a486dd 8.7.1 (#4892) 2022-06-04 08:43:44 +03:00
github-actions[bot] 2a1ff7bb1e [CI Skip] release/beta 8.6.3-12
skip-checks: true
2022-06-04 05:02:26 +00:00
Jaco 59b4e41cb6 Bump TS (#4891) 2022-06-04 07:55:19 +03:00
github-actions[bot] 194d65d31b [CI Skip] release/beta 8.6.3-11
skip-checks: true
2022-06-03 07:08:41 +00:00
Jaco 10995b5696 Bump dev deps (#4890) 2022-06-03 10:00:38 +03:00
github-actions[bot] 73e717e665 [CI Skip] release/beta 8.6.3-10
skip-checks: true
2022-06-02 11:49:24 +00:00
Jaco f770f29422 Support for Range in typegen for Enum (#4889) 2022-06-02 14:41:52 +03:00
github-actions[bot] a7ad18bd0c [CI Skip] release/beta 8.6.3-9
skip-checks: true
2022-06-02 07:47:11 +00:00
Jaco 45d6c00816 Internal derive adjustments (#4888) 2022-06-02 10:39:11 +03:00
github-actions[bot] 4d02c78fe2 [CI Skip] release/beta 8.6.3-8
skip-checks: true
2022-06-01 21:07:37 +00:00
Jaco e73a347700 Adjust staking info retrieval (better batching) (#4887) 2022-06-01 23:59:20 +03:00
github-actions[bot] ea25189d2f [CI Skip] release/beta 8.6.3-7
skip-checks: true
2022-06-01 20:46:10 +00:00
Jaco 99be561a88 Adjust storage combination queue size (#4886)
* Adjust storage combination queue size

* 25
2022-06-01 23:37:19 +03:00
github-actions[bot] 871429b726 [CI Skip] release/beta 8.6.3-6
skip-checks: true
2022-06-01 20:07:40 +00:00
Jaco b041e7985c Trapping for failed collective proposals (#4885)
* Trapping for failed collective proposals

* revert multi

* Recomment

* Remove multi augmentation

* Adjust
2022-06-01 22:58:29 +03:00
github-actions[bot] 93ad99c5e9 [CI Skip] release/beta 8.6.3-5
skip-checks: true
2022-06-01 08:54:12 +00:00
Jaco 3e41751130 Adjust rpc-core cache with created Codec values (#4883) 2022-06-01 11:46:23 +03:00
github-actions[bot] 697c25a541 [CI Skip] release/beta 8.6.3-4
skip-checks: true
2022-06-01 05:38:53 +00:00
Jaco 05cf0cba8a Bump @polkadot/util & use nextTick (#4882) 2022-06-01 08:31:13 +03:00
github-actions[bot] d245bc69c9 [CI Skip] release/beta 8.6.3-3
skip-checks: true
2022-06-01 04:12:38 +00:00
Jaco c385ec2047 Internal merge of storage queries (#4881)
* Internal merge of storage queries

* setTimeout(() => ..., 0) to Promise.resolve().then(() => ...)
2022-06-01 07:04:33 +03:00
github-actions[bot] 374e69f2fc [CI Skip] release/beta 8.6.3-2
skip-checks: true
2022-05-31 10:20:15 +00:00
Jaco 12f2fbdaf5 Adjust derive flags retrieval (#4880) 2022-05-31 13:12:24 +03:00
github-actions[bot] e7e81c62c5 [CI Skip] release/beta 8.6.3-1
skip-checks: true
2022-05-31 08:53:25 +00:00
Jaco 7e8f5f6bae Add Kusama 9220 upgrade block (#4879) 2022-05-31 11:44:51 +03:00
github-actions[bot] 90f7f375e6 [CI Skip] release/beta 8.6.3-0
skip-checks: true
2022-05-31 07:32:16 +00:00
Jaco e7beb2d46f Expose provider errors & .stats on API (#4878)
* Expose provider errors & .stats on API

* Expose WS errors
2022-05-31 10:24:17 +03:00
github-actions[bot] a7a5a409d8 [CI Skip] release/stable 8.6.2
skip-checks: true
2022-05-30 12:51:53 +00:00
Jaco bd0b6426a7 8.6.2 (#4876) 2022-05-30 15:42:31 +03:00
github-actions[bot] 06cb4aadfa [CI Skip] release/beta 8.6.2-1
skip-checks: true
2022-05-30 08:23:48 +00:00
Jaco f76efa5f8a Bump TS (#4873)
* Bump TS

* Adjust

* Additional TS 4.7.2 fixes
2022-05-30 11:13:41 +03:00
github-actions[bot] cdc8d68e8b [CI Skip] release/beta 8.6.2-0
skip-checks: true
2022-05-30 05:44:39 +00:00
Jaco a208cc9bb5 LRU Sizing (#4872) 2022-05-30 08:36:28 +03:00
github-actions[bot] 6192e60668 [CI Skip] release/stable 8.6.1
skip-checks: true
2022-05-29 09:53:24 +00:00
Jaco c5eb40a98d 8.6.1 (#4870) 2022-05-29 12:45:28 +03:00
github-actions[bot] ab9b47ba51 [CI Skip] release/beta 8.5.2-14
skip-checks: true
2022-05-29 09:26:43 +00:00
Jaco dc0a5f3dec Bump Kusama metadata (#4868) 2022-05-29 12:18:39 +03:00
github-actions[bot] 3628a1bf86 [CI Skip] release/beta 8.5.2-13
skip-checks: true
2022-05-29 09:14:48 +00:00
Jaco a51fed491b Bump metadata (#4867) 2022-05-29 12:07:13 +03:00
github-actions[bot] 4616865333 [CI Skip] release/beta 8.5.2-12
skip-checks: true
2022-05-29 08:29:33 +00:00
Jaco e840d43463 Bump 3rd party deps (#4865) 2022-05-29 11:20:04 +03:00
github-actions[bot] c384311570 [CI Skip] release/beta 8.5.2-11
skip-checks: true
2022-05-29 08:03:56 +00:00
Jaco 521d44bb73 Bump deps (#4864) 2022-05-29 10:54:13 +03:00
github-actions[bot] 865fb63002 [CI Skip] release/beta 8.5.2-10
skip-checks: true
2022-05-27 10:38:01 +00:00
Jaco 63c58538dc Adjust inspect for ExtrinsicPayload (#4862)
* Adjust inspect for ExtrinsicPayload

* Adjust
2022-05-27 13:30:15 +03:00
github-actions[bot] 4166cb7fa5 [CI Skip] release/beta 8.5.2-9
skip-checks: true
2022-05-27 09:37:45 +00:00
Jaco 8810f31eae Remove dev logs (#4861) 2022-05-27 12:27:10 +03:00
github-actions[bot] 3038edec72 [CI Skip] release/beta 8.5.2-8
skip-checks: true
2022-05-27 09:21:19 +00:00
Jaco 9e09c11b0b Use compactFromU8aLim & u8aConcatStrict (#4859)
* Use compactFromU8aLim & u8aConcatStrict

* Bump common
2022-05-27 12:11:17 +03:00
github-actions[bot] c6d1e00b09 [CI Skip] release/beta 8.5.2-7
skip-checks: true
2022-05-27 07:09:27 +00:00
Jaco c5f467dce1 Remove some internal Array allocations (#4858)
* Handle Vec assignment inline

* mappings

* Adjust

* Adjust

* Cleanup build

* Fix BTreeSet build

* Adjust

* hasNoDupes adjustment

* Adjust PortableRegistry extractName
2022-05-27 10:01:11 +03:00
github-actions[bot] c8ce65f079 [CI Skip] release/beta 8.5.2-6
skip-checks: true
2022-05-26 14:07:36 +00:00
Jaco 71a8ff55d6 Cache class definitions for codec primitives (#4855)
* Cache class definitions for codec primitives

* Adjustments for linting

* clearCache

* cleaner test description

* inline assign

* Adjust failing

* Pass definition via Options
2022-05-26 16:59:32 +03:00
github-actions[bot] 4825d5466d [CI Skip] release/beta 8.5.2-5
skip-checks: true
2022-05-26 12:08:06 +00:00
Jaco c6a0f3b8d5 Internal typegen ordering (#4857) 2022-05-26 15:00:10 +03:00
github-actions[bot] 100f008ffa [CI Skip] release/beta 8.5.2-4
skip-checks: true
2022-05-26 10:23:57 +00:00
Jaco 02b9136d56 Adjust Kusama historic StakingLedger for < 1051 (#4856)
* Adjust Kusama historic StakingLedger for < 1051

* CHANGELOG
2022-05-26 13:14:31 +03:00
github-actions[bot] 8379783835 [CI Skip] release/beta 8.5.2-3
skip-checks: true
2022-05-26 07:23:45 +00:00
Jaco 5730005eba Optimization of registry.getOrUnknown with lookup cache (#4853) 2022-05-26 10:15:22 +03:00
github-actions[bot] f701c398c3 [CI Skip] release/beta 8.5.2-2
skip-checks: true
2022-05-26 06:01:51 +00:00
Jaco 5a90d02f1f Support for Option<bool> 1-byte encoding (#4852)
* Support for Option<bool> 1-byte encoding

* Adjust for linting
2022-05-26 08:53:38 +03:00
github-actions[bot] 4dad961106 [CI Skip] release/beta 8.5.2-1
skip-checks: true
2022-05-25 17:55:24 +00:00
Jaco d41491e859 Adjust AnyBool & AnyString typings (#4850)
* Adjust AnyBool & AnyString typings

* Fix AnyString typing
2022-05-25 20:43:30 +03:00
github-actions[bot] 1fbfbac062 [CI Skip] release/beta 8.5.2-0
skip-checks: true
2022-05-25 12:18:33 +00:00
Jaco a7d826f839 Optimization for createClass with shortcut typeDef creation (#4849) 2022-05-25 15:07:42 +03:00
github-actions[bot] 8649c17dd7 [CI Skip] release/stable 8.5.1
skip-checks: true
2022-05-22 16:24:12 +00:00
Jaco 9b794e963d 8.5.1 (#4847) 2022-05-22 19:14:37 +03:00
github-actions[bot] ad9a162b01 [CI Skip] release/beta 8.4.3-7
skip-checks: true
2022-05-22 08:52:56 +00:00
Jaco 82c16e2aed Bump deps (#4846) 2022-05-22 11:41:52 +03:00
github-actions[bot] e6a432049c [CI Skip] release/beta 8.4.3-6
skip-checks: true
2022-05-21 11:47:18 +00:00
Jaco 84c70a850b Bump static metadata (#4844) 2022-05-21 14:38:22 +03:00
github-actions[bot] 937efb631b [CI Skip] release/beta 8.4.3-5
skip-checks: true
2022-05-21 11:23:32 +00:00
Jaco 99898e3310 Handle Vec<Option> in typegen (#4843) 2022-05-21 14:15:09 +03:00
github-actions[bot] d540355729 [CI Skip] release/beta 8.4.3-4
skip-checks: true
2022-05-19 18:31:09 +00:00
Jaco 5fac4d9398 Add additional isCodec checks to error/event .is (#4840) 2022-05-19 21:21:23 +03:00
github-actions[bot] baa2caae68 [CI Skip] release/beta 8.4.3-3
skip-checks: true
2022-05-18 06:11:53 +00:00
Nikos Kontakis 62d9889737 Update substrate connect to 0.7.5 (#4835)
* Update substrate connect to 0.7.5; Add optional configuration to connect()

* Address PR's comments
2022-05-18 09:03:10 +03:00
github-actions[bot] 7c0e9831c3 [CI Skip] release/beta 8.4.3-2
skip-checks: true
2022-05-17 15:11:10 +00:00
Jaco c601e4163a Bump deps (#4834) 2022-05-17 17:59:56 +03:00
github-actions[bot] 1404994792 [CI Skip] release/beta 8.4.3-1
skip-checks: true
2022-05-17 12:32:44 +00:00
Jaco a95d36d67a Support mmr_generateBatchProof RPC (#4831) 2022-05-17 15:23:11 +03:00
github-actions[bot] 48b43b9129 [CI Skip] release/beta 8.4.3-0
skip-checks: true
2022-05-17 06:03:12 +00:00
Jaco c60c1efd46 Adjust extrinsic inspect for signed/unsigned (#4830) 2022-05-17 08:54:41 +03:00
github-actions[bot] ef54cfb29b [CI Skip] release/stable 8.4.2
skip-checks: true
2022-05-15 08:53:15 +00:00
Jaco 23c23a81b3 8.4.2 (#4828) 2022-05-15 11:45:18 +03:00
github-actions[bot] 3d8ba0f1bf [CI Skip] release/stable 8.4.1
skip-checks: true
2022-05-14 12:37:18 +00:00
Jaco b39efbeaf2 8.4.1 (#4827) 2022-05-14 15:28:45 +03:00
github-actions[bot] b305caee6e [CI Skip] release/beta 8.3.3-16
skip-checks: true
2022-05-13 19:41:22 +00:00
Jaco 143a149628 Bump common (#4825) 2022-05-13 22:33:31 +03:00
github-actions[bot] 8f80c0391d [CI Skip] release/beta 8.3.3-15
skip-checks: true
2022-05-13 14:51:31 +00:00
Jaco 1364cb8264 Upgrade blocks (#4824) 2022-05-13 17:42:56 +03:00
github-actions[bot] 0e12ebad1d [CI Skip] release/beta 8.3.3-14
skip-checks: true
2022-05-13 14:03:36 +00:00
Jaco 8dc0f0486d Small decoding cleanups (#4823)
* Small decoding cleanups

* isHex

* Adjust struct

* Additional
2022-05-13 16:55:13 +03:00
github-actions[bot] 6159270465 [CI Skip] release/beta 8.3.3-13
skip-checks: true
2022-05-13 11:33:21 +00:00
Jaco 40b3c54916 Bump common (#4822) 2022-05-13 14:24:45 +03:00
github-actions[bot] 85e7e3c11c [CI Skip] release/beta 8.3.3-12
skip-checks: true
2022-05-12 12:33:11 +00:00
Jaco 3ad01d27b2 Add Vote override for conviction-voting (#4821) 2022-05-12 15:24:39 +03:00
github-actions[bot] 05b0ff2aba [CI Skip] release/beta 8.3.3-11
skip-checks: true
2022-05-12 09:39:49 +00:00
Jaco 84c9da8374 Bump beta @polkadot/util (#4820)
* Bump beta @polkadot/util

* Bump common
2022-05-12 12:28:27 +03:00
github-actions[bot] 6222672faa [CI Skip] release/beta 8.3.3-10
skip-checks: true
2022-05-12 05:22:23 +00:00
Jaco 96f2f83cd5 Bump deps (#4819) 2022-05-12 08:13:00 +03:00
github-actions[bot] f444d9ed75 [CI Skip] release/beta 8.3.3-9
skip-checks: true
2022-05-11 08:36:53 +00:00
Jaco d93a127d88 Create linkage compatible types in V14 conversion (#4816)
* Create linkage compatible types in V14 conversion

* Handle Linkage in extractTypes

* Linkage fallback type

* CHANGELOG
2022-05-11 11:25:30 +03:00
github-actions[bot] 3a9a35a392 [CI Skip] release/beta 8.3.3-8
skip-checks: true
2022-05-10 11:47:01 +00:00
Jaco 5c655ca029 Use I* interfaces for extrinsic payload getters (#4814)
* Use `I*` interfaces for extrinsic payload getters

* Adjust with IText

* Text extends IText

* Adjust
2022-05-10 14:38:58 +03:00
github-actions[bot] 1808cb0a9d [CI Skip] release/beta 8.3.3-7
skip-checks: true
2022-05-10 07:48:04 +00:00
Jaco 54e94ec6bc Change all usages of .substr to .substring (#4809) 2022-05-10 10:39:15 +03:00
github-actions[bot] 22db4f1c3d [CI Skip] release/beta 8.3.3-6
skip-checks: true
2022-05-10 07:35:27 +00:00
Jaco e514a59e63 Bump deps (#4812) 2022-05-10 10:27:03 +03:00
github-actions[bot] 3318a7566f [CI Skip] release/beta 8.3.3-5
skip-checks: true
2022-05-09 10:27:35 +00:00
Jaco fd568c0341 Optimize Compact decoding in Uint8Array streams (#4808)
* Optimize Compact decoding in Uint8Array streams

* Adjust test

* Adjust
2022-05-09 13:19:05 +03:00
github-actions[bot] 2edcef6ff5 [CI Skip] release/beta 8.3.3-4
skip-checks: true
2022-05-09 08:05:51 +00:00
Jaco 264cc9365e Bump metadata (#4806) 2022-05-09 10:55:51 +03:00
github-actions[bot] 6e23a27ce1 [CI Skip] release/beta 8.3.3-3
skip-checks: true
2022-05-09 06:59:58 +00:00
Jaco 38d39a4d13 Allow for optional definitions in typegen (#4805)
* Allow for optional definitions in typegen

* Adjust

* Adjust
2022-05-09 09:51:35 +03:00
github-actions[bot] 6954ec794c [CI Skip] release/beta 8.3.3-2
skip-checks: true
2022-05-09 06:11:08 +00:00
Jaco 3ee6eb5a13 Dedupe wss:// handling in polkadot-types-from-{chain, defs} (#4804) 2022-05-09 09:01:07 +03:00
github-actions[bot] 9d1c848f28 [CI Skip] release/beta 8.3.3-1
skip-checks: true
2022-05-09 05:42:43 +00:00
Jaco 1d3258f537 Add explicit support for Call typegen (inclusive of non-defaults) (#4803) 2022-05-09 08:31:48 +03:00
github-actions[bot] e8d7013172 [CI Skip] release/beta 8.3.3-0
skip-checks: true
2022-05-09 05:14:07 +00:00
Jaco 55ccdd2fbc Add support for Range/RangeInclusive typegen (#4802) 2022-05-09 08:03:17 +03:00
github-actions[bot] 0449dd7b51 [CI Skip] release/stable 8.3.2
skip-checks: true
2022-05-08 16:23:38 +00:00
Jaco 4d44c1187b 8.3.2 (#4800) 2022-05-08 19:15:30 +03:00
github-actions[bot] f2eff6628b [CI Skip] release/beta 8.3.2-2
skip-checks: true
2022-05-06 11:22:58 +00:00
Nikos KontakisandPierre Krieger 4923bc3e35 Bump @substrate/connect in rpc-provider to 0.7.4 (#4796)
* Bump @substrate/connect in rpc-provider to 0.7.4

* Add new optional param config in ScProvider's connect() where user can alter the log level

* Satisfy linter

* Update packages/rpc-provider/src/substrate-connect/ScProvider.ts

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Address PRs comments

* Fix build error

* remove config feature

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
2022-05-06 14:11:37 +03:00
github-actions[bot] 47da005bee [CI Skip] release/beta 8.3.2-1
skip-checks: true
2022-05-06 03:51:19 +00:00
Jaco 7e82ab3d43 Adjust BTreeSet in typegen top-level generation (#4794) 2022-05-06 06:42:22 +03:00
github-actions[bot] 8df9642e04 [CI Skip] release/beta 8.3.2-0
skip-checks: true
2022-05-05 06:17:33 +00:00
Jaco 6f76e1c4cc Bump @polkadot/dev (#4792) 2022-05-05 09:07:55 +03:00
github-actions[bot] 1d65cc5642 [CI Skip] release/stable 8.3.1
skip-checks: true
2022-05-01 07:01:27 +00:00
Jaco 722bb5222e 8.3.1 (#4789) 2022-05-01 09:52:47 +03:00
github-actions[bot] 49e2daf8f2 [CI Skip] release/beta 8.2.2-11
skip-checks: true
2022-05-01 06:43:57 +00:00
Jaco 88e3c900b7 Bump metadata (#4788) 2022-05-01 09:35:49 +03:00
github-actions[bot] a127dea5e4 [CI Skip] release/beta 8.2.2-10
skip-checks: true
2022-04-30 19:44:53 +00:00
Jaco d29660dc4e Adjust size-assert for U8Fixed (#4787) 2022-04-30 22:35:23 +03:00
github-actions[bot] 1870ad26d5 [CI Skip] release/beta 8.2.2-9
skip-checks: true
2022-04-30 11:29:05 +00:00
Jaco 558a42c6ed Correct BTreeSet extraction (#4785) 2022-04-30 14:18:45 +03:00
github-actions[bot] 6708264688 [CI Skip] release/beta 8.2.2-8
skip-checks: true
2022-04-30 06:09:26 +00:00
Jaco abac14f983 Bump @polkadot/util (#4784) 2022-04-30 09:01:02 +03:00
github-actions[bot] 3cf9040115 [CI Skip] release/beta 8.2.2-7
skip-checks: true
2022-04-29 11:47:32 +00:00
Jaco 37dcd78c4a Bump TS (#4782) 2022-04-29 14:37:50 +03:00
github-actions[bot] 6b3e4cc90e [CI Skip] release/beta 8.2.2-6
skip-checks: true
2022-04-27 09:54:17 +00:00
Jaco 79ab347cbe Westend 9200 upgrade block (#4777) 2022-04-27 12:43:28 +03:00
github-actions[bot] bc302c5cb7 [CI Skip] release/beta 8.2.2-5
skip-checks: true
2022-04-27 07:05:38 +00:00
Jaco 9972776afb Bump @polkadot/dev (#4776) 2022-04-27 09:56:13 +03:00
github-actions[bot] 0b2a3c4e74 [CI Skip] release/beta 8.2.2-4
skip-checks: true
2022-04-26 17:36:22 +00:00
Jaco ccac72fece Remove outdated contract docs (#4774) 2022-04-26 20:27:48 +03:00
github-actions[bot] 8d5209d7dc [CI Skip] release/beta 8.2.2-3
skip-checks: true
2022-04-26 17:23:03 +00:00
Alex DandAlex D 5c2bd9dfa7 fetch metadata via websocket in polkadot-types-from-defs (#4773)
* add ability to fetch metadata from websocket connection as stated in usage https://github.com/polkadot-js/api/blob/master/packages/typegen/src/fromDefs.ts\#L20

* exit after websocket

Co-authored-by: Alex D <pr0fedt@gmail.com>
2022-04-26 20:13:29 +03:00
github-actions[bot] b2e71be983 [CI Skip] release/beta 8.2.2-2
skip-checks: true
2022-04-26 14:59:52 +00:00
Jaco d2f3672f2c Metadata for nomination pools (#4753)
* Metadata for nomination pools

* Update

* Adjust

* Bump meta

* Re-add pool meta

* Latest pools metadata

* Rerun
2022-04-26 17:48:49 +03:00
github-actions[bot] 6fb7849091 [CI Skip] release/beta 8.2.2-1
skip-checks: true
2022-04-26 13:23:48 +00:00
Jaco 983c77fe61 Adjustment for paymentInfo (#4771)
* Adjustment for paymentInfo

* Bump dev
2022-04-26 16:12:17 +03:00
github-actions[bot] 256e35386a [CI Skip] release/beta 8.2.2-0
skip-checks: true
2022-04-25 09:08:14 +00:00
Jaco 8beb03b177 Kusama 9190 upgrade block (#4769) 2022-04-25 12:00:39 +03:00
github-actions[bot] 967f5e980a [CI Skip] release/stable 8.2.1
skip-checks: true
2022-04-24 08:59:23 +00:00
Jaco 00a27efaee 8.2.1 (#4766) 2022-04-24 11:51:42 +03:00
github-actions[bot] a7163fb1ba [CI Skip] release/beta 8.1.2-6
skip-checks: true
2022-04-24 07:32:16 +00:00
Jaco 4c6dd53c3b Bump dev (w/ lint fixes) (#4765) 2022-04-24 10:23:58 +03:00
github-actions[bot] 61199ffb2b [CI Skip] release/beta 8.1.2-5
skip-checks: true
2022-04-24 07:11:13 +00:00
Jaco dbfb03760c Bump static metadata (#4764)
* Bump static metadata

* Redo Kusama
2022-04-24 10:02:48 +03:00
github-actions[bot] c9b1fcdb0a [CI Skip] release/beta 8.1.2-4
skip-checks: true
2022-04-22 13:30:54 +00:00
Jaco 29953edd24 api.derive.balances.fees (#4761)
* api.derive.balances.fees

* Adjust for removal

* Adjust
2022-04-22 16:22:36 +03:00
github-actions[bot] 96a23bda50 [CI Skip] release/beta 8.1.2-3
skip-checks: true
2022-04-22 05:14:41 +00:00
serge 09a8d80144 make WS provider timeout configurable (#4758)
* make WS provider timeout configurable

* minor
2022-04-22 08:05:42 +03:00
github-actions[bot] 5637579879 [CI Skip] release/beta 8.1.2-2
skip-checks: true
2022-04-21 19:43:07 +00:00
Jaco 448ce0a76e Re-bump dev 2022-04-21 22:34:33 +03:00
Jaco a6a062378d Bump dev (#4763) 2022-04-21 22:26:03 +03:00
github-actions[bot] 40c78f95d2 [CI Skip] release/beta 8.1.2-1
skip-checks: true
2022-04-19 14:10:30 +00:00
Jaco b0e135c5ca Bump deps (#4757) 2022-04-19 16:59:27 +03:00
github-actions[bot] 22218bd9b0 [CI Skip] release/beta 8.1.2-0
skip-checks: true
2022-04-19 10:10:08 +00:00
Jaco 149b7d9ee6 Don't fake sign if already signed (#4756) 2022-04-19 13:02:20 +03:00
github-actions[bot] 9a7b91a6f5 [CI Skip] release/stable 8.1.1
skip-checks: true
2022-04-17 11:40:27 +00:00
Jaco 80b165ba34 8.1.1 (#4750)
* 8.1.1

* CHANGELOG
2022-04-17 14:31:59 +03:00
github-actions[bot] 95a4512530 [CI Skip] release/beta 8.0.3-6
skip-checks: true
2022-04-17 10:52:54 +00:00
Jaco 15a315dede Bump static metadata (#4749) 2022-04-17 13:44:21 +03:00
github-actions[bot] 32548a34a4 [CI Skip] release/beta 8.0.3-5
skip-checks: true
2022-04-17 05:39:22 +00:00
Jaco 50142d7e63 Pull typegen __dirname from packageInfo (#4748)
* Pull ty[pegen __dirname from packageInfo

* CHANGELOG
2022-04-17 08:31:04 +03:00
github-actions[bot] 1ed6117e3f [CI Skip] release/beta 8.0.3-4
skip-checks: true
2022-04-14 13:51:48 +00:00
Jaco a392025a15 Adjust default "no RPC response" timeout to 60s (#4746) 2022-04-14 16:43:53 +03:00
github-actions[bot] fbeb478602 [CI Skip] release/beta 8.0.3-3
skip-checks: true
2022-04-14 12:17:31 +00:00
Jaco 2cdd24445c Adjust entriesPages w/ & w/o at (#4745)
* Adjust entriesPages w/ & w/o at

* Adjust

* Update packages/api/src/base/Decorate.ts

* s/keyset/keys/

* CHANGELOG
2022-04-14 15:07:55 +03:00
github-actions[bot] e545f6f2b3 [CI Skip] release/beta 8.0.3-2
skip-checks: true
2022-04-14 09:51:19 +00:00
Zannis Kalampoukis 1aa2b7e1ff fix: Typegen handles structs and vectors of structs without erroring (#4743) 2022-04-14 12:39:57 +03:00
github-actions[bot] 677d0c9969 [CI Skip] release/beta 8.0.3-1
skip-checks: true
2022-04-14 05:22:37 +00:00
Jaco 775fff5333 Apply wildcard type matches (renamed pallets) (#4741)
* Apply wildcard type matches (renamed pallets)

* typo
2022-04-14 08:14:04 +03:00
github-actions[bot] 9345a18de0 [CI Skip] release/beta 8.0.3-0
skip-checks: true
2022-04-12 05:07:29 +00:00
Jaco a4256396ee Bump deps (#4739) 2022-04-12 07:59:13 +03:00
github-actions[bot] 776600ef00 [CI Skip] release/stable 8.0.2
skip-checks: true
2022-04-11 18:09:09 +00:00
Jaco 1a31043cc4 Detect typegen template location for commonjs execution (#4738) 2022-04-11 21:01:00 +03:00
github-actions[bot] 66159955ac [CI Skip] release/stable 8.0.1
skip-checks: true
2022-04-10 10:34:25 +00:00
Jaco 03c725f637 8.0.1 (#4734) 2022-04-10 13:26:19 +03:00
github-actions[bot] e5708a7e7e [CI Skip] release/beta 7.15.2-15
skip-checks: true
2022-04-09 13:13:27 +00:00
Jaco fb5ce83f74 Add support for apiAt.tx(...) (#4696)
* Add support for apiAt.tx(...)

* CHANGELOG
2022-04-09 16:05:36 +03:00
github-actions[bot] 6c3bd2f408 [CI Skip] release/beta 7.15.2-14
skip-checks: true
2022-04-09 10:11:21 +00:00
Jaco 66e01afe26 Bump metadata (#4732) 2022-04-09 13:02:46 +03:00
github-actions[bot] 71f9bdf368 [CI Skip] release/beta 7.15.2-13
skip-checks: true
2022-04-09 09:26:26 +00:00
Jaco 7af9330026 Add bagList expand(bag: Bag) (#4731) 2022-04-09 12:17:58 +03:00
github-actions[bot] d5aff171e4 [CI Skip] release/beta 7.15.2-12
skip-checks: true
2022-04-09 09:15:46 +00:00
Jaco 543de63af8 Re-use bagList types (#4730) 2022-04-09 12:05:33 +03:00
github-actions[bot] cdcdf589dd [CI Skip] release/beta 7.15.2-11
skip-checks: true
2022-04-09 08:49:12 +00:00
Jaco 1330b58afd Align derive.bagsList.all with multi (#4729) 2022-04-09 11:40:48 +03:00
github-actions[bot] 0b2ec65e88 [CI Skip] release/beta 7.15.2-10
skip-checks: true
2022-04-09 08:37:51 +00:00
Jaco 8840e29063 Bump util to 9.0.1 (#4728) 2022-04-09 11:29:42 +03:00
github-actions[bot] b9925b569d [CI Skip] release/beta 7.15.2-9
skip-checks: true
2022-04-09 06:41:34 +00:00
Jaco 2640b65be9 Fix typegen for cjs imports (#4727) 2022-04-09 09:33:05 +03:00
github-actions[bot] d64a0ca295 [CI Skip] release/beta 7.15.2-8
skip-checks: true
2022-04-08 18:54:24 +00:00
Jaco 79eeed3f9a Return sorted names for api.registry.lookup.names (#4726) 2022-04-08 21:46:03 +03:00
github-actions[bot] d154b535e6 [CI Skip] release/beta 7.15.2-7
skip-checks: true
2022-04-08 15:43:31 +00:00
Jaco 87c2690fc2 Bagslist derive sorted (#4725) 2022-04-08 18:35:14 +03:00
github-actions[bot] 8f0ca37c60 [CI Skip] release/beta 7.15.2-6
skip-checks: true
2022-04-08 13:04:36 +00:00
Jaco f7dd4a3552 Add basic derive.bagsList support (#4723) 2022-04-08 15:56:14 +03:00
github-actions[bot] abcad05a91 [CI Skip] release/beta 7.15.2-5
skip-checks: true
2022-04-08 05:59:53 +00:00
Jaco ba188dcc0d JSONRPC request/response handler opts (#4722)
* JSONRPC request/response handler opts

* Fix test

* CHANGELOG
2022-04-08 08:51:44 +03:00
github-actions[bot] ae2422f350 [CI Skip] release/beta 7.15.2-4
skip-checks: true
2022-04-08 05:45:27 +00:00
Zannis KalampoukisandJaco 576efc0239 fix: typegen supports vectors of slices (#4720)
* fix: typegen supports vectors of slices

* fix linting

* Update packages/typegen/src/util/derived.ts

Co-authored-by: Jaco <jacogr@gmail.com>
2022-04-08 08:37:31 +03:00
github-actions[bot] 111540177f [CI Skip] release/beta 7.15.2-3
skip-checks: true
2022-04-06 10:54:35 +00:00
Josep M Sobrepere 43ee566669 docs: improve rpc-provider README (#4719) 2022-04-06 13:44:56 +03:00
github-actions[bot] 39299188b0 [CI Skip] release/beta 7.15.2-2
skip-checks: true
2022-04-06 09:15:26 +00:00
Jaco 5d13bfb925 Bump @polkadot/* (#4718)
* Bump @polkadot/*

* Bump @substrate/connect

* Adjust
2022-04-06 12:06:42 +03:00
github-actions[bot] c759ff0c12 [CI Skip] release/beta 7.15.2-1
skip-checks: true
2022-04-05 12:29:28 +00:00
Jaco 0cc34dff85 Polkadot 9180 block (#4717) 2022-04-05 15:20:36 +03:00
github-actions[bot] 1682a8f096 [CI Skip] release/beta 7.15.2-0
skip-checks: true
2022-04-05 06:22:59 +00:00
Jaco be572aabf0 Bump @polkadot/dev (#4715) 2022-04-05 09:14:32 +03:00
github-actions[bot] 7a6d19d241 [CI Skip] release/stable 7.15.1
skip-checks: true
2022-04-03 06:07:54 +00:00
Jaco f4a590d7f8 7.15.1 (#4714) 2022-04-03 08:59:31 +03:00
github-actions[bot] 771e5f3bcf [CI Skip] release/beta 7.14.4-9
skip-checks: true
2022-04-02 16:32:54 +00:00
Jaco 1ba427356d Kusama & Westend upgrade blocks (#4713) 2022-04-02 19:24:34 +03:00
github-actions[bot] aad497e9d2 [CI Skip] release/beta 7.14.4-8
skip-checks: true
2022-04-02 10:38:12 +00:00
Jaco 95fc2b2c99 Bump static metadata (#4712) 2022-04-02 13:28:40 +03:00
github-actions[bot] b7b707249b [CI Skip] release/beta 7.14.4-7
skip-checks: true
2022-04-01 08:00:13 +00:00
Jaco ce95e305f3 Bump dev deps (#4711) 2022-04-01 10:50:46 +03:00
github-actions[bot] 4ea793f55e [CI Skip] release/beta 7.14.4-6
skip-checks: true
2022-03-31 13:52:55 +00:00
Jaco bb0b365dfe Lazy crypto init (#4709) 2022-03-31 16:45:09 +03:00
github-actions[bot] 756f817d93 [CI Skip] release/beta 7.14.4-5
skip-checks: true
2022-03-31 07:56:48 +00:00
Jaco df4bda1fc8 Promise cache for metadata from version (improves parallel) (#4708)
* Cache for metadata from version (improves parallel)

* Ordering

* Single waiting placeholder

* Dedupe

* Sprinkle in await

* Tighten up with HexString

* CHANGELOG
2022-03-31 10:46:46 +03:00
github-actions[bot] a98e9543b8 [CI Skip] release/beta 7.14.4-4
skip-checks: true
2022-03-30 15:07:08 +00:00
Jaco 84abaff414 DispatchError.error as [u8; 4] (#4570)
* DispatchError.error as [u8; 4]

* Adjust Error.is

* Adjust

* Adjust

* U8a applies to error only

* CHANGELOG
2022-03-30 17:57:41 +03:00
github-actions[bot] 29d5460cdd [CI Skip] release/beta 7.14.4-3
skip-checks: true
2022-03-30 14:51:41 +00:00
HackFisher e2d0de4f6c Update maxExtrinsic definition (#4703)
Related https://github.com/polkadot-js/api/pull/4702

Sorry thatI shouldn't modify the auto-generated file `types.ts` which was later get reverted by `[CI Skip] release/beta 7.14.4-1`:

https://github.com/polkadot-js/api/commit/6fb6c40c7dd073b7715f9a7fa7628f4b62ab99a8
2022-03-30 17:41:28 +03:00
github-actions[bot] 8e32777efa [CI Skip] release/beta 7.14.4-2
skip-checks: true
2022-03-30 08:26:59 +00:00
Xiliang Chen 39b1de326c implement entriesPaged and keysPages for query at (#4701)
* implement entriesPaged and keysPages for query at

* remove redudent declaration
2022-03-30 11:17:54 +03:00
github-actions[bot] 6fb6c40c7d [CI Skip] release/beta 7.14.4-1
skip-checks: true
2022-03-30 05:02:17 +00:00
HackFisher badb10bdd9 Fix types for maxExtrinsic (#4702)
Ref: https://github.com/paritytech/substrate/blob/41567c30da77a2546a90c1049042ebd7b0b09bc4/frame/system/src/limits.rs#L99-L102
2022-03-30 07:52:05 +03:00
github-actions[bot] 235a7b1aa9 [CI Skip] release/beta 7.14.4-0
skip-checks: true
2022-03-29 04:34:42 +00:00
Josep M Sobrepere b7d65fb506 fix: export substrate-connect WellKnownChain (#4700) 2022-03-29 07:24:57 +03:00
github-actions[bot] 8eb0524fed [CI Skip] release/stable 7.14.3
skip-checks: true
2022-03-28 10:10:02 +00:00
Jaco bab50b2d74 7.14.3 (#4699) 2022-03-28 13:02:22 +03:00
github-actions[bot] bb75b42273 [CI Skip] release/stable 7.14.2
skip-checks: true
2022-03-28 05:23:21 +00:00
Jaco 949e429d04 Don't export ScProvider top-level in @polkadot/rpc-provider (#4694)
* Don't export `ScProvider` top-level in `@polkadot/rpc-provider`

* 7.14.2
2022-03-28 08:12:33 +03:00
github-actions[bot] 0b1c20efd7 [CI Skip] release/stable 7.14.1
skip-checks: true
2022-03-27 08:29:36 +00:00
Jaco 0536998766 Correct release to 7.14.1 (#4691) 2022-03-27 11:19:58 +03:00
Jaco 22651eb4b8 8.14.1 (#4690) 2022-03-27 11:00:19 +03:00
github-actions[bot] 48414bdb34 [CI Skip] release/beta 7.13.2-10
skip-checks: true
2022-03-27 06:34:39 +00:00
Jaco 2ff6a85fb3 Bump TypeScript (#4689) 2022-03-27 09:27:11 +03:00
github-actions[bot] 8be1f337a8 [CI Skip] release/beta 7.13.2-9
skip-checks: true
2022-03-25 16:31:07 +00:00
Jaco 2c7056da25 Bump dev (& update CHANGELOG) (#4687) 2022-03-25 18:20:15 +02:00
github-actions[bot] b53c22d6d3 [CI Skip] release/beta 7.13.2-8
skip-checks: true
2022-03-25 15:56:15 +00:00
Josep M SobrepereandJaco 17f316b7c7 Add smoldot rpc provider (#4672)
* Add smoldot rpc provider

* remove smoldot references and fix lint issues

* fix wrong export

* Update packages/rpc-provider/src/substrate-connect/createScClient.ts

Co-authored-by: Jaco <jacogr@gmail.com>

* Update packages/rpc-provider/src/substrate-connect/createScClient.ts

Co-authored-by: Jaco <jacogr@gmail.com>

* Update packages/rpc-provider/src/substrate-connect/Health.ts

Co-authored-by: Jaco <jacogr@gmail.com>

* fix linting on `createScClient.ts`

* fix linting on `Health.ts`

* use @polkadotjs/utils

* remove @substrate/connect

* add @substrate/connect

* fixt linting issues

* export `ScProvider` class

* fix connecting to dependency

* make ScProvider lazy

* dendency -> sharedSandbox

* use @substrate/connect@0.7.0-alpha.0

* fix bundle.ts export

Co-authored-by: Jaco <jacogr@gmail.com>
2022-03-25 17:46:24 +02:00
github-actions[bot] b44fcc90b2 [CI Skip] release/beta 7.13.2-7
skip-checks: true
2022-03-24 18:19:20 +00:00
Jaco b4e477a8c1 Remove all README links (#4685) 2022-03-24 20:09:16 +02:00
github-actions[bot] 4b921c8a55 [CI Skip] release/beta 7.13.2-6
skip-checks: true
2022-03-24 10:13:45 +00:00
Yaroslav Bolyukin e53231b70a Support BTreeMap/BTreeSet in typegen (#4682) 2022-03-24 12:04:14 +02:00
github-actions[bot] afd1db58ac [CI Skip] release/beta 7.13.2-5
skip-checks: true
2022-03-23 14:18:04 +00:00
Jaco 63ba84a641 Clear connection timeout on disconnect (#4681) 2022-03-23 16:09:25 +02:00
github-actions[bot] 044aecbfc3 [CI Skip] release/beta 7.13.2-4
skip-checks: true
2022-03-23 05:29:10 +00:00
Jaco e573c26df3 Bump dev (#4679) 2022-03-23 07:19:33 +02:00
github-actions[bot] 31e7de31f3 [CI Skip] release/beta 7.13.2-3
skip-checks: true
2022-03-22 14:26:51 +00:00
Jaco 7cd9c16eae Add dev_getBlockStats RPC (#4677)
* Add dev_getBlockStats RPC

* CHANGELOG
2022-03-22 16:18:13 +02:00
github-actions[bot] 2b1a7da446 [CI Skip] release/beta 7.13.2-2
skip-checks: true
2022-03-22 07:49:36 +00:00
Jaco 9399c8d24f Output BitVec toHuman to LSB (limit support) (#4676) 2022-03-22 09:41:17 +02:00
github-actions[bot] 798e5fcc78 [CI Skip] release/beta 7.13.2-1
skip-checks: true
2022-03-22 07:05:38 +00:00
Jaco d8ad237b00 Add total.bytes{Recv, Sent} to provider stats (#4671) 2022-03-22 08:54:42 +02:00
github-actions[bot] 550cb10766 [CI Skip] release/beta 7.13.2-0
skip-checks: true
2022-03-22 06:52:53 +00:00
Jaco a44108c3f3 Exatra BitVec namespaces top-level (#4674) 2022-03-22 08:43:08 +02:00
github-actions[bot] 2f28ea0ea8 [CI Skip] release/stable 7.13.1
skip-checks: true
2022-03-19 11:41:58 +00:00
Jaco 488d078b9c 7.13.1 (#4670)
* 7.13.1

* typo
2022-03-19 13:33:35 +02:00
github-actions[bot] ba384cee78 [CI Skip] release/beta 7.12.2-9
skip-checks: true
2022-03-19 09:06:14 +00:00
Jaco 4f95f33cbb Bump util (#4668) 2022-03-19 10:58:21 +02:00
github-actions[bot] 368cb8314c [CI Skip] release/beta 7.12.2-8
skip-checks: true
2022-03-19 07:51:35 +00:00
Jaco c01896d24f Bump babel & dev (#4667) 2022-03-19 09:43:03 +02:00
github-actions[bot] 983043bd1e [CI Skip] release/beta 7.12.2-7
skip-checks: true
2022-03-18 15:17:52 +00:00
MOZGIII 9c2ed6297a Follow-up fix after #4665 (#4666)
* Fix a small nit

* Correct a newly discovered type issue
2022-03-18 17:09:41 +02:00
github-actions[bot] 8a7fee5903 [CI Skip] release/beta 7.12.2-6
skip-checks: true
2022-03-18 14:41:33 +00:00
MOZGIII b0e8a8512a Allow generic Data param at RpcError (#4665)
* Allow generic Data param at RpcError

* Ensure that unless `Data` is specified, the field can't be accessed
2022-03-18 16:33:14 +02:00
github-actions[bot] f83d23d0f6 [CI Skip] release/beta 7.12.2-5
skip-checks: true
2022-03-18 07:50:30 +00:00
Jaco 9dfb5cb237 state_trieMigrationStatus RPC (#4664) 2022-03-18 09:40:37 +02:00
github-actions[bot] 8c87b16924 [CI Skip] release/beta 7.12.2-4
skip-checks: true
2022-03-17 19:01:11 +00:00
Jaco 0d5dce002d Bump static metadata (#4663) 2022-03-17 20:51:10 +02:00
github-actions[bot] 4d0c777a8f [CI Skip] release/beta 7.12.2-3
skip-checks: true
2022-03-17 15:41:45 +00:00
Jaco d63108a4b4 Add basic provider stats (#4662)
* Add basic provider stats

* Add timeout counter

* Make stats() optional for providers (don't break what is out there)

* Update packages/rpc-provider/src/types.ts
2022-03-17 17:33:40 +02:00
github-actions[bot] 5898ac335e [CI Skip] release/beta 7.12.2-2
skip-checks: true
2022-03-17 08:24:12 +00:00
Jaco f108d16d1b RPC timeouts (#4661)
* RPC timeouts

* for loop
2022-03-17 10:14:26 +02:00
github-actions[bot] 32f1495993 [CI Skip] release/beta 7.12.2-1
skip-checks: true
2022-03-17 05:45:53 +00:00
Jaco 2527497e4a Bump dev deps (#4658)
* Bump dev deps

* trigger
2022-03-17 07:37:40 +02:00
github-actions[bot] e50209da0d [CI Skip] release/beta 7.12.2-0
skip-checks: true
2022-03-15 06:28:29 +00:00
Noah Corona cccd512d70 Add rpc error fields (#4637)
* [WIP] Add RpcError

Currently located in rpc-core at request of maintainer. However unclear as to how it should be used, because the error
needs to be thrown in rpc-provider, and depending on it causes a dependency loop.

* Move `RpcError` to `rpc-provider`

Also add tests
2022-03-15 08:20:16 +02:00
github-actions[bot] 1db2136a3d [CI Skip] release/stable 7.12.1
skip-checks: true
2022-03-13 09:50:36 +00:00
Jaco 466485d5aa 7.12.1 (#4653) 2022-03-13 11:39:47 +02:00
github-actions[bot] c9ea333add [CI Skip] release/beta 7.11.2-8
skip-checks: true
2022-03-12 10:15:28 +00:00
Jaco dca62cf3ba Bump common (#4652) 2022-03-12 12:06:50 +02:00
github-actions[bot] 2d9e667d01 [CI Skip] release/beta 7.11.2-7
skip-checks: true
2022-03-11 12:02:08 +00:00
Jaco 67679f34e9 Align CHANGELOG (#4650)
* Align CHANGELOG

* Typos
2022-03-11 13:54:11 +02:00
github-actions[bot] d646fa03af [CI Skip] release/beta 7.11.2-6
skip-checks: true
2022-03-11 06:17:48 +00:00
Jaco 6c33e98553 Ensure Option<None> of different type evaluates to None (#4647) 2022-03-11 08:09:21 +02:00
github-actions[bot] e8cdbf9e80 [CI Skip] release/beta 7.11.2-5
skip-checks: true
2022-03-10 18:51:25 +00:00
Jaco 5016e12ae4 Fix conversion of metadata prior to <= V11 to V14 (#4646) 2022-03-10 20:41:09 +02:00
github-actions[bot] ac09179768 [CI Skip] release/beta 7.11.2-4
skip-checks: true
2022-03-10 08:08:05 +00:00
Jaco 8cc1663bd8 Bump deps (#4644) 2022-03-10 09:57:55 +02:00
github-actions[bot] 34d090c9b3 [CI Skip] release/beta 7.11.2-3
skip-checks: true
2022-03-09 11:37:47 +00:00
Jaco cb1d13e04c Add lookup types to the registry (#4642)
* Add lookup types to the registry

* Adjust
2022-03-09 13:29:31 +02:00
github-actions[bot] 022d79c4cd [CI Skip] release/beta 7.11.2-2
skip-checks: true
2022-03-09 09:53:38 +00:00
Jaco ed079a6acb Adjust registry augment location (#4641) 2022-03-09 11:44:54 +02:00
github-actions[bot] 01d023d141 [CI Skip] release/beta 7.11.2-1
skip-checks: true
2022-03-08 11:08:05 +00:00
Jaco 0b03f73975 Allow for (ab)use of Option<Null>/Option<()> as a boolean (#4639)
* Allow for (ab)use of Option<Null> as a boolean

* Additional test for ()

* Adjust
2022-03-08 12:58:33 +02:00
github-actions[bot] e4cae64187 [CI Skip] release/beta 7.11.2-0
skip-checks: true
2022-03-07 08:22:49 +00:00
Jaco f13989d712 Support bundlers where import.meta.url is undefined (#4634) 2022-03-07 10:13:02 +02:00
github-actions[bot] 05c3f12cd7 [CI Skip] release/stable 7.11.1
skip-checks: true
2022-03-06 16:38:04 +00:00
Jaco 9f6f33844a 7.11.1 (#4631)
* 7.11.1

* packageInfo

* Robustness
2022-03-06 18:30:20 +02:00
github-actions[bot] 895f82920d [CI Skip] release/beta 7.10.2-10
skip-checks: true
2022-03-06 09:24:51 +00:00
Jaco 06fa4aa6eb Allow use of options.signer for status updates (#4615)
* Allow use of options.signer for status updates

* Use isFunction as applicable

* Use UpdateInfo

* CHANGELOG
2022-03-06 11:14:50 +02:00
github-actions[bot] 1e5002fb5e [CI Skip] release/beta 7.10.2-9
skip-checks: true
2022-03-06 08:36:08 +00:00
Jaco 8be52dec13 Apply chunking to era{Exposure, Prefs, Slashes} (#4620)
* Apply chunking to era{Exposure, Prefs, Slashes}

* CHANGELOG

* Failsafe return location

* typo
2022-03-06 10:26:43 +02:00
github-actions[bot] 8fcda8cd54 [CI Skip] release/beta 7.10.2-8
skip-checks: true
2022-03-06 08:02:44 +00:00
Jaco d08c306887 Bump metadata (#4630) 2022-03-06 09:54:02 +02:00
github-actions[bot] eb6b0232c3 [CI Skip] release/beta 7.10.2-7
skip-checks: true
2022-03-06 06:50:29 +00:00
Jaco e5fbaeb7cd Bump deps (#4629) 2022-03-06 08:42:51 +02:00
github-actions[bot] 8e61ea1b8b [CI Skip] release/beta 7.10.2-6
skip-checks: true
2022-03-04 10:32:35 +00:00
Jaco 9fe202a4d3 Add Polkadot 9170 upgrade block (#4627) 2022-03-04 12:24:43 +02:00
github-actions[bot] 6e62d03652 [CI Skip] release/beta 7.10.2-5
skip-checks: true
2022-03-04 07:51:56 +00:00
Jaco 49dc66f7d4 Adjust auto actions (#4626)
* Adjust auto actions

* Adjust
2022-03-04 09:43:58 +02:00
github-actions[bot] 22320f9995 [CI Skip] release/beta 7.10.2-4
skip-checks: true
2022-03-03 09:39:17 +00:00
Jaco 7603bad434 Remove checkout from auto-{approve, merge} actions (#4624) 2022-03-03 11:29:15 +02:00
github-actions[bot] e82f0f35ad [CI Skip] release/beta 7.10.2-3
skip-checks: true
2022-03-02 05:22:27 +00:00
Jaco ae0aa14eb8 Replace mergify with action (#4619) 2022-03-02 07:14:42 +02:00
github-actions[bot] 4875bb9990 [CI Skip] release/beta 7.10.2-2
skip-checks: true
2022-03-01 11:16:01 +00:00
Jacoandmergify[bot] a0308dd25a Bump TS (#4616)
* Bump TS

* Adjust

* Adjust Observable Codec returns

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-01 11:08:20 +00:00
github-actions[bot] edb06d971a [CI Skip] release/beta 7.10.2-1
skip-checks: true
2022-02-28 10:44:59 +00:00
Jacoandmergify[bot] 271a4d8fd7 Kusama 9170 upgrade block (#4613)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-28 10:26:56 +00:00
github-actions[bot] a71e5ad95c [CI Skip] release/beta 7.10.2-0
skip-checks: true
2022-02-28 07:34:42 +00:00
Jaco edcdb70e8a Adjust approve workflow (#4612) 2022-02-28 07:13:43 +00:00
github-actions[bot] 17357f6b99 [CI Skip] release/stable 7.10.1
skip-checks: true
2022-02-27 08:04:03 +00:00
Jaco c596a8cb51 7.10.1 (#4609) 2022-02-27 09:42:16 +02:00
github-actions[bot] bdf13b10e5 [CI Skip] release/beta 7.9.2-12
skip-checks: true
2022-02-27 07:15:02 +00:00
coolcorexixandphat.itern 519a12f19a Investigate 4559 v2 (#4608)
* first build

* second build, area of defect found

* third build, fixed the problem successfully

* cleaning up after receving maintainer's response

Co-authored-by: phat.itern <phatNfqAsia>
2022-02-27 08:50:54 +02:00
github-actions[bot] beffc7b754 [CI Skip] release/beta 7.9.2-11
skip-checks: true
2022-02-26 08:51:00 +00:00
Jaco d5ae7031cd Metadata bump (#4606)
* Metadata bump

* Detect BitSequence order

* Adjust
2022-02-26 10:29:41 +02:00
github-actions[bot] 8aff13b827 [CI Skip] release/beta 7.9.2-10
skip-checks: true
2022-02-25 11:03:13 +00:00
Jaco a23b3f953b Retrieve named reserves (#4602) 2022-02-25 12:40:35 +02:00
github-actions[bot] 1249c46019 [CI Skip] release/beta 7.9.2-9
skip-checks: true
2022-02-24 18:44:58 +00:00
Jaco 2aaf52bb92 Use assertUnreachable from @polkadot/util (#4600) 2022-02-24 18:28:34 +00:00
github-actions[bot] 3372898f82 [CI Skip] release/beta 7.9.2-8
skip-checks: true
2022-02-24 06:38:41 +00:00
Jacoandmergify[bot] ed2f512cfc Don't auto-attach lookup to registry (#4599)
* Don't auto-attach lookup to registry

* CHANGELOG

* Add base u* types

* s/compatTypes/specs/

* CHANGELOG

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-24 06:31:06 +00:00
github-actions[bot] 00147df500 [CI Skip] release/beta 7.9.2-7
skip-checks: true
2022-02-24 05:52:26 +00:00
Jacoandmergify[bot] 3b0c8887d7 Add chain.getBlockByNumber (#4598)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-24 05:42:58 +00:00
github-actions[bot] 16452233b2 [CI Skip] release/beta 7.9.2-6
skip-checks: true
2022-02-23 10:43:52 +00:00
Jaco 5bf87262bc Skip job on non-local repo 2022-02-23 12:33:41 +02:00
github-actions[bot] b8e01fd674 [CI Skip] release/beta 7.9.2-5
skip-checks: true
2022-02-23 10:09:24 +00:00
Jaco f8378ba0f7 Use jacogr/action-approve (#4595) 2022-02-23 12:00:15 +02:00
github-actions[bot] afc105400c [CI Skip] release/beta 7.9.2-4
skip-checks: true
2022-02-22 17:27:21 +00:00
Jaco cca1f10563 XcmV2TraitsOutcome test (#4593)
* XcmV2TraitsOutcome test

* Cleanup build with correct references
2022-02-22 17:19:28 +00:00
github-actions[bot] 6cdbbf5372 [CI Skip] release/beta 7.9.2-3
skip-checks: true
2022-02-22 10:06:24 +00:00
Jaco 8c89732eb7 Decoded storage hashers with primary lookup (#4591) 2022-02-22 09:58:36 +00:00
github-actions[bot] ab3ad6b2ca [CI Skip] release/beta 7.9.2-2
skip-checks: true
2022-02-22 09:01:10 +00:00
Jaco 72f427a250 Map initialU8aLength test (#4590) 2022-02-22 08:51:40 +00:00
github-actions[bot] 5b0bd9d4b7 [CI Skip] release/beta 7.9.2-1
skip-checks: true
2022-02-21 18:14:49 +00:00
Jacoandmergify[bot] cd9662ab4c Ensure BTreeSet has the correct decoded length (#4588)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-21 18:07:11 +00:00
github-actions[bot] 13751b6fdf [CI Skip] release/beta 7.9.2-0
skip-checks: true
2022-02-21 10:38:39 +00:00
Jaco 652f8c28a4 Bump dev (#4585) 2022-02-21 10:30:49 +00:00
github-actions[bot] 0bae9138b8 [CI Skip] release/stable 7.9.1
skip-checks: true
2022-02-20 15:23:37 +00:00
Jaco 98e8cac424 7.9.1 (#4580) 2022-02-20 17:15:17 +02:00
github-actions[bot] dca7f208bc [CI Skip] release/beta 7.8.2-9
skip-checks: true
2022-02-20 06:44:31 +00:00
Jacoandmergify[bot] 67ff12885a Align CHANGELOG (#4579)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-02-20 06:35:03 +00:00
github-actions[bot] 08c53032eb [CI Skip] release/beta 7.8.2-8
skip-checks: true
2022-02-20 06:00:20 +00:00
Scott TwinameandJaco 5da8f21947 Add support for historical BlockNumber rpc methods (#4574)
* Add support for historical BlockNumber rpc methods

* Update function description

* Apply suggestions from code review

Co-authored-by: Jaco <jacogr@gmail.com>
2022-02-20 07:50:41 +02:00
github-actions[bot] 5080b266a0 [CI Skip] release/beta 7.8.2-7
skip-checks: true
2022-02-19 06:51:06 +00:00
Jaco 0186848936 Convert ExactDerive to interface (#4578) 2022-02-19 06:41:12 +00:00
github-actions[bot] d0de35b05b [CI Skip] release/beta 7.8.2-6
skip-checks: true
2022-02-18 08:42:41 +00:00
Jaco 3ded30a0f3 Bump static metadata (#4575)
* Bump static metadata

* previous incarnation of trieIndex
2022-02-18 08:30:55 +00:00
github-actions[bot] 9fef78c5e1 [CI Skip] release/beta 7.8.2-5
skip-checks: true
2022-02-17 10:28:47 +00:00
Jaco b2a7c453c4 Align grandpa_proveFinality with Substrate (#4573) 2022-02-17 10:19:24 +00:00
github-actions[bot] 030258a671 [CI Skip] release/beta 7.8.2-4
skip-checks: true
2022-02-17 06:12:57 +00:00
Scott Twiname 0a85b4839d Fix getting block registry when historical type isn't BlockHash (#4571)
* Fix getting block registry when historical type isn't BlockHash

* Revert change, remove isHistoric from historical BlockNumber fields
2022-02-17 08:05:06 +02:00
github-actions[bot] ad363bac09 [CI Skip] release/beta 7.8.2-3
skip-checks: true
2022-02-16 08:32:56 +00:00
Jaco e0c0a8c583 Bump deps (#4568) 2022-02-16 08:23:40 +00:00
github-actions[bot] f923a31758 [CI Skip] release/beta 7.8.2-2
skip-checks: true
2022-02-15 18:32:20 +00:00
Jaco 416229d976 Bump deps (#4567) 2022-02-15 18:20:37 +00:00
github-actions[bot] 4380c45f17 [CI Skip] release/beta 7.8.2-1
skip-checks: true
2022-02-15 07:53:05 +00:00
Jaco d481aed8cb Add mergify (#4566) 2022-02-15 09:45:10 +02:00
github-actions[bot] ca25983e3e [CI Skip] release/beta 7.8.2-0
skip-checks: true
2022-02-14 15:08:31 +00:00
Jaco f7caa496e4 Kusama 9160 upgrade block (#4565) 2022-02-14 17:00:05 +02:00
github-actions[bot] 3f8e4ce133 [CI Skip] release/stable 7.8.1
skip-checks: true
2022-02-14 12:55:48 +00:00
Jaco 39c99083bc 7.8.1 (#4564) 2022-02-14 14:46:24 +02:00
github-actions[bot] 46aa427f98 [CI Skip] release/beta 7.7.2-17
skip-checks: true
2022-02-14 05:51:41 +00:00
Jaco 6336fc0787 Bump common (#4563) 2022-02-14 07:43:13 +02:00
github-actions[bot] b0532be7df [CI Skip] release/beta 7.7.2-16
skip-checks: true
2022-02-13 12:55:58 +00:00
Jaco e7a5b015e9 Don't run scripts on CI (#4562) 2022-02-13 14:47:33 +02:00
github-actions[bot] 2f07f18a5a [CI Skip] release/beta 7.7.2-15
skip-checks: true
2022-02-11 07:49:46 +00:00
Jaco c92d5b7eb0 Bump metadata (#4558) 2022-02-11 09:40:07 +02:00
github-actions[bot] e340a99eda [CI Skip] release/beta 7.7.2-14
skip-checks: true
2022-02-10 08:29:28 +00:00
Jaco f169ca08a8 Expose txIndex on extrinsic results (#4556)
* Expose txIndex on extrinsic results

* CHANGELOG

* optional txIndex

* Adjust result
2022-02-10 10:20:57 +02:00
github-actions[bot] 898d1593f3 [CI Skip] release/beta 7.7.2-13
skip-checks: true
2022-02-09 18:38:12 +00:00
Keith Ingram 2c8d9563c4 Update contract types and rpc (#4541)
* Update contract types and rpc

* Corrected InstantiateReturnValue

* enum, set fallbacks

* set definition

* underscore
2022-02-09 20:29:43 +02:00
github-actions[bot] 804c0c4887 [CI Skip] release/beta 7.7.2-12
skip-checks: true
2022-02-09 12:11:11 +00:00
Jaco 3b991ce8c7 Ensure camelCase names appear in inspect (#4554) 2022-02-09 14:01:47 +02:00
github-actions[bot] e66cc0fb45 [CI Skip] release/beta 7.7.2-11
skip-checks: true
2022-02-09 10:20:46 +00:00
Jaco 61daa0f2c8 Adjust inspect inner/outer (#4553) 2022-02-09 12:11:53 +02:00
github-actions[bot] 7af315f278 [CI Skip] release/beta 7.7.2-10
skip-checks: true
2022-02-09 08:29:19 +00:00
Jaco e55661ca34 Bump util (#4552) 2022-02-09 10:20:38 +02:00
github-actions[bot] 097a1748fd [CI Skip] release/beta 7.7.2-9
skip-checks: true
2022-02-09 06:19:32 +00:00
Jaco 9c587d378e Bump dev (#4551) 2022-02-09 08:09:28 +02:00
github-actions[bot] 02f99356aa [CI Skip] release/beta 7.7.2-8
skip-checks: true
2022-02-08 16:27:10 +00:00
Jaco cacacec130 Codec.inspect (#4538)
* Codec.inspect

* Additional

* Adjust

* LookupSource

* Some tests

* All base tests

* Tests for BTree{Map, Set}

* Additional tests

* All extended type tests

* Additional

* Native tests

* Adjust

* Struct with names
2022-02-08 18:18:31 +02:00
github-actions[bot] 6d095a042f [CI Skip] release/beta 7.7.2-7
skip-checks: true
2022-02-08 13:41:15 +00:00
Jaco b022ad3154 Bump dev (#4548) 2022-02-08 15:33:06 +02:00
github-actions[bot] e0129aa02e [CI Skip] release/beta 7.7.2-6
skip-checks: true
2022-02-08 12:28:09 +00:00
Jaco dfc200a25a Wrap storage inspect in hasher function (#4547) 2022-02-08 14:18:17 +02:00
github-actions[bot] 85fdbed227 [CI Skip] release/beta 7.7.2-5
skip-checks: true
2022-02-08 11:16:59 +00:00
Jaco 04a23c0f60 Extract the arg types (#4546) 2022-02-08 13:08:29 +02:00
github-actions[bot] 0bf9eb2f3a [CI Skip] release/beta 7.7.2-4
skip-checks: true
2022-02-08 10:43:13 +00:00
Jaco f13462f7cf Add inspect(...args) to storage (#4545) 2022-02-08 12:34:01 +02:00
github-actions[bot] 0754bc45d3 [CI Skip] release/beta 7.7.2-3
skip-checks: true
2022-02-08 07:52:43 +00:00
Jaco e314f51813 Re-enable BitVec tests (#4543)
* Re-enable BitVec tests

* CHANGELOG
2022-02-08 09:42:24 +02:00
github-actions[bot] 5148bc42ae [CI Skip] release/beta 7.7.2-2
skip-checks: true
2022-02-08 04:50:29 +00:00
Scott Twiname b43c848817 Fix isHistorical to isHistoric (#4540) 2022-02-08 06:42:32 +02:00
github-actions[bot] abd2b58b52 [CI Skip] release/beta 7.7.2-1
skip-checks: true
2022-02-07 21:14:51 +00:00
Scott Twiname 2ce1decd99 Add isHistorical field to relevant eth rpc requests (#4539)
Adds `isHistorical` to `BlockNumber` parameters for eth rpc requests that support querying at a point in time.
2022-02-07 23:04:59 +02:00
github-actions[bot] f8112735af [CI Skip] release/beta 7.7.2-0
skip-checks: true
2022-02-07 10:54:52 +00:00
Jaco 455a8d2a91 Adjust map header output type with lookup (#4536)
* Adjust map header output type with lookup

* Adjust typings
2022-02-07 12:44:17 +02:00
github-actions[bot] ca692cc7c0 [CI Skip] release/stable 7.7.1
skip-checks: true
2022-02-06 07:05:44 +00:00
Jaco f5f5b540af 7.7.1 (#4535) 2022-02-06 08:56:28 +02:00
github-actions[bot] 8b3b1b4611 [CI Skip] release/beta 7.6.2-9
skip-checks: true
2022-02-05 20:05:06 +00:00
Jaco 21cb76e517 Bump dev (#4534) 2022-02-05 21:54:35 +02:00
github-actions[bot] d774a3c2ab [CI Skip] release/beta 7.6.2-8
skip-checks: true
2022-02-04 14:54:50 +00:00
Jaco 0c08e8ba9e Re-decorate all runtime endpoints (#4532) 2022-02-04 16:46:44 +02:00
github-actions[bot] c2549ec166 [CI Skip] release/beta 7.6.2-7
skip-checks: true
2022-02-04 12:28:12 +00:00
Jaco d27fce3b29 Bump deps (#4531) 2022-02-04 14:19:14 +02:00
github-actions[bot] 849588e305 [CI Skip] release/beta 7.6.2-6
skip-checks: true
2022-02-03 14:50:08 +00:00
Jaco 4f3fedc27e beefy_getFinalizedHead (#4530) 2022-02-03 16:42:00 +02:00
github-actions[bot] 57a5892f99 [CI Skip] release/beta 7.6.2-5
skip-checks: true
2022-02-03 10:52:43 +00:00
Jaco f5499ca4ed Don't show Call/Event extract warning pre-v14 (#4528) 2022-02-03 12:44:05 +02:00
github-actions[bot] 37ae595f03 [CI Skip] release/beta 7.6.2-4
skip-checks: true
2022-02-03 10:39:21 +00:00
Jaco 868a4a2964 Bump metadata (#4527) 2022-02-03 12:30:18 +02:00
github-actions[bot] 3656480cff [CI Skip] release/beta 7.6.2-3
skip-checks: true
2022-02-03 09:24:49 +00:00
Jaco 37cf4b5e88 Explicit class cache clear (#4523)
* Explicit class cache clear

* Re-register defaults

* Track knownDefaults in getters

* get ordering
2022-02-03 11:14:43 +02:00
github-actions[bot] 75a4e7b5d7 [CI Skip] release/beta 7.6.2-2
skip-checks: true
2022-02-03 09:02:59 +00:00
Jaco 12d6cf8a5b Don't want on resolvable Lookup* types (#4524) 2022-02-03 10:54:22 +02:00
github-actions[bot] aa7e5ea601 [CI Skip] release/beta 7.6.2-1
skip-checks: true
2022-02-02 14:54:43 +00:00
Gérard Dethier 9f5232019e Fix LRUCache memory leak. (#4520) 2022-02-02 16:46:28 +02:00
github-actions[bot] 3063763a18 [CI Skip] release/beta 7.6.2-0
skip-checks: true
2022-02-02 09:38:40 +00:00
Jaco b76f9e7e21 Adjust runtime upgrade init (#4519) 2022-02-02 11:30:25 +02:00
github-actions[bot] 558636b6b0 [CI Skip] release/stable 7.6.1
skip-checks: true
2022-01-30 05:32:32 +00:00
Jaco 8b92772b2f 7.6.1 (#4515) 2022-01-30 07:21:26 +02:00
github-actions[bot] cf0881f704 [CI Skip] release/beta 7.5.2-11
skip-checks: true
2022-01-29 15:43:58 +00:00
Jaco 1adc17b598 Workaround for regenerator runtime + private callback (#4514)
* Workaround for regenerator runtime + private callback

* CHANGELOG
2022-01-29 17:34:35 +02:00
github-actions[bot] a55256a247 [CI Skip] release/beta 7.5.2-10
skip-checks: true
2022-01-29 11:02:51 +00:00
Jaco faaa4e9480 CHANGELOG update (#4512) 2022-01-29 12:52:53 +02:00
github-actions[bot] ba52ab450e [CI Skip] release/beta 7.5.2-9
skip-checks: true
2022-01-29 10:49:04 +00:00
r0t0r-r0t0r 0660d0cf15 Fix memory leak on raw rpc call (#4505)
* Fix memory leak on raw rpc call

While processing a raw rpc call an observable is removed from the wrong cache. It causes a memory leak.

* Fix memory leak on raw rpc subscription, fix types

Fixed similar memory leak on raw rpc subscription.
Also added proper type declaration for the return value of the _memomize function to address build error.
2022-01-29 12:41:02 +02:00
Jaco fa1a3315f8 Bump deps (#4511) 2022-01-29 12:30:48 +02:00
github-actions[bot] 5f281b07fe [CI Skip] release/beta 7.5.2-8
skip-checks: true
2022-01-27 07:27:58 +00:00
Jaco e5bc2601cc Add support for rpc.contracts.uploadCode (#4508) 2022-01-27 09:18:51 +02:00
github-actions[bot] 6132a34333 [CI Skip] release/beta 7.5.2-7
skip-checks: true
2022-01-26 16:14:58 +00:00
Jaco 697e6d8b8b Exhaustive TypeDefInfo handling in extractType (#4506) 2022-01-26 18:06:18 +02:00
github-actions[bot] 33c4d82293 [CI Skip] release/beta 7.5.2-6
skip-checks: true
2022-01-26 09:00:43 +00:00
Jaco c46e0e9d5b Adjust bounty derive, empty on no {treasury, bounties}.bounties (#4503) 2022-01-26 10:51:24 +02:00
github-actions[bot] 4b9f987203 [CI Skip] release/beta 7.5.2-5
skip-checks: true
2022-01-25 15:13:05 +00:00
Jaco a650ae195e Non-aliased CallEvent type extraction (#4502)
* Non-aliased CallEvent type extraction

* Update packages/types/src/metadata/PortableRegistry/PortableRegistry.ts
2022-01-25 17:01:57 +02:00
github-actions[bot] 0dca7bacc2 [CI Skip] release/beta 7.5.2-4
skip-checks: true
2022-01-25 11:00:20 +00:00
Jaco 87f79151b4 Bump static metadata (#4499) 2022-01-25 12:52:00 +02:00
github-actions[bot] 480ae203b4 [CI Skip] release/beta 7.5.2-3
skip-checks: true
2022-01-25 07:05:28 +00:00
Jaco c4427c0497 Emit decorated event on API (incl. upgrades) (#4497) 2022-01-25 08:57:08 +02:00
github-actions[bot] f130f55167 [CI Skip] release/beta 7.5.2-2
skip-checks: true
2022-01-25 06:20:10 +00:00
Jaco 2009483542 Adjust SlotRange to 36 entries (with older 10-count version) (#4495)
* Adjust SlotRange to 36 entries (with older 10-count version)

* Fix tuple

* Adjust
2022-01-25 08:09:53 +02:00
github-actions[bot] ca50309554 [CI Skip] release/beta 7.5.2-1
skip-checks: true
2022-01-24 06:57:53 +00:00
Jaco db5b0986c4 Align Range/RangeInclusive handling with other definitions (#4489)
* Align Range/RangeInclusive handling with other definitions

* Split RangeInclusive class

* Rnage -> Range TypeDef

* Correct Range wrappers

* CHANGELOG

* Remove extra Range CHANGELOG entry

* Update CHANGELOG.md
2022-01-24 08:46:35 +02:00
github-actions[bot] b94cf566c9 [CI Skip] release/beta 7.5.2-0
skip-checks: true
2022-01-24 06:23:53 +00:00
Jaco ff24cec841 Dedupe WrapperOpaque classes (#4479)
* Dedupe WrapperOpaque classes

* Keep WrapperOpaque in own file
2022-01-24 08:13:08 +02:00
github-actions[bot] e16d20e996 [CI Skip] release/stable 7.5.1
skip-checks: true
2022-01-23 07:31:32 +00:00
Jaco bfab0f8538 7.5.1 (#4492) 2022-01-23 09:23:22 +02:00
github-actions[bot] 4752a98456 [CI Skip] release/beta 7.4.2-17
skip-checks: true
2022-01-23 07:09:01 +00:00
Jaco e63a3ec6a9 Bump common to 8.3.3 (#4491) 2022-01-23 08:59:11 +02:00
github-actions[bot] 4dc30d7d98 [CI Skip] release/beta 7.4.2-16
skip-checks: true
2022-01-22 12:08:56 +00:00
Jaco 71f6825b00 Bump deps (#4490) 2022-01-22 13:59:34 +02:00
github-actions[bot] d56b0bfccc [CI Skip] release/beta 7.4.2-15
skip-checks: true
2022-01-21 14:07:06 +00:00
Jaco 39ff956076 Expose constructoir meta on Blueprint/Code (#4486) 2022-01-21 15:56:27 +02:00
github-actions[bot] faa22fc634 [CI Skip] release/beta 7.4.2-14
skip-checks: true
2022-01-21 11:51:41 +00:00
Jaco f5ce395371 Expose contract.{query, tx}.method.meta (#4485) 2022-01-21 13:40:21 +02:00
github-actions[bot] b986d4cb5d [CI Skip] release/beta 7.4.2-13
skip-checks: true
2022-01-20 07:39:34 +00:00
Jaco 9c39cd9255 Add .multi support on api.at(...).<section>.<method> (#4478) 2022-01-20 09:30:24 +02:00
github-actions[bot] 43e2c44ac1 [CI Skip] release/beta 7.4.2-12
skip-checks: true
2022-01-20 07:12:40 +00:00
Jaco 3507a74d60 Correct V0/V1 contract def, adjust namespace tests (#4477)
* Correct V0/V1 contract def, adjust namespace tests

* Some failures

* V0 -> V1 conversion with name as Text[]

* CHANGELOG
2022-01-20 09:01:17 +02:00
Oleksandr MykhailenkoandJaco 97797d64f1 Add more complex namespaced contracts & test cases for them (#4472)
* Add more complex namespaced contracts & test cases for them.

* Apply suggestions from code review

* Update packages/api-contract/src/Abi/toLatest.spec.ts

Co-authored-by: Jaco <jacogr@gmail.com>
2022-01-20 08:01:12 +02:00
github-actions[bot] 88d7207102 [CI Skip] release/beta 7.4.2-11
skip-checks: true
2022-01-19 13:16:28 +00:00
Jaco 1616b014b3 Contract meta v1 name to v2 label w/ :: (#4471) 2022-01-19 15:08:28 +02:00
github-actions[bot] c20538f6f7 [CI Skip] release/beta 7.4.2-10
skip-checks: true
2022-01-19 11:34:55 +00:00
Jaco e77c2dd78c Contracts metadata v3 test data (#4470)
* Contracts metadata v3 test data

* Reformat
2022-01-19 13:25:35 +02:00
github-actions[bot] 6e7ce901ab [CI Skip] release/beta 7.4.2-9
skip-checks: true
2022-01-19 06:01:42 +00:00
Jaco 3396ed6010 Fix storage metadata (#4467) 2022-01-19 07:52:06 +02:00
github-actions[bot] 09ec89ae62 [CI Skip] release/beta 7.4.2-8
skip-checks: true
2022-01-19 05:29:50 +00:00
Jaco a7d78ff6eb Polkadot 9151 upgrade block (#4466) 2022-01-19 07:20:07 +02:00
github-actions[bot] 868043a22b [CI Skip] release/beta 7.4.2-7
skip-checks: true
2022-01-18 14:03:44 +00:00
Jaco 0310582056 Bump static metadata (#4464) 2022-01-18 15:54:48 +02:00
github-actions[bot] 629b9b486e [CI Skip] release/beta 7.4.2-6
skip-checks: true
2022-01-18 11:03:24 +00:00
Jaco 500e2022c3 Augment Registry (w/o CodecRegistry & CreateRegistry) (#4463)
* Augment Registry (w/o CodecRegistry & CreateRegistry)

* Build fixes

* Final build fixes

* licence headers
2022-01-18 12:52:01 +02:00
github-actions[bot] f8c2701751 [CI Skip] release/beta 7.4.2-5
skip-checks: true
2022-01-18 08:59:45 +00:00
Jaco d70ef05b54 CHANGELOG with 7.0.1 FAQ entry (+ some typos) (#4462) 2022-01-18 10:51:24 +02:00
github-actions[bot] 4b1d4c7335 [CI Skip] release/beta 7.4.2-4
skip-checks: true
2022-01-18 06:10:18 +00:00
Jaco c79939e650 Kusama 9151 upgrade block (#4461)
* Kusama 9151 upgrade block

* Update CHANGELOG.md
2022-01-18 07:59:59 +02:00
github-actions[bot] 8f298ba2a0 [CI Skip] release/beta 7.4.2-3
skip-checks: true
2022-01-18 05:45:38 +00:00
Jaco da6311d584 Replace usage of exportType in typegen (#4460) 2022-01-18 07:36:30 +02:00
github-actions[bot] d589adf208 [CI Skip] release/beta 7.4.2-2
skip-checks: true
2022-01-18 05:35:44 +00:00
Jaco dfbfaf12eb Support for ink! metadata v3 (#4432)
* Support for ink! metadata v3

* Flatten check for V1-V3

* DRY-er is/as conversions

* Test for v2 conversion

* Remove stray console.log

* Generic converter

* Cleanups
2022-01-18 07:27:10 +02:00
github-actions[bot] 91989e1a2b [CI Skip] release/beta 7.4.2-1
skip-checks: true
2022-01-17 10:23:48 +00:00
Jaco 86c2a96ed4 Reformat root tsconfig.build.json (#4459) 2022-01-17 12:12:31 +02:00
github-actions[bot] 9f3dab39c0 [CI Skip] release/beta 7.4.2-0
skip-checks: true
2022-01-17 06:43:15 +00:00
Jaco a02687c9fb Bump deps (#4457) 2022-01-17 08:35:06 +02:00
github-actions[bot] 80399fefcd [CI Skip] release/stable 7.4.1
skip-checks: true
2022-01-15 19:08:46 +00:00
Jaco ff9a0b3d44 7.4.1 (#4454)
* 7.4.1

* CHANGELOG
2022-01-15 21:00:41 +02:00
github-actions[bot] 8df82af638 [CI Skip] release/beta 7.3.2-9
skip-checks: true
2022-01-14 15:38:40 +00:00
Jaco ddfcc5624c Add Kusama 9150 upgrade block (#4449) 2022-01-14 17:29:01 +02:00
github-actions[bot] 7b08fbb695 [CI Skip] release/beta 7.3.2-8
skip-checks: true
2022-01-14 10:29:41 +00:00
Jaco 07d85783d8 Manual format of tsconfig.build.json (#4447) 2022-01-14 12:18:57 +02:00
github-actions[bot] f0d6fc0167 [CI Skip] release/beta 7.3.2-7
skip-checks: true
2022-01-13 08:17:43 +00:00
Jaco 7b085307f8 Update .mailmap 2022-01-13 10:07:16 +02:00
github-actions[bot] e22a38dd9c [CI Skip] release/beta 7.3.2-6
skip-checks: true
2022-01-12 08:53:34 +00:00
Jaco 2ceb727ee6 Update to tsconfig.build.json inside packages (#4444)
* Update to tsconfig.build.json inside packages

* Update refs
2022-01-12 10:44:56 +02:00
github-actions[bot] bc4e656745 [CI Skip] release/beta 7.3.2-5
skip-checks: true
2022-01-12 05:41:50 +00:00
Jaco 6d2b3b8463 Bump dev (w/ contrib update) (#4442) 2022-01-12 07:33:39 +02:00
github-actions[bot] 5369b6cb10 [CI Skip] release/beta 7.3.2-4
skip-checks: true
2022-01-11 14:22:33 +00:00
Jaco 53fd71b732 Mini-extracted test for Range values (#4441) 2022-01-11 16:14:26 +02:00
github-actions[bot] 63e38b3d1c [CI Skip] release/beta 7.3.2-3
skip-checks: true
2022-01-11 07:00:04 +00:00
Jaco cd98ac65f3 Add tsconfig.build.json (#4440) 2022-01-11 08:51:54 +02:00
github-actions[bot] 7bd0819cbb [CI Skip] release/beta 7.3.2-2
skip-checks: true
2022-01-11 05:44:03 +00:00
Jaco e84c2a5180 Asserts for number formats (#4439)
* Asserts for number formats

* Test for Compact (used base format asserts)

* Lint fixes
2022-01-11 07:33:25 +02:00
github-actions[bot] aabf4b3e45 [CI Skip] release/beta 7.3.2-1
skip-checks: true
2022-01-10 16:27:00 +00:00
Jaco 0f67d3e54d Ensure Range/RangeInclusive variant check does not fail on encoding (#4437) 2022-01-10 18:19:23 +02:00
github-actions[bot] 8cbc36550b [CI Skip] release/beta 7.3.2-0
skip-checks: true
2022-01-10 08:30:42 +00:00
Jaco 25c46f2a0d Ensure non-option calls in api-contract are marked as @deprecated (#4433) 2022-01-10 10:21:06 +02:00
github-actions[bot] f7124f7d69 [CI Skip] release/stable 7.3.1
skip-checks: true
2022-01-09 16:09:32 +00:00
Jaco afe12e5293 7.3.1 (#4430) 2022-01-09 17:58:36 +02:00
github-actions[bot] 53c8952c66 [CI Skip] release/beta 7.2.2-11
skip-checks: true
2022-01-09 07:00:58 +00:00
Jaco 7478eb4fce Bump common (#4429) 2022-01-09 08:52:49 +02:00
github-actions[bot] bc7ee1a1da [CI Skip] release/beta 7.2.2-10
skip-checks: true
2022-01-08 07:54:12 +00:00
Jaco 1eb878a773 Treat WrapperKeepOpaque as wrapper (#4427)
* Treat WrapperKeepOpaque as wrapper

* Exapnsion on allowed Opaque types
2022-01-08 09:45:13 +02:00
github-actions[bot] ccef61070b [CI Skip] release/beta 7.2.2-9
skip-checks: true
2022-01-08 06:31:21 +00:00
Jaco 64300aa436 Metadata bump (#4425) 2022-01-08 08:23:09 +02:00
Jaco 5a3255bc59 Bump dev & common (#4426) 2022-01-08 08:22:44 +02:00
github-actions[bot] 800064a18c [CI Skip] release/beta 7.2.2-8
skip-checks: true
2022-01-07 12:59:31 +00:00
Jaco b1e8fcf16e Allow WrapperKeepOpaque as a wrapper (#4424) 2022-01-07 14:48:00 +02:00
github-actions[bot] a1843c8cf6 [CI Skip] release/beta 7.2.2-7
skip-checks: true
2022-01-07 10:45:47 +00:00
Jaco a9b0f97f74 Extend WrapperKeepOpaque with optional decoding (#4422)
* Extend WrapperKeepOpaque with optional decoding

* headers

* TypeDefInfo.WrapperKeepOpaque

* Rebuild

* CHANGELOG
2022-01-07 12:36:28 +02:00
github-actions[bot] 763e73138a [CI Skip] release/beta 7.2.2-6
skip-checks: true
2022-01-06 15:06:57 +00:00
Jaco e5103cd63f Bumps (common & dev, incl. CHANGELOG) (#4420)
* Bumps

* Bump dev & common

* Bumps
2022-01-06 16:58:29 +02:00
github-actions[bot] f606982bce [CI Skip] release/beta 7.2.2-5
skip-checks: true
2022-01-06 07:40:55 +00:00
Jaco 392d447b99 Adjust LRU historic size (clarify isCachable flag) (#4419) 2022-01-06 09:31:13 +02:00
github-actions[bot] 3a6c4a524a [CI Skip] release/beta 7.2.2-4
skip-checks: true
2022-01-05 09:07:25 +00:00
Jaco 014017104f Bump dev (w/ packageInfo adjustments) (#4417) 2022-01-05 10:57:42 +02:00
github-actions[bot] 026fb18933 [CI Skip] release/beta 7.2.2-3
skip-checks: true
2022-01-05 07:07:29 +00:00
Jaco 361b411dc5 Bump dev (#4416) 2022-01-05 08:59:06 +02:00
github-actions[bot] 011b0b4a88 [CI Skip] release/beta 7.2.2-2
skip-checks: true
2022-01-04 10:28:19 +00:00
Jaco 2798be0f1c fetch-depth 0 (#4413) 2022-01-04 12:18:44 +02:00
github-actions[bot] 03d7510ef6 [CI Skip] release/beta 7.2.2-1
skip-checks: true
2022-01-04 10:06:22 +00:00
Jaco e66704233c Bump dev (w/ CONTRIBUTORS & umd) (#4412) 2022-01-04 11:55:41 +02:00
github-actions[bot] 53eecf6220 [CI Skip] release/beta 7.2.2-0
skip-checks: true
2022-01-03 15:03:34 +00:00
Jaco 051fa6965a Bump dev (& header fix) (#4410) 2022-01-03 16:53:13 +02:00
github-actions[bot] c9edf77df3 [CI Skip] release/stable 7.2.1
skip-checks: true
2022-01-03 07:03:16 +00:00
Jaco c1c71a90e3 7.2.1 (#4409) 2022-01-03 08:53:53 +02:00
github-actions[bot] a21f321be9 [CI Skip] release/beta 7.1.2-8
skip-checks: true
2022-01-02 15:45:56 +00:00
Jaco 1d19c44a9b Correct @polkadot/rpc-augment (fromChain) (#4408) 2022-01-02 17:35:22 +02:00
github-actions[bot] 186e071f86 [CI Skip] release/beta 7.1.2-7
skip-checks: true
2022-01-01 16:43:56 +00:00
Jaco 6e52039e09 2022 (#4406) 2022-01-01 18:33:31 +02:00
github-actions[bot] 1b24fe963e [CI Skip] release/beta 7.1.2-6
skip-checks: true
2022-01-01 08:37:02 +00:00
Jaco dbf21d2654 Bump dev (#4405)
* Bump dev

* adjust
2022-01-01 10:26:39 +02:00
github-actions[bot] f8b54ddb45 [CI Skip] release/beta 7.1.2-5
skip-checks: true
2022-01-01 07:39:02 +00:00
Jaco 8ba4ed5377 2022 (#4404) 2022-01-01 09:28:18 +02:00
github-actions[bot] b1cb369209 [CI Skip] release/beta 7.1.2-4
skip-checks: true
2021-12-31 15:32:02 +00:00
Jaco 911b86d516 Introduce detectOther (#4403) 2021-12-31 17:24:14 +02:00
github-actions[bot] 29555e0d93 [CI Skip] release/beta 7.1.2-3
skip-checks: true
2021-12-31 09:51:11 +00:00
Jaco ecdbfd22d5 Mock __dirname (#4402) 2021-12-31 11:43:19 +02:00
github-actions[bot] 9c76bb2618 [CI Skip] release/beta 7.1.2-2
skip-checks: true
2021-12-31 08:05:00 +00:00
Jaco 5b1551983e Bump babel (#4401) 2021-12-31 09:57:01 +02:00
github-actions[bot] e22cc4206c [CI Skip] release/beta 7.1.2-1
skip-checks: true
2021-12-29 05:36:01 +00:00
Jaco 47a951be2a Bump deps (#4399) 2021-12-29 07:28:15 +02:00
github-actions[bot] fcc04e6e7e [CI Skip] release/beta 7.1.2-0
skip-checks: true
2021-12-27 11:06:16 +00:00
Jaco c6d330b91e Add set for contract ReturnFlags (#4397) 2021-12-27 12:56:54 +02:00
github-actions[bot] e16786a5f6 [CI Skip] release/stable 7.1.1
skip-checks: true
2021-12-26 08:41:55 +00:00
Jaco e388e473be 7.1.1 (#4396)
* 7.1.1

* Ensure all deps are fixed
2021-12-26 10:32:49 +02:00
github-actions[bot] 029c4d7f7f [CI Skip] release/beta 7.0.3-15
skip-checks: true
2021-12-26 08:12:45 +00:00
Jaco 5d6c2dd9f2 DRY cleanups for contracts (#4395) 2021-12-26 10:03:28 +02:00
github-actions[bot] ade5dc45d1 [CI Skip] release/beta 7.0.3-14
skip-checks: true
2021-12-25 10:22:06 +00:00
Jaco 8e578a643a Bump berry (#4394) 2021-12-25 12:14:04 +02:00
github-actions[bot] 8a67405fd7 [CI Skip] release/beta 7.0.3-13
skip-checks: true
2021-12-25 07:19:29 +00:00
Jaco 851bbe4cc6 Use assertReturn as applicable (#4393) 2021-12-25 09:09:13 +02:00
github-actions[bot] 0fec7506b7 [CI Skip] release/beta 7.0.3-12
skip-checks: true
2021-12-25 06:24:04 +00:00
Jaco 63b80b823e Metadata bump (#4392) 2021-12-25 08:16:30 +02:00
github-actions[bot] d3f9cdbec3 [CI Skip] release/beta 7.0.3-11
skip-checks: true
2021-12-24 14:49:31 +00:00
Jaco 6de4293f9f Remove @polkadot/ts dependency (#4391)
* Remove @polkadot/ts dependency

* Remove VoidCallback

* Bump dev
2021-12-24 16:42:12 +02:00
github-actions[bot] e1d2e2c7d5 [CI Skip] release/beta 7.0.3-10
skip-checks: true
2021-12-24 13:31:06 +00:00
Jaco 11f8cb6cfa Align types-augment with api-augment (#4390)
* Align types-augment with api-augment

* Adjust CHANGELOG

* Dependencies

* Definitions

* Adjust dependencies
2021-12-24 15:22:15 +02:00
github-actions[bot] 2f0fecf89b [CI Skip] release/beta 7.0.3-9
skip-checks: true
2021-12-24 12:08:09 +00:00
Jaco acfb193270 Provide polkadot/kusama augmentation (#4388)
* Provide polkadot/kusama augmentation

* Generate all

* Dev dump

* Build kusama/polkadot with no augmentation overlaps

* CHANGELOG
2021-12-24 14:01:05 +02:00
github-actions[bot] ccd4de824f [CI Skip] release/beta 7.0.3-8
skip-checks: true
2021-12-24 07:16:30 +00:00
Jaco 9800a3b55d Expose txHash on submittable results (#4387)
* Expose txHash on submittable results

* CHANGELOG

* CHANGELOG
2021-12-24 09:08:56 +02:00
github-actions[bot] 938eb7d390 [CI Skip] release/beta 7.0.3-7
skip-checks: true
2021-12-23 09:52:10 +00:00
Jaco d0b4542c94 Align query name generation (#4383) 2021-12-23 11:44:36 +02:00
github-actions[bot] bb2833ae51 [CI Skip] release/beta 7.0.3-6
skip-checks: true
2021-12-23 09:40:18 +00:00
Jaco cfff5b6be6 Dev w/ checks for tsconfig.spec.json (#4384)
* Dev w/ checks for tsconfig.spec.json

* bump
2021-12-23 11:30:19 +02:00
github-actions[bot] d29d1df84b [CI Skip] release/beta 7.0.3-5
skip-checks: true
2021-12-23 07:03:09 +00:00
Jaco 79cca97c03 Dev bump (w/ types key in export map) (#4382) 2021-12-23 08:55:32 +02:00
github-actions[bot] a807ab6b04 [CI Skip] release/beta 7.0.3-4
skip-checks: true
2021-12-22 14:37:03 +00:00
Jaco 517a4d1f09 Extended tsconfig lint cleanups (#4379) 2021-12-22 16:29:42 +02:00
github-actions[bot] e19eeb8a60 [CI Skip] release/beta 7.0.3-3
skip-checks: true
2021-12-22 09:45:51 +00:00
Jaco 1af5fb35bc Additional Option tests (#4378) 2021-12-22 11:35:45 +02:00
github-actions[bot] adbc1799a2 [CI Skip] release/beta 7.0.3-2
skip-checks: true
2021-12-22 07:20:59 +00:00
Jaco f51dbd7df9 Fix jest alias config (#4377)
* Fix jest alias config

* Dedupe
2021-12-22 09:12:02 +02:00
github-actions[bot] f11c8f9360 [CI Skip] release/beta 7.0.3-1
skip-checks: true
2021-12-21 17:11:21 +00:00
Jaco 46fdc22201 Split registry & lookup augmentation (#4376)
* Split registry & lookup augmentation

* Fix package path

* Adjust CC paths, fix detectPackage

* Adjust rollup config

* Adjust rollup in-process packages

* Re-adjust rollup (OCD...)
2021-12-21 19:02:38 +02:00
github-actions[bot] 2ba4233645 [CI Skip] release/beta 7.0.3-0
skip-checks: true
2021-12-21 11:18:15 +00:00
Keith Ingram a868233c2f Storage deposit limit changes (#4370) 2021-12-21 13:09:37 +02:00
github-actions[bot] a7752f3c18 [CI Skip] release/stable 7.0.2
skip-checks: true
2021-12-21 08:41:54 +00:00
Jaco 3a06775f9f 7.0.2 (#4375) 2021-12-21 10:34:28 +02:00
github-actions[bot] 936b5d9b72 [CI Skip] release/beta 7.0.2-3
skip-checks: true
2021-12-21 08:26:30 +00:00
Jaco 523f1622b5 Collective aliases (don't apply to derive naming) (#4374)
* Collective aliases (don't apply to derive naming)

* Fix build (aka new form apply to prime)
2021-12-21 10:17:41 +02:00
github-actions[bot] a2c027b7b7 [CI Skip] release/beta 7.0.2-2
skip-checks: true
2021-12-21 08:16:23 +00:00
Jaco d13f66eb5b Prep for preimage pallet usage (#4372)
* Prep for preimage pallet usage

* info uses derives

* adjust
2021-12-21 10:07:13 +02:00
github-actions[bot] 9f400ea15c [CI Skip] release/beta 7.0.2-1
skip-checks: true
2021-12-21 06:42:37 +00:00
Jaco c0e841031a Update Substrate metadata & scheduler usage (#4371) 2021-12-21 08:33:23 +02:00
github-actions[bot] 34f6b7b560 [CI Skip] release/beta 7.0.2-0
skip-checks: true
2021-12-20 16:05:36 +00:00
Jaco 55fe455713 Small import cleanups (#4368) 2021-12-20 17:58:16 +02:00
github-actions[bot] 2a004e32bc [CI Skip] release/stable 7.0.1
skip-checks: true
2021-12-20 09:54:35 +00:00
Jaco bde574ff3d 7.0.1 (#4366) 2021-12-20 11:46:59 +02:00
github-actions[bot] 9c41b52175 [CI Skip] release/beta 6.12.2-27
skip-checks: true
2021-12-20 08:55:36 +00:00
Jaco c78d1dd149 Add *-augment packages by default (#4364) 2021-12-20 10:48:42 +02:00
github-actions[bot] 714760963a [CI Skip] release/beta 6.12.2-26
skip-checks: true
2021-12-20 08:29:09 +00:00
Joey 094382373c don't throw error at onSocketClose (#4363) 2021-12-20 10:19:44 +02:00
github-actions[bot] 2790d1d744 [CI Skip] release/beta 6.12.2-25
skip-checks: true
2021-12-20 08:08:02 +00:00
Jaco 67ee8b08d9 Ensure *.d.ts files are generated in outputs (#4362)
* Ensure *.d.ts files are generated in outputs

* Adjust

* Additional dep

* Update

* Update refs
2021-12-20 10:00:10 +02:00
github-actions[bot] aa704210f8 [CI Skip] release/beta 6.12.2-24
skip-checks: true
2021-12-20 06:32:40 +00:00
Jaco 4ea8e72927 Bump all static metadata (#4357)
* Bump all static metadata

* Revert Substrate until new schedulers is in-place
2021-12-20 08:25:44 +02:00
github-actions[bot] 817bb3f2aa [CI Skip] release/beta 6.12.2-23
skip-checks: true
2021-12-20 06:22:46 +00:00
Jaco 1550eb18a6 tsconfig path linting (#4358)
* tsconfig path linting

* yarn.lock

* Update @polkadot/dev
2021-12-20 08:14:44 +02:00
github-actions[bot] 5d01220a0e [CI Skip] release/beta 6.12.2-22
skip-checks: true
2021-12-19 20:16:16 +00:00
Jaco e81e24fa5f Adjust packages with known dependencies (#4356) 2021-12-19 22:09:32 +02:00
github-actions[bot] bb75aa8f74 [CI Skip] release/beta 6.12.2-21
skip-checks: true
2021-12-19 19:39:37 +00:00
Jaco 3d4511607f API optional augmentation (#4355)
* API optional augmentation

* Rebuild

* Rebuild

* Cleanups

* Adjust, no multi-imports

* Adjust

* Adjust

* Dedupe

* Augmented exports

* It builds via references (no circulars)

* Don't output *.manual.{js,cjs}
2021-12-19 21:30:34 +02:00
github-actions[bot] fe27d8059e [CI Skip] release/beta 6.12.2-20
skip-checks: true
2021-12-19 10:28:04 +00:00
Jaco ba24a7080c Adjust augmentation (#4354) 2021-12-19 12:19:15 +02:00
github-actions[bot] 9fd061be48 [CI Skip] release/beta 6.12.2-19
skip-checks: true
2021-12-19 09:43:23 +00:00
Jaco 1c78464e23 Split *.spec.ts into own reference (#4353) 2021-12-19 11:33:39 +02:00
github-actions[bot] 8f1eec6522 [CI Skip] release/beta 6.12.2-18
skip-checks: true
2021-12-19 08:48:36 +00:00
Jaco c60e77fef1 Bump common (#4352) 2021-12-19 10:38:37 +02:00
github-actions[bot] 1a4d915652 [CI Skip] release/beta 6.12.2-17
skip-checks: true
2021-12-18 16:14:13 +00:00
Jaco aca7acbdbe Adjust augment imports (#4351) 2021-12-18 18:04:16 +02:00
github-actions[bot] 8fe3e49ecd [CI Skip] release/beta 6.12.2-16
skip-checks: true
2021-12-18 15:39:18 +00:00
Jaco fcee83d803 Split into types-augment (#4350)
* Aplit into types-augment

* Adjust

* Adjust, fix typegen run

* Adjust

* Rebuild

* Adjust

* Adjust

* CC
2021-12-18 17:31:18 +02:00
github-actions[bot] 2b2bad6725 [CI Skip] release/beta 6.12.2-15
skip-checks: true
2021-12-18 14:00:58 +00:00
Jaco f8ebd5fdfa Adjust generated import locations (#4331)
* Adjust generated import locations

* Update packages/types/src/augment/registry.ts
2021-12-18 15:53:14 +02:00
github-actions[bot] 8c5a164635 [CI Skip] release/beta 6.12.2-14
skip-checks: true
2021-12-18 11:23:09 +00:00
Jaco 6d1b9cbfb2 Split rpc augmentation (#4349)
* Split rpc augmentation

* CC

* Split augmentation trigger

* Exports
2021-12-18 13:15:15 +02:00
github-actions[bot] 6518166252 [CI Skip] release/beta 6.12.2-13
skip-checks: true
2021-12-18 07:26:45 +00:00
Jaco 4913cf65fd Move api-derive to correct location (#4343)
* Move api-derive to correct location

* Adjust (linting ok)

* No composite

* ApiDerive split

* Adjust

* Still WIP, getting closer

* It lints

* derive build issues sorted

* It builds :)

* Add system_health to mock

* api-augment usage

* Cleanups

* Adjust paths

* linting

* Some <'s

* Revert <>'s

* linting

* ordering

* Augmentation tweaks

* yarn.lock

* export
2021-12-18 09:18:55 +02:00
github-actions[bot] 7b8a6e89d9 [CI Skip] release/beta 6.12.2-12
skip-checks: true
2021-12-17 10:36:32 +00:00
Jaco 664e9e8f26 References for api augmentation (#4346)
* References for api augmentation

* Adjust

* Progress... let's see where it leads

* It compiles...

* Adjust

* CC ignore
2021-12-17 12:26:26 +02:00
github-actions[bot] 5062ee602f [CI Skip] release/beta 6.12.2-11
skip-checks: true
2021-12-17 07:53:47 +00:00
Jaco f11feb4363 Move test files to correct packages (#4345)
* Move test files to correct packages

* Adjust
2021-12-17 09:45:46 +02:00
github-actions[bot] 4e433446e2 [CI Skip] release/beta 6.12.2-10
skip-checks: true
2021-12-17 06:13:21 +00:00
Jaco c89e551fe6 Bump dev (#4344) 2021-12-17 08:05:35 +02:00
github-actions[bot] a9282ced12 [CI Skip] release/beta 6.12.2-9
skip-checks: true
2021-12-17 04:46:38 +00:00
Jaco 85e13cc2b1 Split @polkadot/types-known (#4342)
* Re-split types-known correctly

* yarn install

* circular :(

* combine?

* It builds... ship it ...
2021-12-17 06:38:54 +02:00
github-actions[bot] 43203195b4 [CI Skip] release/beta 6.12.2-8
skip-checks: true
2021-12-16 13:31:40 +00:00
Jaco 1e472eebc9 Expose registry: Registry on Call/Extrinstic/Metadata (#4339)
* Expose registry: Registry on Call/Extrinstic/Metadata

* Adjust

* fix Call

* Adjust

* Fix it?
2021-12-16 15:22:51 +02:00
github-actions[bot] 30db589eee [CI Skip] release/beta 6.12.2-7
skip-checks: true
2021-12-16 13:18:29 +00:00
Jaco 51b61158b7 Contract export adjustments (#4340) 2021-12-16 15:10:38 +02:00
github-actions[bot] 7b7034cad3 [CI Skip] release/beta 6.12.2-6
skip-checks: true
2021-12-16 10:29:17 +00:00
Jaco d3a05c0da0 Cleanup contract exports (#4337) 2021-12-16 12:20:27 +02:00
Jaco a33e10f0b9 Adjust type imports from types-codec (#4335) 2021-12-16 12:20:06 +02:00
github-actions[bot] 27f564841d [CI Skip] release/beta 6.12.2-5
skip-checks: true
2021-12-16 05:59:32 +00:00
Jaco 5c8bad5bb9 getTyped to cleanup this.get('...') (#4334)
* getTyped to cleanup this.get('...')

* shorten

* Adjust
2021-12-16 07:51:52 +02:00
github-actions[bot] 1113f6cfdd [CI Skip] release/beta 6.12.2-4
skip-checks: true
2021-12-15 16:05:41 +00:00
Jaco 1753ee5395 Don't abuse _raw in Base (#4332)
* Don't abuse _raw in Base

* Adjust WrapperOpaque

* Adjust LookupSource
2021-12-15 17:56:16 +02:00
github-actions[bot] 6c27c94b4a [CI Skip] release/beta 6.12.2-3
skip-checks: true
2021-12-15 14:14:11 +00:00
Jaco f02d3af3d2 Split @polkadot/types-create (#4330)
* Split @polkadot/types-create

* Remove floating Type class

* Adjust

* Adjust detectPackage

* Fix types-known exports
2021-12-15 16:05:13 +02:00
github-actions[bot] 890dd391dc [CI Skip] release/beta 6.12.2-2
skip-checks: true
2021-12-15 12:11:51 +00:00
Jaco 7982c416e7 Split codec into @polkadot/types-codec (#4329)
* Split codec into @polkadot/types-codec

* Additional (test cleanups next)

* Fix tests

* Imports from '@polkadot/types-codec

* All remaining codec imports (only exports left)

* Bytes -> types-codec

* Cleanups

* Bool, BitVec, Text movements

* sanitize move

* Adjust (first build fixes)

* Adjust

* Additional

* Adjust

* Adjustments

* linting

* Adjust, not working atm

* Move {U,I}{8,16,32...} to types-codec

* createTypeUnsafe

* Fix type-only exports

* Folder exports

* Split Lookup/Create on registry interfaces

* Clanup LookupRegistry & CreateRegistry

* Combine CreateRegistry into LookupRegistry
2021-12-15 14:04:15 +02:00
github-actions[bot] e4eee7edcd [CI Skip] release/beta 6.12.2-1
skip-checks: true
2021-12-14 12:28:33 +00:00
Andreea Eftene cffab6900d Add storage deposit support (#4304)
* add storage deposit support

* Revert "add storage deposit support"

This reverts commit 10eea6332b2756b23766df316a90ba4f244cb424.

* generate new metadata

* make it build

* add storage deposit in RPCs

* rename endowment to value

* support older nodes

* check the right things

* hide storage_deposit until better supported

* add the right defaults

* hardcode storageDepositLimit to null
2021-12-14 14:20:04 +02:00
github-actions[bot] 8487558450 [CI Skip] release/beta 6.12.2-0
skip-checks: true
2021-12-14 10:12:40 +00:00
Jaco 736fd536f9 Use tsconfig references (#4328)
* Use tsconfig references

* Move types-known (temp until lower-level split)

* Sources

* Adjust

* tesconfig.eslint.json

* Bumps

* AdjustAdjust

* Linting passing... a start...

* Adjust

* Merge derive

* Merge

* api-contract-support

* It builds?

* compare locations
2021-12-14 12:04:50 +02:00
github-actions[bot] cbb5a021a0 [CI Skip] release/stable 6.12.1
skip-checks: true
2021-12-13 08:29:38 +00:00
Jaco da7f32d96f 6.12.1 (#4326) 2021-12-13 10:20:32 +02:00
github-actions[bot] 591784cd65 [CI Skip] release/beta 6.11.2-24
skip-checks: true
2021-12-13 06:21:35 +00:00
Jaco ddd2f2dfe5 Add tsconfig.base (#4325) 2021-12-13 08:13:54 +02:00
github-actions[bot] 56f297d3b9 [CI Skip] release/beta 6.11.2-23
skip-checks: true
2021-12-12 09:51:00 +00:00
Jaco fa7669f0af Bump tsc (#4323)
* Bump tsc

* Checktypes update
2021-12-12 11:44:20 +02:00
github-actions[bot] 2aa8525fe7 [CI Skip] release/beta 6.11.2-22
skip-checks: true
2021-12-12 07:40:06 +00:00
Jaco 9254c5781f Dedupe progress extraction (#4322)
* Dedupe progress extraction

* Adjust
2021-12-12 09:32:20 +02:00
github-actions[bot] e13f3bea65 [CI Skip] release/beta 6.11.2-21
skip-checks: true
2021-12-12 06:55:31 +00:00
Jaco 59c2327768 Add firstMemo (dedupes) (#4321)
* Add firstMemo (dedupes)

* Adjust

* flatten

* Readability

* Readability
2021-12-12 08:47:58 +02:00
github-actions[bot] 4b0c6aa515 [CI Skip] release/beta 6.11.2-20
skip-checks: true
2021-12-11 09:00:51 +00:00
Jaco 6276e45155 More cleanups to collective derives (#4320) 2021-12-11 10:50:33 +02:00
github-actions[bot] c7cb1d84ab [CI Skip] release/beta 6.11.2-19
skip-checks: true
2021-12-11 08:19:31 +00:00
Jaco 1a6025e012 Collective dedupe (#4319) 2021-12-11 10:08:41 +02:00
github-actions[bot] 83655c92c4 [CI Skip] release/beta 6.11.2-18
skip-checks: true
2021-12-11 07:45:04 +00:00
Jaco 63a55d2f8a Cleanups for bestNumber derives (#4318)
* Cleanups for bestNumber derives

* Unused imports

* Re-exports of types for *.d.ts outputs
2021-12-11 09:35:52 +02:00
github-actions[bot] c32953b2ea [CI Skip] release/beta 6.11.2-17
skip-checks: true
2021-12-10 15:39:53 +00:00
Jaco e51cd1a2f7 CheckNonZeroSender (#4316) 2021-12-10 17:31:53 +02:00
github-actions[bot] e58694566e [CI Skip] release/beta 6.11.2-16
skip-checks: true
2021-12-09 19:27:10 +00:00
Jaco 248561ca14 Cleanups with DRY-er code (#4312)
* Cleanups with DRY-er code

* dedupe

* lint fixes
2021-12-09 21:17:29 +02:00
github-actions[bot] d4a9b43e88 [CI Skip] release/beta 6.11.2-15
skip-checks: true
2021-12-09 16:34:11 +00:00
Jaco f717663f50 Update metadata generation docs (#4311)
* Update metadata generation docs

* Add cross-link
2021-12-09 18:26:20 +02:00
github-actions[bot] 49ebae9a55 [CI Skip] release/beta 6.11.2-14
skip-checks: true
2021-12-09 12:40:32 +00:00
Jaco 7a1419e73a Split relative & package imports in TS templates (#4310)
* Split relative & package imports in TS templates

* Cleanup unneeded spread

* Regen with importsAll
2021-12-09 14:32:01 +02:00
github-actions[bot] d15d05918c [CI Skip] release/beta 6.11.2-13
skip-checks: true
2021-12-09 11:04:56 +00:00
Jaco 969151c4a7 Additional derive cleanups (#4308)
* Additional derive cleanups

* unwrapNumber

* Adjust
2021-12-09 12:54:51 +02:00
github-actions[bot] 23717bb180 [CI Skip] release/beta 6.11.2-12
skip-checks: true
2021-12-09 10:19:29 +00:00
Jaco e32ac213b9 Additional derive cleanups (#4307)
* Additional derive cleanups

* Adjust

* Multi cache set

* Adjust mapping
2021-12-09 12:12:05 +02:00
github-actions[bot] 584cbb994b [CI Skip] release/beta 6.11.2-11
skip-checks: true
2021-12-08 18:26:13 +00:00
Jaco dcb7760a0e Remove capabilities (#4303) 2021-12-08 20:18:38 +02:00
github-actions[bot] fd6ba08f58 [CI Skip] release/beta 6.11.2-10
skip-checks: true
2021-12-08 17:25:20 +00:00
Jaco a30329b47d Support for contracts metadata V2 (#4289)
* Support for contracts metadata V2

* Add & use latest

* Build interfaces

* conversion of V1 -> Latest

* spreads

* Use V2 in creation, aka s/name/label/

* Extract -> latest conversion

* Flatten

* Add V2 test contracts (tests are failing)

* V2, V1 & V1 catered for in Abi.spec.ts

* Explicit v0/v1 -> Latest conversions

* Adjust V2/V1/V0 check order

* Cleanup type assertions

* Save

* Remove eslint unsafe

* Flatten test exports

* Entries... last non-critical, OCD-driven change...

* tsc check fixes

* Conversion tests

* v1ToLatest renames

* Text[]

* Split conversion (ease of future change)

* V2 in V2 conversion

* Dedupe?

* Additional cleanups

* Adjust

* Flatten types

* Adjust

* filter versions adjustments

* additional, get it done.
2021-12-08 19:14:51 +02:00
github-actions[bot] 610f03d006 [CI Skip] release/beta 6.11.2-9
skip-checks: true
2021-12-08 16:59:07 +00:00
Jaco 1cc9756d0e Dedupe collectives (#4302)
* Dedupe collectives

* Members

* Type imports (unused)

* Work-around for TS type imports

* tsconfig

* Adjust with only local imports
2021-12-08 18:50:18 +02:00
github-actions[bot] bf753cb858 [CI Skip] release/beta 6.11.2-8
skip-checks: true
2021-12-08 15:25:27 +00:00
Jaco 9a2cd1c446 Dedupe staking derive caches (#4301)
* Dedupe staking derive caches

* Dedupe

* Adjust

* Adjust

* typing

* lintin

* Adjust
2021-12-08 17:17:38 +02:00
github-actions[bot] 4a7bfe96e1 [CI Skip] release/beta 6.11.2-7
skip-checks: true
2021-12-08 12:23:29 +00:00
Jaco 7c51354186 Additional derive cleanups (#4299)
* Additional derive cleanups

* map var

* Apply suggestions from code review

* Additional

* Metadata cleanups

* Adjust

* Apply HexString to all Metadata init

* typegen HexString

* generator HexString

* basepath
2021-12-08 14:15:26 +02:00
github-actions[bot] 8a7707eb41 [CI Skip] release/beta 6.11.2-6
skip-checks: true
2021-12-08 11:22:53 +00:00
Jaco 88eac8e654 CC check adjustments (#4300) 2021-12-08 13:15:10 +02:00
github-actions[bot] c637d699bc [CI Skip] release/beta 6.11.2-5
skip-checks: true
2021-12-08 10:20:44 +00:00
Jaco d2450a9382 Cleanup storage createFunction (#4298)
* Cleanup storage createFunction

* Fix build
2021-12-08 12:12:01 +02:00
github-actions[bot] 4dd6b82471 [CI Skip] release/beta 6.11.2-4
skip-checks: true
2021-12-08 09:37:16 +00:00
Jaco 93ce2210da Adjust private members to JS privates (#4297) 2021-12-08 11:28:19 +02:00
github-actions[bot] 2463b52381 [CI Skip] release/beta 6.11.2-3
skip-checks: true
2021-12-08 09:26:53 +00:00
Jaco bc1cdc17e0 Cleanup author extraction (#4296) 2021-12-08 11:16:50 +02:00
github-actions[bot] 47ddfd75f7 [CI Skip] release/beta 6.11.2-2
skip-checks: true
2021-12-08 08:46:02 +00:00
Jaco 9643a2e026 Expose type on generated interfaces (#4295) 2021-12-08 10:36:12 +02:00
github-actions[bot] 5ceaa53c59 [CI Skip] release/beta 6.11.2-1
skip-checks: true
2021-12-08 08:21:38 +00:00
Jaco edc09b56b4 Small utility dedups (#4294) 2021-12-08 10:13:04 +02:00
github-actions[bot] 9b940738d4 [CI Skip] release/beta 6.11.2-0
skip-checks: true
2021-12-07 14:21:11 +00:00
Jaco b86610381a Kusama 9130 upgrade block (#4291) 2021-12-07 16:11:38 +02:00
github-actions[bot] dfe4bb32f0 [CI Skip] release/stable 6.11.1
skip-checks: true
2021-12-05 18:52:48 +00:00
Jaco b81c73b6ec 6.11.1 (#4288) 2021-12-05 20:45:20 +02:00
github-actions[bot] 9bb2549d0b [CI Skip] release/beta 6.10.4-4
skip-checks: true
2021-12-05 12:09:16 +00:00
Jaco ab90f8bd41 Bump metadata (#4286)
* Bump metadata

* Kusama & Polkadot

* Build interfaces

* Build json
2021-12-05 13:59:55 +02:00
github-actions[bot] 221712753f [CI Skip] release/beta 6.10.4-3
skip-checks: true
2021-12-05 11:49:23 +00:00
Jaco ed28a990af Bump common (#4285)
* Bump common

* 8.1.2
2021-12-05 13:40:10 +02:00
github-actions[bot] 055f32d1d9 [CI Skip] release/beta 6.10.4-2
skip-checks: true
2021-12-01 08:57:36 +00:00
Jaco a175ce87d7 Adjust cron (#4278) 2021-12-01 10:49:08 +02:00
github-actions[bot] f0f1714b12 [CI Skip] release/beta 6.10.4-1
skip-checks: true
2021-12-01 08:06:03 +00:00
Jaco 3778bd893b Add extra param to state_traceBlock (#4276)
* Add extra param to state_traceBlock

* CHANGELOG
2021-12-01 09:57:56 +02:00
github-actions[bot] d4436e19fa [CI Skip] release/beta 6.10.4-0
skip-checks: true
2021-12-01 07:48:35 +00:00
Jaco 4cf93fd4c0 Bump common (#4277) 2021-12-01 09:41:33 +02:00
github-actions[bot] 6d94896764 [CI Skip] release/stable 6.10.3
skip-checks: true
2021-11-30 14:14:46 +00:00
Jaco bacb757d7d Fix ss58Prefix extraction (#4274)
* Fix ss58Prefix extraction

* allow fallback

* adjust
2021-11-30 16:07:50 +02:00
github-actions[bot] 7be3cc949f [CI Skip] release/stable 6.10.2
skip-checks: true
2021-11-30 05:32:43 +00:00
Jaco 41cc8b34aa Bump util (#4272)
* Bump util

* util 8.0.4

* 8.0.4
2021-11-30 07:25:50 +02:00
github-actions[bot] 4bbba5bb35 [CI Skip] release/beta 6.10.2-0
skip-checks: true
2021-11-29 15:48:19 +00:00
Jaco feae323f5c Adjust augmentation interface consistency (#4269)
* Adjust augmetation interface consistency

* spelling

* Remove useless eslint slience

* slience escapes

* rebuild

* Fix indent

* comment fix (again)

* Adjust

* Additional adjustments
2021-11-29 17:41:23 +02:00
github-actions[bot] b363833a9f [CI Skip] release/stable 6.10.1
skip-checks: true
2021-11-29 06:45:19 +00:00
Jaco f083ea3861 6.10.1 (#4267) 2021-11-29 08:38:21 +02:00
github-actions[bot] f62e7f8bf9 [CI Skip] release/beta 6.9.3-6
skip-checks: true
2021-11-29 05:55:26 +00:00
Jaco fedb0a3f09 Re-order augmentation imports (#4266) 2021-11-29 07:46:34 +02:00
github-actions[bot] 38928448bf [CI Skip] release/beta 6.9.3-5
skip-checks: true
2021-11-26 12:54:56 +00:00
Jaco cfbde5f6bd Fix RPC non-available section init (#4263) 2021-11-26 14:47:54 +02:00
github-actions[bot] 4b0e0bc6d3 [CI Skip] release/beta 6.9.3-4
skip-checks: true
2021-11-26 10:51:45 +00:00
Jaco 9acb79f500 Bump common (#4262)
* Bump common

* Adjust
2021-11-26 12:45:02 +02:00
Github Actions 5dc0b38881 [CI Skip] release/beta 6.9.3-3
skip-checks: true
2021-11-24 14:59:43 +00:00
Jaco fab6f7e883 Adjust stale schedule (#4257) 2021-11-24 16:52:40 +02:00
Github Actions 66e635e909 [CI Skip] release/beta 6.9.3-2
skip-checks: true
2021-11-23 08:08:38 +00:00
Jaco 6e496d5a3c Add missing types -> types-known dep (#4252)
* Add missing types -> types-known dep

* Run install :)
2021-11-23 09:59:53 +02:00
Github Actions ca172c9a53 [CI Skip] release/beta 6.9.3-1
skip-checks: true
2021-11-22 09:49:34 +00:00
Jaco e9b83a9ff6 Bump static metadata (#4248)
* Bump static metadata

* metadata static json

* Adjust tests (new signed extensions)
2021-11-22 11:42:27 +02:00
Github Actions cf18d97b3a [CI Skip] release/beta 6.9.3-0
skip-checks: true
2021-11-22 06:41:45 +00:00
Jaco 0b1c715408 Bump dev (#4247) 2021-11-22 08:32:50 +02:00
1079 changed files with 107213 additions and 37675 deletions
+14 -2
View File
@@ -1,4 +1,4 @@
39
40
1.4.2
1.6.2
@@ -43,4 +43,16 @@
6.4.2
6.5.2
6.7.2
6.9.2
6.9.2
6.10.2
6.10.3
7.0.2
7.14.2
7.14.3
8.0.2
8.3.2
8.4.2
8.6.2
8.8.2
+16 -1
View File
@@ -1,3 +1,17 @@
checks:
argument-count:
config:
threshold: 5
method-complexity:
config:
threshold: 7
method-count:
config:
threshold: 25
method-lines:
config:
threshold: 30
exclude_patterns:
- "**/*.spec.js"
- "**/*.spec.ts"
@@ -5,7 +19,8 @@ exclude_patterns:
- "**/*.test.ts"
- "docs/**/*.js"
- "docs/**/*.ts"
- "packages/api/src/augment/"
- "packages/*-augment/"
- "packages/*-augment-*/"
- "packages/typegen/scripts"
- "packages/typegen/src"
- "packages/types/src/interfaces/"
+3 -9
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
const base = require('@polkadot/dev/config/eslint.cjs');
@@ -6,18 +6,12 @@ const base = require('@polkadot/dev/config/eslint.cjs');
module.exports = {
...base,
ignorePatterns: [
'.eslintrc.js',
'.github/**',
'.vscode/**',
'.yarn/**',
'**/build/*',
'**/coverage/*',
'**/node_modules/*'
...base.ignorePatterns
],
parserOptions: {
...base.parserOptions,
project: [
'./tsconfig.json'
'./tsconfig.eslint.json'
]
},
rules: {
+50
View File
@@ -0,0 +1,50 @@
<!--
For general support, howto, coding and bundling questions, please use the Substrate & Polkadot StackExchange at https://substrate.stackexchange.com/ and get other ecosystem developers involved. This issues in this repository are meant for the tracking of feature requests and bug reports.
While all issues are looked at non-bug and non-features would take quite a bit longer to get to and may yield less than satisfactory responses in this format.
Additionally, please ensure you have done a search on the existing and closed issues before logging a new request. This saves time on all sides.
-->
* **I'm submitting a ...**
<!--- Try and classify your actual report -->
- [ ] Bug report
- [ ] Feature request
- [ ] Support request (please bear the comments above in mind)
- [ ] Other
* **What is the current behavior and expected behavior?**
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
* **What is the motivation for changing the behavior?**
<!--- Not obligatory, but suggest a motivation for the request -->
<!--- or ideas how to implement the addition or change -->
* **Please tell us about your environment:**
<!--- Include as many relevant details about the environment you experienced the issue in -->
<!--- Also snsure that you have tested against the latest stable releases if a bug -->
- Version:
- Environment:
- [ ] Node.js
- [ ] Browser
- [ ] Other (limited support for other environments available)
- Language:
- [ ] JavaScript
- [ ] TypeScript
- [ ] Other
+16
View File
@@ -0,0 +1,16 @@
name: bot
on:
pull_request:
types: [labeled]
jobs:
approve:
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
runs-on: ubuntu-latest
steps:
- uses: jacogr/action-approve@master
with:
authors: jacogr
labels: -auto
token: ${{ secrets.GH_PAT_BOT }}
+16
View File
@@ -0,0 +1,16 @@
name: bot
on:
pull_request:
types: [labeled]
jobs:
merge:
runs-on: ubuntu-latest
steps:
- uses: jacogr/action-merge@master
with:
checks: build,lint,test
labels: -auto
strategy: squash
token: ${{ secrets.GH_PAT_BOT }}
+3 -1
View File
@@ -2,11 +2,13 @@ name: 'Lock Threads'
on:
schedule:
- cron: '30 1/2 * * *'
- cron: '10 1/3 * * *'
jobs:
lock:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: dessant/lock-threads@v2
with:
+2
View File
@@ -8,6 +8,8 @@ jobs:
step: ['lint', 'test', 'build']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.step }}
+7 -5
View File
@@ -12,16 +12,18 @@ jobs:
step: ['build:release']
name: ${{ matrix.step }}
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: ${{ matrix.step }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GH_PAT: ${{ secrets.GH_PAT }}
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn install --immutable | grep -v 'YN0013'
yarn ${{ matrix.step }}
+2
View File
@@ -9,6 +9,8 @@ jobs:
check:
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/checkout@v2
- uses: returntocorp/semgrep-action@v1
+3 -1
View File
@@ -1,11 +1,13 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 2/2 * * *'
- cron: '55 1/3 * * *'
jobs:
stale:
runs-on: ubuntu-latest
env:
YARN_ENABLE_SCRIPTS: false
steps:
- uses: actions/stale@v3
with:
+5 -1
View File
@@ -1,11 +1,14 @@
_book/
build/
build-cjs/
build-esm/
build-docs/
coverage/
docs/.vuepress/dist/
docs/substrate/*.md
node_modules/
tmp/
NOTES.md
.DS_Store
.env.local
.env.development.local
@@ -21,6 +24,7 @@ tmp/
cc-test-reporter
lerna-debug.log*
npm-debug.log*
package-lock.json
tsconfig*buildinfo
yarn-debug.log*
yarn-error.log*
package-lock.json
+3
View File
@@ -0,0 +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>
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = require('@polkadot/dev/config/prettier.cjs');
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-631
View File
File diff suppressed because one or more lines are too long
+785
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -10,4 +10,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"
yarnPath: .yarn/releases/yarn-3.0.1.cjs
yarnPath: .yarn/releases/yarn-3.2.0.cjs
+522
View File
@@ -1,5 +1,527 @@
# CHANGELOG
## 8.8.2 Jun 14, 2022
Changes:
- Aling historic `DispatchErrorModule` with `U8` variant
- Extend lookup type name generation when conflicts arrise
- Update to latest Substrate metadata
## 8.8.1 Jun 12, 2022
Contributed:
- Ensure typegen disconnects from WS endpoint (Thanks to https://github.com/rflechtner)
Changes:
- Ensure storage `Option<Option<Type>>` are correctly handled
- Cater for named event fields (expose on event data as available)
- Expose (partial) `runtimeVersion` on `api.at` interfaces
- Add aliases for `DispatchError{U8, U8a}` (default to new `U8a` variant)
- Align `DispatchError` definition with latest Substrate
- Adjust contracts RPC definitions with `DispatchError` return
- Ensure `blockHash` is passed through with `era` sign options
- Workaround for default calls on chains with non-standard indexes
- Optimization for value returns on merged queries
- Update `derive.bagsList` to detect `voterList` pallet
- Add Polkadot 9200/9220 & Westend 9230 upgrade blocks
## 8.7.1 Jun 4, 2022
Changes:
- Add internal merge of single storage queries
- Expose provider stats on API intrerface via `.stats`
- Adjust flag extraction for latest phragmen types
- Support for `Range` in typegen for `Enum`
- Add Kusama 9220 upgrade block
## 8.6.2 May 30, 2022
Changes:
- Don't apply default to `Option<bool>` opt-in
- Lower default historic LRU cache size (128 entries, 192MB est)
- Cater for updates required by TS 4.7.2
## 8.6.1 May 29, 2022
Changes:
- Add codec support for specialized `Option<bool>`
- Optimization for `createClass` with shortcut typeDef creation
- Optimization of `registry.getOrUnknown` with lookup cache
- Optimization of Array allocations in decoding
- Use `compactFromU8aLim` & `u8aConcatStrict` variants
- Adjust `.inspect()` for `ExtrinsicPayload`
- Adjust Kusama `StakingLedger` for runtime 1051
- Update to latest Substrate, Kusama & Polkadot static metadata
## 8.5.1 May 22, 2022
Contributed:
- Bump `@substrate/connect` to 0.7.5 (Thanks to https://github.com/wirednkod)
Changes:
- Adjust extrinsic inspect for signed/unsigned
- Add support for `mmr_generateBatchProof` RPC
- Add additional `isCodec` checks to error/event `.is`
- Add support for `Vec<Option<X>>` in typegen
- Update to latest Substrate, Kusama & Polkadot static metadata
## 8.4.2 May 15, 2022
Changes:
- Expand/fix TS typings for `MortalEra.{birth, death}(...)`
## 8.4.1 May 14, 2022
Changes:
- Added support for typegen over `Range/RangeInclusive` types
- Add explicit support for `Call` typegen (inclusive of non-defaults)
- Deupe `wss://` handling in `polkadot-types-from-{chain, defs}`
- Allow for optional `definitions.ts` in typegen (only use chain)
- Optimize `Compact<*>` decoding in Uint8Array streams
- Use `I*` interfaces for extrinsic payload getters
- Re-add support for historic linked-map queries
- Update to latest Substrate, Kusama & Polkadot static metadata
- Add latest upgrade blocks for Polkadot, Kusama & Westend
## 8.3.2 May 8, 2022
Contributed:
- Bump `@substrate/connect` to 0.7.4 (Thanks to https://github.com/wirednkod)
Changes:
- Adjust `BTreeSet` in typegen top-level generation
## 8.3.1 May 1, 2022
Contributed:
- Fetch metadata via WS for `types-from-defs` (Thanks to https://github.com/alex-nax)
Changes:
- Extract metadata v14 `BTreeSet` types into correct type
- Assert to ensure that `[u8; <size>]` has exact sizes (non-u8a inputs)
- Adjust `tx.paymentInfo` signing process for existing signature
- Add Kusama 9190 upgrade block
- Add Westend 9200 upgrade block
- Update to latest Substrate, Kusama & Polkadot static metadata
## 8.2.1 Apr 24, 2022
Contributed:
- Make WS timeout check configurable (Thanks to https://github.com/isSerge)
Changes:
- Don't fake signature for `paymentInfo` if already signed
- Remove `api.derive.balances.fees` (use direct constants as applicable)
- Add Westend 9190 upgrade block
- Update to latest Substrate, Kusama & Polkadot static metadata
## 8.1.1 Apr 17, 2022
Contributed:
- Adjust typegen for `Vec<{ struct: <type> }>` (Thanks to https://github.com/zannis)
- Adjust typegen __dirname for ESM (Thanks to https://github.com/drewstone)
Changes:
- Fix `entriesPaged` where no `at?: BlockHash` is specified
- Apply windcard matches for `democracy::vote::Vote` and `identity::type::Data`
- Adjust default "no RPC response" timeout to 60s
- Update to latest Substrate, Kusama & Polkadot static metadata
## 8.0.2 Apr 11, 2022
Changes:
- Detect typegen template location for commonjs execution
## 8.0.1 Apr 10, 2022
- **Breaking change** In this major version the commonjs outputs are moved to a sub-folder. Since the export map and main field in package.json does reflect this change, there should be no usage changes. However the packages here will all need to be on the same version for internal linkage.
Contributed:
- Improve `rpc-provider` README (Thanks to https://github.com/josepot)
- Add handling for `Vec<[<Type>;<length>]>` in typegen (Thanks to https://github.com/zannis)
Changes:
- Add support for `apiAt.tx(...)` to construct at a specific point
- Add basic `api.derive.bagsList.*` support
- Return sorted names for `api.registry.lookup.names`
- Optimize JSONRPC requests/response handling
- Output commonjs files under the `cjs/**` root
- Update to latest Substrate, Kusama & Polkadot static metadata
- Add latest Polkadot 9180 upgrade block
- Update to `@polkadot/util` 9.0.1
## 7.15.1 Apr 3, 2022
Contributed:
- Export `WellKnownChain` for `substrate-connect` (Thanks to https://github.com/josepot)
- Add support for `{entries, keys}Paged` in `.at` (Thanks to https://github.com/xlc)
- Align `WeightsPerClass` interface on `maxExtrinsic` (Thanks to https://github.com/HackFisher)
Changes:
- Cater for `DispatchError` with `error` as `[u8; 4]`
- Add in-flight cache for parallel same-version metadata queries
- Cater for lazy `@polkadot/util-crypto` init (adjustment for React Native)
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update latest Westend & Kusama (up to 9180) upgrade blocks
## 7.14.3 Mar 28, 2022
Changes:
- Ensure `BitVec` with MSB does not fail (used in Polkadot `DeliveredMessages`)
## 7.14.2 Mar 28, 2022
Changes:
- Don't export `ScProvider` top-level in `@polkadot/rpc-provider`
## 7.14.1 Mar 27, 2022
Contributed:
- Add `ScProvider` for `@substrate/substrate-connect` (Thanks to https://github.com/josepot)
- Add support for `BTree{Map, Set}` in typegen (Thanks to https://github.com/CertainLach)
Changes:
- Only explicitly support LSB on `BitVec` types
- Change `toHuman()` on `BitVec` to output default LSB
- Add `bytes{Sent, Recv}` to provider stats
- Clear connection timout on provider `disconnect()`
- Add support for `dev_getBlockStats` RPC
## 7.13.1 Mar 19, 2022
**Important** This contains an upgraded version of `@polkadot/wasm-crypto`. For users of asm.js, e.g. React Native, there are some additional upgrade instructions in the release notes for this version https://github.com/polkadot-js/wasm/releases/tag/v5.0.1
Contributed:
- Expose custom RPC error details (Thanks to https://github.com/intendednull)
- Improve custom RPC error typings (Thanks to https://github.com/MOZGIII)
Changes:
- Support for rejection of hanging RPC requests (30s timeout)
- Add `.stats` to provider interfaces with running counters
- Add support for `state_trieMigrationStatus` RPC
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update to `@polkadot/util` 8.6.1
- Additional workaround for Vite bundling
## 7.12.1 Mar 13, 2022
Changes:
- Allow for correct handling of `Option<Null>` types
- Adjust for bundlers where `import.meta.url` is undefined
- Update to `@polkadot/util` 8.5.1
## 7.11.1 Mar 6, 2022
Changes:
- Chunk derive retrieval of `era{Exposure, Prefs, Slashes}`
- Ensure that signer (passed via options) do get updated
- Kusama & Polkadot 9170 upgrade blocks
- Update to latest Substrate, Kusama & Polkadot static metadata
- Adjustments for TypeScript 7.6.2
## 7.10.1 Feb 27, 2022
Contributed:
- Ensure `updateId` is correct in signer callbacks (Thanks to https://github.com/coolcorexix)
Changes:
- Ensure `BTreeSet` has the correct decoded length
- Attach `PortableRegistry` at point of metadata set
- Add `derive.chain.getBlockByNumber`
- Retrieve named reserves in `derive.balances.all`
- Ensure `v13 -> v14` metadata conversion attaches primitives
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.9.1 Feb 20, 2022
Contributed:
- Support historic queries via blockNumber (Thanks to https://github.com/stwiname)
Changes:
- Align `grandpa_proveFinality` with Substrate
- Allow for derive augmentation (swap base type to interfaces)
- Kusama 9160 upgrade block
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.8.1 Feb 14, 2022
Contributed:
- Add `isHistoric` flag to ETH RPCs (Thanks to https://github.com/stwiname)
- Align contract instantiate types with Substrate (Thanks to https://github.com/kwingram25)
Changes:
- Adjust map header output type with lookup id
- Re-enable all `BitVec` tests for `toU8a`
- Expose `txIndex` as event index on extrinsic results
- Allow inspection of Codec encoding (experimental)
- Allow inspection of storage key encoding (experimental)
- Update to latest Substrate, Kusama & Polkadot static metadata
- Update `@polkadot/util` to 8.4.1
## 7.7.1 Feb 6, 2022
Upgrade priority: Low. Recommended for users with long-running scripts.
Contributed:
- Fix rpc-provider LRU memory leak (Thanks to https://github.com/gdethier)
Changes:
- Don't warn on `Lookup*` types missing (these are resolvable)
- Don't clear injected `PortableRegistry` types on runtime upgrade
- Clear warning for `Call`/`Event` on non-meta v14 runtimes
- Add `beefy_getFinalizedHead` RPC support
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.6.1 Jan 30, 2022
Upgdare priority: Low. Recommended for users with long-running scripts and those chains based around the latest Substrate master versions.
Contributed:
- Fix memory leak on `.raw` RPC calls (Thanks to https://github.com/r0t0r-r0t0r)
Changes:
- Adjust extraction of `Call` & `Event` types for metadata v14
- Adjust historic `WinningData` and `SlotRange` types (36-entry variant)
- Emit `decorated` event on API on metadata decoration
- Dedupe and extend `WrapperKeepOpaque/WrapperOpaque`
- Align `Range/RangeInclusive` usage with similar types
- Adjust bounty derive, return empty on no `{treasury, bounties}.bounties`
- Ensure handling of all `TypeDefInfo` keys in extraction
- Add support for `rpc.contracts.uploadCode`
- Workaround for generators where `#private = { this... }` yields undefined
- Update to latest Substrate, Kusama & Polkadot static metadata
## 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.
Changes:
- Extend support for `WrapperKeepOpaque` with internal decoding (allowed to fail)
- Adjust max-entries in historic provider LRU
- Update to latest Substrate/Polkadot/Kusama metadata
- Update `@polkadot/util` to 8.3.1
- Update package paths under ESM
## 7.2.1 Jan 3, 2022
Upgrade priority: Low. Recommended for users generating TS chain-specific augmentations.
Changes:
- Convert contract `ReturnFlags` to set (as opposed to bare `u32`)
- Adjust chain-specific augmentation to not auto-add RPC imports
- Ensure package path is availble under ESM & CJS
## 7.1.1 Dec 26, 2021
Upgrade priority: Low. Recommended for users of contracts form Substrate master & Polkador/Kusama TS app developers where specific chain augmentation would be helpful.
Contributed:
- Expose `storageDepositLimit` on contract options (Thanks to https://github.com/kwingram25)
Changes:
- Expose `@polkadot/api-augment/{kusama, polkadot, substrate}` for specific augmentations (The bare `@polkadot/api-augment` is equivalent to `/substrate`, keeping the existing behavior)
- Expose `@polkadot/types-augment/{lookup, registry}` variants (The bare `@polkadot/types-augment` applies both)
- Expose `txHash` on submittable results, e.g. `tx.signAndSend(..., ({ txHash }) => ...)`
- Align casing for TS & exposed queries (adjusts for `ALLCAPS` entries)
- Additional tests for `Option` codec (explicit in expectations)
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.0.2 Dec 21, 2021
Upgrade priority: Low. Recommended for applications where collective derives with aliasses are being used.
Changes:
- Fix alias module mapping in collective derives
- Update `dispathchQueue` derive to align with latest Substrate
- Update to latest Substrate metadata
## 7.0.1 Dec 20, 2021
Upgrade priority: Low. Recommended for TS users with their own non-Polkadot/Kusama chains.
- **Breaking changes** For TS users the default API augmentation is now optional. This means that the API, for TypeScript, is not decorated by default with the Substrate types and encpoints. TS users should add a singular `import '@polkadot/api-augment';` in their code to 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 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:
- Add contracts storage deposit support (Thanks to https://github.com/statictype)
- Do not throw error on socket closes (Thanks to https://github.com/xcaptain)
Changes:
- Split `@polkadot/types-{codec, create}` packages from `types`
- Extract `@polkadot/{api, rpc, types}-augment` (now optional, TS-user applied)
- Rework build steps to use TS project references
- Add Polkadot 9140 upgrade block
- Update to latest Substrate, Kusama & Polkadot static metadata
## 6.12.1 Dec 13, 2021
Upgrade priority: Low. Recommended for users of contracts on the current Substrate master version and TS users who generate metadata v14 interfaces.
Changes:
- Add support for contracts V2 ABI metadata
- `CheckNonZeroSender` signed extension support
- Remove old-style capabilities detection (unneeded with metadata v14+)
- Generated TS Enum interfaces now expose the `type` (with allowed values)
- Split local & package imports in generated TS interfaces
- Add Kusama 9130 upgrade block
- Internal maintainability cleanups
## 6.11.1 Dec 5, 2021
Upgrade priority: Low. Maintenance upgrade, tracking the latest `@polkadot` libraries.
Changes:
- Align `state_traceBlock` RPC with Substrate
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.10.3 Nov 30, 2021
Upgrade priority: Medium. Recommended for 6.10.x users
Changes:
- Fix ss58Prefix extraction
## 6.10.2 Nov 30, 2021
Upgrade priority: Low. Aligns TS augmentation and decoration with older behavior for ALL_CAPS identifiers.
Changes:
- Adjust augmentation interface consistency with top-level declarations
- Update `@polkadot/util` to 8.0.4 with adjusted `stringCamelCase`
## 6.10.1 Nov 29, 2021
Upgrade priority: Low. Recommended for users of `HttpProvider` and for chains generating types using TS augmentation.
Changes:
- Fix for HttpProvider init (RPC sections with only subscriptions)
- Re-order imports in lookup type augmentation interfaces
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.9.2 Nov 22, 2021
Upgrade priority: Medium. Pulls in `@polkadot/util-crypto` fix for TS projects.
+104
View File
@@ -0,0 +1,104 @@
3023 Jaco 8.8.2 (#4937)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
37 Keith Ingram Update contract types and rpc (#4541)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
16 Xiliang Chen implement entriesPaged and keysPages for query at (#4701)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
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 D Use derive customAccount and customLocks for balance overrides (#3248)
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 Nikos Kontakis Update substrate connect to 0.7.5 (#4835)
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
4 Thibaut Sardan no subscription for http (#3127)
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 Josep M Sobrepere docs: improve rpc-provider README (#4719)
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 HackFisher Update maxExtrinsic definition (#4703)
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 MOZGIII Follow-up fix after #4665 (#4666)
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 Zannis Kalampoukis fix: Typegen handles structs and vectors of structs without erroring (#4743)
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 coolcorexix Investigate 4559 v2 (#4608)
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 Gérard Dethier Fix LRUCache memory leak. (#4520)
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 Noah Corona Add rpc error fields (#4637)
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 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
1 Raphael Flechtner fix: typegen disconnect ws on success (#4901)
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 serge make WS provider timeout configurable (#4758)
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 Yaroslav Bolyukin Support BTreeMap/BTreeSet in typegen (#4682)
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)
-14
View File
@@ -14,17 +14,3 @@ If you are an existing user, please be sure to track the [CHANGELOG](CHANGELOG.m
## tutorials
Looking for tutorials to get started? Look at [examples](https://polkadot.js.org/docs/api/examples/promise/) for guides on how to use the API to make queries and submit transactions.
## overview
The API is split up into a number of internal packages -
- [@polkadot/api](packages/api/) The API library, providing both Promise and RxJS Observable-based interfaces. This is the main user-facing entry point.
- [@polkadot/api-derive](packages/api-derive/) Derived results that are injected into the API, allowing for combinations of various query results (only used internally and exposed on the Api instances via `api.derive.*`)
- [@polkadot/metadata](packages/metadata/) Base extrinsic, storage and constant injectors for injection
- [@polkadot/rpc-core](packages/rpc-core/) Wrapper around all [JSON-RPC methods](https://polkadot.js.org/docs/substrate/rpc) exposed by a Polkadot network client
- [@polkadot/rpc-provider](packages/rpc-provider/) Providers for connecting to nodes, including WebSockets and Http
Type definitions for interfaces as exposed by Polkadot & Substrate clients -
- [@polkadot/types](packages/types/) Codecs for all Polkadot and Substrate primitives
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
module.exports = require('@polkadot/dev/config/babel-config-cjs.cjs');
+4 -5
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
const config = require('@polkadot/dev/config/jest.cjs');
@@ -6,13 +6,12 @@ const config = require('@polkadot/dev/config/jest.cjs');
module.exports = {
...config,
moduleNameMapper: {
'@polkadot/api-(contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
'@polkadot/api-(augment|base|contract|derive)(.*)$': '<rootDir>/packages/api-$1/src/$2',
// eslint-disable-next-line sort-keys
'@polkadot/api(.*)$': '<rootDir>/packages/api/src/$1',
'@polkadot/metadata(.*)$': '<rootDir>/packages/metadata/src/$1',
'@polkadot/rpc-(core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2',
'@polkadot/rpc-(augment|core|provider)(.*)$': '<rootDir>/packages/rpc-$1/src/$2',
'@polkadot/typegen(.*)$': '<rootDir>/packages/typegen/src/$1',
'@polkadot/types-(known|support)(.*)$': '<rootDir>/packages/types-$1/src/$2',
'@polkadot/types-(augment|codec|create|known|support)(.*)$': '<rootDir>/packages/types-$1/src/$2',
// eslint-disable-next-line sort-keys
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
},
+9 -10
View File
@@ -2,8 +2,8 @@
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2",
"packageManager": "yarn@3.0.1",
"license": "Apache-2.0",
"packageManager": "yarn@3.2.0",
"private": true,
"repository": {
"type": "git",
@@ -11,7 +11,7 @@
},
"sideEffects": false,
"type": "commonjs",
"version": "6.9.2",
"version": "8.8.2",
"workspaces": [
"packages/*"
],
@@ -31,16 +31,15 @@
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/register": "^7.16.0",
"@babel/runtime": "^7.16.3",
"@polkadot/dev": "^0.63.29",
"@polkadot/ts": "^0.4.14",
"@babel/core": "^7.18.5",
"@babel/register": "^7.17.7",
"@babel/runtime": "^7.18.3",
"@polkadot/dev": "^0.67.3",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.0.3",
"@types/jest": "^28.1.1",
"copyfiles": "^2.4.1"
},
"resolutions": {
"typescript": "^4.5.2"
"typescript": "^4.7.3"
}
}
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+3
View File
@@ -0,0 +1,3 @@
# @polkadot/api-augment
Generated augmentation.
+37
View File
@@ -0,0 +1,37 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "API generated augmentation",
"engines": {
"node": ">=14.0.0"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-augment#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-augment",
"repository": {
"directory": "packages/api-augment",
"type": "git",
"url": "https://github.com/polkadot-js/api.git"
},
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/api-base": "8.8.2",
"@polkadot/rpc-augment": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-augment": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/util": "^9.4.1"
},
"devDependencies": {
"@polkadot/types-support": "8.8.2"
}
}
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
// for the API, we decorate not only the endpoints, but all types
import '@polkadot/rpc-augment';
import '@polkadot/types-augment';
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './substrate';
export { packageInfo } from './packageInfo';
+8
View File
@@ -0,0 +1,8 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { packageInfo as baseInfo } from '@polkadot/api-base/packageInfo';
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
import { packageInfo as codecInfo } from '@polkadot/types-codec/packageInfo';
export default [baseInfo, typesInfo, codecInfo];
+11
View File
@@ -0,0 +1,11 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
import { detectPackage } from '@polkadot/util';
import others from './detectOther';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, null, others);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './detectPackage';
export * from './bundle';
@@ -1,36 +1,27 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api/types';
import type { U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types';
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
import type { Codec } from '@polkadot/types/types';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api/types/consts' {
export interface AugmentedConsts<ApiType> {
assets: {
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
auctions: {
/**
* The amount of funds that must be reserved when creating a new approval.
* The number of blocks over which an auction may be retroactively ended.
**/
approvalDeposit: u128 & AugmentedConst<ApiType>;
endingPeriod: u32 & AugmentedConst<ApiType>;
leasePeriodsPerSlot: u32 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset.
* The length of each sample to take during the ending period.
*
* `EndingPeriod` / `SampleLength` = Total # of Samples
**/
assetDeposit: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved when adding metadata to your asset.
**/
metadataDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The additional funds that must be reserved for the number of bytes you store in your
* metadata.
**/
metadataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* The maximum length of a name or symbol stored on-chain.
**/
stringLimit: u32 & AugmentedConst<ApiType>;
sampleLength: u32 & AugmentedConst<ApiType>;
slotRangeCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -72,58 +63,6 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
bagsList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their vote weight. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
* weight, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
* will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
* into bag 0, an id with weight 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
balances: {
/**
* The minimum amount required to keep an account open.
@@ -144,11 +83,6 @@ declare module '@polkadot/api/types/consts' {
[key: string]: Codec;
};
bounties: {
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty
* curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a bounty proposal.
**/
@@ -165,12 +99,29 @@ declare module '@polkadot/api/types/consts' {
* Minimum value for a bounty.
**/
bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMax: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMin: Option<u128> & AugmentedConst<ApiType>;
/**
* The curator deposit is calculated as a percentage of the curator fee.
*
* This deposit has optional upper and lower bounds with `CuratorDepositMax` and
* `CuratorDepositMin`.
**/
curatorDepositMultiplier: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
*
* Benchmarks depend on this value, be sure to update weights file when changing this value
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
@@ -178,26 +129,41 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
contracts: {
childBounties: {
/**
* The deposit that must be placed into the contract's account to instantiate it.
* This is in **addition** to the [`pallet_balances::Pallet::ExistenialDeposit`].
* The minimum balance for a contract's account can be queried using
* [`Pallet::subsistence_threshold`].
* Minimum value for a child-bounty.
**/
contractDeposit: u128 & AugmentedConst<ApiType>;
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* The maximum number of tries that can be queued for deletion.
* Maximum number of child bounties that can be added to a parent bounty.
**/
deletionQueueDepth: u32 & AugmentedConst<ApiType>;
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of weight that can be consumed per block for lazy trie removal.
* Generic const
**/
deletionWeightLimit: u64 & AugmentedConst<ApiType>;
[key: string]: Codec;
};
claims: {
prefix: Bytes & AugmentedConst<ApiType>;
/**
* Cost schedule and limits.
* Generic const
**/
schedule: PalletContractsSchedule & AugmentedConst<ApiType>;
[key: string]: Codec;
};
crowdloan: {
/**
* The minimum amount that may be contributed into a crowdloan. Should almost certainly be at
* least `ExistentialDeposit`.
**/
minContribution: u128 & AugmentedConst<ApiType>;
/**
* `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b"py/cfund")`
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Max number of storage keys to remove per extrinsic call.
**/
removeKeysLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -267,19 +233,25 @@ declare module '@polkadot/api/types/consts' {
};
electionProviderMultiPhase: {
/**
* Maximum length (bytes) that the mined solution should consume.
*
* The miner will ensure that the total length of the unsigned solution will not exceed
* this value.
* The minimum amount of improvement to the solution score that defines a solution as
* "better" in the Signed phase.
**/
minerMaxLength: u32 & AugmentedConst<ApiType>;
betterSignedThreshold: Perbill & AugmentedConst<ApiType>;
/**
* Maximum weight that the miner should consume.
*
* The miner will ensure that the total weight of the unsigned solution will not exceed
* this value, based on [`WeightInfo::submit_unsigned`].
* The minimum amount of improvement to the solution score that defines a solution as
* "better" in the Unsigned phase.
**/
minerMaxWeight: u64 & AugmentedConst<ApiType>;
betterUnsignedThreshold: Perbill & AugmentedConst<ApiType>;
/**
* The maximum number of electable targets to put in the snapshot.
**/
maxElectableTargets: u16 & AugmentedConst<ApiType>;
/**
* The maximum number of electing voters to put in the snapshot. At the moment, snapshots
* are only over a single block, but once multi-block elections are introduced they will
* take place over multiple blocks.
**/
maxElectingVoters: u32 & AugmentedConst<ApiType>;
/**
* The priority of the unsigned transaction submitted in the unsigned-phase
**/
@@ -303,6 +275,10 @@ declare module '@polkadot/api/types/consts' {
* Per-weight deposit for a signed solution.
**/
signedDepositWeight: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of unchecked solutions to refund the call fee for.
**/
signedMaxRefunds: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of signed submissions that can be queued.
*
@@ -316,7 +292,9 @@ declare module '@polkadot/api/types/consts' {
/**
* Maximum weight of a signed solution.
*
* This should probably be similar to [`Config::MinerMaxWeight`].
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
* this value.
**/
signedMaxWeight: u64 & AugmentedConst<ApiType>;
/**
@@ -327,63 +305,10 @@ declare module '@polkadot/api/types/consts' {
* Base reward for a signed solution
**/
signedRewardBase: u128 & AugmentedConst<ApiType>;
/**
* The minimum amount of improvement to the solution score that defines a solution as
* "better" (in any phase).
**/
solutionImprovementThreshold: Perbill & AugmentedConst<ApiType>;
/**
* Duration of the unsigned phase.
**/
unsignedPhase: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of voters to put in the snapshot. At the moment, snapshots are only
* over a single block, but once multi-block elections are introduced they will take place
* over multiple blocks.
*
* Also, note the data type: If the voters are represented by a `u32` in `type
* CompactSolution`, the same `u32` is used here to ensure bounds are respected.
**/
voterSnapshotPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
elections: {
/**
* How much should be locked up in order to submit one's candidacy.
**/
candidacyBond: u128 & AugmentedConst<ApiType>;
/**
* Number of members to elect.
**/
desiredMembers: u32 & AugmentedConst<ApiType>;
/**
* Number of runners_up to keep.
**/
desiredRunnersUp: u32 & AugmentedConst<ApiType>;
/**
* Identifier for the elections-phragmen pallet's lock
**/
palletId: U8aFixed & AugmentedConst<ApiType>;
/**
* How long each seat is kept. This defines the next block number at which an election
* round will happen. If set to zero, no elections are ever triggered and the module will
* be in passive mode.
**/
termDuration: u32 & AugmentedConst<ApiType>;
/**
* Base deposit associated with voting.
*
* This should be sensibly high to economically ensure the pallet cannot be attacked by
* creating a gigantic number of votes.
**/
votingBondBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of bond that need to be locked for each vote (32 bytes).
**/
votingBondFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -505,26 +430,6 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
lottery: {
/**
* The max number of calls available in a single lottery.
**/
maxCalls: u32 & AugmentedConst<ApiType>;
/**
* Number of time we should try to generate a random number that has no modulo bias.
* The larger this number, the more potential computation is used for picking the winner,
* but also the more likely that the chosen winner is done fairly.
**/
maxGenerateRandom: u32 & AugmentedConst<ApiType>;
/**
* The Lottery's pallet id
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: {
/**
* The base amount of currency needed to reserve for creating a multisig execution or to
@@ -550,6 +455,70 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
nominationPools: {
/**
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
* This is important in the event slashing takes place and the pool's points-to-balance
* ratio becomes disproportional.
* For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1.
* Such a scenario would also be the equivalent of the pool being 90% slashed.
**/
minPointsToBalance: u32 & AugmentedConst<ApiType>;
/**
* The nomination pool's pallet id.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
paras: {
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
phragmenElection: {
/**
* How much should be locked up in order to submit one's candidacy.
**/
candidacyBond: u128 & AugmentedConst<ApiType>;
/**
* Number of members to elect.
**/
desiredMembers: u32 & AugmentedConst<ApiType>;
/**
* Number of runners_up to keep.
**/
desiredRunnersUp: u32 & AugmentedConst<ApiType>;
/**
* Identifier for the elections-phragmen pallet's lock
**/
palletId: U8aFixed & AugmentedConst<ApiType>;
/**
* How long each seat is kept. This defines the next block number at which an election
* round will happen. If set to zero, no elections are ever triggered and the module will
* be in passive mode.
**/
termDuration: u32 & AugmentedConst<ApiType>;
/**
* Base deposit associated with voting.
*
* This should be sensibly high to economically ensure the pallet cannot be attacked by
* creating a gigantic number of votes.
**/
votingBondBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of bond that need to be locked for each vote (32 bytes).
**/
votingBondFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
proxy: {
/**
* The base amount of currency needed to reserve for creating an announcement.
@@ -611,8 +580,13 @@ declare module '@polkadot/api/types/consts' {
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
*
* NOTE: The threshold programmed in this Pallet uses u16, so it does
* not really make sense to have a limit here greater than u16::MAX.
* But also, that is a lot more than you should probably set this value
* to anyway...
**/
maxFriends: u16 & AugmentedConst<ApiType>;
maxFriends: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
@@ -628,6 +602,21 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
registrar: {
/**
* The deposit to be paid per byte stored on chain.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* The deposit to be paid to run a parathread.
* This should include the cost for storing the genesis head and validation code.
**/
paraDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
* The maximum weight that may be scheduled per block for any dispatchables of less
@@ -644,6 +633,20 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
slots: {
/**
* The number of blocks to offset each lease period by.
**/
leaseOffset: u32 & AugmentedConst<ApiType>;
/**
* The number of blocks over which a single period lasts.
**/
leasePeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
society: {
/**
* The minimum amount of a deposit required for a bid to be made.
@@ -693,6 +696,9 @@ declare module '@polkadot/api/types/consts' {
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of nominations per nominator.
**/
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
@@ -701,6 +707,11 @@ declare module '@polkadot/api/types/consts' {
* claim their reward. This used to limit the i/o cost for the nominator payout.
**/
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively
* determines how many unique eras a staker may be unbonding in.
**/
maxUnlockingChunks: u32 & AugmentedConst<ApiType>;
/**
* Number of sessions per era.
**/
@@ -771,6 +782,8 @@ declare module '@polkadot/api/types/consts' {
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
*
* Benchmarks depend on this value, be sure to update weights file when changing this value
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
@@ -815,14 +828,6 @@ declare module '@polkadot/api/types/consts' {
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* The fee to be paid for making a transaction; the per-byte portion.
**/
transactionByteFee: u128 & AugmentedConst<ApiType>;
/**
* The polynomial that is applied in order to derive fee from weight.
**/
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -835,6 +840,8 @@ declare module '@polkadot/api/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
@@ -846,6 +853,10 @@ declare module '@polkadot/api/types/consts' {
* An accepted proposal gets these back. A rejected proposal does not.
**/
proposalBond: Permill & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMaximum: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
@@ -859,45 +870,6 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
uniques: {
/**
* The basic amount of funds that must be reserved when adding an attribute to an asset.
**/
attributeDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset class.
**/
classDeposit: u128 & AugmentedConst<ApiType>;
/**
* The additional funds that must be reserved for the number of bytes store in metadata,
* either "normal" metadata or attribute metadata.
**/
depositPerByte: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset instance.
**/
instanceDeposit: u128 & AugmentedConst<ApiType>;
/**
* The maximum length of an attribute key.
**/
keyLimit: u32 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved when adding metadata to your asset.
**/
metadataDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The maximum length of data stored on-chain.
**/
stringLimit: u32 & AugmentedConst<ApiType>;
/**
* The maximum length of an attribute value.
**/
valueLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
utility: {
/**
* The limit on the number of batched calls.
@@ -919,9 +891,57 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
}
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
[key: string]: QueryableModuleConsts;
}
}
voterList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
} // AugmentedConsts
} // declare module
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,43 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/api-augment/kusama';
import type { PolkadotRuntimeParachainsUmpPalletEvent, XcmV2TraitsOutcome } from '@polkadot/types/lookup';
import { Metadata, TypeRegistry } from '@polkadot/types';
import metadataStatic from '@polkadot/types-support/metadata/static-kusama';
const registry = new TypeRegistry();
const metadata = new Metadata(registry, metadataStatic);
registry.setMetadata(metadata);
describe('correct types', (): void => {
it('correctly creates XcmV2TraitsOutcome', (): void => {
const test = registry.createType<XcmV2TraitsOutcome>('XcmV2TraitsOutcome', {
Incomplete: [3_000_000_000, 'BadOrigin']
});
expect(test.toHuman()).toEqual({
Incomplete: [
'3,000,000,000',
'BadOrigin'
]
});
expect(test.isIncomplete).toEqual(true);
expect(test.asIncomplete.toHuman()).toEqual([
'3,000,000,000',
'BadOrigin'
]);
});
it('correctly creates PolkadotRuntimeParachainsUmpPalletEvent', (): void => {
const test = registry.createType<PolkadotRuntimeParachainsUmpPalletEvent>('PolkadotRuntimeParachainsUmpPalletEvent', '0x02112233445566778811223344556677881122334455667788112233445566778801005ed0b20000000006');
expect(test.asExecutedUpward[1].asIncomplete.toHuman()).toEqual([
'3,000,000,000',
'BadOrigin'
]);
});
});
File diff suppressed because it is too large Load Diff
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types/augment';
import '../base';
import './consts';
import './errors';
import './events';
import './query';
import './rpc';
import './registry';
import './tx';
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types-augment/registry/substrate';
import '@polkadot/types-augment/registry/polkadot';
import '@polkadot/types-augment/registry/kusama';
File diff suppressed because it is too large Load Diff
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-augment', path: 'auto', type: 'auto', version: '8.8.2' };
+796
View File
@@ -0,0 +1,796 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
auctions: {
/**
* The number of blocks over which an auction may be retroactively ended.
**/
endingPeriod: u32 & AugmentedConst<ApiType>;
leasePeriodsPerSlot: u32 & AugmentedConst<ApiType>;
/**
* The length of each sample to take during the ending period.
*
* `EndingPeriod` / `SampleLength` = Total # of Samples
**/
sampleLength: u32 & AugmentedConst<ApiType>;
slotRangeCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
authorship: {
/**
* The number of blocks back we should accept uncles.
* This means that we will deal with uncle-parents that are
* `UncleGenerations + 1` before `now`.
**/
uncleGenerations: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
babe: {
/**
* The amount of time, in slots, that each epoch should last.
* NOTE: Currently it is not possible to change the epoch duration after
* the chain has started. Attempting to do so will brick block production.
**/
epochDuration: u64 & AugmentedConst<ApiType>;
/**
* The expected average block time at which BABE should be creating
* blocks. Since BABE is probabilistic it is not trivial to figure out
* what the expected average block time should be based on the slot
* duration and the security parameter `c` (where `1 - c` represents
* the probability of a slot being empty).
**/
expectedBlockTime: u64 & AugmentedConst<ApiType>;
/**
* Max number of authorities allowed
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
balances: {
/**
* The minimum amount required to keep an account open.
**/
existentialDeposit: u128 & AugmentedConst<ApiType>;
/**
* The maximum number of locks that should exist on an account.
* Not strictly enforced, but used for weight estimation.
**/
maxLocks: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of named reserves that can exist on an account.
**/
maxReserves: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
bounties: {
/**
* The amount held on deposit for placing a bounty proposal.
**/
bountyDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The delay period for which a bounty beneficiary need to wait before claim the payout.
**/
bountyDepositPayoutDelay: u32 & AugmentedConst<ApiType>;
/**
* Bounty duration in blocks.
**/
bountyUpdatePeriod: u32 & AugmentedConst<ApiType>;
/**
* Minimum value for a bounty.
**/
bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMax: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
curatorDepositMin: Option<u128> & AugmentedConst<ApiType>;
/**
* The curator deposit is calculated as a percentage of the curator fee.
*
* This deposit has optional upper and lower bounds with `CuratorDepositMax` and
* `CuratorDepositMin`.
**/
curatorDepositMultiplier: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
*
* Benchmarks depend on this value, be sure to update weights file when changing this value
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
childBounties: {
/**
* Minimum value for a child-bounty.
**/
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of child bounties that can be added to a parent bounty.
**/
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
claims: {
prefix: Bytes & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
crowdloan: {
/**
* The minimum amount that may be contributed into a crowdloan. Should almost certainly be at
* least `ExistentialDeposit`.
**/
minContribution: u128 & AugmentedConst<ApiType>;
/**
* `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b"py/cfund")`
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Max number of storage keys to remove per extrinsic call.
**/
removeKeysLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
democracy: {
/**
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
**/
cooloffPeriod: u32 & AugmentedConst<ApiType>;
/**
* The period between a proposal being approved and enacted.
*
* It should generally be a little more than the unstake period to ensure that
* voting stakers have an opportunity to remove themselves from the system in the case
* where they are on the losing side of a vote.
**/
enactmentPeriod: u32 & AugmentedConst<ApiType>;
/**
* Minimum voting period allowed for a fast-track referendum.
**/
fastTrackVotingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Indicator for whether an emergency origin is even allowed to happen. Some chains may
* want to set this permanently to `false`, others may want to condition it on things such
* as an upgrade having happened recently.
**/
instantAllowed: bool & AugmentedConst<ApiType>;
/**
* How often (in blocks) new public referenda are launched.
**/
launchPeriod: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of public proposals that can exist at any time.
**/
maxProposals: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of votes for an account.
*
* Also used to compute weight, an overly big value can
* lead to extrinsic with very big weight: see `delegate` for instance.
**/
maxVotes: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount to be used as a deposit for a public referendum proposal.
**/
minimumDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance that must be deposited per byte of preimage stored.
**/
preimageByteDeposit: u128 & AugmentedConst<ApiType>;
/**
* The minimum period of vote locking.
*
* It should be no shorter than enactment period to ensure that in the case of an approval,
* those successful voters are locked into the consequences that their votes entail.
**/
voteLockingPeriod: u32 & AugmentedConst<ApiType>;
/**
* How often (in blocks) to check for new votes.
**/
votingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
electionProviderMultiPhase: {
/**
* The minimum amount of improvement to the solution score that defines a solution as
* "better" in the Signed phase.
**/
betterSignedThreshold: Perbill & AugmentedConst<ApiType>;
/**
* The minimum amount of improvement to the solution score that defines a solution as
* "better" in the Unsigned phase.
**/
betterUnsignedThreshold: Perbill & AugmentedConst<ApiType>;
/**
* The maximum number of electable targets to put in the snapshot.
**/
maxElectableTargets: u16 & AugmentedConst<ApiType>;
/**
* The maximum number of electing voters to put in the snapshot. At the moment, snapshots
* are only over a single block, but once multi-block elections are introduced they will
* take place over multiple blocks.
**/
maxElectingVoters: u32 & AugmentedConst<ApiType>;
/**
* The priority of the unsigned transaction submitted in the unsigned-phase
**/
minerTxPriority: u64 & AugmentedConst<ApiType>;
/**
* The repeat threshold of the offchain worker.
*
* For example, if it is 5, that means that at least 5 blocks will elapse between attempts
* to submit the worker's solution.
**/
offchainRepeat: u32 & AugmentedConst<ApiType>;
/**
* Base deposit for a signed solution.
**/
signedDepositBase: u128 & AugmentedConst<ApiType>;
/**
* Per-byte deposit for a signed solution.
**/
signedDepositByte: u128 & AugmentedConst<ApiType>;
/**
* Per-weight deposit for a signed solution.
**/
signedDepositWeight: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of unchecked solutions to refund the call fee for.
**/
signedMaxRefunds: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of signed submissions that can be queued.
*
* It is best to avoid adjusting this during an election, as it impacts downstream data
* structures. In particular, `SignedSubmissionIndices<T>` is bounded on this value. If you
* update this value during an election, you _must_ ensure that
* `SignedSubmissionIndices.len()` is less than or equal to the new value. Otherwise,
* attempts to submit new solutions may cause a runtime panic.
**/
signedMaxSubmissions: u32 & AugmentedConst<ApiType>;
/**
* Maximum weight of a signed solution.
*
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
* this value.
**/
signedMaxWeight: u64 & AugmentedConst<ApiType>;
/**
* Duration of the signed phase.
**/
signedPhase: u32 & AugmentedConst<ApiType>;
/**
* Base reward for a signed solution
**/
signedRewardBase: u128 & AugmentedConst<ApiType>;
/**
* Duration of the unsigned phase.
**/
unsignedPhase: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
grandpa: {
/**
* Max Authorities in use
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
identity: {
/**
* The amount held on deposit for a registered identity
**/
basicDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount held on deposit per additional field for a registered identity.
**/
fieldDeposit: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O
* required to access an identity, but can be pretty high.
**/
maxAdditionalFields: u32 & AugmentedConst<ApiType>;
/**
* Maxmimum number of registrars allowed in the system. Needed to bound the complexity
* of, e.g., updating judgements.
**/
maxRegistrars: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of sub-accounts allowed per identified account.
**/
maxSubAccounts: u32 & AugmentedConst<ApiType>;
/**
* The amount held on deposit for a registered subaccount. This should account for the fact
* that one storage item's value will increase by the size of an account ID, and there will
* be another trie item whose value is the size of an account ID plus 32 bytes.
**/
subAccountDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
imOnline: {
/**
* A configuration for base priority of unsigned transactions.
*
* This is exposed so that it can be tuned for particular runtime, when
* multiple pallets send unsigned transactions.
**/
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
indices: {
/**
* The deposit needed for reserving an index.
**/
deposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
multisig: {
/**
* The base amount of currency needed to reserve for creating a multisig execution or to
* store a dispatch call for later.
*
* This is held for an additional storage item whose value size is
* `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is
* `32 + sizeof(AccountId)` bytes.
**/
depositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per unit threshold when creating a multisig execution.
*
* This is held for adding 32 bytes more into a pre-existing storage value.
**/
depositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of signatories allowed in the multisig.
**/
maxSignatories: u16 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
paras: {
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
phragmenElection: {
/**
* How much should be locked up in order to submit one's candidacy.
**/
candidacyBond: u128 & AugmentedConst<ApiType>;
/**
* Number of members to elect.
**/
desiredMembers: u32 & AugmentedConst<ApiType>;
/**
* Number of runners_up to keep.
**/
desiredRunnersUp: u32 & AugmentedConst<ApiType>;
/**
* Identifier for the elections-phragmen pallet's lock
**/
palletId: U8aFixed & AugmentedConst<ApiType>;
/**
* How long each seat is kept. This defines the next block number at which an election
* round will happen. If set to zero, no elections are ever triggered and the module will
* be in passive mode.
**/
termDuration: u32 & AugmentedConst<ApiType>;
/**
* Base deposit associated with voting.
*
* This should be sensibly high to economically ensure the pallet cannot be attacked by
* creating a gigantic number of votes.
**/
votingBondBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of bond that need to be locked for each vote (32 bytes).
**/
votingBondFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
proxy: {
/**
* The base amount of currency needed to reserve for creating an announcement.
*
* This is held when a new storage item holding a `Balance` is created (typically 16
* bytes).
**/
announcementDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per announcement made.
*
* This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)
* into a pre-existing storage value.
**/
announcementDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of time-delayed announcements that are allowed to be pending.
**/
maxPending: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of proxies allowed for a single account.
**/
maxProxies: u32 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for creating a proxy.
*
* This is held for an additional storage item whose value size is
* `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes.
**/
proxyDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per proxy added.
*
* This is held for adding 32 bytes plus an instance of `ProxyType` more into a
* pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take
* into account `32 + proxy_type.encode().len()` bytes of data.
**/
proxyDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
registrar: {
/**
* The deposit to be paid per byte stored on chain.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* The deposit to be paid to run a parathread.
* This should include the cost for storing the genesis head and validation code.
**/
paraDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
scheduler: {
/**
* The maximum weight that may be scheduled per block for any dispatchables of less
* priority than `schedule::HARD_DEADLINE`.
**/
maximumWeight: u64 & AugmentedConst<ApiType>;
/**
* The maximum number of scheduled calls in the queue for a single block.
* Not strictly enforced, but used for weight estimation.
**/
maxScheduledPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
slots: {
/**
* The number of blocks to offset each lease period by.
**/
leaseOffset: u32 & AugmentedConst<ApiType>;
/**
* The number of blocks over which a single period lasts.
**/
leasePeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
staking: {
/**
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of nominations per nominator.
**/
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
*
* For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can
* claim their reward. This used to limit the i/o cost for the nominator payout.
**/
maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively
* determines how many unique eras a staker may be unbonding in.
**/
maxUnlockingChunks: u32 & AugmentedConst<ApiType>;
/**
* Number of sessions per era.
**/
sessionsPerEra: u32 & AugmentedConst<ApiType>;
/**
* Number of eras that slashes are deferred by, after computation.
*
* This should be less than the bonding duration. Set to 0 if slashes
* should be applied immediately, without opportunity for intervention.
**/
slashDeferDuration: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
system: {
/**
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
**/
blockHashCount: u32 & AugmentedConst<ApiType>;
/**
* The maximum length of a block (in bytes).
**/
blockLength: FrameSystemLimitsBlockLength & AugmentedConst<ApiType>;
/**
* Block & extrinsics weights: base values and limits.
**/
blockWeights: FrameSystemLimitsBlockWeights & AugmentedConst<ApiType>;
/**
* The weight of runtime database operations the runtime can invoke.
**/
dbWeight: FrameSupportWeightsRuntimeDbWeight & AugmentedConst<ApiType>;
/**
* The designated SS85 prefix of this chain.
*
* This replaces the "ss58Format" property declared in the chain spec. Reason is
* that the runtime should know about the prefix in order to make use of it as
* an identifier of the chain.
**/
ss58Prefix: u16 & AugmentedConst<ApiType>;
/**
* Get the chain's current version.
**/
version: SpVersionRuntimeVersion & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
timestamp: {
/**
* The minimum period between blocks. Beware that this is different to the *expected*
* period that the block production apparatus provides. Your chosen consensus system will
* generally work with this to determine a sensible block time. e.g. For Aura, it will be
* double this period on default settings.
**/
minimumPeriod: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
tips: {
/**
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: u128 & AugmentedConst<ApiType>;
/**
* Maximum acceptable reason length.
*
* Benchmarks depend on this value, be sure to update weights file when changing this value
**/
maximumReasonLength: u32 & AugmentedConst<ApiType>;
/**
* The period for which a tip remains open after is has achieved threshold tippers.
**/
tipCountdown: u32 & AugmentedConst<ApiType>;
/**
* The percent of the final tip which goes to the original reporter of the tip.
**/
tipFindersFee: Percent & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a tip report.
**/
tipReportDepositBase: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
transactionPayment: {
/**
* A fee mulitplier for `Operational` extrinsics to compute "virtual tip" to boost their
* `priority`
*
* This value is multipled by the `final_fee` to obtain a "virtual tip" that is later
* added to a tip component in regular `priority` calculations.
* It means that a `Normal` transaction can front-run a similarly-sized `Operational`
* extrinsic (with no tip), by including a tip value greater than the virtual tip.
*
* ```rust,ignore
* // For `Normal`
* let priority = priority_calc(tip);
*
* // For `Operational`
* let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;
* let priority = priority_calc(tip + virtual_tip);
* ```
*
* Note that since we use `final_fee` the multiplier applies also to the regular `tip`
* sent with the transaction. So, not only does the transaction get a priority bump based
* on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`
* transactions.
**/
operationalFeeMultiplier: u8 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
treasury: {
/**
* Percentage of spare funds (if any) that are burnt per spend period.
**/
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
* The treasury's pallet id, used for deriving its sovereign account ID.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Fraction of a proposal's value that should be bonded in order to place the proposal.
* An accepted proposal gets these back. A rejected proposal does not.
**/
proposalBond: Permill & AugmentedConst<ApiType>;
/**
* Maximum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMaximum: Option<u128> & AugmentedConst<ApiType>;
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMinimum: u128 & AugmentedConst<ApiType>;
/**
* Period between successive spends.
**/
spendPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
utility: {
/**
* The limit on the number of batched calls.
**/
batchedCallsLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
vesting: {
maxVestingSchedules: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount transferred to call `vested_transfer`.
**/
minVestedTransfer: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
voterList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
} // AugmentedConsts
} // declare module
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,10 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '../base';
import './consts';
import './errors';
import './events';
import './query';
import './registry';
import './tx';
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,5 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types-augment/registry/substrate';
import '@polkadot/types-augment/registry/polkadot';
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,11 +1,152 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api/types';
import type { ApiTypes } from '@polkadot/api-base/types';
declare module '@polkadot/api/types/errors' {
export interface AugmentedErrors<ApiType> {
declare module '@polkadot/api-base/types/errors' {
export interface AugmentedErrors<ApiType extends ApiTypes> {
alliance: {
/**
* Account has been deemed unscrupulous by the Alliance and is not welcome to join or be
* nominated.
**/
AccountNonGrata: AugmentedError<ApiType>;
/**
* Account is already an elevated (fellow) member.
**/
AlreadyElevated: AugmentedError<ApiType>;
/**
* Account is already a member.
**/
AlreadyMember: AugmentedError<ApiType>;
/**
* Item is already listed as unscrupulous.
**/
AlreadyUnscrupulous: AugmentedError<ApiType>;
/**
* Balance is insufficient for the required deposit.
**/
InsufficientFunds: AugmentedError<ApiType>;
/**
* The founders/fellows/allies have already been initialized.
**/
MembersAlreadyInitialized: AugmentedError<ApiType>;
/**
* The announcement is not found.
**/
MissingAnnouncement: AugmentedError<ApiType>;
/**
* The proposal hash is not found.
**/
MissingProposalHash: AugmentedError<ApiType>;
/**
* Account is not an ally.
**/
NotAlly: AugmentedError<ApiType>;
/**
* Account is not a founder.
**/
NotFounder: AugmentedError<ApiType>;
/**
* Item has not been deemed unscrupulous.
**/
NotListedAsUnscrupulous: AugmentedError<ApiType>;
/**
* Account is not a member.
**/
NotMember: AugmentedError<ApiType>;
/**
* The proposal is not vetoable.
**/
NotVetoableProposal: AugmentedError<ApiType>;
/**
* Account does not have voting rights.
**/
NoVotingRights: AugmentedError<ApiType>;
/**
* Length of website URL exceeds `MaxWebsiteUrlLength`.
**/
TooLongWebsiteUrl: AugmentedError<ApiType>;
/**
* Number of announcements exceeds `MaxAnnouncementsCount`.
**/
TooManyAnnouncements: AugmentedError<ApiType>;
/**
* Number of members exceeds `MaxMembersCount`.
**/
TooManyMembers: AugmentedError<ApiType>;
/**
* The number of unscrupulous items exceeds `MaxUnscrupulousItems`.
**/
TooManyUnscrupulousItems: AugmentedError<ApiType>;
/**
* This member is up for being kicked from the Alliance and cannot perform this operation.
**/
UpForKicking: AugmentedError<ApiType>;
/**
* The account's identity has no good judgement.
**/
WithoutGoodIdentityJudgement: AugmentedError<ApiType>;
/**
* The account's identity does not have display field and website field.
**/
WithoutIdentityDisplayAndWebsite: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
allianceMotion: {
/**
* Members are already initialized!
**/
AlreadyInitialized: AugmentedError<ApiType>;
/**
* Duplicate proposals not allowed
**/
DuplicateProposal: AugmentedError<ApiType>;
/**
* Duplicate vote ignored
**/
DuplicateVote: AugmentedError<ApiType>;
/**
* Account is not a member
**/
NotMember: AugmentedError<ApiType>;
/**
* Proposal must exist
**/
ProposalMissing: AugmentedError<ApiType>;
/**
* The close call was made too early, before the end of the voting.
**/
TooEarly: AugmentedError<ApiType>;
/**
* There can only be a maximum of `MaxProposals` active proposals.
**/
TooManyProposals: AugmentedError<ApiType>;
/**
* Mismatched index
**/
WrongIndex: AugmentedError<ApiType>;
/**
* The given length bound for the proposal was too low.
**/
WrongProposalLength: AugmentedError<ApiType>;
/**
* The given weight bound for the proposal was too low.
**/
WrongProposalWeight: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
assets: {
/**
* The asset-account already exists.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
* Invalid metadata given.
**/
@@ -18,10 +159,6 @@ declare module '@polkadot/api/types/errors' {
* Account balance must be greater than or equal to the transfer amount.
**/
BalanceLow: AugmentedError<ApiType>;
/**
* Balance should be non-zero.
**/
BalanceZero: AugmentedError<ApiType>;
/**
* The origin account is frozen.
**/
@@ -34,13 +171,22 @@ declare module '@polkadot/api/types/errors' {
* Minimum balance should be non-zero.
**/
MinBalanceZero: AugmentedError<ApiType>;
/**
* The account to alter does not exist.
**/
NoAccount: AugmentedError<ApiType>;
/**
* The asset-account doesn't have an associated deposit.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* No provider reference exists to allow a non-zero balance of a non-self-sufficient
* asset.
* Unable to increment the consumer reference counters on the account. Either no provider
* reference exists to allow a non-zero balance of a non-self-sufficient asset, or the
* maximum number of consumers has been reached.
**/
NoProvider: AugmentedError<ApiType>;
/**
@@ -51,6 +197,10 @@ declare module '@polkadot/api/types/errors' {
* The given asset ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
/**
* The operation would result in funds being burned.
**/
WouldBurn: AugmentedError<ApiType>;
/**
* The source account would not survive the transfer and it needs to stay alive.
**/
@@ -99,6 +249,10 @@ declare module '@polkadot/api/types/errors' {
* A given equivocation report is valid but already previously reported.
**/
DuplicateOffenceReport: AugmentedError<ApiType>;
/**
* Submitted configuration is invalid.
**/
InvalidConfiguration: AugmentedError<ApiType>;
/**
* An equivocation proof provided as part of an equivocation report is invalid.
**/
@@ -112,6 +266,16 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
bagsList: {
/**
* A error in the list interface implementation.
**/
List: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
balances: {
/**
* Beneficiary account must pre-exist
@@ -151,6 +315,10 @@ declare module '@polkadot/api/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
bounties: {
/**
* The bounty cannot be closed because it has active child bounties.
**/
HasActiveChildBounty: AugmentedError<ApiType>;
/**
* Proposer's balance is too low.
**/
@@ -184,6 +352,10 @@ declare module '@polkadot/api/types/errors' {
* Require bounty curator.
**/
RequireCurator: AugmentedError<ApiType>;
/**
* Too many approvals are already queued.
**/
TooManyQueued: AugmentedError<ApiType>;
/**
* The bounty status is unexpected.
**/
@@ -193,17 +365,39 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
childBounties: {
/**
* The bounty balance is not enough to add new child-bounty.
**/
InsufficientBountyBalance: AugmentedError<ApiType>;
/**
* The parent bounty is not in active state.
**/
ParentBountyNotActive: AugmentedError<ApiType>;
/**
* Number of child bounties exceeds limit `MaxActiveChildBountyCount`.
**/
TooManyChildBounties: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
contracts: {
/**
* Performing the requested transfer would have brought the contract below
* the subsistence threshold. No transfer is allowed to do this. Use `seal_terminate`
* to recover a deposit.
* Code removal was denied because the code is still in use by at least one contract.
**/
BelowSubsistenceThreshold: AugmentedError<ApiType>;
CodeInUse: AugmentedError<ApiType>;
/**
* No code could be found at the supplied code hash.
**/
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.
@@ -213,6 +407,13 @@ declare module '@polkadot/api/types/errors' {
* No contract was found at the specified address.
**/
ContractNotFound: AugmentedError<ApiType>;
/**
* The contract ran to completion but decided to revert its storage changes.
* Please note that this error is only returned from extrinsics. When called directly
* or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags
* to determine whether a reversion has taken place.
**/
ContractReverted: AugmentedError<ApiType>;
/**
* Contract trapped during execution.
**/
@@ -245,6 +446,10 @@ declare module '@polkadot/api/types/errors' {
* `seal_call` forwarded this contracts input. It therefore is no longer available.
**/
InputForwarded: AugmentedError<ApiType>;
/**
* Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`.
**/
InvalidCallFlags: AugmentedError<ApiType>;
/**
* A new schedule must have a greater version than the current one.
**/
@@ -254,11 +459,6 @@ declare module '@polkadot/api/types/errors' {
* of what is specified in the schedule.
**/
MaxCallDepthReached: AugmentedError<ApiType>;
/**
* The newly created contract is below the subsistence threshold after executing
* its contructor. No contracts are allowed to exist below that threshold.
**/
NewContractNotFunded: AugmentedError<ApiType>;
/**
* The chain does not provide a chain extension. Calling the chain extension results
* in this error. Note that this usually shouldn't happen as deploying such contracts
@@ -286,12 +486,13 @@ declare module '@polkadot/api/types/errors' {
**/
ReentranceDenied: AugmentedError<ApiType>;
/**
* A storage modification exhausted the 32bit type that holds the storage size.
*
* This can either happen when the accumulated storage in bytes is too large or
* when number of storage items is too large.
* More storage was created than allowed by the storage deposit limit.
**/
StorageExhausted: AugmentedError<ApiType>;
StorageDepositLimitExhausted: AugmentedError<ApiType>;
/**
* Origin doesn't have enough balance to pay the required storage deposits.
**/
StorageDepositNotEnoughFunds: AugmentedError<ApiType>;
/**
* A contract self destructed in its constructor.
*
@@ -308,9 +509,8 @@ declare module '@polkadot/api/types/errors' {
**/
TooManyTopics: AugmentedError<ApiType>;
/**
* Performing the requested transfer failed for a reason originating in the
* chosen currency implementation of the runtime. Most probably the balance is
* too low or locks are placed on it.
* Performing the requested transfer failed. Probably because there isn't enough
* free balance in the sender's account.
**/
TransferFailed: AugmentedError<ApiType>;
/**
@@ -322,6 +522,61 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
convictionVoting: {
/**
* The account is already delegating.
**/
AlreadyDelegating: AugmentedError<ApiType>;
/**
* The account currently has votes attached to it and the operation cannot succeed until
* these are removed, either through `unvote` or `reap_vote`.
**/
AlreadyVoting: AugmentedError<ApiType>;
/**
* The class ID supplied is invalid.
**/
BadClass: AugmentedError<ApiType>;
/**
* The class must be supplied since it is not easily determinable from the state.
**/
ClassNeeded: AugmentedError<ApiType>;
/**
* Too high a balance was provided that the account cannot afford.
**/
InsufficientFunds: AugmentedError<ApiType>;
/**
* Maximum number of votes reached.
**/
MaxVotesReached: AugmentedError<ApiType>;
/**
* Delegation to oneself makes no sense.
**/
Nonsense: AugmentedError<ApiType>;
/**
* The actor has no permission to conduct the action.
**/
NoPermission: AugmentedError<ApiType>;
/**
* The actor has no permission to conduct the action right now but will do in the future.
**/
NoPermissionYet: AugmentedError<ApiType>;
/**
* The account is not currently delegating.
**/
NotDelegating: AugmentedError<ApiType>;
/**
* Poll is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* The given account did not vote on the poll.
**/
NotVoter: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
council: {
/**
* Members are already initialized!
@@ -492,6 +747,10 @@ declare module '@polkadot/api/types/errors' {
* The call is not allowed at this point.
**/
CallNotAllowed: AugmentedError<ApiType>;
/**
* The fallback failed
**/
FallbackFailed: AugmentedError<ApiType>;
/**
* `Self::insert_submission` returned an invalid index.
**/
@@ -892,6 +1151,139 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
nominationPools: {
/**
* An account is already delegating in another pool. An account may only belong to one
* pool at a time.
**/
AccountBelongsToOtherPool: AugmentedError<ApiType>;
/**
* The pools state cannot be changed.
**/
CanNotChangeState: AugmentedError<ApiType>;
/**
* None of the funds can be withdrawn yet because the bonding duration has not passed.
**/
CannotWithdrawAny: AugmentedError<ApiType>;
/**
* Some error occurred that should never happen. This should be reported to the
* maintainers.
**/
Defensive: AugmentedError<ApiType>;
/**
* The caller does not have adequate permissions.
**/
DoesNotHavePermission: AugmentedError<ApiType>;
/**
* The member is fully unbonded (and thus cannot access the bonded and reward pool
* anymore to, for example, collect rewards).
**/
FullyUnbonding: AugmentedError<ApiType>;
/**
* Too many members in the pool or system.
**/
MaxPoolMembers: AugmentedError<ApiType>;
/**
* The system is maxed out on pools.
**/
MaxPools: AugmentedError<ApiType>;
/**
* The member cannot unbond further chunks due to reaching the limit.
**/
MaxUnbondingLimit: AugmentedError<ApiType>;
/**
* Metadata exceeds [`Config::MaxMetadataLen`]
**/
MetadataExceedsMaxLen: AugmentedError<ApiType>;
/**
* The amount does not meet the minimum bond to either join or create a pool.
**/
MinimumBondNotMet: AugmentedError<ApiType>;
/**
* A pool must be in [`PoolState::Destroying`] in order for the depositor to unbond or for
* other members to be permissionlessly unbonded.
**/
NotDestroying: AugmentedError<ApiType>;
/**
* Not enough points. Ty unbonding less.
**/
NotEnoughPointsToUnbond: AugmentedError<ApiType>;
/**
* Either a) the caller cannot make a valid kick or b) the pool is not destroying.
**/
NotKickerOrDestroying: AugmentedError<ApiType>;
/**
* The caller does not have nominating permissions for the pool.
**/
NotNominator: AugmentedError<ApiType>;
/**
* The depositor must be the only member in the bonded pool in order to unbond. And the
* depositor must be the only member in the sub pools in order to withdraw unbonded.
**/
NotOnlyPoolMember: AugmentedError<ApiType>;
/**
* The pool is not open to join
**/
NotOpen: AugmentedError<ApiType>;
/**
* The transaction could not be executed due to overflow risk for the pool.
**/
OverflowRisk: AugmentedError<ApiType>;
/**
* Partial unbonding now allowed permissionlessly.
**/
PartialUnbondNotAllowedPermissionlessly: AugmentedError<ApiType>;
/**
* An account is not a member.
**/
PoolMemberNotFound: AugmentedError<ApiType>;
/**
* A (bonded) pool id does not exist.
**/
PoolNotFound: AugmentedError<ApiType>;
/**
* A reward pool does not exist. In all cases this is a system logic error.
**/
RewardPoolNotFound: AugmentedError<ApiType>;
/**
* A sub pool does not exist.
**/
SubPoolsNotFound: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
preimage: {
/**
* Preimage has already been noted on-chain.
**/
AlreadyNoted: AugmentedError<ApiType>;
/**
* The user is not authorized to perform this action.
**/
NotAuthorized: AugmentedError<ApiType>;
/**
* The preimage cannot be removed since it has not yet been noted.
**/
NotNoted: AugmentedError<ApiType>;
/**
* The preimage request cannot be removed since no outstanding requests exist.
**/
NotRequested: AugmentedError<ApiType>;
/**
* A preimage may not be removed when there are outstanding requests.
**/
Requested: AugmentedError<ApiType>;
/**
* Preimage is too large to store on-chain.
**/
TooLarge: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
proxy: {
/**
* Account is already a proxy.
@@ -930,6 +1322,98 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
rankedCollective: {
/**
* Account is already a member.
**/
AlreadyMember: AugmentedError<ApiType>;
/**
* Unexpected error in state.
**/
Corruption: AugmentedError<ApiType>;
/**
* The information provided is incorrect.
**/
InvalidWitness: AugmentedError<ApiType>;
/**
* There are no further records to be removed.
**/
NoneRemaining: AugmentedError<ApiType>;
/**
* The origin is not sufficiently privileged to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* Account is not a member.
**/
NotMember: AugmentedError<ApiType>;
/**
* The given poll index is unknown or has closed.
**/
NotPolling: AugmentedError<ApiType>;
/**
* The given poll is still ongoing.
**/
Ongoing: AugmentedError<ApiType>;
/**
* The member's rank is too low to vote.
**/
RankTooLow: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
rankedPolls: {
/**
* The referendum index provided is invalid in this context.
**/
BadReferendum: AugmentedError<ApiType>;
/**
* The track identifier given was invalid.
**/
BadTrack: AugmentedError<ApiType>;
/**
* There are already a full complement of referendums in progress for this track.
**/
Full: AugmentedError<ApiType>;
/**
* Referendum's decision deposit is already paid.
**/
HasDeposit: AugmentedError<ApiType>;
/**
* The deposit cannot be refunded since none was made.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The deposit refunder is not the depositor.
**/
NoPermission: AugmentedError<ApiType>;
/**
* There was nothing to do in the advancement.
**/
NothingToDo: AugmentedError<ApiType>;
/**
* Referendum is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* No track exists for the proposal origin.
**/
NoTrack: AugmentedError<ApiType>;
/**
* The queue of the track is empty.
**/
QueueEmpty: AugmentedError<ApiType>;
/**
* Any deposit cannot be refunded until after the decision is over.
**/
Unfinished: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
recovery: {
/**
* This account is already set up for recovery
@@ -1000,6 +1484,70 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
referenda: {
/**
* The referendum index provided is invalid in this context.
**/
BadReferendum: AugmentedError<ApiType>;
/**
* The track identifier given was invalid.
**/
BadTrack: AugmentedError<ApiType>;
/**
* There are already a full complement of referendums in progress for this track.
**/
Full: AugmentedError<ApiType>;
/**
* Referendum's decision deposit is already paid.
**/
HasDeposit: AugmentedError<ApiType>;
/**
* The deposit cannot be refunded since none was made.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The deposit refunder is not the depositor.
**/
NoPermission: AugmentedError<ApiType>;
/**
* There was nothing to do in the advancement.
**/
NothingToDo: AugmentedError<ApiType>;
/**
* Referendum is not ongoing.
**/
NotOngoing: AugmentedError<ApiType>;
/**
* No track exists for the proposal origin.
**/
NoTrack: AugmentedError<ApiType>;
/**
* The queue of the track is empty.
**/
QueueEmpty: AugmentedError<ApiType>;
/**
* Any deposit cannot be refunded until after the decision is over.
**/
Unfinished: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
remark: {
/**
* Attempted to call `store` outside of block execution.
**/
BadContext: AugmentedError<ApiType>;
/**
* Attempting to store empty data.
**/
Empty: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
scheduler: {
/**
* Failed to schedule a call
@@ -1151,6 +1699,10 @@ declare module '@polkadot/api/types/errors' {
* The user has enough bond and thus cannot be chilled forcefully by an external person.
**/
CannotChillOther: AugmentedError<ApiType>;
/**
* Commission is too low. Must be at least `MinCommission`.
**/
CommissionTooLow: AugmentedError<ApiType>;
/**
* Duplicate index.
**/
@@ -1172,7 +1724,9 @@ declare module '@polkadot/api/types/errors' {
**/
IncorrectSlashingSpans: AugmentedError<ApiType>;
/**
* Can not bond with value less than minimum required.
* Cannot have a validator or nominator role, with value less than the minimum defined by
* governance (see `MinValidatorBond` and `MinNominatorBond`). If unbonding is the
* intention, `chill` first to remove one's role as validator/nominator.
**/
InsufficientBond: AugmentedError<ApiType>;
/**
@@ -1226,6 +1780,42 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
stateTrieMigration: {
/**
* bad witness data provided.
**/
BadWitness: AugmentedError<ApiType>;
/**
* A key was longer than the configured maximum.
*
* This means that the migration halted at the current [`Progress`] and
* can be resumed with a larger [`crate::Config::MaxKeyLen`] value.
* Retrying with the same [`crate::Config::MaxKeyLen`] value will not work.
* The value should only be increased to avoid a storage migration for the currently
* stored [`crate::Progress::LastKey`].
**/
KeyTooLong: AugmentedError<ApiType>;
/**
* max signed limits not respected.
**/
MaxSignedLimits: AugmentedError<ApiType>;
/**
* submitter does not have enough funds.
**/
NotEnoughFunds: AugmentedError<ApiType>;
/**
* Signed migration is not allowed because the maximum limit is not set yet.
**/
SignedMigrationNotAllowed: AugmentedError<ApiType>;
/**
* upper bound of size is exceeded,
**/
SizeUpperBoundExceeded: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
sudo: {
/**
* Sender must be the Sudo account
@@ -1325,6 +1915,10 @@ declare module '@polkadot/api/types/errors' {
* Not a member.
**/
NotMember: AugmentedError<ApiType>;
/**
* Too many members.
**/
TooManyMembers: AugmentedError<ApiType>;
/**
* Generic error
**/
@@ -1419,6 +2013,11 @@ declare module '@polkadot/api/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
treasury: {
/**
* The spend origin is valid but the amount it is allowed to spend is lower than the
* amount to be spent.
**/
InsufficientPermission: AugmentedError<ApiType>;
/**
* Proposer's balance is too low.
**/
@@ -1427,6 +2026,10 @@ declare module '@polkadot/api/types/errors' {
* No proposal or bounty at that index.
**/
InvalidIndex: AugmentedError<ApiType>;
/**
* Proposal has not been approved.
**/
ProposalNotApproved: AugmentedError<ApiType>;
/**
* Too many approvals in the queue.
**/
@@ -1438,7 +2041,7 @@ declare module '@polkadot/api/types/errors' {
};
uniques: {
/**
* The asset instance ID has already been used for an asset.
* The item ID has already been used for an item.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
@@ -1446,13 +2049,29 @@ declare module '@polkadot/api/types/errors' {
**/
BadWitness: AugmentedError<ApiType>;
/**
* The asset instance or class is frozen.
* The item or collection is frozen.
**/
Frozen: AugmentedError<ApiType>;
/**
* The asset ID is already taken.
* The item ID is already taken.
**/
InUse: AugmentedError<ApiType>;
/**
* The item is locked.
**/
Locked: AugmentedError<ApiType>;
/**
* The max supply has already been set.
**/
MaxSupplyAlreadySet: AugmentedError<ApiType>;
/**
* All items have been minted.
**/
MaxSupplyReached: AugmentedError<ApiType>;
/**
* The provided max supply is less to the amount of items a collection already has.
**/
MaxSupplyTooSmall: AugmentedError<ApiType>;
/**
* There is no delegate approved.
**/
@@ -1461,14 +2080,18 @@ declare module '@polkadot/api/types/errors' {
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* The named owner has not signed ownership of the collection is acceptable.
**/
Unaccepted: AugmentedError<ApiType>;
/**
* No approval exists that would allow the transfer.
**/
Unapproved: AugmentedError<ApiType>;
/**
* The given asset ID is unknown.
* The given item ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
UnknownCollection: AugmentedError<ApiType>;
/**
* The delegate turned out to be different to what was expected.
**/
@@ -1519,9 +2142,31 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
}
export interface DecoratedErrors<ApiType extends ApiTypes> extends AugmentedErrors<ApiType> {
[key: string]: ModuleErrors<ApiType>;
}
}
whitelist: {
/**
* The call was already whitelisted; No-Op.
**/
CallAlreadyWhitelisted: AugmentedError<ApiType>;
/**
* The call was not whitelisted.
**/
CallIsNotWhitelisted: AugmentedError<ApiType>;
/**
* The weight of the decoded call was higher than the witness.
**/
InvalidCallWeightWitness: AugmentedError<ApiType>;
/**
* The preimage of the call hash could not be loaded.
**/
UnavailablePreImage: AugmentedError<ApiType>;
/**
* The call could not be decoded.
**/
UndecodableCall: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
} // AugmentedErrors
} // declare module
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,10 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '../base';
import './consts';
import './errors';
import './events';
import './query';
import './registry';
import './tx';
@@ -1,19 +1,90 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api/types';
import type { BTreeMap, Bytes, Data, Null, Option, U8aFixed, Vec, WrapperOpaque, bool, u128, u32, u64, u8 } from '@polkadot/types';
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Data } from '@polkadot/types';
import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, WrapperOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { AnyNumber, ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, Call, H256, Perbill, Percent } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAssetsApproval, PalletAssetsAssetBalance, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmPrefabWasmModule, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesClassDetails, PalletUniquesClassMetadata, PalletUniquesInstanceDetails, PalletUniquesInstanceMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpCoreCryptoKeyTypeId, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
import type { FrameSupportWeightsPerDispatchClassU64, FrameSystemAccountInfo, FrameSystemEventRecord, FrameSystemLastRuntimeUpgradeInfo, FrameSystemPhase, NodeRuntimeSessionKeys, PalletAllianceCid, PalletAllianceMemberRole, PalletAssetsApproval, PalletAssetsAssetAccount, PalletAssetsAssetDetails, PalletAssetsAssetMetadata, PalletAuthorshipUncleEntryItem, PalletBagsListListBag, PalletBagsListListNode, PalletBalancesAccountData, PalletBalancesBalanceLock, PalletBalancesReleases, PalletBalancesReserveData, PalletBountiesBounty, PalletChildBountiesChildBounty, PalletCollectiveVotes, PalletContractsStorageDeletedContract, PalletContractsStorageRawContractInfo, PalletContractsWasmOwnerInfo, PalletContractsWasmPrefabWasmModule, PalletConvictionVotingVoteVoting, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletElectionProviderMultiPhasePhase, PalletElectionProviderMultiPhaseReadySolution, PalletElectionProviderMultiPhaseRoundSnapshot, PalletElectionProviderMultiPhaseSignedSignedSubmission, PalletElectionProviderMultiPhaseSolutionOrSnapshotSize, PalletElectionsPhragmenSeatHolder, PalletElectionsPhragmenVoter, PalletGiltActiveGilt, PalletGiltActiveGiltsTotal, PalletGiltGiltBid, PalletGrandpaStoredPendingChange, PalletGrandpaStoredState, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletImOnlineBoundedOpaqueNetworkState, PalletImOnlineSr25519AppSr25519Public, PalletLotteryLotteryConfig, PalletMultisigMultisig, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool, PalletNominationPoolsSubPools, PalletPreimageRequestStatus, PalletProxyAnnouncement, PalletProxyProxyDefinition, PalletRankedCollectiveMemberRecord, PalletRankedCollectiveVoteRecord, PalletRecoveryActiveRecovery, PalletRecoveryRecoveryConfig, PalletReferendaReferendumInfoConvictionVotingTally, PalletReferendaReferendumInfoRankedCollectiveTally, PalletSchedulerScheduledV3, PalletSocietyBid, PalletSocietyBidKind, PalletSocietyVote, PalletSocietyVouchingStatus, PalletStakingActiveEraInfo, PalletStakingEraRewardPoints, PalletStakingExposure, PalletStakingForcing, PalletStakingNominations, PalletStakingReleases, PalletStakingRewardDestination, PalletStakingSlashingSlashingSpans, PalletStakingSlashingSpanRecord, PalletStakingStakingLedger, PalletStakingUnappliedSlash, PalletStakingValidatorPrefs, PalletStateTrieMigrationMigrationLimits, PalletStateTrieMigrationMigrationTask, PalletTipsOpenTip, PalletTransactionPaymentReleases, PalletTransactionStorageTransactionInfo, PalletTreasuryProposal, PalletUniquesCollectionDetails, PalletUniquesCollectionMetadata, PalletUniquesItemDetails, PalletUniquesItemMetadata, PalletVestingReleases, PalletVestingVestingInfo, SpAuthorityDiscoveryAppPublic, SpConsensusBabeAppPublic, SpConsensusBabeBabeEpochConfiguration, SpConsensusBabeDigestsNextConfigDescriptor, SpConsensusBabeDigestsPreDigest, SpCoreCryptoKeyTypeId, SpNposElectionsElectionScore, SpRuntimeDigest, SpStakingOffenceOffenceDetails } from '@polkadot/types/lookup';
import type { Observable } from '@polkadot/types/types';
declare module '@polkadot/api/types/storage' {
export interface AugmentedQueries<ApiType> {
declare module '@polkadot/api-base/types/storage' {
export interface AugmentedQueries<ApiType extends ApiTypes> {
alliance: {
/**
* The current IPFS CIDs of any announcements.
**/
announcements: AugmentedQuery<ApiType, () => Observable<Vec<PalletAllianceCid>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maps members to their candidacy deposit.
**/
depositOf: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u128>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Maps member type to members of each type.
**/
members: AugmentedQuery<ApiType, (arg: PalletAllianceMemberRole | 'Founder' | 'Fellow' | 'Ally' | number | Uint8Array) => Observable<Vec<AccountId32>>, [PalletAllianceMemberRole]> & QueryableStorageEntry<ApiType, [PalletAllianceMemberRole]>;
/**
* The IPFS CID of the alliance rule.
* Founders and fellows can propose a new rule with a super-majority.
*
* Any founder has a special one-vote veto right to the rule setting.
**/
rule: AugmentedQuery<ApiType, () => Observable<Option<PalletAllianceCid>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current list of accounts deemed unscrupulous. These accounts non grata cannot submit
* candidacy.
**/
unscrupulousAccounts: AugmentedQuery<ApiType, () => Observable<Vec<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current list of websites deemed unscrupulous.
**/
unscrupulousWebsites: AugmentedQuery<ApiType, () => Observable<Vec<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A set of members that are (potentially) being kicked out. They cannot retire until the
* motion is settled.
**/
upForKicking: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<bool>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
allianceMotion: {
/**
* The current members of the collective. This is stored sorted (just by value).
**/
members: AugmentedQuery<ApiType, () => Observable<Vec<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The prime member that helps determine the default vote behavior in case of absentations.
**/
prime: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Proposals so far.
**/
proposalCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Actual proposal for a given hash, if it's current.
**/
proposalOf: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Call>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* The hashes of the active proposals.
**/
proposals: AugmentedQuery<ApiType, () => Observable<Vec<H256>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Votes on a given proposal, if it is ongoing.
**/
voting: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletCollectiveVotes>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
assets: {
/**
* The number of units of assets held by any given account.
* The holdings of a specific account for a specific asset.
**/
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<PalletAssetsAssetBalance>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
account: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<PalletAssetsAssetAccount>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
/**
* Approved balance transfers. First balance is the amount approved for transfer. Second
* is the amount of `T::Currency` reserved for storing this.
@@ -74,7 +145,7 @@ declare module '@polkadot/api/types/storage' {
* This field should always be populated during block processing unless
* secondary plain slots are enabled (which don't contain a VRF output).
*
* It is set in `on_initialize`, before it will contain the value from the last block.
* It is set in `on_finalize`, before it will contain the value from the last block.
**/
authorVrfRandomness: AugmentedQuery<ApiType, () => Observable<Option<U8aFixed>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -107,7 +178,7 @@ declare module '@polkadot/api/types/storage' {
* Temporary value (cleared at block finalization) which is `Some`
* if per-block initialization has already been called for current block.
**/
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<U8aFixed>>>, []> & QueryableStorageEntry<ApiType, []>;
initialized: AugmentedQuery<ApiType, () => Observable<Option<Option<SpConsensusBabeDigestsPreDigest>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* How late the current block is compared to its parent.
*
@@ -169,7 +240,7 @@ declare module '@polkadot/api/types/storage' {
};
bagsList: {
/**
* How many ids are registered.
* Counter for the related counted storage map
**/
counterForListNodes: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -191,8 +262,29 @@ declare module '@polkadot/api/types/storage' {
};
balances: {
/**
* The balance of an account.
* The Balances pallet example of storing the balance of an account.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
* }
* ```
*
* You can also store the balance of an account in the `System` pallet.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = System
* }
* ```
*
* But this comes with tradeoffs, storing account balances in the system pallet stores
* `frame_system` data alongside the account data contrary to storing account balances in the
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
* NOTE: This is only used in the case that this pallet is used to store balances.
**/
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
@@ -242,11 +334,34 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
contracts: {
childBounties: {
/**
* The subtrie counter.
* Child bounties that have been added.
**/
accountCounter: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
childBounties: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletChildBountiesChildBounty>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* Number of total child bounties.
**/
childBountyCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The description of each child-bounty.
**/
childBountyDescriptions: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The cumulative child-bounty curator fee for each parent bounty.
**/
childrenCuratorFees: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u128>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Number of child bounties per parent bounty.
* Map of parent bounty index to number of child bounties.
**/
parentChildBounties: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<u32>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
contracts: {
/**
* A mapping between an original code hash and instrumented wasm code, ready for execution.
**/
@@ -264,6 +379,35 @@ declare module '@polkadot/api/types/storage' {
* stored in said trie. Therefore this operation is performed lazily in `on_initialize`.
**/
deletionQueue: AugmentedQuery<ApiType, () => Observable<Vec<PalletContractsStorageDeletedContract>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* This is a **monotonic** counter incremented on contract instantiation.
*
* This is used in order to generate unique trie ids for contracts.
* The trie id of a new contract is calculated from hash(account_id, nonce).
* The nonce is required because otherwise the following sequence would lead to
* a possible collision of storage:
*
* 1. Create a new contract.
* 2. Terminate the contract.
* 3. Immediately recreate the contract with the same account_id.
*
* This is bad because the contents of a trie are deleted lazily and there might be
* storage of the old instantiation still in it when the new contract is created. Please
* note that we can't replace the counter by the block number because the sequence above
* can happen in the same block. We also can't keep the account counter in memory only
* because storage is the only way to communicate across different extrinsics in the
* same block.
*
* # Note
*
* Do not use it to determine the number of contracts. It won't be decremented if
* a contract is destroyed.
**/
nonce: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A mapping between an original code hash and its owner information.
**/
ownerInfoOf: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletContractsWasmOwnerInfo>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* A mapping from an original code hash to the original code, untouched by instrumentation.
**/
@@ -273,6 +417,23 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
convictionVoting: {
/**
* The voting classes which have a non-zero lock requirement and the lock amounts which they
* require. The actual amount locked on behalf of this pallet should always be the maximum of
* this list.
**/
classLocksFor: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Vec<ITuple<[u16, u128]>>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* All voting for a particular voter in a particular voting class. We store the balance for the
* number of votes that we have recorded.
**/
votingFor: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u16 | AnyNumber | Uint8Array) => Observable<PalletConvictionVotingVoteVoting>, [AccountId32, u16]> & QueryableStorageEntry<ApiType, [AccountId32, u16]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
council: {
/**
* The current members of the collective. This is stored sorted (just by value).
@@ -324,13 +485,6 @@ declare module '@polkadot/api/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
@@ -401,7 +555,7 @@ declare module '@polkadot/api/types/storage' {
*
* Can be set via `set_minimum_untrusted_score`.
**/
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<Vec<u128>>>, []> & QueryableStorageEntry<ApiType, []>;
minimumUntrustedScore: AugmentedQuery<ApiType, () => Observable<Option<SpNposElectionsElectionScore>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Current best solution, signed or unsigned, queued to be returned upon `elect`.
**/
@@ -423,7 +577,7 @@ declare module '@polkadot/api/types/storage' {
* can be quite large, so we're willing to pay the cost of multiple database accesses to access
* them one at a time instead of reading and decoding all of them at once.
**/
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<Vec<u128>, u32>>, []> & QueryableStorageEntry<ApiType, []>;
signedSubmissionIndices: AugmentedQuery<ApiType, () => Observable<BTreeMap<SpNposElectionsElectionScore, u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The next index to be assigned to an incoming signed submission.
*
@@ -445,7 +599,7 @@ declare module '@polkadot/api/types/storage' {
* Twox note: the key of the map is an auto-incrementing index which users cannot inspect or
* affect; we shouldn't need a cryptographically secure hasher.
**/
signedSubmissionsMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<PalletElectionProviderMultiPhaseSignedSignedSubmission>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
signedSubmissionsMap: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletElectionProviderMultiPhaseSignedSignedSubmission>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Snapshot data of the round.
*
@@ -690,7 +844,7 @@ declare module '@polkadot/api/types/storage' {
[key: string]: QueryableStorageEntry<ApiType>;
};
multisig: {
calls: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Option<ITuple<[Bytes, AccountId32, u128]>>>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
calls: AugmentedQuery<ApiType, (arg: U8aFixed | string | Uint8Array) => Observable<Option<ITuple<[WrapperKeepOpaque<Call>, AccountId32, u128]>>>, [U8aFixed]> & QueryableStorageEntry<ApiType, [U8aFixed]>;
/**
* The set of open multisig operations.
**/
@@ -700,6 +854,98 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
nominationPools: {
/**
* Storage for bonded pools.
**/
bondedPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsBondedPoolInner>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Counter for the related counted storage map
**/
counterForBondedPools: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Counter for the related counted storage map
**/
counterForMetadata: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Counter for the related counted storage map
**/
counterForPoolMembers: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Counter for the related counted storage map
**/
counterForReversePoolIdLookup: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Counter for the related counted storage map
**/
counterForRewardPools: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Counter for the related counted storage map
**/
counterForSubPoolsStorage: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Ever increasing number of all pools created so far.
**/
lastPoolId: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maximum number of members that can exist in the system. If `None`, then the count
* members are not bound on a system wide basis.
**/
maxPoolMembers: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maximum number of members that may belong to pool. If `None`, then the count of
* members is not bound on a per pool basis.
**/
maxPoolMembersPerPool: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Maximum number of nomination pools that can exist. If `None`, then an unbounded number of
* pools can exist.
**/
maxPools: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Metadata for the pool.
**/
metadata: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Bytes>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Minimum bond required to create a pool.
*
* This is the amount that the depositor must put as their initial stake in the pool, as an
* indication of "skin in the game".
*
* This is the value that will always exist in the staking ledger of the pool bonded account
* while all other accounts leave.
**/
minCreateBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Minimum amount to bond to join a pool.
**/
minJoinBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Active members.
**/
poolMembers: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletNominationPoolsPoolMember>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* A reverse lookup from the pool's account id to its id.
*
* This is only used for slashing. In all other instances, the pool id is used, and the
* accounts are deterministically derived from it.
**/
reversePoolIdLookup: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Reward pools. This is where there rewards for each pool accumulate. When a members payout
* is claimed, the balance comes out fo the reward pool. Keyed by the bonded pools account.
**/
rewardPools: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsRewardPool>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Groups of unbonding pools. Each group of unbonding pools belongs to a bonded pool,
* hence the name sub-pools. Keyed by the bonded pools account.
**/
subPoolsStorage: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletNominationPoolsSubPools>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
offences: {
/**
* A vector of reports of the same kind that happened at the same time slot.
@@ -723,6 +969,20 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
preimage: {
/**
* The preimages stored by this pallet.
**/
preimageFor: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Bytes>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* The request status of a given hash.
**/
statusFor: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<PalletPreimageRequestStatus>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
proxy: {
/**
* The announcements made by the proxy (key).
@@ -750,6 +1010,60 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
rankedCollective: {
/**
* The index of each ranks's member into the group of members who have at least that rank.
**/
idToIndex: AugmentedQuery<ApiType, (arg1: u16 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [u16, AccountId32]> & QueryableStorageEntry<ApiType, [u16, AccountId32]>;
/**
* The members in the collective by index. All indices in the range `0..MemberCount` will
* return `Some`, however a member's index is not guaranteed to remain unchanged over time.
**/
indexToId: AugmentedQuery<ApiType, (arg1: u16 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<AccountId32>>, [u16, u32]> & QueryableStorageEntry<ApiType, [u16, u32]>;
/**
* The number of members in the collective who have at least the rank according to the index
* of the vec.
**/
memberCount: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<u32>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
/**
* The current members of the collective.
**/
members: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletRankedCollectiveMemberRecord>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Votes on a given proposal, if it is ongoing.
**/
voting: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: AccountId32 | string | Uint8Array) => Observable<Option<PalletRankedCollectiveVoteRecord>>, [u32, AccountId32]> & QueryableStorageEntry<ApiType, [u32, AccountId32]>;
votingCleanup: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<Bytes>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
rankedPolls: {
/**
* The number of referenda being decided currently.
**/
decidingCount: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<u32>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
/**
* The next free referendum index, aka the number of referenda started so far.
**/
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Information concerning any given referendum.
**/
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfoRankedCollectiveTally>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
* conviction-weighted approvals.
*
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
**/
trackQueue: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u32]>>>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
recovery: {
/**
* Active recovery attempts.
@@ -773,21 +1087,40 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
referenda: {
/**
* The number of referenda being decided currently.
**/
decidingCount: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<u32>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
/**
* The next free referendum index, aka the number of referenda started so far.
**/
referendumCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Information concerning any given referendum.
**/
referendumInfoFor: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletReferendaReferendumInfoConvictionVotingTally>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* The sorted list of referenda ready to be decided but not yet being decided, ordered by
* conviction-weighted approvals.
*
* This should be empty if `DecidingCount` is less than `TrackInfo::max_deciding`.
**/
trackQueue: AugmentedQuery<ApiType, (arg: u16 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[u32, u128]>>>, [u16]> & QueryableStorageEntry<ApiType, [u16]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
scheduler: {
/**
* Items to be executed, indexed by the block number that they should be executed on.
**/
agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletSchedulerScheduledV2>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
agenda: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Option<PalletSchedulerScheduledV3>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Lookup from identity to the block number and index of the task.
**/
lookup: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<Option<ITuple<[u32, u32]>>>, [Bytes]> & QueryableStorageEntry<ApiType, [Bytes]>;
/**
* Storage version of the pallet.
*
* New networks start with last version.
**/
storageVersion: AugmentedQuery<ApiType, () => Observable<PalletSchedulerReleases>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -935,11 +1268,11 @@ declare module '@polkadot/api/types/storage' {
**/
chillThreshold: AugmentedQuery<ApiType, () => Observable<Option<Percent>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A tracker to keep count of the number of items in the `Nominators` map.
* Counter for the related counted storage map
**/
counterForNominators: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A tracker to keep count of the number of items in the `Validators` map.
* Counter for the related counted storage map
**/
counterForValidators: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -1049,6 +1382,12 @@ declare module '@polkadot/api/types/storage' {
* When this value is not set, no limits are enforced.
**/
maxValidatorsCount: AugmentedQuery<ApiType, () => Observable<Option<u32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The minimum amount of commission that validators can set.
*
* If set to `0`, no limit exists.
**/
minCommission: AugmentedQuery<ApiType, () => Observable<Perbill>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Minimum number of staking participants before emergency conditions are imposed.
**/
@@ -1062,9 +1401,22 @@ declare module '@polkadot/api/types/storage' {
**/
minValidatorBond: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The map from nominator stash key to the set of stash keys of all validators to nominate.
* The map from nominator stash key to their nomination preferences, namely the validators that
* they wish to support.
*
* When updating this storage item, you must also update the `CounterForNominators`.
* Note that the keys of this storage map might become non-decodable in case the
* [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators
* are still existent in storage, their key is correct and retrievable (i.e. `contains_key`
* indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable
* nominators will effectively not-exist, until they re-submit their preferences such that it
* is within the bounds of the newly set `Config::MaxNominations`.
*
* This implies that `::iter_keys().count()` and `::iter().count()` might return different
* values for this map. Moreover, the main `::count()` is aligned with the former, namely the
* number of keys that exist.
*
* Lastly, if any of the nominators become non-decodable, they can be chilled immediately via
* [`Call::chill_other`] dispatchable by anyone.
**/
nominators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<PalletStakingNominations>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
@@ -1119,8 +1471,6 @@ declare module '@polkadot/api/types/storage' {
validatorCount: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The map from (wannabe) validator stash key to the preferences of that validator.
*
* When updating this storage item, you must also update the `CounterForValidators`.
**/
validators: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletStakingValidatorPrefs>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
@@ -1133,11 +1483,36 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
stateTrieMigration: {
/**
* The limits that are imposed on automatic migrations.
*
* If set to None, then no automatic migration happens.
**/
autoLimits: AugmentedQuery<ApiType, () => Observable<Option<PalletStateTrieMigrationMigrationLimits>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Migration progress.
*
* This stores the snapshot of the last migrated keys. It can be set into motion and move
* forward by any of the means provided by this pallet.
**/
migrationProcess: AugmentedQuery<ApiType, () => Observable<PalletStateTrieMigrationMigrationTask>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The maximum limits that the signed migration could use.
*
* If not set, no signed submission is allowed.
**/
signedMigrationMaxLimits: AugmentedQuery<ApiType, () => Observable<Option<PalletStateTrieMigrationMigrationLimits>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
sudo: {
/**
* The `AccountId` of the sudo key.
**/
key: AugmentedQuery<ApiType, () => Observable<AccountId32>, []> & QueryableStorageEntry<ApiType, []>;
key: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -1171,8 +1546,11 @@ declare module '@polkadot/api/types/storage' {
/**
* Events deposited for the current block.
*
* NOTE: This storage item is explicitly unbounded since it is never intended to be read
* from within the runtime.
* NOTE: The item is unbound and should therefore never be read on chain.
* It could otherwise inflate the PoV size of a block.
*
* Events have a large in-memory size. Box the events to not go out-of-memory
* just in case someone still reads them from within the runtime.
**/
events: AugmentedQuery<ApiType, () => Observable<Vec<FrameSystemEventRecord>>, []> & QueryableStorageEntry<ApiType, []>;
/**
@@ -1369,30 +1747,43 @@ declare module '@polkadot/api/types/storage' {
};
uniques: {
/**
* The assets held by any given account; set out this way so that assets owned by a single
* The items held by any given account; set out this way so that items owned by a single
* account can be enumerated.
**/
account: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array, arg3: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32, u32]>;
/**
* The assets in existence and their ownership details.
* The items in existence and their ownership details.
**/
asset: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesInstanceDetails>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
asset: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesItemDetails>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* Metadata of an asset class.
* Attributes of a collection.
**/
attribute: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: Option<u32> | null | object | string | Uint8Array, arg3: Bytes | string | Uint8Array) => Observable<Option<ITuple<[Bytes, u128]>>>, [u32, Option<u32>, Bytes]> & QueryableStorageEntry<ApiType, [u32, Option<u32>, Bytes]>;
/**
* Details of an asset class.
* Details of a collection.
**/
class: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesClassDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
class: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesCollectionDetails>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Metadata of an asset class.
* The collections owned by any given account; set out this way so that collections owned by
* a single account can be enumerated.
**/
classMetadataOf: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesClassMetadata>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
classAccount: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<Null>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
/**
* Metadata of an asset instance.
* Metadata of a collection.
**/
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesInstanceMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
classMetadataOf: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesCollectionMetadata>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Keeps track of the number of items a collection might have.
**/
collectionMaxSupply: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Option<u32>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
/**
* Metadata of an item.
**/
instanceMetadataOf: AugmentedQuery<ApiType, (arg1: u32 | AnyNumber | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<Option<PalletUniquesItemMetadata>>, [u32, u32]> & QueryableStorageEntry<ApiType, [u32, u32]>;
/**
* The collection, if any, of which an account is willing to take ownership.
**/
ownershipAcceptance: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* Generic query
**/
@@ -1414,9 +1805,12 @@ declare module '@polkadot/api/types/storage' {
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
}
export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
[key: string]: QueryableModuleStorage<ApiType>;
}
}
whitelist: {
whitelistedCall: AugmentedQuery<ApiType, (arg: H256 | string | Uint8Array) => Observable<Option<Null>>, [H256]> & QueryableStorageEntry<ApiType, [H256]>;
/**
* Generic query
**/
[key: string]: QueryableStorageEntry<ApiType>;
};
} // AugmentedQueries
} // declare module
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-augment authors & contributors
// SPDX-License-Identifier: Apache-2.0
import '@polkadot/types-augment/registry/substrate';
File diff suppressed because it is too large Load Diff
+21
View File
@@ -0,0 +1,21 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/*.spec.ts",
"**/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" },
{ "path": "../types-support/tsconfig.build.json" }
]
}
+22
View File
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/kusama/*.ts"
],
"exclude": [
"**/kusama/*.spec.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" }
]
}
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src",
"emitDeclarationOnly": false,
"noEmit": true
},
"include": [
"**/kusama/*.spec.ts"
],
"references": [
{ "path": "../api-augment/tsconfig.build.json" },
{ "path": "../api-augment/tsconfig.kusama.json" },
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" },
{ "path": "../types-support/tsconfig.build.json" }
]
}
@@ -0,0 +1,22 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/polkadot/*.ts"
],
"exclude": [
"**/polkadot/*.spec.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" }
]
}
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+3
View File
@@ -0,0 +1,3 @@
# @polkadot/api-base
API Base interfaces
+32
View File
@@ -0,0 +1,32 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Interfaces for interacting with contracts and contract ABIs",
"engines": {
"node": ">=14.0.0"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-base#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-base",
"repository": {
"directory": "packages/api-base",
"type": "git",
"url": "https://github.com/polkadot-js/api.git"
},
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"type": "module",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.18.3",
"@polkadot/rpc-core": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/util": "^9.4.1",
"rxjs": "^7.5.5"
}
}
+4
View File
@@ -0,0 +1,4 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { packageInfo } from './packageInfo';
+7
View File
@@ -0,0 +1,7 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { packageInfo as rpcInfo } from '@polkadot/rpc-core/packageInfo';
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
export default [rpcInfo, typesInfo];
+11
View File
@@ -0,0 +1,11 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
import { detectPackage } from '@polkadot/util';
import others from './detectOther';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, null, others);
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import './detectPackage';
export * from './bundle';
+6
View File
@@ -0,0 +1,6 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-base', path: 'auto', type: 'auto', version: '8.8.2' };
+26
View File
@@ -0,0 +1,26 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { DecoratedRpc, QueryableConsts, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics } from '@polkadot/api-base/types';
import type { RpcInterface } from '@polkadot/rpc-core/types';
import type { Metadata } from '@polkadot/types';
import type { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import type { Registry, Signer } from '@polkadot/types/types';
// A smaller interface of ApiRx, used in derive and in SubmittableExtrinsic
export interface ApiInterfaceRx {
consts: QueryableConsts<'rxjs'>;
extrinsicType: number;
genesisHash?: Hash;
hasSubscriptions: boolean;
registry: Registry;
runtimeMetadata: Metadata;
runtimeVersion: RuntimeVersion;
query: QueryableStorage<'rxjs'>;
queryAt: (blockHash: Uint8Array | string, knownVersion?: RuntimeVersion) => Observable<QueryableStorage<'rxjs'>>;
queryMulti: QueryableStorageMulti<'rxjs'>;
rpc: DecoratedRpc<'rxjs', RpcInterface>;
tx: SubmittableExtrinsics<'rxjs'>;
signer?: Signer;
}
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
@@ -17,10 +17,15 @@ export type VoidFn = () => void;
export type UnsubscribePromise = Promise<VoidFn>;
// FIXME The day TS has higher-kinded types, we can remove this hardcoded stuff
export type PromiseOrObs<ApiType extends ApiTypes, T> = ApiType extends 'rxjs'
? Observable<T>
: Promise<T>;
export type PromiseOrObs<ApiType extends ApiTypes, T> =
ApiType extends 'rxjs'
? Observable<T>
: Promise<T>;
export type MethodResult<ApiType extends ApiTypes, F extends AnyFunction> =
ApiType extends 'rxjs'
? RxResult<F>
: PromiseResult<F>;
// Here are the return types of these parts of the api:
// - api.query.*.*: no exact typings
@@ -39,15 +44,9 @@ export interface PromiseResult<F extends AnyFunction> {
(...args: Parameters<F>): Promise<ObsInnerType<ReturnType<F>>>;
(...args: Push<Parameters<F>, Callback<ObsInnerType<ReturnType<F>>>>): UnsubscribePromise;
<T extends Codec | Codec[]>(...args: Parameters<F>): Promise<T>;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
<T extends Codec | Codec[]>(...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
}
// FIXME The day TS has higher-kinded types, we can remove this hardcoded stuff
export type MethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
? RxResult<F>
: PromiseResult<F>;
// In the abstract `decorateMethod` in Base.ts, we can also pass in some meta-
// information. This describes it.
export interface DecorateMethodOptions {
+25
View File
@@ -0,0 +1,25 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PalletConstantMetadataLatest } from '@polkadot/types/interfaces';
import type { Codec } from '@polkadot/types/types';
import type { ApiTypes } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedConsts<ApiType extends ApiTypes> {
// augmented
}
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: QueryableModuleConsts;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export interface AugmentedConst<ApiType extends ApiTypes> {
meta: PalletConstantMetadataLatest;
}
export interface QueryableModuleConsts {
[key: string]: Codec;
}
+8
View File
@@ -0,0 +1,8 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
type DeriveCreator = (instanceId: string, api: unknown) => (...args: unknown[]) => Observable<any>;
export type DeriveCustom = Record<string, Record<string, DeriveCreator>>;
+22
View File
@@ -0,0 +1,22 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { IsError } from '@polkadot/types/metadata/decorate/types';
import type { ApiTypes } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedErrors<ApiType extends ApiTypes> {
// augmented
}
export interface DecoratedErrors<ApiType extends ApiTypes> extends AugmentedErrors<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: ModuleErrors<ApiType>;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type AugmentedError<ApiType extends ApiTypes> = IsError;
export interface ModuleErrors<ApiType extends ApiTypes> {
[key: string]: AugmentedError<ApiType>;
}
+23
View File
@@ -0,0 +1,23 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { IsEvent } from '@polkadot/types/metadata/decorate/types';
import type { AnyTuple } from '@polkadot/types/types';
import type { ApiTypes } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedEvents<ApiType extends ApiTypes> {
// augmented
}
export interface DecoratedEvents<ApiType extends ApiTypes> extends AugmentedEvents<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: ModuleEvents<ApiType>;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type AugmentedEvent<ApiType extends ApiTypes, T extends AnyTuple = AnyTuple, N = unknown> = IsEvent<T, N>;
export interface ModuleEvents<ApiType extends ApiTypes> {
[key: string]: AugmentedEvent<ApiType>;
}
+15
View File
@@ -0,0 +1,15 @@
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// These are augmented, do an augmentation export
export * from '@polkadot/api-base/types/consts';
export * from '@polkadot/api-base/types/errors';
export * from '@polkadot/api-base/types/events';
export * from '@polkadot/api-base/types/storage';
export * from '@polkadot/api-base/types/submittable';
// normal exports
export * from './api';
export * from './base';
export * from './derive';
export * from './rpc';
@@ -1,33 +1,34 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AnyFunction, Callback, DefinitionRpc } from '@polkadot/types/types';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base';
export interface RpcRxResult<F extends AnyFunction> extends RxResult<F> {
export type { AugmentedRpc } from '@polkadot/rpc-core/types';
export interface RxRpcResult<F extends AnyFunction> extends RxResult<F> {
raw <T> (...args: Parameters<F>): Observable<T>;
meta: DefinitionRpc;
}
export interface RpcPromiseResult<F extends AnyFunction> extends PromiseResult<F> {
export interface PromiseRpcResult<F extends AnyFunction> extends PromiseResult<F> {
raw <T> (...args: Parameters<F>): Promise<T>;
raw <T> (...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
meta: DefinitionRpc;
}
export type RpcMethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
? RpcRxResult<F>
: RpcPromiseResult<F>;
? RxRpcResult<F>
: PromiseRpcResult<F>;
export type DecoratedRpcSection<ApiType extends ApiTypes, Section> = {
[Method in keyof Section]: Section[Method] extends AnyFunction
? RpcMethodResult<ApiType, Section[Method]>
[M in keyof Section]: Section[M] extends AnyFunction
? RpcMethodResult<ApiType, Section[M]>
: never
}
export type DecoratedRpc<ApiType extends ApiTypes, AllSections> = {
[Section in keyof AllSections]: DecoratedRpcSection<ApiType, AllSections[Section]>
[S in keyof AllSections]: DecoratedRpcSection<ApiType, AllSections[S]>
}
+137
View File
@@ -0,0 +1,137 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { StorageKey, u64 } from '@polkadot/types';
import type { Hash } from '@polkadot/types/interfaces';
import type { StorageEntry } from '@polkadot/types/primitive/types';
import type { AnyFunction, AnyTuple, Callback, Codec, IStorageKey } from '@polkadot/types/types';
import type { ApiTypes, DropLast, MethodResult, ObsInnerType, PaginationOptions, PromiseOrObs, UnsubscribePromise } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedQueries<ApiType extends ApiTypes> {
// augmented
}
export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
// when non-augmented, we need to at least have Codec results
[key: string]: QueryableModuleStorage<ApiType>;
}
export interface QueryableStorageAt<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
[key: string]: QueryableModuleStorageAt<ApiType>;
}
type AsCodec<R extends Codec | any> = R extends Codec
? R
: Codec;
type ReturnCodec<F extends AnyFunction> = AsCodec<ObsInnerType<ReturnType<F>>>;
interface StorageEntryObservableMulti<R extends Codec = Codec> {
<T extends Codec = R>(args: (unknown[] | unknown)[]): Observable<T[]>;
}
interface StorageEntryPromiseMulti<R extends Codec = Codec> {
<T extends Codec = R>(args: (unknown[] | unknown)[]): Promise<T[]>;
<T extends Codec = R>(args: (unknown[] | unknown)[], callback: Callback<T[]>): UnsubscribePromise;
}
export interface StorageEntryPromiseOverloads {
(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<Codec>;
<T extends Codec>(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<T>;
<T extends Codec>(callback: Callback<T>): UnsubscribePromise;
<T extends Codec>(arg: unknown, callback: Callback<T>): UnsubscribePromise;
<T extends Codec>(arg1: unknown, arg2: unknown, callback: Callback<T>): UnsubscribePromise;
<T extends Codec>(arg1: unknown, arg2: unknown, arg3: unknown, callback: Callback<T>): UnsubscribePromise;
}
export interface StorageEntryPromiseOverloadsAt {
(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<Codec>;
<T extends Codec>(arg1?: unknown, arg2?: unknown, arg3?: unknown): Promise<T>;
}
// This is the most generic typings we can have for a storage entry function
export type GenericStorageEntryFunction = (...args: unknown[]) => Observable<Codec>
export type QueryableStorageEntry<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> =
ApiType extends 'rxjs'
? AugmentedQuery<'rxjs', GenericStorageEntryFunction, A>
: AugmentedQuery<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloads;
export type QueryableStorageEntryAt<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> =
ApiType extends 'rxjs'
? AugmentedQueryAt<'rxjs', GenericStorageEntryFunction, A>
: AugmentedQueryAt<'promise', GenericStorageEntryFunction, A> & StorageEntryPromiseOverloadsAt;
export interface StorageEntryBase<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> extends StorageEntryBaseAt<ApiType, F, A> {
/**
* @deprecated Use api.at(<blockHash>)
*/
at: <T extends Codec | any = ReturnCodec<F>>(hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, T>;
creator: StorageEntry;
/**
* @deprecated Use api.at(<blockHash>)
*/
entriesAt: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
/**
* @deprecated Use api.at(<blockHash>)
*/
keysAt: <K extends AnyTuple = A> (hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
/**
* @deprecated The underlying RPC this been marked unsafe and is generally not exposed
*/
range: <T extends Codec | any = ReturnCodec<F>>([from, to]: [Hash | Uint8Array | string, Hash | Uint8Array | string | undefined] | [Hash | Uint8Array | string], ...args: Parameters<F>) => PromiseOrObs<ApiType, [Hash, T][]>;
/**
* @deprecated Use api.at(<blockHash>)
*/
sizeAt: (hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
multi: ApiType extends 'rxjs'
? StorageEntryObservableMulti<ReturnCodec<F>>
: StorageEntryPromiseMulti<ReturnCodec<F>>;
}
export interface StorageEntryBaseAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> {
entries: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
entriesPaged: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>;
is: (key: IStorageKey<AnyTuple>) => key is IStorageKey<A>;
key: (...args: Parameters<F>) => string;
keyPrefix: (...args: DropLast<Parameters<F>>) => string;
keys: <K extends AnyTuple = A> (...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
keysPaged: <K extends AnyTuple = A> (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
}
export interface QueryableModuleStorage<ApiType extends ApiTypes> {
[key: string]: QueryableStorageEntry<ApiType, AnyTuple>;
}
export interface QueryableModuleStorageAt<ApiType extends ApiTypes> {
[key: string]: QueryableStorageEntryAt<ApiType, AnyTuple>;
}
export type QueryableStorageMultiArg<ApiType extends ApiTypes> =
QueryableStorageEntry<ApiType> |
[QueryableStorageEntry<ApiType>, ...unknown[]];
export interface QueryableStorageMultiBase<ApiType extends ApiTypes> {
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Observable<T>;
}
export interface QueryableStorageMultiPromise<ApiType extends ApiTypes> {
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[], callback: Callback<T>): UnsubscribePromise;
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Promise<T>;
}
export type QueryableStorageMulti<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? QueryableStorageMultiBase<ApiType>
: QueryableStorageMultiPromise<ApiType>;
export type AugmentedQuery<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBase<ApiType, F, A>;
export type AugmentedQueryAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBaseAt<ApiType, F, A>;
// backwards compatibility-only
export type AugmentedQueryDoubleMap<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = AugmentedQuery<ApiType, F, A>;
@@ -0,0 +1,95 @@
// Copyright 2017-2022 @polkadot/api-base authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
import type { AccountId, Address, ApplyExtrinsicResult, Call, DispatchError, DispatchInfo, EventRecord, Extrinsic, ExtrinsicStatus, Hash, RuntimeDispatchInfo } from '@polkadot/types/interfaces';
import type { AnyFunction, AnyNumber, AnyTuple, Callback, CallBase, Codec, IExtrinsicEra, IKeyringPair, ISubmittableResult, Signer } from '@polkadot/types/types';
import type { ApiTypes, PromiseOrObs } from './base';
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-empty-interface
export interface AugmentedSubmittables<ApiType extends ApiTypes> {
// augmented
}
export interface SubmittableExtrinsics<ApiType extends ApiTypes> extends AugmentedSubmittables<ApiType> {
(extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType>;
// when non-augmented, we need to at least have Codec results
[key: string]: SubmittableModuleExtrinsics<ApiType>;
}
export type AddressOrPair = IKeyringPair | string | AccountId | Address;
export type AugmentedSubmittable<T extends AnyFunction, A extends AnyTuple = AnyTuple> = T & CallBase<A>;
export interface SignerOptions {
blockHash: Uint8Array | string;
era?: IExtrinsicEra | number;
nonce: AnyNumber | Codec;
signer?: Signer;
tip?: AnyNumber;
assetId?: AnyNumber;
}
export type SubmittableDryRunResult<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? Observable<ApplyExtrinsicResult>
: Promise<ApplyExtrinsicResult>;
export interface SubmittableExtrinsicFunction<ApiType extends ApiTypes, A extends AnyTuple = AnyTuple> extends CallBase<A> {
(...params: any[]): SubmittableExtrinsic<ApiType>;
}
export interface SubmittableModuleExtrinsics<ApiType extends ApiTypes> {
// only with is<Type> augmentation
[key: string]: SubmittableExtrinsicFunction<ApiType>;
}
export type SubmittablePaymentResult<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? Observable<RuntimeDispatchInfo>
: Promise<RuntimeDispatchInfo>;
export type SubmittableResultResult<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> =
ApiType extends 'rxjs'
? Observable<R>
: Promise<Hash>;
export type SubmittableResultSubscription<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> =
ApiType extends 'rxjs'
? Observable<R>
: Promise<() => void>;
export interface SubmittableResultValue {
dispatchError?: DispatchError;
dispatchInfo?: DispatchInfo;
events?: EventRecord[];
internalError?: Error;
status: ExtrinsicStatus;
txHash: Hash;
txIndex?: number;
}
export interface SubmittableExtrinsic<ApiType extends ApiTypes, R extends ISubmittableResult = ISubmittableResult> extends Extrinsic {
dryRun (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableDryRunResult<ApiType>;
paymentInfo (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittablePaymentResult<ApiType>;
send (): SubmittableResultResult<ApiType>;
send (statusCb: Callback<R>): SubmittableResultSubscription<ApiType, R>;
/**
* @deprecated
*/
sign (account: IKeyringPair, _options?: Partial<SignerOptions>): this;
signAsync (account: AddressOrPair, _options?: Partial<SignerOptions>): PromiseOrObs<ApiType, this>;
signAndSend (account: AddressOrPair, options?: Partial<SignerOptions>): SubmittableResultResult<ApiType, R>;
signAndSend (account: AddressOrPair, statusCb: Callback<R>): SubmittableResultSubscription<ApiType>;
signAndSend (account: AddressOrPair, options: Partial<SignerOptions>, statusCb?: Callback<R>): SubmittableResultSubscription<ApiType, R>;
withResultTransform (transform: (input: ISubmittableResult) => ISubmittableResult): this;
}
+12
View File
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"references": [
{ "path": "../rpc-core/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" }
]
}
-13
View File
@@ -1,16 +1,3 @@
# @polkadot/api-contract
Interfaces to allow for the encoding and decoding of Substrate contract ABIs.
```js
import {ApiPromise, WsProvider } from '@polkadot/api';
import { Abi } from '@polkadot/api-contract';
const wsProvider = new WsProvider(<...Node Url...>);
const api = await ApiPromise.create({ provider: wsProvider });
const abi = new Abi(<...JSON ABI...>, api.registry.getChainProperties());
api.tx.contracts
.call(<contract addr>, <value>, <max gas>, abi.messages.<method name>(<...params...>))
.signAndSend(<keyring pair>, (result: SubmittableResult) => { ... });
```
+13 -6
View File
@@ -20,13 +20,20 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "6.9.2",
"version": "8.8.2",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.3",
"@polkadot/api": "6.9.2",
"@polkadot/types": "6.9.2",
"@polkadot/util": "^7.9.2",
"rxjs": "^7.4.0"
"@babel/runtime": "^7.18.3",
"@polkadot/api": "8.8.2",
"@polkadot/types": "8.8.2",
"@polkadot/types-codec": "8.8.2",
"@polkadot/types-create": "8.8.2",
"@polkadot/util": "^9.4.1",
"@polkadot/util-crypto": "^9.4.1",
"rxjs": "^7.5.5"
},
"devDependencies": {
"@polkadot/api-augment": "8.8.2",
"@polkadot/keyring": "^9.4.1"
}
}
+25 -10
View File
@@ -1,7 +1,7 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyJson, Registry } from '@polkadot/types/types';
import type { Registry } from '@polkadot/types/types';
import fs from 'fs';
import path from 'path';
@@ -9,11 +9,12 @@ import path from 'path';
import { TypeDefInfo } from '@polkadot/types/types';
import { blake2AsHex } from '@polkadot/util-crypto';
import abis from '../../test/contracts';
import abis from '../test/contracts';
import { Abi } from '.';
interface SpecDef {
messages: {
label: string;
name: string[] | string
}[]
}
@@ -28,6 +29,12 @@ interface JSONAbi {
spec: SpecDef;
V1: {
spec: SpecDef;
},
V2: {
spec: SpecDef;
},
V3: {
spec: SpecDef;
}
}
@@ -47,11 +54,19 @@ function stringifyJson (registry: Registry): string {
describe('Abi', (): void => {
describe('ABI', (): void => {
Object.entries(abis).forEach(([abiName, abi]: [string, JSONAbi]) => {
Object.entries(abis).forEach(([abiName, _abi]) => {
const abi = _abi as unknown as JSONAbi;
it(`initializes from a contract ABI (${abiName})`, (): void => {
try {
const messageIds = (abi.V1 ? abi.V1 : abi).spec.messages.map(({ name }) => Array.isArray(name) ? name[0] : name);
const inkAbi = new Abi(abis[abiName] as AnyJson);
const messageIds = (abi.V3 || abi.V2 || abi.V1 || abi).spec.messages.map(({ label, name }) =>
label || (
Array.isArray(name)
? name.join('::')
: name
)
);
const inkAbi = new Abi(abis[abiName]);
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
} catch (error) {
@@ -66,9 +81,9 @@ describe('Abi', (): void => {
describe('TypeDef', (): void => {
Object.keys(abis).forEach((abiName) => {
it(`initializes from a contract ABI (${abiName})`, (): void => {
const abi = new Abi(abis[abiName] as AnyJson);
const abi = new Abi(abis[abiName]);
const json = stringifyJson(abi.registry);
const cmpPath = path.join(__dirname, `../../test/compare/${abiName}.test.json`);
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
@@ -87,8 +102,8 @@ describe('Abi', (): void => {
});
it('has the correct hash for the source', (): void => {
const bundle = abis.ink_v0_flipperBundle as JSONAbi;
const abi = new Abi(bundle as unknown as AnyJson);
const abi = new Abi(abis.ink_v0_flipperBundle);
const bundle = abis.ink_v0_flipperBundle as unknown as JSONAbi;
// manual
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
+43 -42
View File
@@ -1,25 +1,16 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes, PortableRegistry } from '@polkadot/types';
import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces';
import type { AnyJson, Codec, Registry } from '@polkadot/types/types';
import type { Bytes } from '@polkadot/types';
import type { ChainProperties, ContractConstructorSpecLatest, ContractEventSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces';
import type { Codec, Registry } from '@polkadot/types/types';
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types';
import { TypeDefInfo, TypeRegistry } from '@polkadot/types';
import { TypeRegistry } from '@polkadot/types';
import { TypeDefInfo } from '@polkadot/types-create';
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { toLatest } from './toLatest';
interface V0AbiJson {
metadataVersion: string;
spec: {
constructors: unknown[];
events: unknown[];
messages: unknown[];
};
types: unknown[];
}
import { convertVersions, enumVersions } from './toLatest';
const l = logger('Abi');
@@ -35,17 +26,25 @@ function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
}
function parseJson (json: AnyJson, chainProperties?: ChainProperties): [AnyJson, Registry, ContractMetadataLatest, ContractProjectInfo] {
function getLatestMeta (registry: Registry, json: Record<string, unknown>): ContractMetadataLatest {
const vx = enumVersions.find((v) => isObject(json[v]));
const metadata = registry.createType('ContractMetadata',
vx
? { [vx]: json[vx] }
: { V0: json }
) as unknown as ContractMetadata;
const converter = convertVersions.find(([v]) => metadata[`is${v}`]);
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] {
const registry = new TypeRegistry();
const info = registry.createType('ContractProjectInfo', json);
const metadata = registry.createType('ContractMetadata', isString((json as unknown as V0AbiJson).metadataVersion)
? { V0: json }
: { V1: (json as Record<string, AnyJson>).V1 }
);
const latest = metadata.isV0
? toLatest(registry, metadata.asV0)
: metadata.asV1;
const lookup = registry.createType<PortableRegistry>('PortableRegistry', { types: latest.types });
const info = registry.createType('ContractProjectInfo', json) as unknown as ContractProjectInfo;
const latest = getLatestMeta(registry, json);
const lookup = registry.createType('PortableRegistry', { types: latest.types }, true);
// attach the lookup to the registry - now the types are known
registry.setLookup(lookup);
@@ -69,7 +68,7 @@ export class Abi {
public readonly info: ContractProjectInfo;
public readonly json: AnyJson;
public readonly json: Record<string, unknown>;
public readonly messages: AbiMessage[];
@@ -77,22 +76,23 @@ export class Abi {
public readonly registry: Registry;
constructor (abiJson: AnyJson, chainProperties?: ChainProperties) {
constructor (abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties) {
[this.json, this.registry, this.metadata, this.info] = parseJson(
isString(abiJson)
? JSON.parse(abiJson) as AnyJson
? JSON.parse(abiJson) as Record<string, unknown>
: abiJson,
chainProperties
);
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpec, index) =>
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: ContractEventSpec, index) =>
this.events = this.metadata.spec.events.map((spec: ContractEventSpecLatest, index) =>
this.#createEvent(spec, index)
);
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpec, index): AbiMessage => {
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpecLatest, index): AbiMessage => {
const typeSpec = spec.returnType.unwrapOr(null);
return this.#createMessage(spec, index, {
@@ -139,15 +139,15 @@ export class Abi {
return findMessage(this.messages, messageOrId);
}
#createArgs = (args: ContractMessageParamSpec[], spec: unknown): AbiParam[] => {
return args.map(({ name, type }, index): AbiParam => {
#createArgs = (args: ContractMessageParamSpecLatest[], spec: unknown): AbiParam[] => {
return args.map(({ label, type }, index): AbiParam => {
try {
assert(isObject(type), 'Invalid type definition found');
const displayName = type.displayName.length
? type.displayName[type.displayName.length - 1].toString()
: undefined;
const camelName = stringCamelCase(name);
const camelName = stringCamelCase(label);
if (displayName && PRIMITIVE_ALWAYS.includes(displayName)) {
return {
@@ -175,7 +175,7 @@ export class Abi {
});
};
#createEvent = (spec: ContractEventSpec, index: number): AbiEvent => {
#createEvent = (spec: ContractEventSpecLatest, index: number): AbiEvent => {
const args = this.#createArgs(spec.args, spec);
const event = {
args,
@@ -184,16 +184,16 @@ export class Abi {
args: this.#decodeArgs(args, data),
event
}),
identifier: spec.name.toString(),
identifier: spec.label.toString(),
index
};
return event;
};
#createMessage = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
#createMessage = (spec: ContractMessageSpecLatest | ContractConstructorSpecLatest, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
const args = this.#createArgs(spec.args, spec);
const identifier = spec.name.toString();
const identifier = spec.label.toString();
const message = {
...add,
args,
@@ -205,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)
@@ -237,8 +238,8 @@ export class Abi {
return message.fromU8a(trimmed.subarray(4));
};
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: unknown[]): Uint8Array => {
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`);
#encodeArgs = ({ label, selector }: ContractMessageSpecLatest | ContractConstructorSpecLatest, args: AbiParam[], data: unknown[]): Uint8Array => {
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
return compactAddLength(
u8aConcat(
@@ -0,0 +1,122 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { v0ToLatest, v1ToLatest, v2ToLatest, v3ToLatest } from '@polkadot/api-contract/Abi/toLatest';
import { TypeRegistry } from '@polkadot/types';
import abis from '../test/contracts';
describe('v0ToLatest', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V0: abis.ink_v0_erc20 });
const latest = v0ToLatest(registry, contract.asV0);
it('has the correct constructors', (): void => {
expect(
latest.spec.constructors.map(({ label }) => label.toString())
).toEqual(['new']);
});
it('has the correct messages', (): void => {
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['total_supply', 'balance_of', 'allowance', 'transfer', 'approve', 'transfer_from']);
});
it('has the correct events', (): void => {
expect(
latest.spec.events.map(({ label }) => label.toString())
).toEqual(['Transfer', 'Approval']);
});
it('has the correct constructor arguments', (): void => {
expect(
latest.spec.constructors[0].args.map(({ label }) => label.toString())
).toEqual(['initial_supply']);
});
it('has the correct message arguments', (): void => {
expect(
latest.spec.messages[1].args.map(({ label }) => label.toString())
).toEqual(['owner']);
});
it('has the correct event arguments', (): void => {
expect(
latest.spec.events[0].args.map(({ label }) => label.toString())
).toEqual(['from', 'to', 'value']);
});
});
describe('v1ToLatest', (): void => {
const registry = new TypeRegistry();
const contract = registry.createType('ContractMetadata', { V1: abis.ink_v1_flipper.V1 });
const latest = v1ToLatest(registry, contract.asV1);
it('has the correct constructors', (): void => {
expect(
latest.spec.constructors.map(({ label }) => label.toString())
).toEqual(['new', 'default']);
});
it('has the correct messages', (): void => {
expect(
latest.spec.messages.map(({ label }) => label.toString())
).toEqual(['flip', 'get']);
});
it('has the correct 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'
]);
});
});
+32 -8
View File
@@ -1,14 +1,38 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataLatest, ContractMetadataV0 } from '@polkadot/types/interfaces';
import type { ContractMetadataLatest, ContractMetadataV3 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import { convertSiV0toV1 } from '@polkadot/types';
import { v0ToV1 } from './toV1';
import { v1ToV2 } from './toV2';
import { v2ToV3 } from './toV3';
export function toLatest (registry: Registry, v0: ContractMetadataV0): ContractMetadataLatest {
return registry.createType('ContractMetadataLatest', {
...v0,
types: convertSiV0toV1(registry, v0.types)
});
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 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]
];
+31
View File
@@ -0,0 +1,31 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataV0, ContractMetadataV1 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import { convertSiV0toV1 } from '@polkadot/types';
import { objectSpread } from '@polkadot/util';
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)
}));
}
+58
View File
@@ -0,0 +1,58 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Text } from '@polkadot/types';
import type { ContractConstructorSpecV0, ContractEventSpecV0, ContractMessageSpecV0, ContractMetadataV1, ContractMetadataV2 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import { objectSpread } from '@polkadot/util';
type WithArgs = keyof typeof ARG_TYPES;
interface NamedEntry {
name: Text | Text[];
}
type GetArgsType<T extends WithArgs> = T extends 'ContractConstructorSpec'
? ContractConstructorSpecV0
: T extends ContractEventSpecV0
? ContractEventSpecV0
: ContractMessageSpecV0;
interface ArgsEntry <T extends WithArgs> extends NamedEntry {
args: GetArgsType<T>['args'][0][];
}
const ARG_TYPES = {
ContractConstructorSpec: 'ContractMessageParamSpecV2',
ContractEventSpec: 'ContractEventParamSpecV2',
ContractMessageSpec: 'ContractMessageParamSpecV2'
};
function v1ToV2Label (entry: NamedEntry): { label: Text } {
return objectSpread({}, entry, {
label: Array.isArray(entry.name)
? entry.name.join('::')
: entry.name
});
}
function v1ToV2Labels <T extends WithArgs> (registry: Registry, outType: T, all: ArgsEntry<T>[]): unknown[] {
return all.map((e) =>
registry.createType(`${outType}V2`, objectSpread(v1ToV2Label(e), {
args: e.args.map((a) =>
registry.createType(ARG_TYPES[outType], v1ToV2Label(a))
)
}))
);
}
export function v1ToV2 (registry: Registry, v1: ContractMetadataV1): ContractMetadataV2 {
return registry.createType('ContractMetadataV2', objectSpread({}, v1, {
spec: objectSpread({}, v1.spec, {
constructors: v1ToV2Labels(registry, 'ContractConstructorSpec', v1.spec.constructors),
events: v1ToV2Labels(registry, 'ContractEventSpec', v1.spec.events),
messages: v1ToV2Labels(registry, 'ContractMessageSpec', v1.spec.messages)
})
}));
}
+18
View File
@@ -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 }))
)
})
}));
}
+4 -3
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AnyJson, Registry } from '@polkadot/types/types';
import type { Registry } from '@polkadot/types/types';
import { ApiBase } from '@polkadot/api/base';
import { assert, isFunction } from '@polkadot/util';
@@ -16,11 +16,12 @@ export abstract class Base<ApiType extends ApiTypes> {
protected readonly _decorateMethod: DecorateMethod<ApiType>;
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, decorateMethod: DecorateMethod<ApiType>) {
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, decorateMethod: DecorateMethod<ApiType>) {
this.abi = abi instanceof Abi
? abi
: new Abi(abi, api.registry.getChainProperties());
this.api = api;
this._decorateMethod = decorateMethod;
assert(!!(api && api.isConnected && api.tx), 'Your API has not been initialized correctly and is not connected to a chain');
+33 -18
View File
@@ -1,10 +1,10 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { AccountId, EventRecord, Hash } from '@polkadot/types/interfaces';
import type { AnyJson, ISubmittableResult } from '@polkadot/types/types';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { AbiConstructor, BlueprintOptions } from '../types';
import type { MapConstructorExec } from './types';
@@ -18,6 +18,10 @@ import { Base } from './Base';
import { Contract } from './Contract';
import { createBluePrintTx, encodeSalt } from './util';
export interface BlueprintConstructor<ApiType extends ApiTypes> {
new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array): Blueprint<ApiType>;
}
export class BlueprintSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
public readonly contract?: Contract<ApiType>;
@@ -36,14 +40,14 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
readonly #tx: MapConstructorExec<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, codeHash: string | Hash | Uint8Array, decorateMethod: DecorateMethod<ApiType>) {
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.codeHash = this.registry.createType('Hash', codeHash);
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,19 +56,30 @@ export class Blueprint<ApiType extends ApiTypes> extends Base<ApiType> {
return this.#tx;
}
#deploy = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, BlueprintSubmittableResult<ApiType>> => {
return this.api.tx.contracts
.instantiate(
value,
gasLimit,
this.codeHash,
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
)
.withResultTransform((result: ISubmittableResult) =>
new BlueprintSubmittableResult(result, applyOnEvent(result, ['Instantiated'], ([record]: EventRecord[]) =>
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
))
);
#deploy = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, storageDepositLimit = null, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, BlueprintSubmittableResult<ApiType>> => {
const hasStorageDeposit = this.api.tx.contracts.instantiate.meta.args.length === 6;
const encParams = this.abi.findConstructor(constructorOrId).toU8a(params);
const encSalt = encodeSalt(salt);
const tx = hasStorageDeposit
? this.api.tx.contracts.instantiate(value, gasLimit, storageDepositLimit, this.codeHash, encParams, encSalt)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore old style without storage deposit
: this.api.tx.contracts.instantiate(value, gasLimit, this.codeHash, encParams, encSalt);
return tx.withResultTransform((result: ISubmittableResult) =>
new BlueprintSubmittableResult(result, applyOnEvent(result, ['Instantiated'], ([record]: EventRecord[]) =>
new Contract<ApiType>(this.api, this.abi, record.event.data[1] as AccountId, this._decorateMethod)
))
);
};
}
export function extendBlueprint <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): BlueprintConstructor<ApiType> {
return class extends Blueprint<ApiType> {
static __BlueprintType = type;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash | Uint8Array) {
super(api, abi, codeHash, decorateMethod);
}
};
}
+8 -10
View File
@@ -1,37 +1,35 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AnyJson } from '@polkadot/types/types';
import fs from 'fs';
import path from 'path';
import { toPromiseMethod } from '@polkadot/api';
import v0contractFlipper from '../../test/contracts/ink/v0/flipper.contract.json';
import v0abiFlipper from '../../test/contracts/ink/v0/flipper.json';
import v1contractFlipper from '../../test/contracts/ink/v1/flipper.contract.json';
import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json';
import v0abiFlipper from '../test/contracts/ink/v0/flipper.json';
import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json';
import { Code } from './Code';
import { mockApi } from './mock';
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts/ink/v0/flipper.wasm'));
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../test/contracts/ink/v0/flipper.wasm'));
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {
expect(
() => new Code(mockApi, v0abiFlipper as AnyJson, v0wasmFlipper, toPromiseMethod)
() => new Code(mockApi, v0abiFlipper as Record<string, unknown>, v0wasmFlipper, toPromiseMethod)
).not.toThrow();
});
it('can construct with an .contract ABI (v0)', (): void => {
expect(
() => new Code(mockApi, v0contractFlipper as AnyJson, null, toPromiseMethod)
() => new Code(mockApi, v0contractFlipper as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
it.only('can construct with an .contract ABI (v1)', (): void => {
expect(
() => new Code(mockApi, v1contractFlipper as AnyJson, null, toPromiseMethod)
() => new Code(mockApi, v1contractFlipper as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
});
+42 -25
View File
@@ -1,10 +1,11 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { EventRecord } from '@polkadot/types/interfaces';
import type { AnyJson, ISubmittableResult } from '@polkadot/types/types';
import type { AccountId, EventRecord } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { Codec } from '@polkadot/types-codec/types';
import type { AbiConstructor, BlueprintOptions } from '../types';
import type { MapConstructorExec } from './types';
@@ -19,6 +20,10 @@ import { Blueprint } from './Blueprint';
import { Contract } from './Contract';
import { createBluePrintTx, encodeSalt } from './util';
export interface CodeConstructor<ApiType extends ApiTypes> {
new(api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined): Code<ApiType>;
}
export class CodeSubmittableResult<ApiType extends ApiTypes> extends SubmittableResult {
public readonly blueprint?: Blueprint<ApiType>;
public readonly contract?: Contract<ApiType>;
@@ -36,7 +41,7 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
readonly #tx: MapConstructorExec<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.code = isWasm(this.abi.info.source.wasm)
@@ -47,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));
}
});
}
@@ -56,25 +61,37 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
return this.#tx;
}
#instantiate = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
return this.api.tx.contracts
.instantiateWithCode(
value,
gasLimit,
compactAddLength(this.code),
this.abi.findConstructor(constructorOrId).toU8a(params),
encodeSalt(salt)
)
.withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
records.reduce<[Blueprint<ApiType>?, Contract<ApiType>?]>(([blueprint, contract], { event }) =>
this.api.events.contracts.Instantiated.is(event)
? [blueprint, new Contract<ApiType>(this.api, this.abi, event.data[1], this._decorateMethod)]
: this.api.events.contracts.CodeStored.is(event)
? [new Blueprint<ApiType>(this.api, this.abi, event.data[0], this._decorateMethod), contract]
: [blueprint, contract],
[])
) || []))
);
#instantiate = (constructorOrId: AbiConstructor | string | number, { gasLimit = BN_ZERO, salt, storageDepositLimit = null, value = BN_ZERO }: BlueprintOptions, params: unknown[]): SubmittableExtrinsic<ApiType, CodeSubmittableResult<ApiType>> => {
const hasStorageDeposit = this.api.tx.contracts.instantiateWithCode.meta.args.length === 6;
const encCode = compactAddLength(this.code);
const encParams = this.abi.findConstructor(constructorOrId).toU8a(params);
const encSalt = encodeSalt(salt);
const tx = hasStorageDeposit
? this.api.tx.contracts.instantiateWithCode(value, gasLimit, storageDepositLimit, encCode, encParams, encSalt)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore old style without storage deposit
: this.api.tx.contracts.instantiateWithCode(value, gasLimit, encCode, encParams, encSalt);
return tx.withResultTransform((result: ISubmittableResult) =>
new CodeSubmittableResult(result, ...(applyOnEvent(result, ['CodeStored', 'Instantiated'], (records: EventRecord[]) =>
records.reduce<[Blueprint<ApiType>?, Contract<ApiType>?]>(([blueprint, contract], { event }) =>
this.api.events.contracts.Instantiated.is(event)
? [blueprint, new Contract<ApiType>(this.api, this.abi, (event as unknown as { data: [Codec, AccountId] }).data[1], this._decorateMethod)]
: this.api.events.contracts.CodeStored.is(event)
? [new Blueprint<ApiType>(this.api, this.abi, (event as unknown as { data: [AccountId] }).data[0], this._decorateMethod), contract]
: [blueprint, contract],
[])
) || []))
);
};
}
export function extendCode <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): CodeConstructor<ApiType> {
return class extends Code<ApiType> {
static __CodeType = type;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
super(api, abi, wasm, decorateMethod);
}
};
}
+78 -60
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { SubmittableExtrinsic } from '@polkadot/api/submittable/types';
import type { ApiTypes, DecorateMethod } from '@polkadot/api/types';
import type { Bytes } from '@polkadot/types';
import type { AccountId, EventRecord, Weight } from '@polkadot/types/interfaces';
import type { AnyJson, ISubmittableResult } from '@polkadot/types/types';
import type { AccountId, ContractExecResult, EventRecord, Weight } from '@polkadot/types/interfaces';
import type { ISubmittableResult } from '@polkadot/types/types';
import type { AbiMessage, ContractCallOutcome, ContractOptions, DecodedEvent } from '../types';
import type { ContractCallResult, ContractCallSend, ContractQuery, ContractTx, MapMessageQuery, MapMessageTx } from './types';
@@ -18,6 +18,11 @@ 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>;
}
// As per Rust, 5 * GAS_PER_SEC
const MAX_CALL_GAS = new BN(5_000_000_000_000).isub(BN_ONE);
@@ -25,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(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(options, params));
: fn(...extractOptions<ContractOptions>(options, params))
);
}
export class ContractSubmittableResult extends SubmittableResult {
@@ -59,18 +66,18 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
readonly #tx: MapMessageTx<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, address: string | AccountId, decorateMethod: DecorateMethod<ApiType>) {
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.address = this.registry.createType('AccountId', address);
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));
}
});
}
@@ -96,68 +103,79 @@ export class Contract<ApiType extends ApiTypes> extends Base<ApiType> {
? isCall
? MAX_CALL_GAS
: (this.api.consts.system.blockWeights
? this.api.consts.system.blockWeights.maxBlock
? (this.api.consts.system.blockWeights as unknown as { maxBlock: Weight }).maxBlock
: this.api.consts.system.maximumBlockWeight as Weight
).muln(64).div(BN_HUNDRED)
: gasLimit;
};
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): SubmittableExtrinsic<ApiType> => {
return this.api.tx.contracts
.call(
this.address,
value,
this.#getGas(gasLimit),
this.abi.findMessage(messageOrId).toU8a(params)
)
.withResultTransform((result: ISubmittableResult) =>
// ContractEmitted is the current generation, ContractExecution is the previous generation
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
records
.map(({ event: { data: [, data] } }): DecodedEvent | null => {
try {
return this.abi.decodeEvent(data as Bytes);
} catch (error) {
l.error(`Unable to decode contract event: ${(error as Error).message}`);
#exec = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, storageDepositLimit = null, value = BN_ZERO }: ContractOptions, params: unknown[]): SubmittableExtrinsic<ApiType> => {
const hasStorageDeposit = this.api.tx.contracts.call.meta.args.length === 5;
const gas = this.#getGas(gasLimit);
const encParams = this.abi.findMessage(messageOrId).toU8a(params);
const tx = hasStorageDeposit
? this.api.tx.contracts.call(this.address, value, gas, storageDepositLimit, encParams)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore old style without storage deposit
: this.api.tx.contracts.call(this.address, value, gas, encParams);
return null;
}
})
.filter((decoded): decoded is DecodedEvent => !!decoded)
))
);
return tx.withResultTransform((result: ISubmittableResult) =>
// ContractEmitted is the current generation, ContractExecution is the previous generation
new ContractSubmittableResult(result, applyOnEvent(result, ['ContractEmitted', 'ContractExecution'], (records: EventRecord[]) =>
records
.map(({ event: { data: [, data] } }): DecodedEvent | null => {
try {
return this.abi.decodeEvent(data as Bytes);
} catch (error) {
l.error(`Unable to decode contract event: ${(error as Error).message}`);
return null;
}
})
.filter((decoded): decoded is DecodedEvent => !!decoded)
))
);
};
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, storageDepositLimit = null, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
assert(this.hasRpcContractsCall, ERROR_NO_CALL);
const message = this.abi.findMessage(messageOrId);
return {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
send: this._decorateMethod((origin: string | AccountId | Uint8Array) =>
this.api.rx.rpc.contracts
.call({
dest: this.address,
gasLimit: this.#getGas(gasLimit, true),
inputData: message.toU8a(params),
origin,
value
})
.pipe(
map(({ debugMessage, gasConsumed, gasRequired, result }): ContractCallOutcome => ({
debugMessage,
gasConsumed,
gasRequired: gasRequired && !gasRequired.isZero()
? gasRequired
: gasConsumed,
output: result.isOk && message.returnType
? this.abi.registry.createTypeUnsafe(message.returnType.lookupName || message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
: null,
result
}))
)
)
send: this._decorateMethod((origin: string | AccountId | Uint8Array) => {
const hasStorageDeposit = this.api.tx.contracts.call.meta.args.length === 5;
const inputData = message.toU8a(params);
const rpc = hasStorageDeposit
? this.api.rx.rpc.contracts.call({ dest: this.address, gasLimit: this.#getGas(gasLimit, true), inputData, origin, storageDepositLimit, value })
: this.api.rx.rpc.contracts.call({ dest: this.address, gasLimit: this.#getGas(gasLimit, true), inputData, origin, value });
const mapFn = ({ debugMessage, gasConsumed, gasRequired, result, storageDeposit }: ContractExecResult): ContractCallOutcome => ({
debugMessage,
gasConsumed,
gasRequired: gasRequired && !gasRequired.isZero()
? gasRequired
: gasConsumed,
output: result.isOk && message.returnType
? this.abi.registry.createTypeUnsafe(message.returnType.lookupName || message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
: null,
result,
storageDeposit
});
return rpc.pipe(map(mapFn));
})
};
};
}
export function extendContract <ApiType extends ApiTypes> (type: ApiType, decorateMethod: DecorateMethod<ApiType>): ContractConstructor<ApiType> {
return class extends Contract<ApiType> {
static __ContractType = type;
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
super(api, abi, address, decorateMethod);
}
};
}
+4 -4
View File
@@ -1,6 +1,6 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// Copyright 2017-2022 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { Blueprint, BlueprintSubmittableResult } from './Blueprint';
export { Code, CodeSubmittableResult } from './Code';
export { Contract } from './Contract';
export { Blueprint, BlueprintSubmittableResult, extendBlueprint } from './Blueprint';
export { Code, CodeSubmittableResult, extendCode } from './Code';
export { Contract, extendContract } from './Contract';
+1 -1
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { ApiBase } from '@polkadot/api/base';
+12 -4
View File
@@ -1,4 +1,4 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Observable } from 'rxjs';
@@ -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;
}
+13 -6
View File
@@ -1,11 +1,11 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
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,18 +16,25 @@ 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(options, params));
: fn(...extractOptions<BlueprintOptions>(options, params))
);
}
export function createBluePrintWithId <T> (fn: (constructorOrId: AbiConstructor | string | number, options: BlueprintOptions, params: unknown[]) => T): ContractGeneric<BlueprintOptions, T> {
return (constructorOrId: AbiConstructor | string | number, options: bigint | string | number | BN | BlueprintOptions, ...params: unknown[]): T =>
isOptions(options)
? fn(constructorOrId, options, params)
: fn(constructorOrId, ...extractOptions(options, params));
: fn(constructorOrId, ...extractOptions<BlueprintOptions>(options, params));
}
export function encodeSalt (salt: Uint8Array | string | null = randomAsU8a()): Uint8Array {
+4 -3
View File
@@ -1,7 +1,8 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { Abi } from './Abi';
export { packageInfo } from './packageInfo';
export { Blueprint as BlueprintPromise, Code as CodePromise, Contract as ContractPromise } from './promise';
export { Blueprint as BlueprintRx, Code as CodeRx, Contract as ContractRx } from './rx';
export * from './promise';
export * from './rx';
@@ -1,18 +1,18 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Simple non-runnable checks to test type definitions in the editor itself
import type { AnyJson } from '@polkadot/types/types';
import '@polkadot/api-augment';
import { ApiPromise } from '@polkadot/api';
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
import abiIncrementer from '../test/contracts/ink/incrementer.json';
import { BlueprintPromise, ContractPromise } from '.';
import abiIncrementer from './test/contracts/ink/v0/incrementer.json';
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
const blueprint = new BlueprintPromise(api, abiIncrementer as AnyJson, '0x1234');
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
// new style
await blueprint.tx.new({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
@@ -23,7 +23,7 @@ async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<
}
async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
const contract = new ContractPromise(api, abiIncrementer as AnyJson, '0x1234');
const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
// queries
await contract.query.get(pairs.alice.address, {});
+7
View File
@@ -0,0 +1,7 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { packageInfo as apiInfo } from '@polkadot/api/packageInfo';
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
export default [apiInfo, typesInfo];

Some files were not shown because too many files have changed in this diff Show More