def get_ont_balance(): preExec = True params = dict() abiFunction = Invoke.get_function(params, 'get_sin_balance', abi_info) responce = SdkUtils.SendTransaction(contract_address, payer, payer, gas_limit, gas_price, abiFunction, preExec) return parse_neo_vm_contract_return_type_integer(responce)
def Balance(address): params = dict() params["address"] = address abiFunction = Invoke.get_function(params, 'balanceOf', abiInfo) return parse_neo_vm_contract_return_type_integer( SdkUtils.SendTransaction(ContractAddress(), owner, ownerAccount, abiFunction))
def set_buyer_address(hashlock, buyer, sender): preExec = False params = dict() params["order_id"] = "Hex:" + hashlock.hex() params["buyer"] = "ByteArray:" + buyer abiFunction = Invoke.get_function(params, 'set_buyer_address', abi_info) responce = SdkUtils.SendTransaction(contract_address, sender, sender, gas_limit, gas_price, abiFunction, preExec) return responce
def get_refund_timelock(hashlock): preExec = True params = dict() params["order_id"] = "Hex:" + hashlock.hex() abiFunction = Invoke.get_function(params, 'get_refund_timelock', abi_info) responce = SdkUtils.SendTransaction(contract_address, payer, payer, gas_limit, gas_price, abiFunction, preExec) return parse_neo_vm_contract_return_type_integer(responce)
def get_buyer(hashlock): preExec = True params = dict() params["order_id"] = "Hex:" + hashlock.hex() abiFunction = Invoke.get_function(params, 'get_buyer', abi_info) responce = SdkUtils.SendTransaction(contract_address, payer, payer, gas_limit, gas_price, abiFunction, preExec) return responce
def claim(hashlock, secret, sender): preExec = False params = dict() params["order_id"] = "Hex:" + hashlock.hex() params["secret"] = "Hex:" + secret.hex() abiFunction = Invoke.get_function(params, 'claim', abi_info) responce = SdkUtils.SendTransaction(contract_address, sender, sender, gas_limit, gas_price, abiFunction, preExec) return responce
def initiate_order(amountOfSinToSell, amountOfUsdtToBuy, hashlock, initiator=singamesAddress, sender=singames): preExec = False params = dict() params["amountOfSinToSell"] = amountOfSinToSell params["amountOfUsdtToBuy"] = amountOfUsdtToBuy params["hashlock"] = "Hex:" + hashlock.hex() params["initiator"] = "ByteArray:" + initiator abiFunction = Invoke.get_function(params, 'intiate_order', abi_info) return SdkUtils.SendTransaction(contract_address, sender, payer, gas_limit, gas_price, abiFunction, preExec)
def Transfer(from_address, to_address, amount, payer): #transfer(from_address, to_address, amount) params = dict() params["from_address"] = from_address params["to_address"] = to_address params["amount"] = amount abiFunction = Invoke.get_function(params, 'transfer', abiInfo) return parse_neo_vm_contract_return_type_bool( SdkUtils.SendTransaction(ContractAddress(), from_address, payer, abiFunction))
def Init(): params = dict() abiFunction = Invoke.get_function(params, 'init', abiInfo) return parse_neo_vm_contract_return_type_bool( SdkUtils.SendTransaction(ContractAddress(), owner, ownerAccount, abiFunction))