@@ -11,6 +11,21 @@ import BigInt
11
11
import PromiseKit
12
12
import EthereumAddress
13
13
14
+ protocol IERC777 {
15
+ func getBalance( account: EthereumAddress ) throws -> BigUInt
16
+ func getAllowance( originalOwner: EthereumAddress , delegate: EthereumAddress ) throws -> BigUInt
17
+ func transfer( from: EthereumAddress , to: EthereumAddress , amount: String ) throws -> WriteTransaction
18
+ func transferFrom( from: EthereumAddress , to: EthereumAddress , originalOwner: EthereumAddress , amount: String ) throws -> WriteTransaction
19
+ func setAllowance( from: EthereumAddress , to: EthereumAddress , newAmount: String ) throws -> WriteTransaction
20
+ func authorize( from: EthereumAddress , operator user: EthereumAddress ) throws -> WriteTransaction
21
+ func revoke( from: EthereumAddress , operator user: EthereumAddress ) throws -> WriteTransaction
22
+ func isOperatorFor( operator user: EthereumAddress , tokenHolder: EthereumAddress ) throws -> Bool
23
+ func send( from: EthereumAddress , to: EthereumAddress , amount: String , data: [ UInt8 ] ) throws -> WriteTransaction
24
+ func operatorSend( from: EthereumAddress , to: EthereumAddress , originalOwner: EthereumAddress , amount: String , data: [ UInt8 ] , operatorData: [ UInt8 ] ) throws -> WriteTransaction
25
+ func burn( from: EthereumAddress , amount: String , data: [ UInt8 ] ) throws -> WriteTransaction
26
+ func operatorBurn( from: EthereumAddress , amount: String , originalOwner: EthereumAddress , data: [ UInt8 ] , operatorData: [ UInt8 ] ) throws -> WriteTransaction
27
+ }
28
+
14
29
// This namespace contains functions to work with ERC721 tokens.
15
30
// can be imperatively read and saved
16
31
public class ERC777 {
@@ -144,7 +159,7 @@ public class ERC777 {
144
159
} . wait ( )
145
160
}
146
161
147
- public func getBalance( account: EthereumAddress ) throws -> BigUInt {
162
+ public func getBalance( account: EthereumAddress ) throws -> BigUInt {
148
163
let contract = self . contract
149
164
var transactionOptions = TransactionOptions ( )
150
165
transactionOptions. callOnBlock = . latest
0 commit comments