holgern/beem

Missing Required Active Authority only when sending market order.

Closed this issue · 2 comments

I'm trying to put market order and fail on:

beemapi.exceptions.MissingRequiredActiveAuthority

But my active key setting is fine because I'm able to do account.transfer
Here is my code:

from beem.account import Account
from beem.market import Market
from beem.price import Price
from beem.amount import Amount

hive = Hive(
        nobroadcast=False,
        keys=["my active key"]
        )
account = Account("myuser", blockchain_instance=hive)
print(account.transfer("otheruser", "0.001", "HIVE", "some memo"))  #    <----       work!

market = Market("HBD:HIVE",
   blockchain_instance=hive
)

print(market.buy(
    Price(4.290001, "HIVE/HBD"),
    Amount("0.01 HBD"),    
    account="myuser"
))			#     <-----              fail on beemapi.exceptions.MissingRequiredActiveAuthority

Am I Missing something ?

Thanks

are your default nodes Hive nodes? Your Price() and Amount() calls fall back to the default blockchain instance. The following works for me:

from beem import Hive
from beem.market import Market
from beem.price import Price
from beem.amount import Amount
from getpass import getpass

h = Hive(node="https://api.hive.blog", keys=[getpass("Active key: ")],
         nobroadcast=False)
market = Market("HBD:HIVE", blockchain_instance=h)
print(market.buy(Price(1.0, "HIVE/HBD", blockchain_instance=h),
                 Amount("0.001 HBD", blockchain_instance=h),
                 account="myuser"))

Its work not thans