refactor: use resource api and update api path#245
Conversation
|
|
|
|
|
|
There was a problem hiding this comment.
Pull request overview
Refactors Subscan integration to use the newer resource-based count API and updated Subscan base URLs, while adding optional API key support (stored locally) to unlock/enable advanced Subscan-backed features.
Changes:
- Switch multisig confirmed/cancelled counters to a single “resource count” fetch path (with Subquery fallback).
- Add an API key configuration modal and persist the key in local storage; attach it as
X-API-Keyon Subscan requests. - Update multiple chain configs from
*.webapi.subscan.ioto*.api.subscan.ioand debounce tab-driven fetching.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/providers/multisig-provider.tsx | Uses the new multisig resource-count hook to populate confirmed/cancelled totals. |
| src/model/storage.ts | Extends persisted storage shape with optional subscanApiKey. |
| src/hooks/subscan.ts | Adds useResourceCount Subscan hook hitting /api/scan/resource_count. |
| src/hooks/combineQuery.ts | Adds useMultisigResourceCount to unify Subscan single-call vs Subquery fallback behavior. |
| src/hooks/AxiosRequest.ts | Adds X-API-Key header injection from local storage for Subscan requests. |
| src/config/chains/people_polkadot.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/people_paseo.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/people_kusama.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/pendulum.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/hydration.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/coretime_polkadot.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/coretime_paseo.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/coretime_kusama.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/bifrost.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/astar.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/assethub_polkadot.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/assethub_paseo.json | Updates Subscan base URL to *.api.subscan.io. |
| src/config/chains/assethub_kusama.json | Updates Subscan base URL to *.api.subscan.io. |
| src/components/modals/ApiKeyModal.tsx | New modal UI to validate/save/delete a locally-stored Subscan API key. |
| src/components/ExtrinsicRecords.tsx | Debounces tab switching to reduce rapid refetch churn. |
| src/App.tsx | Adds an “Advanced settings” entry point and mounts the API key modal. |
| public/locales/zh/translation.json | Adds zh translations for API key modal UI. |
| public/locales/en/translation.json | Adds en translations for API key modal UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
preview environment is ready at https://245-dceeebd.multisig-preview.subscan.io |
|
preview environment is ready at https://245-6cc221c.multisig-preview.subscan.io |
https://github.com/subscan-explorer/subscan/issues/5180
测试网络:assethub paseo