Questions tagged [python]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
11 views

Getting error in cryptobot smart contract. [What fix is required ?? ]

import smartpy as sp # TODO: Code needs to be fixed. class Cryptobot(sp.Contract): def __init__(self, manager_address, life_state, initial_mutez, market_address): self.init( ...
user avatar
0 votes
1 answer
53 views

Buying NFT's on objkt.com using Pytezos

To learn Pytezos I am trying to buy NFT - from Tezzardz collection on objkt.com using Pytezos. How can I specify which Tezzard # I want to buy in a code? Is there anything else I need to know? test = ...
user avatar
  • 21
2 votes
1 answer
35 views

Pytezos for originating contracts

I am quite new to Pytezos and I have a few questions and would be very happy if you could help me. I want to make my script buy NFT, I know the smart contract address, how could I get from smart ...
user avatar
  • 21
0 votes
1 answer
17 views

my tezos oracles docker image (tqtezos/oracle-stock-ticker) is unable to find activation code via faucet file

my tezos oracles docker image (tqtezos/oracle-stock-ticker) is unable to find activation code from faucet configuration file using flask app. Getting following error: File "/usr/local/lib/python3....
user avatar
0 votes
2 answers
54 views

Tezos for Python

I am quite new to Python, using it for about half a year. I want to learn coding on Tezos blockchain and got some questions for you. Is there a chance to deploy smart contract using python? I know ...
user avatar
  • 1
1 vote
1 answer
53 views

How to compare a mutez value with int in smartpy

When trying to check the transferred value is positive I get an error that TMutez is not TIntOrNat.: sp.verify(sp.amount > 0, "Amount should be positive")
user avatar
  • 141
2 votes
1 answer
118 views

Why does smartpy use sp.for/sp.while instead of the default loops provided by python?

So I just started out with smartpy and I am kinda confused about the point of having separate expression for loops. My understanding is that it is may be because it's a part of on-chain computations, ...
user avatar
1 vote
2 answers
117 views

How to total smartpy.TMutez type stored as values in smartpy.bigmap?

I have the following smartpy.bigmap in smart contract storage: import smartpy as sp self.data.init(bgmp=sp.bigmap(tkey=sp.TAddress,tvalue=sp.TMutez)) I would like to total all the stored tvalue so ...
user avatar
2 votes
2 answers
126 views

How to connect to sandboxed server with pytezos?

I'm trying to use pytezos with sandboxed tezos server. Pytezos requires the following arguments for connection: shell, set to http://localhost:18731/ key, which I can't figure out I tried the ...
user avatar
  • 207
4 votes
2 answers
200 views

Unable to get consistent tz2 (secp256pk1) signature

I am trying to reproduce the signing algorithm used for tz2 address which uses the secp256pk1 elliptic curve. My problem is that when I try to verify if the signature is valid with the tezos cli, I ...
user avatar
3 votes
1 answer
403 views

Creating public key hash

Could somebody please point me to a piece of working Python 3.7 code that generates a Tezos public key hash out of seed, password and e-mail address? Everything I could find so far is always a mix of ...
user avatar
2 votes
1 answer
75 views

Can inject operation but can't preapply operation, returns 400

I can inject an operation but can't preapply an operation, it returns 400. I checked the body's format and it's OK. Why does this rpc return 400? I can inject the operation.
user avatar
7 votes
3 answers
292 views

How do I base58 encode the chain ID using Python?

When Tezos needs to sign a baking or endorsement operation payload, byte 0 will be a 0x01 for a baking operation or 0x02 for an endorsement operation. Bytes 1-5 in the operation payload contain the ...
user avatar