An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/Trust/Vendors/New Group/Commands/GetStormBirdBalance.swift

28 lines
885 B

// Copyright SIX DAY LLC. All rights reserved.
import Foundation
import TrustKeystore
struct GetStormBirdBalanceEncode: 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(\(GetStormBirdBalanceEncode.abi), [\"\(address.description)\"])"
return .script(command: run)
}
}
struct GetStormBirdBalanceDecode: Web3Request {
typealias Response = String
let data: String
var type: Web3RequestType {
let run = "web3.eth.abi.decodeParameter('uint16[]', '\(data)')"
return .script(command: run)
}
}