How to use the pywaves.Order function in PyWaves

To help you get started, we’ve selected a few PyWaves examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PyWaves / PyWaves / address.py View on Github external
def buy(self, assetPair, amount, price, maxLifetime=30 * 86400, matcherFee=pywaves.DEFAULT_MATCHER_FEE, timestamp=0):
        assetPair.refresh()
        normPrice = int(pow(10, 8 + assetPair.asset2.decimals - assetPair.asset1.decimals) * price)
        id = self._postOrder(assetPair.asset1, assetPair.asset2, b'\0', amount, normPrice, maxLifetime, matcherFee, timestamp)
        if pywaves.OFFLINE:
            return id
        elif id != -1:
            return pywaves.Order(id, assetPair, self)
github PyWaves / PyWaves / address.py View on Github external
def sell(self, assetPair, amount, price, maxLifetime=30 * 86400, matcherFee=pywaves.DEFAULT_MATCHER_FEE, timestamp=0):
        assetPair.refresh()
        normPrice = int(pow(10, 8 + assetPair.asset2.decimals - assetPair.asset1.decimals) * price)
        id = self._postOrder(assetPair.asset1, assetPair.asset2, b'\1', amount, normPrice, maxLifetime, matcherFee, timestamp)
        if pywaves.OFFLINE:
            return id
        elif id!=-1:
            return pywaves.Order(id, assetPair, self)