Interop¶
Interop¶
- class Interop(**kwargs)¶
Implements the interop api endpoints.
- status_burns(**kwargs) List[ConversionRequestModel] ¶
Gets the current interop status of burns.
- Parameters:
**kwargs – Extra keyword arguments.
- Returns:
A list of burn conversion requests.
- Return type:
List[ConversionRequestModel]
- Raises:
APIError – Error thrown by node API. See message for details.
- status_mints(**kwargs) List[ConversionRequestModel] ¶
Gets the current interop status of mints.
- Parameters:
**kwargs – Extra keyword arguments.
- Returns:
A list of mint conversion requests.
- Return type:
List[ConversionRequestModel]
- Raises:
APIError – Error thrown by node API. See message for details.
- status_votes(**kwargs) dict ¶
Gets the current interop status of votes.
- Parameters:
**kwargs – Extra keyword arguments.
- Returns:
A dictionary of votes with {request_id: [pubkeys_that_voted]}
- Return type:
dict
- Raises:
APIError – Error thrown by node API. See message for details.
- owners(destination_chain: int, **kwargs) List[str] ¶
Retrieves the list of current owners for the multisig wallet contract.
- Parameters:
destination_chain (int) – The destination chain.
**kwargs – Extra keyword arguments.
- Returns:
A list of owners of the multisig contract.
- Return type:
List[str]
- Raises:
APIError – Error thrown by node API. See message for details.
- add_owner(destination_chain: int, new_owner_address: str | Address, gas_price: int, **kwargs) uint256 ¶
Creates and broadcasts an addOwner contract call on the multisig wallet contract. This can only be done by one of the current owners of the contract, and needs to be confirmed by a sufficient number of the other owners.
- Parameters:
destination_chain (int) – The destination chain.
new_owner_address (str, Address) – The address to add to multisig ownership.
gas_price (int) – The gas price.
**kwargs – Extra keyword arguments.
- Returns:
The transactionId of the multisig wallet contract transaction, which is then used to confirm the transaction.
- Return type:
- Raises:
APIError – Error thrown by node API. See message for details.
- remove_owner(destination_chain: int, existing_owner_address: str | Address, gas_price: int, **kwargs) uint256 ¶
Creates and broadcasts a removeOwner contract call on the multisig wallet contract. This can only be done by one of the current owners of the contract, and needs to be confirmed by a sufficient number of the other owners.
- Parameters:
destination_chain (int) – The destination chain.
existing_owner_address (str, Address) – The address to add to multisig ownership.
gas_price (int) – The gas price.
**kwargs – Extra keyword arguments.
- Returns:
The transactionId of the multisig wallet contract transaction, which is then used to confirm the transaction.
- Return type:
- Raises:
APIError – Error thrown by node API. See message for details.
- confirm_transaction(destination_chain: int, transaction_id: int, gas_price: int, **kwargs) uint256 ¶
Explicitly confirms a given multisig wallet contract transactionId by submitting a contract call transaction to the network.
This can only be called once per multisig owner. Additional calls by the same owner account will simply fail and waste gas.
- Parameters:
destination_chain (int) – The destination chain.
transaction_id (int) – The multisig wallet transactionId (int, not transaction hash).
gas_price (int) – The gas price.
**kwargs – Extra keyword arguments.
- Returns:
The on-chain transaction hash of the contract call transaction.
- Return type:
- Raises:
APIError – Error thrown by node API. See message for details.
- change_requirement(destination_chain: int, requirement: int, gas_price: int, **kwargs) uint256 ¶
Creates and broadcasts a ‘changeRequirement()’ contract call on the multisig wallet contract. This can only be done by one of the current owners of the contract, and needs to be confirmed by a sufficient number of the other owners.
This should only be done once all owner modifications are complete to save gas and orchestrating confirmations.
- Parameters:
destination_chain (int) – The destination chain.
requirement (int) – The new threshold for confirmations on the multisig wallet contract. Can usually be numOwners / 2 rounded up.
gas_price (int) – The gas price.
**kwargs – Extra keyword arguments.
- Returns:
The multisig wallet transactionId of the changerequirement call.
- Return type:
- Raises:
APIError – Error thrown by node API. See message for details.
- multisig_transaction(destination_chain: int, transaction_id: int, raw: bool, **kwargs) hexstr | TransactionResponseModel ¶
Retrieves a multisig wallet transaction.
- Parameters:
destination_chain (int) – The destination chain.
transaction_id (int) – The multisig wallet transactionId (int, not transaction hash).
raw (bool) – Indicates whether to partially decode the transaction or leave it in raw hex format.
**kwargs – Extra keyword arguments.
- Returns:
The multisig wallet transaction data.
- Return type:
Union[hexstr, TransactionResponseModel]
- Raises:
APIError – Error thrown by node API. See message for details.
- multisig_confirmations(destination_chain: int, transaction_id: int, **kwargs) List[str] ¶
Returns the list of contract owners that confirmed a particular multisig transaction.
- Parameters:
destination_chain (int) – The destination chain.
transaction_id (int) – The multisig wallet transactionId (int, not transaction hash).
**kwargs – Extra keyword arguments.
- Returns:
A list of owner addresses that confirmed the transaction.
- Return type:
List[str]
- Raises:
APIError – Error thrown by node API. See message for details.
- balance(destination_chain: int, account: str, **kwargs) Money ¶
Retrieves the wSTRAX balance of a given account.
- Parameters:
destination_chain (int) – The chain the wSTRAX ERC20 contract is deployed to.
account (str) – The account to retrieve the balance for.
**kwargs – Extra keyword arguments.
- Returns:
The wSTRAX account balance.
- Return type:
- Raises:
APIError – Error thrown by node API. See message for details.
- requests_delete(**kwargs) Money ¶
Deletes conversion requests.
- Parameters:
**kwargs – Extra keyword arguments.
- Returns:
A message about the status of the request.
- Return type:
str
- Raises:
APIError – Error thrown by node API. See message for details.
- requests_setoriginator(request_id: int, **kwargs) str ¶
Endpoint that allows the multisig operator to set itself as the originator (submittor) for a given request id.
- Parameters:
request_id (int) – The requestId in question.
**kwargs – Extra keyword arguments.
- Returns:
A message about the status of the request.
- Return type:
str
- Raises:
APIError – Error thrown by node API. See message for details.
- requests_setnotoriginator(request_id: int, **kwargs) str ¶
Endpoint that allows the multisig operator to reset the request as NotOriginator.
- Parameters:
request_id (int) – The requestId in question.
**kwargs – Extra keyword arguments.
- Returns:
A message about the status of the request.
- Return type:
str
- Raises:
APIError – Error thrown by node API. See message for details.
- requests_reprocess_burn(request_id: int, height: int, **kwargs) str ¶
Endpoint that allows the multisig operator to reprocess a burn.
- Parameters:
request_id (int) – The requestId to reprocess burn.
height (int) – The height at which to reprocess the burn.
**kwargs – Extra keyword arguments.
- Returns:
A message about the status of the request.
- Return type:
str
- Raises:
APIError – Error thrown by node API. See message for details.
- requests_pushvote(request_id: int, vote_id: int, **kwargs) str ¶
Endpoint that allows the multisig operator to manually add a vote if they are originator of the request.
- Parameters:
request_id (int) – The request id.
vote_id (int) – The vote id.
**kwargs – Extra keyword arguments.
- Returns:
A message about the status of the request.
- Return type:
str
- Raises:
APIError – Error thrown by node API. See message for details.
ConversionRequestModel¶
- class ConversionRequestModel(*, requestId: uint256, requestType: ConversionRequestType, requestStatus: int, blockHeight: int, destinationAddress: Address, destinationChain: DestinationChain, amount: Money, processed: bool)¶
A pydantic model of a conversion request.
- request_type: ConversionRequestType¶
The conversion request type.
- request_status: int¶
The conversion request status.
- block_height: int¶
The block height of the transaction.
- destination_chain: DestinationChain¶
The destination chain.
- processed: bool¶
True if the conversion has been processed.
TransactionResponseModel¶
- class TransactionResponseModel(*, data: hexstr, destination: DestinationChain, value: Money, executed: bool)¶
A pydantic model of a multisig transaction response.
- destination: DestinationChain¶
The destination chain.
- executed: bool¶
True if the transaction has been processed.