Compare commits

...
651 Commits
Author SHA1 Message Date
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
Github Actions 5d493e1a03 [CI Skip] release/stable 6.9.2
skip-checks: true
2021-11-22 05:34:55 +00:00
Jaco e5437ef9e9 6.9.2 (#4246)
* 6.9.2

* Pull in new util
2021-11-22 07:26:47 +02:00
Github Actions b56bed39e1 [CI Skip] release/stable 6.9.1
skip-checks: true
2021-11-21 09:36:41 +00:00
Jaco e789f91850 6.9.1 (#4244) 2021-11-21 11:28:52 +02:00
Github Actions a236eb9453 [CI Skip] release/beta 6.8.2-18
skip-checks: true
2021-11-21 09:14:31 +00:00
Jaco 7ef01b8534 Bump common (#4243) 2021-11-21 11:06:08 +02:00
Github Actions 0e58545a9d [CI Skip] release/beta 6.8.2-17
skip-checks: true
2021-11-19 10:21:44 +00:00
Jaco c474123777 Bump common (#4239)
* Bump common

* CHANGELOG
2021-11-19 12:14:05 +02:00
Github Actions 93edfcf560 [CI Skip] release/beta 6.8.2-16
skip-checks: true
2021-11-19 07:59:40 +00:00
Daniel SavuandGithub Actions e5a67d82fa fix: Generate custom type definitions (#4224)
* fix: Generate custom type definitions

* Generate separate lookup types

* fix: Custom imports

* fix linting errors

Co-authored-by: Github Actions <action@github.com>
2021-11-19 09:51:51 +02:00
Github Actions 194f6aece1 [CI Skip] release/beta 6.8.2-15
skip-checks: true
2021-11-19 05:35:22 +00:00
Jaco 3b4fef8f6e Bump deps (#4238) 2021-11-19 07:26:28 +02:00
Github Actions 6c7323ee3a [CI Skip] release/beta 6.8.2-14
skip-checks: true
2021-11-18 20:00:39 +00:00
Jaco a97b50decb Additional isU8a decoding shortcuts (#4236) 2021-11-18 21:52:24 +02:00
Github Actions 52accf6444 [CI Skip] release/beta 6.8.2-13
skip-checks: true
2021-11-18 13:27:34 +00:00
Jaco 5b8eb231cc CHANGELOG (#4234) 2021-11-18 15:20:21 +02:00
Github Actions 5ea62367d3 [CI Skip] release/beta 6.8.2-12
skip-checks: true
2021-11-18 10:49:36 +00:00
Jaco 49a034a1a0 Place u8a decoding top-of-tree (#4230)
* Place u8a decoding top-of-tree

* Adjust
2021-11-18 12:41:27 +02:00
Github Actions 62a476cb4c [CI Skip] release/beta 6.8.2-11
skip-checks: true
2021-11-18 09:59:41 +00:00
Jaco b283673812 Squeek less recursion out of DetectCodec (#4232)
* Squeek less recursion out of DetectCodec

* Flatten more

* TS 4.5.2 for checking
2021-11-18 11:52:31 +02:00
Github Actions b6a075fefb [CI Skip] release/beta 6.8.2-10
skip-checks: true
2021-11-18 09:11:06 +00:00
Jaco afa844ae01 Bump deps (#4231) 2021-11-18 11:03:45 +02:00
Github Actions 353ef59a1c [CI Skip] release/beta 6.8.2-9
skip-checks: true
2021-11-18 06:32:55 +00:00
Jaco 6228999e6f Decoding cleanups (#4228)
* Decoding cleanups

* CHANGELOG

* Additional adjustments

* Adjust

* Ordering
2021-11-18 08:24:52 +02:00
Github Actions 56db42fedf [CI Skip] release/beta 6.8.2-8
skip-checks: true
2021-11-18 04:48:36 +00:00
Jaco df44693e5d Use stringPascalCase from @polkadot/util (#4211) 2021-11-18 06:40:28 +02:00
Github Actions cfa25f8dda [CI Skip] release/beta 6.8.2-7
skip-checks: true
2021-11-18 04:01:38 +00:00
Jaco bc8934f3c3 Ensure generation of Call/Event enums (#4226) 2021-11-18 05:53:54 +02:00
Github Actions bc67c72e9b [CI Skip] release/beta 6.8.2-6
skip-checks: true
2021-11-17 12:26:35 +00:00
Jaco 22d85e745a Bump deps (#4221)
* Bump deps

* Adjust

* Adjust
2021-11-17 14:19:21 +02:00
Github Actions 60ba2952f7 [CI Skip] release/beta 6.8.2-5
skip-checks: true
2021-11-17 08:28:22 +00:00
Jaco bb10d2813f Expand runtime Call/Event matching (#4220)
* Expand runtime Call/Event matching

* Adjust * matching

* CHANGELOG
2021-11-17 10:18:55 +02:00
Github Actions 80b581f0df [CI Skip] release/beta 6.8.2-4
skip-checks: true
2021-11-13 06:00:08 +00:00
Jaco ef37c421ac Option toJSON output same as from Substrate input (#4212)
* Option toJSON output same as from Substrate input

* CHANGELOG
2021-11-13 07:53:15 +02:00
Github Actions 6e1e8e622b [CI Skip] release/beta 6.8.2-3
skip-checks: true
2021-11-13 05:41:31 +00:00
Jaco ec38a1510f CHANGELOG (#4210) 2021-11-13 07:33:18 +02:00
Github Actions e550ca5a71 [CI Skip] release/beta 6.8.2-2
skip-checks: true
2021-11-12 10:56:32 +00:00
Jaco 80241f732f Split base/essential definition handling (#4206)
* Split base/essential definition handling

* Adjust
2021-11-12 12:47:34 +02:00
Github Actions 84fc0be12e [CI Skip] release/beta 6.8.2-1
skip-checks: true
2021-11-12 08:53:05 +00:00
flex e1f14e8a83 Change BeefySignedCommitment signatures type to EcdsaSignature (#4204) 2021-11-12 10:45:09 +02:00
Github Actions 1155724604 [CI Skip] release/beta 6.8.2-0
skip-checks: true
2021-11-11 12:55:42 +00:00
Jaco 3bb9541943 Bump deps (#4203) 2021-11-11 14:47:26 +02:00
Github Actions 25288f664a [CI Skip] release/stable 6.8.1
skip-checks: true
2021-11-11 11:15:45 +00:00
Jaco 879c5d7b44 6.8.1 (#4201)
* 6.8.1

* rx.queryAt param CHANGELOG
2021-11-11 13:08:24 +02:00
Jaco cdaec1953c Add knownVersion on rx.queryAt (#4194) 2021-11-11 11:30:16 +02:00
Github Actions f4bf7a9c52 [CI Skip] release/beta 6.7.3-7
skip-checks: true
2021-11-11 05:28:44 +00:00
Jaco 7b46c6aa15 Adjust signFake to apply large default signature (#4199)
* Adjust signFake to apply empty default signature

* 0x01... default

* Rename constant

* Add previously failing test
2021-11-11 07:19:21 +02:00
Github Actions d28f4ccfa0 [CI Skip] release/beta 6.7.3-6
skip-checks: true
2021-11-10 17:43:43 +00:00
Jaco e5b05dc700 Slight adjustment to rpc-provider LRU (#4198) 2021-11-10 19:35:20 +02:00
Github Actions bf9831753e [CI Skip] release/beta 6.7.3-5
skip-checks: true
2021-11-10 12:53:27 +00:00
Jaco 5e1670dbae Provider-level caching for historic requests (#4195)
* Provider-level caching for historic requests

* LRUCache

* Adjust

* Adjust

* Adjust

* Opts

* private variables

* Implementation link

* lru .entries adjustment (using .keys)

* Adjust expectations
2021-11-10 14:46:13 +02:00
Github Actions 0d0a230c86 [CI Skip] release/beta 6.7.3-4
skip-checks: true
2021-11-10 08:55:22 +00:00
Jaco 9989b69b46 Rename decorate method (#4193)
* Rename decorateMethod*

* Split exports
2021-11-10 10:48:20 +02:00
Github Actions 66693253ef [CI Skip] release/beta 6.7.3-3
skip-checks: true
2021-11-10 07:05:56 +00:00
Jaco cbffc37dcf Optimize PortableRegistry (#4192)
* Optimize PortableRegistry

* Additional

* Adjust shortcut

* Adjust params

* Move decorateMethod

* Ordering

* Adjust

* Exports

* Renames
2021-11-10 08:58:50 +02:00
Github Actions 74ee42ed66 [CI Skip] release/beta 6.7.3-2
skip-checks: true
2021-11-10 05:15:04 +00:00
Jaco f642e2399f Polkadot 9122 block (#4191) 2021-11-10 07:07:31 +02:00
Github Actions 8cefb055db [CI Skip] release/beta 6.7.3-1
skip-checks: true
2021-11-09 14:17:36 +00:00
Jaco 1f31756019 Ensure known types for v14 is empty (#4190) 2021-11-09 16:10:44 +02:00
Github Actions 4d6a1da6d5 [CI Skip] release/beta 6.7.3-0
skip-checks: true
2021-11-09 11:30:34 +00:00
Jaco d62e720627 Remove ::generic:: from names & namespaces (#4189) 2021-11-09 13:23:10 +02:00
Github Actions 4af4470998 [CI Skip] release/stable 6.7.2
skip-checks: true
2021-11-09 09:24:30 +00:00
Jaco 8bb6218132 Detect AccountId & Address via SpRuntime* defs (#4188)
* Detect AccountId & Address via SpRuntime* defs

* Always do check via UncheckedExtrinsic

* Adjust

* 6.7.2

* Add Signature detection

* Extract ExtrinsicSignature type
2021-11-09 11:14:31 +02:00
Github Actions f4197f8752 [CI Skip] release/beta 6.7.2-0
skip-checks: true
2021-11-08 14:31:55 +00:00
Jaco 7cfad3b1c4 Derive combineLatest order adjustments (#4186) 2021-11-08 16:24:27 +02:00
Github Actions ff67a659b6 [CI Skip] release/stable 6.7.1
skip-checks: true
2021-11-07 09:17:39 +00:00
Jaco a5c69a42fc 6.7.1 (#4184)
* 6.7.1

* packgeInfo

* voteLockingPeriod
2021-11-07 11:09:03 +02:00
Github Actions 3facbf00eb [CI Skip] release/beta 6.6.2-27
skip-checks: true
2021-11-07 07:54:42 +00:00
Jaco 5a6eece6d6 Swap to objectProperty from @polkadot/util (#4183)
* Swap to objectProperty from @polkadot/util

* Re-apply
2021-11-07 09:45:37 +02:00
Github Actions 9219fa3197 [CI Skip] release/beta 6.6.2-26
skip-checks: true
2021-11-07 01:10:02 +00:00
Jaco 32b9a39b1e Multiple Codec property assignments helper (#4182)
* Multiple Codec property assignments helper

* Pass index

* consistency in naming

* typesToMap external

* Loop on index

* any -> unknown

* CHANGELOG

* Adjust

* Fix Enum with Array keys
2021-11-07 03:00:37 +02:00
Github Actions 61a7fe6307 [CI Skip] release/beta 6.6.2-25
skip-checks: true
2021-11-06 20:50:48 +00:00
Jaco ca755d3e0d Make v4 payload driven by extension fields (#4017)
* Make v4 payload driven by extension fields

* Add getters for additional fields

* Move keys

* Re-adjust

* abstract

* SignerPayload fields

* CHANGELOG
2021-11-06 22:42:14 +02:00
Github Actions 442dba42ba [CI Skip] release/beta 6.6.2-24
skip-checks: true
2021-11-06 14:43:03 +00:00
Jaco ba80dd8873 Bump metadata (#4180)
* Bump metadata

* Re-generate types.json

* Kusama hex

* Kusama (... after some struggles)
2021-11-06 16:34:33 +02:00
Github Actions 1d35302dca [CI Skip] release/beta 6.6.2-23
skip-checks: true
2021-11-06 12:36:03 +00:00
Jaco 39c3121437 CHANGELOG (#4179) 2021-11-06 14:28:22 +02:00
Github Actions d7de1d84fb [CI Skip] release/beta 6.6.2-22
skip-checks: true
2021-11-06 10:24:30 +00:00
Jaco 0ee1dfb353 Caching for previously-created complex classes (#4177)
* Caching for previousl-created complex classes

* Drop non-output testing test
2021-11-06 12:17:07 +02:00
Github Actions 0a6f1d87d4 [CI Skip] release/beta 6.6.2-21
skip-checks: true
2021-11-06 10:12:27 +00:00
Jaco b7c563391c Remove memoized caches (Enum, Set) (#4178) 2021-11-06 12:01:40 +02:00
Github Actions b648c4ba6c [CI Skip] release/beta 6.6.2-20
skip-checks: true
2021-11-06 08:09:13 +00:00
Jaco 0eb995c9a1 Apply hashCache on Extrinsic only (no duplication) (#4176) 2021-11-06 10:01:05 +02:00
Github Actions 936d14ffea [CI Skip] release/beta 6.6.2-19
skip-checks: true
2021-11-06 07:34:38 +00:00
Nazar Mokrynskyi 72c7a0a34b Performance tweaks (#4143)
* Avoid unnecessary work in `filterEvents`

* Memoize computed extrinsic hash

* Optimize sanitize by reusing precompiled regular expressions

* Memoize generation of property names in `Enum` and `Set`

* Memoize sanitizing
2021-11-06 09:25:54 +02:00
Jaco 8402013e97 Add account::AccountId20 mapping (#4175)
Replaces https://github.com/polkadot-js/api/pull/4117

Sadly I messed up that one since I moved the PortableRegistry, so despite best-efforts cannot quite revolve the now-conflicts on GitHub itself

Will give acknowledgement since it is deserved, just cannot quite get the PR merged as of right now.
2021-11-06 09:12:12 +02:00
Github Actions fde6b72974 [CI Skip] release/beta 6.6.2-18
skip-checks: true
2021-11-05 16:06:06 +00:00
Jaco d98d4d6908 Move PortableRegistry alongside metadata (#4172) 2021-11-05 17:47:02 +02:00
Github Actions ed384666ee [CI Skip] release/beta 6.6.2-17
skip-checks: true
2021-11-05 14:38:57 +00:00
Jaco 4e64e3d654 Change initialU8aLength to non-getter (#4170)
* Change initialU8aLength to non-getter

* Remove time comments

* Adjust Compact shortcut

* Adjust

* Move isU8a check first in decoding

* #initialLength for Compact

* Compact re-adjust

* Split decodeU8aVec

* decodeVec opt

* Fix compare

* Adjust

* Additional objectSpread

* Additional objectSpread

* isU8a always first

* Comment time logs

* Convert String right at point of using

* Optimize Text from Text

* Fix Text test

* Additional ordering updates

* Enum adjustments

* Reorder Option

* Adjust

* Remove comments

* Adjust
2021-11-05 16:19:38 +02:00
Github Actions 72b4b51915 [CI Skip] release/beta 6.6.2-16
skip-checks: true
2021-11-05 07:25:57 +00:00
Jaco 81f5bf96f5 Adjust Struct loops (#4169) 2021-11-05 09:09:52 +02:00
Github Actions e935281b77 [CI Skip] release/beta 6.6.2-15
skip-checks: true
2021-11-05 06:23:39 +00:00
Jaco e132330c0b Update rpc mappings (#4168)
* Update rpc mappings

* spread
2021-11-05 08:07:57 +02:00
Github Actions 21594aa660 [CI Skip] release/beta 6.6.2-14
skip-checks: true
2021-11-04 14:14:02 +00:00
Jaco 6fb7989b41 Lazy decoration (part 9, rpc) (#4165)
* Lazy decoration (part 9, rpc)

* Flatten

* Cleanups (& bump dev, fix copy-to)

* Only RPC methods are lazy

* Decorate rpc-core lazily

* Adjust import

* Remove (now) invalid test
2021-11-04 15:59:05 +02:00
Github Actions 1f38a38bd5 [CI Skip] release/beta 6.6.2-13
skip-checks: true
2021-11-04 13:06:08 +00:00
Jaco e918aa8b14 Lazy decoration (part 10, Import lazy* from @polkadot/util) (#4166)
* Impot lazy* from @polkadot/util

* Bumps
2021-11-04 14:51:06 +02:00
Github Actions 4a33b18ac4 [CI Skip] release/beta 6.6.2-12
skip-checks: true
2021-11-04 09:36:06 +00:00
Jaco cb97fd1a48 Use new object utilities (as applicable) (#4161)
* Use new object utilities (as applicable)

* Extract utility functions

* Renames

* Comment cleanup

* Fix types
2021-11-04 11:20:03 +02:00
Github Actions 51600bc560 [CI Skip] release/beta 6.6.2-11
skip-checks: true
2021-11-04 09:01:50 +00:00
Jaco 12344ed980 Bump deps (dev & common) (#4162) 2021-11-04 10:43:42 +02:00
Github Actions 0b6773a744 [CI Skip] release/beta 6.6.2-10
skip-checks: true
2021-11-03 14:19:54 +00:00
Jaco 17a38e9c09 Rebump dev, rollup build fixes (#4158) 2021-11-03 16:01:27 +02:00
Github Actions 70499fe6ac [CI Skip] release/beta 6.6.2-9
skip-checks: true
2021-11-03 13:09:32 +00:00
Jaco 64493e0091 Bump dev (#4156) 2021-11-03 15:05:39 +02:00
Github Actions ae3efb31f8 [CI Skip] release/beta 6.6.2-8
skip-checks: true
2021-11-03 10:34:20 +00:00
Jaco 6da58d0698 Dedupe decorate for storage & storageAt (#4155)
* Dedupe decorate for storage & storageAt

* blockHash as last param

* Adjust

* Reorder

* Reorder
2021-11-03 12:16:27 +02:00
Github Actions 07f40c1429 [CI Skip] release/beta 6.6.2-7
skip-checks: true
2021-11-03 09:00:41 +00:00
Jaco f5f67e795e Lazy decoration (part 8, consistent call order) (#4153)
* Lazy decoration (part 8, consistent call order)

* Dedupe

* Flatten, no extra calls

* Dedupe more

* Adjust lazyVariants

* Additional flatten

* Adjust lazyVariants

* Reorder name/index

* Deupe strings

* Flatten createkeys

* Adjust
2021-11-03 10:47:04 +02:00
Github Actions 5b0652c272 [CI Skip] release/beta 6.6.2-6
skip-checks: true
2021-11-03 05:42:40 +00:00
Jaco 53ef5f7c56 Lazy decoration (part 7, augment optimize) (#4152)
* Lazy decoration (part 7, augment optimize)

* augment with generics

* Adjust
2021-11-03 07:26:02 +02:00
Github Actions 71f99875e4 [CI Skip] release/beta 6.6.2-5
skip-checks: true
2021-11-02 14:43:15 +00:00
Jaco a097075bfe Lazy decorate (part 6, API internals) (#4150)
* Lazy decorate (part 6, API internals)

* Rework tx decoration

* Adjust metadata decoration triggers

* Reformat registry lazy decoration

* storage
2021-11-02 16:29:08 +02:00
Jaco 527f840950 More internal reduce adjustments (#4149) 2021-11-02 16:13:20 +02:00
Github Actions 7fadc7eedb [CI Skip] release/beta 6.6.2-4
skip-checks: true
2021-11-02 11:37:04 +00:00
Jaco 35663319d9 Lazy decoration (part 5, augmentObject) (#4145)
* Lazy decoration (part 5, augmentObject)

* hasOwnProperty update

* Fix comments

* loop indexes

* Extract lazySection

* Use hasOwnProperty on is/as getters

* defineProperty helper

* Update defineProperty & use for loops

* skip/adjust for some keys
2021-11-02 13:21:16 +02:00
Github Actions b9d9670d18 [CI Skip] release/beta 6.6.2-3
skip-checks: true
2021-11-02 10:32:15 +00:00
Jaco fd027f452c Lazy decoration (part 3, derives) (#4142)
* Lazy decoration (part 3, prep for derives)

* Derives are lazy

* ... it should have derives

* dedupe api-derive lazy

* function -> inline

* Cleanup defineProperty

* Adjust

* Final readability tweaks

* ... I lied, alignment tweaks

* Exportable lazyDeriveSection

* lazy from @polkadot/types

* Adjust
2021-11-02 12:10:30 +02:00
Github Actions 10a6e03f85 [CI Skip] release/beta 6.6.2-2
skip-checks: true
2021-11-02 09:42:13 +00:00
Jaco 522eb8359f Lazy decoration (part 2, registry) (#4141)
* Lazy decoration (part 2)

* createCallFunction

* Remove previous gen

* WIP, registry dedup

* ... anbd with extrinsics

* Additional cleanups

* Creator

* This should be sharable with derive...

* getName

* Adjust

* lazy.ts in types/create

* Go crazy on comments...
2021-11-02 11:28:29 +02:00
Github Actions d1fd7f75af [CI Skip] release/beta 6.6.2-1
skip-checks: true
2021-11-02 08:05:34 +00:00
Jaco bb61b1e6ac Lazy decoration (part 1, metadata) (#4139)
* Make decoration lazy

* Extract common

* w/ Extrinsics

* Storage lazy

* V14 -> Latest

* Util

* Adjust to use create/lazy

* Adjust

* Add tests for errors & events (long-time outstanding)
2021-11-02 09:49:16 +02:00
Github Actions 7c17baa5be [CI Skip] release/beta 6.6.2-0
skip-checks: true
2021-11-02 05:56:45 +00:00
Jaco 9e7c0a1959 Lazy decoration (part 4, lazyMethod/lazyMethods) (#4144) 2021-11-02 07:35:32 +02:00
Github Actions db2e97bf66 [CI Skip] release/stable 6.6.1
skip-checks: true
2021-11-01 16:17:29 +00:00
Jaco 057f6b6041 6.6.1 (#4140)
* 6.6.1

* 6.6.1
2021-11-01 17:59:50 +02:00
Github Actions ca82336087 [CI Skip] release/beta 6.5.3-13
skip-checks: true
2021-11-01 09:50:27 +00:00
Jaco 761ceaeaa3 Internal adjustments (part 6) (#4138)
* Internal adjustments (part 6)

* Additional
2021-11-01 11:35:17 +02:00
Github Actions 0cbca0adb8 [CI Skip] release/beta 6.5.3-12
skip-checks: true
2021-11-01 09:21:33 +00:00
Jaco d24db4fd6a Internal adjustments (part 4) (#4136)
* Internal adjustments (part 3)

* Internal adjustments (part 4)

* Additional

* Additional

* Fix set encoding
2021-11-01 11:01:31 +02:00
Jaco 4a893b9feb Internal adjustments (part 5) (#4137) 2021-11-01 10:56:16 +02:00
Github Actions 71a0a84f26 [CI Skip] release/beta 6.5.3-11
skip-checks: true
2021-11-01 08:25:14 +00:00
Jaco 44d241f489 Internal adjustments (part 3) (#4135) 2021-11-01 10:03:13 +02:00
Github Actions a4cb5f558d [CI Skip] release/beta 6.5.3-10
skip-checks: true
2021-11-01 07:46:07 +00:00
Jaco aef4d07c48 Internal adjustments (part 2) (#4134) 2021-11-01 09:27:04 +02:00
Github Actions 6a5f1bbbf4 [CI Skip] release/beta 6.5.3-9
skip-checks: true
2021-10-31 05:15:37 +00:00
Jaco e60ef2d677 Optimize internal u8a decoding (#4131)
* Optimize internal u8a decoding

* linting

* tsc fixes & HexString usage

* yet more... it passes now (well... tsc & lint)
2021-10-31 06:58:14 +02:00
Github Actions f4622d05db [CI Skip] release/beta 6.5.3-8
skip-checks: true
2021-10-30 15:33:20 +00:00
Jaco 47d7900809 Adjust struct iterable creation (#4130) 2021-10-30 18:12:12 +03:00
Jaco 2c86e9347b Optimize Struct from Struct construction (#4128)
* Optimize Struct from Map constrcution

* Update packages/types/src/metadata/MetadataVersioned.ts

* CHANGELOG

* Only shortcut Struct

* tests
2021-10-30 17:50:37 +03:00
Github Actions 5827d298ad [CI Skip] release/beta 6.5.3-7
skip-checks: true
2021-10-29 15:25:42 +00:00
Jaco 60e0f69920 Adjust AbstractArray & Struct decoders (#4127)
* Adjust AbstractArray & Struct decoders

* Fixes, add Text & Bytes/Raw to shortcuts

* Additional

* Additional

* Remove debug log

* Revert extra arg, make CC happy

* BTreeSet
2021-10-29 18:06:57 +03:00
Github Actions 97f1ee17b0 [CI Skip] release/beta 6.5.3-6
skip-checks: true
2021-10-28 12:13:17 +00:00
Jaco 85215a308d Bump metadata (#4123) 2021-10-28 14:48:42 +03:00
Github Actions 89fa4edcf7 [CI Skip] release/beta 6.5.3-5
skip-checks: true
2021-10-28 11:05:51 +00:00
Jaco ec42fb9bff Update known Westend upgrade blocks (#4122) 2021-10-28 13:48:10 +03:00
Github Actions 96d696dbf3 [CI Skip] release/beta 6.5.3-4
skip-checks: true
2021-10-28 08:43:46 +00:00
Jaco b7992ecc0b Use lookupName in createClass (as available) (#4121)
* User lookupName in createClass (as available)

* CHANGELOG

* cleanups

* Adjust for Vecs

* Small check cleanups
2021-10-28 11:19:30 +03:00
Github Actions 0acae6e158 [CI Skip] release/beta 6.5.3-3
skip-checks: true
2021-10-26 12:58:10 +00:00
Jaco 6afea5043e Add and dedupe EthereumAddress (#4118)
* Add and dedupe EthereumAddress

* Override for Polkadot claims
2021-10-26 15:40:58 +03:00
Github Actions c9ee8d9942 [CI Skip] release/beta 6.5.3-2
skip-checks: true
2021-10-26 11:58:39 +00:00
Jaco 55f4e150c0 Split namespaces (#4116) 2021-10-26 14:42:18 +03:00
Github Actions 3e3e9c5f5a [CI Skip] release/beta 6.5.3-1
skip-checks: true
2021-10-26 10:40:54 +00:00
Jaco 66215890dd Correct construction of palletVersion keys (#4115) 2021-10-26 13:20:54 +03:00
Github Actions bf6c7ee0c3 [CI Skip] release/beta 6.5.3-0
skip-checks: true
2021-10-26 07:58:18 +00:00
Jaco f726edf725 Bump dev (#4113) 2021-10-26 10:42:23 +03:00
Github Actions d917861a77 [CI Skip] release/stable 6.5.2
skip-checks: true
2021-10-26 06:02:42 +00:00
Jaco 12a54efde5 Fix Struct decoding for null (#4112)
* Fix Struct decoding for null

* CHANGELOG

* 6.5.2
2021-10-26 08:46:03 +03:00
Github Actions 9ae87bed78 [CI Skip] release/beta 6.5.2-3
skip-checks: true
2021-10-25 14:27:40 +00:00
Jaco 7f5a52258c Adjust toHuman on Call (#4109) 2021-10-25 17:10:26 +03:00
Github Actions 2c212e6b4d [CI Skip] release/beta 6.5.2-2
skip-checks: true
2021-10-25 14:07:57 +00:00
Jaco 3d75744a20 Bump dev deps (#4108) 2021-10-25 16:51:05 +03:00
Github Actions d2ff259989 [CI Skip] release/beta 6.5.2-1
skip-checks: true
2021-10-25 12:08:53 +00:00
Jaco cac2ef30a1 Bump dev (#4106) 2021-10-25 14:44:47 +03:00
Github Actions ea38dedcc1 [CI Skip] release/beta 6.5.2-0
skip-checks: true
2021-10-25 06:15:30 +00:00
Jaco 0bd632e612 Allow for optional known RuntimeVersion on api.at (#4103)
* Allow for optional known RuntimeVersion on api.at

* CHANGELOG typo
2021-10-25 08:57:26 +03:00
Github Actions 4ce7163bb1 [CI Skip] release/stable 6.5.1
skip-checks: true
2021-10-24 18:18:36 +00:00
Jaco 72fbd3f829 6.5.1 (#4102) 2021-10-24 20:58:36 +03:00
Github Actions f20fadb51c [CI Skip] release/beta 6.4.3-9
skip-checks: true
2021-10-23 12:36:20 +00:00
Jaco 0e0183dc99 Adjust raw toAscii output (#4097) 2021-10-23 15:16:07 +03:00
Github Actions fa71e129c2 [CI Skip] release/beta 6.4.3-8
skip-checks: true
2021-10-23 11:39:43 +00:00
Jaco cb68842da6 Bump metadata (& deps) (#4096)
* Bump metadata (& deps)

* Bump deps
2021-10-23 14:18:20 +03:00
Github Actions 44f348ecc5 [CI Skip] release/beta 6.4.3-7
skip-checks: true
2021-10-22 11:48:06 +00:00
Jaco 891a6106f0 Ensure rpcCore correctly decorates .raw (#4091)
* Ensure rpcCore correctly decorates .json/.raw

* .raw encoding changes + memoization
2021-10-22 14:25:46 +03:00
Github Actions 90fcc234a9 [CI Skip] release/beta 6.4.3-6
skip-checks: true
2021-10-22 05:55:01 +00:00
Jaco 72fcd97cdb Add typeName to TypeDef (#4089)
* Add typeName to TypeDef

* Sanitize typeName

* Export typeName inside fuction args meta

* Correct typeName extraction
2021-10-22 08:35:09 +03:00
Github Actions 2ded2052b7 [CI Skip] release/beta 6.4.3-5
skip-checks: true
2021-10-21 11:53:24 +00:00
Jaco a8da5707f2 Add palletVersion to queries (#4088)
* Add palletVersion to queries

* Re-use raw key creator

* types

* Re-adjust test
2021-10-21 14:36:54 +03:00
Github Actions f508668c46 [CI Skip] release/beta 6.4.3-4
skip-checks: true
2021-10-21 10:14:53 +00:00
Jaco 15ed0723f1 Adjust Node Websocket options (frame sizes) (#4087) 2021-10-21 12:54:25 +03:00
Github Actions c9b0502542 [CI Skip] release/beta 6.4.3-3
skip-checks: true
2021-10-21 04:55:24 +00:00
Jaco 0d5a841a81 Expose extracted type names in PortableRegistry 2021-10-21 07:33:10 +03:00
Github Actions e47b8c1e73 [CI Skip] release/beta 6.4.3-2
skip-checks: true
2021-10-21 03:28:36 +00:00
Nikos Kontakis 50fe50d1a8 Add auction in shared types (#4085) 2021-10-21 06:07:51 +03:00
Github Actions 9e4669b8b4 [CI Skip] release/beta 6.4.3-1
skip-checks: true
2021-10-19 06:09:04 +00:00
Jaco 1e383315e2 Adjust convertSiV0toV1 import location (#4082) 2021-10-19 08:47:06 +03:00
Github Actions 6f66eb2b66 [CI Skip] release/beta 6.4.3-0
skip-checks: true
2021-10-19 05:37:39 +00:00
Jaco 0864340ae2 Adjust xcm version mapping utility (#4081) 2021-10-19 08:21:07 +03:00
Github Actions a3f5c65b5d [CI Skip] release/stable 6.4.2
skip-checks: true
2021-10-18 16:53:12 +00:00
JacoandAlexander Popiak 7f94137b2d Ensure SignerPayload correctly serializes Option with None (#4079)
* Ensure `SignerPayload` correctly serializes `Option` with `None`

* patch

* Update CHANGELOG.md

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
2021-10-18 19:35:56 +03:00
Github Actions d65587f58d [CI Skip] release/beta 6.4.2-1
skip-checks: true
2021-10-18 14:24:15 +00:00
Jaco 8959455401 Add Eth Block{0, 1, 2} and TransactionV{0, 1, 2} (#4078)
* Add Eth Block{0, 1, 2} and TransactionV{0, 1, 2}

* CHANGELOG
2021-10-18 17:06:53 +03:00
Github Actions 8e40e38bd6 [CI Skip] release/beta 6.4.2-0
skip-checks: true
2021-10-18 11:49:20 +00:00
Jaco c646717576 Explicit tests for metadata re-serialization (#4077)
* Explicit tests for metadata re-serialization

* Skip re-serialized

* Add asCallsOnly tests
2021-10-18 14:25:45 +03:00
Github Actions 4e7d6f03f5 [CI Skip] release/stable 6.4.1
skip-checks: true
2021-10-17 18:26:21 +00:00
Jaco cc3f258a5b 6.4.1 (#4074)
* 6.4.1

* 6.4.0  version bump

* CHANGELOG
2021-10-17 21:10:42 +03:00
Jaco 4c776c260d Bump dev (#4073) 2021-10-17 20:30:16 +03:00
Github Actions f2c636217c [CI Skip] release/beta 6.3.2-19
skip-checks: true
2021-10-17 12:23:45 +00:00
Jaco d7ab3bfbc1 Filter unused enum fields for v14 (#4071) 2021-10-17 15:05:29 +03:00
Github Actions 567504329d [CI Skip] release/beta 6.3.2-18
skip-checks: true
2021-10-17 12:03:08 +00:00
Jaco 5eb3534d8e Bump dev (w/ eslint 8) (#4070)
* Bump dev (w/ eslint 8)

* Additional linting

* Additional

* More lint fixes

* Last batch

* Additional

* Cleanups
2021-10-17 14:49:26 +03:00
Github Actions 806fda67e9 [CI Skip] release/beta 6.3.2-17
skip-checks: true
2021-10-16 07:07:51 +00:00
Jaco 5578d5d0ab Bump common (#4069) 2021-10-16 09:49:18 +03:00
Github Actions 39c540d453 [CI Skip] release/beta 6.3.2-16
skip-checks: true
2021-10-15 11:53:17 +00:00
Jaco 36a244fd75 Additional v14 types in derives (#4067) 2021-10-15 14:33:44 +03:00
Github Actions 84a0ab816e [CI Skip] release/beta 6.3.2-15
skip-checks: true
2021-10-15 07:33:33 +00:00
Jaco e305f2c11a Adjust crowdloan types to lookups (#4065)
* Adjust crowdloan types to lookups

* Remove debug hex...
2021-10-15 10:15:02 +03:00
Github Actions ed773dd158 [CI Skip] release/beta 6.3.2-14
skip-checks: true
2021-10-14 17:51:52 +00:00
Jaco 18056a8edd Statemint 5 as a patch (#4061) 2021-10-14 20:36:46 +03:00
Github Actions 96f3ce5b35 [CI Skip] release/beta 6.3.2-13
skip-checks: true
2021-10-14 07:03:28 +00:00
Jaco e7a78ae908 Ensure indexes are AccountIndex type (#4059) 2021-10-14 09:44:49 +03:00
Github Actions 295c9219c2 [CI Skip] release/beta 6.3.2-12
skip-checks: true
2021-10-13 14:27:37 +00:00
Jaco 99dc85ab4a Skip online tests 2021-10-13 17:12:33 +03:00
Jaco 16876cd0a0 Trigger, random test timeout 2021-10-13 16:54:58 +03:00
Jaco cb65fb450f Return multiple vesting schedules (#4057)
* Display multiple vesting schedules

* Derive with multiple vesting schedules

* Update
2021-10-13 16:31:41 +03:00
Github Actions 5bc2ad81f9 [CI Skip] release/beta 6.3.2-11
skip-checks: true
2021-10-13 04:45:17 +00:00
Jaco 03b98774bc Allow queries for new vesting (& prev & old...) (#4053) 2021-10-13 07:31:07 +03:00
Github Actions fb49f6bbe9 [CI Skip] release/beta 6.3.2-10
skip-checks: true
2021-10-12 13:42:59 +00:00
Jaco eb792102c8 New Polkadot 9110 upgrade block (#4051) 2021-10-12 16:22:24 +03:00
Jaco a12a258112 Remove Polkadot 9110 upgrade block (#4050)
* Remove Polkadot 9110 upgrade block

* 9111 blocks
2021-10-12 16:02:36 +03:00
Github Actions 018dd8a1c7 [CI Skip] release/beta 6.3.2-9
skip-checks: true
2021-10-12 11:23:25 +00:00
Jaco 7a100db4b4 Kusama 9110 pulled (#4049) 2021-10-12 14:00:47 +03:00
Github Actions 858a1d13c4 [CI Skip] release/beta 6.3.2-8
skip-checks: true
2021-10-12 04:53:50 +00:00
Jaco aa1630627a Add missing v14 metadata/runtime type link (#4048) 2021-10-12 07:38:04 +03:00
Github Actions c3af40ef50 [CI Skip] release/beta 6.3.2-7
skip-checks: true
2021-10-11 16:58:15 +00:00
Jaco 16534d6e5b npmjs crap... republish, yet again. 2021-10-11 19:40:16 +03:00
Github Actions eeb5f766da [CI Skip] release/beta 6.3.2-6
skip-checks: true
2021-10-11 14:05:02 +00:00
Jaco 03f41704c4 nmpjs apparently has a publishing fixe, let's check... 2021-10-11 16:46:51 +03:00
Github Actions 6b0c5fad2d [CI Skip] release/beta 6.3.2-5
skip-checks: true
2021-10-11 11:59:53 +00:00
Jaco 51165bf759 trigger... maybe npm wakes up this time... 2021-10-11 14:38:53 +03:00
Github Actions 7f45d995de [CI Skip] release/beta 6.3.2-4
skip-checks: true
2021-10-11 10:47:42 +00:00
Jaco e7b9c40dd9 Update .123trigger 2021-10-11 13:26:36 +03:00
Github Actions e7b66ceb89 [CI Skip] release/beta 6.3.2-3
skip-checks: true
2021-10-11 10:12:34 +00:00
Jaco d053b86e23 Use Si V1 in contracts (w/ PortableRegistry usage) (#3988)
* Use Si V1 in contracts (w/ PortableRegistry usage)

* Type id lookups

* Fix build & linting

* Remove extra .toNumber() (VSCode has gone crazy)

* v1 tests

* Cleanup parsing

* Explicit type cast for v1 types

* Unneeded toNumber

* Align events exposure with messages/constructors

* dedupe

* Re-add typedef extraction tests

* with typedefs

* Override for always primitives

* displayName improvements

* Versioned project

* New structure

* Fixes

* Cleanups

* Ensure API registry is the default used

* Adjust arg & return encoding/decoding

* Recursive contract

* DoNotConstruct to Si type
2021-10-11 12:50:09 +03:00
Github Actions 6a12aceae2 [CI Skip] release/beta 6.3.2-2
skip-checks: true
2021-10-10 11:19:03 +00:00
Jaco 7c6b64c6c8 Statemint v14 types (#4045)
* Statemint v14 types

* CHANGELOG

* v4 & v5

* Adjust
2021-10-10 13:59:58 +03:00
Github Actions 5495501e0c [CI Skip] release/beta 6.3.2-1
skip-checks: true
2021-10-10 10:08:34 +00:00
Jaco 6b7824fe4f Adjust contracts InstantiateReturnValue (#4044)
* Adjust contracts InstantiateReturnValue

* CHANGELOG
2021-10-10 12:50:47 +03:00
Github Actions 5f0b350a95 [CI Skip] release/beta 6.3.2-0
skip-checks: true
2021-10-10 09:46:13 +00:00
Jaco 85269716dd Kusama & Polkadot 9100/9110 upgrade blocks (#4043) 2021-10-10 12:25:48 +03:00
Github Actions 5b9f1544a3 [CI Skip] release/stable 6.3.1
skip-checks: true
2021-10-09 13:42:12 +00:00
Jaco 9943bda41f 6.3.1 (#4041)
* 6.3.1

* Set version
2021-10-09 16:26:33 +03:00
Github Actions b99e7a3cdb [CI Skip] release/beta 6.2.2-12
skip-checks: true
2021-10-09 13:08:09 +00:00
Jaco 1e491579c1 Adjust wildcard path matches (#4040) 2021-10-09 15:49:01 +03:00
Github Actions ef83cfbdc1 [CI Skip] release/beta 6.2.2-11
skip-checks: true
2021-10-08 07:49:23 +00:00
Jaco d10407a44f Bump deps (#4037)
* Bump deps

* Bump

* revamp comments

* Only use un-aliased primitives

* Revert "Only use un-aliased primitives"

This reverts commit 93d7e28f3a73351899789acc0914b75b421d4c11.
2021-10-08 10:31:11 +03:00
Github Actions 068af8b2ab [CI Skip] release/beta 6.2.2-10
skip-checks: true
2021-10-08 05:37:11 +00:00
Jaco d9f4d3e08b Adjust xcm Fungibility (#4035)
* Adjust xcm Fungibility

* V1 & V2

* Align with master
2021-10-08 08:17:49 +03:00
Github Actions fa79f35ec2 [CI Skip] release/beta 6.2.2-9
skip-checks: true
2021-10-07 13:50:37 +00:00
Jaco 8c2c2afc37 Swap Xcm to defaults instead of V0, Polkadot runtime 9100+ (#4033)
* Swap Xcm to V1 (defaults), Polkadot runtime 9100+

* V1/V2 (latest is V1 at 9100)

* Various versions

* formatting

* V1 <= 9105, V2 >= 9106
2021-10-07 16:29:18 +03:00
Github Actions 5157d8c3f0 [CI Skip] release/beta 6.2.2-8
skip-checks: true
2021-10-07 10:05:48 +00:00
Jaco bb303361e2 queryMulti via api.at (#4031)
* queryMulti via api.at

* checkTypes

* Kusama & Polkadot added

* Revert "Kusama & Polkadot added"

This reverts commit f7f2c30290d455bad50bb0b8bb1965d65b4d2ae2.
2021-10-07 12:49:43 +03:00
Github Actions ad587b0673 [CI Skip] release/beta 6.2.2-7
skip-checks: true
2021-10-07 08:32:37 +00:00
Jaco ae5cf270f0 Bump static metadata (#4030)
* Bump static metadata

* Rebuild

* Polkadot & Kusama added
2021-10-07 11:12:08 +03:00
Github Actions 9fc33ac53a [CI Skip] release/beta 6.2.2-6
skip-checks: true
2021-10-06 11:28:59 +00:00
Jaco 60d4da934a Single getMetadata on parallel same-hash queries (#4026) 2021-10-06 14:12:13 +03:00
Github Actions 550d17d349 [CI Skip] release/beta 6.2.2-5
skip-checks: true
2021-10-06 10:07:11 +00:00
Jaco ce8a2b5e4f Dedupe findCall/findError (#4028) 2021-10-06 12:46:28 +03:00
Github Actions 4c4994e63c [CI Skip] release/beta 6.2.2-4
skip-checks: true
2021-10-06 08:54:45 +00:00
Jaco df9b6959d1 Expose findCall/findError on api.at (#4027)
* Expose findCall/findError on api.at

* Move findError/findCall
2021-10-06 11:36:18 +03:00
Github Actions 6a583ee594 [CI Skip] release/beta 6.2.2-3
skip-checks: true
2021-10-06 06:13:47 +00:00
Jaco affa6ab1bd Mark api.query.<section>.<method>.at as deprecated (#4023)
* Use api.at internally for sizeAt/entriesAt/keysAt

* Remove debug logs

* Mark api.query.<section>.<method>.at as deprecated

* formatting

* @deprecated formatting

* commenting
2021-10-06 08:53:50 +03:00
Github Actions 407aca37c1 [CI Skip] release/beta 6.2.2-2
skip-checks: true
2021-10-05 07:57:23 +00:00
Jaco 246dfaf943 Use api.at internally for sizeAt/entriesAt/keysAt (#4022)
* Use api.at internally for sizeAt/entriesAt/keysAt

* Remove debug logs
2021-10-05 10:35:23 +03:00
Github Actions a05fff302f [CI Skip] release/beta 6.2.2-1
skip-checks: true
2021-10-05 06:16:34 +00:00
Jaco d45a9cfe58 Rework derives to ensure cached registries (#4021) 2021-10-05 08:57:30 +03:00
Github Actions 32881d73a0 [CI Skip] release/beta 6.2.2-0
skip-checks: true
2021-10-04 12:58:03 +00:00
Jaco e568ffe23f Static substrate bump (#4018) 2021-10-04 15:35:56 +03:00
Github Actions 8475130a22 [CI Skip] release/stable 6.2.1
skip-checks: true
2021-10-04 08:33:37 +00:00
Jaco a7e824ff09 6.2.1 (#4016)
* 6.2.1

* CHANGELOG

* Bump static metadata

* CHANGELOG
2021-10-04 11:17:55 +03:00
Alexander Popiak 9d5fb2bf72 Add asset id in signing (#4009)
* add assetId to SignerOptions

* pull assetId into extrinsic signing

* set assetId to optional AnyNumber throughout

* add logging of extrinsic options

* add assetId to _injectSignature & add getters

* re-add import

* longer doc comments
2021-10-04 10:02:28 +03:00
Github Actions 2cf0e306dd [CI Skip] release/beta 6.1.3-3
skip-checks: true
2021-10-01 10:17:38 +00:00
Jaco 72d5330727 Use lookup types in derives (#4012)
* Use lookup types in derives

* additional

* society
2021-10-01 13:02:24 +03:00
Github Actions 1c3bdda08f [CI Skip] release/beta 6.1.3-2
skip-checks: true
2021-10-01 08:51:17 +00:00
Jaco 668ad3dfe5 Handle plain multi queries diguised as map-form (#4011) 2021-10-01 11:29:12 +03:00
Github Actions 651afaeb9a [CI Skip] release/beta 6.1.3-1
skip-checks: true
2021-09-30 06:54:52 +00:00
Jaco 5036aa9ef4 Better error messages for misformed queries (#4007)
* Better error messages for misformed queries

* Cater for raw function (no meta)
2021-09-30 09:39:13 +03:00
Github Actions 3598cc25f4 [CI Skip] release/beta 6.1.3-0
skip-checks: true
2021-09-29 12:28:47 +00:00
Jaco 987a2ec2df Adjust multi to infer return types (#4002)
* Adjust multi to infer return types

* some linting

* Additional

* Dedupe
2021-09-29 14:07:29 +02:00
Github Actions 389c4c5255 [CI Skip] release/stable 6.1.2
skip-checks: true
2021-09-29 08:08:58 +00:00
Jaco 493287cedf 6.1.2 (#4001) 2021-09-29 09:50:25 +02:00
Github Actions fe52dc8006 [CI Skip] release/beta 6.1.2-3
skip-checks: true
2021-09-29 06:08:50 +00:00
Jaco f26008ab95 Fix .at queries/decoration for pre-V13 metadata (#4000)
* Fix `.at` queries/decoration for pre-V13 metadata

* fields fix (or rather... protection against upcoming change)
2021-09-29 07:46:13 +02:00
Github Actions 0952720237 [CI Skip] release/beta 6.1.2-2
skip-checks: true
2021-09-27 11:20:10 +00:00
Jaco 04058fe95e Bump metadata (#3996)
* Bump metadata

* Ensure WrapperOquaque is applied

* Use field for mapping

* Handle WrapperOpaque

* Adjust
2021-09-27 13:02:18 +02:00
Github Actions eb96371e59 [CI Skip] release/beta 6.1.2-1
skip-checks: true
2021-09-27 09:20:29 +00:00
Jaco a313fe13e7 Add support for WrapperOpaque (#3997)
* Add support for WrapperOpaque

* Dedupe dual params

* Adjust case

* Re-adjust to Vec
2021-09-27 11:02:37 +02:00
Github Actions 243c263485 [CI Skip] release/beta 6.1.2-0
skip-checks: true
2021-09-27 06:31:40 +00:00
Jaco 311d8b792c Additional types for bridges (#3995) 2021-09-27 08:08:42 +02:00
Github Actions 878f631745 [CI Skip] release/stable 6.1.1
skip-checks: true
2021-09-27 05:54:41 +00:00
Jaco d7753839a2 6.1.1 (#3994)
* 6.1.1

* bumps
2021-09-27 07:36:47 +02:00
Github Actions fc74d88bbb [CI Skip] release/beta 6.0.6-4
skip-checks: true
2021-09-24 08:24:35 +00:00
HackFisher 47bbeee14b fix OutboundLaneData types (#3992) 2021-09-24 10:05:56 +02:00
Github Actions ba01620ba1 [CI Skip] release/beta 6.0.6-3
skip-checks: true
2021-09-23 09:30:55 +00:00
Jaco 6e66387a8d CHANGELOG (#3986) 2021-09-23 11:10:10 +02:00
Github Actions c58687b3c6 [CI Skip] release/beta 6.0.6-2
skip-checks: true
2021-09-22 09:22:01 +00:00
Jaco 2801088b0a Scale-info v0 -> v1 conversion (as needed by contracts) (#3987)
* Scale-info v0 -> v1 conversion (as needed by contracts)

* Renames

* V1 types same as v0 where applicable
2021-09-22 11:01:39 +02:00
Github Actions fc5af92a03 [CI Skip] release/beta 6.0.6-1
skip-checks: true
2021-09-22 04:07:20 +00:00
Furqan A 8f8bb2aa23 fix: fixed 404 to the docs from the api readme (#3985) 2021-09-22 06:48:18 +03:00
Github Actions 3f69b3fc73 [CI Skip] release/beta 6.0.6-0
skip-checks: true
2021-09-20 18:48:01 +00:00
Jaco 4ea170a83a Add childstate_getStorageEntries RPC (#3980)
* Add `childstate_getStorageEntries` RPC

* Remove extra ,
2021-09-20 20:33:30 +02:00
Github Actions 26649c429a [CI Skip] release/stable 6.0.5
skip-checks: true
2021-09-20 13:57:16 +00:00
Jaco 7c57778389 6.0.5 (#3977) 2021-09-20 15:38:54 +02:00
Github Actions dbb5d66de3 [CI Skip] release/stable 6.0.4
skip-checks: true
2021-09-20 09:10:12 +00:00
Jaco 6bc92a6d31 6.0.4 (#3975)
* 6.0.4

* Update CHANGELOG.md
2021-09-20 10:53:34 +02:00
Github Actions 6462327ea5 [CI Skip] release/beta 6.0.4-1
skip-checks: true
2021-09-20 06:17:50 +00:00
Jaco 3b4c2ac323 Extract getSiName conversion (#3974) 2021-09-20 07:56:33 +02:00
Github Actions d0ecfdafc1 [CI Skip] release/beta 6.0.4-0
skip-checks: true
2021-09-20 05:19:55 +00:00
Jaco 870bb8d3cb User api.at for all .at queries (#3973) 2021-09-20 06:59:35 +02:00
Github Actions 2fdb68d3bc [CI Skip] release/stable 6.0.3
skip-checks: true
2021-09-19 19:47:24 +00:00
Jaco 6ef410e375 Share TypeSpec between registry instances (#3972)
* Share TypeSpec between registry instances

* 6.0.3
2021-09-19 21:29:11 +02:00
Github Actions 962c741139 [CI Skip] release/beta 6.0.3-0
skip-checks: true
2021-09-19 06:38:13 +00:00
Jaco 598e69002a Formatting for metadata documentation (#3969)
* Formatting for metadata documentation

* unwrap
2021-09-19 08:18:13 +02:00
Github Actions f6e50f14b5 [CI Skip] release/stable 6.0.2
skip-checks: true
2021-09-18 09:12:35 +00:00
Jaco caec49a8dc Fix Substrate key generation (#3968)
* Fix Substrate key generation

* 6.0.2
2021-09-18 10:56:35 +02:00
Github Actions 0865b91f88 [CI Skip] release/stable 6.0.1
skip-checks: true
2021-09-18 05:26:37 +00:00
Jaco 6b45d5606d 6.0.1 (#3966) 2021-09-18 08:08:57 +03:00
Github Actions a22f66f044 [CI Skip] release/beta 5.9.2-10
skip-checks: true
2021-09-17 14:58:58 +00:00
Jaco 41fd67c24e Bump deps (#3965) 2021-09-17 16:40:46 +02:00
Github Actions 19e7d6dbdb [CI Skip] release/beta 5.9.2-9
skip-checks: true
2021-09-17 05:02:17 +00:00
Jaco 8fea8872fc Additional augmentation fixes (#3964)
* Additional augmentation fixes

* Update packages/api/src/checkTypes.manual.ts
2021-09-17 06:44:49 +02:00
Github Actions d17fc3b63b [CI Skip] release/beta 5.9.2-8
skip-checks: true
2021-09-17 04:18:28 +00:00
Jaco f8e012cf87 Ensure lookup augmentation is exported (#3963) 2021-09-17 05:59:59 +02:00
Github Actions 830af4a928 [CI Skip] release/beta 5.9.2-7
skip-checks: true
2021-09-16 05:14:13 +00:00
Jaco 345c536380 Fix v13 toCallsOnly path (#3957) 2021-09-16 06:57:13 +02:00
Github Actions d527a02d2f [CI Skip] release/beta 5.9.2-6
skip-checks: true
2021-09-15 17:05:19 +00:00
Jaco 22aafbdd4c Parsing for metadata v14 (#3759)
* Adjust

* Better, need a BoundedVec solution...

* Composites

* Storage optional types

* Better... not perfect

* v14 tests passing

* Always perform asLatest

* Keep portable registry seperate

* Cleanup derived types

* Cleanups

* Adjust

* Cleanups

* Pass wraps

* Rename types (PortableRegistry) -> lookup

* Back on-track...

* SiLookup strings

* Allow building

* unsafe create on registry

* createTypeUnsafe typing

* Adjust

* Fix bool check

* Remove WrappedConstructor

* Additional

* Additional cleanups

* On-demand even type creation

* Rework

* Adjust

* Revert createClass to master (with adjustments)

* Running through v14

* Registry from master

* Run against v14

* Adjust

* Adjust

* Adjust generation (non-complete)

* Adjust

* Definition from metadata (round 1)

* Some linting fixes

* v13

* Adjust

* Dedupe

* Some linting

* Additional linting (md generation, not all)

* md additional

* calls update

* Additional linting

* Cleanups

* Remove extra arg

* Remove unneeded assert

* Revert < 12 index adjustments

* Cleanups

* v13 compat types

* Some tests

* Registry revert

* Additional test fixes

* Adjust sorting

* Adjust tests with lookups

* CodeClimate cleanups

* Additional tests

* Compat with prev-generation args

* Error & events compat args

* Fix Error/Event metadata creation

* Fix lookup circular

* Registry types

* Adjust

* Adjust lookup generation

* Short-circuit full type (with lookupIndex)

* Defaults for type expansion

* Tuple with extra spaces removed

* Fill in generated types

* Checks

* Adjust generation

* Adjust tests

* Adjust

* Adjust type encoding

* Adjust

* Use registry for name generation

* Update v13 lookup generation

* Adjust looup with typeDef (optional)

* Format lookup definitions

* Start with TS interface generation

* Adjust

* Adjust

* Adjust

* Don't short-cisrcuit type evaluation

* Adjust

* Correct plain imports

* Adjust

* Don't remove already-set lookupName

* Bytes

* Cleanups

* Adjust with unused

* Embed non-named structs

* Enum without name throws error

* Case-sensitivity on path duplication

* s/lookupNameOrig/lookupNameRoot/

* Don't export Lookup* type interfaces

* Shortcut lookup

* Adjust

* Revert api/Decorate

* Adjust import name generation

* Don't clobber root lookups

* Root exports

* Remove duplicated fields creation

* Adjust less-important name parts

* Cleanups & imports

* Adjust with correct imports

* Storage optionality

* Rebuild, fix (some) tests

* Extract identity BitFlags

* Additional cleanups

* Adjust

* No IdentityFields override

* v13 for extrinsic test

* Dedupe getUniqTypes

* Simplify?

* Adjust

* Update sorting

* Adjust expansion

* Dedupe

* Strip generics, sub-part * matching

* Name matching

* Align

* Adjust set matching

* hex/json split

* naming

* v13 for extrinsic injection test

* Adjust test signature

* Dedupe tests

* Adjust

* Update import

* augment @polkadot/types/lookup

* Sort import names

* Handle BitSequence in PortableRegistry

* Use Kusama-dev v14 metadata

* Merge bitSequence support

* Polkadot/Substrate split

* Template formatting

* Hobbling along

* Adjust

* Recode subs

* Fix circular in dual fashion

* Adjust

* Also generate Substrate

* Exclude Substrate types from Polkadot

* Remove duplicate phantoms

* Cleanup lookup typegen

* Additional

* Extract names with params (as applicable)

* Ensure path is always available

* renames

* Metadata v14 only has combined Map

* v14 Map conversion de-duped

* Substrate Map conversion

* v13 tests

* Apply suggestions from code review

* Housekeeping

* v14 bump

* NMap -> Map (& others removed)

* Adjust generation

* Decorate linting

* Tuple & non-tuple types

* hashers check

* Condense

* Additional asTuple check

* Consistent pre-v14 Map handling

* Fix metadata tests

* Fix (some) tests

* Fix test expectations

* Fail create early

* Additional fixes

* Additional

* Movement

* Remove CodecArg

* Dump it

* Apply param expansion

* Remove only

* Allow no-args to StorageKey

* linting

* multi fixes

* Map adjustments

* Rebuild

* Rebuild

* Rebuild

* Latest

* Bump metadata

* Rewrite

* Fix lookup formatting

* Rebuild after merge

* Latest substrate v14

* Rebuild

* Rebuild (+ no enum trailing ,)

* trigger

* Fix JSON checks

* Remove unneeded check

* Bump Kusama/Polkadot

* Dedupe testUtil

* Metadata v14
2021-09-15 19:46:48 +03:00
Github Actions 88e5b26532 [CI Skip] release/beta 5.9.2-5
skip-checks: true
2021-09-15 09:46:16 +00:00
Jaco a203168126 Add RuntimeEnvironmentUpdated to Digest (#3955)
* Add RuntimeEnvironmentUpdated to Digest

* CHANGELOG
2021-09-15 11:34:13 +02:00
Github Actions 538544be84 [CI Skip] release/beta 5.9.2-4
skip-checks: true
2021-09-15 08:58:54 +00:00
Jaco 264bbf12c9 Bump static metadata (#3954) 2021-09-15 10:49:18 +02:00
Github Actions 5c144a8ae7 [CI Skip] release/beta 5.9.2-3
skip-checks: true
2021-09-15 03:43:12 +00:00
Ian He f28d648fac HttpProvider support clone() (#3949)
* HttpProvider support clone()

* fix lint
2021-09-15 06:31:35 +03:00
Github Actions f695cd0835 [CI Skip] release/beta 5.9.2-2
skip-checks: true
2021-09-14 12:00:39 +00:00
Jaco 44fdbdffd5 Bump deps (#3952) 2021-09-14 13:48:53 +02:00
Github Actions ee5ae49df7 [CI Skip] release/beta 5.9.2-1
skip-checks: true
2021-09-14 06:53:58 +00:00
Jaco febcabe109 Allow null values in bundles min/max (#3950)
* Allow null values in bundles min/max

* Adjust bundle type definition

* Backwards compat

* Lenient types
2021-09-14 08:43:56 +02:00
Github Actions 367efda128 [CI Skip] release/beta 5.9.2-0
skip-checks: true
2021-09-13 11:58:27 +00:00
Jaco 3583e758cd IdentityInfo <= Substrate 198 (#3947) 2021-09-13 13:46:49 +02:00
Github Actions d6fe638c5b [CI Skip] release/stable 5.9.1
skip-checks: true
2021-09-13 06:04:16 +00:00
Jaco ea72e3eb5b 5.9.1 (#3944) 2021-09-13 07:53:34 +02:00
Github Actions 45c0e16ecd [CI Skip] release/beta 5.8.4-4
skip-checks: true
2021-09-11 09:54:45 +00:00
Branan Riley 5b1823f7eb Add proxy type for Centrifuge (#3940) 2021-09-11 12:42:44 +03:00
Github Actions 6e998cce3d [CI Skip] release/beta 5.8.4-3
skip-checks: true
2021-09-11 07:45:40 +00:00
Jaco c46740e4e8 Adjust Xcm Error enum types (#3943) 2021-09-11 09:36:15 +02:00
Github Actions 4e5b98725b [CI Skip] release/beta 5.8.4-2
skip-checks: true
2021-09-08 06:18:18 +00:00
Jaco fca973cd53 Enhance type narrow checks (#3939) 2021-09-08 08:07:07 +02:00
Github Actions d1c9a507d9 [CI Skip] release/beta 5.8.4-1
skip-checks: true
2021-09-07 07:54:42 +00:00
Jaco 2cfd2f4d20 DisputeState types (#3937) 2021-09-07 09:43:52 +02:00
Github Actions d3b90c068f [CI Skip] release/beta 5.8.4-0
skip-checks: true
2021-09-07 07:27:46 +00:00
Jaco 3127c00d05 Polkadot 9090 upgrade (#3936) 2021-09-07 09:16:05 +02:00
Github Actions 3cdf3065d7 [CI Skip] release/stable 5.8.3
skip-checks: true
2021-09-06 12:43:42 +00:00
Jaco 973b1fcffb 5.8.3 (#3935) 2021-09-06 14:32:02 +02:00
1054 changed files with 105138 additions and 33282 deletions
+22 -2
View File
@@ -1,11 +1,14 @@
32
39
1.4.2
1.6.2
1.11.2
1.12.2
1.17.2
1.31.2
2.8.2
3.2.2
3.2.3
3.3.2
@@ -17,6 +20,7 @@
3.9.2
3.9.3
3.10.2
4.0.2
4.0.3
4.6.2
@@ -27,4 +31,20 @@
5.3.2
5.5.2
5.8.2
5.8.2
5.8.3
6.0.2
6.0.3
6.0.4
6.0.5
6.1.2
6.4.2
6.5.2
6.7.2
6.9.2
6.10.2
6.10.3
7.0.2
+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: {
+1 -1
View File
@@ -2,7 +2,7 @@ name: 'Lock Threads'
on:
schedule:
- cron: '30 1/2 * * *'
- cron: '10 1/3 * * *'
jobs:
lock:
+1
View File
@@ -15,6 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: ${{ matrix.step }}
env:
+1 -1
View File
@@ -1,7 +1,7 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 2/2 * * *'
- cron: '55 1/3 * * *'
jobs:
stale:
+2 -1
View File
@@ -21,6 +21,7 @@ tmp/
cc-test-reporter
lerna-debug.log*
npm-debug.log*
package-lock.json
tsconfig*buildinfo
yarn-debug.log*
yarn-error.log*
package-lock.json
+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
+768
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.1.1.cjs
+469
View File
@@ -1,7 +1,476 @@
# CHANGELOG
## 7.5.1 Jan 23, 2022
Upgrade priority: Low. Recommended for users of the latest contract pallet and ink! versions.
Contributed:
- Add additional namespaced contract tests (Thanks to https://github.com/VargSupercolony)
Changes:
- Adjust `Registry` consistency, augment extensions
- Add `.multi` support on `api.at(...).<section>.<method>`
- Add support for ink! metadata V3 with payable constructors
- Cleanup ink! metadata parsing, allowing for easier extension
- Expose `contract.{query, tx}.<method>.meta`, aligning with API
- Fix storage metadata, aligning method with decorated name
- Adjust typegen, only using exportInterface
- Added Kusama/Polkadot 9151 upgrade block (known types)
- Update to latest Substrate, Kusama & Polkadot static metadata
## 7.4.1 Jan 15, 2022
Upgrade priority: Medium. Required for all chains using `Range` and `RangeInclusive` types. Also includes better error handling for number conversions.
Changes:
- Asserts for invalid number format inputs (MAX_SAFE_INTEGER, float)
- Ensure `Range/RangeInclusive` variant check does not fail on encoding
- Ensure non-option calls in api-contract are marked as `@deprecated`
- Added Kusama 9150 upgrade block (known types)
- Update `@polkadot/util` to 8.3.2
## 7.3.1 Jan 9, 2022
Upgrade priority: Low. Maintenance upgrade, tracking the latest `@polkadot` libraries.
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.
Changes:
- Update `@polkadot/util-crypto` with TS compilation work-around
## 6.9.1 Nov 21, 2021
Upgrade priority: Medium. Recommended for metadata v14 parachains. For TS users, the package now support TypeScript 4.5.2 and allows extraction of user types from metadata v14.
Contributed:
- Lookup TS generation for all metadata v14 chains (Thanks to https://github.com/savudani8)
- Update `BeefySignedCommitment` type (Thanks to https://github.com/czl1378)
Changes:
- Adjust runtime `*::{Call, Event}` matching for metadata v14
- Adjust derive decoration with (optional) known methods
- Expose `*{Call, Event, Error}` TS types for metadata v14
- Align Option `.toJSON` output with Substrate input
- Optimize Enum, Struct, Option & Number decoding paths
- Ajust PascalCase conversions with function from util
- Prepare pre-v13 types for optional injection
- Adjustments for TS 4.5.2 support (flatten type infers)
## 6.8.1 Nov 11, 2021
Upgrade priority: Low. Recommended for chains with non-MultiSignature variants where `paymentInfo` is required.
Changes:
- Adjust `paymentInfo` signatures to cater for non-MultiSignature variants
- Remove `::generic::` from names & namespaces under metadata v14
- Add Polkadot 9122 upgrade block
- Cleanup Polkadot/Kusama/Westend/Rococo known types (>= v14 metadata)
- Internal `decorateMethod{Promise, Rx}` renamed to `to{Promise, Rx}Method`
- Add RPC provider-level LRU for historic requests
- Add optional known runtime version param to internal `rx.queryAt`
## 6.7.2 Nov 9, 2021
Upgrade priority: Low. Recommended for chains on metadata v14 with non-default `Address` implementations.
Changes:
- Detect `AccountId` & `Address` types via `SpRuntime*` definitions
- Adjust api-derive call ordering when using `.queryAt`
## 6.7.1 Nov 7, 2021
Upgrade priority: Low. Internal maintenance updates, focussed on internal optimizations.
Changelog:
- Optimize Extrinsic & block handling (Thanks to https://github.com/nazar-pc)
- Add `account::AccountId20` mapping (Thanks to https://github.com/joelamouche)
Changes:
- Use new-gen `voteLockingPeriod` in democracy derives (as available)
- Dynamically inject getters for `Extrinsic` payloads
- Optimize caching for complex constructed type classes per registry
- Convert metadata, rpc and api to use lazy decoration
- Split u8a decoding paths for `Vec` (different from general path)
- Keep track of initial u8a decoded length inside base Codecs
- Extract multi property assignments for `Struct`, `Set`, `Json` & `Enum`
- Move `PortableRegistry` location inside `@polkadot/types/metadata`
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.6.1 Nov 1, 2021
Upgrade priority: Low. Internal maintenance updates.
Changes:
- Fix construction for `palletVersion` keys with correct prefix
- Add Polkadot `EthereumAddress` as a known `PortableRegistry` override
- De-dupe `PortableRegistry` namespace splitting operations
- Optimize internal `AbstractArray` & `Struct` u8a decoding
- Shortcut `Struct` construction from `Struct` instance
- Use internal `lookupName` in `createClass` (allows deeply recursive lookups)
- Codec `toHex()` will now correctly return the TS `HexString` type
- Update known upgrade blocks for Westend & Kusama
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.5.2 Oct 26, 2021
Upgrade priority: Low. Recommended for users with `.at` queries on unknown blocks.
Changes:
- Adjust `toHuman` on `Call` to return names & (not only) values
- Allow for optional known `RuntimeVersion` to short-circuit `api.at`
- Ensure `Struct` decodes fully on `null` input (equivalent to `undefined` & `{}`)
## 6.5.1 Oct 24, 2021
Upgrade priority: Low. Internal maintenance upgrades.
Contributed:
- Add `Auction` to Polkadot pre-0.9.11 `ProxyType` (Thanks to https://github.com/wirednkod)
Changes:
- Ecah module now exposes the Substrate-added `palletVersion` storage item
- Adjust Websocket `maxReceivedFrameSize` under Node
- `TypeDef` structures now contain the `typeName` from metadata v14 on fields
- Fix browser bundle imports for xcm-mapping (move to `types-known`)
- Expose all extracted type names in `PortableRegistry`
- Adjust `toJSON` (Ascii) output detection on `Raw`
- Adjust `api.rpc.*.*.raw(..args)` return to the actual over-the-wire JSON result
- Remove `api.rpc.*.*.json(..args)` since it now overlaps with new `.raw`
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.4.2 Oct 18, 2021
Upgrade priority: Low. Recommended for Westmint runtime 500+
Changes:
- Ensure `SignerPayload` correctly serializes `Option` with `None`
- Add Ethereum `BlockV{0, 1, 2}` types, aligning with latest Frontier
- Additional tests for metadata serialization/de-serialization
## 6.4.1 Oct 17, 2021
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9110+
Changes:
- Adjust Statemint known types for version 4+
- Adjust balance derives to return multiple vesting schedules
- Adjust crowdloan derives to use paged key retrieval
- Ensure account indices (derived) are `Accountindex` types
- Adjust metadata v14 to include top-level type field from metadata
- Filter metadata v14 unused enum fields in TS generation
- Adjust derives to use more metadata v14 types on returns
- Add Kusama & Polkadot upgrade blocks for 9100/9110
- Align contract usage with latrest `PortableRegistry` (remove old-generation)
- Adjust contracts `InstantiateReturnValue` type (no rent projection after 267)
- Adjust for eslint v8 checks
- Don't run any online tests on CI by default (uncontrolled external dependencies)
## 6.3.1 Oct 9, 2021
Upgrade priority: Low. Recommended for Kusama & Polkadot runtime 9100+
Changes:
- Mark `api.query.*.*.at` as deprecated (use `api.at`)
- Expose `queryMulti`, `findError` and `findCall` on `api.at`
- Optimize parallel metadata retrieval/decoration
- Rework derive `.at` to ensure no additional metadata calls
- Adjust Xcm types for Kusama, Polkadot, Westend (V1 & V2 usage)
- Fix Xcm Fungibility type
- Add upgrade blocks for Westend
- Prepare for v14 metadata swap in Kusama/Polkadot (9110 runtime)
- Adjust metadata wilcard path matching (event extraction)
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.2.1 Oct 4, 2021
Upgrade priority: Low. Maintenance updates.
Contributed:
- Cater for new asset fee payment extension (Thanks to https://github.com/apopiak)
Changes:
- Extend error messages for malformed `queryMulti` inputs
- Correctly handle non-map queries passed to `queryMulti` in map form
- Use new metadata v14 lookup type in derive results
- Adjust definitions to infer TS types in `.multi` queries
- Fix TS lookup enum generation with nested Option & Tuple
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.1.2 Sep 29, 2021
Upgrade priority: Low. Recommended for 6.x users using historic queries.
Changes:
- Fix `.at` queries/decoration for pre-V13 metadata
- Added `BridgeMessageId` & `SpecVersion` types for bridges
- Added `WrapperOpaque` encoding/decoding (as per latest Substrate)
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 6.1.1 Sep 27, 2021
Upgrade priority: Low. Minor maintenance changes from the 6.0.x versions.
Contributed:
- Adjust bridges `OutboundLaneData` type (Thanks to https://github.com/HackFisher)
- Fix README 404 (Thanks to https://github.com/nblogist)
Changes:
- Add `childstate_getStorageEntries` RPC
- Allow for scale-info v0 -> v1 conversion
## 6.0.5 Sep 20, 2021
Upgrade priority: Low. Recommended for all users on 6.0.4 using `api.query.*.*.at` calls
Changes:
- Revert cross-registry (now-inactive) change introduced in 6.0.3
- Ensure `Option` is correctly imported for TS query generation
## 6.0.4 Sep 20, 2021
Upgrade priority: Low. Recommended for all users on 6.0.3 using `api.query.*.*.at` calls
Changes:
- `api.query.<module>.<method>.at` will now use `at.at(<hash>)`
- Use and expose `metadata/util/getSiName` to get human type names
## 6.0.3 Sep 19, 2021
Upgrade priority: Low. Recommended for all users on 6.0.2 using `api.query.*.*.at` calls
Changes:
- Fix `api.query.<module>.<method>.at` queries
- Adjust typegen formatting for metadata documentation
## 6.0.2 Sep 18, 2021
Upgrade priority: Low. Recommended for all users on 6.0.1, especially those using `api.query.substrate.*` calls
Changes:
- Fix `api.query.substrate.*` key generation
## 6.0.1 Sep 18, 2021
Upgrade priority: Low. Recommended for users of the latest Substrate/Polkadot with Metadata v14.
- **Important** The Metadata v14 change allows the metadata to expose the chain types. This has been a major overhaul of the metadata handling, hence the major version bump.
Contributed:
- Allow for `.clone` on Http provider (Thanks to https://github.com/ianhe8x)
Changes:
- Allow for Metadata v14 parsing & usage
- Align `DigestItem` to latest Substrate
- Adjust Kusama `IdentityInfo` type for historic versions
- All `null` values in bundles min/max
- Bump static metadata for latest Substrate, Polkadot & Kusama
## 5.9.1 Sep 13, 2021
Upgrade priority: Low. Recommended for chains using Xcm.
Contributed:
- Adjust Centrifuge `ProxyType` (Thanks to https://github.com/branan)
Changes:
- Additional types for parachain Disputes
- Adjust Xcm Error enum types
- Add Polkadot 9090 upgrade block
- Decoding enhancements with narrowing checks for TS
## 5.8.3 Sep 6, 2021
Upgrade priority: Low.
Changes:
- Adjust Statemint, Rococo and Westend Xcm overrides
## 5.8.2 Sep 6, 2021
Upgrade priority: Low.
Contributed:
- Correct Xcm V1 `MultiLocation` definitions (Thanks to https://github.com/apopiak)
+92
View File
@@ -0,0 +1,92 @@
2782 Jaco 7.5.1 (#4492)
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
36 Keith Ingram Storage deposit limit changes (#4370)
35 Stefanie Doll Updated child storage parameters (#1709)
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
15 Xiliang Chen add Authority origin (#3645)
11 Ian He HttpProvider support clone() (#3949)
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
5 Chevdor Fix metadata package link (#3458)
5 Jake Naviasky Fixing approvalFlagsToBools. (#1250)
4 Alex Wang fix issue that creates duplicate providers (#983)
4 Alexander Popiak Add asset id in signing (#4009)
4 Joshy Orndorff spelling; efect -> effect (#2295)
4 Nantian fix bigint type (#3869)
4 Thibaut Sardan no subscription for http (#3127)
3 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
3 André Silva add support for ValidationCodeHash (#3640)
3 Antoine Estienne Adapted to display moonbeam author (#3108)
3 Arjan Zijderveld Added `Emergency` to `ElectionPhase` (#3707)
3 Ewa Kowalska Handle no council for bounties proposals (#3062)
3 hamidra add support for n key entries for NMaps (#3886)
3 Hamza Tokuchi more typos (#2532)
3 Julien Eluard Fixed typos about module balances (#1402)
3 KarishmaBothara Backward compatibility thing (#3511)
3 Miguel Hervas Adding RT4 Types (#3007)
3 Shawn Tabrizi Add `isReadyOrError` when connecting to API (#2577)
3 YJ feat: Vote interface as U8a (#1061)
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
2 Branan Riley Add proxy type for Centrifuge (#3940)
2 Caio Add `Range` and `RangeInclusive` types (#3791)
2 Jakub Pánik All heads subscription (#1899)
2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405)
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
2 Nikos Kontakis Add auction in shared types (#4085)
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
2 sung wu Update tx.md (#2485)
2 Veliko Abi constructor takes different parameters (#3347)
2 Wei Tang Use /usr/bin/env bash instead of /bin/bash (#2053)
2 扩散性百万甜面包 Typo, deocrateMethod -> decorateMethod (#1594)
1 Andreea Eftene Add storage deposit support (#4304)
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
1 chriswmercer little readme tweak (#279)
1 codingsh #2182 - add: search for docs (#2232)
1 Dan Forbes Add WeightToFeeCoefficient type (#2296)
1 Daniel Maricic Fixed typo in README (#2402)
1 Daniel Savu fix: Generate custom type definitions (#4224)
1 David Don't log full error (#2952)
1 Denis Tsai realign AccountKey20Junction to polkadot xcm's Junction enum (#3770)
1 djuanito.eth Update fees to current constants (#2320)
1 Drew Stone Update evm definitions to include vicinity (#2279)
1 Dylan Galea Updated users of the polkadot-js/api (#2027)
1 flex Change BeefySignedCommitment signatures type to EcdsaSignature (#4204)
1 Furqan A fix: fixed 404 to the docs from the api readme (#3985)
1 Gerben van de Wiel Adding some extra notes on changes in the specname (#2329)
1 HackFisher fix OutboundLaneData types (#3992)
1 Hoani Bryson Multiple Endpoint support for WsProvider (#2234)
1 Hyungsuk Kang Update fees.ts (#1014)
1 icodezjb Update SessionKeys (#3035)
1 iiiiiiii Make unknownTypes externally accessible (#3263)
1 JesseAbram added 07 Example showing how to make a transfer with allowed block permissions folder in docs (#1062)
1 Joey don't throw error at `onSocketClose` (#4363)
1 Jordan Allow typegen for custom RPCs (#2876)
1 JQQQ Allow rpc expose definition/ metadata (#3488)
1 Kian Paimani Update definitions.ts (#2514)
1 Krzysztof Jelski Derive for bounties and descriptions (#2925)
1 Lae Make sure awaiting on an api object won't stuck forever on error (#1763)
1 Lezek123 BTreeSet and BTreeMap - encoding and serialization fixes (#3789)
1 Lovesh Harchandani Fix name of "getBlock" in package "api-derive" and export it in "index.ts" (#2857)
1 Mario Neises fix usage with typescript (#405)
1 Mario Pino Add PolkaStats to API users (#1593)
1 Mark Robert Henderson Update warnings.ts to have the latest URLs (#2720)
1 Matej Nemček added Kodadot to @polkadot/api users section (#2220)
1 Mokhtar Naamani Disable websocket outgoing message fragmentation for w3cwebsocket (#2738)
1 Nazar Mokrynskyi Performance tweaks (#4143)
1 Nikhil Ranjan add vestingPerBlock and vestingEndBlock in DeriveBalancesAll when doing calcBalances (#2563)
1 Nikolay Volf Fix typo (#1730)
1 Oleksandr Mykhailenko Add more complex namespaced contracts & test cases for them (#4472)
1 Paul M Fox Basic BTreeMaps codec support (#1474)
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
1 qiuhao update DeriveCustom type (#2581)
1 Rocco Musolino remove broken link (#2671)
1 satellitex Add BTreeSet<V> Codec (#1639)
1 satellitex Add traits replace rules. for invalid cases `::<type>` and `<type>::`. (#885)
1 Satyam Agrawal update as per the 0.97.0-beta.38 release (#1617)
1 Sean Young Solang requires u256 and i256 types (#2752)
1 Sergei Pepyakin INK! -> ink! (#1347)
1 WoeOm adapt Darwinia, Crab Network types (#3498)
1 Xat_MassacrE Fix packages/types/src/codec/utils/encodeTypes.ts encodeSubTypes bug (#1544)
1 yjh fix MetadataVersioned.asV12 (#2983)
1 Yuri fixes #3693 Fix uniques return types (#3694)
1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286)
+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'
},
+19 -14
View File
@@ -1,40 +1,45 @@
{
"repository": "https://github.com/polkadot-js/api",
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api#readme",
"license": "Apache-2",
"packageManager": "yarn@3.0.1",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/polkadot-js/api.git"
},
"sideEffects": false,
"type": "commonjs",
"version": "7.5.1",
"workspaces": [
"packages/*"
],
"resolutions": {
"typescript": "^4.4.2"
},
"scripts": {
"build": "yarn build:interfaces && polkadot-dev-build-ts",
"build:extra": "(cd packages/typegen && copyfiles scripts/* build)",
"build:interfaces": "polkadot-types-internal-interfaces",
"build:release": "polkadot-ci-ghact-build",
"build:rollup": "polkadot-exec-rollup --config",
"docs:metadata": "polkadot-types-internal-metadata",
"chain:info": "polkadot-types-chain-info",
"lint": "polkadot-dev-run-lint",
"clean": "polkadot-dev-clean-build",
"docs:metadata": "polkadot-types-internal-metadata",
"lint": "polkadot-dev-run-lint",
"postinstall": "polkadot-dev-yarn-only",
"test": "polkadot-dev-run-test --coverage --forceExit --runInBand --testPathIgnorePatterns e2e",
"test:one": "polkadot-dev-run-test --detectOpenHandles --forceExit",
"test:watch": "polkadot-dev-run-test --watch"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/register": "^7.15.3",
"@babel/runtime": "^7.15.4",
"@polkadot/dev": "^0.62.66",
"@polkadot/ts": "^0.4.7",
"@babel/core": "^7.16.12",
"@babel/register": "^7.16.9",
"@babel/runtime": "^7.16.7",
"@polkadot/dev": "^0.65.43",
"@polkadot/typegen": "workspace:packages/typegen",
"@types/jest": "^27.0.1",
"@types/jest": "^27.4.0",
"copyfiles": "^2.4.1"
},
"version": "5.8.2",
"packageManager": "yarn@3.0.1"
"resolutions": {
"typescript": "^4.5.5"
}
}
+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.
+34
View File
@@ -0,0 +1,34 @@
{
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "API generated augmentation",
"engines": {
"node": ">=14.0.0"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-augment#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-augment",
"repository": {
"directory": "packages/api-augment",
"type": "git",
"url": "https://github.com/polkadot-js/api.git"
},
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"type": "module",
"version": "7.5.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/api-base": "7.5.1",
"@polkadot/rpc-augment": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-augment": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/util": "^8.3.3"
}
}
+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,42 +1,27 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { Vec, bool, u16, u32, u64 } from '@polkadot/types';
import type { Codec } from '@polkadot/types/types';
import type { Schedule } from '@polkadot/types/interfaces/contracts';
import type { Balance, BalanceOf, BlockNumber, LockIdentifier, Moment, PalletId, Perbill, Percent, Permill, RuntimeDbWeight, TransactionPriority, Weight } from '@polkadot/types/interfaces/runtime';
import type { SessionIndex } from '@polkadot/types/interfaces/session';
import type { EraIndex } from '@polkadot/types/interfaces/staking';
import type { RuntimeVersion } from '@polkadot/types/interfaces/state';
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import type { BlockLength, BlockWeights } from '@polkadot/types/interfaces/system';
import type { DepositBalanceOf } from '@polkadot/types/interfaces/uniques';
import type { ApiTypes } from '@polkadot/api/types';
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, 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, 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: DepositBalanceOf & 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: DepositBalanceOf & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved when adding metadata to your asset.
**/
metadataDepositBase: DepositBalanceOf & AugmentedConst<ApiType>;
/**
* The additional funds that must be reserved for the number of bytes you store in your
* metadata.
**/
metadataDepositPerByte: DepositBalanceOf & 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
**/
@@ -48,7 +33,7 @@ declare module '@polkadot/api/types/consts' {
* This means that we will deal with uncle-parents that are
* `UncleGenerations + 1` before `now`.
**/
uncleGenerations: BlockNumber & AugmentedConst<ApiType>;
uncleGenerations: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -68,7 +53,63 @@ declare module '@polkadot/api/types/consts' {
* duration and the security parameter `c` (where `1 - c` represents
* the probability of a slot being empty).
**/
expectedBlockTime: Moment & AugmentedConst<ApiType>;
expectedBlockTime: u64 & AugmentedConst<ApiType>;
/**
* Max number of authorities allowed
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
bagsList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their vote weight. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's weight
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower
* weight, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists
* will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall
* into bag 0, an id with weight 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -78,7 +119,7 @@ declare module '@polkadot/api/types/consts' {
/**
* The minimum amount required to keep an account open.
**/
existentialDeposit: Balance & AugmentedConst<ApiType>;
existentialDeposit: u128 & AugmentedConst<ApiType>;
/**
* The maximum number of locks that should exist on an account.
* Not strictly enforced, but used for weight estimation.
@@ -95,31 +136,34 @@ declare module '@polkadot/api/types/consts' {
};
bounties: {
/**
* Percentage of the curator fee that will be reserved upfront as deposit for bounty curator.
* Percentage of the curator fee that will be reserved upfront as deposit for bounty
* curator.
**/
bountyCuratorDeposit: Permill & AugmentedConst<ApiType>;
/**
* The amount held on deposit for placing a bounty proposal.
**/
bountyDepositBase: BalanceOf & AugmentedConst<ApiType>;
bountyDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The delay period for which a bounty beneficiary need to wait before claim the payout.
**/
bountyDepositPayoutDelay: BlockNumber & AugmentedConst<ApiType>;
bountyDepositPayoutDelay: u32 & AugmentedConst<ApiType>;
/**
* Bounty duration in blocks.
**/
bountyUpdatePeriod: BlockNumber & AugmentedConst<ApiType>;
bountyUpdatePeriod: u32 & AugmentedConst<ApiType>;
/**
* Minimum value for a bounty.
**/
bountyValueMinimum: BalanceOf & AugmentedConst<ApiType>;
bountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* The amount held on deposit per byte within bounty description.
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: BalanceOf & AugmentedConst<ApiType>;
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>;
/**
@@ -127,70 +171,27 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
contracts: {
claims: {
prefix: Bytes & AugmentedConst<ApiType>;
/**
* The maximum number of tries that can be queued for deletion.
* Generic const
**/
deletionQueueDepth: u32 & AugmentedConst<ApiType>;
[key: string]: Codec;
};
crowdloan: {
/**
* The maximum amount of weight that can be consumed per block for lazy trie removal.
* The minimum amount that may be contributed into a crowdloan. Should almost certainly be at
* least `ExistentialDeposit`.
**/
deletionWeightLimit: Weight & AugmentedConst<ApiType>;
minContribution: u128 & AugmentedConst<ApiType>;
/**
* The balance every contract needs to deposit to stay alive indefinitely.
*
* This is different from the [`Self::TombstoneDeposit`] because this only needs to be
* deposited while the contract is alive. Costs for additional storage are added to
* this base cost.
*
* This is a simple way to ensure that contracts with empty storage eventually get deleted
* by making them pay rent. This creates an incentive to remove them early in order to save
* rent.
* `PalletId` for the crowdloan pallet. An appropriate value could be `PalletId(*b"py/cfund")`
**/
depositPerContract: BalanceOf & AugmentedConst<ApiType>;
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* The balance a contract needs to deposit per storage byte to stay alive indefinitely.
*
* Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1
* BU/byte/day, then a contract with 1,000,000 BU that uses 1,000 bytes of storage would
* pay no rent. But if the balance reduced to 500,000 BU and the storage stayed the same at
* 1,000, then it would pay 500 BU/day.
* Max number of storage keys to remove per extrinsic call.
**/
depositPerStorageByte: BalanceOf & AugmentedConst<ApiType>;
/**
* The balance a contract needs to deposit per storage item to stay alive indefinitely.
*
* It works the same as [`Self::DepositPerStorageByte`] but for storage items.
**/
depositPerStorageItem: BalanceOf & AugmentedConst<ApiType>;
/**
* The fraction of the deposit that should be used as rent per block.
*
* When a contract hasn't enough balance deposited to stay alive indefinitely it needs
* to pay per block for the storage it consumes that is not covered by the deposit.
* This determines how high this rent payment is per block as a fraction of the deposit.
**/
rentFraction: Perbill & AugmentedConst<ApiType>;
/**
* Cost schedule and limits.
**/
schedule: Schedule & AugmentedConst<ApiType>;
/**
* Number of block delay an extrinsic claim surcharge has.
*
* When claim surcharge is called by an extrinsic the rent is checked
* for current_block - delay
**/
signedClaimHandicap: BlockNumber & AugmentedConst<ApiType>;
/**
* Reward that is received by the party whose touch has led
* to removal of a contract.
**/
surchargeReward: BalanceOf & AugmentedConst<ApiType>;
/**
* The minimum amount required to generate a tombstone.
**/
tombstoneDeposit: BalanceOf & AugmentedConst<ApiType>;
removeKeysLimit: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -200,7 +201,7 @@ declare module '@polkadot/api/types/consts' {
/**
* Period in blocks where an external proposal may not be re-submitted after being vetoed.
**/
cooloffPeriod: BlockNumber & AugmentedConst<ApiType>;
cooloffPeriod: u32 & AugmentedConst<ApiType>;
/**
* The period between a proposal being approved and enacted.
*
@@ -208,11 +209,11 @@ declare module '@polkadot/api/types/consts' {
* 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: BlockNumber & AugmentedConst<ApiType>;
enactmentPeriod: u32 & AugmentedConst<ApiType>;
/**
* Minimum voting period allowed for a fast-track referendum.
**/
fastTrackVotingPeriod: BlockNumber & AugmentedConst<ApiType>;
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
@@ -222,7 +223,7 @@ declare module '@polkadot/api/types/consts' {
/**
* How often (in blocks) new public referenda are launched.
**/
launchPeriod: BlockNumber & AugmentedConst<ApiType>;
launchPeriod: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of public proposals that can exist at any time.
**/
@@ -237,33 +238,28 @@ declare module '@polkadot/api/types/consts' {
/**
* The minimum amount to be used as a deposit for a public referendum proposal.
**/
minimumDeposit: BalanceOf & AugmentedConst<ApiType>;
minimumDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance that must be deposited per byte of preimage stored.
**/
preimageByteDeposit: BalanceOf & AugmentedConst<ApiType>;
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: BlockNumber & AugmentedConst<ApiType>;
voteLockingPeriod: u32 & AugmentedConst<ApiType>;
/**
* How often (in blocks) to check for new votes.
**/
votingPeriod: BlockNumber & AugmentedConst<ApiType>;
votingPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
electionProviderMultiPhase: {
/**
* Maximum number of iteration of balancing that will be executed in the embedded miner of
* the pallet.
**/
minerMaxIterations: u32 & AugmentedConst<ApiType>;
/**
* Maximum length (bytes) that the mined solution should consume.
*
@@ -277,30 +273,30 @@ declare module '@polkadot/api/types/consts' {
* The miner will ensure that the total weight of the unsigned solution will not exceed
* this value, based on [`WeightInfo::submit_unsigned`].
**/
minerMaxWeight: Weight & AugmentedConst<ApiType>;
minerMaxWeight: u64 & AugmentedConst<ApiType>;
/**
* The priority of the unsigned transaction submitted in the unsigned-phase
**/
minerTxPriority: TransactionPriority & AugmentedConst<ApiType>;
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: BlockNumber & AugmentedConst<ApiType>;
offchainRepeat: u32 & AugmentedConst<ApiType>;
/**
* Base deposit for a signed solution.
**/
signedDepositBase: BalanceOf & AugmentedConst<ApiType>;
signedDepositBase: u128 & AugmentedConst<ApiType>;
/**
* Per-byte deposit for a signed solution.
**/
signedDepositByte: BalanceOf & AugmentedConst<ApiType>;
signedDepositByte: u128 & AugmentedConst<ApiType>;
/**
* Per-weight deposit for a signed solution.
**/
signedDepositWeight: BalanceOf & AugmentedConst<ApiType>;
signedDepositWeight: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of signed submissions that can be queued.
*
@@ -316,15 +312,15 @@ declare module '@polkadot/api/types/consts' {
*
* This should probably be similar to [`Config::MinerMaxWeight`].
**/
signedMaxWeight: Weight & AugmentedConst<ApiType>;
signedMaxWeight: u64 & AugmentedConst<ApiType>;
/**
* Duration of the signed phase.
**/
signedPhase: BlockNumber & AugmentedConst<ApiType>;
signedPhase: u32 & AugmentedConst<ApiType>;
/**
* Base reward for a signed solution
**/
signedRewardBase: BalanceOf & AugmentedConst<ApiType>;
signedRewardBase: u128 & AugmentedConst<ApiType>;
/**
* The minimum amount of improvement to the solution score that defines a solution as
* "better" (in any phase).
@@ -333,46 +329,16 @@ declare module '@polkadot/api/types/consts' {
/**
* Duration of the unsigned phase.
**/
unsignedPhase: BlockNumber & AugmentedConst<ApiType>;
unsignedPhase: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
elections: {
/**
* How much should be locked up in order to submit one's candidacy.
**/
candidacyBond: BalanceOf & 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: LockIdentifier & 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: BlockNumber & AugmentedConst<ApiType>;
/**
* Base deposit associated with voting.
* 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.
*
* This should be sensibly high to economically ensure the pallet cannot be attacked by
* creating a gigantic number of votes.
* 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.
**/
votingBondBase: BalanceOf & AugmentedConst<ApiType>;
/**
* The amount of bond that need to be locked for each vote (32 bytes).
**/
votingBondFactor: BalanceOf & AugmentedConst<ApiType>;
voterSnapshotPerBlock: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -385,11 +351,6 @@ declare module '@polkadot/api/types/consts' {
* Must be no greater than `MaxQueueLen`.
**/
fifoQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The issuance to ignore. This is subtracted from the `Currency`'s `total_issuance` to get
* the issuance by which we inflate or deflate the gilt.
**/
ignoredIssuance: BalanceOf & AugmentedConst<ApiType>;
/**
* The number of blocks between consecutive attempts to issue more gilts in an effort to
* get to the target amount to be frozen.
@@ -397,7 +358,7 @@ declare module '@polkadot/api/types/consts' {
* A larger value results in fewer storage hits each block, but a slower period to get to
* the target.
**/
intakePeriod: BlockNumber & AugmentedConst<ApiType>;
intakePeriod: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of bids that can be turned into issued gilts each block. A larger
* value here means less of the block available for transactions should there be a glut of
@@ -416,12 +377,12 @@ declare module '@polkadot/api/types/consts' {
* It should be at least big enough to ensure that there is no possible storage spam attack
* or queue-filling attack.
**/
minFreeze: BalanceOf & AugmentedConst<ApiType>;
minFreeze: u128 & AugmentedConst<ApiType>;
/**
* The base period for the duration queues. This is the common multiple across all
* supported freezing durations that can be bid upon.
**/
period: BlockNumber & AugmentedConst<ApiType>;
period: u32 & AugmentedConst<ApiType>;
/**
* Number of duration queues in total. This sets the maximum duration supported, which is
* this value multiplied by `Period`.
@@ -432,15 +393,25 @@ declare module '@polkadot/api/types/consts' {
**/
[key: string]: Codec;
};
grandpa: {
/**
* Max Authorities in use
**/
maxAuthorities: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
identity: {
/**
* The amount held on deposit for a registered identity
**/
basicDeposit: BalanceOf & AugmentedConst<ApiType>;
basicDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount held on deposit per additional field for a registered identity.
**/
fieldDeposit: BalanceOf & AugmentedConst<ApiType>;
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.
@@ -460,7 +431,7 @@ declare module '@polkadot/api/types/consts' {
* 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: BalanceOf & AugmentedConst<ApiType>;
subAccountDeposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -473,7 +444,7 @@ declare module '@polkadot/api/types/consts' {
* This is exposed so that it can be tuned for particular runtime, when
* multiple pallets send unsigned transactions.
**/
unsignedPriority: TransactionPriority & AugmentedConst<ApiType>;
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -483,27 +454,7 @@ declare module '@polkadot/api/types/consts' {
/**
* The deposit needed for reserving an index.
**/
deposit: BalanceOf & AugmentedConst<ApiType>;
/**
* Generic const
**/
[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: PalletId & AugmentedConst<ApiType>;
deposit: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -518,13 +469,13 @@ declare module '@polkadot/api/types/consts' {
* `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is
* `32 + sizeof(AccountId)` bytes.
**/
depositBase: BalanceOf & AugmentedConst<ApiType>;
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: BalanceOf & AugmentedConst<ApiType>;
depositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of signatories allowed in the multisig.
**/
@@ -534,6 +485,52 @@ declare module '@polkadot/api/types/consts' {
**/
[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.
@@ -541,14 +538,14 @@ declare module '@polkadot/api/types/consts' {
* This is held when a new storage item holding a `Balance` is created (typically 16
* bytes).
**/
announcementDepositBase: BalanceOf & AugmentedConst<ApiType>;
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: BalanceOf & AugmentedConst<ApiType>;
announcementDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of time-delayed announcements that are allowed to be pending.
**/
@@ -563,7 +560,7 @@ declare module '@polkadot/api/types/consts' {
* This is held for an additional storage item whose value size is
* `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes.
**/
proxyDepositBase: BalanceOf & AugmentedConst<ApiType>;
proxyDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per proxy added.
*
@@ -571,7 +568,7 @@ declare module '@polkadot/api/types/consts' {
* pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take
* into account `32 + proxy_type.encode().len()` bytes of data.
**/
proxyDepositFactor: BalanceOf & AugmentedConst<ApiType>;
proxyDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -584,7 +581,7 @@ declare module '@polkadot/api/types/consts' {
* This is held for an additional storage item whose value size is
* `2 + sizeof(BlockNumber, Balance)` bytes.
**/
configDepositBase: BalanceOf & AugmentedConst<ApiType>;
configDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per additional user when creating a recovery
* configuration.
@@ -592,7 +589,7 @@ declare module '@polkadot/api/types/consts' {
* This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage
* value.
**/
friendDepositFactor: BalanceOf & AugmentedConst<ApiType>;
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
**/
@@ -606,7 +603,22 @@ declare module '@polkadot/api/types/consts' {
* `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable
* threshold.
**/
recoveryDeposit: BalanceOf & AugmentedConst<ApiType>;
recoveryDeposit: 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
**/
@@ -617,7 +629,7 @@ declare module '@polkadot/api/types/consts' {
* The maximum weight that may be scheduled per block for any dispatchables of less
* priority than `schedule::HARD_DEADLINE`.
**/
maximumWeight: Weight & AugmentedConst<ApiType>;
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.
@@ -628,41 +640,59 @@ 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.
**/
candidateDeposit: BalanceOf & AugmentedConst<ApiType>;
candidateDeposit: u128 & AugmentedConst<ApiType>;
/**
* The number of blocks between membership challenges.
**/
challengePeriod: BlockNumber & AugmentedConst<ApiType>;
challengePeriod: u32 & AugmentedConst<ApiType>;
/**
* Maximum candidate intake per round.
* The maximum number of candidates that we accept per round.
**/
maxCandidateIntake: u32 & AugmentedConst<ApiType>;
/**
* The number of times a member may vote the wrong way (or not at all, when they are a skeptic)
* before they become suspended.
* The maximum duration of the payout lock.
**/
maxLockDuration: u32 & AugmentedConst<ApiType>;
/**
* The number of times a member may vote the wrong way (or not at all, when they are a
* skeptic) before they become suspended.
**/
maxStrikes: u32 & AugmentedConst<ApiType>;
/**
* The societies's module id
* The societies's pallet id
**/
palletId: PalletId & AugmentedConst<ApiType>;
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* The amount of incentive paid within each period. Doesn't include VoterTip.
**/
periodSpend: BalanceOf & AugmentedConst<ApiType>;
periodSpend: u128 & AugmentedConst<ApiType>;
/**
* The number of blocks between candidate/membership rotation periods.
**/
rotationPeriod: BlockNumber & AugmentedConst<ApiType>;
rotationPeriod: u32 & AugmentedConst<ApiType>;
/**
* The amount of the unpaid reward that gets deducted in the case that either a skeptic
* doesn't vote or someone votes in the wrong way.
**/
wrongSideDeduction: BalanceOf & AugmentedConst<ApiType>;
wrongSideDeduction: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -672,7 +702,7 @@ declare module '@polkadot/api/types/consts' {
/**
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: EraIndex & AugmentedConst<ApiType>;
bondingDuration: u32 & AugmentedConst<ApiType>;
maxNominations: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of nominators rewarded for each validator.
@@ -684,14 +714,14 @@ declare module '@polkadot/api/types/consts' {
/**
* Number of sessions per era.
**/
sessionsPerEra: SessionIndex & AugmentedConst<ApiType>;
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: EraIndex & AugmentedConst<ApiType>;
slashDeferDuration: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -701,19 +731,19 @@ declare module '@polkadot/api/types/consts' {
/**
* Maximum number of block number to block hash mappings to keep (oldest pruned first).
**/
blockHashCount: BlockNumber & AugmentedConst<ApiType>;
blockHashCount: u32 & AugmentedConst<ApiType>;
/**
* The maximum length of a block (in bytes).
**/
blockLength: BlockLength & AugmentedConst<ApiType>;
blockLength: FrameSystemLimitsBlockLength & AugmentedConst<ApiType>;
/**
* Block & extrinsics weights: base values and limits.
**/
blockWeights: BlockWeights & AugmentedConst<ApiType>;
blockWeights: FrameSystemLimitsBlockWeights & AugmentedConst<ApiType>;
/**
* The weight of runtime database operations the runtime can invoke.
**/
dbWeight: RuntimeDbWeight & AugmentedConst<ApiType>;
dbWeight: FrameSupportWeightsRuntimeDbWeight & AugmentedConst<ApiType>;
/**
* The designated SS85 prefix of this chain.
*
@@ -725,7 +755,7 @@ declare module '@polkadot/api/types/consts' {
/**
* Get the chain's current version.
**/
version: RuntimeVersion & AugmentedConst<ApiType>;
version: SpVersionRuntimeVersion & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -738,7 +768,7 @@ declare module '@polkadot/api/types/consts' {
* generally work with this to determine a sensible block time. e.g. For Aura, it will be
* double this period on default settings.
**/
minimumPeriod: Moment & AugmentedConst<ApiType>;
minimumPeriod: u64 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -746,39 +776,65 @@ declare module '@polkadot/api/types/consts' {
};
tips: {
/**
* The amount held on deposit per byte within the tip report reason.
* The amount held on deposit per byte within the tip report reason or bounty description.
**/
dataDepositPerByte: BalanceOf & AugmentedConst<ApiType>;
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: BlockNumber & AugmentedConst<ApiType>;
tipCountdown: u32 & AugmentedConst<ApiType>;
/**
* The amount of the final tip which goes to the original reporter of the tip.
* 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: BalanceOf & AugmentedConst<ApiType>;
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>;
/**
* The fee to be paid for making a transaction; the per-byte portion.
**/
transactionByteFee: BalanceOf & AugmentedConst<ApiType>;
transactionByteFee: u128 & AugmentedConst<ApiType>;
/**
* The polynomial that is applied in order to derive fee from weight.
**/
weightToFee: Vec<WeightToFeeCoefficient> & AugmentedConst<ApiType>;
weightToFee: Vec<FrameSupportWeightsWeightToFeeCoefficient> & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -796,7 +852,7 @@ declare module '@polkadot/api/types/consts' {
/**
* The treasury's pallet id, used for deriving its sovereign account ID.
**/
palletId: PalletId & AugmentedConst<ApiType>;
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.
@@ -805,50 +861,11 @@ declare module '@polkadot/api/types/consts' {
/**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMinimum: BalanceOf & AugmentedConst<ApiType>;
proposalBondMinimum: u128 & AugmentedConst<ApiType>;
/**
* Period between successive spends.
**/
spendPeriod: BlockNumber & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
uniques: {
/**
* The basic amount of funds that must be reserved when adding an attribute to an asset.
**/
attributeDepositBase: DepositBalanceOf & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset class.
**/
classDeposit: DepositBalanceOf & AugmentedConst<ApiType>;
/**
* The additional funds that must be reserved for the number of bytes store in metadata,
* either "normal" metadata or attribute metadata.
**/
depositPerByte: DepositBalanceOf & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset instance.
**/
instanceDeposit: DepositBalanceOf & 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: DepositBalanceOf & 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>;
spendPeriod: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
@@ -869,15 +886,11 @@ declare module '@polkadot/api/types/consts' {
/**
* The minimum amount transferred to call `vested_transfer`.
**/
minVestedTransfer: BalanceOf & AugmentedConst<ApiType>;
minVestedTransfer: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
}
export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
[key: string]: QueryableModuleConsts;
}
}
} // AugmentedConsts
} // declare module
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,9 +1,9 @@
// Copyright 2017-2021 @polkadot/api authors & contributors
// 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 './rpc';
import './tx';
File diff suppressed because it is too large Load Diff
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: '7.5.1' };
+768
View File
@@ -0,0 +1,768 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { Bytes, 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, 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;
};
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.
**/
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: {
/**
* 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.
**/
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>;
/**
* 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;
};
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: {
/**
* 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.
**/
minerMaxLength: u32 & 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`].
**/
minerMaxWeight: u64 & 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>;
/**
* 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.
*
* This should probably be similar to [`Config::MinerMaxWeight`].
**/
signedMaxWeight: u64 & AugmentedConst<ApiType>;
/**
* Duration of the signed phase.
**/
signedPhase: u32 & AugmentedConst<ApiType>;
/**
* 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;
};
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>;
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>;
/**
* 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>;
/**
* 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
**/
[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.
**/
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>;
/**
* 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;
};
} // 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,9 @@
// 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 './tx';
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,979 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api-base/types';
import type { U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
import type { Codec } from '@polkadot/types-codec/types';
import type { Perbill, Percent, Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, PalletContractsSchedule, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
declare module '@polkadot/api-base/types/consts' {
export interface AugmentedConsts<ApiType extends ApiTypes> {
assets: {
/**
* The amount of funds that must be reserved when creating a new approval.
**/
approvalDeposit: u128 & AugmentedConst<ApiType>;
/**
* The amount of funds that must be reserved for a non-provider asset account to be
* maintained.
**/
assetAccountDeposit: u128 & AugmentedConst<ApiType>;
/**
* The basic amount of funds that must be reserved for an asset.
**/
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>;
/**
* 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;
};
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.
**/
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: {
/**
* 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.
**/
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>;
/**
* 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: {
/**
* Percentage of child-bounty value to be reserved as curator deposit
* when curator fee is zero.
**/
childBountyCuratorDepositBase: Permill & AugmentedConst<ApiType>;
/**
* Minimum value for a child-bounty.
**/
childBountyValueMinimum: u128 & AugmentedConst<ApiType>;
/**
* Maximum number of child-bounties that can be added to a parent bounty.
**/
maxActiveChildBountyCount: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
contracts: {
/**
* The maximum number of contracts that can be pending for deletion.
*
* When a contract is deleted by calling `seal_terminate` it becomes inaccessible
* immediately, but the deletion of the storage items it has accumulated is performed
* later. The contract is put into the deletion queue. This defines how many
* contracts can be queued up at the same time. If that limit is reached `seal_terminate`
* will fail. The action must be retried in a later block in that case.
*
* The reasons for limiting the queue depth are:
*
* 1. The queue is in storage in order to be persistent between blocks. We want to limit
* the amount of storage that can be consumed.
* 2. The queue is stored in a vector and needs to be decoded as a whole when reading
* it at the end of each block. Longer queues take more weight to decode and hence
* limit the amount of items that can be deleted per block.
**/
deletionQueueDepth: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of weight that can be consumed per block for lazy trie removal.
*
* The amount of weight that is dedicated per block to work on the deletion queue. Larger
* values allow more trie keys to be deleted in each block but reduce the amount of
* weight that is left for transactions. See [`Self::DeletionQueueDepth`] for more
* information about the deletion queue.
**/
deletionWeightLimit: u64 & AugmentedConst<ApiType>;
/**
* The amount of balance a caller has to pay for each byte of storage.
*
* # Note
*
* Changing this value for an existing chain might need a storage migration.
**/
depositPerByte: u128 & AugmentedConst<ApiType>;
/**
* The amount of balance a caller has to pay for each storage item.
*
* # Note
*
* Changing this value for an existing chain might need a storage migration.
**/
depositPerItem: u128 & AugmentedConst<ApiType>;
/**
* Cost schedule and limits.
**/
schedule: PalletContractsSchedule & 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: {
/**
* 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.
**/
minerMaxLength: u32 & 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`].
**/
minerMaxWeight: u64 & 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>;
/**
* 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.
*
* This should probably be similar to [`Config::MinerMaxWeight`].
**/
signedMaxWeight: u64 & AugmentedConst<ApiType>;
/**
* Duration of the signed phase.
**/
signedPhase: u32 & AugmentedConst<ApiType>;
/**
* 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
**/
[key: string]: Codec;
};
gilt: {
/**
* Portion of the queue which is free from ordering and just a FIFO.
*
* Must be no greater than `MaxQueueLen`.
**/
fifoQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The number of blocks between consecutive attempts to issue more gilts in an effort to
* get to the target amount to be frozen.
*
* A larger value results in fewer storage hits each block, but a slower period to get to
* the target.
**/
intakePeriod: u32 & AugmentedConst<ApiType>;
/**
* The maximum amount of bids that can be turned into issued gilts each block. A larger
* value here means less of the block available for transactions should there be a glut of
* bids to make into gilts to reach the target.
**/
maxIntakeBids: u32 & AugmentedConst<ApiType>;
/**
* Maximum number of items that may be in each duration queue.
**/
maxQueueLen: u32 & AugmentedConst<ApiType>;
/**
* The minimum amount of funds that may be offered to freeze for a gilt. Note that this
* does not actually limit the amount which may be frozen in a gilt since gilts may be
* split up in order to satisfy the desired amount of funds under gilts.
*
* It should be at least big enough to ensure that there is no possible storage spam attack
* or queue-filling attack.
**/
minFreeze: u128 & AugmentedConst<ApiType>;
/**
* The base period for the duration queues. This is the common multiple across all
* supported freezing durations that can be bid upon.
**/
period: u32 & AugmentedConst<ApiType>;
/**
* Number of duration queues in total. This sets the maximum duration supported, which is
* this value multiplied by `Period`.
**/
queueCount: 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;
};
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
* 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;
};
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;
};
recovery: {
/**
* The base amount of currency needed to reserve for creating a recovery configuration.
*
* This is held for an additional storage item whose value size is
* `2 + sizeof(BlockNumber, Balance)` bytes.
**/
configDepositBase: u128 & AugmentedConst<ApiType>;
/**
* The amount of currency needed per additional user when creating a recovery
* configuration.
*
* This is held for adding `sizeof(AccountId)` bytes more into a pre-existing storage
* value.
**/
friendDepositFactor: u128 & AugmentedConst<ApiType>;
/**
* The maximum amount of friends allowed in a recovery configuration.
**/
maxFriends: u16 & AugmentedConst<ApiType>;
/**
* The base amount of currency needed to reserve for starting a recovery.
*
* This is primarily held for deterring malicious recovery attempts, and should
* have a value large enough that a bad actor would choose not to place this
* deposit. It also acts to fund additional storage item whose value size is
* `sizeof(BlockNumber, Balance + T * AccountId)` bytes. Where T is a configurable
* threshold.
**/
recoveryDeposit: 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;
};
society: {
/**
* The minimum amount of a deposit required for a bid to be made.
**/
candidateDeposit: u128 & AugmentedConst<ApiType>;
/**
* The number of blocks between membership challenges.
**/
challengePeriod: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of candidates that we accept per round.
**/
maxCandidateIntake: u32 & AugmentedConst<ApiType>;
/**
* The maximum duration of the payout lock.
**/
maxLockDuration: u32 & AugmentedConst<ApiType>;
/**
* The number of times a member may vote the wrong way (or not at all, when they are a
* skeptic) before they become suspended.
**/
maxStrikes: u32 & AugmentedConst<ApiType>;
/**
* The societies's pallet id
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* The amount of incentive paid within each period. Doesn't include VoterTip.
**/
periodSpend: u128 & AugmentedConst<ApiType>;
/**
* The number of blocks between candidate/membership rotation periods.
**/
rotationPeriod: u32 & AugmentedConst<ApiType>;
/**
* The amount of the unpaid reward that gets deducted in the case that either a skeptic
* doesn't vote or someone votes in the wrong way.
**/
wrongSideDeduction: u128 & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
staking: {
/**
* Number of eras that staked funds must remain bonded for.
**/
bondingDuration: u32 & AugmentedConst<ApiType>;
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>;
/**
* 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>;
/**
* 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
**/
[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.
**/
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>;
/**
* 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;
};
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.
**/
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;
};
} // AugmentedConsts
} // declare module
@@ -1,11 +1,15 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api/types';
import type { ApiTypes } from '@polkadot/api-base/types';
declare module '@polkadot/api/types/errors' {
export interface AugmentedErrors<ApiType> {
declare module '@polkadot/api-base/types/errors' {
export interface AugmentedErrors<ApiType extends ApiTypes> {
assets: {
/**
* The asset-account already exists.
**/
AlreadyExists: AugmentedError<ApiType>;
/**
* Invalid metadata given.
**/
@@ -18,10 +22,6 @@ declare module '@polkadot/api/types/errors' {
* Account balance must be greater than or equal to the transfer amount.
**/
BalanceLow: AugmentedError<ApiType>;
/**
* Balance should be non-zero.
**/
BalanceZero: AugmentedError<ApiType>;
/**
* The origin account is frozen.
**/
@@ -34,13 +34,22 @@ declare module '@polkadot/api/types/errors' {
* Minimum balance should be non-zero.
**/
MinBalanceZero: AugmentedError<ApiType>;
/**
* The account to alter does not exist.
**/
NoAccount: AugmentedError<ApiType>;
/**
* The asset-account doesn't have an associated deposit.
**/
NoDeposit: AugmentedError<ApiType>;
/**
* The signing account has no permission to do the operation.
**/
NoPermission: AugmentedError<ApiType>;
/**
* No provider reference exists to allow a non-zero balance of a non-self-sufficient
* asset.
* Unable to increment the consumer reference counters on the account. Either no provider
* reference exists to allow a non-zero balance of a non-self-sufficient asset, or the
* maximum number of consumers has been reached.
**/
NoProvider: AugmentedError<ApiType>;
/**
@@ -51,6 +60,10 @@ declare module '@polkadot/api/types/errors' {
* The given asset ID is unknown.
**/
Unknown: AugmentedError<ApiType>;
/**
* The operation would result in funds being burned.
**/
WouldBurn: AugmentedError<ApiType>;
/**
* The source account would not survive the transfer and it needs to stay alive.
**/
@@ -112,6 +125,24 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
bagsList: {
/**
* Id not found in list.
**/
IdNotFound: AugmentedError<ApiType>;
/**
* An Id does not have a greater vote weight than another Id.
**/
NotHeavier: AugmentedError<ApiType>;
/**
* Attempted to place node in front of a node in another bag.
**/
NotInSameBag: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
balances: {
/**
* Beneficiary account must pre-exist
@@ -151,6 +182,10 @@ declare module '@polkadot/api/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
bounties: {
/**
* The bounty cannot be closed because it has active child-bounties.
**/
HasActiveChildBounty: AugmentedError<ApiType>;
/**
* Proposer's balance is too low.
**/
@@ -193,41 +228,55 @@ 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 in order to allow
* for a tombstone to be created. Use `seal_terminate` to remove a contract without
* leaving a tombstone behind.
* 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.
**/
CodeTooLarge: AugmentedError<ApiType>;
/**
* A tombstone exist at the specified address.
*
* Tombstone cannot be called. Anyone can use `seal_restore_to` in order to revive
* the contract, though.
**/
ContractIsTombstone: AugmentedError<ApiType>;
/**
* A contract could not be evicted because it has enough balance to pay rent.
*
* This can be returned from [`Pallet::claim_surcharge`] because the target
* contract has enough balance to pay for its rent.
**/
ContractNotEvictable: AugmentedError<ApiType>;
/**
* 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.
**/
@@ -243,7 +292,7 @@ declare module '@polkadot/api/types/errors' {
/**
* Removal of a contract failed because the deletion queue is full.
*
* This can happen when either calling [`Pallet::claim_surcharge`] or `seal_terminate`.
* This can happen when calling `seal_terminate`.
* The queue is filled by deleting contracts and emptied by a fixed amount each block.
* Trying again during another block is the only way to resolve this issue.
**/
@@ -260,40 +309,15 @@ declare module '@polkadot/api/types/errors' {
* `seal_call` forwarded this contracts input. It therefore is no longer available.
**/
InputForwarded: AugmentedError<ApiType>;
/**
* An origin TrieId written in the current block.
**/
InvalidContractOrigin: AugmentedError<ApiType>;
/**
* Cannot restore to nonexisting or alive contract.
**/
InvalidDestinationContract: AugmentedError<ApiType>;
/**
* A new schedule must have a greater version than the current one.
**/
InvalidScheduleVersion: AugmentedError<ApiType>;
/**
* Cannot restore from nonexisting or tombstone contract.
**/
InvalidSourceContract: AugmentedError<ApiType>;
/**
* An origin must be signed or inherent and auxiliary sender only provided on inherent.
**/
InvalidSurchargeClaim: AugmentedError<ApiType>;
/**
* Tombstones don't match.
**/
InvalidTombstone: AugmentedError<ApiType>;
/**
* Performing a call was denied because the calling depth reached the limit
* 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
@@ -321,30 +345,22 @@ declare module '@polkadot/api/types/errors' {
**/
ReentranceDenied: AugmentedError<ApiType>;
/**
* The called contract does not have enough balance to pay for its storage.
*
* The contract ran out of balance and is therefore eligible for eviction into a
* tombstone. Anyone can evict the contract by submitting a `claim_surcharge`
* extrinsic. Alternatively, a plain balance transfer can be used in order to
* increase the contracts funds so that it can be called again.
* More storage was created than allowed by the storage deposit limit.
**/
RentNotPaid: AugmentedError<ApiType>;
StorageDepositLimitExhausted: 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.
* Origin doesn't have enough balance to pay the required storage deposits.
**/
StorageExhausted: AugmentedError<ApiType>;
StorageDepositNotEnoughFunds: AugmentedError<ApiType>;
/**
* A contract self destructed in its constructor.
*
* This can be triggered by a call to `seal_terminate` or `seal_restore_to`.
* This can be triggered by a call to `seal_terminate`.
**/
TerminatedInConstructor: AugmentedError<ApiType>;
/**
* Termination of a contract is not allowed while the contract is already
* on the call stack. Can be triggered by `seal_terminate` or `seal_restore_to.
* on the call stack. Can be triggered by `seal_terminate`.
**/
TerminatedWhileReentrant: AugmentedError<ApiType>;
/**
@@ -352,9 +368,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>;
/**
@@ -936,6 +951,36 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
preimage: {
/**
* Preimage has already been noted on-chain.
**/
AlreadyNoted: AugmentedError<ApiType>;
/**
* The user is not authorized to perform this action.
**/
NotAuthorized: AugmentedError<ApiType>;
/**
* The preimage cannot be removed since it has not yet been noted.
**/
NotNoted: AugmentedError<ApiType>;
/**
* The preimage request cannot be removed since no outstanding requests exist.
**/
NotRequested: AugmentedError<ApiType>;
/**
* A preimage may not be removed when there are outstanding requests.
**/
Requested: AugmentedError<ApiType>;
/**
* Preimage is too large to store on-chain.
**/
TooLarge: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
proxy: {
/**
* Account is already a proxy.
@@ -1195,6 +1240,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.
**/
@@ -1216,7 +1265,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>;
/**
@@ -1281,6 +1332,10 @@ declare module '@polkadot/api/types/errors' {
[key: string]: AugmentedError<ApiType>;
};
system: {
/**
* The origin filter prevent the call to be dispatched.
**/
CallFiltered: AugmentedError<ApiType>;
/**
* Failed to extract the runtime version from the new runtime.
*
@@ -1559,9 +1614,5 @@ declare module '@polkadot/api/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
}
export interface DecoratedErrors<ApiType extends ApiTypes> extends AugmentedErrors<ApiType> {
[key: string]: ModuleErrors<ApiType>;
}
}
} // AugmentedErrors
} // declare module
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
// 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 './tx';
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"exclude": [
"**/kusama/*.ts",
"**/polkadot/*.ts"
],
"references": [
{ "path": "../api-base/tsconfig.build.json" },
{ "path": "../rpc-augment/tsconfig.build.json" },
{ "path": "../types/tsconfig.build.json" },
{ "path": "../types-codec/tsconfig.build.json" },
{ "path": "../types-augment/tsconfig.build.json" }
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.ts",
"**/kusama/*.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,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"include": [
"**/base.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" }
]
}
+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": "7.5.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.16.7",
"@polkadot/rpc-core": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/util": "^8.3.3",
"rxjs": "^7.5.2"
}
}
+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: '7.5.1' };
+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 {
@@ -64,4 +63,5 @@ export interface PaginationOptions<A = unknown> {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type DecorateMethod<ApiType extends ApiTypes> = <Method extends (...args: any[]) => Observable<any>>(method: Method, options?: DecorateMethodOptions) => any;
export type DecorateMethod<ApiType extends ApiTypes, T = any> =
<M extends (...args: any[]) => Observable<any>>(method: M, options?: DecorateMethodOptions) => T;
+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> = IsEvent<T>;
export interface ModuleEvents<ApiType extends ApiTypes> {
[key: string]: AugmentedEvent<ApiType, AnyTuple>;
}
+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';
+34
View File
@@ -0,0 +1,34 @@
// 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';
import { ApiTypes, PromiseResult, Push, RxResult, UnsubscribePromise } from './base';
export type { AugmentedRpc } from '@polkadot/rpc-core/types';
export interface RxRpcResult<F extends AnyFunction> extends RxResult<F> {
raw <T> (...args: Parameters<F>): Observable<T>;
meta: DefinitionRpc;
}
export interface PromiseRpcResult<F extends AnyFunction> extends PromiseResult<F> {
raw <T> (...args: Parameters<F>): Promise<T>;
raw <T> (...args: Push<Parameters<F>, Callback<T>>): UnsubscribePromise;
meta: DefinitionRpc;
}
export type RpcMethodResult<ApiType extends ApiTypes, F extends AnyFunction> = ApiType extends 'rxjs'
? RxRpcResult<F>
: PromiseRpcResult<F>;
export type DecoratedRpcSection<ApiType extends ApiTypes, Section> = {
[M in keyof Section]: Section[M] extends AnyFunction
? RpcMethodResult<ApiType, Section[M]>
: never
}
export type DecoratedRpc<ApiType extends ApiTypes, AllSections> = {
[S in keyof AllSections]: DecoratedRpcSection<ApiType, AllSections[S]>
}
+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][]>;
entriesPaged: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
/**
* @deprecated Use api.at(<blockHash>)
*/
keysAt: <K extends AnyTuple = A> (hash: Hash | Uint8Array | string, ...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
keysPaged: <K extends AnyTuple = A> (opts: PaginationOptions<Parameters<F>[0]>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
/**
* @deprecated The underlying RPC this been marked unsafe and is generally not exposed
*/
range: <T extends Codec | any = ReturnCodec<F>>([from, to]: [Hash | Uint8Array | string, Hash | Uint8Array | string | undefined] | [Hash | Uint8Array | string], ...args: Parameters<F>) => PromiseOrObs<ApiType, [Hash, T][]>;
/**
* @deprecated Use api.at(<blockHash>)
*/
sizeAt: (hash: Hash | Uint8Array | string, ...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
multi: ApiType extends 'rxjs'
? StorageEntryObservableMulti<ReturnCodec<F>>
: StorageEntryPromiseMulti<ReturnCodec<F>>;
}
export interface StorageEntryBaseAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> {
entries: <T extends Codec | any = ReturnCodec<F>, K extends AnyTuple = A>(...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, [StorageKey<K>, T][]>;
hash: (...args: Parameters<F>) => PromiseOrObs<ApiType, Hash>;
is: (key: IStorageKey<AnyTuple>) => key is IStorageKey<A>;
key: (...args: Parameters<F>) => string;
keyPrefix: (...args: DropLast<Parameters<F>>) => string;
keys: <K extends AnyTuple = A> (...args: DropLast<Parameters<F>>) => PromiseOrObs<ApiType, StorageKey<K>[]>;
size: (...args: Parameters<F>) => PromiseOrObs<ApiType, u64>;
}
export interface QueryableModuleStorage<ApiType extends ApiTypes> {
[key: string]: QueryableStorageEntry<ApiType, AnyTuple>;
}
export interface QueryableModuleStorageAt<ApiType extends ApiTypes> {
[key: string]: QueryableStorageEntryAt<ApiType, AnyTuple>;
}
export type QueryableStorageMultiArg<ApiType extends ApiTypes> =
QueryableStorageEntry<ApiType> |
[QueryableStorageEntry<ApiType>, ...unknown[]];
export interface QueryableStorageMultiBase<ApiType extends ApiTypes> {
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Observable<T>;
}
export interface QueryableStorageMultiPromise<ApiType extends ApiTypes> {
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[], callback: Callback<T>): UnsubscribePromise;
<T extends Codec[]>(calls: QueryableStorageMultiArg<ApiType>[]): Promise<T>;
}
export type QueryableStorageMulti<ApiType extends ApiTypes> =
ApiType extends 'rxjs'
? QueryableStorageMultiBase<ApiType>
: QueryableStorageMultiPromise<ApiType>;
export type AugmentedQuery<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBase<ApiType, F, A>;
export type AugmentedQueryAt<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = MethodResult<ApiType, F> & StorageEntryBaseAt<ApiType, F, A>;
// backwards compatibility-only
export type AugmentedQueryDoubleMap<ApiType extends ApiTypes, F extends AnyFunction, A extends AnyTuple = AnyTuple> = AugmentedQuery<ApiType, F, A>;
@@ -0,0 +1,94 @@
// 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;
}
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" }
]
}
+30 -19
View File
@@ -1,28 +1,39 @@
{
"name": "@polkadot/api-contract",
"version": "5.8.2",
"type": "module",
"author": "Jaco Greeff <jacogr@gmail.com>",
"bugs": "https://github.com/polkadot-js/api/issues",
"contributors": [],
"description": "Interfaces for interacting with contracts and contract ABIs",
"main": "index.js",
"engines": {
"node": ">=14.0.0"
},
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"license": "Apache-2.0",
"maintainers": [],
"name": "@polkadot/api-contract",
"repository": {
"directory": "packages/api-contract",
"type": "git",
"url": "https://github.com/polkadot-js/api.git"
},
"sideEffects": [
"./detectPackage.js",
"./detectPackage.cjs"
],
"engines": {
"node": ">=14.0.0"
},
"author": "Jaco Greeff <jacogr@gmail.com>",
"maintainers": [],
"contributors": [],
"license": "Apache-2.0",
"repository": "github:polkadot-js/api",
"bugs": "https://github.com/polkadot-js/api/issues",
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
"type": "module",
"version": "7.5.1",
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.15.4",
"@polkadot/api": "5.8.2",
"@polkadot/types": "5.8.2",
"@polkadot/util": "^7.3.1",
"rxjs": "^7.3.0"
"@babel/runtime": "^7.16.7",
"@polkadot/api": "7.5.1",
"@polkadot/types": "7.5.1",
"@polkadot/types-codec": "7.5.1",
"@polkadot/types-create": "7.5.1",
"@polkadot/util": "^8.3.3",
"@polkadot/util-crypto": "^8.3.3",
"rxjs": "^7.5.2"
},
"devDependencies": {
"@polkadot/api-augment": "7.5.1",
"@polkadot/keyring": "^8.3.3"
}
}
-52
View File
@@ -1,52 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { blake2AsHex } from '@polkadot/util-crypto';
import abis from '../test/contracts';
import { Abi } from '.';
interface JSONAbi {
source: {
compiler: string,
hash: string,
language: string,
wasm: string
},
spec: {
messages: {
name: string[] | string
}[]
}
}
describe('Abi', (): void => {
Object.entries(abis).forEach(([abiName, abi]) => {
it(`initializes from a contract ABI (${abiName})`, (): void => {
try {
const messageIds = (abi as JSONAbi).spec.messages.map(({ name }) => Array.isArray(name) ? name[0] : name);
const inkAbi = new Abi(abis[abiName]);
expect(inkAbi.messages.map(({ identifier }) => identifier)).toEqual(messageIds);
} catch (error) {
console.error(error);
throw error;
}
});
});
it('has the correct hash for the source', (): void => {
const bundle = abis.ink_flipperBundle as JSONAbi;
const abi = new Abi(bundle as any);
// manual
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
// the Codec hash
expect(bundle.source.hash).toEqual(abi.project.source.wasm.hash.toHex());
// the hash as per the actual Abi
expect(bundle.source.hash).toEqual(abi.project.source.wasmHash.toHex());
});
});
-198
View File
@@ -1,198 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes } from '@polkadot/types';
import type { ChainProperties, ContractConstructorSpec, ContractEventSpec, ContractMessageParamSpec, ContractMessageSpec, ContractProject } from '@polkadot/types/interfaces';
import type { AnyJson, Codec } from '@polkadot/types/types';
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from './types';
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { MetaRegistry } from './MetaRegistry';
const l = logger('Abi');
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
const message = isNumber(messageOrId)
? list[messageOrId]
: isString(messageOrId)
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
: messageOrId;
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
}
export class Abi {
readonly #events: AbiEvent[];
public readonly constructors: AbiConstructor[];
public readonly json: AnyJson;
public readonly messages: AbiMessage[];
public readonly project: ContractProject;
public readonly registry: MetaRegistry;
constructor (abiJson: AnyJson, chainProperties?: ChainProperties) {
const json = isString(abiJson)
? JSON.parse(abiJson) as AnyJson
: abiJson;
assert(isObject(json) && !Array.isArray(json) && json.metadataVersion && isObject(json.spec) && !Array.isArray(json.spec) && Array.isArray(json.spec.constructors) && Array.isArray(json.spec.messages), 'Invalid JSON ABI structure supplied, expected a recent metadata version');
this.json = json;
this.registry = new MetaRegistry(json.metadataVersion as string, chainProperties);
this.project = this.registry.createType('ContractProject', json);
this.registry.setMetaTypes(this.project.types);
this.project.types.forEach((_, index) =>
this.registry.getMetaTypeDef({ type: this.registry.createType('Si0LookupTypeId', index + this.registry.typeOffset) })
);
this.constructors = this.project.spec.constructors.map((spec: ContractConstructorSpec, index) =>
this.#createMessage(spec, index, {
isConstructor: true
})
);
this.#events = this.project.spec.events.map((spec: ContractEventSpec, index) =>
this.#createEvent(spec, index)
);
this.messages = this.project.spec.messages.map((spec: ContractMessageSpec, index): AbiMessage => {
const typeSpec = spec.returnType.unwrapOr(null);
return this.#createMessage(spec, index, {
isMutating: spec.mutates.isTrue,
isPayable: spec.payable.isTrue,
returnType: typeSpec
? this.registry.getMetaTypeDef(typeSpec)
: null
});
});
}
/**
* Warning: Unstable API, bound to change
*/
public decodeEvent (data: Bytes | Uint8Array): DecodedEvent {
const index = data[0];
const event = this.#events[index];
assert(event, () => `Unable to find event with index ${index}`);
return event.fromU8a(data.subarray(1));
}
/**
* Warning: Unstable API, bound to change
*/
public decodeConstructor (data: Uint8Array): DecodedMessage {
return this.#decodeMessage('message', this.constructors, data);
}
/**
* Warning: Unstable API, bound to change
*/
public decodeMessage (data: Uint8Array): DecodedMessage {
return this.#decodeMessage('message', this.messages, data);
}
public findConstructor (constructorOrId: AbiConstructor | string | number): AbiConstructor {
return findMessage(this.constructors, constructorOrId);
}
public findMessage (messageOrId: AbiMessage | string | number): AbiMessage {
return findMessage(this.messages, messageOrId);
}
#createArgs = (args: ContractMessageParamSpec[], spec: unknown): AbiParam[] => {
return args.map((arg, index): AbiParam => {
try {
assert(isObject(arg.type), 'Invalid type definition found');
return {
name: stringCamelCase(arg.name),
type: this.registry.getMetaTypeDef(arg.type)
};
} catch (error) {
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
throw error;
}
});
}
#createEvent = (spec: ContractEventSpec, index: number): AbiEvent => {
const args = this.#createArgs(spec.args, spec);
const event = {
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedEvent => ({
args: this.#decodeArgs(args, data),
event
}),
identifier: spec.name.toString(),
index
};
return event;
}
#createMessage = (spec: ContractMessageSpec | ContractConstructorSpec, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
const args = this.#createArgs(spec.args, spec);
const identifier = spec.name.toString();
const message = {
...add,
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedMessage => ({
args: this.#decodeArgs(args, data),
message
}),
identifier,
index,
method: stringCamelCase(identifier),
selector: spec.selector,
toU8a: (params: unknown[]) =>
this.#encodeArgs(spec, args, params)
};
return message;
}
#decodeArgs = (args: AbiParam[], data: Uint8Array): Codec[] => {
// for decoding we expect the input to be just the arg data, no selectors
// no length added (this allows use with events as well)
let offset = 0;
return args.map(({ type }): Codec => {
const value = this.registry.createType(type.type as 'Text', data.subarray(offset));
offset += value.encodedLength;
return value;
});
}
#decodeMessage = (type: 'constructor' | 'message', list: AbiMessage[], data: Uint8Array): DecodedMessage => {
const [, trimmed] = compactStripLength(data);
const selector = trimmed.subarray(0, 4);
const message = list.find((m) => m.selector.eq(selector));
assert(message, `Unable to find ${type} with selector ${u8aToHex(selector)}`);
return message.fromU8a(trimmed.subarray(4));
}
#encodeArgs = ({ name, selector }: ContractMessageSpec | ContractConstructorSpec, args: AbiParam[], data: unknown[]): Uint8Array => {
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${name.toString()}', found ${data.length}`);
return compactAddLength(
u8aConcat(
this.registry.createType('ContractSelector', selector).toU8a(),
...args.map(({ type }, index) => this.registry.createType(type.type as 'Text', data[index]).toU8a())
)
);
}
}
+117
View File
@@ -0,0 +1,117 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Registry } from '@polkadot/types/types';
import fs from 'fs';
import path from 'path';
import { TypeDefInfo } from '@polkadot/types/types';
import { blake2AsHex } from '@polkadot/util-crypto';
import abis from '../test/contracts';
import { Abi } from '.';
interface SpecDef {
messages: {
label: string;
name: string[] | string
}[]
}
interface JSONAbi {
source: {
compiler: string,
hash: string,
language: string,
wasm: string
},
spec: SpecDef;
V1: {
spec: SpecDef;
},
V2: {
spec: SpecDef;
},
V3: {
spec: SpecDef;
}
}
function stringifyInfo (key: string, value: unknown): unknown {
return key === 'info'
? TypeDefInfo[value as number]
: value;
}
function stringifyJson (registry: Registry): string {
const defs = registry.lookup.types.map(({ id }) =>
registry.lookup.getTypeDef(id)
);
return JSON.stringify(defs, stringifyInfo, 2);
}
describe('Abi', (): void => {
describe('ABI', (): void => {
Object.entries(abis).forEach(([abiName, _abi]) => {
const abi = _abi as unknown as JSONAbi;
it(`initializes from a contract ABI (${abiName})`, (): void => {
try {
const messageIds = (abi.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) {
console.error(error);
throw error;
}
});
});
});
describe('TypeDef', (): void => {
Object.keys(abis).forEach((abiName) => {
it(`initializes from a contract ABI (${abiName})`, (): void => {
const abi = new Abi(abis[abiName]);
const json = stringifyJson(abi.registry);
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
expect(JSON.parse(json)).toEqual(require(cmpPath));
} catch (error) {
if (process.env.GITHUB_REPOSITORY) {
console.error(json);
throw error;
}
fs.writeFileSync(cmpPath, json, { flag: 'w' });
}
});
});
});
it('has the correct hash for the source', (): void => {
const abi = new Abi(abis.ink_v0_flipperBundle);
const bundle = abis.ink_v0_flipperBundle as unknown as JSONAbi;
// manual
expect(bundle.source.hash).toEqual(blake2AsHex(bundle.source.wasm));
// the Codec hash
expect(bundle.source.hash).toEqual(abi.info.source.wasm.hash.toHex());
// the hash as per the actual Abi
expect(bundle.source.hash).toEqual(abi.info.source.wasmHash.toHex());
});
});
+253
View File
@@ -0,0 +1,253 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Bytes } from '@polkadot/types';
import type { ChainProperties, ContractConstructorSpecLatest, ContractEventSpecLatest, ContractMessageParamSpecLatest, ContractMessageSpecLatest, ContractMetadata, ContractMetadataLatest, ContractProjectInfo } from '@polkadot/types/interfaces';
import type { Codec, Registry } from '@polkadot/types/types';
import type { AbiConstructor, AbiEvent, AbiMessage, AbiParam, DecodedEvent, DecodedMessage } from '../types';
import { TypeRegistry } from '@polkadot/types';
import { TypeDefInfo } from '@polkadot/types-create';
import { assert, assertReturn, compactAddLength, compactStripLength, isNumber, isObject, isString, logger, stringCamelCase, stringify, u8aConcat, u8aToHex } from '@polkadot/util';
import { convertVersions, enumVersions } from './toLatest';
const l = logger('Abi');
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
function findMessage <T extends AbiMessage> (list: T[], messageOrId: T | string | number): T {
const message = isNumber(messageOrId)
? list[messageOrId]
: isString(messageOrId)
? list.find(({ identifier }) => [identifier, stringCamelCase(identifier)].includes(messageOrId.toString()))
: messageOrId;
return assertReturn(message, () => `Attempted to call an invalid contract interface, ${stringify(messageOrId)}`);
}
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) as unknown as ContractProjectInfo;
const latest = getLatestMeta(registry, json);
const lookup = registry.createType('PortableRegistry', { types: latest.types });
// attach the lookup to the registry - now the types are known
registry.setLookup(lookup);
if (chainProperties) {
registry.setChainProperties(chainProperties);
}
// warm-up the actual type, pre-use
lookup.types.forEach(({ id }) =>
lookup.getTypeDef(id)
);
return [json, registry, latest, info];
}
export class Abi {
public readonly events: AbiEvent[];
public readonly constructors: AbiConstructor[];
public readonly info: ContractProjectInfo;
public readonly json: Record<string, unknown>;
public readonly messages: AbiMessage[];
public readonly metadata: ContractMetadataLatest;
public readonly registry: Registry;
constructor (abiJson: Record<string, unknown> | string, chainProperties?: ChainProperties) {
[this.json, this.registry, this.metadata, this.info] = parseJson(
isString(abiJson)
? JSON.parse(abiJson) as Record<string, unknown>
: abiJson,
chainProperties
);
this.constructors = this.metadata.spec.constructors.map((spec: ContractConstructorSpecLatest, index) =>
this.#createMessage(spec, index, {
isConstructor: true,
isPayable: spec.payable.isTrue
})
);
this.events = this.metadata.spec.events.map((spec: ContractEventSpecLatest, index) =>
this.#createEvent(spec, index)
);
this.messages = this.metadata.spec.messages.map((spec: ContractMessageSpecLatest, index): AbiMessage => {
const typeSpec = spec.returnType.unwrapOr(null);
return this.#createMessage(spec, index, {
isMutating: spec.mutates.isTrue,
isPayable: spec.payable.isTrue,
returnType: typeSpec
? this.registry.lookup.getTypeDef(typeSpec.type)
: null
});
});
}
/**
* Warning: Unstable API, bound to change
*/
public decodeEvent (data: Bytes | Uint8Array): DecodedEvent {
const index = data[0];
const event = this.events[index];
assert(event, () => `Unable to find event with index ${index}`);
return event.fromU8a(data.subarray(1));
}
/**
* Warning: Unstable API, bound to change
*/
public decodeConstructor (data: Uint8Array): DecodedMessage {
return this.#decodeMessage('message', this.constructors, data);
}
/**
* Warning: Unstable API, bound to change
*/
public decodeMessage (data: Uint8Array): DecodedMessage {
return this.#decodeMessage('message', this.messages, data);
}
public findConstructor (constructorOrId: AbiConstructor | string | number): AbiConstructor {
return findMessage(this.constructors, constructorOrId);
}
public findMessage (messageOrId: AbiMessage | string | number): AbiMessage {
return findMessage(this.messages, messageOrId);
}
#createArgs = (args: ContractMessageParamSpecLatest[], spec: unknown): AbiParam[] => {
return args.map(({ label, type }, index): AbiParam => {
try {
assert(isObject(type), 'Invalid type definition found');
const displayName = type.displayName.length
? type.displayName[type.displayName.length - 1].toString()
: undefined;
const camelName = stringCamelCase(label);
if (displayName && PRIMITIVE_ALWAYS.includes(displayName)) {
return {
name: camelName,
type: {
info: TypeDefInfo.Plain,
type: displayName
}
};
}
const typeDef = this.registry.lookup.getTypeDef(type.type);
return {
name: camelName,
type: displayName && !typeDef.type.startsWith(displayName)
? { displayName, ...typeDef }
: typeDef
};
} catch (error) {
l.error(`Error expanding argument ${index} in ${stringify(spec)}`);
throw error;
}
});
};
#createEvent = (spec: ContractEventSpecLatest, index: number): AbiEvent => {
const args = this.#createArgs(spec.args, spec);
const event = {
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedEvent => ({
args: this.#decodeArgs(args, data),
event
}),
identifier: spec.label.toString(),
index
};
return event;
};
#createMessage = (spec: ContractMessageSpecLatest | ContractConstructorSpecLatest, index: number, add: Partial<AbiMessage> = {}): AbiMessage => {
const args = this.#createArgs(spec.args, spec);
const identifier = spec.label.toString();
const message = {
...add,
args,
docs: spec.docs.map((d) => d.toString()),
fromU8a: (data: Uint8Array): DecodedMessage => ({
args: this.#decodeArgs(args, data),
message
}),
identifier,
index,
method: stringCamelCase(identifier),
path: identifier.split('::').map((s) => stringCamelCase(s)),
selector: spec.selector,
toU8a: (params: unknown[]) =>
this.#encodeArgs(spec, args, params)
};
return message;
};
#decodeArgs = (args: AbiParam[], data: Uint8Array): Codec[] => {
// for decoding we expect the input to be just the arg data, no selectors
// no length added (this allows use with events as well)
let offset = 0;
return args.map(({ type: { lookupName, type } }): Codec => {
const value = this.registry.createType(lookupName || type, data.subarray(offset));
offset += value.encodedLength;
return value;
});
};
#decodeMessage = (type: 'constructor' | 'message', list: AbiMessage[], data: Uint8Array): DecodedMessage => {
const [, trimmed] = compactStripLength(data);
const selector = trimmed.subarray(0, 4);
const message = list.find((m) => m.selector.eq(selector));
assert(message, `Unable to find ${type} with selector ${u8aToHex(selector)}`);
return message.fromU8a(trimmed.subarray(4));
};
#encodeArgs = ({ label, selector }: ContractMessageSpecLatest | ContractConstructorSpecLatest, args: AbiParam[], data: unknown[]): Uint8Array => {
assert(data.length === args.length, () => `Expected ${args.length} arguments to contract message '${label.toString()}', found ${data.length}`);
return compactAddLength(
u8aConcat(
this.registry.createType('ContractSelector', selector).toU8a(),
...args.map(({ type: { lookupName, type } }, index) =>
this.registry.createType(lookupName || type, data[index]).toU8a()
)
)
);
};
}
@@ -0,0 +1,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'
]);
});
});
+38
View File
@@ -0,0 +1,38 @@
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ContractMetadataLatest, ContractMetadataV3 } from '@polkadot/types/interfaces';
import type { Registry } from '@polkadot/types/types';
import { v0ToV1 } from './toV1';
import { v1ToV2 } from './toV2';
import { v2ToV3 } from './toV3';
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 }))
)
})
}));
}
@@ -1,43 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import fs from 'fs';
import path from 'path';
import { TypeDefInfo } from '@polkadot/types/types';
import abis from '../test/contracts';
import { Abi } from '.';
function stringifyInfo (key: string, value: unknown): unknown {
return key === 'info'
? TypeDefInfo[value as number]
: value;
}
describe('MetaRegistry', (): void => {
Object.keys(abis).forEach((abiName) => {
it(`initializes from a contract ABI (${abiName})`, (): void => {
const abi = new Abi(abis[abiName]);
const json = JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo, 2);
const cmpPath = path.join(__dirname, `../test/compare/${abiName}.test.json`);
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
expect(JSON.parse(json)).toEqual(require(cmpPath));
} catch (error) {
if (process.env.GITHUB_REPOSITORY) {
console.error(JSON.stringify(abi.registry.metaTypeDefs, stringifyInfo));
throw error;
}
fs.writeFileSync(cmpPath, json, { flag: 'w' });
}
});
});
it('stores base project as JSON', (): void => {
expect(new Abi(abis.ink_dns).json).toEqual(abis.ink_dns);
});
});
-252
View File
@@ -1,252 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ChainProperties, ContractDisplayName, Si0Field, Si0LookupTypeId, Si0Type, Si0TypeDefArray, Si0TypeDefSequence, Si0TypeDefTuple, Si0TypeDefVariant, Si0Variant } from '@polkadot/types/interfaces';
import type { InterfaceTypes, TypeDef } from '@polkadot/types/types';
import { TypeDefInfo, TypeRegistry, withTypeString } from '@polkadot/types';
import { assert, isUndefined } from '@polkadot/util';
interface PartialTypeSpec {
readonly type: Si0LookupTypeId;
readonly displayName?: ContractDisplayName;
}
// convert the offset into project-specific, index-1
export function getRegistryOffset (id: Si0LookupTypeId, typeOffset: number): number {
return id.toNumber() - typeOffset;
}
const PRIMITIVE_ALIAS: Record<string, keyof InterfaceTypes> = {
Char: 'u32', // Rust char is 4-bytes
Str: 'Text'
};
const PRIMITIVE_ALWAYS = ['AccountId', 'AccountIndex', 'Address', 'Balance'];
// TODO Replace usages with PortableRegistry
export class MetaRegistry extends TypeRegistry {
public readonly metaTypeDefs: TypeDef[] = [];
public readonly typeOffset;
#siTypes: Si0Type[] = [];
constructor (metadataVersion: string, chainProperties?: ChainProperties) {
super();
const [major, minor] = metadataVersion.split('.').map((n) => parseInt(n, 10));
// type indexes are 1-based pre 0.7 and 0-based post
this.typeOffset = (major === 0 && minor < 7) ? 1 : 0;
if (chainProperties) {
this.setChainProperties(chainProperties);
}
}
public setMetaTypes (metaTypes: Si0Type[]): void {
this.#siTypes = metaTypes;
}
public getMetaTypeDef (typeSpec: PartialTypeSpec): TypeDef {
const offset = getRegistryOffset(typeSpec.type, this.typeOffset);
let typeDef = this.metaTypeDefs[offset];
if (!typeDef) {
typeDef = this.#extract(this.#getMetaType(typeSpec.type), typeSpec.type);
this.metaTypeDefs[offset] = typeDef;
}
if (typeSpec.displayName && typeSpec.displayName.length) {
const displayName = typeSpec.displayName[typeSpec.displayName.length - 1].toString();
if (!typeDef.type.startsWith(displayName)) {
typeDef = {
...typeDef,
displayName,
type: PRIMITIVE_ALWAYS.includes(displayName)
? displayName
: typeDef.type
};
}
}
// Here we protect against the following cases
// - No displayName present, these are generally known primitives
// - displayName === type, these generate circular references
// - displayName Option & type Option<...something...>
if (typeDef.displayName && !this.hasType(typeDef.displayName) && !(typeDef.type === typeDef.displayName || typeDef.type.startsWith(`${typeDef.displayName}<`))) {
this.register({ [typeDef.displayName]: typeDef.type });
}
return typeDef;
}
#getMetaType = (id: Si0LookupTypeId): Si0Type => {
const type = this.#siTypes[getRegistryOffset(id, this.typeOffset)];
assert(!isUndefined(type), () => `getMetaType:: Unable to find ${id.toNumber()} in type values`);
return this.createType('Si0Type', type);
}
#extract = (type: Si0Type, id: Si0LookupTypeId): TypeDef => {
const path = [...type.path];
const isPrimitivePath = !!path.length && (
(path.length > 2 && path[0].eq('ink_env') && path[1].eq('types')) ||
PRIMITIVE_ALWAYS.includes(path[path.length - 1].toString())
);
let typeDef: Omit<TypeDef, 'type'>;
if (isPrimitivePath) {
typeDef = this.#extractPrimitivePath(type);
} else if (type.def.isPrimitive) {
typeDef = this.#extractPrimitive(type);
} else if (type.def.isComposite) {
typeDef = this.#extractFields(type.def.asComposite.fields);
} else if (type.def.isVariant) {
typeDef = this.#extractVariant(type.def.asVariant, id);
} else if (type.def.isArray) {
typeDef = this.#extractArray(type.def.asArray);
} else if (type.def.isSequence) {
typeDef = this.#extractSequence(type.def.asSequence, id);
} else if (type.def.isTuple) {
typeDef = this.#extractTuple(type.def.asTuple);
} else {
throw new Error(`Invalid ink! type at index ${id.toString()}`);
}
const displayName = path.pop()?.toString();
return withTypeString(this, {
...(displayName
? { displayName }
: {}
),
...(path.length > 1
? { namespace: path.map((s) => s.toString()).join('::') }
: {}
),
...(type.params.length > 0
? { sub: type.params.map((type) => this.getMetaTypeDef({ type })) }
: {}
),
...typeDef
});
}
#extractArray = ({ len: length, type }: Si0TypeDefArray): Omit<TypeDef, 'type'> => {
assert(!length || length.toNumber() <= 256, 'MetaRegistry: Only support for [Type; <length>], where length <= 256');
return {
info: TypeDefInfo.VecFixed,
length: length.toNumber(),
sub: this.getMetaTypeDef({ type })
};
}
#extractFields = (fields: Si0Field[]): Omit<TypeDef, 'type'> => {
const [isStruct, isTuple] = fields.reduce(([isAllNamed, isAllUnnamed], { name }) => ([
isAllNamed && name.isSome,
isAllUnnamed && name.isNone
]),
[true, true]);
assert(isTuple || isStruct, 'Invalid fields type detected, expected either Tuple or Struct');
const sub = fields.map(({ name, type }) => ({
...this.getMetaTypeDef({ type }),
...(name.isSome
? { name: name.unwrap().toString() }
: {}
)
}));
return isTuple && sub.length === 1
? sub[0]
: {
// check for tuple first (no fields may be available)
info: isTuple
? TypeDefInfo.Tuple
: TypeDefInfo.Struct,
sub
};
}
#extractPrimitive = (type: Si0Type): TypeDef => {
const typeStr = type.def.asPrimitive.type.toString();
return {
info: TypeDefInfo.Plain,
type: PRIMITIVE_ALIAS[typeStr] || typeStr.toLowerCase()
};
}
#extractPrimitivePath = (type: Si0Type): TypeDef => {
return {
info: TypeDefInfo.Plain,
type: type.path[type.path.length - 1].toString()
};
}
#extractSequence = ({ type }: Si0TypeDefSequence, id: Si0LookupTypeId): Omit<TypeDef, 'type'> => {
assert(!!type, () => `ContractRegistry: Invalid sequence type found at id ${id.toString()}`);
return {
info: TypeDefInfo.Vec,
sub: this.getMetaTypeDef({ type })
};
}
#extractTuple = (ids: Si0TypeDefTuple): Omit<TypeDef, 'type'> => {
return ids.length === 1
? this.getMetaTypeDef({ type: ids[0] })
: {
info: TypeDefInfo.Tuple,
sub: ids.map((type) => this.getMetaTypeDef({ type }))
};
}
#extractVariant = ({ variants }: Si0TypeDefVariant, id: Si0LookupTypeId): Omit<TypeDef, 'type'> => {
const { params, path } = this.#getMetaType(id);
const specialVariant = path[0].toString();
return specialVariant === 'Option'
? {
info: TypeDefInfo.Option,
sub: this.getMetaTypeDef({ type: params[0] })
}
: specialVariant === 'Result'
? {
info: TypeDefInfo.Result,
sub: params.map((type, index) => ({
name: ['Ok', 'Error'][index],
...this.getMetaTypeDef({ type })
}))
}
: {
info: TypeDefInfo.Enum,
sub: this.#extractVariantSub(variants)
};
}
#extractVariantSub = (variants: Si0Variant[]): TypeDef[] => {
return variants.every(({ fields }) => fields.length === 0)
? variants.map(({ discriminant, name }) => ({
...(
discriminant.isSome
? { ext: { discriminant: discriminant.unwrap().toNumber() } }
: {}
),
info: TypeDefInfo.Plain,
name: name.toString(),
type: 'Null'
}))
: variants.map(({ fields, name }) => withTypeString(this, {
...this.#extractFields(fields),
name: name.toString()
}));
}
}
+10 -7
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';
@@ -14,19 +14,22 @@ export abstract class Base<ApiType extends ApiTypes> {
public readonly api: ApiBase<ApiType>;
public readonly registry: Registry;
protected readonly _decorateMethod: DecorateMethod<ApiType>;
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, decorateMethod: DecorateMethod<ApiType>) {
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, decorateMethod: DecorateMethod<ApiType>) {
this.abi = abi instanceof Abi
? abi
: new Abi(abi, api.registry.getChainProperties());
this.api = api;
this.registry = this.abi.registry;
this._decorateMethod = decorateMethod;
assert(!!(api && api.isConnected && api.tx && api.tx.contracts && Object.keys(api.tx.contracts).length), 'Your API has not been initialized correctly and it not decorated with the runtime interfaces for contracts as retrieved from the on-chain runtime');
assert(!!(api && api.isConnected && api.tx), 'Your API has not been initialized correctly and is not connected to a chain');
assert(!!(api.tx.contracts && Object.keys(api.tx.contracts).length), 'You need to connect to a chain with a runtime that supports contracts');
assert(isFunction(api.tx.contracts.instantiateWithCode), 'You need to connect to a chain with a runtime with a V3 contracts module. The runtime does not expose api.tx.contracts.instantiateWithCode');
}
public get registry (): Registry {
return this.api.registry;
}
}
+34 -19
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);
}
};
}
+15 -8
View File
@@ -1,28 +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 fs from 'fs';
import path from 'path';
import { decorateMethodPromise } from '@polkadot/api';
import { toPromiseMethod } from '@polkadot/api';
import contractFlipper from '../../test/contracts/ink/flipper.contract.json';
import abiFlipper from '../../test/contracts/ink/flipper.json';
import v0contractFlipper from '../test/contracts/ink/v0/flipper.contract.json';
import v0abiFlipper from '../test/contracts/ink/v0/flipper.json';
import v1contractFlipper from '../test/contracts/ink/v1/flipper.contract.json';
import { Code } from './Code';
import { mockApi } from './mock';
const wasmFlipper = fs.readFileSync(path.join(__dirname, '../../test/contracts/ink/flipper.wasm'));
const v0wasmFlipper = fs.readFileSync(path.join(__dirname, '../test/contracts/ink/v0/flipper.wasm'));
describe('Code', (): void => {
it('can construct with an individual ABI/WASM combo', (): void => {
expect(
() => new Code(mockApi, abiFlipper, wasmFlipper, decorateMethodPromise)
() => new Code(mockApi, v0abiFlipper as Record<string, unknown>, v0wasmFlipper, toPromiseMethod)
).not.toThrow();
});
it('can construct with an .contract ABI', (): void => {
it('can construct with an .contract ABI (v0)', (): void => {
expect(
() => new Code(mockApi, contractFlipper, null, decorateMethodPromise)
() => new Code(mockApi, v0contractFlipper as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
it.only('can construct with an .contract ABI (v1)', (): void => {
expect(
() => new Code(mockApi, v1contractFlipper as Record<string, unknown>, null, toPromiseMethod)
).not.toThrow();
});
});
+45 -28
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,18 +41,18 @@ export class Code<ApiType extends ApiTypes> extends Base<ApiType> {
readonly #tx: MapConstructorExec<ApiType> = {};
constructor (api: ApiBase<ApiType>, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
constructor (api: ApiBase<ApiType>, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined, decorateMethod: DecorateMethod<ApiType>) {
super(api, abi, decorateMethod);
this.code = isWasm(this.abi.project.source.wasm)
? this.abi.project.source.wasm
this.code = isWasm(this.abi.info.source.wasm)
? this.abi.info.source.wasm
: u8aToU8a(wasm);
assert(isWasm(this.code), 'No WASM code provided');
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);
}
};
}
+81 -64
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';
@@ -13,12 +13,16 @@ import { map } from 'rxjs';
import { SubmittableResult } from '@polkadot/api';
import { ApiBase } from '@polkadot/api/base';
import { createTypeUnsafe } from '@polkadot/types';
import { assert, BN, BN_HUNDRED, BN_ONE, BN_ZERO, bnToBn, isFunction, isUndefined, logger } from '@polkadot/util';
import { Abi } from '../Abi';
import { applyOnEvent, extractOptions, isOptions } from '../util';
import { Base } from './Base';
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);
@@ -26,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 {
@@ -60,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));
}
});
}
@@ -97,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}`);
#read = (messageOrId: AbiMessage | string | number, { gasLimit = BN_ZERO, value = BN_ZERO }: ContractOptions, params: unknown[]): ContractCallSend<ApiType> => {
return null;
}
})
.filter((decoded): decoded is DecodedEvent => !!decoded)
))
);
};
#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
? createTypeUnsafe(this.registry, message.returnType.type, [result.asOk.data.toU8a(true)], { isPedantic: true })
: null,
result
}))
)
)
send: this._decorateMethod((origin: string | AccountId | Uint8Array) => {
const hasStorageDeposit = this.api.tx.contracts.call.meta.args.length === 5;
const 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,16 +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 '@polkadot/api-augment';
import { ApiPromise } from '@polkadot/api';
import { BlueprintPromise, ContractPromise } from '@polkadot/api-contract';
import { createTestPairs, TestKeyringMap } from '@polkadot/keyring/testingPairs';
import abiIncrementer from '../test/contracts/ink/incrementer.json';
import { BlueprintPromise, ContractPromise } from '.';
import abiIncrementer from './test/contracts/ink/v0/incrementer.json';
async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
const blueprint = new BlueprintPromise(api, abiIncrementer, '0x1234');
const blueprint = new BlueprintPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
// new style
await blueprint.tx.new({ gasLimit: 456, salt: '0x1234', value: 123 }, 42).signAndSend(pairs.bob);
@@ -21,7 +23,7 @@ async function checkBlueprint (api: ApiPromise, pairs: TestKeyringMap): Promise<
}
async function checkContract (api: ApiPromise, pairs: TestKeyringMap): Promise<void> {
const contract = new ContractPromise(api, abiIncrementer, '0x1234');
const contract = new ContractPromise(api, abiIncrementer as Record<string, unknown>, '0x1234');
// queries
await contract.query.get(pairs.alice.address, {});
+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];
+5 -4
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 { packageInfo as apiInfo } from '@polkadot/api/packageInfo';
import { packageInfo as typesInfo } from '@polkadot/types/packageInfo';
// Do not edit, auto-generated by @polkadot/dev
import { detectPackage } from '@polkadot/util';
import others from './detectOther';
import { packageInfo } from './packageInfo';
detectPackage(packageInfo, typeof __dirname !== 'undefined' && __dirname, [apiInfo, typesInfo]);
detectPackage(packageInfo, null, others);
+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 './detectPackage';
+3 -3
View File
@@ -1,6 +1,6 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
// Auto-generated by @polkadot/dev, do not edit
// Do not edit, auto-generated by @polkadot/dev
export const packageInfo = { name: '@polkadot/api-contract', version: '5.8.2' };
export const packageInfo = { name: '@polkadot/api-contract', path: 'auto', type: 'auto', version: '7.5.1' };
@@ -1,16 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Hash } from '@polkadot/types/interfaces';
import type { AnyJson } from '@polkadot/types/types';
import { ApiPromise, decorateMethodPromise } from '@polkadot/api';
import { Abi } from '../Abi';
import { Blueprint as BaseBlueprint } from '../base';
export class Blueprint extends BaseBlueprint<'promise'> {
constructor (api: ApiPromise, abi: AnyJson | Abi, codeHash: string | Hash) {
super(api, abi, codeHash, decorateMethodPromise);
}
}
-16
View File
@@ -1,16 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { ApiPromise } from '@polkadot/api';
import type { AnyJson } from '@polkadot/types/types';
import { decorateMethodPromise } from '@polkadot/api';
import { Abi } from '../Abi';
import { Code as BaseCode } from '../base';
export class Code extends BaseCode<'promise'> {
constructor (api: ApiPromise, abi: AnyJson | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
super(api, abi, wasm, decorateMethodPromise);
}
}
@@ -1,16 +0,0 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AccountId } from '@polkadot/types/interfaces';
import type { AnyJson } from '@polkadot/types/types';
import { ApiPromise, decorateMethodPromise } from '@polkadot/api';
import { Abi } from '../Abi';
import { Contract as BaseContract } from '../base';
export class Contract extends BaseContract<'promise'> {
constructor (api: ApiPromise, abi: AnyJson | Abi, address: string | AccountId) {
super(api, abi, address, decorateMethodPromise);
}
}
+25 -4
View File
@@ -1,6 +1,27 @@
// Copyright 2017-2021 @polkadot/api-contract authors & contributors
// Copyright 2017-2022 @polkadot/api-contract authors & contributors
// SPDX-License-Identifier: Apache-2.0
export { Blueprint } from './Blueprint';
export { Code } from './Code';
export { Contract } from './Contract';
import type { AccountId, Hash } from '@polkadot/types/interfaces';
import { ApiPromise, toPromiseMethod } from '@polkadot/api';
import { Abi } from '../Abi';
import { Blueprint, Code, Contract } from '../base';
export class BlueprintPromise extends Blueprint<'promise'> {
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, codeHash: string | Hash) {
super(api, abi, codeHash, toPromiseMethod);
}
}
export class CodePromise extends Code<'promise'> {
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, wasm: Uint8Array | string | Buffer | null | undefined) {
super(api, abi, wasm, toPromiseMethod);
}
}
export class ContractPromise extends Contract<'promise'> {
constructor (api: ApiPromise, abi: string | Record<string, unknown> | Abi, address: string | AccountId) {
super(api, abi, address, toPromiseMethod);
}
}
+1 -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 type { BlueprintSubmittableResult as BaseBlueprintSubmittableResult, CodeSubmittableResult as BaseCodeSubmittableResult } from '../base';

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