escrow_utils
Utility class for escrow-related operations.
Code Example
Module
class human_protocol_sdk.escrow.escrow_utils.EscrowData(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest_url=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None)
Bases: object
__init__(chain_id, id, address, amount_paid, balance, count, factory_address, launcher, status, token, total_funded_amount, created_at, final_results_url=None, intermediate_results_url=None, manifest_hash=None, manifest_url=None, recording_oracle=None, reputation_oracle=None, exchange_oracle=None)
Initializes an EscrowData instance.
Parameters:
chain_id (
ChainId
) β Chain identifierid (
str
) β Identifieraddress (
str
) β Addressamount_paid (
int
) β Amount paidbalance (
int
) β Balancecount (
int
) β Countfactory_address (
str
) β Factory addresslauncher (
str
) β Launcherstatus (
str
) β Statustoken (
str
) β Tokentotal_funded_amount (
int
) β Total funded amountcreated_at (
datetime
) β Creation datefinal_results_url (
Optional
[str
]) β URL for final results.intermediate_results_url (
Optional
[str
]) β URL for intermediate results.manifest_hash (
Optional
[str
]) β Manifest hash.manifest_url (
Optional
[str
]) β Manifest URL.recording_oracle (
Optional
[str
]) β Recording Oracle address.reputation_oracle (
Optional
[str
]) β Reputation Oracle address.exchange_oracle (
Optional
[str
]) β Exchange Oracle address.
class human_protocol_sdk.escrow.escrow_utils.EscrowUtils
Bases: object
A utility class that provides additional escrow-related functionalities.
static get_escrow(chain_id, escrow_address)
Returns the escrow for a given address.
Parameters:
chain_id (
ChainId
) β Network in which the escrow has been deployedescrow_address (
str
) β Address of the escrow
Return type:
Optional
[EscrowData
]Returns: Escrow data
Example:
static get_escrows(filter)
Get an array of escrow addresses based on the specified filter parameters.
Parameters: filter (
EscrowFilter
) β Object containing all the necessary parameters to filterReturn type:
List
[EscrowData
]Returns: List of escrows
Example:
static get_status_events(chain_id, statuses=None, date_from=None, date_to=None, launcher=None, first=10, skip=0, order_direction=OrderDirection.DESC)
Retrieve status events for specified networks and statuses within a date range.
Parameters:
chain_id (
ChainId
) β Network to request data.(Optional[List[Status]]) (statuses) β List of statuses to filter by.
(Optional[datetime]****) (date_to) β Start date for the query range.
(Optional[datetime]****) β End date for the query range.
(Optional[str]****) (launcher) β Address of the launcher to filter by.
(int) (skip) β Number of items per page.
(int) β Page number to retrieve.
(OrderDirection) (order_direction) β Order of results, βascβ or βdescβ.
Return List[StatusEvent]: List of status events matching the query parameters.
Raises: EscrowClientError β If an unsupported chain ID or invalid launcher address is provided.
Example:
Return type:
List
[StatusEvent
]
class human_protocol_sdk.escrow.escrow_utils.StatusEvent(timestamp, status, chain_id, escrow_address)
Bases: object
Initializes a StatusEvent instance.
Parameters:
timestamp (
int
) β The timestamp of the event.status (
str
) β The status of the escrow.chain_id (
ChainId
) β The chain identifier where the event occurred.escrow_address (
str
) β The address of the escrow.
__init__(timestamp, status, chain_id, escrow_address)
Last updated