feat: add RequiredBadge support to PerAssetTransfers manifest builder - #452
feat: add RequiredBadge support to PerAssetTransfers manifest builder#452genkipool wants to merge 3 commits into
Conversation
| use crate::prelude::*; | ||
|
|
||
| /// A badge that is required to authorize/validate the transaction execution. | ||
| #[derive(Clone, Debug, PartialEq, Eq, Hash)] |
There was a problem hiding this comment.
Should not need a new type, do use ResourceSpecifier
| let resource_arg: ScryptoResourceAddress = | ||
| resource_address.into(); | ||
| let amount_arg: ScryptoDecimal192 = amount.into(); | ||
| builder = builder.call_method( |
There was a problem hiding this comment.
prefer create_proof_from_account_of_amount
| .into_iter() | ||
| .map(ScryptoNonFungibleLocalId::from) | ||
| .collect(); | ||
| builder = builder.call_method( |
There was a problem hiding this comment.
prefer using create_proof_from_account_of_non_fungibles
| mockk = "1.13.11" | ||
| kotlin = "2.0.21" | ||
| agp = "8.9.0" | ||
| agp = "8.12.3" |
There was a problem hiding this comment.
any reason for this change?
There was a problem hiding this comment.
Please explain why this was changed
|
|
||
| cargoNdk { | ||
| targets = arrayListOf("arm64", "arm") | ||
| targets = arrayListOf("arm64", "arm", "x86_64", "x86") |
There was a problem hiding this comment.
I guess you need to x86_64 for building on Intel based machine for the emulator? seems that you are on Linux machine.
|
Hi @GhenadieVP, Thank you for the detailed review! Here are my responses and the reasoning behind the changes: 1.
|
Yes, it is good to keep at least for local dev. |
Description
This PR extends the
PerAssetTransfersmanifest building logic to support injecting required badges into the transaction. It is required for the upcoming feature in the Android/iOS wallets that automatically presents authorized badges when transferring restricted tokens or NFTs.Changes
RequiredBadgetype with the standardResourceSpecifier.TransactionManifest.perAssetTransfersbuilder to accept and inject a list ofResourceSpecifierinto the generated manifest instructions.create_proof_of_amountfor fungibles andcreate_proof_of_non_fungiblesfor NFTs) on the Account component during manifest building.UuidSerializer.kt,TimestampSerializer.kt) as requested.TransactionManifestTest.ktto verify correct badge injection.Related Issues