Skip to content
New issue

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

Add asset close to amount field to transaction #1886

Merged
merged 16 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2148,6 +2148,10 @@
"description": "Closing amount for the transaction.",
"type": "integer"
},
"asset-closing-amount": {
"description": "The number of the asset's unit that were transferred to the close-to address.",
"type": "integer"
},
"confirmed-round": {
"description": "The round where this transaction was confirmed, if present.",
"type": "integer"
Expand Down
12 changes: 12 additions & 0 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@
"description": "The application index if the transaction was found and it created an application.",
"type": "integer"
},
"asset-closing-amount": {
"description": "The number of the asset's unit that were transferred to the close-to address.",
"type": "integer"
},
"asset-index": {
"description": "The asset index if the transaction was found and it created an asset.",
"type": "integer"
Expand Down Expand Up @@ -3129,6 +3133,10 @@
"description": "The application index if the transaction was found and it created an application.",
"type": "integer"
},
"asset-closing-amount": {
"description": "The number of the asset's unit that were transferred to the close-to address.",
"type": "integer"
},
"asset-index": {
"description": "The asset index if the transaction was found and it created an asset.",
"type": "integer"
Expand Down Expand Up @@ -3189,6 +3197,10 @@
"description": "The application index if the transaction was found and it created an application.",
"type": "integer"
},
"asset-closing-amount": {
"description": "The number of the asset's unit that were transferred to the close-to address.",
"type": "integer"
},
"asset-index": {
"description": "The asset index if the transaction was found and it created an asset.",
"type": "integer"
Expand Down
4 changes: 4 additions & 0 deletions daemon/algod/api/server/v1/handlers/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ func assetTransferTxEncode(tx transactions.Transaction, ad transactions.ApplyDat
xfer.CloseTo = tx.AssetTransferTxnFields.AssetCloseTo.String()
}

if ad.AssetClosingAmount != 0 {
algorandskiy marked this conversation as resolved.
Show resolved Hide resolved
xfer.CloseToAmount = ad.AssetClosingAmount
}

return v1.Transaction{
AssetTransfer: &xfer,
}
Expand Down
178 changes: 89 additions & 89 deletions daemon/algod/api/server/v2/generated/private/routes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions daemon/algod/api/server/v2/generated/private/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading