Skip to content

Commit

Permalink
feat: allow for registry override (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
bee344 authored Feb 16, 2024
1 parent 81ac35a commit 856a638
Show file tree
Hide file tree
Showing 26 changed files with 454 additions and 169 deletions.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type AssetTransferApiOpts = {
/**
* The injectedRegistry allows you to add custom values to the predefined initialized registry.
* If you would like to see the registry you may visit https://github.com/paritytech/asset-transfer-api-registry/blob/main/registry.json
* When adding a new chain, the `specName` and `tokens` fields are mandatory.
*
* An example input of the registry would be:
* {
Expand All @@ -133,9 +134,31 @@ type AssetTransferApiOpts = {
* }
* }
*
* NOTE: It supports adding info for `polkadot`, `kusama`, and `westend`.
* NOTE: It supports adding info for `polkadot`, `kusama`, `westend` and `rococo`.
*/
injectedRegistry?: RequireAtLeastOne<ChainInfoRegistry>;
/**
* The overrideRegistry option allows you to modify chain data already present in the registry,
* either overriding fields' values or adding new information. If the chain of which data is
* being overriden is not present in the registry, it will be treated as if it were
* and injectedRegistry and added following the same logic.
*
* If the chain is present in the registry, it will override only the fields
* present in the passed overrideRegistry, leaving the remaining as is.
*
* An example input for overrideRegistry would be:
* {
* westend: {
* '0': {
* tokens: ['WER'],
* }
* }
* }
*
* This would override the existing native token for the Westend Relay Chain
* to WER instead of WND.
*/
overrideRegistry?: RequireAtLeastOne<ChainInfoRegistry<InjectedChainInfoKeys>>;
/**
* RegistryTypes is a string and can either be 'CDN' or 'NPM'.
*
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/assets/search.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 856a638

Please sign in to comment.