andelf / tronpy

TRON Python Client Library.
MIT License
204 stars 96 forks source link

sending from multisig tron address failed #70

Closed ikamran closed 1 year ago

ikamran commented 1 year ago

Hello,

I have an issue sending from a multisign address, what cause to get that error? on the web i can send by using that private key but using tronpy, It seems i miss something what is the correct way?

contract.functions.transfer(TC2r7dPEfMaMt8ToJ3rQ7SuVhX391cFhv5, 100_000_000)
.with_owner("TGihHToJJ9B1NFi2Vx5bTM8muRmsbdAaJ8")  # address of the private key
.fee_limit(20_000_000)
.build()
.sign(priv_key)

print(txn.txid)
print(txn.broadcast().wait())
tronpy.exceptions.BadKey: ('provided private key is not in the permission list', 'provided TGihHToJJ9B1NFi2Vx5bTM8muRmsbdAaJ8', "required {'keys': [{'address': '4163cdf133fcf4beb05881fb4b5d2b0ccf938a52af', 'w
eight': 1}], 'threshold': 1, 'permission_name': 'owner'}")
MrNaif2018 commented 1 year ago

Is it a special address, not a regular one? Could you provide me with the steps on how to create one to test it?

MrNaif2018 commented 1 year ago

Closing in favour of #50

ikamran commented 1 year ago

Is it a special address, not a regular one? Could you provide me with the steps on how to create one to test it?

first I created a multi signature address by and set 2 of 3 for sending funds now I have a multi signature address which nobody can send money, I want to know how can I send money from multi signature address by using tronpy?

ikamran commented 1 year ago

Is it a special address, not a regular one? Could you provide me with the steps on how to create one to test it?

first I changed the owner of

MrNaif2018 commented 1 year ago

I want to know how can I send money from multi signature address by using tronpy?

I think you can craft a tx, i.e. tx = somecommand.build() Then do tx=tx.sign(FIRST_PRIVATE_KEY).sign(SECOND_PRIVATE_KEY)

ikamran commented 1 year ago

actually I did it by sign it by one of PRIVATE_KEYs which result was what i sent above but as you know I can not sign from other ones I want to sign it myself broadcast it and wait until my coworkers sign it manually it's what I am looking for

MrNaif2018 commented 1 year ago

Erm, no, that's not how it works...

You can only broadcast finalized transaction with all signatures What you can do, is .sign() with your key, then use .to_json() or similar to send to your colleagues, they will do Transaction.from_json(json).sign(THEIR_KEY) and then broadcast

ikamran commented 1 year ago

Like I am understanding it now!!! maybe :) so how things work on tronscan website, in there after you create new transaction others can see there are transactions to sign in their account

MrNaif2018 commented 1 year ago

They just store this json for later signing by other parties