@@ -105,9 +105,9 @@ public extension ENS {
105
105
106
106
// FIXME: Rewrite this to CodableTransaction
107
107
@available ( * , message: " Available for only owner " )
108
- public func setAddress( forNode node: String , address: EthereumAddress , options : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
109
- var options = options ?? defaultTransaction
110
- options . to = self . resolverContractAddress
108
+ public func setAddress( forNode node: String , address: EthereumAddress , transaction : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
109
+ var transaction = transaction ?? defaultTransaction
110
+ transaction . to = self . resolverContractAddress
111
111
guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
112
112
guard let transaction = self . resolverContract. createWriteOperation ( " setAddr " , parameters: [ nameHash, address] ) else { throw Web3Error . transactionSerializationError }
113
113
guard let result = try ? await transaction. writeToChain ( password: password) else { throw Web3Error . processingError ( desc: " Can't send transaction " ) }
@@ -124,9 +124,9 @@ public extension ENS {
124
124
125
125
// FIXME: Rewrite this to CodableTransaction
126
126
@available ( * , message: " Available for only owner " )
127
- func setCanonicalName( forNode node: String , name: String , options : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
128
- var options = options ?? defaultTransaction
129
- options . to = self . resolverContractAddress
127
+ func setCanonicalName( forNode node: String , name: String , transaction : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
128
+ var transaction = transaction ?? defaultTransaction
129
+ transaction . to = self . resolverContractAddress
130
130
guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
131
131
guard let transaction = self . resolverContract. createWriteOperation ( " setName " , parameters: [ nameHash, name] ) else { throw Web3Error . transactionSerializationError }
132
132
guard let result = try ? await transaction. writeToChain ( password: password) else { throw Web3Error . processingError ( desc: " Can't send transaction " ) }
@@ -143,9 +143,9 @@ public extension ENS {
143
143
144
144
// FIXME: Rewrite this to CodableTransaction
145
145
@available ( * , message: " Available for only owner " )
146
- func setContentHash( forNode node: String , hash: String , options : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
147
- var options = options ?? defaultTransaction
148
- options . to = self . resolverContractAddress
146
+ func setContentHash( forNode node: String , hash: String , transaction : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
147
+ var transaction = transaction ?? defaultTransaction
148
+ transaction . to = self . resolverContractAddress
149
149
guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
150
150
guard let transaction = self . resolverContract. createWriteOperation ( " setContenthash " , parameters: [ nameHash, hash] ) else { throw Web3Error . transactionSerializationError }
151
151
guard let result = try ? await transaction. writeToChain ( password: password)
@@ -164,9 +164,9 @@ public extension ENS {
164
164
165
165
// FIXME: Rewrite this to CodableTransaction
166
166
@available ( * , message: " Available for only owner " )
167
- func setContractABI( forNode node: String , contentType: ENS . Resolver . ContentType , data: Data , options : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
168
- var options = options ?? defaultTransaction
169
- options . to = self . resolverContractAddress
167
+ func setContractABI( forNode node: String , contentType: ENS . Resolver . ContentType , data: Data , transaction : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
168
+ var transaction = transaction ?? defaultTransaction
169
+ transaction . to = self . resolverContractAddress
170
170
guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
171
171
guard let transaction = self . resolverContract. createWriteOperation ( " setABI " , parameters: [ nameHash, contentType. rawValue, data] ) else { throw Web3Error . transactionSerializationError }
172
172
guard let result = try ? await transaction. writeToChain ( password: password) else { throw Web3Error . processingError ( desc: " Can't send transaction " ) }
@@ -185,9 +185,9 @@ public extension ENS {
185
185
186
186
// FIXME: Rewrite this to CodableTransaction
187
187
@available ( * , message: " Available for only owner " )
188
- public func setPublicKey( forNode node: String , publicKey: PublicKey , options : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
189
- var options = options ?? defaultTransaction
190
- options . to = self . resolverContractAddress
188
+ public func setPublicKey( forNode node: String , publicKey: PublicKey , transaction : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
189
+ var transaction = transaction ?? defaultTransaction
190
+ transaction . to = self . resolverContractAddress
191
191
let pubkeyWithoutPrefix = publicKey. getComponentsWithoutPrefix ( )
192
192
guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
193
193
guard let transaction = self . resolverContract. createWriteOperation ( " setPubkey " , parameters: [ nameHash, pubkeyWithoutPrefix. x, pubkeyWithoutPrefix. y] ) else { throw Web3Error . transactionSerializationError }
@@ -205,9 +205,9 @@ public extension ENS {
205
205
206
206
// FIXME: Rewrite this to CodableTransaction
207
207
@available ( * , message: " Available for only owner " )
208
- public func setTextData( forNode node: String , key: String , value: String , options : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
209
- var options = options ?? defaultTransaction
210
- options . to = self . resolverContractAddress
208
+ public func setTextData( forNode node: String , key: String , value: String , transaction : CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
209
+ var transaction = transaction ?? defaultTransaction
210
+ transaction . to = self . resolverContractAddress
211
211
guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
212
212
guard let transaction = self . resolverContract. createWriteOperation ( " setText " , parameters: [ nameHash, key, value] ) else { throw Web3Error . transactionSerializationError }
213
213
guard let result = try ? await transaction. writeToChain ( password: password) else { throw Web3Error . processingError ( desc: " Can't send transaction " ) }
0 commit comments