The hexadecimal address of the raindex contract
Complete raindex configuration
Retrieves all tokens from the YAML configuration, including remote tokens.
This async function fetches all tokens defined in the YAML configuration.
If using-tokens-from URLs are configured, it will fetch and merge remote
tokens from those URLs before returning the complete token list.
const result = await raindexYaml.getTokens();
if (result.error) {
console.error("Error:", result.error.readableMsg);
return;
}
const tokens = result.value;
// Each token has: key, address, decimals, name, symbol, chainId
tokens.forEach(token => {
console.log(`${token.symbol} on chain ${token.chainId}`);
});
Array of token information
StaticgetCurrent spec version
StaticnewCreates a new RaindexYaml instance from YAML configuration sources.
This constructor parses one or more YAML configuration strings to create an RaindexYaml instance that provides access to raindex configurations, network settings, tokens, and other deployment metadata. The YAML sources are merged and validated according to the raindex specification.
// Basic usage with single YAML source
const yamlConfig = `
version: "6"
networks:
mainnet:
rpc: https://mainnet.infura.io
chain-id: 1
raindexes:
my-raindex:
address: 0x1234567890abcdef1234567890abcdef12345678
network: mainnet
...
`;
const result = RaindexYaml.new([yamlConfig], false);
if (result.error) {
console.error("Configuration error:", result.error.readableMsg);
return;
}
const raindexYaml = result.value;
// Do something with the raindexYaml
Vector of YAML configuration strings to parse and merge
Optionalvalidate: null | booleanOptional boolean to enable strict validation (defaults to false)
Successfully parsed and configured instance
Retrieves raindex configuration by its contract address from a parsed YAML configuration.
This function looks up a specific raindex configuration within a YAML configuration file using the raindex's blockchain address. It's essential for accessing raindex metadata including network configuration, subgraph endpoints, and other deployment details.
Examples