-
Notifications
You must be signed in to change notification settings - Fork 374
Open
Labels
SupportTracks issues or requests related to troubleshooting, answering questions, and user assistance.Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Description
I was able to augment my API following the docs here and using the new input from this PR polkadot-js/docs#445.
However, I'm struggeling how to get it to work if I want to work with multiple chains in a single project. So I want to have apiChainA
and apiChainB
properly typed augmented. If I generate both into different folders and import them I get a mixture of both maybe even breaking the api?
- Bug report
- Feature request
- Support request
- Other
- What is the current behavior and expected behavior?
Using polkadot-types-from-defs
& polkadot-types-from-chain
to generate type augmentations with metadata for ChainA
and ChainB
.
ChainA only has a Balances
Pallet, ChainB
only has a Identity
pallet.
import "./interfaces/chainA/augment-api.ts"
import "./interfaces/chainA/augment-types.ts"
import "./interfaces/chainB/augment-api.ts"
import "./interfaces/chainB/augment-types.ts"
const apiChainA = new ApiPromise({provider:new WsProvider("wss://chainA")})
const apiChainB = new ApiPromise({provider:new WsProvider("wss://chainB")})
// apiChainA and apiChainB both would have `api.tx.balances` and `api.tx.identity`
- Please tell us about your environment:
-
Version: 10.11.2
- Node.js
- Browser
- Other (limited support for other environments)
-
Language:
- JavaScript
- TypeScript (include tsc --version)
- Other
ekenigs
Metadata
Metadata
Assignees
Labels
SupportTracks issues or requests related to troubleshooting, answering questions, and user assistance.Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Type
Projects
Status
Support