コード例 #1
0
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)
コード例 #2
0
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))
コード例 #3
0
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
コード例 #4
0
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)
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
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)
コード例 #8
0
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))
コード例 #9
0
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))