diff --git a/Web3Swift/GasEstimate/EthGasEstimate.swift b/Web3Swift/GasEstimate/EthGasEstimate.swift index cf825ec..dac4443 100644 --- a/Web3Swift/GasEstimate/EthGasEstimate.swift +++ b/Web3Swift/GasEstimate/EthGasEstimate.swift @@ -240,6 +240,87 @@ public final class EthGasEstimate: BytesScalar { ) } + /** + Ctor + + - parameters: + - network: network to call + - senderAddress: bytes representation of a sender address + - recipientAddress: bytes representation of a recipient address + - gasEstimate: estimate of the gas to be spent + - gasPrice: price that will be paid for each unit of gas + - contractCall: encoded contract call + */ + public convenience init( + network: Network, + senderAddress: BytesScalar, + recipientAddress: BytesScalar, + gasEstimate: BytesScalar, + gasPrice: BytesScalar, + contractCall: BytesScalar + ) { + self.init( + estimationProcedure: EstimateGasProcedure( + network: network, + parameters: [ + "from" : BytesParameter( + bytes: senderAddress + ), + "to" : BytesParameter( + bytes: recipientAddress + ), + "gas" : QuantityParameter( + number: gasEstimate + ), + "gasPrice" : QuantityParameter( + number: gasPrice + ), + "data" : BytesParameter( + bytes: contractCall + ) + ] + ) + ) + } + + /** + Ctor + + - parameters: + - network: network to call + - senderAddress: bytes representation of a sender address + - recipientAddress: bytes representation of a recipient address + - gasPrice: price that will be paid for each unit of gas + - contractCall: encoded contract call + */ + public convenience init( + network: Network, + senderAddress: BytesScalar, + recipientAddress: BytesScalar, + gasPrice: BytesScalar, + contractCall: BytesScalar + ) { + self.init( + estimationProcedure: EstimateGasProcedure( + network: network, + parameters: [ + "from" : BytesParameter( + bytes: senderAddress + ), + "to" : BytesParameter( + bytes: recipientAddress + ), + "gasPrice" : QuantityParameter( + number: gasPrice + ), + "data" : BytesParameter( + bytes: contractCall + ) + ] + ) + ) + } + /** - returns: Hexadecimal representation of an estimate value