Skip to content

Commit 647a0dc

Browse files
fix: added default initializer for TransactionOptions;
1 parent dfa34e7 commit 647a0dc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Sources/web3swift/Web3/Web3+Options.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,32 @@ public struct TransactionOptions {
8888

8989
public var accessList: [AccessListEntry]?
9090

91+
public init(type: TransactionType? = nil,
92+
to: EthereumAddress? = nil,
93+
from: EthereumAddress? = nil,
94+
chainID: BigUInt? = nil,
95+
gasLimit: TransactionOptions.GasLimitPolicy? = nil,
96+
gasPrice: TransactionOptions.GasPricePolicy? = nil,
97+
maxFeePerGas: TransactionOptions.FeePerGasPolicy? = nil,
98+
maxPriorityFeePerGas: TransactionOptions.FeePerGasPolicy? = nil,
99+
value: BigUInt? = nil,
100+
nonce: TransactionOptions.NoncePolicy? = nil,
101+
callOnBlock: TransactionOptions.CallingBlockPolicy? = nil,
102+
accessList: [AccessListEntry]? = nil) {
103+
self.type = type
104+
self.to = to
105+
self.from = from
106+
self.chainID = chainID
107+
self.gasLimit = gasLimit
108+
self.gasPrice = gasPrice
109+
self.maxFeePerGas = maxFeePerGas
110+
self.maxPriorityFeePerGas = maxPriorityFeePerGas
111+
self.value = value
112+
self.nonce = nonce
113+
self.callOnBlock = callOnBlock
114+
self.accessList = accessList
115+
}
116+
91117
public static var defaultOptions: TransactionOptions {
92118
var opts = TransactionOptions()
93119
opts.type = .legacy

0 commit comments

Comments
 (0)