Giter Site home page Giter Site logo

Comments (6)

34r7h avatar 34r7h commented on July 30, 2024

I thought this might have been because of ada locked in a token is showing as available, but I tried from an address with only lovelaces.

from pycardano.

cffls avatar cffls commented on July 30, 2024

What version of pycardano are you using? It could be that the change (2.83-1.6-0.16=1.07) is not meeting the minimum utxo size requirement. It will be great if you can share the input address so I am able to reproduce the problem.

from pycardano.

34r7h avatar 34r7h commented on July 30, 2024

I'm using pycardano v0.5.0 sending from addr1qypm6f2z5g45duzj9v9lt7jz9ce2q5m59vw3reqm9e25uxpynes82004nuvufjx0zu8up9dlr574azfnnp2vj3dcwrsqfux5t0

from pycardano.

34r7h avatar 34r7h commented on July 30, 2024

I thought the min was 1 ADA + ~0.16 min tx fee. Does pycardano have a higher min to cover overhead without possible hiccups?

from pycardano.

cffls avatar cffls commented on July 30, 2024

Could confirmed this is a bug. You are right, when there is only ADA in the output, 1 ADA is the minimum requirement. I fixed this in this commit: cffls@f8daca6

Test:

from pycardano import *



network = Network.MAINNET
context = BlockFrostChainContext("mainnetqEZ4wDDoRdtWqh2SNVLNqfQbhlNmTbza", network)

address = Address.from_primitive('addr1qypm6f2z5g45duzj9v9lt7jz9ce2q5m59vw3reqm9e25uxpynes82004nuvufjx0zu8up9dlr574azfnnp2vj3dcwrsqfux5t0')

builder = TransactionBuilder(context)
builder.add_input_address(address)

builder.add_output(
    TransactionOutput(
        Address.from_primitive(
"addr1qyady0evsaxqsfmz0z8rvmq62fmuas5w8n4m8z6qcm4wrt3e8dlsen8n464ucw69acfgdxgguscgfl5we3rwts4s57ashysyee"
        ),
        Value.from_primitive(
            [
                1600000,
            ]
        ),
    )
)


tx_body = builder.build(change_address=address)
print(tx_body)

Output:

{'auxiliary_data_hash': None,
 'certificates': None,
 'collateral': None,
 'collateral_return': None,
 'fee': 167965,
 'inputs': [{'index': 0,
 'transaction_id': TransactionId(hex='1764ea2ce4653c1f03b78a5ac73cf4c40247a930f60d3467927f744e9c06fc6d')}],
 'mint': None,
 'network_id': None,
 'outputs': [{'address': addr1qyady0evsaxqsfmz0z8rvmq62fmuas5w8n4m8z6qcm4wrt3e8dlsen8n464ucw69acfgdxgguscgfl5we3rwts4s57ashysyee,
 'amount': {'coin': 1600000, 'multi_asset': {}},
 'datum_hash': None},
             {'address': addr1qypm6f2z5g45duzj9v9lt7jz9ce2q5m59vw3reqm9e25uxpynes82004nuvufjx0zu8up9dlr574azfnnp2vj3dcwrsqfux5t0,
 'amount': {'coin': 1062574, 'multi_asset': {}},
 'datum_hash': None}],
 'reference_inputs': None,
 'required_signers': None,
 'script_data_hash': None,
 'total_collateral': None,
 'ttl': None,
 'update': None,
 'validity_start': None,
 'withdraws': None}

from pycardano.

34r7h avatar 34r7h commented on July 30, 2024

Thanks Jer, I'll look for the update when you pull it into the master branch

from pycardano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.