import { PrettyContract } from '@canton-network/core-tx-parser'
import { HoldingView, Lock } from '@canton-network/core-token-standard'
// Return type narrowed to PrettyContract<HoldingView>[]
const utxos = await sdk.token.utxos.list({ partyId: sender.partyId })
const result: PrettyContract<HoldingView> = utxos[0]
// The badly typed result.interfaceViewValue.contractId was always undefined at runtime and has been removed
const contractId: string = result.contractId
// New typing for the lock object
const lock: Lock = result.interfaceViewValue.lock
// New typing matches existing runtime structure
const expiresAfter: { microseconds: string } = lock.expiresAfter
// Now requires PrettyContract<HoldingView> as an argument
const isLocked: boolean = TokenStandardService.isHoldingLocked(result)