-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Static configs | ||
|
||
## Introduction | ||
|
||
All of the static constants that are relevant for the chain have been aggregated into a single file. | ||
|
||
This includes, but is not limited to: | ||
* Chain info and its relevant configs | ||
* All supported assets on each chain | ||
|
||
The configuration documents are versioned so you will know if the object changes. | ||
|
||
You can access the configs in one of two ways: | ||
|
||
## Point the json files directly | ||
|
||
* Testnet: https://axelar-testnet.s3.us-east-2.amazonaws.com/configs/testnet-config-1.x.json | ||
* Mainnet: https://axelar-mainnet.s3.us-east-2.amazonaws.com/configs/mainnet-config-1.x.json | ||
|
||
|
||
## Typescript API | ||
|
||
Alternatively, you can use the hooks, i.e. | ||
|
||
The package can be installed into your dApp as a project dependency with: | ||
```bash | ||
npm i @@axelarjs/api | ||
``` | ||
|
||
Then run | ||
```typescript | ||
|
||
import { createAxelarConfigClient } from "@axelarjs/api"; | ||
import { ENVIRONMENTS } from "@axelarjs/core"; | ||
|
||
const test = async () => { | ||
const api = createAxelarConfigClient(ENVIRONMENTS.testnet); | ||
const configs = await api.getAxelarConfigs(ENVIRONMENTS.testnet); | ||
Object.entries(configs.chains).forEach((v) => | ||
console.log(`config for chain ${v[0]}: ${v[1]}`) | ||
); | ||
}; | ||
test(); | ||
``` | ||
|
||
Each of the relevant properties in the schema are typed out in the following Typescript interfaces: https://github.com/axelarnetwork/axelarjs/blob/main/packages/api/src/axelar-config/types.ts |