-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
From Claude's output in new-uI:
Fix
1. Create shared alias computation helper
File: portal/lib/schema/stream-alias.ts (new)
Helper that computes the stream alias from the contract address using the SDK:
import { sablier } from "sablier";
import { isEvmAddress } from "@/isomorphic/schema";
export function computeStreamAlias(
contract: string,
chainId: number,
tokenId: string,
indexerAlias: string | null | undefined,
): string {
// If the indexer provided a proper alias (not address-based), use it
if (indexerAlias) {
const source = indexerAlias.split("-")[0] ?? "";
if (source && !isEvmAddress(source)) {
return indexerAlias;
}
}
// Compute alias from SDK
const contractInfo = sablier.contracts.get({
chainId,
contractAddress: contract.toLowerCase(),
});
if (contractInfo?.alias) {
return `${contractInfo.alias}-${chainId}-${tokenId}`;
}
// Fallback: address-based ID
return `${contract.toLowerCase()}-${chainId}-${tokenId}`;
}
Metadata
Metadata
Assignees
Labels
No labels