function buildURI(UrlObj: LbryUrlObj, includeProto: boolean = true, protoDefault: string = 'lbry://'): string {
  const {
    streamName,
    streamClaimId,
    channelName,
    channelClaimId,
    primaryClaimSequence,
    primaryBidPosition,
    secondaryClaimSequence,
    secondaryBidPosition,
    startTime,
    ...deprecatedParts
  } = UrlObj;
  const { claimId, claimName, contentName } = deprecatedParts;

  if (!isProduction) {
    if (claimId) {
      console.error(__("'claimId' should no longer be used. Use 'streamClaimId' or 'channelClaimId' instead"));
    }
    if (claimName) {
      console.error(__("'claimName' should no longer be used. Use 'streamClaimName' or 'channelClaimName' instead"));
    }
    if (contentName) {
      console.error(__("'contentName' should no longer be used. Use 'streamName' instead"));
    }
  }

  if (!claimName && !channelName && !streamName) {
    console.error(
      __("'claimName', 'channelName', and 'streamName' are all empty. One must be present to build a url.")
    );
  }

  const formattedChannelName = channelName && (channelName.startsWith('@') ? channelName : `@${channelName}`);
  const primaryClaimName = claimName || contentName || formattedChannelName || streamName;
  const primaryClaimId = claimId || (formattedChannelName ? channelClaimId : streamClaimId);
  const secondaryClaimName = (!claimName && contentName) || (formattedChannelName ? streamName : null);
  const secondaryClaimId = secondaryClaimName && streamClaimId;

  return (
    (includeProto ? protoDefault : '') +
    // primaryClaimName will always exist here because we throw above if there is no "name" value passed in
    // $FlowFixMe
    primaryClaimName +
    (primaryClaimId ? `#${primaryClaimId}` : '') +
    (primaryClaimSequence ? `:${primaryClaimSequence}` : '') +
    (primaryBidPosition ? `${primaryBidPosition}` : '') +
    (secondaryClaimName ? `/${secondaryClaimName}` : '') +
    (secondaryClaimId ? `#${secondaryClaimId}` : '') +
    (secondaryClaimSequence ? `:${secondaryClaimSequence}` : '') +
    (secondaryBidPosition ? `${secondaryBidPosition}` : '') +
    (startTime ? `?t=${startTime}` : '')
  );
}
Takes an object in the same format returned by parse() and builds a URI.

The channelName key will accept names with or without the @ prefix.