Skip to content

Commit f1c295b

Browse files
Rename [Read|Write]Transaction to [Read|Write]Operation,
that is more fits to its intent.
1 parent bf25523 commit f1c295b

22 files changed

+253
-253
lines changed

Sources/web3swift/Tokens/ERC1155/Web3+ERC1155.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import Core
1414
// FIXME: Rewrite this to CodableTransaction
1515
protocol IERC1155: IERC165 {
1616

17-
func safeTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, id: BigUInt, value: BigUInt, data: [UInt8]) async throws -> WriteTransaction
17+
func safeTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, id: BigUInt, value: BigUInt, data: [UInt8]) async throws -> WriteOperation
1818

19-
func safeBatchTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, ids: [BigUInt], values: [BigUInt], data: [UInt8]) async throws -> WriteTransaction
19+
func safeBatchTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, ids: [BigUInt], values: [BigUInt], data: [UInt8]) async throws -> WriteOperation
2020

2121
func balanceOf(account: EthereumAddress, id: BigUInt) async throws -> BigUInt
2222

23-
func setApprovalForAll(from: EthereumAddress, operator user: EthereumAddress, approved: Bool, scope: Data) async throws -> WriteTransaction
23+
func setApprovalForAll(from: EthereumAddress, operator user: EthereumAddress, approved: Bool, scope: Data) async throws -> WriteOperation
2424

2525
func isApprovedForAll(owner: EthereumAddress, operator user: EthereumAddress, scope: Data) async throws -> Bool
2626
}
@@ -82,7 +82,7 @@ public class ERC1155: IERC1155 {
8282
self._hasReadProperties = true
8383
}
8484

85-
public func safeTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, id: BigUInt, value: BigUInt, data: [UInt8]) throws -> WriteTransaction {
85+
public func safeTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, id: BigUInt, value: BigUInt, data: [UInt8]) throws -> WriteOperation {
8686
let contract = self.contract
8787
var basicOptions = CodableTransaction.emptyTransaction
8888
basicOptions.from = from
@@ -92,7 +92,7 @@ public class ERC1155: IERC1155 {
9292
return tx
9393
}
9494

95-
public func safeBatchTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, ids: [BigUInt], values: [BigUInt], data: [UInt8]) throws -> WriteTransaction {
95+
public func safeBatchTransferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, ids: [BigUInt], values: [BigUInt], data: [UInt8]) throws -> WriteOperation {
9696
let contract = self.contract
9797
var basicOptions = CodableTransaction.emptyTransaction
9898
basicOptions.from = from
@@ -111,7 +111,7 @@ public class ERC1155: IERC1155 {
111111
return res
112112
}
113113

114-
public func setApprovalForAll(from: EthereumAddress, operator user: EthereumAddress, approved: Bool, scope: Data) throws -> WriteTransaction {
114+
public func setApprovalForAll(from: EthereumAddress, operator user: EthereumAddress, approved: Bool, scope: Data) throws -> WriteOperation {
115115
let contract = self.contract
116116
var basicOptions = CodableTransaction.emptyTransaction
117117
basicOptions.from = from

Sources/web3swift/Tokens/ERC1376/Web3+ERC1376.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ extension DirectDebitInfo: Hashable {
3535

3636
// Service-Friendly Token Standard
3737
protocol IERC1376: IERC20 {
38-
func approve(from: EthereumAddress, spender: EthereumAddress, expectedValue: String, newValue: String) async throws -> WriteTransaction
39-
func increaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String) async throws -> WriteTransaction
40-
func decreaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String, strict: Bool) async throws -> WriteTransaction
41-
func setERC20ApproveChecking(from: EthereumAddress, approveChecking: Bool) async throws -> WriteTransaction
38+
func approve(from: EthereumAddress, spender: EthereumAddress, expectedValue: String, newValue: String) async throws -> WriteOperation
39+
func increaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String) async throws -> WriteOperation
40+
func decreaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String, strict: Bool) async throws -> WriteOperation
41+
func setERC20ApproveChecking(from: EthereumAddress, approveChecking: Bool) async throws -> WriteOperation
4242

4343
func spendableAllowance(owner: EthereumAddress, spender: EthereumAddress) async throws -> BigUInt
44-
func transfer(from: EthereumAddress, data: String) async throws -> WriteTransaction
45-
func transferAndCall(from: EthereumAddress, to: EthereumAddress, value: String, data: [UInt8]) async throws -> WriteTransaction
44+
func transfer(from: EthereumAddress, data: String) async throws -> WriteOperation
45+
func transferAndCall(from: EthereumAddress, to: EthereumAddress, value: String, data: [UInt8]) async throws -> WriteOperation
4646

4747
func nonceOf(owner: EthereumAddress) async throws -> BigUInt
48-
func increaseNonce(from: EthereumAddress) async throws -> WriteTransaction
48+
func increaseNonce(from: EthereumAddress) async throws -> WriteOperation
4949
func delegateTransferAndCall(from: EthereumAddress,
5050
nonce: BigUInt,
5151
fee: BigUInt,
@@ -56,13 +56,13 @@ protocol IERC1376: IERC20 {
5656
mode: IERC1376DelegateMode,
5757
v: UInt8,
5858
r: Data,
59-
s: Data) async throws -> WriteTransaction
59+
s: Data) async throws -> WriteOperation
6060

6161
func directDebit(debtor: EthereumAddress, receiver: EthereumAddress) async throws -> DirectDebit
62-
func setupDirectDebit(from: EthereumAddress, receiver: EthereumAddress, info: DirectDebitInfo) async throws -> WriteTransaction
63-
func terminateDirectDebit(from: EthereumAddress, receiver: EthereumAddress) async throws -> WriteTransaction
64-
func withdrawDirectDebit(from: EthereumAddress, debtor: EthereumAddress) async throws -> WriteTransaction
65-
func withdrawDirectDebit(from: EthereumAddress, debtors: [EthereumAddress], strict: Bool) async throws -> WriteTransaction
62+
func setupDirectDebit(from: EthereumAddress, receiver: EthereumAddress, info: DirectDebitInfo) async throws -> WriteOperation
63+
func terminateDirectDebit(from: EthereumAddress, receiver: EthereumAddress) async throws -> WriteOperation
64+
func withdrawDirectDebit(from: EthereumAddress, debtor: EthereumAddress) async throws -> WriteOperation
65+
func withdrawDirectDebit(from: EthereumAddress, debtors: [EthereumAddress], strict: Bool) async throws -> WriteOperation
6666
}
6767

6868
// FIXME: Rewrite this to CodableTransaction
@@ -113,7 +113,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
113113
return res
114114
}
115115

116-
public func transfer(from: EthereumAddress, to: EthereumAddress, amount: String) async throws -> WriteTransaction {
116+
public func transfer(from: EthereumAddress, to: EthereumAddress, amount: String) async throws -> WriteOperation {
117117
let contract = self.contract
118118
var basicOptions = CodableTransaction.emptyTransaction
119119
basicOptions.from = from
@@ -135,7 +135,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
135135
return tx
136136
}
137137

138-
public func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) async throws -> WriteTransaction {
138+
public func transferFrom(from: EthereumAddress, to: EthereumAddress, originalOwner: EthereumAddress, amount: String) async throws -> WriteOperation {
139139
let contract = self.contract
140140
var basicOptions = CodableTransaction.emptyTransaction
141141
basicOptions.from = from
@@ -158,7 +158,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
158158
return tx
159159
}
160160

161-
public func setAllowance(from: EthereumAddress, to: EthereumAddress, newAmount: String) async throws -> WriteTransaction {
161+
public func setAllowance(from: EthereumAddress, to: EthereumAddress, newAmount: String) async throws -> WriteOperation {
162162
let contract = self.contract
163163
var basicOptions = CodableTransaction.emptyTransaction
164164
basicOptions.from = from
@@ -181,7 +181,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
181181
return tx
182182
}
183183

184-
public func approve(from: EthereumAddress, spender: EthereumAddress, amount: String) async throws -> WriteTransaction {
184+
public func approve(from: EthereumAddress, spender: EthereumAddress, amount: String) async throws -> WriteOperation {
185185
let contract = self.contract
186186
var basicOptions = CodableTransaction.emptyTransaction
187187
basicOptions.from = from
@@ -213,7 +213,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
213213
return res
214214
}
215215

216-
func approve(from: EthereumAddress, spender: EthereumAddress, expectedValue: String, newValue: String) async throws -> WriteTransaction {
216+
func approve(from: EthereumAddress, spender: EthereumAddress, expectedValue: String, newValue: String) async throws -> WriteOperation {
217217
let contract = self.contract
218218
var basicOptions = CodableTransaction.emptyTransaction
219219
basicOptions.from = from
@@ -239,7 +239,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
239239
return tx
240240
}
241241

242-
func increaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String) async throws -> WriteTransaction {
242+
func increaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String) async throws -> WriteOperation {
243243
let contract = self.contract
244244
var basicOptions = CodableTransaction.emptyTransaction
245245
basicOptions.from = from
@@ -262,7 +262,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
262262
return tx
263263
}
264264

265-
func decreaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String, strict: Bool) async throws -> WriteTransaction {
265+
func decreaseAllowance(from: EthereumAddress, spender: EthereumAddress, value: String, strict: Bool) async throws -> WriteOperation {
266266
let contract = self.contract
267267
var basicOptions = CodableTransaction.emptyTransaction
268268
basicOptions.from = from
@@ -285,7 +285,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
285285
return tx
286286
}
287287

288-
func setERC20ApproveChecking(from: EthereumAddress, approveChecking: Bool) throws -> WriteTransaction {
288+
func setERC20ApproveChecking(from: EthereumAddress, approveChecking: Bool) throws -> WriteOperation {
289289
let contract = self.contract
290290
var basicOptions = CodableTransaction.emptyTransaction
291291
basicOptions.from = from
@@ -304,7 +304,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
304304
return res
305305
}
306306

307-
func transfer(from: EthereumAddress, data: String) async throws -> WriteTransaction {
307+
func transfer(from: EthereumAddress, data: String) async throws -> WriteOperation {
308308
let contract = self.contract
309309
var basicOptions = CodableTransaction.emptyTransaction
310310
basicOptions.from = from
@@ -326,7 +326,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
326326
return tx
327327
}
328328

329-
func transferAndCall(from: EthereumAddress, to: EthereumAddress, value: String, data: [UInt8]) async throws -> WriteTransaction {
329+
func transferAndCall(from: EthereumAddress, to: EthereumAddress, value: String, data: [UInt8]) async throws -> WriteOperation {
330330
let contract = self.contract
331331
var basicOptions = CodableTransaction.emptyTransaction
332332
basicOptions.from = from
@@ -357,7 +357,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
357357
return res
358358
}
359359

360-
func increaseNonce(from: EthereumAddress) throws -> WriteTransaction {
360+
func increaseNonce(from: EthereumAddress) throws -> WriteOperation {
361361
let contract = self.contract
362362
var basicOptions = CodableTransaction.emptyTransaction
363363
basicOptions.from = from
@@ -368,7 +368,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
368368
return tx
369369
}
370370

371-
func delegateTransferAndCall(from: EthereumAddress, nonce: BigUInt, fee: BigUInt, gasAmount: BigUInt, to: EthereumAddress, value: String, data: [UInt8], mode: IERC1376DelegateMode, v: UInt8, r: Data, s: Data) async throws -> WriteTransaction {
371+
func delegateTransferAndCall(from: EthereumAddress, nonce: BigUInt, fee: BigUInt, gasAmount: BigUInt, to: EthereumAddress, value: String, data: [UInt8], mode: IERC1376DelegateMode, v: UInt8, r: Data, s: Data) async throws -> WriteOperation {
372372
let contract = self.contract
373373
var basicOptions = CodableTransaction.emptyTransaction
374374
basicOptions.from = from
@@ -402,7 +402,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
402402
return res
403403
}
404404

405-
func setupDirectDebit(from: EthereumAddress, receiver: EthereumAddress, info: DirectDebitInfo) throws -> WriteTransaction {
405+
func setupDirectDebit(from: EthereumAddress, receiver: EthereumAddress, info: DirectDebitInfo) throws -> WriteOperation {
406406
let contract = self.contract
407407
var basicOptions = CodableTransaction.emptyTransaction
408408
basicOptions.from = from
@@ -412,7 +412,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
412412
return tx
413413
}
414414

415-
func terminateDirectDebit(from: EthereumAddress, receiver: EthereumAddress) throws -> WriteTransaction {
415+
func terminateDirectDebit(from: EthereumAddress, receiver: EthereumAddress) throws -> WriteOperation {
416416
let contract = self.contract
417417
var basicOptions = CodableTransaction.emptyTransaction
418418
basicOptions.from = from
@@ -422,7 +422,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
422422
return tx
423423
}
424424

425-
func withdrawDirectDebit(from: EthereumAddress, debtor: EthereumAddress) throws -> WriteTransaction {
425+
func withdrawDirectDebit(from: EthereumAddress, debtor: EthereumAddress) throws -> WriteOperation {
426426
let contract = self.contract
427427
var basicOptions = CodableTransaction.emptyTransaction
428428
basicOptions.from = from
@@ -432,7 +432,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
432432
return tx
433433
}
434434

435-
func withdrawDirectDebit(from: EthereumAddress, debtors: [EthereumAddress], strict: Bool) throws -> WriteTransaction {
435+
func withdrawDirectDebit(from: EthereumAddress, debtors: [EthereumAddress], strict: Bool) throws -> WriteOperation {
436436
let contract = self.contract
437437
var basicOptions = CodableTransaction.emptyTransaction
438438
basicOptions.from = from

0 commit comments

Comments
 (0)