It's the same issue as before, you are trying to put the key in the required auth or required posting auth:
I noticed in cancel order:
def cancel_order(account_name, order_id):
"""Cancel an order by its orderId."""
payload = {
"contractName": "market",
"contractAction": "cancel",
"contractPayload": {"orderId": str(order_id)},
}
tx = TransactionBuilder(blockchain_instance=hive)
op = Custom_json(
required_posting_auths=[HIVE_ACTIVE_KEY], # <--- this is wrong
required_auths=[account_name],
id="ssc-mainnet-hive",
json=jsonlib.dumps(payload),
)
tx.operations = [op]
tx.sign()
tx.broadcast()
print(f"❎ Cancelled order: {order_id}")
Think of it this way, it'asking who's auth do we need, so we have the two fields: required_posting_auths=[]
because we don't need anybody's posting auth for this call. Then in required_auths=[account_name]
because we do need the active auth of the account for this call. Has nothing to do with the keys, just whose account do we need access to, to do this action. you could actually even omit the line you don't need at all for the custom json. for example it could very easily read:
op = Custom_json(
required_auths=[account_name],
id="ssc-mainnet-hive",
json=jsonlib.dumps(payload),
)
You have this problem in a couple of the functions in place_order.py
e.g. the buy / sell / cancel