I am hitting a wall trying to figure out a working proof of concept to get pytezos
to "purchase" a token from objkt. I am using the following script with pytezos
under the assumption that:
- I do this using an operation group
- I should use the
.transaction
method - I need to pass the entrypoint ( in tzKT this appears to be a
fulfill_ask
entrypoint? ) and the additionaltoken_id
?
from pytezos import pytezos
from decimal import Decimal
# COLECT THIS TOKEN: https://objkt.com/asset/KT1KXXZ758wtyf2NBjWKPeXugDh5Mm7kyckw/2
# COLLECTIO CONTRACT: KT1KXXZ758wtyf2NBjWKPeXugDh5Mm7kyckw
# Market PLace Contract: KT1WvzYHCNBvDSdwafTHv7nJ1dWmZ8GCYuuC
# PRICE: Decimal('.01')
# CREATOR: tz2SRxyGc1SFnbAyGuWTNcRbWgZB6pyeGYqB
PRVKEY = "edsk...."
contract_address='KT1WvzYHCNBvDSdwafTHv7nJ1dWmZ8GCYuuC'
token_id=2
ask_id = 1253832
opgrp = pytezos.using( shell='mainnet', key=PRVKEY )
# best guess how to format parameters based on doc: https://pytezos.org/high_level.html#pytezos.client.PyTezosClient.transaction
opg2 = opg.transaction( destination=contract_address,
amount=Decimal('.009'),
fee=Decimal('.00150'),
parameters = { "entrypoint": 'fulfill_ask',
"value": '(Pair ask_id {})'.format(ask_id) })
opgrp2 = opgrp2.fill()
opgrpSigned = opgrp2.sign() # error out here: fails to parse the Micheline expression for "value"
UPDATED: User iguerNL pointed out the flaw that i am not connecting with the correct contract, i am updating to fix that.