Skip to content

Commit acf90b3

Browse files
committed
Merge branch 'master' into jg-ns
2 parents 7db2101 + 756f817 commit acf90b3

File tree

225 files changed

+31172
-17558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+31172
-17558
lines changed

.123trigger

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
39
1+
40
22

33
1.4.2
44
1.6.2
@@ -47,4 +47,7 @@
4747
6.10.2
4848
6.10.3
4949

50-
7.0.2
50+
7.0.2
51+
52+
7.14.2
53+
7.14.3

.github/workflows/auto-approve.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: bot
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
7+
jobs:
8+
approve:
9+
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: jacogr/action-approve@master
13+
with:
14+
authors: jacogr
15+
labels: -auto
16+
token: ${{ secrets.GH_PAT_BOT }}

.github/workflows/auto-merge.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: bot
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
7+
jobs:
8+
merge:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: jacogr/action-merge@master
12+
with:
13+
checks: build,lint,test
14+
labels: -auto
15+
strategy: squash
16+
token: ${{ secrets.GH_PAT_BOT }}

.github/workflows/lock.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
lock:
99
runs-on: ubuntu-latest
10+
env:
11+
YARN_ENABLE_SCRIPTS: false
1012
steps:
1113
- uses: dessant/lock-threads@v2
1214
with:

.github/workflows/pr-any.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
step: ['lint', 'test', 'build']
99
name: ${{ matrix.step }}
1010
runs-on: ubuntu-latest
11+
env:
12+
YARN_ENABLE_SCRIPTS: false
1113
steps:
1214
- uses: actions/checkout@v2
1315
- name: ${{ matrix.step }}

.github/workflows/push-master.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@ jobs:
1212
step: ['build:release']
1313
name: ${{ matrix.step }}
1414
runs-on: ubuntu-latest
15+
env:
16+
YARN_ENABLE_SCRIPTS: false
17+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
18+
GH_PAT: ${{ secrets.GH_PAT }}
19+
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
20+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1521
steps:
1622
- uses: actions/checkout@v2
1723
with:
1824
fetch-depth: 0
1925
token: ${{ secrets.GH_PAT }}
2026
- name: ${{ matrix.step }}
21-
env:
22-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
23-
GH_PAT: ${{ secrets.GH_PAT }}
24-
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
25-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2627
run: |
2728
yarn install --immutable | grep -v 'YN0013'
2829
yarn ${{ matrix.step }}

.github/workflows/semgrep.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
check:
1010
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
1111
runs-on: ubuntu-latest
12+
env:
13+
YARN_ENABLE_SCRIPTS: false
1214
steps:
1315
- uses: actions/checkout@v2
1416
- uses: returntocorp/semgrep-action@v1

.github/workflows/stale.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
jobs:
77
stale:
88
runs-on: ubuntu-latest
9+
env:
10+
YARN_ENABLE_SCRIPTS: false
911
steps:
1012
- uses: actions/stale@v3
1113
with:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ docs/.vuepress/dist/
66
docs/substrate/*.md
77
node_modules/
88
tmp/
9+
NOTES.md
910
.DS_Store
1011
.env.local
1112
.env.development.local

.yarn/releases/yarn-3.1.1.cjs

-768
This file was deleted.

.yarn/releases/yarn-3.2.0.cjs

+785
Large diffs are not rendered by default.

.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ plugins:
1010
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
1111
spec: "@yarnpkg/plugin-version"
1212

13-
yarnPath: .yarn/releases/yarn-3.1.1.cjs
13+
yarnPath: .yarn/releases/yarn-3.2.0.cjs

CHANGELOG.md

+160
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,172 @@
22

33
## master
44

5+
Contributed:
6+
7+
- Export `WellKnownChain` for `substrate-connect` (Thanks to https://github.com/josepot)
8+
- Add support for `{entries, keys}Paged` in `.at` (Thanks to https://github.com/xlc)
9+
- Align `WeightsPerClass` interface on `maxExtrinsic` (Thanks to https://github.com/HackFisher)
10+
11+
Changes:
12+
13+
- Cater for `DispatchError` with `error` as `[u8; 4]`
14+
- Add in-flight cache for parallel same-version metadata queries
15+
16+
17+
## 7.14.3 Mar 28, 2022
18+
519
Changes:
620

21+
- Ensure `BitVec` with MSB does not fail (used in Polkadot `DeliveredMessages`)
22+
23+
24+
## 7.14.2 Mar 28, 2022
25+
26+
Changes:
27+
28+
- Don't export `ScProvider` top-level in `@polkadot/rpc-provider`
29+
30+
31+
## 7.14.1 Mar 27, 2022
32+
33+
Contributed:
34+
35+
- Add `ScProvider` for `@substrate/substrate-connect` (Thanks to https://github.com/josepot)
36+
- Add support for `BTree{Map, Set}` in typegen (Thanks to https://github.com/CertainLach)
37+
38+
Changes:
39+
40+
- Only explicitly support LSB on `BitVec` types
41+
- Change `toHuman()` on `BitVec` to output default LSB
42+
- Add `bytes{Sent, Recv}` to provider stats
43+
- Clear connection timout on provider `disconnect()`
44+
- Add support for `dev_getBlockStats` RPC
45+
46+
47+
## 7.13.1 Mar 19, 2022
48+
49+
**Important** This contains an upgraded version of `@polkadot/wasm-crypto`. For users of asm.js, e.g. React Native, there are some additional upgrade instructions in the release notes for this version https://github.com/polkadot-js/wasm/releases/tag/v5.0.1
50+
51+
Contributed:
52+
53+
- Expose custom RPC error details (Thanks to https://github.com/intendednull)
54+
- Improve custom RPC error typings (Thanks to https://github.com/MOZGIII)
55+
56+
Changes:
57+
58+
- Support for rejection of hanging RPC requests (30s timeout)
59+
- Add `.stats` to provider interfaces with running counters
60+
- Add support for `state_trieMigrationStatus` RPC
61+
- Update to latest Substrate, Kusama & Polkadot static metadata
62+
- Update to `@polkadot/util` 8.6.1
63+
- Additional workaround for Vite bundling
64+
65+
66+
## 7.12.1 Mar 13, 2022
67+
68+
Changes:
69+
70+
- Allow for correct handling of `Option<Null>` types
71+
- Adjust for bundlers where `import.meta.url` is undefined
72+
- Update to `@polkadot/util` 8.5.1
73+
74+
75+
## 7.11.1 Mar 6, 2022
76+
77+
Changes:
78+
79+
- Chunk derive retrieval of `era{Exposure, Prefs, Slashes}`
80+
- Ensure that signer (passed via options) do get updated
81+
- Kusama & Polkadot 9170 upgrade blocks
82+
- Update to latest Substrate, Kusama & Polkadot static metadata
83+
- Adjustments for TypeScript 7.6.2
84+
85+
86+
## 7.10.1 Feb 27, 2022
87+
88+
Contributed:
89+
90+
- Ensure `updateId` is correct in signer callbacks (Thanks to https://github.com/coolcorexix)
91+
92+
Changes:
93+
94+
- Ensure `BTreeSet` has the correct decoded length
95+
- Attach `PortableRegistry` at point of metadata set
96+
- Add `derive.chain.getBlockByNumber`
97+
- Retrieve named reserves in `derive.balances.all`
98+
- Ensure `v13 -> v14` metadata conversion attaches primitives
99+
- Update to latest Substrate, Kusama & Polkadot static metadata
100+
101+
102+
## 7.9.1 Feb 20, 2022
103+
104+
Contributed:
105+
106+
- Support historic queries via blockNumber (Thanks to https://github.com/stwiname)
107+
108+
Changes:
109+
110+
- Align `grandpa_proveFinality` with Substrate
111+
- Allow for derive augmentation (swap base type to interfaces)
112+
- Kusama 9160 upgrade block
113+
- Update to latest Substrate, Kusama & Polkadot static metadata
114+
115+
116+
## 7.8.1 Feb 14, 2022
117+
118+
Contributed:
119+
120+
- Add `isHistoric` flag to ETH RPCs (Thanks to https://github.com/stwiname)
121+
- Align contract instantiate types with Substrate (Thanks to https://github.com/kwingram25)
122+
123+
Changes:
124+
125+
- Adjust map header output type with lookup id
126+
- Re-enable all `BitVec` tests for `toU8a`
127+
- Expose `txIndex` as event index on extrinsic results
128+
- Allow inspection of Codec encoding (experimental)
129+
- Allow inspection of storage key encoding (experimental)
130+
- Update to latest Substrate, Kusama & Polkadot static metadata
131+
- Update `@polkadot/util` to 8.4.1
132+
133+
134+
## 7.7.1 Feb 6, 2022
135+
136+
Upgrade priority: Low. Recommended for users with long-running scripts.
137+
138+
Contributed:
139+
140+
- Fix rpc-provider LRU memory leak (Thanks to https://github.com/gdethier)
141+
142+
Changes:
143+
144+
- Don't warn on `Lookup*` types missing (these are resolvable)
145+
- Don't clear injected `PortableRegistry` types on runtime upgrade
146+
- Clear warning for `Call`/`Event` on non-meta v14 runtimes
147+
- Add `beefy_getFinalizedHead` RPC support
148+
- Update to latest Substrate, Kusama & Polkadot static metadata
149+
150+
151+
## 7.6.1 Jan 30, 2022
152+
153+
Upgdare priority: Low. Recommended for users with long-running scripts and those chains based around the latest Substrate master versions.
154+
155+
Contributed:
156+
157+
- Fix memory leak on `.raw` RPC calls (Thanks to https://github.com/r0t0r-r0t0r)
158+
159+
Changes:
160+
161+
- Adjust extraction of `Call` & `Event` types for metadata v14
7162
- Adjust historic `WinningData` and `SlotRange` types (36-entry variant)
8163
- Emit `decorated` event on API on metadata decoration
9164
- Dedupe and extend `WrapperKeepOpaque/WrapperOpaque`
10165
- Align `Range/RangeInclusive` usage with similar types
166+
- Adjust bounty derive, return empty on no `{treasury, bounties}.bounties`
167+
- Ensure handling of all `TypeDefInfo` keys in extraction
168+
- Add support for `rpc.contracts.uploadCode`
169+
- Workaround for generators where `#private = { this... }` yields undefined
170+
- Update to latest Substrate, Kusama & Polkadot static metadata
11171

12172

13173
## 7.5.1 Jan 23, 2022

CONTRIBUTORS

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
2785 Jaco Adjust SlotRange to 36 entries (with older 10-count version) (#4495)
1+
2888 Jaco Promise cache for metadata from version (improves parallel) (#4708)
22
83 Amaury Martiny StatementKind: Regular and Saft (#2303)
3-
36 Keith Ingram Storage deposit limit changes (#4370)
3+
37 Keith Ingram Update contract types and rpc (#4541)
44
35 Stefanie Doll Updated child storage parameters (#1709)
55
20 Luke Schoen fix: Fixes TypeError: Cannot read property 'vesting' of undefined (#1970)
6+
16 Xiliang Chen implement entriesPaged and keysPages for query at (#4701)
67
15 Jeremías Díaz feat(types): add correct tuple type to storage key (#3054)
7-
15 Xiliang Chen add Authority origin (#3645)
88
11 Ian He HttpProvider support clone() (#3949)
99
10 Axel Chalon Make Enum/Tuple constructor use value directly if instance (#1954)
1010
5 Chevdor Fix metadata package link (#3458)
@@ -13,6 +13,7 @@
1313
4 Alexander Popiak Add asset id in signing (#4009)
1414
4 Joshy Orndorff spelling; efect -> effect (#2295)
1515
4 Nantian fix bigint type (#3869)
16+
4 Scott Twiname Add support for historical BlockNumber rpc methods (#4574)
1617
4 Thibaut Sardan no subscription for http (#3127)
1718
3 Alex D Use derive customAccount and customLocks for balance overrides (#3248)
1819
3 André Silva add support for ValidationCodeHash (#3640)
@@ -29,9 +30,12 @@
2930
2 Alexander Krupenkin Add [u8; 33] type width for U8aFixed type (#2391)
3031
2 Branan Riley Add proxy type for Centrifuge (#3940)
3132
2 Caio Add `Range` and `RangeInclusive` types (#3791)
33+
2 HackFisher Update maxExtrinsic definition (#4703)
3234
2 Jakub Pánik All heads subscription (#1899)
3335
2 James Lefrère Add `.eq()` usage to docs and fix docs typos (#1405)
36+
2 Josep M Sobrepere fix: export substrate-connect `WellKnownChain` (#4700)
3437
2 Keith Yeung Allow keyPrefix to accept an additional argument for double maps (#2230)
38+
2 MOZGIII Follow-up fix after #4665 (#4666)
3539
2 Nikos Kontakis Add auction in shared types (#4085)
3640
2 Paweł Nguyen Fix a minor typo in cookbook blocks docs (#2294)
3741
2 sung wu Update tx.md (#2485)
@@ -42,6 +46,7 @@
4246
1 Brad Larson [NEW] Support for custom headers with providers (#2423)
4347
1 chriswmercer little readme tweak (#279)
4448
1 codingsh #2182 - add: search for docs (#2232)
49+
1 coolcorexix Investigate 4559 v2 (#4608)
4550
1 Dan Forbes Add WeightToFeeCoefficient type (#2296)
4651
1 Daniel Maricic Fixed typo in README (#2402)
4752
1 Daniel Savu fix: Generate custom type definitions (#4224)
@@ -52,6 +57,7 @@
5257
1 Dylan Galea Updated users of the polkadot-js/api (#2027)
5358
1 flex Change BeefySignedCommitment signatures type to EcdsaSignature (#4204)
5459
1 Furqan A fix: fixed 404 to the docs from the api readme (#3985)
60+
1 Gérard Dethier Fix LRUCache memory leak. (#4520)
5561
1 Gerben van de Wiel Adding some extra notes on changes in the specname (#2329)
5662
1 HackFisher fix OutboundLaneData types (#3992)
5763
1 Hoani Bryson Multiple Endpoint support for WsProvider (#2234)
@@ -75,10 +81,12 @@
7581
1 Nazar Mokrynskyi Performance tweaks (#4143)
7682
1 Nikhil Ranjan add vestingPerBlock and vestingEndBlock in DeriveBalancesAll when doing calcBalances (#2563)
7783
1 Nikolay Volf Fix typo (#1730)
84+
1 Noah Corona Add rpc error fields (#4637)
7885
1 Oleksandr Mykhailenko Add more complex namespaced contracts & test cases for them (#4472)
7986
1 Paul M Fox Basic BTreeMaps codec support (#1474)
8087
1 philipstanislaus Update types for centrifuge chain v1.2.0 (#2424)
8188
1 qiuhao update DeriveCustom type (#2581)
89+
1 r0t0r-r0t0r Fix memory leak on raw rpc call (#4505)
8290
1 Rocco Musolino remove broken link (#2671)
8391
1 satellitex Add BTreeSet<V> Codec (#1639)
8492
1 satellitex Add traits replace rules. for invalid cases `::<type>` and `<type>::`. (#885)
@@ -87,6 +95,7 @@
8795
1 Sergei Pepyakin INK! -> ink! (#1347)
8896
1 WoeOm adapt Darwinia, Crab Network types (#3498)
8997
1 Xat_MassacrE Fix packages/types/src/codec/utils/encodeTypes.ts encodeSubTypes bug (#1544)
98+
1 Yaroslav Bolyukin Support BTreeMap/BTreeSet in typegen (#4682)
9099
1 yjh fix MetadataVersioned.asV12 (#2983)
91100
1 Yuri fixes #3693 Fix uniques return types (#3694)
92101
1 Zeke Mostov fix: Allow sudo for polkadot indexed proxy enum (#3286)

README.md

-14
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,3 @@ If you are an existing user, please be sure to track the [CHANGELOG](CHANGELOG.m
1414
## tutorials
1515

1616
Looking for tutorials to get started? Look at [examples](https://polkadot.js.org/docs/api/examples/promise/) for guides on how to use the API to make queries and submit transactions.
17-
18-
## overview
19-
20-
The API is split up into a number of internal packages -
21-
22-
- [@polkadot/api](packages/api/) The API library, providing both Promise and RxJS Observable-based interfaces. This is the main user-facing entry point.
23-
- [@polkadot/api-derive](packages/api-derive/) Derived results that are injected into the API, allowing for combinations of various query results (only used internally and exposed on the Api instances via `api.derive.*`)
24-
- [@polkadot/metadata](packages/metadata/) Base extrinsic, storage and constant injectors for injection
25-
- [@polkadot/rpc-core](packages/rpc-core/) Wrapper around all [JSON-RPC methods](https://polkadot.js.org/docs/substrate/rpc) exposed by a Polkadot network client
26-
- [@polkadot/rpc-provider](packages/rpc-provider/) Providers for connecting to nodes, including WebSockets and Http
27-
28-
Type definitions for interfaces as exposed by Polkadot & Substrate clients -
29-
30-
- [@polkadot/types](packages/types/) Codecs for all Polkadot and Substrate primitives

jest.config.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@ module.exports = {
1515
// eslint-disable-next-line sort-keys
1616
'@polkadot/types(.*)$': '<rootDir>/packages/types/src/$1'
1717
},
18+
"transformIgnorePatterns": [
19+
'/node_modules/(?!@polkadot|@substrate/connect|@babel/runtime/helpers/esm/)'
20+
],
1821
testTimeout: 30000
1922
};

0 commit comments

Comments
 (0)