Cosmos Wrapper Approval
Code Example
export const wrapperApproval = ({
specialAddress,
tokenIds,
ownershipTimes,
approvalId,
}: {
specialAddress: string;
tokenIds: iUintRange<bigint>[];
ownershipTimes: iUintRange<bigint>[];
approvalId: string;
}): RequiredApprovalProps => {
const id = approvalId;
const toSet: RequiredApprovalProps = {
version: 0n,
toListId: specialAddress,
toList: AddressList.getReservedAddressList(specialAddress),
fromListId: 'AllWithoutMint',
fromList: AddressList.getReservedAddressList('AllWithoutMint'),
initiatedByListId: 'All',
initiatedByList: AddressList.AllAddresses(),
transferTimes: UintRangeArray.FullRanges(),
tokenIds: tokenIds,
ownershipTimes: ownershipTimes,
approvalId: id,
approvalCriteria: {
...EmptyApprovalCriteria,
allowSpecialWrapping: true, // Required for wrapper path operations
overridesToIncomingApprovals: true,
},
};
return toSet;
};Last updated