parent
a388c0546f
commit
09214df220
@ -0,0 +1,28 @@ |
||||
// Copyright SIX DAY LLC. All rights reserved. |
||||
|
||||
import Foundation |
||||
import TrustKeystore |
||||
|
||||
struct GetERC20NameEncode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
static let abi = "{\"constant\":true,\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"name\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}" |
||||
|
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.encodeFunctionCall(\(GetERC20NameEncode.abi), [])" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
||||
struct GetERC20NameDecode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
let data: String |
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.decodeParameter('string', '\(data)')" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
@ -0,0 +1,28 @@ |
||||
// Copyright SIX DAY LLC. All rights reserved. |
||||
|
||||
import Foundation |
||||
import TrustKeystore |
||||
|
||||
struct GetERC20SymbolEncode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
static let abi = "{\"constant\":true,\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"name\":\"symbol\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}" |
||||
|
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.encodeFunctionCall(\(GetERC20SymbolEncode.abi), [])" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
||||
struct GetERC20SymbolDecode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
let data: String |
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.decodeParameter('string', '\(data)')" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
@ -0,0 +1,28 @@ |
||||
// Copyright SIX DAY LLC. All rights reserved. |
||||
|
||||
import Foundation |
||||
import TrustKeystore |
||||
|
||||
struct GetERC875BalanceEncode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
static let abi = "{\"constant\":true,\"inputs\":[{\"name\":\"_owner\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"name\":\"\",\"type\":\"uint16[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}" |
||||
|
||||
let address: Address |
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.encodeFunctionCall(\(GetERC875BalanceEncode.abi), [\"\(address.description)\"])" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
||||
struct GetERC875BalanceDecode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
let data: String |
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.decodeParameter('uint16[4]', '\(data)')" |
||||
return .script(command: run) |
||||
} |
||||
} |
@ -0,0 +1,27 @@ |
||||
// Copyright SIX DAY LLC. All rights reserved. |
||||
|
||||
import Foundation |
||||
import TrustKeystore |
||||
|
||||
struct GetIsERC875Encode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
static let abi = "{\"constant\":true,\"inputs\":[],\"name\":\"isStormBirdContract\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}" |
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.encodeFunctionCall(\(GetIsERC875Encode.abi), [])" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
||||
struct GetIsERC875Decode: Web3Request { |
||||
typealias Response = String |
||||
|
||||
let data: String |
||||
|
||||
var type: Web3RequestType { |
||||
let run = "web3.eth.abi.decodeParameter('uint256', '\(data)')" |
||||
return .script(command: run) |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue