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