darwinia-network / darwinia.js-1.0-deprecated

Javascript API and Types
Apache License 2.0
5 stars 4 forks source link

support coexist chains apis at one project #79

Open cinlk opened 2 years ago

cinlk commented 2 years ago

sdk only config one chain apis at runtime by tsconfig path mapping. for example using pangolin chain apis and types

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@polkadot/api-augment": ["./node_modules/@darwinia/api-augment/pangolin/index.d.ts"],
      "@polkadot/types-augment": ["./node_modules/@darwinia/types/interfaces/augment-types.d.ts"],
      "@polkadot/rpc-augment": ["./node_modules/@darwinia/rpc-augment/pangolin/index.d.ts"],
      "@poladot/types/lookup": ["./node_modules/@darwinia/types-augment/lookup/pangolin/index.d.ts"]
    }
  }
}
cinlk commented 2 years ago

refer to https://github.com/polkadot-js/api/issues/4969