We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Amount Object is:
public class Amount { private String unit; private BigInteger quantity; }
When the transfer amount includes decimals, how should it be handled?
The Current Example code:
PaymentTransaction paymentTransaction = PaymentTransaction.builder() .sender(sender) .receiver(receiver) .amount(BigInteger.valueOf(3000)) .unit("57fca08abbaddee36da742a839f7d83a7e1d2419f1507fcbf3916522534245525259") .build();
The text was updated successfully, but these errors were encountered:
@mackieq Cardano Native tokens are represented as whole number (BigInteger in Java). So during transfer you can't use decimal.
You can also get the decimal info of an existing mainnet token from token registry and convert it to a whole number using that. Please check info about token registry here https://developers.cardano.org/docs/native-tokens/cardano-token-registry/
Btw, PaymentTransaction api is now deprecated.
Please look into "QuickTx" api which is quite simple and flexible.
Here are some examples of QuickTx api.
https://github.com/bloxbean/cardano-client-examples/blob/main/src/test/java/com/bloxbean/cardano/client/example/quicktx/SimplePayment.java
Blog post: https://satran004.medium.com/introducing-new-quicktx-api-in-cardano-client-lib-0-5-0-beta1-5beb491282ce
Sorry, something went wrong.
No branches or pull requests
The Amount Object is:
When the transfer amount includes decimals, how should it be handled?
The Current Example code:
The text was updated successfully, but these errors were encountered: