Skip to content

Commit d9730b5

Browse files
milestone one
* feat(chains): add update chains script * feat(dashboard): enable State Management System * chore(papi): add prebuild instruction * chore(hooks): fix build erros on hooks * feat(eslint): add eslint ignore * chore(hooks): fix type erros * chore(eslint): remove eslint ignore * chore(hooks): fix build erro on useMultiEventSubscribre * chore(build): fix build problems and rewrite hooks * feat(milestone): * State Management System #5 *Polkadot API Integration #6 *Parachain Support Framework #7
1 parent bed3b60 commit d9730b5

63 files changed

Lines changed: 6754 additions & 32 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Update Blockchain Descriptors
2+
3+
on:
4+
schedule:
5+
# Run weekly on Monday at 00:00 UTC
6+
- cron: '0 0 * * 1'
7+
# Allow manual triggering
8+
workflow_dispatch:
9+
inputs:
10+
specific_chain:
11+
description: 'Specific chain to update (leave empty for all)'
12+
required: false
13+
default: ''
14+
15+
jobs:
16+
update-chains:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Bun
24+
uses: oven-sh/setup-bun@v1
25+
with:
26+
bun-version: latest
27+
28+
- name: Install dependencies
29+
run: bun install
30+
31+
- name: Setup metadata directory
32+
run: mkdir -p .papi/metadata
33+
34+
# Define the chains to update
35+
- name: Define chains list
36+
id: chains
37+
run: |
38+
if [ -n "${{ github.event.inputs.specific_chain }}" ]; then
39+
# Use the specific chain if provided in manual trigger
40+
echo "CHAINS=${{ github.event.inputs.specific_chain }}" >> $GITHUB_ENV
41+
else
42+
# Otherwise use the full list of chains
43+
echo "CHAINS=polkadot kusama westend2 rococo_v2_2 paseo polkadot_asset_hub kusama_asset_hub westend_asset_hub rococo_asset_hub polkadot_bridge_hub kusama_bridge_hub westend_bridge_hub rococo_bridge_hub polkadot_collectives pendulum amplitude hydradx basilisk mangata" >> $GITHUB_ENV
44+
fi
45+
46+
# Update all chains in the list
47+
- name: Update chains
48+
run: |
49+
# Process each chain
50+
for chain in $CHAINS; do
51+
# Convert chain name to descriptor key (kebab-case to camelCase, remove non-alphanumeric)
52+
descriptor_key=$(echo $chain | sed -r 's/-([a-z])/\U\1/g' | sed 's/[^a-zA-Z0-9]//g')
53+
54+
# Special case for relay chains to map them to common names
55+
case $chain in
56+
polkadot)
57+
descriptor_key="dot"
58+
;;
59+
kusama)
60+
descriptor_key="ksm"
61+
;;
62+
westend2)
63+
descriptor_key="wnd"
64+
;;
65+
rococo_v2_2)
66+
descriptor_key="roc"
67+
;;
68+
paseo)
69+
descriptor_key="paseo"
70+
;;
71+
esac
72+
73+
echo "Updating chain: $chain with descriptor key: $descriptor_key"
74+
75+
# Run papi add command
76+
npx papi add $descriptor_key -n $chain --skip-codegen
77+
78+
# Check for errors
79+
if [ $? -ne 0 ]; then
80+
echo "Error updating $chain"
81+
# Continue with other chains even if this one fails
82+
continue
83+
fi
84+
85+
echo "Successfully updated $chain"
86+
done
87+
88+
# Run codegen once at the end to include all chains
89+
echo "Running final codegen"
90+
npx papi
91+
92+
# Install the updated descriptors
93+
bun install
94+
95+
- name: Create Pull Request
96+
uses: peter-evans/create-pull-request@v6
97+
with:
98+
token: ${{ secrets.GITHUB_TOKEN }}
99+
commit-message: "chore: update blockchain descriptors"
100+
title: "Update Blockchain Descriptors"
101+
body: |
102+
# Blockchain Descriptors Update
103+
104+
This automated PR updates the blockchain descriptors for all supported chains in the Polkadot ecosystem.
105+
106+
## Updated Chains
107+
108+
```
109+
${{ env.CHAINS }}
110+
```
111+
112+
## What Changed
113+
114+
- Updated chain metadata
115+
- Updated descriptors with latest type definitions
116+
- Updated dependencies
117+
118+
> This is an automated PR created by the `update-chains` GitHub Action.
119+
branch: chore/update-blockchain-descriptors
120+
base: main
121+
labels: automation, dependencies
122+
delete-branch: true

.papi/descriptors/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!.gitignore
3+
!package.json

.papi/descriptors/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.1.0-autogenerated.11446670771092814724",
3+
"name": "@polkadot-api/descriptors",
4+
"files": [
5+
"dist"
6+
],
7+
"exports": {
8+
".": {
9+
"types": "./dist/index.d.ts",
10+
"module": "./dist/index.mjs",
11+
"import": "./dist/index.mjs",
12+
"require": "./dist/index.js"
13+
},
14+
"./package.json": "./package.json"
15+
},
16+
"main": "./dist/index.js",
17+
"module": "./dist/index.mjs",
18+
"browser": "./dist/index.mjs",
19+
"types": "./dist/index.d.ts",
20+
"sideEffects": false,
21+
"peerDependencies": {
22+
"polkadot-api": ">=1.9.11"
23+
}
24+
}

.papi/metadata/dot.scale

408 KB
Binary file not shown.

.papi/metadata/paseo.scale

415 KB
Binary file not shown.

.papi/metadata/passeo.scale

415 KB
Binary file not shown.
311 KB
Binary file not shown.
378 KB
Binary file not shown.
248 KB
Binary file not shown.

.papi/metadata/roc.scale

411 KB
Binary file not shown.

0 commit comments

Comments
 (0)