Ejemplo n.º 1
0
    def cancel_order(self, hash):
        '''
        Cancel an order

        :param hash: required
        :type hash: str

        :returns: Order

        :raises: DydxAPIError
        '''
        signature = utils.sign_cancel_order(hash, self.private_key)
        return self._delete('/v2/orders/' + hash,
                            headers={'Authorization': 'Bearer ' + signature})
Ejemplo n.º 2
0
    def cancel_order(self, hash):
        """
        Cancel an order

        :param hash: required
        :type hash: str

        :returns: Order

        :raises: DydxAPIError
        """
        signature = utils.sign_cancel_order(hash, self.private_key)
        return self._delete(
            "dex/orders/" + hash, headers={"Authorization": "Bearer " + signature}
        )
Ejemplo n.º 3
0
 def test_sign_cancel_order(self):
     signature = utils.sign_cancel_order(order_hash=ORDER_HASH,
                                         private_key=PRIVATE_KEY_1)
     assert signature == CANCEL_ORDER_SIGNATURE