import { GatewayApiClient, ScryptoSborValue, StateEntityDetailsResponseItemDetails } from '@radixdlt/babylon-gateway-api-sdk'; import { EntityDetails, EntityField, RadixElement } from './types.js'; type RadixComponentDetails = Extract; /** * Fetches and validates Radix component details from the gateway. * * @param gateway - The Radix Gateway API client * @param entityAddress - The on-chain address of the component * @param componentName - Human-readable name for error messages (e.g., "mailbox", "ISM", "hook") * * @throws {Error} If the entity is not a Radix component */ export declare function getRadixComponentDetails(gateway: Readonly, entityAddress: string, componentName: string): Promise; /** * Fetches all keys from a Radix key-value store. * * @param gateway - The Radix Gateway API client * @param keyValueStoreAddress - The on-chain address of the key-value store * @returns Array of all keys in the key-value store */ export declare function getKeysFromKvStore(gateway: Readonly, keyValueStoreAddress: string): Promise; /** * Extracts ownership information from a Radix component's details. * * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityDetails - The component details containing role assignment information * @returns The ownership information including the access rule and proof requirements * * @throws {Error} If ownership information is not defined in the component details */ export declare function getComponentOwnershipInfo(entityAddress: string, entityDetails: RadixComponentDetails): EntityDetails['role_assignments']['owner']; /** * Extracts the owner address of a Radix component. * * Radix components use role-based access control where ownership is represented * by holding a specific resource. This function finds the holder of that resource. * * @param gateway - The Radix Gateway API client * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityDetails - The component details containing ownership information * @returns The address of the component owner * * @throws {Error} If ownership info is missing or if there are multiple resource holders */ export declare function getComponentOwner(gateway: Readonly, entityAddress: string, entityDetails: RadixComponentDetails): Promise; /** * Extracts the state object from Radix component details. * * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityDetails - The component details containing the state * @returns The component state containing * * @throws {Error} If the state is not defined in the component details */ export declare function getComponentState(entityAddress: string, entityDetails: RadixComponentDetails): EntityDetails['state']; export declare function getFieldPropertyFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state'], property: TKey, formatter?: (value: NonNullable) => T): T | NonNullable; /** * Tries to extracts a field value from a Radix component's entity state. * * Handles both regular fields and Radix Option enums. For Option enums, it automatically * extracts the value from the Some variant. * * @param fieldName - The name of the field to extract * @param entityState - The component state containing the fields * @returns The field value as a string or undefined if it was not found * * * @overload * @param fieldName - The name of the field to extract * @param entityState - The component state containing the fields * @param formatter - Function to transform the string value into a different type * @returns The formatted field value or undefined if it was not found */ export declare function tryGetFieldValueFromEntityState(fieldName: string, entityState: EntityDetails['state']): string | undefined; export declare function tryGetFieldValueFromEntityState(fieldName: string, entityState: EntityDetails['state'], formatter: (value: string) => T): T | undefined; /** * Extracts a field value from a Radix component's entity state. * * Handles both regular fields and Radix Option enums. For Option enums, it automatically * extracts the value from the Some variant. * * @param fieldName - The name of the field to extract * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @returns The field value as a string * * @throws {Error} If the field is not found in the state * * @overload * @param fieldName - The name of the field to extract * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @param formatter - Function to transform the string value into a different type * @returns The formatted field value */ export declare function getFieldValueFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state']): string; export declare function getFieldValueFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state'], formatter: (value: string) => T): T; /** * Tries to extract a hex field value from a Radix component's entity state. * * Similar to tryGetFieldValueFromEntityState but extracts the hex representation * instead of the regular value. Handles both regular fields and Radix Option enums. * * @param fieldName - The name of the field to extract * @param entityState - The component state containing the fields * @returns The field hex value as a string or undefined if it was not found * * @overload * @param fieldName - The name of the field to extract * @param entityState - The component state containing the fields * @param formatter - Function to transform the hex string value into a different type * @returns The formatted field hex value or undefined if it was not found */ export declare function tryGetFieldHexValueFromEntityState(fieldName: string, entityState: EntityDetails['state']): string | undefined; export declare function tryGetFieldHexValueFromEntityState(fieldName: string, entityState: EntityDetails['state'], formatter: (value: string) => T): T | undefined; /** * Extracts a hex field value from a Radix component's entity state. * * Similar to getFieldValueFromEntityState but extracts the hex representation * instead of the regular value. Handles both regular fields and Radix Option enums. * * @param fieldName - The name of the field to extract * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @returns The field hex value as a string * * @throws {Error} If the field is not found in the state * * @overload * @param fieldName - The name of the field to extract * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @param formatter - Function to transform the hex string value into a different type * @returns The formatted field hex value */ export declare function getFieldHexValueFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state']): string; export declare function getFieldHexValueFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state'], formatter: (value: string) => T): T; /** * Extracts an optional field value from a Radix component's entity state. * * Similar to getFieldValueFromEntityState, but returns undefined instead of throwing * if the field is not found or if it's an Option::None variant. * * @param fieldName - The name of the field to extract * @param entityState - The component state containing the fields * @returns The field value as a string, or undefined if not found/None */ export declare function getOptionalFieldValueFromEntityState(fieldName: string, entityState: EntityDetails['state']): string | undefined; export declare function getOptionalFieldValueFromEntityState(fieldName: string, entityState: EntityDetails['state'], formatter: (value: string) => T): T | undefined; /** * Extracts field elements (array values) from a Radix component's entity state. * * Used for fields that contain arrays of elements, such as validator lists or * multi-value configurations. * * @param fieldName - The name of the field to extract * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @returns Array of RadixElement objects * * @throws {Error} If the field is not found in the state * * @overload * @param fieldName - The name of the field to extract * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @param formatter - Function to transform the RadixElement array into a different type * @returns The formatted element array */ export declare function getFieldElementsFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state']): RadixElement[]; export declare function getFieldElementsFromEntityState(fieldName: string, entityAddress: string, entityState: EntityDetails['state'], formatter: (value: RadixElement[]) => T[]): T[]; /** * Extracts the resource address from a Radix component's entity state. * * Searches the component state fields for a ResourceAddress type and returns its value. * Used for identifying token resources associated with warp route components. * * @param entityAddress - The on-chain address of the component (used for error messages) * @param entityState - The component state containing the fields * @returns The resource address as a string * * @throws {Error} If no ResourceAddress field is found in the component state */ export declare function getResourceAddress(entityAddress: string, entityState: EntityDetails['state']): string; export {}; //# sourceMappingURL=base-query.d.ts.map