Questions tagged [python]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
26 views

Url error in smartpy

I trying to write a smart contract on the tezos network and using import FA2 library for this. But when I try to run the code I face the url error. this is my code : import smartpy as sp FA2 = sp.io....
AMS SAL's user avatar
0 votes
1 answer
12 views

Pytezos: transfer endpoint

I get an unexpected arguments error while trying to make a transfer endpoint call. my_contract.transfer([{ "transfer_item": { "from_": "tz1...", "txs&...
Joel's user avatar
  • 1
1 vote
1 answer
23 views

Examples of deploying a smart contract on a tezos sandbox with python/pytezos

I've been looking for up to date examples of deploying a smart contract on a tezos sandbox for a while now. Does anyone know of any good references? I'm using python/pytezos.
user avatar
0 votes
1 answer
29 views

Decoding the "0501..." strings used by SigningType.MICHELINE

Is there a trick to decoding the "0501..." strings used by SigningType.MICHELINE. I am trying to unpack it from python using: from pytezos.michelson.types import MichelsonType ty = ...
user avatar
0 votes
2 answers
59 views

Using Pytezos to Properly call a smart contract with correct parameters ( to purchase token from objkt )

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: ...
roy's user avatar
  • 101
2 votes
1 answer
29 views

Pytezos: structuring call for FA2

Can you guys help me correctly structure a call to the update_operators in an FA2? I tried everything single combination I can think of, and it still doesn't work It says the structure should be like ...
João Gonçalo Morais's user avatar
-1 votes
1 answer
56 views

How to validate a tezos address either it's valid or invalid?

Like in web3.py we can check an ethereum address is valid or invalid by this web3.utils.isAddress(address) Is there any function available in pytezos or not?
Shahbaz Ali's user avatar
-2 votes
1 answer
45 views

I've setup the tezos node for Ghostnet testnet but don't know how interact with node

I'm facing this issue while interacting with my node
Shahbaz Ali's user avatar
1 vote
1 answer
56 views

how to find the balance in pytezos [duplicate]

how to find the balance of an tezos account in pytezos?
Shahbaz Ali's user avatar
1 vote
1 answer
83 views

How to create an address of tezos by using pytezos?

I've created an address of tezos by using pytezos with the below mentioned code addr = Key.generate() publicKey = addr.public_key_hash() pvtKey = addr.secret_key(passphrase='12435') and when I import ...
Shahbaz Ali's user avatar
1 vote
1 answer
51 views

How can I connect to the kathmandunet in pytezos?

I'm using pytezos and trying to send 1 xtz from one account to another account using pytezos and I want to do this transaction on kathmandunet and I don't know how to initialize the pytezos instance ...
Shahbaz Ali's user avatar
2 votes
1 answer
30 views

How to use the pytezos.crypto.encoding.base58_encode function?

i'm trying to use the pytezos.crypto.key library. But i miss something giving the Key object my public key as an argument. Here my code : encoded_key=pytezos.crypto.encoding.base58_encode(bytearray(b'...
achille1017's user avatar
0 votes
1 answer
71 views

How to interact with tezos blockchain by using python?

I want to create a python script in which I need to create some functions like 1-GetTransactionByHash 2-GetBlockByHash 3-GetBalanceOfWallet I want to ask that how could I do it by using python in ...
Shahbaz Ali's user avatar
1 vote
1 answer
67 views

Gas Exhausted error

I am trying to use pytezos to perform a transaction on Tezos testnet. I am receiving a 'Gas Exhausted' error although it is suppose to autofill. Python code: native_key = await Key.from_mnemonic(words,...
thotheolh's user avatar
  • 113
0 votes
1 answer
23 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( ...
Amit Kumar's user avatar
0 votes
1 answer
151 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 = ...
Aron's user avatar
  • 31
3 votes
1 answer
92 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 ...
Aron's user avatar
  • 31
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....
Kamran Shahid's user avatar
0 votes
2 answers
100 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 ...
Aron's user avatar
  • 1
1 vote
1 answer
73 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")
Chiptus's user avatar
  • 141
2 votes
1 answer
135 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, ...
Anshu Jalan's user avatar
1 vote
2 answers
145 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 ...
macourtney7's user avatar
2 votes
2 answers
138 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 ...
jpic's user avatar
  • 207
5 votes
2 answers
224 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 ...
Simon B.Robert's user avatar
3 votes
1 answer
457 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 ...
hh221165's user avatar
2 votes
1 answer
138 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.
purplecity's user avatar
7 votes
3 answers
317 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 ...
Luke Youngblood's user avatar