Improves the DX for creating a post-conditions. Previously, several functions had to be discovered (e.g. makeStandardNonFungiblePostCondition, makeContractNonFungiblePostCondition, createNonFungiblePostCondition, createAssetInfo).
And the resulting code pretty verbose:
const postCondition = createNonFungiblePostCondition(
createContractPrincipal(
'SP2JXKMSH007NPYAQHKJPQMAQYAD90NQGTVJVQ02B',
'contract-name'),
NonFungibleConditionCode.Owns,
createAssetInfo('SP2ZP4GJDZJ1FDHTQ963F0292PE9J9752TZJ68F21',
'contract_name',
'asset_name'),
bufferCVFromString('nft_asset_name')
);
// Note: more verbose when the inputs are strings that need to be split
// (e.g. `SP2JXKMSH007NPYAQHKJPQMAQYAD90NQGTVJVQ02B.contract-name`)
These post conditions can now be constructed without distinguishing between principal types or requiring construction of the AssetInfo object:
Description
Improves the DX for creating a post-conditions. Previously, several functions had to be discovered (e.g.
makeStandardNonFungiblePostCondition
,makeContractNonFungiblePostCondition
,createNonFungiblePostCondition
,createAssetInfo
).And the resulting code pretty verbose:
These post conditions can now be constructed without distinguishing between principal types or requiring construction of the
AssetInfo
object:Type of Change
Does this introduce a breaking change?
Backwards compatible
Are documentation updates required?
Testing information
Checklist
npm run test
passes