{"version":3,"sources":["../src/runTypegen.ts","../src/AbiTypeGen.ts","../src/abi/Abi.ts","../src/abi/errors/ErrorCode.ts","../src/utils/makeErrorCodes.ts","../src/utils/parseErrorCodes.ts","../src/abi/types/AType.ts","../src/abi/types/EmptyType.ts","../src/abi/types/OptionType.ts","../src/utils/findType.ts","../src/utils/getFunctionInputs.ts","../src/utils/parseTypeArguments.ts","../src/utils/getTypeDeclaration.ts","../src/abi/functions/Function.ts","../src/utils/makeFunction.ts","../src/utils/parseFunctions.ts","../src/utils/makeType.ts","../src/abi/types/ArrayType.ts","../src/abi/types/StrType.ts","../src/abi/types/B256Type.ts","../src/abi/types/B512Type.ts","../src/abi/types/BoolType.ts","../src/abi/types/BytesType.ts","../src/utils/extractStructName.ts","../src/abi/types/ResultType.ts","../src/abi/types/EnumType.ts","../src/abi/types/EvmAddressType.ts","../src/abi/types/GenericType.ts","../src/abi/types/U8Type.ts","../src/abi/types/U64Type.ts","../src/abi/types/RawUntypedPtr.ts","../src/abi/types/RawUntypedSlice.ts","../src/abi/types/StdStringType.ts","../src/abi/types/StrSliceType.ts","../src/abi/types/StructType.ts","../src/abi/types/TupleType.ts","../src/abi/types/U16Type.ts","../src/abi/types/U256Type.ts","../src/abi/types/U32Type.ts","../src/abi/types/VectorType.ts","../src/utils/supportedTypes.ts","../src/utils/shouldSkipAbiType.ts","../src/utils/parseTypes.ts","../src/utils/transpile-abi.ts","../src/abi/configurable/Configurable.ts","../src/types/enums/ProgramTypeEnum.ts","../src/utils/assembleContracts.ts","../src/templates/renderHbsTemplate.ts","../src/templates/common/_header.hbs","../src/templates/common/common.hbs","../src/templates/common/common.ts","../src/templates/common/index.hbs","../src/templates/common/index.ts","../src/templates/contract/factory.ts","../src/templates/contract/factory.hbs","../src/templates/utils/formatEnums.ts","../src/templates/utils/formatImports.ts","../src/templates/utils/formatStructs.ts","../src/templates/contract/main.hbs","../src/templates/contract/main.ts","../src/utils/assemblePredicates.ts","../src/templates/predicate/main.ts","../src/templates/predicate/main.hbs","../src/utils/assembleScripts.ts","../src/templates/script/main.ts","../src/templates/script/main.hbs","../src/utils/validateBinFile.ts","../src/utils/collectBinFilePaths.ts","../src/utils/collectStorageSlotsFilePaths.ts"],"sourcesContent":["import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { versions as builtinVersions, type BinaryVersions } from '@fuel-ts/versions';\nimport { readFileSync, writeFileSync } from 'fs';\nimport { globSync } from 'glob';\nimport { mkdirp } from 'mkdirp';\nimport { basename } from 'path';\nimport { rimrafSync } from 'rimraf';\n\nimport { AbiTypeGen } from './AbiTypeGen';\nimport type { ProgramTypeEnum } from './types/enums/ProgramTypeEnum';\nimport type { IFile } from './types/interfaces/IFile';\nimport { collectBinFilepaths } from './utils/collectBinFilePaths';\nimport { collectStorageSlotsFilepaths } from './utils/collectStorageSlotsFilePaths';\n\nexport interface IGenerateFilesParams {\n  cwd: string;\n  filepaths?: string[];\n  inputs?: string[];\n  output: string;\n  silent?: boolean;\n  programType: ProgramTypeEnum;\n  versions?: BinaryVersions;\n}\n\nexport function runTypegen(params: IGenerateFilesParams) {\n  const { cwd, inputs, output, silent, programType, filepaths: inputFilepaths } = params;\n  const versions: BinaryVersions = { FUELS: builtinVersions.FUELS, ...params.versions };\n\n  const cwdBasename = basename(cwd);\n\n  function log(...args: unknown[]) {\n    if (!silent) {\n      // eslint-disable-next-line no-console\n      console.log(args.join(' '));\n    }\n  }\n\n  /*\n    Assembling files array and expanding globals if needed\n  */\n  let filepaths: string[] = [];\n\n  if (!inputFilepaths?.length && inputs?.length) {\n    filepaths = inputs.flatMap((i) => globSync(i, { cwd }));\n  } else if (inputFilepaths?.length) {\n    filepaths = inputFilepaths;\n  } else {\n    throw new FuelError(\n      ErrorCode.MISSING_REQUIRED_PARAMETER,\n      `At least one parameter should be supplied: 'input' or 'filepaths'.`\n    );\n  }\n\n  /*\n    Assembling file paths x contents\n  */\n  const abiFiles = filepaths.map((filepath) => {\n    const contents = readFileSync(filepath, 'utf-8');\n    const abi: IFile = {\n      path: filepath,\n      contents,\n    };\n\n    return abi;\n  });\n\n  if (!abiFiles.length) {\n    throw new FuelError(ErrorCode.NO_ABIS_FOUND, `no ABI found at '${inputs}'`);\n  }\n\n  const binFiles = collectBinFilepaths({ filepaths, programType });\n\n  const storageSlotsFiles = collectStorageSlotsFilepaths({ filepaths, programType });\n\n  /*\n    Starting the engine\n  */\n  const abiTypeGen = new AbiTypeGen({\n    outputDir: output,\n    abiFiles,\n    binFiles,\n    storageSlotsFiles,\n    programType,\n    versions,\n  });\n\n  /*\n    Generating files\n  */\n  log('Generating files..\\n');\n\n  mkdirp.sync(`${output}`);\n\n  abiTypeGen.files.forEach((file) => {\n    rimrafSync(file.path);\n    writeFileSync(file.path, file.contents);\n    const trimPathRegex = new RegExp(`^.+${cwdBasename}/`, 'm');\n    log(` - ${file.path.replace(trimPathRegex, '')}`);\n  });\n\n  log('\\nDone.⚡');\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport type { BinaryVersions } from '@fuel-ts/versions';\n\nimport { Abi } from './abi/Abi';\nimport { ProgramTypeEnum } from './types/enums/ProgramTypeEnum';\nimport type { IFile } from './types/interfaces/IFile';\nimport { assembleContracts } from './utils/assembleContracts';\nimport { assemblePredicates } from './utils/assemblePredicates';\nimport { assembleScripts } from './utils/assembleScripts';\nimport { validateBinFile } from './utils/validateBinFile';\n\n/*\n  Manages many instances of Abi\n*/\nexport class AbiTypeGen {\n  public readonly abis: Abi[];\n  public readonly abiFiles: IFile[];\n  public readonly binFiles: IFile[];\n  public readonly storageSlotsFiles: IFile[];\n  public readonly outputDir: string;\n  public readonly files: IFile[];\n  public readonly versions: BinaryVersions;\n\n  constructor(params: {\n    abiFiles: IFile[];\n    binFiles: IFile[];\n    storageSlotsFiles: IFile[];\n    outputDir: string;\n    programType: ProgramTypeEnum;\n    versions: BinaryVersions;\n  }) {\n    const { abiFiles, binFiles, outputDir, programType, storageSlotsFiles, versions } = params;\n\n    this.outputDir = outputDir;\n\n    this.abiFiles = abiFiles;\n    this.binFiles = binFiles;\n    this.storageSlotsFiles = storageSlotsFiles;\n    this.versions = versions;\n\n    // Creates a `Abi` for each abi file\n    this.abis = this.abiFiles.map((abiFile) => {\n      const binFilepath = abiFile.path.replace('-abi.json', '.bin');\n      const relatedBinFile = this.binFiles.find(({ path }) => path === binFilepath);\n\n      const storageSlotFilepath = abiFile.path.replace('-abi.json', '-storage_slots.json');\n      const relatedStorageSlotsFile = this.storageSlotsFiles.find(\n        ({ path }) => path === storageSlotFilepath\n      );\n\n      if (!relatedBinFile) {\n        validateBinFile({\n          abiFilepath: abiFile.path,\n          binExists: !!relatedBinFile,\n          binFilepath,\n          programType,\n        });\n      }\n\n      const abi = new Abi({\n        filepath: abiFile.path,\n        rawContents: JSON.parse(abiFile.contents as string),\n        hexlifiedBinContents: relatedBinFile?.contents,\n        storageSlotsContents: relatedStorageSlotsFile?.contents,\n        outputDir,\n        programType,\n      });\n\n      return abi;\n    });\n\n    // Assemble list of files to be written to disk\n    this.files = this.getAssembledFiles({ programType });\n  }\n\n  private getAssembledFiles(params: { programType: ProgramTypeEnum }): IFile[] {\n    const { abis, outputDir, versions } = this;\n    const { programType } = params;\n\n    switch (programType) {\n      case ProgramTypeEnum.CONTRACT:\n        return assembleContracts({ abis, outputDir, versions });\n      case ProgramTypeEnum.SCRIPT:\n        return assembleScripts({ abis, outputDir, versions });\n      case ProgramTypeEnum.PREDICATE:\n        return assemblePredicates({ abis, outputDir, versions });\n      default:\n        throw new FuelError(\n          ErrorCode.INVALID_INPUT_PARAMETERS,\n          `Invalid Typegen programType: ${programType}. Must be one of ${Object.values(\n            ProgramTypeEnum\n          )}`\n        );\n    }\n  }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { normalizeString } from '@fuel-ts/utils';\n\nimport type { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum';\nimport type { IConfigurable } from '../types/interfaces/IConfigurable';\nimport type { IErrorCode } from '../types/interfaces/IErrorCode';\nimport type { IFunction } from '../types/interfaces/IFunction';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiOld } from '../types/interfaces/JsonAbi';\nimport type { JsonAbi } from '../types/interfaces/JsonAbiNew';\nimport { parseErrorCodes } from '../utils/parseErrorCodes';\nimport { parseFunctions } from '../utils/parseFunctions';\nimport { parseTypes } from '../utils/parseTypes';\nimport { transpileAbi } from '../utils/transpile-abi';\n\nimport { Configurable } from './configurable/Configurable';\n\n/*\n  Manages many instances of Types and Functions\n*/\nexport class Abi {\n  public capitalizedName: string;\n  public camelizedName: string;\n  public programType: ProgramTypeEnum;\n\n  public filepath: string;\n  public outputDir: string;\n\n  public commonTypesInUse: string[] = [];\n\n  public rawContents: JsonAbi;\n  public hexlifiedBinContents?: string;\n  public storageSlotsContents?: string;\n\n  public types: IType[];\n  public functions: IFunction[];\n  public configurables: IConfigurable[];\n  public errorCodes?: IErrorCode[];\n\n  constructor(params: {\n    filepath: string;\n    programType: ProgramTypeEnum;\n    rawContents: JsonAbi;\n    hexlifiedBinContents?: string;\n    storageSlotsContents?: string;\n    outputDir: string;\n  }) {\n    const {\n      filepath,\n      outputDir,\n      rawContents,\n      hexlifiedBinContents,\n      programType,\n      storageSlotsContents,\n    } = params;\n\n    const abiNameRegex = /([^/]+)-abi\\.json$/m;\n    const abiName = filepath.match(abiNameRegex);\n\n    const couldNotParseName = !abiName || abiName.length === 0;\n\n    if (couldNotParseName) {\n      throw new FuelError(\n        ErrorCode.PARSE_FAILED,\n        `Could not parse name from ABI file: ${filepath}.`\n      );\n    }\n\n    this.programType = programType;\n    this.capitalizedName = `${normalizeString(abiName[1])}`;\n    this.camelizedName = this.capitalizedName.replace(/^./m, (x) => x.toLowerCase());\n\n    this.filepath = filepath;\n    this.rawContents = rawContents;\n    this.hexlifiedBinContents = hexlifiedBinContents;\n    this.storageSlotsContents = storageSlotsContents;\n    this.outputDir = outputDir;\n\n    const { types, functions, configurables, errorCodes } = this.parse();\n\n    this.types = types;\n    this.functions = functions;\n    this.configurables = configurables;\n    this.errorCodes = errorCodes;\n\n    this.computeCommonTypesInUse();\n  }\n\n  parse() {\n    const transpiled = transpileAbi(this.rawContents) as JsonAbiOld;\n    const {\n      types: rawAbiTypes,\n      functions: rawAbiFunctions,\n      configurables: rawAbiConfigurables,\n      errorCodes: rawErrorCodes,\n    } = transpiled;\n\n    const types = parseTypes({ rawAbiTypes });\n    const functions = parseFunctions({ rawAbiFunctions, types });\n    const configurables = rawAbiConfigurables.map(\n      (rawAbiConfigurable) => new Configurable({ types, rawAbiConfigurable })\n    );\n    const errorCodes = parseErrorCodes({ rawErrorCodes, types });\n\n    return {\n      types,\n      functions,\n      configurables,\n      errorCodes,\n    };\n  }\n\n  computeCommonTypesInUse() {\n    const customTypesTable: Record<string, string> = {\n      option: 'Option',\n      enum: 'Enum',\n      vector: 'Vec',\n      result: 'Result',\n    };\n\n    this.commonTypesInUse = [];\n\n    Object.keys(customTypesTable).forEach((typeName) => {\n      const isInUse = !!this.types.find((t) => t.name === typeName);\n\n      if (isInUse) {\n        const commonTypeLabel: string = customTypesTable[typeName];\n        this.commonTypesInUse.push(commonTypeLabel);\n      }\n    });\n  }\n}\n","import type { IErrorCode } from '../../types/interfaces/IErrorCode';\n\nexport class ErrorCode {\n  public code: string;\n  public value: IErrorCode['value'];\n\n  constructor(params: IErrorCode) {\n    this.code = params.code;\n    this.value = params.value;\n  }\n}\n","import { ErrorCode } from '../abi/errors/ErrorCode';\nimport type { IErrorCode } from '../types/interfaces/IErrorCode';\n\nexport function makeErrorCode(params: IErrorCode) {\n  return new ErrorCode(params);\n}\n","import type { ErrorCode } from '../abi/errors/ErrorCode';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiErrorCode } from '../types/interfaces/JsonAbi';\n\nimport { makeErrorCode } from './makeErrorCodes';\n\nexport function parseErrorCodes(params: {\n  types: IType[];\n  rawErrorCodes?: Record<string, JsonAbiErrorCode>;\n}) {\n  // const { types, rawErrorCodes } = params;\n  const { rawErrorCodes } = params;\n  const errorCodes: ErrorCode[] = Object.entries(rawErrorCodes ?? {}).map(([code, value]) =>\n    makeErrorCode({ code, value })\n  );\n\n  return errorCodes;\n}\n","import type { ITypeAttributes } from '../../types/interfaces/IType';\nimport type { JsonAbiType } from '../../types/interfaces/JsonAbi';\n\nexport class AType {\n  public rawAbiType: JsonAbiType;\n  public attributes: ITypeAttributes;\n  public requiredFuelsMembersImports: string[];\n\n  constructor(params: { rawAbiType: JsonAbiType }) {\n    this.rawAbiType = params.rawAbiType;\n    this.attributes = {\n      inputLabel: 'unknown',\n      outputLabel: 'unknown',\n    };\n    this.requiredFuelsMembersImports = [];\n  }\n}\n","import type { JsonAbiType } from '../..';\nimport type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class EmptyType extends AType implements IType {\n  public static swayType = '()';\n\n  public name = 'empty';\n\n  static MATCH_REGEX: RegExp = /^\\(\\)$/m;\n\n  constructor(params: { rawAbiType: JsonAbiType }) {\n    super(params);\n    this.attributes = {\n      inputLabel: 'undefined',\n      outputLabel: 'void',\n    };\n  }\n\n  static isSuitableFor(params: { type: string }) {\n    return EmptyType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class OptionType extends AType implements IType {\n  public static swayType = 'enum Option';\n\n  public name = 'option';\n\n  static MATCH_REGEX: RegExp = /^enum (std::option::)?Option$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return OptionType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    this.attributes = {\n      inputLabel: `Option`,\n      outputLabel: `Option`,\n    };\n    return this.attributes;\n  }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { IType } from '../types/interfaces/IType';\n\nexport function findType(params: { types: IType[]; typeId: number }) {\n  const { types, typeId } = params;\n\n  const foundType = types.find(({ rawAbiType: { typeId: tid } }) => tid === typeId);\n\n  if (!foundType) {\n    throw new FuelError(ErrorCode.TYPE_ID_NOT_FOUND, `Type ID not found: ${typeId}.`);\n  }\n\n  // ensure type attributes is always parsed\n  foundType.parseComponentsAttributes({ types });\n\n  return foundType;\n}\n","import { EmptyType } from '../abi/types/EmptyType';\nimport { OptionType } from '../abi/types/OptionType';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiArgument } from '../types/interfaces/JsonAbi';\n\nimport { findType } from './findType';\n\nexport type FunctionInput<TArg extends JsonAbiArgument = JsonAbiArgument> = TArg & {\n  isOptional: boolean;\n};\n\nexport const getFunctionInputs = (params: {\n  types: IType[];\n  inputs: readonly JsonAbiArgument[];\n}): Array<FunctionInput> => {\n  const { types, inputs } = params;\n  let isMandatory = false;\n\n  return inputs.reduceRight((result, input) => {\n    const type = findType({ types, typeId: input.type });\n    const isTypeMandatory =\n      !EmptyType.isSuitableFor({ type: type.rawAbiType.type }) &&\n      !OptionType.isSuitableFor({ type: type.rawAbiType.type });\n\n    isMandatory = isMandatory || isTypeMandatory;\n    return [{ ...input, isOptional: !isMandatory }, ...result];\n  }, [] as FunctionInput[]);\n};\n","import type { TargetEnum } from '../types/enums/TargetEnum';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiArgument } from '../types/interfaces/JsonAbi';\n\nimport { findType } from './findType';\n\n/*\n  Recursively parses the given `typeArguments` node\n*/\nexport function parseTypeArguments(params: {\n  types: IType[];\n  target: TargetEnum;\n  typeArguments: readonly JsonAbiArgument[];\n  parentTypeId?: number;\n}): string {\n  const { types, typeArguments, parentTypeId, target } = params;\n\n  const attributeKey: 'inputLabel' | 'outputLabel' = `${target}Label`;\n\n  const buffer: string[] = [];\n\n  let parentType: IType | undefined;\n  let parentLabel: string | undefined;\n\n  if (parentTypeId !== undefined) {\n    parentType = findType({ types, typeId: parentTypeId });\n    parentLabel = parentType.attributes[attributeKey];\n  }\n\n  // loop through all `typeArgument` items\n  typeArguments.forEach((typeArgument) => {\n    const currentTypeId = typeArgument.type;\n\n    const currentType = findType({ types, typeId: currentTypeId });\n    const currentLabel = currentType.attributes[attributeKey];\n\n    if (typeArgument.typeArguments) {\n      // recursively process nested `typeArguments`\n      const nestedParsed = parseTypeArguments({\n        types,\n        target,\n        parentTypeId: typeArgument.type,\n        typeArguments: typeArgument.typeArguments as JsonAbiArgument[],\n      });\n\n      buffer.push(nestedParsed);\n    } else {\n      buffer.push(`${currentLabel}`);\n    }\n  });\n\n  let output = buffer.join(', ');\n\n  if (parentLabel) {\n    output = `${parentLabel}<${output}>`;\n  }\n\n  return output;\n}\n","import { TargetEnum } from '../types/enums/TargetEnum';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiArgument } from '../types/interfaces/JsonAbi';\n\nimport { findType } from './findType';\nimport { parseTypeArguments } from './parseTypeArguments';\n\nexport function resolveInputLabel(\n  types: IType[],\n  typeId: number,\n  typeArguments: JsonAbiArgument['typeArguments']\n) {\n  const type = findType({ types, typeId });\n\n  let typeDecl: string;\n\n  if (typeArguments?.length) {\n    // recursively process child `typeArguments`\n    typeDecl = parseTypeArguments({\n      types,\n      target: TargetEnum.INPUT,\n      parentTypeId: typeId,\n      typeArguments,\n    });\n  } else {\n    // or just collect type declaration\n    typeDecl = type.attributes.inputLabel;\n  }\n\n  return typeDecl;\n}\n","import type { IFunction, JsonAbiFunction, IFunctionAttributes } from '../../index';\nimport { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\nimport { getFunctionInputs } from '../../utils/getFunctionInputs';\nimport { resolveInputLabel } from '../../utils/getTypeDeclaration';\nimport { parseTypeArguments } from '../../utils/parseTypeArguments';\n\nexport class Function implements IFunction {\n  public name: string;\n  public types: IType[];\n  public rawAbiFunction: JsonAbiFunction;\n  public attributes: IFunctionAttributes;\n\n  constructor(params: { types: IType[]; rawAbiFunction: JsonAbiFunction }) {\n    this.rawAbiFunction = params.rawAbiFunction;\n    this.types = params.types;\n    this.name = params.rawAbiFunction.name;\n\n    this.attributes = {\n      inputs: this.bundleInputTypes(),\n      output: this.bundleOutputTypes(),\n      prefixedInputs: this.bundleInputTypes(true),\n    };\n  }\n\n  bundleInputTypes(shouldPrefixParams: boolean = false) {\n    const { types } = this;\n\n    // loop through all mandatory inputs\n    const inputs = getFunctionInputs({ types, inputs: this.rawAbiFunction.inputs }).map(\n      ({ isOptional, ...input }) => {\n        const { name, type: typeId, typeArguments } = input;\n\n        const typeDecl = resolveInputLabel(types, typeId, typeArguments);\n\n        // assemble it in `[key: string]: <Type>` fashion\n        if (shouldPrefixParams) {\n          const optionalSuffix = isOptional ? '?' : '';\n          return `${name}${optionalSuffix}: ${typeDecl}`;\n        }\n\n        return typeDecl;\n      }\n    );\n\n    return inputs.join(', ');\n  }\n\n  bundleOutputTypes() {\n    return parseTypeArguments({\n      types: this.types,\n      target: TargetEnum.OUTPUT,\n      typeArguments: [this.rawAbiFunction.output],\n    });\n  }\n\n  getDeclaration() {\n    const { name } = this;\n    const { prefixedInputs, output } = this.attributes;\n    const decl = `${name}: InvokeFunction<[${prefixedInputs}], ${output}>`;\n    return decl;\n  }\n}\n","import { Function } from '../abi/functions/Function';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiFunction } from '../types/interfaces/JsonAbi';\n\nexport function makeFunction(params: { types: IType[]; rawAbiFunction: JsonAbiFunction }) {\n  const { types, rawAbiFunction } = params;\n  return new Function({ types, rawAbiFunction });\n}\n","import type { IFunction } from '../types/interfaces/IFunction';\nimport type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiFunction } from '../types/interfaces/JsonAbi';\n\nimport { makeFunction } from './makeFunction';\n\nexport function parseFunctions(params: {\n  types: IType[];\n  rawAbiFunctions: readonly JsonAbiFunction[];\n}) {\n  const { types, rawAbiFunctions } = params;\n  const functions: IFunction[] = rawAbiFunctions.map((rawAbiFunction) =>\n    makeFunction({ types, rawAbiFunction })\n  );\n  return functions;\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { JsonAbiType } from '../types/interfaces/JsonAbi';\n\nimport { supportedTypes } from './supportedTypes';\n\nexport function makeType(params: { rawAbiType: JsonAbiType }) {\n  const { rawAbiType } = params;\n  const { type } = rawAbiType;\n\n  const TypeClass = supportedTypes.find((tc) => tc.isSuitableFor({ type }));\n\n  if (!TypeClass) {\n    throw new FuelError(ErrorCode.TYPE_NOT_SUPPORTED, `Type not supported: ${type}`);\n  }\n\n  return new TypeClass(params);\n}\n","import { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\nimport { findType } from '../../utils/findType';\nimport { parseTypeArguments } from '../../utils/parseTypeArguments';\n\nimport { AType } from './AType';\n\nexport class ArrayType extends AType implements IType {\n  // Note: the array length expressed in '; 2]' could be any length\n  public static swayType = '[_; 2]';\n\n  public name = 'array';\n\n  static MATCH_REGEX: RegExp = /^\\[_; ([0-9]+)\\]$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return ArrayType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(params: { types: IType[] }) {\n    const { types } = params;\n    const { type } = this.rawAbiType;\n\n    // array length will be used to generated a fixed-length array type\n    const arrayLen = Number(type.match(ArrayType.MATCH_REGEX)?.[1]);\n\n    const inputs: string[] = [];\n    const outputs: string[] = [];\n\n    this.rawAbiType.components?.forEach((component) => {\n      const { type: typeId, typeArguments } = component;\n\n      if (!typeArguments) {\n        // if component has no type arguments, read its attributes and voilà\n        const { attributes } = findType({ types, typeId });\n\n        inputs.push(attributes.inputLabel);\n        outputs.push(attributes.outputLabel);\n      } else {\n        // otherwise process child `typeArguments` recursively\n        const inputLabel = parseTypeArguments({\n          types,\n          typeArguments,\n          parentTypeId: typeId,\n          target: TargetEnum.INPUT,\n        });\n\n        const outputLabel = parseTypeArguments({\n          types,\n          typeArguments,\n          parentTypeId: typeId,\n          target: TargetEnum.OUTPUT,\n        });\n\n        inputs.push(inputLabel);\n        outputs.push(outputLabel);\n      }\n    });\n\n    // fixed-length array, based on `arrayLen`\n    const inputTypes = Array(arrayLen).fill(inputs[0]).join(', ');\n    const outputTypes = Array(arrayLen).fill(outputs[0]).join(', ');\n\n    this.attributes = {\n      inputLabel: `[${inputTypes}]`,\n      outputLabel: `[${outputTypes}]`,\n    };\n\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class StrType extends AType implements IType {\n  // Note: the str length expressed in '[3]' could be any length\n  public static swayType = 'str[3]';\n\n  public name = 'str';\n\n  static MATCH_REGEX: RegExp = /^str\\[(.+)\\]$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return StrType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    this.attributes = {\n      inputLabel: 'string',\n      outputLabel: 'string',\n    };\n    return this.attributes;\n  }\n}\n","import { StrType } from './StrType';\n\nexport class B256Type extends StrType {\n  public static override swayType = 'b256';\n\n  public override name = 'b256';\n\n  static override MATCH_REGEX = /^b256$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return B256Type.MATCH_REGEX.test(params.type);\n  }\n}\n","import { B256Type } from './B256Type';\n\nexport class B512Type extends B256Type {\n  public static override swayType = 'struct B512';\n\n  public override name = 'b512';\n\n  static override MATCH_REGEX = /^struct (std::b512::)?B512$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return B512Type.MATCH_REGEX.test(params.type);\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class BoolType extends AType implements IType {\n  public static swayType = 'bool';\n\n  public name = 'bool';\n\n  static MATCH_REGEX: RegExp = /^bool$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return BoolType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    this.attributes = {\n      inputLabel: 'boolean',\n      outputLabel: 'boolean',\n    };\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { ArrayType } from './ArrayType';\n\nexport class BytesType extends ArrayType {\n  public static override swayType = 'struct Bytes';\n\n  public override name = 'bytes';\n\n  static override MATCH_REGEX: RegExp = /^struct (std::bytes::)?Bytes/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return BytesType.MATCH_REGEX.test(params.type);\n  }\n\n  public override parseComponentsAttributes(_params: { types: IType[] }) {\n    const capitalizedName = 'Bytes';\n\n    this.attributes = {\n      inputLabel: capitalizedName,\n      outputLabel: capitalizedName,\n    };\n\n    this.requiredFuelsMembersImports = [capitalizedName];\n\n    return this.attributes;\n  }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport type { JsonAbiType } from '../types/interfaces/JsonAbi';\n\nexport function extractStructName(params: { rawAbiType: JsonAbiType; regex: RegExp }) {\n  const { rawAbiType, regex } = params;\n\n  const matches = rawAbiType.type.match(regex);\n  const match = matches?.[2] ?? matches?.[1];\n\n  if (!match) {\n    let errorMessage = `Couldn't extract struct name with: '${regex}'.\\n\\n`;\n    errorMessage += `Check your JSON ABI.\\n\\n[source]\\n`;\n    errorMessage += `${JSON.stringify(rawAbiType, null, 2)}`;\n\n    throw new FuelError(ErrorCode.JSON_ABI_ERROR, errorMessage);\n  }\n\n  return match;\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class ResultType extends AType implements IType {\n  public static swayType = 'enum Result';\n\n  public name = 'result';\n\n  static MATCH_REGEX: RegExp = /^enum (std::result::)?Result$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return ResultType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    this.attributes = {\n      inputLabel: `Result`,\n      outputLabel: `Result`,\n    };\n    return this.attributes;\n  }\n}\n","import type { JsonAbiArgument } from '../../index';\nimport type { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\nimport { extractStructName } from '../../utils/extractStructName';\nimport { findType } from '../../utils/findType';\nimport { parseTypeArguments } from '../../utils/parseTypeArguments';\n\nimport { AType } from './AType';\nimport { EmptyType } from './EmptyType';\nimport { OptionType } from './OptionType';\nimport { ResultType } from './ResultType';\n\nexport class EnumType extends AType implements IType {\n  public static swayType = 'enum MyEnumName';\n\n  public name = 'enum';\n\n  static MATCH_REGEX: RegExp = /^enum (.+::)?(.+)$/m;\n  static IGNORE_REGEXES: RegExp[] = [OptionType.MATCH_REGEX, ResultType.MATCH_REGEX];\n\n  static isSuitableFor(params: { type: string }) {\n    const isAMatch = EnumType.MATCH_REGEX.test(params.type);\n    const shouldBeIgnored = EnumType.IGNORE_REGEXES.some((r) => r.test(params.type));\n    return isAMatch && !shouldBeIgnored;\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    const structName = this.getStructName();\n\n    this.attributes = {\n      structName,\n      inputLabel: `${structName}Input`,\n      outputLabel: `${structName}Output`,\n    };\n\n    return this.attributes;\n  }\n\n  public getStructName() {\n    const name = extractStructName({\n      rawAbiType: this.rawAbiType,\n      regex: EnumType.MATCH_REGEX,\n    });\n    return name;\n  }\n\n  public getNativeEnum(params: { types: IType[] }) {\n    const { types } = params;\n\n    const typeHash: { [key: number]: IType['rawAbiType']['type'] } = types.reduce(\n      (hash, row) => ({\n        ...hash,\n        [row.rawAbiType.typeId]: row.rawAbiType.type,\n      }),\n      {}\n    );\n\n    const { components } = this.rawAbiType;\n\n    // `components` array guaranteed to always exist for structs/enums\n    const enumComponents = components as JsonAbiArgument[];\n\n    if (!enumComponents.every(({ type }) => typeHash[type] === EmptyType.swayType)) {\n      return undefined;\n    }\n\n    return enumComponents.map(({ name }) => `${name} = '${name}'`).join(', ');\n  }\n\n  public getStructContents(params: { types: IType[]; target: TargetEnum }) {\n    const { types, target } = params;\n\n    const { components } = this.rawAbiType;\n\n    // `components` array guaranteed to always exist for structs/enums\n    const enumComponents = components as JsonAbiArgument[];\n\n    const attributeKey: 'inputLabel' | 'outputLabel' = `${target}Label`;\n\n    const contents = enumComponents.map((component) => {\n      const { name, type: typeId, typeArguments } = component;\n\n      if (typeId === 0) {\n        return `${name}: []`;\n      }\n\n      const type = findType({ types, typeId });\n      let typeDecl: string;\n\n      if (typeArguments) {\n        // recursively process child `typeArguments`\n        typeDecl = parseTypeArguments({\n          types,\n          target,\n          parentTypeId: typeId,\n          typeArguments,\n        });\n      } else {\n        // or just collect type declaration\n        typeDecl = type.attributes[attributeKey];\n      }\n\n      return `${name}: ${typeDecl}`;\n    });\n\n    return contents.join(', ');\n  }\n\n  public getStructDeclaration(params: { types: IType[] }) {\n    const { types } = params;\n    const { typeParameters } = this.rawAbiType;\n\n    if (typeParameters) {\n      const structs = typeParameters.map((typeId) => findType({ types, typeId }));\n\n      const labels = structs.map(({ attributes: { inputLabel } }) => inputLabel);\n\n      return `<${labels.join(', ')}>`;\n    }\n\n    return '';\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class EvmAddressType extends AType implements IType {\n  public static swayType = 'struct EvmAddress';\n\n  public name = 'evmAddress';\n\n  static MATCH_REGEX: RegExp = /^struct (std::vm::evm::evm_address::)?EvmAddress$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return EvmAddressType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    const capitalizedName = 'EvmAddress';\n\n    this.attributes = {\n      inputLabel: capitalizedName,\n      outputLabel: capitalizedName,\n    };\n\n    this.requiredFuelsMembersImports = [capitalizedName];\n\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\nimport { extractStructName } from '../../utils/extractStructName';\n\nimport { AType } from './AType';\n\nexport class GenericType extends AType implements IType {\n  public static swayType = 'generic T';\n\n  public name = 'generic';\n\n  static MATCH_REGEX: RegExp = /^generic ([^\\s]+)$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return GenericType.MATCH_REGEX.test(params.type);\n  }\n\n  public getStructName() {\n    const name = extractStructName({\n      rawAbiType: this.rawAbiType,\n      regex: GenericType.MATCH_REGEX,\n    });\n    return name;\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    const label = this.getStructName();\n\n    this.attributes = {\n      inputLabel: label,\n      outputLabel: label,\n    };\n\n    return this.attributes;\n  }\n}\n","import type { JsonAbiType } from '../../index';\nimport type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class U8Type extends AType implements IType {\n  public static swayType = 'u8';\n\n  public name = 'u8';\n\n  public static MATCH_REGEX: RegExp = /^u8$/m;\n\n  constructor(params: { rawAbiType: JsonAbiType }) {\n    super(params);\n    this.attributes = {\n      inputLabel: `BigNumberish`,\n      outputLabel: `number`,\n    };\n    this.requiredFuelsMembersImports = [this.attributes.inputLabel];\n  }\n\n  static isSuitableFor(params: { type: string }) {\n    return U8Type.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { U8Type } from './U8Type';\n\nexport class U64Type extends U8Type implements IType {\n  public static override swayType = 'u64';\n\n  public override name = 'u64';\n\n  public static override MATCH_REGEX: RegExp = /^u64$/m;\n\n  public override parseComponentsAttributes(_params: { types: IType[] }) {\n    this.attributes = {\n      inputLabel: `BigNumberish`,\n      outputLabel: `BN`,\n    };\n    this.requiredFuelsMembersImports = Object.values(this.attributes);\n    return this.attributes;\n  }\n\n  static override isSuitableFor(params: { type: string }) {\n    return U64Type.MATCH_REGEX.test(params.type);\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { U64Type } from './U64Type';\n\nexport class RawUntypedPtr extends U64Type implements IType {\n  public static override swayType = 'raw untyped ptr';\n\n  public override name = 'rawUntypedPtr';\n\n  public static override MATCH_REGEX: RegExp = /^raw untyped ptr$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return RawUntypedPtr.MATCH_REGEX.test(params.type);\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { ArrayType } from './ArrayType';\n\nexport class RawUntypedSlice extends ArrayType {\n  public static override swayType = 'raw untyped slice';\n\n  public override name = 'rawUntypedSlice';\n\n  public static override MATCH_REGEX: RegExp = /^raw untyped slice$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return RawUntypedSlice.MATCH_REGEX.test(params.type);\n  }\n\n  public override parseComponentsAttributes(_params: { types: IType[] }) {\n    const capitalizedName = 'RawSlice';\n\n    this.attributes = {\n      inputLabel: capitalizedName,\n      outputLabel: capitalizedName,\n    };\n\n    this.requiredFuelsMembersImports = [capitalizedName];\n\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class StdStringType extends AType implements IType {\n  public static swayType = 'struct String';\n\n  public name = 'stdString';\n\n  static MATCH_REGEX: RegExp = /^struct (std::string::)?String/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return StdStringType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    const capitalizedName = 'StdString';\n\n    this.attributes = {\n      inputLabel: capitalizedName,\n      outputLabel: capitalizedName,\n    };\n\n    this.requiredFuelsMembersImports = [capitalizedName];\n\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { AType } from './AType';\n\nexport class StrSliceType extends AType implements IType {\n  public static swayType = 'str';\n\n  public name = 'strSlice';\n\n  static MATCH_REGEX: RegExp = /^str$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return StrSliceType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    const capitalizedName = 'StrSlice';\n\n    this.attributes = {\n      inputLabel: capitalizedName,\n      outputLabel: capitalizedName,\n    };\n\n    this.requiredFuelsMembersImports = [capitalizedName];\n\n    return this.attributes;\n  }\n}\n","import type { JsonAbiArgument } from '../../index';\nimport type { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\nimport { extractStructName } from '../../utils/extractStructName';\nimport { findType } from '../../utils/findType';\nimport { parseTypeArguments } from '../../utils/parseTypeArguments';\n\nimport { AType } from './AType';\n\nexport class StructType extends AType implements IType {\n  public static swayType = 'struct MyStruct';\n\n  public name = 'struct';\n\n  static MATCH_REGEX: RegExp = /^struct (.+::)?(.+)$/m;\n  static IGNORE_REGEX: RegExp = /^struct (std::.*)?(Vec|RawVec|EvmAddress|Bytes|String|RawBytes)$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    const isAMatch = StructType.MATCH_REGEX.test(params.type);\n    const shouldBeIgnored = StructType.IGNORE_REGEX.test(params.type);\n    return isAMatch && !shouldBeIgnored;\n  }\n\n  public parseComponentsAttributes(_params: { types: IType[] }) {\n    const structName = this.getStructName();\n\n    this.attributes = {\n      structName,\n      inputLabel: `${structName}Input`,\n      outputLabel: `${structName}Output`,\n    };\n\n    return this.attributes;\n  }\n\n  public getStructName() {\n    const name = extractStructName({\n      rawAbiType: this.rawAbiType,\n      regex: StructType.MATCH_REGEX,\n    });\n    return name;\n  }\n\n  public getStructContents(params: { types: IType[]; target: TargetEnum }) {\n    const { types, target } = params;\n    const { components } = this.rawAbiType;\n\n    // `components` array guaranteed to always exist for structs/enums\n    const structComponents = components as JsonAbiArgument[];\n\n    // loop through all components\n    const members = structComponents.map((component) => {\n      const { name, type: typeId, typeArguments } = component;\n\n      const type = findType({ types, typeId });\n\n      let typeDecl: string;\n\n      if (typeArguments) {\n        // recursively process child `typeArguments`\n        typeDecl = parseTypeArguments({\n          types,\n          target,\n          parentTypeId: typeId,\n          typeArguments,\n        });\n      } else {\n        // or just collect type declaration\n        const attributeKey: 'inputLabel' | 'outputLabel' = `${target}Label`;\n        typeDecl = type.attributes[attributeKey];\n      }\n\n      // assemble it in `[key: string]: <Type>` fashion\n      return `${name}: ${typeDecl}`;\n    });\n\n    return members.join(', ');\n  }\n\n  public getStructDeclaration(params: { types: IType[] }) {\n    const { types } = params;\n    const { typeParameters } = this.rawAbiType;\n\n    if (typeParameters) {\n      const structs = typeParameters.map((typeId) => findType({ types, typeId }));\n\n      const labels = structs.map(({ attributes: { inputLabel } }) => inputLabel);\n\n      return `<${labels.join(', ')}>`;\n    }\n\n    return '';\n  }\n}\n","import { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\nimport { findType } from '../../utils/findType';\nimport { parseTypeArguments } from '../../utils/parseTypeArguments';\n\nimport { AType } from './AType';\n\nexport class TupleType extends AType implements IType {\n  // Note: a tuple can have more/less than 3x items (like the one bellow)\n  public static swayType = '(_, _, _)';\n\n  public name = 'tupple';\n\n  static MATCH_REGEX: RegExp = /^\\([_,\\s]+\\)$/m;\n\n  static isSuitableFor(params: { type: string }) {\n    return TupleType.MATCH_REGEX.test(params.type);\n  }\n\n  public parseComponentsAttributes(params: { types: IType[] }) {\n    const { types } = params;\n\n    const inputs: string[] = [];\n    const outputs: string[] = [];\n\n    this.rawAbiType.components?.forEach((component) => {\n      const { type: typeId, typeArguments } = component;\n\n      if (!typeArguments) {\n        // if component has no type arguments, read its attributes and voilà\n        const { attributes } = findType({ types, typeId });\n\n        inputs.push(attributes.inputLabel);\n        outputs.push(attributes.outputLabel);\n      } else {\n        // otherwise process child `typeArguments` recursively\n        const inputLabel = parseTypeArguments({\n          types,\n          typeArguments,\n          parentTypeId: typeId,\n          target: TargetEnum.INPUT,\n        });\n\n        const outputLabel = parseTypeArguments({\n          types,\n          typeArguments,\n          parentTypeId: typeId,\n          target: TargetEnum.OUTPUT,\n        });\n\n        inputs.push(inputLabel);\n        outputs.push(outputLabel);\n      }\n    });\n\n    this.attributes = {\n      inputLabel: `[${inputs.join(', ')}]`,\n      outputLabel: `[${outputs.join(', ')}]`,\n    };\n\n    return this.attributes;\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { U8Type } from './U8Type';\n\nexport class U16Type extends U8Type implements IType {\n  public static override swayType = 'u16';\n\n  public override name = 'u16';\n\n  public static override MATCH_REGEX: RegExp = /^u16$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return U16Type.MATCH_REGEX.test(params.type);\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { U64Type } from './U64Type';\n\nexport class U256Type extends U64Type implements IType {\n  public static override swayType = 'u256';\n\n  public override name = 'u256';\n\n  public static override MATCH_REGEX: RegExp = /^u256$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return U256Type.MATCH_REGEX.test(params.type);\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { U8Type } from './U8Type';\n\nexport class U32Type extends U8Type implements IType {\n  public static override swayType = 'u32';\n\n  public override name = 'u32';\n\n  public static override MATCH_REGEX: RegExp = /^u32$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    return U32Type.MATCH_REGEX.test(params.type);\n  }\n}\n","import type { IType } from '../../types/interfaces/IType';\n\nimport { ArrayType } from './ArrayType';\n\nexport class VectorType extends ArrayType {\n  public static override swayType = 'struct Vec';\n\n  public override name = 'vector';\n\n  static override MATCH_REGEX: RegExp = /^struct (std::vec::)?Vec/m;\n  static IGNORE_REGEX: RegExp = /^struct (std::vec::)?RawVec$/m;\n\n  static override isSuitableFor(params: { type: string }) {\n    const isAMatch = VectorType.MATCH_REGEX.test(params.type);\n    const shouldBeIgnored = VectorType.IGNORE_REGEX.test(params.type);\n    return isAMatch && !shouldBeIgnored;\n  }\n\n  public override parseComponentsAttributes(_params: { types: IType[] }) {\n    this.attributes = {\n      inputLabel: `Vec`,\n      outputLabel: `Vec`,\n    };\n    return this.attributes;\n  }\n}\n","import { ArrayType } from '../abi/types/ArrayType';\nimport { B256Type } from '../abi/types/B256Type';\nimport { B512Type } from '../abi/types/B512Type';\nimport { BoolType } from '../abi/types/BoolType';\nimport { BytesType } from '../abi/types/BytesType';\nimport { EmptyType } from '../abi/types/EmptyType';\nimport { EnumType } from '../abi/types/EnumType';\nimport { EvmAddressType } from '../abi/types/EvmAddressType';\nimport { GenericType } from '../abi/types/GenericType';\nimport { OptionType } from '../abi/types/OptionType';\nimport { RawUntypedPtr } from '../abi/types/RawUntypedPtr';\nimport { RawUntypedSlice } from '../abi/types/RawUntypedSlice';\nimport { ResultType } from '../abi/types/ResultType';\nimport { StdStringType } from '../abi/types/StdStringType';\nimport { StrSliceType } from '../abi/types/StrSliceType';\nimport { StrType } from '../abi/types/StrType';\nimport { StructType } from '../abi/types/StructType';\nimport { TupleType } from '../abi/types/TupleType';\nimport { U16Type } from '../abi/types/U16Type';\nimport { U256Type } from '../abi/types/U256Type';\nimport { U32Type } from '../abi/types/U32Type';\nimport { U64Type } from '../abi/types/U64Type';\nimport { U8Type } from '../abi/types/U8Type';\nimport { VectorType } from '../abi/types/VectorType';\n\nexport const supportedTypes = [\n  EmptyType,\n  ArrayType,\n  B256Type,\n  B512Type,\n  BoolType,\n  BytesType,\n  EnumType,\n  GenericType,\n  OptionType,\n  RawUntypedPtr,\n  RawUntypedSlice,\n  StdStringType,\n  StrType,\n  StrSliceType,\n  StructType,\n  TupleType,\n  U16Type,\n  U32Type,\n  U64Type,\n  U256Type,\n  U8Type,\n  VectorType,\n  EvmAddressType,\n  ResultType,\n];\n","export function shouldSkipAbiType(params: { type: string }) {\n  const ignoreList = [\n    'struct RawVec',\n    'struct std::vec::RawVec',\n    'struct RawBytes',\n    'struct std::bytes::RawBytes',\n  ];\n  const shouldSkip = ignoreList.indexOf(params.type) >= 0;\n  return shouldSkip;\n}\n","import type { IType } from '../types/interfaces/IType';\nimport type { JsonAbiType } from '../types/interfaces/JsonAbi';\n\nimport { makeType } from './makeType';\nimport { shouldSkipAbiType } from './shouldSkipAbiType';\n\nexport function parseTypes(params: { rawAbiTypes: readonly JsonAbiType[] }) {\n  const types: IType[] = [];\n\n  // First we parse all ROOT nodes\n  params.rawAbiTypes.forEach((rawAbiType) => {\n    const { type } = rawAbiType;\n    const skip = shouldSkipAbiType({ type });\n    if (!skip) {\n      const parsedType = makeType({ rawAbiType });\n      types.push(parsedType);\n    }\n  });\n\n  // Then we parse all their components' [attributes]\n  types.forEach((type) => {\n    type.parseComponentsAttributes({ types });\n  });\n\n  return types;\n}\n","/* eslint-disable no-restricted-globals */\n/* eslint-disable no-param-reassign */\n/* eslint-disable @typescript-eslint/no-use-before-define */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\n\nconst findTypeByConcreteId = (types, id) => types.find((x) => x.concreteTypeId === id);\n\nconst findConcreteTypeById = (abi, id) => abi.concreteTypes.find((x) => x.concreteTypeId === id);\n\nfunction finsertTypeIdByConcreteTypeId(abi, types, id) {\n  const concreteType = findConcreteTypeById(abi, id);\n\n  if (concreteType.metadataTypeId !== undefined) {\n    return concreteType.metadataTypeId;\n  }\n\n  const type = findTypeByConcreteId(types, id);\n  if (type) {\n    return type.typeId;\n  }\n\n  types.push({\n    typeId: types.length,\n    type: concreteType.type,\n    components: parseComponents(concreteType.components),\n    concreteTypeId: id,\n    typeParameters: concreteType.typeParameters ?? null,\n    originalConcreteTypeId: concreteType?.concreteTypeId,\n  });\n\n  return types.length - 1;\n}\n\nfunction parseFunctionTypeArguments(abi, types, concreteType) {\n  return (\n    concreteType.typeArguments?.map((cTypeId) => {\n      const self = findConcreteTypeById(abi, cTypeId);\n      const type = !isNaN(cTypeId) ? cTypeId : finsertTypeIdByConcreteTypeId(abi, types, cTypeId);\n      return {\n        name: '',\n        type,\n        // originalTypeId: cTypeId,\n        typeArguments: parseFunctionTypeArguments(abi, types, self),\n      };\n    }) ?? null\n  );\n}\n\nexport function parseConcreteType(abi, types, concreteTypeId, name) {\n  const type = finsertTypeIdByConcreteTypeId(abi, types, concreteTypeId);\n  const concrete = findConcreteTypeById(abi, concreteTypeId);\n  return {\n    name: name ?? '',\n    type,\n    // concreteTypeId,\n    typeArguments: parseFunctionTypeArguments(abi, types, concrete),\n  };\n}\n\nfunction parseComponents(abi, types, components) {\n  return (\n    components?.map((component) => {\n      const { typeId, name, typeArguments } = component;\n      const type = !isNaN(typeId) ? typeId : finsertTypeIdByConcreteTypeId(abi, types, typeId);\n      return {\n        name,\n        type,\n        // originalTypeId: typeId,\n        typeArguments: parseComponents(abi, types, typeArguments),\n      };\n    }) ?? null\n  );\n}\n\n/**\n * This will transpile new ABIs (spec: \"1\") to the old format.\n *\n * The new format got these new props:\n *    - `specVersion`,\n *    - `concreteTypes`\n *    - `metadataTypes`\n *\n * The old format contains only:\n *    - `types`\n */\nexport function transpileAbi(abi) {\n  // do not transpile older versions\n  if (!abi.specVersion) {\n    return abi;\n  }\n\n  // 0. define empty types array\n  const types = [];\n\n  // 1. root level of metadata types\n  abi.metadataTypes.forEach((m) => {\n    const t = {\n      typeId: m.metadataTypeId,\n      type: m.type,\n      components: m.components ?? (m.type === '()' ? [] : null),\n      typeParameters: m.typeParameters ?? null,\n    };\n    types.push(t);\n  });\n\n  // 2. the metadata's components\n  types.forEach((t) => {\n    t.components = parseComponents(abi, types, t.components);\n  });\n\n  // 3. functions inputs/outputs\n  const functions = abi.functions.map((fn) => {\n    const inputs = fn.inputs.map(({ concreteTypeId, name }) =>\n      parseConcreteType(abi, types, concreteTypeId, name)\n    );\n    const output = parseConcreteType(abi, types, fn.output, '');\n    return { ...fn, inputs, output };\n  });\n\n  // 4. configurables\n  const configurables = abi.configurables.map((conf) => ({\n    name: conf.name,\n    configurableType: parseConcreteType(abi, types, conf.concreteTypeId),\n    offset: conf.offset,\n  }));\n\n  // 5. loggedTypes\n  const loggedTypes = abi.loggedTypes.map((log) => ({\n    logId: log.logId,\n    loggedType: parseConcreteType(abi, types, log.concreteTypeId),\n  }));\n\n  // transpiled ABI\n  const transpiled = {\n    encoding: abi.encodingVersion,\n    types,\n    functions,\n    loggedTypes,\n    messagesTypes: abi.messagesTypes,\n    configurables,\n    errorCodes: abi.errorCodes,\n  };\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  return transpiled as any;\n}\n","import type { IConfigurable } from '../../types/interfaces/IConfigurable';\nimport type { IType } from '../../types/interfaces/IType';\nimport type { JsonAbiConfigurable } from '../../types/interfaces/JsonAbi';\nimport { resolveInputLabel } from '../../utils/getTypeDeclaration';\n\nexport class Configurable implements IConfigurable {\n  public name: string;\n  public inputLabel: string;\n\n  constructor(params: { types: IType[]; rawAbiConfigurable: JsonAbiConfigurable }) {\n    const {\n      types,\n      rawAbiConfigurable: {\n        name,\n        configurableType: { type, typeArguments },\n      },\n    } = params;\n\n    this.name = name;\n\n    this.inputLabel = resolveInputLabel(types, type, typeArguments);\n  }\n}\n","export enum ProgramTypeEnum {\n  CONTRACT = 'contract',\n  SCRIPT = 'script',\n  PREDICATE = 'predicate',\n}\n","import type { BinaryVersions } from '@fuel-ts/versions';\nimport { join } from 'path';\n\nimport type { Abi } from '../abi/Abi';\nimport type { IFile } from '../index';\nimport { renderCommonTemplate } from '../templates/common/common';\nimport { renderIndexTemplate } from '../templates/common/index';\nimport { renderFactoryTemplate } from '../templates/contract/factory';\nimport { renderMainTemplate } from '../templates/contract/main';\n\n/**\n * Render all Contract-related templates and returns\n * an array of `IFile` with them all. For here on,\n * the only thing missing is to write them to disk.\n */\nexport function assembleContracts(params: {\n  abis: Abi[];\n  outputDir: string;\n  versions: BinaryVersions;\n}) {\n  const { abis, outputDir, versions } = params;\n\n  const files: IFile[] = [];\n  const usesCommonTypes = abis.find((a) => a.commonTypesInUse.length > 0);\n\n  abis.forEach((abi) => {\n    const { capitalizedName } = abi;\n\n    const mainFilepath = `${outputDir}/${capitalizedName}.ts`;\n    const factoryFilepath = `${outputDir}/${capitalizedName}Factory.ts`;\n\n    const main: IFile = {\n      path: mainFilepath,\n      contents: renderMainTemplate({ abi, versions }),\n    };\n\n    const factory: IFile = {\n      path: factoryFilepath,\n      contents: renderFactoryTemplate({ abi, versions }),\n    };\n\n    files.push(main);\n    files.push(factory);\n  });\n\n  // Includes index file\n  const indexFile: IFile = {\n    path: `${outputDir}/index.ts`,\n    contents: renderIndexTemplate({ files, versions }),\n  };\n\n  files.push(indexFile);\n\n  // Conditionally includes `common.ts` file if needed\n  if (usesCommonTypes) {\n    const commonsFilepath = join(outputDir, 'common.ts');\n    const file: IFile = {\n      path: commonsFilepath,\n      contents: renderCommonTemplate({ versions }),\n    };\n    files.push(file);\n  }\n\n  return files;\n}\n","import type { BinaryVersions } from '@fuel-ts/versions';\nimport Handlebars from 'handlebars';\n\nimport headerTemplate from './common/_header.hbs';\n\n/*\n  Renders the given template w/ the given data, while injecting common\n  header for disabling lint rules and annotating Fuel component's versions.\n*/\nexport function renderHbsTemplate(params: {\n  template: string;\n  versions: BinaryVersions;\n  data?: Record<string, unknown>;\n}) {\n  const { data, template, versions } = params;\n\n  const options = {\n    strict: true,\n    noEscape: true,\n  };\n\n  const renderTemplate = Handlebars.compile(template, options);\n  const renderHeaderTemplate = Handlebars.compile(headerTemplate, options);\n\n  const text = renderTemplate({\n    ...data,\n    header: renderHeaderTemplate(versions),\n  });\n\n  return text.replace(/[\\n]{3,}/gm, '\\n\\n');\n}\n","/* Autogenerated file. Do not edit manually. */\n\n/* eslint-disable max-classes-per-file */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/consistent-type-imports */\n\n\n/*\n  Fuels version: {{FUELS}}\n{{#if FORC}}\n  Forc version: {{FORC}}\n{{/if}}\n{{#if FUEL_CORE}}\n  Fuel-Core version: {{FUEL_CORE}}\n{{/if}}\n*/\n","{{header}}\n\n/**\n * Mimics Sway Enum.\n * Requires one and only one Key-Value pair and raises error if more are provided.\n */\nexport type Enum<T> = {\n  [K in keyof T]: Pick<T, K> & { [P in Exclude<keyof T, K>]?: never };\n}[keyof T];\n\n/**\n * Mimics Sway Option and Vectors.\n * Vectors are treated like arrays in Typescript.\n */\nexport type Option<T> = T | undefined;\n\nexport type Vec<T> = T[];\n\n/**\n * Mimics Sway Result enum type.\n * Ok represents the success case, while Err represents the error case.\n */\nexport type Result<T, E> = Enum<{Ok: T, Err: E}>;\n","import type { BinaryVersions } from '@fuel-ts/versions';\n\nimport { renderHbsTemplate } from '../renderHbsTemplate';\n\nimport commonTemplate from './common.hbs';\n\nexport function renderCommonTemplate(params: { versions: BinaryVersions }) {\n  const { versions } = params;\n  const text = renderHbsTemplate({ template: commonTemplate, versions });\n  return text;\n}\n","{{header}}\n\n{{#each members}}\nexport { {{this}} } from './{{this}}';\n{{/each}}\n","import type { BinaryVersions } from '@fuel-ts/versions';\n\nimport type { IFile } from '../../types/interfaces/IFile';\nimport { renderHbsTemplate } from '../renderHbsTemplate';\n\nimport indexTemplate from './index.hbs';\n\nexport function renderIndexTemplate(params: {\n  files: Pick<IFile, 'path'>[];\n  versions: BinaryVersions;\n}) {\n  const { files, versions } = params;\n\n  const members = files.map((f) => f.path.match(/([^/]+)\\.ts$/m)?.[1]);\n\n  const text = renderHbsTemplate({\n    template: indexTemplate,\n    versions,\n    data: {\n      members,\n    },\n  });\n\n  return text;\n}\n","import { compressBytecode } from '@fuel-ts/utils';\nimport type { BinaryVersions } from '@fuel-ts/versions';\n\nimport type { Abi } from '../../abi/Abi';\nimport { renderHbsTemplate } from '../renderHbsTemplate';\n\nimport factoryTemplate from './factory.hbs';\n\nexport function renderFactoryTemplate(params: { abi: Abi; versions: BinaryVersions }) {\n  const { versions, abi } = params;\n  const {\n    camelizedName,\n    capitalizedName,\n    rawContents,\n    storageSlotsContents,\n    hexlifiedBinContents: hexlifiedBinString,\n  } = abi;\n\n  const abiJsonString = JSON.stringify(rawContents, null, 2);\n  const storageSlotsJsonString = storageSlotsContents ?? '[]';\n\n  const text = renderHbsTemplate({\n    template: factoryTemplate,\n    versions,\n    data: {\n      camelizedName,\n      capitalizedName,\n      abiJsonString,\n      storageSlotsJsonString,\n      compressedBytecode: compressBytecode(hexlifiedBinString),\n    },\n  });\n\n  return text;\n}\n","{{header}}\n\nimport { ContractFactory as __ContractFactory, decompressBytecode } from \"fuels\";\nimport type { Provider, Account, DeployContractOptions } from \"fuels\";\n\nimport { {{capitalizedName}} } from \"./{{capitalizedName}}\";\n\nconst bytecode = decompressBytecode(\"{{compressedBytecode}}\");\n\nexport class {{capitalizedName}}Factory extends __ContractFactory<{{capitalizedName}}> {\n\n  static readonly bytecode = bytecode;\n\n  constructor(accountOrProvider: Account | Provider) {\n    super(\n      bytecode,\n      {{capitalizedName}}.abi,\n      accountOrProvider,\n      {{capitalizedName}}.storageSlots\n    );\n  }\n\n  static deploy (\n    wallet: Account,\n    options: DeployContractOptions = {}\n  ) {\n    const factory = new {{capitalizedName}}Factory(wallet);\n    return factory.deploy(options);\n  }\n}\n","import type { EnumType } from '../../abi/types/EnumType';\nimport { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\n\nexport function formatEnums(params: { types: IType[] }) {\n  const { types } = params;\n\n  const enums = types\n    .filter((t) => t.name === 'enum')\n    .map((t) => {\n      const et = t as EnumType; // only enums here\n      const structName = et.getStructName();\n      const inputValues = et.getStructContents({ types, target: TargetEnum.INPUT });\n      const outputValues = et.getStructContents({ types, target: TargetEnum.OUTPUT });\n      const inputNativeValues = et.getNativeEnum({ types });\n      const outputNativeValues = et.getNativeEnum({ types });\n      const typeAnnotations = et.getStructDeclaration({ types });\n\n      return {\n        structName,\n        inputValues,\n        outputValues,\n        recycleRef: inputValues === outputValues, // reduces duplication\n        inputNativeValues,\n        outputNativeValues,\n        typeAnnotations,\n      };\n    })\n    .sort((a, b) => (a.structName < b.structName ? -1 : 1));\n\n  return { enums };\n}\n","import { uniq } from 'ramda';\n\nimport type { IType } from '../../types/interfaces/IType';\n\nconst caseInsensitiveSort = (a: string, b: string) =>\n  a.toLowerCase().localeCompare(b.toLowerCase());\n\nexport function formatImports(params: { types: IType[]; baseMembers?: string[] }) {\n  const { types, baseMembers = [] } = params;\n\n  const members = types.flatMap((t) => t.requiredFuelsMembersImports);\n  const imports = uniq(baseMembers.concat(members).sort(caseInsensitiveSort));\n\n  return {\n    imports: imports.length ? imports : undefined,\n  };\n}\n","import type { StructType } from '../../abi/types/StructType';\nimport { TargetEnum } from '../../types/enums/TargetEnum';\nimport type { IType } from '../../types/interfaces/IType';\n\nexport function formatStructs(params: { types: IType[] }) {\n  const { types } = params;\n\n  const structs = types\n    .filter((t) => t.name === 'struct')\n    .map((t) => {\n      const st = t as StructType; // only structs here\n      const structName = st.getStructName();\n      const inputValues = st.getStructContents({ types, target: TargetEnum.INPUT });\n      const outputValues = st.getStructContents({ types, target: TargetEnum.OUTPUT });\n      const typeAnnotations = st.getStructDeclaration({ types });\n      return {\n        structName,\n        typeAnnotations,\n        inputValues,\n        outputValues,\n        recycleRef: inputValues === outputValues, // reduces duplication\n      };\n    })\n    .sort((a, b) => (a.structName < b.structName ? -1 : 1));\n\n  return { structs };\n}\n","{{header}}\n\nimport { Contract as __Contract, Interface } from \"fuels\";\n{{#if imports}}\nimport type {\n  Provider,\n  Account,\n  StorageSlot,\n  Address,\n{{#each imports}}\n  {{this}},\n{{/each}}\n} from 'fuels';\n{{/if}}\n\n{{#if commonTypesInUse}}\nimport type { {{commonTypesInUse}} } from \"./common\";\n{{/if}}\n\n\n{{#each enums}}\n{{#if inputNativeValues}}\nexport enum {{structName}}Input { {{inputNativeValues}} };\n{{else}}\nexport type {{structName}}Input{{typeAnnotations}} = Enum<{ {{inputValues}} }>;\n{{/if}}\n{{#if outputNativeValues}}\nexport enum {{structName}}Output { {{outputNativeValues}} };\n{{else}}\n  {{#if recycleRef}}\nexport type {{structName}}Output{{typeAnnotations}} = {{structName}}Input{{typeAnnotations}};\n  {{else}}\nexport type {{structName}}Output{{typeAnnotations}} = Enum<{ {{outputValues}} }>;\n  {{/if}}\n{{/if}}\n{{/each}}\n\n\n{{#each structs}}\nexport type {{structName}}Input{{typeAnnotations}} = { {{inputValues}} };\n{{#if recycleRef}}\nexport type {{structName}}Output{{typeAnnotations}} = {{structName}}Input{{typeAnnotations}};\n{{else}}\nexport type {{structName}}Output{{typeAnnotations}} = { {{outputValues}} };\n{{/if}}\n{{/each}}\n\n{{#if configurables}}\nexport type {{capitalizedName}}Configurables = Partial<{\n{{#each configurables}}\n  {{name}}: {{inputLabel}};\n{{/each}}\n}>;\n{{/if}}\n\nconst abi = {{abiJsonString}};\n\nconst storageSlots: StorageSlot[] = {{storageSlotsJsonString}};\n\nexport class {{capitalizedName}}Interface extends Interface {\n  constructor() {\n    super(abi);\n  }\n\n  declare functions: {\n    {{#each functionsFragments}}\n    {{this}}: FunctionFragment;\n    {{/each}}\n  };\n}\n\nexport class {{capitalizedName}} extends __Contract {\n  static readonly abi = abi;\n  static readonly storageSlots = storageSlots;\n\n  declare interface: {{capitalizedName}}Interface;\n  declare functions: {\n    {{#each functionsTypedefs}}\n    {{this}};\n    {{/each}}\n  };\n\n  constructor(\n    id: string | Address,\n    accountOrProvider: Account | Provider,\n  ) {\n    super(id, abi, accountOrProvider);\n  }\n}\n","import type { BinaryVersions } from '@fuel-ts/versions';\n\nimport type { Abi } from '../../abi/Abi';\nimport { renderHbsTemplate } from '../renderHbsTemplate';\nimport { formatEnums } from '../utils/formatEnums';\nimport { formatImports } from '../utils/formatImports';\nimport { formatStructs } from '../utils/formatStructs';\n\nimport mainTemplate from './main.hbs';\n\nexport function renderMainTemplate(params: { abi: Abi; versions: BinaryVersions }) {\n  const { versions, abi } = params;\n  const { camelizedName, capitalizedName, types, functions, commonTypesInUse, configurables } = abi;\n\n  /*\n    First we format all attributes\n  */\n  const functionsTypedefs = functions.map((f) => f.getDeclaration());\n\n  const functionsFragments = functions.map((f) => f.name);\n\n  const encoders = functions.map((f) => ({\n    functionName: f.name,\n    input: f.attributes.inputs,\n  }));\n\n  const decoders = functions.map((f) => ({\n    functionName: f.name,\n  }));\n\n  const { enums } = formatEnums({ types });\n  const { structs } = formatStructs({ types });\n  const { imports } = formatImports({\n    types,\n    baseMembers: ['FunctionFragment', 'InvokeFunction'],\n  });\n\n  const { rawContents, storageSlotsContents } = params.abi;\n  const abiJsonString = JSON.stringify(rawContents, null, 2);\n  const storageSlotsJsonString = storageSlotsContents ?? '[]';\n\n  /*\n    And finally render template\n  */\n  const text = renderHbsTemplate({\n    template: mainTemplate,\n    versions,\n    data: {\n      camelizedName,\n      capitalizedName,\n      commonTypesInUse: commonTypesInUse.join(', '),\n      functionsTypedefs,\n      functionsFragments,\n      encoders,\n      decoders,\n      structs,\n      enums,\n      imports,\n      abiJsonString,\n      storageSlotsJsonString,\n      configurables,\n    },\n  });\n\n  return text;\n}\n","import type { BinaryVersions } from '@fuel-ts/versions';\nimport { join } from 'path';\n\nimport type { Abi } from '../abi/Abi';\nimport type { IFile } from '../index';\nimport { renderCommonTemplate } from '../templates/common/common';\nimport { renderIndexTemplate } from '../templates/common/index';\nimport { renderMainTemplate } from '../templates/predicate/main';\n\n/**\n * Render all Predicate-related templates and returns\n * an array of `IFile` with them all. For here on,\n * the only thing missing is to write them to disk.\n */\nexport function assemblePredicates(params: {\n  abis: Abi[];\n  outputDir: string;\n  versions: BinaryVersions;\n}) {\n  const { abis, outputDir, versions } = params;\n\n  const files: IFile[] = [];\n  const usesCommonTypes = abis.find((a) => a.commonTypesInUse.length > 0);\n\n  abis.forEach((abi) => {\n    const { capitalizedName: name } = abi;\n\n    const factoryFilepath = `${outputDir}/${name}.ts`;\n\n    const factory: IFile = {\n      path: factoryFilepath,\n      contents: renderMainTemplate({ abi, versions }),\n    };\n\n    files.push(factory);\n  });\n\n  // Includes index file\n  const indexFile: IFile = {\n    path: `${outputDir}/index.ts`,\n    contents: renderIndexTemplate({ files, versions }),\n  };\n\n  files.push(indexFile);\n\n  // Conditionally includes `common.ts` file if needed\n  if (usesCommonTypes) {\n    const commonsFilepath = join(outputDir, 'common.ts');\n    const file: IFile = {\n      path: commonsFilepath,\n      contents: renderCommonTemplate({ versions }),\n    };\n    files.push(file);\n  }\n\n  return files;\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { compressBytecode } from '@fuel-ts/utils';\nimport type { BinaryVersions } from '@fuel-ts/versions';\n\nimport type { Abi } from '../../abi/Abi';\nimport { renderHbsTemplate } from '../renderHbsTemplate';\nimport { formatEnums } from '../utils/formatEnums';\nimport { formatImports } from '../utils/formatImports';\nimport { formatStructs } from '../utils/formatStructs';\n\nimport mainTemplate from './main.hbs';\n\nexport function renderMainTemplate(params: { abi: Abi; versions: BinaryVersions }) {\n  const { abi, versions } = params;\n\n  const { types, configurables } = abi;\n\n  const {\n    rawContents,\n    capitalizedName,\n    hexlifiedBinContents: hexlifiedBinString,\n    commonTypesInUse,\n  } = params.abi;\n\n  const abiJsonString = JSON.stringify(rawContents, null, 2);\n\n  const func = abi.functions.find((f) => f.name === 'main');\n\n  if (!func) {\n    throw new FuelError(ErrorCode.ABI_MAIN_METHOD_MISSING, `ABI doesn't have a 'main()' method.`);\n  }\n\n  const { enums } = formatEnums({ types });\n  const { structs } = formatStructs({ types });\n  const { imports } = formatImports({\n    types,\n    baseMembers: [\n      'Predicate as __Predicate',\n      'Provider',\n      'InputValue',\n      'PredicateParams',\n      'decompressBytecode',\n    ],\n  });\n\n  const { prefixedInputs: inputs, output } = func.attributes;\n\n  const text = renderHbsTemplate({\n    template: mainTemplate,\n    versions,\n    data: {\n      inputs,\n      output,\n      structs,\n      enums,\n      abiJsonString,\n      compressedBytecode: compressBytecode(hexlifiedBinString),\n      capitalizedName,\n      imports,\n      configurables,\n      commonTypesInUse: commonTypesInUse.join(', '),\n    },\n  });\n\n  return text;\n}\n","{{header}}\n\n{{#if imports}}\nimport {\n{{#each imports}}\n  {{this}},\n{{/each}}\n} from 'fuels';\n{{/if}}\n\n{{#if commonTypesInUse}}\nimport type { {{commonTypesInUse}} } from \"./common\";\n{{/if}}\n\n\n{{#each enums}}\n{{#if inputNativeValues}}\nexport enum {{structName}}Input { {{inputNativeValues}} };\n{{else}}\nexport type {{structName}}Input{{typeAnnotations}} = Enum<{ {{inputValues}} }>;\n{{/if}}\n{{#if outputNativeValues}}\nexport enum {{structName}}Output { {{outputNativeValues}} };\n{{else}}\n  {{#if recycleRef}}\nexport type {{structName}}Output{{typeAnnotations}} = {{structName}}Input{{typeAnnotations}};\n  {{else}}\nexport type {{structName}}Output{{typeAnnotations}} = Enum<{ {{outputValues}} }>;\n  {{/if}}\n{{/if}}\n{{/each}}\n\n\n{{#each structs}}\nexport type {{structName}}Input{{typeAnnotations}} = { {{inputValues}} };\n{{#if recycleRef}}\nexport type {{structName}}Output{{typeAnnotations}} = {{structName}}Input{{typeAnnotations}};\n{{else}}\nexport type {{structName}}Output{{typeAnnotations}} = { {{outputValues}} };\n{{/if}}\n{{/each}}\n\n{{#if configurables}}\nexport type {{capitalizedName}}Configurables = Partial<{\n  {{#each configurables}}\n    {{name}}: {{inputLabel}};\n  {{/each}}\n}>;\n{{else}}\nexport type {{capitalizedName}}Configurables = undefined;\n{{/if}}\n\nexport type {{capitalizedName}}Inputs = [{{inputs}}];\n\nexport type {{capitalizedName}}Parameters = Omit<\n  PredicateParams<{{capitalizedName}}Inputs, {{capitalizedName}}Configurables>,\n  'abi' | 'bytecode'\n>;\n\nconst abi = {{abiJsonString}};\n\nconst bytecode = decompressBytecode('{{compressedBytecode}}');\n\nexport class {{capitalizedName}} extends __Predicate<\n  {{capitalizedName}}Inputs,\n  {{capitalizedName}}Configurables\n> {\n  static readonly abi = abi;\n  static readonly bytecode = bytecode;\n\n  constructor(params: {{capitalizedName}}Parameters) {\n    super({ abi, bytecode, ...params });\n  }\n}\n","import type { BinaryVersions } from '@fuel-ts/versions';\nimport { join } from 'path';\n\nimport type { Abi } from '../abi/Abi';\nimport type { IFile } from '../index';\nimport { renderCommonTemplate } from '../templates/common/common';\nimport { renderIndexTemplate } from '../templates/common/index';\nimport { renderMainTemplate } from '../templates/script/main';\n\n/**\n * Render all Script-related templates and returns\n * an array of `IFile` with them all. For here on,\n * the only thing missing is to write them to disk.\n */\nexport function assembleScripts(params: {\n  abis: Abi[];\n  outputDir: string;\n  versions: BinaryVersions;\n}) {\n  const { abis, outputDir, versions } = params;\n\n  const files: IFile[] = [];\n  const usesCommonTypes = abis.find((a) => a.commonTypesInUse.length > 0);\n\n  abis.forEach((abi) => {\n    const { capitalizedName } = abi;\n\n    const factoryFilepath = `${outputDir}/${capitalizedName}.ts`;\n\n    const factory: IFile = {\n      path: factoryFilepath,\n      contents: renderMainTemplate({ abi, versions }),\n    };\n\n    files.push(factory);\n  });\n\n  // Includes index file\n  const indexFile: IFile = {\n    path: `${outputDir}/index.ts`,\n    contents: renderIndexTemplate({ files, versions }),\n  };\n\n  files.push(indexFile);\n\n  // Conditionally includes `common.ts` file if needed\n  if (usesCommonTypes) {\n    const commonsFilepath = join(outputDir, 'common.ts');\n    const file: IFile = {\n      path: commonsFilepath,\n      contents: renderCommonTemplate({ versions }),\n    };\n    files.push(file);\n  }\n\n  return files;\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\nimport { compressBytecode } from '@fuel-ts/utils';\nimport type { BinaryVersions } from '@fuel-ts/versions';\n\nimport type { Abi } from '../../abi/Abi';\nimport { renderHbsTemplate } from '../renderHbsTemplate';\nimport { formatEnums } from '../utils/formatEnums';\nimport { formatImports } from '../utils/formatImports';\nimport { formatStructs } from '../utils/formatStructs';\n\nimport mainTemplate from './main.hbs';\n\nexport function renderMainTemplate(params: { abi: Abi; versions: BinaryVersions }) {\n  const { abi, versions } = params;\n\n  const { types, configurables } = abi;\n\n  const {\n    rawContents,\n    capitalizedName,\n    hexlifiedBinContents: hexlifiedBinString,\n    commonTypesInUse,\n  } = params.abi;\n\n  const abiJsonString = JSON.stringify(rawContents, null, 2);\n\n  const func = abi.functions.find((f) => f.name === 'main');\n\n  if (!func) {\n    throw new FuelError(ErrorCode.ABI_MAIN_METHOD_MISSING, `ABI doesn't have a 'main()' method.`);\n  }\n\n  const { enums } = formatEnums({ types });\n  const { structs } = formatStructs({ types });\n  const { imports } = formatImports({\n    types,\n    baseMembers: ['Script as __Script', 'Account', 'decompressBytecode'],\n  });\n\n  const { prefixedInputs: inputs, output } = func.attributes;\n\n  const text = renderHbsTemplate({\n    template: mainTemplate,\n    versions,\n    data: {\n      inputs,\n      output,\n      structs,\n      enums,\n      abiJsonString,\n      compressedBytecode: compressBytecode(hexlifiedBinString),\n      capitalizedName,\n      imports,\n      configurables,\n      commonTypesInUse: commonTypesInUse.join(', '),\n    },\n  });\n\n  return text;\n}\n","{{header}}\n\n{{#if imports}}\nimport {\n{{#each imports}}\n  {{this}},\n{{/each}}\n} from 'fuels';\n{{/if}}\n\n{{#if commonTypesInUse}}\nimport type { {{commonTypesInUse}} } from \"./common\";\n{{/if}}\n\n\n{{#each enums}}\n{{#if inputNativeValues}}\nexport enum {{structName}}Input { {{inputNativeValues}} };\n{{else}}\nexport type {{structName}}Input{{typeAnnotations}} = Enum<{ {{inputValues}} }>;\n{{/if}}\n{{#if outputNativeValues}}\nexport enum {{structName}}Output { {{outputNativeValues}} };\n{{else}}\n  {{#if recycleRef}}\nexport type {{structName}}Output{{typeAnnotations}} = {{structName}}Input{{typeAnnotations}};\n  {{else}}\nexport type {{structName}}Output{{typeAnnotations}} = Enum<{ {{outputValues}} }>;\n  {{/if}}\n{{/if}}\n{{/each}}\n\n\n{{#each structs}}\nexport type {{structName}}Input{{typeAnnotations}} = { {{inputValues}} };\n{{#if recycleRef}}\nexport type {{structName}}Output{{typeAnnotations}} = {{structName}}Input{{typeAnnotations}};\n{{else}}\nexport type {{structName}}Output{{typeAnnotations}} = { {{outputValues}} };\n{{/if}}\n{{/each}}\n\nexport type {{capitalizedName}}Inputs = [{{inputs}}];\nexport type {{capitalizedName}}Output = {{output}};\n\n{{#if configurables}}\nexport type {{capitalizedName}}Configurables = Partial<{\n{{#each configurables}}\n  {{name}}: {{inputLabel}};\n{{/each}}\n}>;\n{{/if}}\n\nconst abi = {{abiJsonString}};\n\nconst bytecode = decompressBytecode('{{compressedBytecode}}');\n\nexport class {{capitalizedName}} extends __Script<{{capitalizedName}}Inputs, {{capitalizedName}}Output> {\n\n  static readonly abi = abi;\n  static readonly bytecode = bytecode;\n\n  constructor(wallet: Account) {\n    super(bytecode, abi, wallet);\n  }\n}\n","import { ErrorCode, FuelError } from '@fuel-ts/errors';\n\nimport { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum';\n\nconst upperFirst = (s: string): string => s[0].toUpperCase() + s.slice(1);\n\nexport function validateBinFile(params: {\n  abiFilepath: string;\n  binFilepath: string;\n  binExists: boolean;\n  programType: ProgramTypeEnum;\n}) {\n  const { abiFilepath, binFilepath, binExists, programType } = params;\n\n  const isScript = programType === ProgramTypeEnum.SCRIPT;\n\n  if (!binExists && isScript) {\n    throw new FuelError(\n      ErrorCode.BIN_FILE_NOT_FOUND,\n      [\n        `Could not find BIN file for counterpart ${upperFirst(programType)} ABI.`,\n        `  - ABI: ${abiFilepath}`,\n        `  - BIN: ${binFilepath}`,\n        programType,\n      ].join('\\n')\n    );\n  }\n}\n","import { hexlify } from '@fuel-ts/utils';\nimport { existsSync, readFileSync } from 'fs';\n\nimport type { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum';\nimport type { IFile } from '../types/interfaces/IFile';\n\nimport { validateBinFile } from './validateBinFile';\n\nexport const collectBinFilepaths = (params: {\n  filepaths: string[];\n  programType: ProgramTypeEnum;\n}) => {\n  const { filepaths, programType } = params;\n\n  // validate and collect bin filepaths for Scripts and/or Predicates\n  const binFiles = filepaths.map((abiFilepath) => {\n    const binFilepath = abiFilepath.replace('-abi.json', '.bin');\n    const binExists = existsSync(binFilepath);\n\n    validateBinFile({ abiFilepath, binFilepath, binExists, programType });\n\n    const bin: IFile = {\n      path: binFilepath,\n      contents: hexlify(readFileSync(binFilepath)),\n    };\n\n    return bin;\n  });\n\n  return binFiles;\n};\n","import { existsSync, readFileSync } from 'fs';\n\nimport { ProgramTypeEnum } from '../types/enums/ProgramTypeEnum';\nimport type { IFile } from '../types/interfaces/IFile';\n\nexport const collectStorageSlotsFilepaths = (params: {\n  filepaths: string[];\n  programType: ProgramTypeEnum;\n}) => {\n  const { filepaths, programType } = params;\n\n  // collect filepaths for storage slots JSON files\n  const storageSlotsFiles: IFile[] = [];\n\n  // abort unless we're dealing with contract types\n  if (programType !== ProgramTypeEnum.CONTRACT) {\n    return storageSlotsFiles;\n  }\n\n  filepaths.forEach((abiFilepath) => {\n    const storageSlotsFilepath = abiFilepath.replace('-abi.json', '-storage_slots.json');\n    const storageSlotsExists = existsSync(storageSlotsFilepath);\n\n    if (storageSlotsExists) {\n      const storageSlots: IFile = {\n        path: storageSlotsFilepath,\n        contents: readFileSync(storageSlotsFilepath, 'utf-8'),\n      };\n\n      storageSlotsFiles.push(storageSlots);\n    }\n  });\n\n  return storageSlotsFiles;\n};\n"],"mappings":";;;;AAAA,SAAS,aAAAA,aAAW,aAAAC,kBAAiB;AACrC,SAAS,YAAY,uBAA4C;AACjE,SAAS,gBAAAC,eAAc,qBAAqB;AAC5C,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;;;ACN3B,SAAS,aAAAC,YAAW,aAAAC,kBAAiB;;;ACArC,SAAS,aAAAC,YAAW,aAAAC,kBAAiB;AACrC,SAAS,uBAAuB;;;ACCzB,IAAM,YAAN,MAAgB;AAAA,EAFvB,OAEuB;AAAA;AAAA;AAAA,EACd;AAAA,EACA;AAAA,EAEP,YAAY,QAAoB;AAC9B,SAAK,OAAO,OAAO;AACnB,SAAK,QAAQ,OAAO;AAAA,EACtB;AACF;;;ACPO,SAAS,cAAc,QAAoB;AAChD,SAAO,IAAI,UAAU,MAAM;AAC7B;AAFgB;;;ACGT,SAAS,gBAAgB,QAG7B;AAED,QAAM,EAAE,cAAc,IAAI;AAC1B,QAAM,aAA0B,OAAO,QAAQ,iBAAiB,CAAC,CAAC,EAAE;AAAA,IAAI,CAAC,CAAC,MAAM,KAAK,MACnF,cAAc,EAAE,MAAM,MAAM,CAAC;AAAA,EAC/B;AAEA,SAAO;AACT;AAXgB;;;ACHT,IAAM,QAAN,MAAY;AAAA,EAHnB,OAGmB;AAAA;AAAA;AAAA,EACV;AAAA,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AK,MAAM,KAAK,QAAQ;AACtC,UAAM,gBAAgB,IAAI,OAAO,MAAM,WAAW,KAAK,GAAG;AAC1D,QAAI,MAAM,KAAK,KAAK,QAAQ,eAAe,EAAE,CAAC,EAAE;AAAA,EAClD,CAAC;AAED,MAAI,eAAU;AAChB;AA7EgB;","names":["ErrorCode","FuelError","readFileSync","ErrorCode","FuelError","ErrorCode","FuelError","ErrorCode","ErrorCode","ErrorCode","FuelError","ErrorCode","FuelError","FuelError","ErrorCode","FuelError","ErrorCode","FuelError","ErrorCode","ProgramTypeEnum","common_default","common_default","join","ErrorCode","FuelError","compressBytecode","main_default","renderMainTemplate","FuelError","ErrorCode","main_default","compressBytecode","renderMainTemplate","join","join","ErrorCode","FuelError","compressBytecode","main_default","renderMainTemplate","FuelError","ErrorCode","main_default","compressBytecode","renderMainTemplate","join","ErrorCode","FuelError","FuelError","ErrorCode","FuelError","ErrorCode","existsSync","readFileSync","existsSync","readFileSync","FuelError","ErrorCode","readFileSync"]}