The hexadecimal address of the orderbook contract
Complete orderbook configuration
StaticnewCreates a new OrderbookYaml instance from YAML configuration sources.
This constructor parses one or more YAML configuration strings to create an OrderbookYaml instance that provides access to orderbook configurations, network settings, tokens, and other deployment metadata. The YAML sources are merged and validated according to the orderbook specification.
// Basic usage with single YAML source
const yamlConfig = `
version: "4"
networks:
mainnet:
rpc: https://mainnet.infura.io
chain-id: 1
orderbooks:
my-orderbook:
address: 0x1234567890abcdef1234567890abcdef12345678
network: mainnet
...
`;
const result = OrderbookYaml.new([yamlConfig], false);
if (result.error) {
console.error("Configuration error:", result.error.readableMsg);
return;
}
const orderbookYaml = result.value;
// Do something with the orderbookYaml
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 orderbook configuration by its contract address from a parsed YAML configuration.
This function looks up a specific orderbook configuration within a YAML configuration file using the orderbook's blockchain address. It's essential for accessing orderbook metadata including network configuration, subgraph endpoints, and other deployment details.
Examples