DynamicContract

DynamicContract

class DynamicContract(**kwargs)

Implements the connectionmanager api endpoints.

property(address: Address, property: str, wallet_name: str, wallet_password: str, sender: Address, gas_price: int = 100, gas_limit: int = 250000, amount: Money | int | float | Decimal = Money(0E-8), fee_amount: Money | int | float | Decimal = Money(0.01000000), **kwargs) LocalExecutionResultModel

Query the value of a property on the contract using a local call.

Parameters:
  • address (Address) – The smart contract address.

  • property (str) – The property to query.

  • wallet_name (str) – The wallet name.

  • wallet_password (str) – The wallet password.

  • sender (Address) – The sending address.

  • gas_price (int, optional) – The gas price. Default=100

  • gas_limit (int, optional) – The gas limit. Default=250000

  • amount (Money, int, float, Decimal, optional) – Amount to send. Default=Money(0)

  • fee_amount (Money, int, float, Decimal, optional) – Fee amount. Default=Money(0.01)

  • **kwargs – Extra keyword arguments.

Returns:

The results of a local contract execution.

Return type:

LocalExecutionResultModel

Raises:

APIError – Error thrown by node API. See message for details.

method(address: Address, method: str, data: dict, wallet_name: str, wallet_password: str, sender: Address, gas_price: int = 100, gas_limit: int = 250000, amount: Money | int | float | Decimal = Money(0E-8), fee_amount: Money | int | float | Decimal = Money(0.01000000), **kwargs) BuildContractTransactionModel

Call a method on the contract by broadcasting a call transaction to the network.

Parameters:
  • address (Address) – The smart contract address.

  • method (str) – The method to call.

  • data (dict) – The data for the request body.

  • wallet_name (str) – The wallet name.

  • wallet_password (str) – The wallet password.

  • sender (Address) – The sending address.

  • gas_price (int, optional) – The gas price. Default=100

  • gas_limit (int, optional) – The gas limit. Default=250000

  • amount (Money, int, float, Decimal, optional) – Amount to send. Default=Money(0)

  • fee_amount (Money, int, float, Decimal, optional) – Fee amount. Default=Money(0.01)

  • **kwargs – Extra keyword arguments.

Returns:

A built smart contract transaction.

Return type:

BuildContractTransactionModel

Raises:

APIError – Error thrown by node API. See message for details.