@@ -73,7 +73,7 @@ public class ERC1155: IERC1155 {
73
73
var transactionOptions = CodableTransaction . emptyTransaction
74
74
transactionOptions. callOnBlock = . latest
75
75
76
- guard let tokenIdPromise = try await contract. createReadOperation ( " id " , parameters: [ ] as [ AnyObject ] , extraData: Data ( ) , transactionOptions : transactionOptions ) ? . decodedData ( ) else { return }
76
+ guard let tokenIdPromise = try await contract. createReadOperation ( " id " , parameters: [ ] as [ AnyObject ] , extraData: Data ( ) ) ? . decodedData ( ) else { return }
77
77
78
78
guard let tokenId = tokenIdPromise [ " 0 " ] as? BigUInt else { return }
79
79
self . _tokenId = tokenId
@@ -87,7 +87,7 @@ public class ERC1155: IERC1155 {
87
87
basicOptions. from = from
88
88
basicOptions. to = self . address
89
89
90
- let tx = contract. createWriteOperation ( " safeTransferFrom " , parameters: [ originalOwner, to, id, value, data] as [ AnyObject ] , transactionOptions : basicOptions ) !
90
+ let tx = contract. createWriteOperation ( " safeTransferFrom " , parameters: [ originalOwner, to, id, value, data] as [ AnyObject ] ) !
91
91
return tx
92
92
}
93
93
@@ -98,7 +98,7 @@ public class ERC1155: IERC1155 {
98
98
basicOptions. to = self . address
99
99
100
100
let tx = contract
101
- . createWriteOperation ( " safeBatchTransferFrom " , parameters: [ originalOwner, to, ids, values, data] as [ AnyObject ] , transactionOptions : basicOptions ) !
101
+ . createWriteOperation ( " safeBatchTransferFrom " , parameters: [ originalOwner, to, ids, values, data] as [ AnyObject ] ) !
102
102
return tx
103
103
}
104
104
@@ -107,12 +107,12 @@ public class ERC1155: IERC1155 {
107
107
var transactionOptions = CodableTransaction . emptyTransaction
108
108
transactionOptions. callOnBlock = . latest
109
109
let result = try await contract
110
- . createReadOperation ( " balanceOf " , parameters: [ account, id] as [ AnyObject ] , extraData: Data ( ) , transactionOptions : self . transactionOptions ) !
110
+ . createReadOperation ( " balanceOf " , parameters: [ account, id] as [ AnyObject ] , extraData: Data ( ) ) !
111
111
. decodedData ( )
112
112
113
113
/*
114
114
let result = try await contract
115
- .prepareToRead("balanceOf", parameters: [account, id] as [AnyObject], extraData: Data(), transactionOptions: self.transactionOptions )!
115
+ .prepareToRead("balanceOf", parameters: [account, id] as [AnyObject], extraData: Data() )!
116
116
.execute()
117
117
.decodeData()
118
118
@@ -127,15 +127,15 @@ public class ERC1155: IERC1155 {
127
127
basicOptions. from = from
128
128
basicOptions. to = self . address
129
129
130
- let tx = contract. createWriteOperation ( " setApprovalForAll " , parameters: [ user, approved, scope] as [ AnyObject ] , transactionOptions : basicOptions ) !
130
+ let tx = contract. createWriteOperation ( " setApprovalForAll " , parameters: [ user, approved, scope] as [ AnyObject ] ) !
131
131
return tx
132
132
}
133
133
134
134
public func isApprovedForAll( owner: EthereumAddress , operator user: EthereumAddress , scope: Data ) async throws -> Bool {
135
135
let contract = self . contract
136
136
var basicOptions = CodableTransaction . emptyTransaction
137
137
basicOptions. callOnBlock = . latest
138
- let result = try await contract. createReadOperation ( " isApprovedForAll " , parameters: [ owner, user, scope] as [ AnyObject ] , extraData: Data ( ) , transactionOptions : self . transactionOptions ) !. decodedData ( )
138
+ let result = try await contract. createReadOperation ( " isApprovedForAll " , parameters: [ owner, user, scope] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
139
139
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
140
140
return res
141
141
}
@@ -145,7 +145,7 @@ public class ERC1155: IERC1155 {
145
145
var transactionOptions = CodableTransaction . emptyTransaction
146
146
transactionOptions. callOnBlock = . latest
147
147
transactionOptions. gasLimitPolicy = . manual( 30000 )
148
- let result = try await contract. createReadOperation ( " supportsInterface " , parameters: [ interfaceID] as [ AnyObject ] , extraData: Data ( ) , transactionOptions : self . transactionOptions ) !. decodedData ( )
148
+ let result = try await contract. createReadOperation ( " supportsInterface " , parameters: [ interfaceID] as [ AnyObject ] , extraData: Data ( ) ) !. decodedData ( )
149
149
guard let res = result [ " 0 " ] as? Bool else { throw Web3Error . processingError ( desc: " Failed to get result of expected type from the Ethereum node " ) }
150
150
return res
151
151
}
0 commit comments