Skip to content

Conversation

h0ngcha0
Copy link
Member

No description provided.

"destinations": [
{
"address": "1C2RAVWSuaXw8xtUxqVERR7ChKBE1XgscNFw73NSHE1v3",
"attoAlphAmount": "10000000000000000",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that it is not necessary because if the attoAlphAmount is not specified, the full node will calculate the required dust amount based on the token: https://github.com/alephium/alephium/blob/30c59df012625a3b568a455800cf025683237da2/app/src/main/scala/org/alephium/app/ServerUtils.scala#L914

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that attoAlphAmount is required from the API, i will update the endpoint.

curl -X 'POST' \
  'https://node.mainnet.alephium.org/transactions/build' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"fromPublicKey": "034e30eb5dd78000bcbe276e1202d0dc5499398321cc160cc8b10f2a71ffdfe7ca", "destinations": [{"address": "1C2RAVWSuaXw8xtUxqVERR7ChKBE1XgscNFw73NSHE1v3", "tokens":[{"id": "66da610efb5129c062e88
e5fd65fe810f31efd1597021b2edf887a4360fa0800", "amount": "1"}]}]}'
{"detail":"Invalid value for: body (missing keys in dictionary: attoAlphAmount at index 266: decoding failure)"}%

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize this, thanks for the fix!

@Lbqds Lbqds merged commit 5231c8a into master Dec 18, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants