Represents an instance of AssetLabelingClient used to read data from the Asset Labeling contract. Provides functionality to manage and retrieve asset labeling data.
OptionalwriteAn optional variable representing an account that can authorize and sign transactions.
The writeAccount variable is either an instance of TransactionSignerAccount or is undefined.
It is used to execute and authenticate transaction operations.
Represents an instance of AssetLabelingClient or undefined.
The variable is used to write data to the Asset Labeling contract. Ensure to properly check for undefined before attempting to invoke any methods or properties associated with the AssetLabelingClient.
Retrieves the application ID associated with the current client instance.
Adds a label to the specified entity with the given details.
The unique identifier for the label.
The name of the label.
The URL associated with the label.
Returns a promise that resolves to the result of the operation, potentially wrapped with error handling.
Adds a label to a specified asset by associating the label ID with the asset ID.
The unique identifier of the asset to which the label will be added.
The unique identifier of the label to be associated with the asset.
A promise that resolves to the client response indicating the result of the operation.
Adds a specified label to a set of asset IDs.
This function permits assigning a label to assets in batches to optimize performance. If the list of asset IDs exceeds the maximum limit for a single method invocation, the function segments the asset IDs into chunks and processes them asynchronously with controlled concurrency.
An array of asset IDs to be labeled.
The identifier of the label to be added to the assets.
A promise that resolves to the response(s) from the operation. If the operation involves chunked requests, the responses are returned as an array.
Add a label to an operator. This allows the operator address to add/remove operators to the label, as well as label assets with this label.
Operator address
Label to add to operator
Updates the label with the specified ID, changing its name and URL.
The unique identifier of the label to be changed.
The new name to assign to the label.
The new URL to associate with the label.
A promise that resolves with the response from the client after attempting to update the label.
Return all asset IDs available on the contract
Asset IDs
Return all label IDs available on the contract
Label IDs
Return all operator addresses on the contract
Operator addresses
Fetches the labels associated with a specific asset.
The unique identifier of the asset for which labels need to be retrieved.
A promise that resolves to an array of asset labels.
Retrieves detailed information for a list of asset IDs as a map of asset ID to asset details.
If the number of asset IDs exceeds the maximum allowed per method call, the request is automatically divided into smaller batches to handle the data in chunks.
An array of asset IDs for which the detailed information is requested.
A promise resolving to a map where each key is an asset ID and the value is the corresponding detailed asset information.
Retrieves asset labels for a given list of asset IDs asynchronously.
This method performs a simulation of fetching labels for the specified assets by calling
the logAssetsLabels function through the readClient instance. If the input list of
asset IDs exceeds the predefined maximum (METHOD_MAX), it automatically splits the call
into batches for processing.
An array of asset IDs for which labels are to be fetched.
A promise that resolves to a map where each asset ID corresponds to its associated array of labels.
Retrieves a map of asset micro details for the provided asset IDs.
This function handles querying for the details of multiple assets using their respective IDs. It ensures batched processing if the number of asset IDs exceeds the maximum method capacity.
An array of asset IDs for which the micro details are requested.
A promise that resolves to a map where each key is the asset ID, and the value is the corresponding AssetMicro data.
Fetches the micro labels for a given list of asset IDs.
This method retrieves metadata for the specified assets by making
a request to the underlying data source. It supports batching
for optimizing requests, ensuring that if the asset list exceeds
a predefined maximum limit (METHOD_MAX), it splits the calls
into batches for processing.
An array of asset IDs for which micro labels are to be fetched.
A promise resolving to a Map where each key is an asset ID and the value is its corresponding micro label information.
Retrieves a map of small asset details for the given list of asset IDs.
If the number of asset IDs exceeds the maximum allowable batch size (METHOD_MAX), the method splits
the request into batches by recursively calling itself with the appropriate subdivisions of the assetIds array.
The method interacts with a read client to simulate a data retrieval process and parses the resulting logs to map each asset ID to its corresponding asset data.
An array of asset IDs for which the small asset details should be retrieved.
A promise resolving to a map where the keys are asset IDs (bigint)
and the values are AssetSmall objects containing the corresponding small asset details.
Retrieves asset text details for a given list of asset IDs.
This function fetches the text descriptors for the specified asset IDs asynchronously.
If the number of asset IDs exceeds the defined method limit (METHOD_MAX),
the function breaks the request into smaller batches and calls itself recursively.
An array of bigint values representing the asset IDs.
A promise that resolves to a Map,
where each key is an asset ID and the value is an AssetText object containing
the text descriptor for the respective asset.
Fetches text labels for a given list of asset IDs.
The function retrieves the text labels associated with the provided asset IDs by calling the backend services and simulating the results. If the number of asset IDs exceeds the maximum allowed limit (METHOD_MAX), the function divides the request into smaller batch calls.
An array of asset IDs for which text labels are to be fetched.
A promise that resolves to a map where the keys are the asset IDs and the values are their associated text label objects.
Retrieves a mapping of asset IDs to their corresponding "AssetTiny" details. This asynchronous function fetches details for the provided asset IDs in an optimized manner, using batching if the number of asset IDs exceeds the allowed limit.
An array of asset identifiers for which the details are requested.
A promise that resolves to a Map where each asset ID is mapped to its corresponding "AssetTiny" details.
Fetches tiny label details for the given list of asset IDs.
This method queries asset data in batches if the number of asset IDs exceeds a pre-defined limit. It uses simulated calls to the read client for retrieving asset label information and parses the logs to extract the results. The returned data is mapped to each asset ID.
Array of asset IDs for which tiny labels are to be retrieved.
A promise that resolves to a map, where each key is an asset ID (bigint) and the value is an object containing the tiny label details for the asset.
Get a label descriptor for a label by its ID.
The label to look up by label ID
A label descriptor
Get multiple label descriptors for labels, by their IDs.
The label IDs to look up
Result wap with label IDs as keys and LabelDescriptors as values.
Get all labels for an operator
The operator address to query
Labels that this account can operate on
Return whether an asset has a specific label
Asset to look up, by asset ID
label to query for, by label ID
True if an asset exists and has a label
Returns whether a specific label ID exists or not
label ID
Whether the label exists or not
Returns whether or not an operator has access to a label
The operator address to query
The label ID to look up
parse typed arc4 structs from logs
tupleParser is like generated clients' xyzArcStructFromTuple abiDecodingMethod is a method name that returns the same avi return type as we are logging e.g. if we are parsing log_label_descriptors() logs that logs LabelDescriptor, abiDecodingMethod can be get_label_descriptor that has ABI return LabelDescriptor
Removes a label specified by the labelId.
The unique identifier of the label to be removed.
A promise that resolves with the result of the removal operation or rejects with an error if the operation fails.
Removes a label from a specified asset.
The unique identifier of the asset from which the label should be removed.
The unique identifier of the label to be removed from the asset.
A promise that resolves to a ClientResponse indicating the result of the label removal operation.
Removes an operator from a specified label.
The address of the operator to be removed.
The ID of the label from which the operator is to be removed.
A promise that resolves to the client response indicating the result of the operation.
The
AbelSDKclass is an SDK for interacting with an asset labeling system, allowing querying, management, and association of labels, assets, and operators within a given application. The class supports read and write operations and relies on Algorand blockchain infrastructure.Example