# init network manager
# connection network is the brownie connection network
# config network is our enviroment we want to connect
network_manager = NetworkManager(connection_network=connection_network,
                                 config_network=config_network)

# run install() if is the first time and you want to install
# networks connection from brownie
# network_manager.install()

# Connect to network
network_manager.connect()

# instantiate DEX Contract
dex = MoCDecentralizedExchange(network_manager).from_abi()

base_token = '0xCB46c0ddc60D18eFEB0E586C17Af6ea36452Dae0'  # DOC Token address
secondary_token = '0x09b6ca5E4496238A1F176aEa6Bb607DB96c2286E'  # WRBTC Token address
amount = 0.001  # you want to purchase 0.0007 WRBTC
price = 14000  # the price in DOC of 1 WRBTC.
lifespan = 5  # the number of ticks your transaction are going to be alive.
amount_buy = amount * price

print("Insert buy limit order. Please wait to the transaction be mined!...")
tx_receipt = dex.insert_buy_limit_order(base_token, secondary_token,
                                        amount_buy, price, lifespan)

# finally disconnect from network
network_manager.disconnect()
"""
# init network manager
# connection network is the brownie connection network
# config network is our enviroment we want to connect
network_manager = NetworkManager(connection_network=connection_network,
                                 config_network=config_network)

# run install() if is the first time and you want to install
# networks connection from brownie
# network_manager.install()

# Connect to network
network_manager.connect()

# instantiate TEX Contract
dex = MoCDecentralizedExchange(network_manager).from_abi()

base_token = '0xCB46c0ddc60D18eFEB0E586C17Af6ea36452Dae0'  # DOC Token address
secondary_token = '0x09b6ca5E4496238A1F176aEa6Bb607DB96c2286E'  # WRBTC Token address
amount = 0.0007  # you want to sell 0.0007 WRBTC
multiply_factor = 1.01
lifespan = 7  # the number of ticks your transaction are going to be alive.

print("Insert sell market order. Please wait to the transaction be mined!...")
tx_receipt = dex.insert_sell_market_order(base_token, secondary_token, amount,
                                          multiply_factor, lifespan)

# finally disconnect from network
network_manager.disconnect()
"""
Insert sell market order. Please wait to the transaction be mined!...
Ejemplo n.º 3
0
from moneyonchain.networks import NetworkManager
from moneyonchain.tex import MoCDecentralizedExchange

connection_network = 'rskTesnetPublic'
config_network = 'dexTestnet'

# init network manager
# connection network is the brownie connection network
# config network is our enviroment we want to connect
network_manager = NetworkManager(connection_network=connection_network,
                                 config_network=config_network)

# run install() if is the first time and you want to install
# networks connection from brownie
# network_manager.install()

# Connect to network
network_manager.connect()

# instantiate DEX Contract
dex = MoCDecentralizedExchange(network_manager).from_abi()

is_paused = dex.paused()
print("Is paused: {0}".format(is_paused))

# finally disconnect from network
network_manager.disconnect()
"""

"""
Ejemplo n.º 4
0
# init network manager
# connection network is the brownie connection network
# config network is our enviroment we want to connect
network_manager = NetworkManager(connection_network=connection_network,
                                 config_network=config_network)

# run install() if is the first time and you want to install
# networks connection from brownie
# network_manager.install()

# Connect to network
network_manager.connect()

# instantiate DEX Contract
dex = MoCDecentralizedExchange(network_manager).from_abi()

base_token = '0xCB46c0ddc60D18eFEB0E586C17Af6ea36452Dae0'  # DOC Token address
secondary_token = '0x09b6ca5E4496238A1F176aEa6Bb607DB96c2286E'  # WRBTC Token address
order_id = 161
previous_order_id = 0

print("Order cancel. Please wait to the transaction be mined!...")
tx_receipt = dex.cancel_sell_order(base_token, secondary_token, order_id,
                                   previous_order_id)

# finally disconnect from network
network_manager.disconnect()
"""
Order cancel. Please wait to the transaction be mined!...
Transaction sent: 0xbdc15398c63c05c14fce9a183d4787b0ac2c006a3ca08e6ba611eca609092bed
connection_network = 'rskTesnetPublic'
config_network = 'dexTestnet'

# init network manager
# connection network is the brownie connection network
# config network is our enviroment we want to connect
network_manager = NetworkManager(connection_network=connection_network,
                                 config_network=config_network)

# run install() if is the first time and you want to install
# networks connection from brownie
# network_manager.install()

# Connect to network
network_manager.connect()

# instantiate DEX Contract
dex = MoCDecentralizedExchange(network_manager).from_abi()

base_token = '0xCB46c0ddc60D18eFEB0E586C17Af6ea36452Dae0'  # DOC Token address
secondary_token = '0x09b6ca5E4496238A1F176aEa6Bb607DB96c2286E'  # WRBTC Token address

tick_stage = dex.tick_stage((base_token, secondary_token))
print("Tick Stage: {0}".format(tick_stage))

# finally disconnect from network
network_manager.disconnect()
"""

"""
connection_network = 'rskTesnetPublic'
config_network = 'dexTestnet'

# init network manager
# connection network is the brownie connection network
# config network is our enviroment we want to connect
network_manager = NetworkManager(connection_network=connection_network,
                                 config_network=config_network)

# run install() if is the first time and you want to install
# networks connection from brownie
# network_manager.install()

# Connect to network
network_manager.connect()

# instantiate DEX Contract
dex = MoCDecentralizedExchange(network_manager).from_abi()

base_token = '0xCB46c0ddc60D18eFEB0E586C17Af6ea36452Dae0'  # DOC Token address
secondary_token = '0x09b6ca5E4496238A1F176aEa6Bb607DB96c2286E'  # WRBTC Token address

is_running = dex.tick_is_running((base_token, secondary_token))
print("Is Running: {0}".format(is_running))

# finally disconnect from network
network_manager.disconnect()
"""

"""