{"record":{"id":"d7f28d255b4f13ec","repo":"FuelLabs/fuels-ts","slug":"error-building-block-explorer-url","errorCode":"ERROR_BUILDING_BLOCK_EXPLORER_URL","errorMessage":"Only one of the following can be passed in to buildBlockExplorerUrl: ${customInputParams.map((param) => param.key).join(', ')}.","messagePattern":"Only one of the following can be passed in to buildBlockExplorerUrl: (.+?)\\.","errorType":"validation","errorClass":"FuelError","httpStatus":null,"severity":"warning","filePath":"packages/account/src/providers/utils/block-explorer.ts","lineNumber":65,"sourceCode":"      value: txId,\n    },\n    {\n      key: 'blockNumber',\n      value: blockNumber,\n    },\n  ];\n\n  const definedValues = customInputParams\n    .filter((param) => !!param.value)\n    .map(({ key, value }) => ({\n      key,\n      value,\n    }));\n\n  const hasAnyDefinedValues = definedValues.length > 0;\n\n  if (definedValues.length > 1) {\n    throw new FuelError(\n      ErrorCode.ERROR_BUILDING_BLOCK_EXPLORER_URL,\n      `Only one of the following can be passed in to buildBlockExplorerUrl: ${customInputParams\n        .map((param) => param.key)\n        .join(', ')}.`\n    );\n  }\n\n  if (path && definedValues.length > 0) {\n    const inputKeys = customInputParams.map(({ key }) => key).join(', ');\n    throw new FuelError(\n      ErrorCode.ERROR_BUILDING_BLOCK_EXPLORER_URL,\n      `You cannot pass in a path to 'buildBlockExplorerUrl' along with any of the following: ${inputKeys}.`\n    );\n  }\n\n  const pathGeneratedFromInputParams = hasAnyDefinedValues\n    ? getPathFromInput(\n        definedValues[0].key as BuildBlockExplorerUrlHelperParam,","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/account/src/providers/utils/block-explorer.ts#L47-L83","documentation":"Thrown by `buildBlockExplorerUrl()` when more than one of the mutually-exclusive locator params (`address`, `txId`, `blockNumber`) is defined. The helper can only build a path for a single resource; passing multiple makes the target ambiguous, so it rejects before constructing an incorrect URL.","triggerScenarios":"Calling `buildBlockExplorerUrl({ address, txId })`, `buildBlockExplorerUrl({ txId, blockNumber })`, or any combination where two or more of the three are truthy. The `definedValues` array length exceeds 1.","commonSituations":"Generically forwarding a user-selected object containing several optional fields into buildBlockExplorerUrl; copy-paste from a config that sets both address and txId; UI that lets the user pick multiple entities and passes them all through.","solutions":["Pass exactly one of `address`, `txId`, or `blockNumber` to buildBlockExplorerUrl.","Add an upstream guard that selects the first defined locator and drops the rest.","Restructure the caller to issue separate buildBlockExplorerUrl calls per resource."],"exampleFix":"// before\nconst url = buildBlockExplorerUrl({ address, txId }); // both set -> throws\n// after\nconst url = buildBlockExplorerUrl(txId ? { txId } : { address });","handlingStrategy":"validation","validationCode":"function pickSingleLocator(o: { address?: string; txId?: string; blockNumber?: number }) {\n  const defined = [o.address, o.txId, o.blockNumber].filter(Boolean);\n  if (defined.length > 1) throw new Error('pass only one locator');\n  return defined.length === 1 ? { address: o.address, txId: o.txId, blockNumber: o.blockNumber } : {};\n}","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Pass exactly one of address/txId/blockNumber.","Build a selector upstream that picks the first defined locator.","Do not forward whole user objects that may contain multiple fields."],"tags":["block-explorer","url","validation","typescript"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}