{"version":3,"file":"settlemint.cjs","names":["graphql: initGraphQLTada<{\n  introspection: introspection;\n  disableMasking: true;\n  scalars: {\n    DateTime: Date;\n    JSON: Record<string, unknown>;\n    Bytes: string;\n    Int8: string;\n    BigInt: string;\n    BigDecimal: string;\n    Timestamp: string;\n  };\n}>","gqlClient: GraphQLClient","workspaceUniqueName: string","createWorkspaceArgs: CreateWorkspaceArgs","workspaceId: Id","amount: number","IdSchema","gqlClient: GraphQLClient","workspaceUniqueName: string","applicationUniqueName: string","args: CreateApplicationArgs","gqlClient: GraphQLClient","args: CreateApplicationAccessTokenArgs","args: Args","args: Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\">","gqlClient: GraphQLClient","applicationUniqueName: string","blockchainNetworkUniqueName: string","args: CreateBlockchainNetworkArgs","gqlClient: GraphQLClient","applicationUniqueName: string","blockchainNodeUniqueName: string","args: CreateBlockchainNodeArgs","gqlClient: GraphQLClient","applicationUniqueName: string","customDeploymentUniqueName: string","imageTag: string","args: CreateCustomDeploymentArgs","gqlClient: GraphQLClient","blockchainNodeUniqueName: string","gqlClient: GraphQLClient","loadBalancerUniqueName: string","applicationUniqueName: string","args: CreateLoadBalancerArgs","gqlClient: GraphQLClient","applicationUniqueName: string","insightsUniqueName: string","args: CreateInsightsArgs","gqlClient: GraphQLClient","applicationUniqueName: string","integrationUniqueName: string","args: CreateIntegrationToolArgs","gqlClient: GraphQLClient","applicationUniqueName: string","storageUniqueName: string","args: CreateStorageArgs","gqlClient: GraphQLClient","applicationUniqueName: string","middlewareUniqueName: string","args: CreateMiddlewareArgs","gqlClient: GraphQLClient","gqlClient: GraphQLClient","applicationUniqueName: string","privateKeyUniqueName: string","args: CreatePrivateKeyArgs","AccessTokenSchema","UrlSchema","pincode: string","salt: string","challenge: string","verificationChallenges: VerificationChallenge[]","options: SettlemintClientOptions","STANDALONE_INSTANCE","LOCAL_INSTANCE","GraphQLClient","input: RequestInfo | URL","init?: RequestInit","data: { errors: { message: string }[] }"],"sources":["../src/helpers/graphql.ts","../src/graphql/workspace.ts","../src/graphql/application.ts","../src/graphql/application-access-tokens.ts","../src/defaults/cluster-service-defaults.ts","../src/defaults/blockchain-network-defaults.ts","../src/graphql/blockchain-network.ts","../src/graphql/blockchain-node.ts","../src/graphql/custom-deployment.ts","../src/graphql/foundry.ts","../src/graphql/load-balancer.ts","../src/graphql/insights.ts","../src/graphql/integration-tool.ts","../src/graphql/storage.ts","../src/graphql/middleware.ts","../src/graphql/platform.ts","../src/graphql/private-key.ts","../src/helpers/client-options.schema.ts","../src/pincode-verification.ts","../src/settlemint.ts"],"sourcesContent":["/**\n * This module initializes and exports GraphQL-related utilities using gql.tada.\n * It sets up the GraphQL client with specific configurations and exports necessary types and functions.\n */\n\nimport { initGraphQLTada } from \"gql.tada\";\nimport type { introspection } from \"./graphql-env.d.ts\";\n\n/**\n * Initializes the GraphQL client with specific configurations.\n *\n * @returns A configured GraphQL client instance.\n */\nexport const graphql: initGraphQLTada<{\n  introspection: introspection;\n  disableMasking: true;\n  scalars: {\n    DateTime: Date;\n    JSON: Record<string, unknown>;\n    Bytes: string;\n    Int8: string;\n    BigInt: string;\n    BigDecimal: string;\n    Timestamp: string;\n  };\n}> = initGraphQLTada<{\n  introspection: introspection;\n  disableMasking: true;\n  scalars: {\n    DateTime: Date;\n    JSON: Record<string, unknown>;\n    Bytes: string;\n    Int8: string;\n    BigInt: string;\n    BigDecimal: string;\n    Timestamp: string;\n  };\n}>();\n\nexport { readFragment } from \"gql.tada\";\nexport type { FragmentOf, ResultOf, VariablesOf } from \"gql.tada\";\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport { type Id, IdSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL fragment containing core workspace fields.\n */\nconst WorkspaceFragment = graphql(\n  `\n    fragment Workspace on Workspace {\n      id\n      uniqueName\n      name\n      applications {\n        id\n        uniqueName\n        name\n      }\n    }\n  `,\n);\n\n/**\n * Type representing a workspace entity.\n */\nexport type Workspace = ResultOf<typeof WorkspaceFragment>;\n\n/**\n * Query to fetch all workspaces and their applications.\n */\nconst getWorkspacesAndApplications = graphql(\n  `\n    query getWorkspacesAndApplications {\n      workspaces {\n        ...Workspace\n        childWorkspaces {\n          ...Workspace\n        }\n      }\n    }\n  `,\n  [WorkspaceFragment],\n);\n\n/**\n * Query to fetch a specific workspace by unique name.\n */\nconst getWorkspace = graphql(\n  `\n    query getWorkspace($uniqueName: String!) {\n      workspaceByUniqueName(uniqueName: $uniqueName) {\n        ...Workspace\n      }\n    }\n  `,\n  [WorkspaceFragment],\n);\n\n/**\n * Mutation to create a new workspace.\n */\nconst createWorkspace = graphql(\n  `\n    mutation CreateWorkspace(\n      $addressLine1: String\n      $addressLine2: String\n      $city: String\n      $companyName: String\n      $country: String\n      $name: String!\n      $parentId: String\n      $paymentMethodId: String\n      $postalCode: String\n      $taxIdType: String\n      $taxIdValue: String\n    ) {\n      createWorkspace(\n        addressLine1: $addressLine1\n        addressLine2: $addressLine2\n        city: $city\n        companyName: $companyName\n        country: $country\n        name: $name\n        parentId: $parentId\n        paymentMethodId: $paymentMethodId\n        postalCode: $postalCode\n        taxIdType: $taxIdType\n        taxIdValue: $taxIdValue\n      ) {\n        ...Workspace\n      }\n    }\n  `,\n  [WorkspaceFragment],\n);\n\nexport type CreateWorkspaceArgs = VariablesOf<typeof createWorkspace>;\n\n/**\n * Mutation to delete a workspace.\n */\nconst deleteWorkspace = graphql(\n  `\n    mutation deleteWorkspace($uniqueName: String!) {\n      deleteWorkspaceByUniqueName(uniqueName: $uniqueName) {\n        ...Workspace\n      }\n    }\n  `,\n  [WorkspaceFragment],\n);\n\n/**\n * Mutation to add credits to a workspace.\n */\nconst addCredits = graphql(\n  `\n    mutation addCredits($workspaceId: String!, $amount: Float!) {\n      addCredits(workspaceId: $workspaceId, amount: $amount)\n    }\n  `,\n);\n\n/**\n * Creates a function to list all workspaces and their applications.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that returns all workspaces sorted by name\n * @throws If the request fails\n */\nexport const workspaceList = (gqlClient: GraphQLClient): (() => Promise<Workspace[]>) => {\n  return async () => {\n    const { workspaces } = await gqlClient.request(getWorkspacesAndApplications);\n    const allWorkspaces = workspaces.reduce<Workspace[]>((acc, workspace) => {\n      acc.push(workspace);\n      if (workspace.childWorkspaces) {\n        acc.push(...workspace.childWorkspaces);\n      }\n      return acc;\n    }, []);\n    return allWorkspaces.sort((a, b) => a.name.localeCompare(b.name));\n  };\n};\n\n/**\n * Creates a function to read a specific workspace by unique name.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single workspace by unique name\n * @throws If the workspace cannot be found or the request fails\n */\nexport const workspaceRead = (gqlClient: GraphQLClient): ((workspaceUniqueName: string) => Promise<Workspace>) => {\n  return async (workspaceUniqueName: string) => {\n    const { workspaceByUniqueName } = await gqlClient.request(getWorkspace, { uniqueName: workspaceUniqueName });\n    return workspaceByUniqueName;\n  };\n};\n\n/**\n * Creates a function to create a new workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new workspace with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const workspaceCreate = (gqlClient: GraphQLClient) => {\n  return async (createWorkspaceArgs: CreateWorkspaceArgs) => {\n    const { createWorkspace: workspace } = await gqlClient.request(createWorkspace, createWorkspaceArgs);\n    return workspace;\n  };\n};\n\n/**\n * Creates a function to delete a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes a workspace by unique name\n * @throws If the workspace cannot be found or the deletion fails\n */\nexport const workspaceDelete = (gqlClient: GraphQLClient) => {\n  return async (workspaceUniqueName: string) => {\n    const { deleteWorkspaceByUniqueName: workspace } = await gqlClient.request(deleteWorkspace, {\n      uniqueName: workspaceUniqueName,\n    });\n    return workspace;\n  };\n};\n\n/**\n * Creates a function to add credits to a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that adds credits to a workspace\n * @throws If the workspace ID is invalid or amount is not positive\n */\nexport const workspaceAddCredits = (gqlClient: GraphQLClient) => {\n  return async (workspaceId: Id, amount: number) => {\n    const id = validate(IdSchema, workspaceId);\n    if (amount <= 0) {\n      throw new Error(\"Credit amount must be a positive number\");\n    }\n    const { addCredits: result } = await gqlClient.request(addCredits, { workspaceId: id, amount });\n    return result;\n  };\n};\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { workspaceRead } from \"./workspace.js\";\n\n/**\n * GraphQL fragment containing core application fields.\n */\nconst ApplicationFragment = graphql(`\n  fragment Application on Application {\n    id\n    uniqueName\n    name\n    workspace {\n      id\n      uniqueName\n      name\n    }\n  }\n`);\n\n/**\n * Type representing an application entity.\n */\nexport type Application = ResultOf<typeof ApplicationFragment>;\n\n/**\n * Query to fetch applications for a workspace.\n */\nconst listApplications = graphql(\n  `\n    query ListApplications($workspaceUniqueName: String!) {\n      workspaceByUniqueName(uniqueName: $workspaceUniqueName) {\n        applications {\n          ...Application\n        }\n      }\n    }\n  `,\n  [ApplicationFragment],\n);\n\n/**\n * Query to fetch a specific application.\n */\nconst readApplication = graphql(\n  `\n    query ReadApplication($applicationUniqueName: String!) {\n      applicationByUniqueName(uniqueName: $applicationUniqueName) {\n        ...Application\n      }\n    }\n  `,\n  [ApplicationFragment],\n);\n\n/**\n * Mutation to create a new application.\n */\nconst createApplication = graphql(\n  `\n    mutation CreateApplication($name: String!, $workspaceId: ID!) {\n      createApplication(name: $name, workspaceId: $workspaceId) {\n        ...Application\n      }\n    }\n  `,\n  [ApplicationFragment],\n);\n\n/**\n * Mutation to delete an application.\n */\nconst deleteApplication = graphql(\n  `\n    mutation DeleteApplication($uniqueName: String!) {\n      deleteApplicationByUniqueName(uniqueName: $uniqueName) {\n        ...Application\n      }\n    }\n  `,\n  [ApplicationFragment],\n);\n\n/**\n * Arguments required to create an application.\n */\nexport type CreateApplicationArgs = Omit<VariablesOf<typeof createApplication>, \"workspaceId\"> & {\n  workspaceUniqueName: string;\n};\n\n/**\n * Creates a function to list applications in a workspace.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches applications for a workspace\n * @throws If the workspace cannot be found or the request fails\n */\nexport const applicationList = (gqlClient: GraphQLClient) => {\n  return async (workspaceUniqueName: string): Promise<Application[]> => {\n    const {\n      workspaceByUniqueName: { applications },\n    } = await gqlClient.request(listApplications, { workspaceUniqueName });\n    return applications;\n  };\n};\n\n/**\n * Creates a function to fetch a specific application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single application by unique name\n * @throws If the application cannot be found or the request fails\n */\nexport const applicationRead = (gqlClient: GraphQLClient) => {\n  return async (applicationUniqueName: string): Promise<Application> => {\n    const { applicationByUniqueName: application } = await gqlClient.request(readApplication, {\n      applicationUniqueName,\n    });\n    return application;\n  };\n};\n\n/**\n * Creates a function to create a new application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new application with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const applicationCreate = (gqlClient: GraphQLClient) => {\n  return async (args: CreateApplicationArgs): Promise<Application> => {\n    const { workspaceUniqueName, ...otherArgs } = args;\n    const workspace = await workspaceRead(gqlClient)(workspaceUniqueName);\n    const { createApplication: application } = await gqlClient.request(createApplication, {\n      ...otherArgs,\n      workspaceId: workspace.id,\n    });\n    return application;\n  };\n};\n\n/**\n * Creates a function to delete an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes an application by unique name\n * @throws If the application cannot be found or the deletion fails\n */\nexport const applicationDelete = (gqlClient: GraphQLClient) => {\n  return async (applicationUniqueName: string): Promise<Application> => {\n    const { deleteApplicationByUniqueName: application } = await gqlClient.request(deleteApplication, {\n      uniqueName: applicationUniqueName,\n    });\n    return application;\n  };\n};\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\nconst createApplicationAccessToken = graphql(\n  `\n    mutation CreateApplicationAccessToken(\n      $applicationId: ID!,\n      $blockchainNetworkScope: BlockchainNetworkScopeInputType!,\n      $blockchainNodeScope: BlockchainNodeScopeInputType!,\n      $customDeploymentScope: CustomDeploymentScopeInputType!,\n      $insightsScope: InsightsScopeInputType!,\n      $integrationScope: IntegrationScopeInputType!,\n      $loadBalancerScope: LoadBalancerScopeInputType!,\n      $middlewareScope: MiddlewareScopeInputType!,\n      $name: String!,\n      $privateKeyScope: PrivateKeyScopeInputType!,\n      $smartContractSetScope: SmartContractSetScopeInputType!,\n      $storageScope: StorageScopeInputType!,\n      $validityPeriod: AccessTokenValidityPeriod!\n    ) {\n      createApplicationAccessToken(\n        applicationId: $applicationId,\n        blockchainNetworkScope: $blockchainNetworkScope,\n        blockchainNodeScope: $blockchainNodeScope,\n        customDeploymentScope: $customDeploymentScope,\n        insightsScope: $insightsScope,\n        integrationScope: $integrationScope,\n        loadBalancerScope: $loadBalancerScope,\n        middlewareScope: $middlewareScope,\n        name: $name,\n        privateKeyScope: $privateKeyScope,\n        smartContractSetScope: $smartContractSetScope,\n        storageScope: $storageScope,\n        validityPeriod: $validityPeriod\n      ) {\n        token\n      }\n    }\n  `,\n  [],\n);\n\nexport type CreateApplicationAccessTokenArgs = Omit<\n  VariablesOf<typeof createApplicationAccessToken>,\n  \"applicationId\"\n> & { applicationUniqueName: string };\n\n/**\n * Creates a new application.\n *\n * @param gqlClient - The GraphQL client instance used to execute the mutation.\n * @returns A function that accepts the arguments for creating an application and returns a promise resolving to the created application.\n */\nexport const applicationAccessTokenCreate = (gqlClient: GraphQLClient) => {\n  return async (args: CreateApplicationAccessTokenArgs): Promise<string> => {\n    const { applicationUniqueName, ...otherArgs } = args;\n    const application = await applicationRead(gqlClient)(applicationUniqueName);\n    const { createApplicationAccessToken: applicationAccessToken } = await gqlClient.request(\n      createApplicationAccessToken,\n      {\n        ...otherArgs,\n        applicationId: application.id,\n      },\n    );\n    if (!applicationAccessToken.token) {\n      throw new Error(\"Failed to create application access token\");\n    }\n    return applicationAccessToken.token;\n  };\n};\n","/**\n * Sets the default values for a cluster service.\n *\n * @param args - The arguments for creating a cluster service.\n * @returns The modified arguments with default values set.\n */\nexport function setClusterServiceDefaults<\n  Args extends {\n    size?: \"SMALL\" | \"MEDIUM\" | \"LARGE\" | \"CUSTOM\" | null | undefined;\n    type?: \"SHARED\" | \"DEDICATED\" | null | undefined;\n  },\n>(args: Args): Args {\n  return {\n    ...args,\n    size: args.size ?? \"SMALL\",\n    type: args.type ?? \"SHARED\",\n  };\n}\n","import type { CreateBlockchainNetworkArgs } from \"../graphql/blockchain-network.js\";\nimport { setClusterServiceDefaults } from \"./cluster-service-defaults.js\";\n\n/**\n * Sets the default values for a blockchain network.\n *\n * @param args - The arguments for creating a blockchain network.\n * @returns The modified arguments with default values set.\n */\nexport function setNetworkDefaults(\n  args: Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\">,\n): Omit<CreateBlockchainNetworkArgs, \"applicationUniqueName\"> {\n  const clusterServiceArgs = setClusterServiceDefaults(args);\n  if (args.consensusAlgorithm === \"BESU_QBFT\") {\n    return {\n      ...clusterServiceArgs,\n      chainId: args.chainId ?? 46040,\n      contractSizeLimit: args.contractSizeLimit ?? 2147483647,\n      evmStackSize: args.evmStackSize ?? 2048,\n      gasLimit: args.gasLimit ?? \"9007199254740991\",\n      gasPrice: args.gasPrice ?? 0,\n      secondsPerBlock: args.secondsPerBlock ?? 2,\n    };\n  }\n  return clusterServiceArgs;\n}\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { setNetworkDefaults } from \"../defaults/blockchain-network-defaults.js\";\n\n/**\n * Fragment containing core blockchain network fields.\n */\nconst BlockchainNetworkFragment = graphql(`\n  fragment BlockchainNetwork on BlockchainNetwork {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    ... on BesuQBFTBlockchainNetwork {\n      chainId\n    }\n    ... on BesuIbftv2BlockchainNetwork {\n      chainId\n    }\n    ... on GethPoWBlockchainNetwork {\n      chainId\n    }\n    ... on GethPoSRinkebyBlockchainNetwork {\n      chainId\n    }\n    ... on GethVenidiumBlockchainNetwork {\n      chainId\n    }\n    ... on GethGoerliBlockchainNetwork {\n      chainId\n    }\n    ... on AvalancheBlockchainNetwork {\n      chainId\n    }\n    ... on AvalancheFujiBlockchainNetwork {\n      chainId\n    }\n    ... on BscPoWBlockchainNetwork {\n      chainId\n    }\n    ... on BscPoWTestnetBlockchainNetwork {\n      chainId\n    }\n    ... on PolygonBlockchainNetwork {\n      chainId\n    }\n    ... on PolygonMumbaiBlockchainNetwork {\n      chainId\n    }\n    ... on PolygonEdgePoABlockchainNetwork {\n      chainId\n    }\n    ... on QuorumQBFTBlockchainNetwork {\n      chainId\n    }\n    ... on GethCliqueBlockchainNetwork {\n      chainId\n    }\n    blockchainNodes {\n      ... on BlockchainNode {\n        id\n        name\n        uniqueName\n        endpoints {\n          id\n          label\n          displayValue\n        }\n      }\n    }\n  }\n`);\n\n/**\n * Type representing a blockchain network entity.\n */\nexport type BlockchainNetwork = ResultOf<typeof BlockchainNetworkFragment>;\n\n/**\n * Query to fetch blockchain networks for an application.\n */\nconst getBlockchainNetworks = graphql(\n  `\n  query getBlockchainNetworks($applicationUniqueName: String!) {\n    blockchainNetworksByUniqueName(applicationUniqueName: $applicationUniqueName) {\n      items {\n        ...BlockchainNetwork\n      }\n    }\n  }\n  `,\n  [BlockchainNetworkFragment],\n);\n\n/**\n * Query to fetch a specific blockchain network.\n */\nconst getBlockchainNetwork = graphql(\n  `\n  query getBlockchainNetwork($uniqueName: String!) {\n    blockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n      ...BlockchainNetwork\n    }\n  }\n  `,\n  [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to create a new blockchain network.\n */\nconst createBlockchainNetwork = graphql(\n  `\n  mutation createBlockchainNetwork(\n    $applicationId: ID!\n    $chainId: Int\n    $consensusAlgorithm: ConsensusAlgorithm!\n    $contractSizeLimit: Int\n    $evmStackSize: Int\n    $gasLimit: String\n    $gasPrice: Int\n    $name: String!\n    $nodeName: String!\n    $secondsPerBlock: Int\n    $provider: String!\n    $region: String!\n    $size: ClusterServiceSize\n    $type: ClusterServiceType\n    $batchTimeout: Float\n    $maxMessageCount: Int\n    $absoluteMaxBytes: Int\n    $preferredMaxBytes: Int\n    $endorsementPolicy: FabricEndorsementPolicy\n    $maxCodeSize: Int\n    $txnSizeLimit: Int\n    $besuIbft2Genesis: BesuIbft2GenesisInput\n    $besuQbftGenesis: BesuQbftGenesisInput\n    $quorumGenesis: QuorumGenesisInput\n    $externalNodes: [BlockchainNetworkExternalNodeInput!]\n    $privateKeyId: ID\n  ) {\n    createBlockchainNetwork(\n      applicationId: $applicationId\n      chainId: $chainId\n      consensusAlgorithm: $consensusAlgorithm\n      contractSizeLimit: $contractSizeLimit\n      evmStackSize: $evmStackSize\n      gasLimit: $gasLimit\n      gasPrice: $gasPrice\n      name: $name\n      nodeName: $nodeName\n      secondsPerBlock: $secondsPerBlock\n      provider: $provider\n      region: $region\n      size: $size\n      type: $type\n      batchTimeout: $batchTimeout\n      maxMessageCount: $maxMessageCount\n      absoluteMaxBytes: $absoluteMaxBytes\n      preferredMaxBytes: $preferredMaxBytes\n      endorsementPolicy: $endorsementPolicy\n      maxCodeSize: $maxCodeSize\n      txnSizeLimit: $txnSizeLimit\n      besuIbft2Genesis: $besuIbft2Genesis\n      besuQbftGenesis: $besuQbftGenesis\n      quorumGenesis: $quorumGenesis\n      externalNodes: $externalNodes\n      keyMaterial: $privateKeyId\n    ) {\n      ...BlockchainNetwork\n    }\n  }\n  `,\n  [BlockchainNetworkFragment],\n);\n\n/**\n * Arguments required to create a blockchain network.\n */\nexport type CreateBlockchainNetworkArgs = Omit<VariablesOf<typeof createBlockchainNetwork>, \"applicationId\"> & {\n  applicationUniqueName: string;\n};\n\n/**\n * Mutation to delete a blockchain network.\n */\nconst deleteBlockchainNetwork = graphql(\n  `\n  mutation deleteBlockchainNetwork($uniqueName: String!) {\n    deleteBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n      ...BlockchainNetwork\n    }\n  }\n  `,\n  [BlockchainNetworkFragment],\n);\n\n/**\n * Mutation to restart a blockchain network.\n */\nconst restartBlockchainNetwork = graphql(\n  `\n  mutation RestartBlockchainNetwork($uniqueName: String!) {\n    restartBlockchainNetworkByUniqueName(uniqueName: $uniqueName) {\n      ...BlockchainNetwork\n    }\n  }\n  `,\n  [BlockchainNetworkFragment],\n);\n\n/**\n * Creates a function to list blockchain networks for a given application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches networks for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const blockchainNetworkList = (gqlClient: GraphQLClient) => {\n  return async (applicationUniqueName: string) => {\n    const {\n      blockchainNetworksByUniqueName: { items },\n    } = await gqlClient.request(getBlockchainNetworks, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single network by unique name\n * @throws If the network cannot be found or the request fails\n */\nexport const blockchainNetworkRead = (gqlClient: GraphQLClient) => {\n  return async (blockchainNetworkUniqueName: string) => {\n    const { blockchainNetworkByUniqueName } = await gqlClient.request(getBlockchainNetwork, {\n      uniqueName: blockchainNetworkUniqueName,\n    });\n    return blockchainNetworkByUniqueName;\n  };\n};\n\n/**\n * Creates a function to create a new blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new network with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const blockchainNetworkCreate = (\n  gqlClient: GraphQLClient,\n): ((args: CreateBlockchainNetworkArgs) => Promise<BlockchainNetwork>) => {\n  return async (args: CreateBlockchainNetworkArgs) => {\n    const { applicationUniqueName, ...otherArgs } = args;\n    const application = await applicationRead(gqlClient)(applicationUniqueName);\n    const blockchainNetworkArgs = setNetworkDefaults(otherArgs);\n    const { createBlockchainNetwork: blockchainNetwork } = await gqlClient.request(createBlockchainNetwork, {\n      ...blockchainNetworkArgs,\n      applicationId: application.id,\n    });\n    return blockchainNetwork;\n  };\n};\n\n/**\n * Creates a function to delete a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that deletes a network by unique name\n * @throws If the network cannot be found or the deletion fails\n */\nexport const blockchainNetworkDelete = (gqlClient: GraphQLClient) => {\n  return async (blockchainNetworkUniqueName: string) => {\n    const { deleteBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n      deleteBlockchainNetwork,\n      {\n        uniqueName: blockchainNetworkUniqueName,\n      },\n    );\n    return blockchainNetwork;\n  };\n};\n\n/**\n * Creates a function to restart a blockchain network.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a network by unique name\n * @throws If the network cannot be found or the restart fails\n */\nexport const blockchainNetworkRestart =\n  (gqlClient: GraphQLClient) =>\n  async (blockchainNetworkUniqueName: string): Promise<BlockchainNetwork> => {\n    const { restartBlockchainNetworkByUniqueName: blockchainNetwork } = await gqlClient.request(\n      restartBlockchainNetwork,\n      { uniqueName: blockchainNetworkUniqueName },\n    );\n    return blockchainNetwork;\n  };\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { blockchainNetworkRead } from \"./blockchain-network.js\";\n\n/**\n * Fragment containing core blockchain node fields.\n */\nconst BlockchainNodeFragment = graphql(`\n  fragment BlockchainNode on BlockchainNode {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    isEvm\n    endpoints {\n      id\n      label\n      displayValue\n    }\n    credentials {\n      id\n      label\n      displayValue\n    }\n    blockchainNetwork {\n      ... on AbstractClusterService {\n        id\n        name\n        uniqueName\n        ... on BesuQBFTBlockchainNetwork {\n          chainId\n        }\n        ... on BesuIbftv2BlockchainNetwork {\n          chainId\n        }\n        ... on GethPoWBlockchainNetwork {\n          chainId\n        }\n        ... on GethPoSRinkebyBlockchainNetwork {\n          chainId\n        }\n        ... on GethVenidiumBlockchainNetwork {\n          chainId\n        }\n        ... on GethGoerliBlockchainNetwork {\n          chainId\n        }\n        ... on AvalancheBlockchainNetwork {\n          chainId\n        }\n        ... on AvalancheFujiBlockchainNetwork {\n          chainId\n        }\n        ... on BscPoWBlockchainNetwork {\n          chainId\n        }\n        ... on BscPoWTestnetBlockchainNetwork {\n          chainId\n        }\n        ... on PolygonBlockchainNetwork {\n          chainId\n        }\n        ... on PolygonMumbaiBlockchainNetwork {\n          chainId\n        }\n        ... on PolygonEdgePoABlockchainNetwork {\n          chainId\n        }\n        ... on QuorumQBFTBlockchainNetwork {\n          chainId\n        }\n        ... on GethCliqueBlockchainNetwork {\n          chainId\n        }\n      }\n    }\n    privateKeys {\n      ... on PrivateKey {\n        id\n        name\n        privateKeyType\n        address\n      }\n    }\n  }\n`);\n\n/**\n * Type representing a blockchain node entity.\n */\nexport type BlockchainNode = ResultOf<typeof BlockchainNodeFragment>;\n\n/**\n * Query to fetch blockchain nodes for an application.\n */\nconst getBlockchainNodes = graphql(\n  `\n    query getBlockchainNodes($applicationUniqueName: String!) {\n      blockchainNodesByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...BlockchainNode\n        }\n      }\n    }\n  `,\n  [BlockchainNodeFragment],\n);\n\n/**\n * Query to fetch a specific blockchain node.\n */\nconst getBlockchainNode = graphql(\n  `\n    query getBlockchainNode($uniqueName: String!) {\n      blockchainNodeByUniqueName(uniqueName: $uniqueName) {\n        ...BlockchainNode\n      }\n    }\n  `,\n  [BlockchainNodeFragment],\n);\n\n/**\n * Mutation to create a blockchain node.\n */\nconst createBlockchainNode = graphql(\n  `\n    mutation createBlockchainNode(\n      $applicationId: ID!\n      $blockchainNetworkId: ID!\n      $name: String!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n      $nodeType: NodeType\n      $keyMaterial: ID\n    ) {\n      createBlockchainNode(\n        applicationId: $applicationId\n        blockchainNetworkId: $blockchainNetworkId\n        name: $name\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n        nodeType: $nodeType\n        keyMaterial: $keyMaterial\n      ) {\n        ...BlockchainNode\n      }\n    }\n  `,\n  [BlockchainNodeFragment],\n);\n\n/**\n * Arguments required to create a blockchain node.\n */\nexport type CreateBlockchainNodeArgs = Omit<\n  VariablesOf<typeof createBlockchainNode>,\n  \"applicationId\" | \"blockchainNetworkId\"\n> & {\n  applicationUniqueName: string;\n  blockchainNetworkUniqueName: string;\n};\n\n/**\n * Mutation to restart a blockchain node.\n */\nconst restartBlockchainNode = graphql(\n  `\n    mutation RestartBlockchainNode($uniqueName: String!) {\n      restartBlockchainNodeByUniqueName(uniqueName: $uniqueName) {\n        ...BlockchainNode\n      }\n    }\n  `,\n  [BlockchainNodeFragment],\n);\n\n/**\n * Creates a function to list blockchain nodes for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches blockchain nodes for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const blockchainNodeList = (gqlClient: GraphQLClient) => {\n  return async (applicationUniqueName: string): Promise<BlockchainNode[]> => {\n    const {\n      blockchainNodesByUniqueName: { items },\n    } = await gqlClient.request(getBlockchainNodes, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single blockchain node by unique name\n * @throws If the blockchain node cannot be found or the request fails\n */\nexport const blockchainNodeRead = (gqlClient: GraphQLClient) => {\n  return async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n    const { blockchainNodeByUniqueName } = await gqlClient.request(getBlockchainNode, {\n      uniqueName: blockchainNodeUniqueName,\n    });\n    return blockchainNodeByUniqueName;\n  };\n};\n\n/**\n * Creates a function to create a new blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new blockchain node with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const blockchainNodeCreate = (gqlClient: GraphQLClient) => {\n  return async (args: CreateBlockchainNodeArgs): Promise<BlockchainNode> => {\n    const { applicationUniqueName, blockchainNetworkUniqueName, ...otherArgs } = args;\n    const [application, blockchainNetwork] = await Promise.all([\n      applicationRead(gqlClient)(applicationUniqueName),\n      blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),\n    ]);\n    const { createBlockchainNode: blockchainNode } = await gqlClient.request(createBlockchainNode, {\n      ...otherArgs,\n      applicationId: application.id,\n      blockchainNetworkId: blockchainNetwork.id,\n    });\n    return blockchainNode;\n  };\n};\n\n/**\n * Creates a function to restart a blockchain node.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a blockchain node by unique name\n * @throws If the blockchain node cannot be found or the restart fails\n */\nexport const blockchainNodeRestart =\n  (gqlClient: GraphQLClient) =>\n  async (blockchainNodeUniqueName: string): Promise<BlockchainNode> => {\n    const { restartBlockchainNodeByUniqueName: blockchainNode } = await gqlClient.request(restartBlockchainNode, {\n      uniqueName: blockchainNodeUniqueName,\n    });\n    return blockchainNode;\n  };\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * Fragment containing core custom deployment fields.\n */\nconst CustomDeploymentFragment = graphql(`\n  fragment CustomDeployment on CustomDeployment {\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    endpoints {\n      id\n      label\n      displayValue\n    }\n    credentials {\n      id\n      label\n      displayValue\n    }\n  }\n`);\n\n/**\n * Type representing a custom deployment entity.\n */\nexport type CustomDeployment = ResultOf<typeof CustomDeploymentFragment>;\n\n/**\n * Query to fetch custom deployments for an application.\n */\nconst getCustomDeployments = graphql(\n  `\n    query getCustomDeployments($applicationUniqueName: String!) {\n      customDeploymentsByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...CustomDeployment\n        }\n      }\n    }\n  `,\n  [CustomDeploymentFragment],\n);\n\n/**\n * Query to fetch a specific custom deployment.\n */\nconst getCustomDeployment = graphql(\n  `\n    query getCustomDeployment($uniqueName: String!) {\n      customDeploymentByUniqueName(uniqueName: $uniqueName) {\n        ...CustomDeployment\n      }\n    }\n  `,\n  [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to edit a custom deployment.\n */\nconst editCustomDeployment = graphql(\n  `\n    mutation EditCustomDeployment($uniqueName: String!, $imageTag: String) {\n      editCustomDeploymentByUniqueName(uniqueName: $uniqueName, imageTag: $imageTag) {\n        ...CustomDeployment\n      }\n    }\n  `,\n  [CustomDeploymentFragment],\n);\n\n/**\n * Mutation to create a custom deployment.\n */\nconst createCustomDeployment = graphql(\n  `\n    mutation CreateCustomDeployment(\n      $applicationId: ID!\n      $name: String!\n      $imageTag: String!\n      $imageName: String!\n      $imageRepository: String!\n      $environmentVariables: JSON\n      $port: Int!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n    ) {\n      createCustomDeployment(\n        applicationId: $applicationId\n        name: $name\n        imageTag: $imageTag\n        imageName: $imageName\n        imageRepository: $imageRepository\n        port: $port\n        environmentVariables: $environmentVariables\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n      ) {\n        ...CustomDeployment\n      }\n    }\n  `,\n  [CustomDeploymentFragment],\n);\n\n/**\n * Arguments required to create a custom deployment.\n */\nexport type CreateCustomDeploymentArgs = Omit<VariablesOf<typeof createCustomDeployment>, \"applicationId\"> & {\n  applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart a custom deployment.\n */\nconst restartCustomDeployment = graphql(\n  `\n    mutation RestartCustomDeployment($uniqueName: String!) {\n      restartCustomDeploymentByUniqueName(uniqueName: $uniqueName) {\n        ...CustomDeployment\n      }\n    }\n  `,\n  [CustomDeploymentFragment],\n);\n\n/**\n * Creates a function to list custom deployments for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches custom deployments for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const customdeploymentList = (\n  gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<CustomDeployment[]>) => {\n  return async (applicationUniqueName: string) => {\n    const {\n      customDeploymentsByUniqueName: { items },\n    } = await gqlClient.request(getCustomDeployments, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single custom deployment by unique name\n * @throws If the custom deployment cannot be found or the request fails\n */\nexport const customdeploymentRead = (\n  gqlClient: GraphQLClient,\n): ((customDeploymentUniqueName: string) => Promise<CustomDeployment>) => {\n  return async (customDeploymentUniqueName: string) => {\n    const { customDeploymentByUniqueName: customDeployment } = await gqlClient.request(getCustomDeployment, {\n      uniqueName: customDeploymentUniqueName,\n    });\n    return customDeployment;\n  };\n};\n\n/**\n * Creates a function to update a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that updates a custom deployment with a new image tag\n * @throws If the custom deployment cannot be found or the update fails\n */\nexport const customdeploymentUpdate = (\n  gqlClient: GraphQLClient,\n): ((customDeploymentUniqueName: string, imageTag: string) => Promise<CustomDeployment>) => {\n  return async (customDeploymentUniqueName: string, imageTag: string) => {\n    const { editCustomDeploymentByUniqueName: cd } = await gqlClient.request(editCustomDeployment, {\n      uniqueName: customDeploymentUniqueName,\n      imageTag,\n    });\n    return cd;\n  };\n};\n\n/**\n * Creates a function to create a new custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a new custom deployment with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const customdeploymentCreate = (\n  gqlClient: GraphQLClient,\n): ((args: CreateCustomDeploymentArgs) => Promise<CustomDeployment>) => {\n  return async (args: CreateCustomDeploymentArgs) => {\n    const { applicationUniqueName, ...otherArgs } = args;\n    const application = await applicationRead(gqlClient)(applicationUniqueName);\n    const { createCustomDeployment: customDeployment } = await gqlClient.request(createCustomDeployment, {\n      ...otherArgs,\n      applicationId: application.id,\n    });\n    return customDeployment;\n  };\n};\n\n/**\n * Creates a function to restart a custom deployment.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a custom deployment by unique name\n * @throws If the custom deployment cannot be found or the restart fails\n */\nexport const customDeploymentRestart =\n  (gqlClient: GraphQLClient) =>\n  async (customDeploymentUniqueName: string): Promise<CustomDeployment> => {\n    const { restartCustomDeploymentByUniqueName: customDeployment } = await gqlClient.request(restartCustomDeployment, {\n      uniqueName: customDeploymentUniqueName,\n    });\n    return customDeployment;\n  };\n","import { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * Query to fetch Foundry environment configuration for a blockchain node.\n */\nconst getFoundryEnvConfig = graphql(\n  `\n    query GetFoundryEnvConfig($blockchainNodeUniqueName: String!) {\n      foundryEnvConfigByUniqueName(blockchainNodeUniqueName: $blockchainNodeUniqueName)\n    }\n  `,\n);\n\n/**\n * Variables for the Foundry environment config query.\n */\nexport type GetFoundryEnvConfigVariables = VariablesOf<typeof getFoundryEnvConfig>;\n\n/**\n * Result type for the Foundry environment config query.\n */\nexport type GetFoundryEnvConfigResult = ResultOf<typeof getFoundryEnvConfig>;\n\n/**\n * Creates a function to fetch Foundry environment configuration.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches Foundry environment configuration for a blockchain node\n * @throws If the blockchain node cannot be found or the request fails\n */\nexport const getEnv = (gqlClient: GraphQLClient) => {\n  return async (blockchainNodeUniqueName: string): Promise<Record<string, string>> => {\n    const { foundryEnvConfigByUniqueName } = await gqlClient.request(getFoundryEnvConfig, { blockchainNodeUniqueName });\n    return foundryEnvConfigByUniqueName as Record<string, string>;\n  };\n};\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { blockchainNetworkRead } from \"@/graphql/blockchain-network.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\n\n/**\n * GraphQL fragment containing core load balancer fields.\n */\nconst LoadBalancerFragment = graphql(`\n  fragment LoadBalancer on LoadBalancer {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    endpoints {\n      id\n      label\n      displayValue\n    }\n  }\n`);\n\n/**\n * Type representing a load balancer entity.\n */\nexport type LoadBalancer = ResultOf<typeof LoadBalancerFragment>;\n\n/**\n * Query to fetch a specific load balancer.\n */\nconst getLoadBalancer = graphql(\n  `\n    query GetLoadBalancer($uniqueName: String!) {\n      loadBalancerByUniqueName(uniqueName: $uniqueName) {\n        ...LoadBalancer\n      }\n    }\n  `,\n  [LoadBalancerFragment],\n);\n\n/**\n * Query to fetch all load balancers for an application.\n */\nconst getLoadBalancers = graphql(\n  `\n    query getLoadBalancers($applicationUniqueName: String!) {\n      loadBalancersByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...LoadBalancer\n        }\n      }\n    }\n  `,\n  [LoadBalancerFragment],\n);\n\n/**\n * Mutation to create a load balancer.\n */\nconst createLoadBalancer = graphql(\n  `\n    mutation createLoadBalancer(\n      $applicationId: ID!\n      $blockchainNetworkId: ID!\n      $name: String!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n      $connectedNodes: [ID!]!\n    ) {\n      createLoadBalancer(\n        applicationId: $applicationId\n        blockchainNetworkId: $blockchainNetworkId\n        name: $name\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n        connectedNodes: $connectedNodes\n      ) {\n        ...LoadBalancer\n      }\n    }\n  `,\n  [LoadBalancerFragment],\n);\n\n/**\n * Arguments required to create a load balancer.\n */\nexport type CreateLoadBalancerArgs = Omit<\n  VariablesOf<typeof createLoadBalancer>,\n  \"applicationId\" | \"blockchainNetworkId\" | \"connectedNodes\"\n> & {\n  applicationUniqueName: string;\n  blockchainNetworkUniqueName: string;\n  connectedNodesUniqueNames: string[];\n};\n\n/**\n * Mutation to restart a load balancer.\n */\nconst restartLoadBalancer = graphql(\n  `\n    mutation RestartLoadBalancer($uniqueName: String!) {\n      restartLoadBalancerByUniqueName(uniqueName: $uniqueName) {\n        ...LoadBalancer\n      }\n    }\n  `,\n  [LoadBalancerFragment],\n);\n\n/**\n * Creates a function to fetch a specific load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single load balancer by unique name\n * @throws If the load balancer cannot be found or the request fails\n */\nexport const loadBalancerRead = (\n  gqlClient: GraphQLClient,\n): ((loadBalancerUniqueName: string) => Promise<LoadBalancer>) => {\n  return async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n    const { loadBalancerByUniqueName: loadBalancer } = await gqlClient.request(getLoadBalancer, {\n      uniqueName: loadBalancerUniqueName,\n    });\n    return loadBalancer as LoadBalancer;\n  };\n};\n\n/**\n * Creates a function to list load balancers for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches load balancers for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const loadBalancerList = (gqlClient: GraphQLClient) => {\n  return async (applicationUniqueName: string): Promise<LoadBalancer[]> => {\n    const {\n      loadBalancersByUniqueName: { items },\n    } = await gqlClient.request(getLoadBalancers, { applicationUniqueName });\n    return items as LoadBalancer[];\n  };\n};\n\n/**\n * Creates a function to create a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates a load balancer\n * @throws If the load balancer cannot be created or the request fails\n */\nexport const loadBalancerCreate = (gqlClient: GraphQLClient) => {\n  return async (args: CreateLoadBalancerArgs): Promise<LoadBalancer> => {\n    const { applicationUniqueName, blockchainNetworkUniqueName, connectedNodesUniqueNames, ...otherArgs } = args;\n    const [application, blockchainNetwork, connectedNodes] = await Promise.all([\n      applicationRead(gqlClient)(applicationUniqueName),\n      blockchainNetworkRead(gqlClient)(blockchainNetworkUniqueName),\n      Promise.all(connectedNodesUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName))),\n    ]);\n    const { createLoadBalancer: loadBalancer } = await gqlClient.request(createLoadBalancer, {\n      ...otherArgs,\n      applicationId: application.id,\n      blockchainNetworkId: blockchainNetwork.id,\n      connectedNodes: connectedNodes.map((node) => node.id),\n    });\n    return loadBalancer as LoadBalancer;\n  };\n};\n\n/**\n * Creates a function to restart a load balancer.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts a load balancer\n * @throws If the load balancer cannot be restarted or the request fails\n */\nexport const loadBalancerRestart =\n  (gqlClient: GraphQLClient) =>\n  async (loadBalancerUniqueName: string): Promise<LoadBalancer> => {\n    const { restartLoadBalancerByUniqueName: loadBalancer } = await gqlClient.request(restartLoadBalancer, {\n      uniqueName: loadBalancerUniqueName,\n    });\n    return loadBalancer as LoadBalancer;\n  };\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { blockchainNodeRead } from \"@/graphql/blockchain-node.js\";\nimport { loadBalancerRead } from \"@/graphql/load-balancer.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL fragment containing core insights fields.\n */\nconst InsightsFragment = graphql(`\n  fragment Insights on Insights {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    insightsCategory\n    endpoints {\n      id\n      label\n      displayValue\n    }\n    credentials {\n      id\n      label\n      displayValue\n    }\n  }\n`);\n\n/**\n * Type representing an insights entity.\n */\nexport type Insights = ResultOf<typeof InsightsFragment>;\n\n/**\n * Query to fetch insights for an application.\n */\nconst getInsights = graphql(\n  `\n    query GetInsights($applicationUniqueName: String!) {\n      insightsListByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...Insights\n        }\n      }\n    }\n  `,\n  [InsightsFragment],\n);\n\n/**\n * Query to fetch a specific insight.\n */\nconst getInsight = graphql(\n  `\n    query GetInsight($uniqueName: String!) {\n      insightsByUniqueName(uniqueName: $uniqueName) {\n        ...Insights\n      }\n    }\n  `,\n  [InsightsFragment],\n);\n\n/**\n * Mutation to create insights.\n */\nconst createInsights = graphql(\n  `\n    mutation CreateInsights(\n      $applicationId: ID!\n      $name: String!\n      $insightsCategory: InsightsCategory!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n      $blockchainNode: ID\n      $loadBalancer: ID\n    ) {\n      createInsights(\n        applicationId: $applicationId\n        name: $name\n        insightsCategory: $insightsCategory\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n        blockchainNode: $blockchainNode\n        loadBalancer: $loadBalancer\n      ) {\n        ...Insights\n      }\n    }\n  `,\n  [InsightsFragment],\n);\n\n/**\n * Arguments required to create insights.\n */\nexport type CreateInsightsArgs = Omit<\n  VariablesOf<typeof createInsights>,\n  \"applicationId\" | \"blockchainNode\" | \"loadBalancer\"\n> & {\n  applicationUniqueName: string;\n  blockchainNodeUniqueName?: string;\n  loadBalancerUniqueName?: string;\n};\n\n/**\n * Mutation to restart insights.\n */\nconst restartInsights = graphql(\n  `\n    mutation RestartInsights($uniqueName: String!) {\n      restartInsightsByUniqueName(uniqueName: $uniqueName) {\n        ...Insights\n      }\n    }\n  `,\n  [InsightsFragment],\n);\n\n/**\n * Creates a function to list insights for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches insights for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const insightsList = (gqlClient: GraphQLClient): ((applicationUniqueName: string) => Promise<Insights[]>) => {\n  return async (applicationUniqueName: string) => {\n    const {\n      insightsListByUniqueName: { items },\n    } = await gqlClient.request(getInsights, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific insight.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single insight by unique name\n * @throws If the insight cannot be found or the request fails\n */\nexport const insightsRead = (gqlClient: GraphQLClient): ((insightsUniqueName: string) => Promise<Insights>) => {\n  return async (insightsUniqueName: string) => {\n    const { insightsByUniqueName: insights } = await gqlClient.request(getInsight, { uniqueName: insightsUniqueName });\n    return insights;\n  };\n};\n\n/**\n * Creates a function to create new insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new insights with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const insightsCreate = (gqlClient: GraphQLClient): ((args: CreateInsightsArgs) => Promise<Insights>) => {\n  return async (args: CreateInsightsArgs) => {\n    const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, ...otherArgs } = args;\n    const [application, blockchainNode, loadBalancer] = await Promise.all([\n      applicationRead(gqlClient)(applicationUniqueName),\n      blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(undefined),\n      loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(undefined),\n    ]);\n    const { createInsights: insights } = await gqlClient.request(createInsights, {\n      ...otherArgs,\n      applicationId: application.id,\n      blockchainNode: blockchainNode?.id,\n      loadBalancer: loadBalancer?.id,\n    });\n    return insights;\n  };\n};\n\n/**\n * Creates a function to restart insights.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts insights by unique name\n * @throws If the insights cannot be found or the restart fails\n */\nexport const insightsRestart =\n  (gqlClient: GraphQLClient) =>\n  async (insightsUniqueName: string): Promise<Insights> => {\n    const { restartInsightsByUniqueName: insights } = await gqlClient.request(restartInsights, {\n      uniqueName: insightsUniqueName,\n    });\n    return insights;\n  };\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL fragment containing core integration fields.\n */\nconst IntegrationFragment = graphql(`\n  fragment Integration on Integration {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    integrationType\n    endpoints {\n      id\n      label\n      displayValue\n    }\n    credentials {\n      id\n      label\n      displayValue\n    }\n  }\n`);\n\n/**\n * Type representing an integration tool entity.\n */\nexport type IntegrationTool = ResultOf<typeof IntegrationFragment>;\n\n/**\n * Query to fetch integrations for an application.\n */\nconst getIntegrations = graphql(\n  `\n    query GetIntegrations($applicationUniqueName: String!) {\n      integrationsByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...Integration\n        }\n      }\n    }\n  `,\n  [IntegrationFragment],\n);\n\n/**\n * Query to fetch a specific integration.\n */\nconst getIntegration = graphql(\n  `\n    query GetIntegration($uniqueName: String!) {\n      integrationByUniqueName(uniqueName: $uniqueName) {\n        ...Integration\n      }\n    }\n  `,\n  [IntegrationFragment],\n);\n\n/**\n * Mutation to create a new integration.\n */\nconst createIntegration = graphql(\n  `\n    mutation CreateIntegration(\n      $applicationId: ID!\n      $name: String!\n      $integrationType: IntegrationType!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n    ) {\n      createIntegration(\n        applicationId: $applicationId\n        name: $name\n        integrationType: $integrationType\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n      ) {\n        ...Integration\n      }\n    }\n  `,\n  [IntegrationFragment],\n);\n\n/**\n * Arguments required to create an integration tool.\n */\nexport type CreateIntegrationToolArgs = Omit<VariablesOf<typeof createIntegration>, \"applicationId\"> & {\n  applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart an integration.\n */\nconst restartIntegrationTool = graphql(\n  `\n    mutation RestartIntegrationTool($uniqueName: String!) {\n      restartIntegrationByUniqueName(uniqueName: $uniqueName) {\n        ...Integration\n      }\n    }\n  `,\n  [IntegrationFragment],\n);\n\n/**\n * Creates a function to list integration tools for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches integration tools for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const integrationToolList = (\n  gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<IntegrationTool[]>) => {\n  return async (applicationUniqueName: string) => {\n    const {\n      integrationsByUniqueName: { items },\n    } = await gqlClient.request(getIntegrations, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single integration tool by unique name\n * @throws If the integration tool cannot be found or the request fails\n */\nexport const integrationToolRead = (\n  gqlClient: GraphQLClient,\n): ((integrationUniqueName: string) => Promise<IntegrationTool>) => {\n  return async (integrationUniqueName: string) => {\n    const { integrationByUniqueName } = await gqlClient.request(getIntegration, { uniqueName: integrationUniqueName });\n    return integrationByUniqueName;\n  };\n};\n\n/**\n * Creates a function to create a new integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new integration tool with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const integrationToolCreate = (\n  gqlClient: GraphQLClient,\n): ((args: CreateIntegrationToolArgs) => Promise<IntegrationTool>) => {\n  return async (args: CreateIntegrationToolArgs) => {\n    const { applicationUniqueName, ...otherArgs } = args;\n    const application = await applicationRead(gqlClient)(applicationUniqueName);\n    const { createIntegration: integration } = await gqlClient.request(createIntegration, {\n      ...otherArgs,\n      applicationId: application.id,\n    });\n    return integration;\n  };\n};\n\n/**\n * Creates a function to restart an integration tool.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts integration tool by unique name\n * @throws If the integration tool cannot be found or the restart fails\n */\nexport const integrationToolRestart =\n  (gqlClient: GraphQLClient) =>\n  async (integrationUniqueName: string): Promise<IntegrationTool> => {\n    const { restartIntegrationByUniqueName: integration } = await gqlClient.request(restartIntegrationTool, {\n      uniqueName: integrationUniqueName,\n    });\n    return integration;\n  };\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL fragment containing core storage fields.\n */\nconst StorageFragment = graphql(`\n  fragment Storage on Storage {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    storageProtocol\n    endpoints {\n      id\n      label\n      displayValue\n    }\n    credentials {\n      id\n      label\n      displayValue\n    }\n  }\n`);\n\n/**\n * Type representing a storage entity.\n */\nexport type Storage = ResultOf<typeof StorageFragment>;\n\n/**\n * Query to fetch storages for an application.\n */\nconst getStorages = graphql(\n  `\n    query GetStorages($applicationUniqueName: String!) {\n      storagesByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...Storage\n        }\n      }\n    }\n  `,\n  [StorageFragment],\n);\n\n/**\n * Query to fetch a specific storage.\n */\nconst getStorage = graphql(\n  `\n    query GetStorage($uniqueName: String!) {\n      storageByUniqueName(uniqueName: $uniqueName) {\n        ...Storage\n      }\n    }\n  `,\n  [StorageFragment],\n);\n\n/**\n * Mutation to create a new storage.\n */\nconst createStorage = graphql(\n  `\n    mutation CreateStorage(\n      $applicationId: ID!\n      $name: String!\n      $storageProtocol: StorageProtocol!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n    ) {\n      createStorage(\n        applicationId: $applicationId\n        name: $name\n        storageProtocol: $storageProtocol\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n      ) {\n        ...Storage\n      }\n    }\n  `,\n  [StorageFragment],\n);\n\n/**\n * Arguments required to create a storage.\n */\nexport type CreateStorageArgs = Omit<VariablesOf<typeof createStorage>, \"applicationId\"> & {\n  applicationUniqueName: string;\n};\n\n/**\n * Mutation to restart a storage.\n */\nconst restartStorage = graphql(\n  `\n    mutation RestartStorage($uniqueName: String!) {\n      restartStorageByUniqueName(uniqueName: $uniqueName) {\n        ...Storage\n      }\n    }\n  `,\n  [StorageFragment],\n);\n\n/**\n * Creates a function to list storages for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches storages for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const storageList = (gqlClient: GraphQLClient): ((applicationUniqueName: string) => Promise<Storage[]>) => {\n  return async (applicationUniqueName: string) => {\n    const {\n      storagesByUniqueName: { items },\n    } = await gqlClient.request(getStorages, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single storage by unique name\n * @throws If the storage cannot be found or the request fails\n */\nexport const storageRead = (gqlClient: GraphQLClient): ((storageUniqueName: string) => Promise<Storage>) => {\n  return async (storageUniqueName: string) => {\n    const { storageByUniqueName: storage } = await gqlClient.request(getStorage, { uniqueName: storageUniqueName });\n    return storage;\n  };\n};\n\n/**\n * Creates a function to create a new storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new storage with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const storageCreate = (gqlClient: GraphQLClient): ((args: CreateStorageArgs) => Promise<Storage>) => {\n  return async (args: CreateStorageArgs) => {\n    const { applicationUniqueName, ...otherArgs } = args;\n    const application = await applicationRead(gqlClient)(applicationUniqueName);\n    const { createStorage: storage } = await gqlClient.request(createStorage, {\n      ...otherArgs,\n      applicationId: application.id,\n    });\n    return storage;\n  };\n};\n\n/**\n * Creates a function to restart a storage.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts storage by unique name\n * @throws If the storage cannot be found or the restart fails\n */\nexport const storageRestart =\n  (gqlClient: GraphQLClient) =>\n  async (storageUniqueName: string): Promise<Storage> => {\n    const { restartStorageByUniqueName: storage } = await gqlClient.request(restartStorage, {\n      uniqueName: storageUniqueName,\n    });\n    return storage;\n  };\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\nimport { loadBalancerRead } from \"./load-balancer.js\";\nimport { storageRead } from \"./storage.js\";\n\n/**\n * GraphQL fragment containing core middleware fields.\n */\nconst MiddlewareFragment = graphql(`\n  fragment Middleware on Middleware {\n    __typename\n    id\n    uniqueName\n    name\n    status\n    healthStatus\n    provider\n    region\n    interface\n    entityVersion\n    serviceUrl\n    endpoints {\n      id\n      label\n      displayValue\n    }\n    credentials {\n      id\n      label\n      displayValue\n    }\n    ... on HAGraphMiddleware {\n      specVersion\n    }\n  }\n`);\n\n/**\n * Type representing a middleware entity.\n */\nexport type Middleware = ResultOf<typeof MiddlewareFragment>;\n\n/**\n * Query to fetch middlewares for an application.\n */\nconst getMiddlewares = graphql(\n  `\n    query GetMiddlewares($applicationUniqueName: String!) {\n      middlewaresByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...Middleware\n        }\n      }\n    }\n  `,\n  [MiddlewareFragment],\n);\n\n/**\n * Query to fetch a specific middleware.\n */\nconst getMiddleware = graphql(\n  `\n    query GetMiddleware($uniqueName: String!) {\n      middlewareByUniqueName(uniqueName: $uniqueName) {\n        ...Middleware\n      }\n    }\n  `,\n  [MiddlewareFragment],\n);\n\n/**\n * Query to fetch a specific middleware with subgraphs.\n */\nconst getGraphMiddlewareSubgraphs = graphql(\n  `\n    query GetMiddleware($uniqueName: String!, $noCache: Boolean) {\n      middlewareByUniqueName(uniqueName: $uniqueName) {\n        ...Middleware\n        ... on HAGraphMiddleware {\n          subgraphs(noCache: $noCache) {\n            name\n            graphqlQueryEndpoint {\n              displayValue\n              id\n            }\n          }\n        }\n      }\n    }\n  `,\n  [MiddlewareFragment],\n);\n\n/**\n * Type representing a middleware entity with subgraphs.\n */\nexport type MiddlewareWithSubgraphs = ResultOf<typeof getGraphMiddlewareSubgraphs>[\"middlewareByUniqueName\"];\n\n/**\n * Mutation to create a new middleware.\n */\nconst createMiddleware = graphql(\n  `\n    mutation CreateMiddleware(\n      $applicationId: ID!\n      $name: String!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n      $interface: MiddlewareType!\n      $storageId: ID\n      $blockchainNodeId: ID\n      $loadBalancerId: ID\n      $abis: [SmartContractPortalMiddlewareAbiInputDto!]\n      $includePredeployedAbis: [String!]\n    ) {\n      createMiddleware(\n        applicationId: $applicationId\n        name: $name\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n        interface: $interface\n        storageId: $storageId\n        blockchainNodeId: $blockchainNodeId\n        loadBalancerId: $loadBalancerId\n        abis: $abis\n        includePredeployedAbis: $includePredeployedAbis\n      ) {\n        ...Middleware\n      }\n    }\n  `,\n  [MiddlewareFragment],\n);\n\n/**\n * Arguments required to create a middleware.\n */\nexport type CreateMiddlewareArgs = Omit<\n  VariablesOf<typeof createMiddleware>,\n  \"applicationId\" | \"blockchainNodeId\" | \"loadBalancerId\" | \"storageId\"\n> & {\n  applicationUniqueName: string;\n  blockchainNodeUniqueName?: string;\n  loadBalancerUniqueName?: string;\n  storageUniqueName?: string;\n};\n\n/**\n * Mutation to restart a middleware.\n */\nconst restartMiddleware = graphql(\n  `\n    mutation RestartMiddleware($uniqueName: String!) {\n      restartMiddlewareByUniqueName(uniqueName: $uniqueName) {\n        ...Middleware\n      }\n    }\n  `,\n  [MiddlewareFragment],\n);\n\n/**\n * Creates a function to list middlewares for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches middlewares for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const middlewareList = (\n  gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<Middleware[]>) => {\n  return async (applicationUniqueName: string): Promise<Middleware[]> => {\n    const {\n      middlewaresByUniqueName: { items },\n    } = await gqlClient.request(getMiddlewares, { applicationUniqueName });\n    return items;\n  };\n};\n\n/**\n * Creates a function to fetch a specific middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single middleware by unique name\n * @throws If the middleware cannot be found or the request fails\n */\nexport const middlewareRead = (gqlClient: GraphQLClient): ((middlewareUniqueName: string) => Promise<Middleware>) => {\n  return async (middlewareUniqueName: string): Promise<Middleware> => {\n    const { middlewareByUniqueName: middleware } = await gqlClient.request(getMiddleware, {\n      uniqueName: middlewareUniqueName,\n    });\n    return middleware;\n  };\n};\n\n/**\n * Creates a function to fetch a specific middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single middleware by unique name\n * @throws If the middleware cannot be found or the request fails\n */\nexport const graphMiddlewareSubgraphs = (\n  gqlClient: GraphQLClient,\n): ((middlewareUniqueName: string, noCache?: boolean) => Promise<MiddlewareWithSubgraphs>) => {\n  return async (middlewareUniqueName: string, noCache = false): Promise<MiddlewareWithSubgraphs> => {\n    const { middlewareByUniqueName: middleware } = await gqlClient.request(getGraphMiddlewareSubgraphs, {\n      uniqueName: middlewareUniqueName,\n      noCache,\n    });\n    return middleware;\n  };\n};\n\n/**\n * Creates a function to create a new middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new middleware with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const middlewareCreate = (gqlClient: GraphQLClient): ((args: CreateMiddlewareArgs) => Promise<Middleware>) => {\n  return async (args: CreateMiddlewareArgs): Promise<Middleware> => {\n    const { applicationUniqueName, blockchainNodeUniqueName, loadBalancerUniqueName, storageUniqueName, ...otherArgs } =\n      args;\n    const [application, blockchainNode, loadBalancer, storage] = await Promise.all([\n      applicationRead(gqlClient)(applicationUniqueName),\n      blockchainNodeUniqueName ? blockchainNodeRead(gqlClient)(blockchainNodeUniqueName) : Promise.resolve(undefined),\n      loadBalancerUniqueName ? loadBalancerRead(gqlClient)(loadBalancerUniqueName) : Promise.resolve(undefined),\n      storageUniqueName ? storageRead(gqlClient)(storageUniqueName) : Promise.resolve(undefined),\n    ]);\n    const { createMiddleware: middleware } = await gqlClient.request(createMiddleware, {\n      ...otherArgs,\n      applicationId: application.id,\n      blockchainNodeId: blockchainNode?.id,\n      loadBalancerId: loadBalancer?.id,\n      storageId: storage?.id,\n    });\n    return middleware;\n  };\n};\n\n/**\n * Creates a function to restart a middleware.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts middleware by unique name\n * @throws If the middleware cannot be found or the restart fails\n */\nexport const middlewareRestart =\n  (gqlClient: GraphQLClient) =>\n  async (middlewareUniqueName: string): Promise<Middleware> => {\n    const { restartMiddlewareByUniqueName: middleware } = await gqlClient.request(restartMiddleware, {\n      uniqueName: middlewareUniqueName,\n    });\n    return middleware;\n  };\n","import { type ResultOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\n\n/**\n * GraphQL query to fetch platform configuration.\n */\nconst getPlatformConfigQuery = graphql(\n  `\n    query platformConfig {\n      config {\n        smartContractSets {\n          id\n          sets {\n            id\n            name\n            featureflagged\n            image {\n              repository\n              tag\n              registry\n            }\n          }\n        }\n        deploymentEngineTargets {\n          id\n          name\n          disabled\n          clusters {\n            id\n            name\n            disabled\n          }\n        }\n        preDeployedAbis {\n          id\n          featureflagged\n          abis\n          label\n        }\n        sdkVersion\n        kits {\n          id\n          name\n          description\n          npmPackageName\n        }\n      }\n    }\n  `,\n  [],\n);\n\n/**\n * Type representing the platform configuration.\n */\nexport type PlatformConfig = ResultOf<typeof getPlatformConfigQuery>[\"config\"];\n\n/**\n * Creates a function to fetch the platform configuration.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches the platform configuration\n * @throws If the request fails\n */\nexport const getPlatformConfig = (gqlClient: GraphQLClient) => {\n  return async (): Promise<PlatformConfig> => {\n    const { config } = await gqlClient.request(getPlatformConfigQuery);\n    return config;\n  };\n};\n","import { applicationRead } from \"@/graphql/application.js\";\nimport { type ResultOf, type VariablesOf, graphql } from \"@/helpers/graphql.js\";\nimport type { GraphQLClient } from \"graphql-request\";\nimport { blockchainNodeRead } from \"./blockchain-node.js\";\nimport { getPlatformConfig } from \"./platform.js\";\n\n/**\n * GraphQL fragment containing core private key fields.\n */\nconst PrivateKeyFragment = graphql(`\n  fragment PrivateKey on PrivateKey {\n    __typename\n    id\n    uniqueName\n    name\n    privateKeyType\n    status\n    healthStatus\n    provider\n    region\n    address\n    trustedForwarderName\n    trustedForwarderAddress\n    relayerKey {\n      ... on PrivateKey {\n        id\n        name\n        uniqueName\n      }\n    }\n    blockchainNodes {\n      ... on BlockchainNode {\n        id\n        name\n        uniqueName\n      }\n    }\n  }\n`);\n\n/**\n * Type representing a private key entity.\n */\nexport type PrivateKey = ResultOf<typeof PrivateKeyFragment>;\n\n/**\n * Query to fetch private keys for an application.\n */\nconst getPrivateKeys = graphql(\n  `\n    query GetPrivateKeys($applicationUniqueName: String!) {\n      privateKeysByUniqueName(applicationUniqueName: $applicationUniqueName) {\n        items {\n          ...PrivateKey\n        }\n      }\n    }\n  `,\n  [PrivateKeyFragment],\n);\n\n/**\n * Query to fetch a specific private key.\n */\nconst getPrivateKey = graphql(\n  `\n    query GetPrivateKey($uniqueName: String!) {\n      privateKeyByUniqueName(uniqueName: $uniqueName) {\n        ...PrivateKey\n      }\n    }\n  `,\n  [PrivateKeyFragment],\n);\n\n/**\n * Mutation to create a new private key.\n */\nconst createPrivateKey = graphql(\n  `\n    mutation CreatePrivateKey(\n      $applicationId: ID!\n      $name: String!\n      $privateKeyType: PrivateKeyType!\n      $provider: String!\n      $region: String!\n      $size: ClusterServiceSize\n      $type: ClusterServiceType\n      $blockchainNodes: [ID!]\n      $trustedForwarderName: String\n      $trustedForwarderAddress: String\n      $relayerKey: ID\n    ) {\n      createPrivateKey(\n        applicationId: $applicationId\n        name: $name\n        privateKeyType: $privateKeyType\n        provider: $provider\n        region: $region\n        size: $size\n        type: $type\n        blockchainNodes: $blockchainNodes\n        trustedForwarderName: $trustedForwarderName\n        trustedForwarderAddress: $trustedForwarderAddress\n        relayerKey: $relayerKey\n      ) {\n        ...PrivateKey\n      }\n    }\n  `,\n  [PrivateKeyFragment],\n);\n\n/**\n * Arguments required to create a private key.\n */\nexport type CreatePrivateKeyArgs = Omit<\n  VariablesOf<typeof createPrivateKey>,\n  \"applicationId\" | \"blockchainNodes\" | \"region\" | \"provider\" | \"size\" | \"type\" | \"relayerKey\"\n> & {\n  applicationUniqueName: string;\n  blockchainNodeUniqueNames?: string[];\n  relayerKeyUniqueName?: string;\n};\n\n/**\n * Mutation to restart a private key.\n */\nconst restartPrivateKey = graphql(\n  `\n    mutation RestartPrivateKey($uniqueName: String!) {\n      restartPrivateKeyByUniqueName(uniqueName: $uniqueName) {\n        ...PrivateKey\n      }\n    }\n  `,\n  [PrivateKeyFragment],\n);\n\n/**\n * Creates a function to list private keys for an application.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches private keys for an application\n * @throws If the application cannot be found or the request fails\n */\nexport const privateKeyList = (\n  gqlClient: GraphQLClient,\n): ((applicationUniqueName: string) => Promise<PrivateKey[]>) => {\n  return async (applicationUniqueName: string) => {\n    const {\n      privateKeysByUniqueName: { items },\n    } = await gqlClient.request(getPrivateKeys, { applicationUniqueName });\n    return items as PrivateKey[];\n  };\n};\n\n/**\n * Creates a function to fetch a specific private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that fetches a single private key by unique name\n * @throws If the private key cannot be found or the request fails\n */\nexport const privatekeyRead = (gqlClient: GraphQLClient): ((privateKeyUniqueName: string) => Promise<PrivateKey>) => {\n  return async (privateKeyUniqueName: string) => {\n    const { privateKeyByUniqueName: privateKey } = await gqlClient.request(getPrivateKey, {\n      uniqueName: privateKeyUniqueName,\n    });\n    return privateKey as PrivateKey;\n  };\n};\n\n/**\n * Creates a function to create a new private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that creates new private key with the provided configuration\n * @throws If the creation fails or validation errors occur\n */\nexport const privateKeyCreate = (gqlClient: GraphQLClient): ((args: CreatePrivateKeyArgs) => Promise<PrivateKey>) => {\n  return async (args: CreatePrivateKeyArgs) => {\n    const { applicationUniqueName, blockchainNodeUniqueNames, relayerKeyUniqueName, ...otherArgs } = args;\n    const application = await applicationRead(gqlClient)(applicationUniqueName);\n    const blockchainNodes = blockchainNodeUniqueNames\n      ? await Promise.all(blockchainNodeUniqueNames.map((uniqueName) => blockchainNodeRead(gqlClient)(uniqueName)))\n      : [];\n    const relayerKey = relayerKeyUniqueName ? await privatekeyRead(gqlClient)(relayerKeyUniqueName) : undefined;\n    const platformConfig = await getPlatformConfig(gqlClient)();\n    const defaultProvider = platformConfig.deploymentEngineTargets.find(\n      (target) => !target.disabled && target.clusters.some((cluster) => !cluster.disabled),\n    );\n    const defaultRegion = defaultProvider?.clusters.find((cluster) => !cluster.disabled);\n    const { createPrivateKey: privateKey } = await gqlClient.request(createPrivateKey, {\n      ...otherArgs,\n      applicationId: application.id,\n      blockchainNodes: blockchainNodes.map((node) => node?.id),\n      relayerKey: relayerKey?.id,\n      provider: defaultProvider?.id ?? \"gke\",\n      region: defaultRegion?.id?.split(\"-\")[1] ?? \"europe\",\n      size: \"SMALL\",\n      type: \"SHARED\",\n    });\n    return privateKey;\n  };\n};\n\n/**\n * Creates a function to restart a private key.\n *\n * @param gqlClient - The GraphQL client instance\n * @returns Function that restarts private key by unique name\n * @throws If the private key cannot be found or the restart fails\n */\nexport const privateKeyRestart =\n  (gqlClient: GraphQLClient) =>\n  async (privateKeyUniqueName: string): Promise<PrivateKey> => {\n    const { restartPrivateKeyByUniqueName: privateKey } = await gqlClient.request(restartPrivateKey, {\n      uniqueName: privateKeyUniqueName,\n    });\n    return privateKey as PrivateKey;\n  };\n","import { AccessTokenSchema, UrlSchema } from \"@settlemint/sdk-utils/validation\";\nimport { z } from \"zod/v4\";\n\n/**\n * Schema for validating SettleMint client options.\n */\nexport const ClientOptionsSchema = z.object({\n  /** The access token used to authenticate with the SettleMint platform */\n  accessToken: AccessTokenSchema,\n  /** The URL of the SettleMint instance to connect to */\n  instance: UrlSchema,\n});\n\n/**\n * Type definition for SettleMint client options, inferred from ClientOptionsSchema.\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n","import { createHash } from \"node:crypto\";\n\nfunction hashPincode(pincode: string, salt: string): string {\n  return createHash(\"sha256\").update(`${salt}${pincode}`).digest(\"hex\");\n}\n\nfunction generateResponse(pincode: string, salt: string, challenge: string): string {\n  const hashedPincode = hashPincode(pincode, salt);\n  return createHash(\"sha256\").update(`${hashedPincode}_${challenge}`).digest(\"hex\");\n}\n\nexport interface PincodeVerificationChallengesArgs {\n  userWalletAddress: string;\n  accessToken: string;\n  instance: string;\n  nodeId: string;\n}\n\nexport interface PincodeVerificationChallengeResponseArgs {\n  verificationChallenge: VerificationChallenge;\n  pincode: string;\n}\n\nexport interface VerificationChallenge {\n  name: string;\n  challenge: {\n    secret: string;\n    salt: string;\n  };\n}\n\n/**\n * Get the pincode verification challenges for a user wallet address.\n * @param userWalletAddress - The user's wallet address.\n * @param accessToken - The user's access token.\n * @param instance - The instance URL.\n * @param nodeId - The node ID.\n * @returns The pincode verification challenges.\n */\nexport async function getPincodeVerificationChallenges({\n  userWalletAddress,\n  accessToken,\n  instance,\n  nodeId,\n}: PincodeVerificationChallengesArgs) {\n  const response = await fetch(\n    `${instance}/cm/nodes/${encodeURIComponent(nodeId)}/user-wallets/${encodeURIComponent(userWalletAddress)}/verifications/challenges?type=PINCODE`,\n    {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        \"x-auth-token\": accessToken,\n      },\n    },\n  );\n\n  if (!response.ok) {\n    if (response.status === 404) {\n      throw new Error(`No user wallet found with address '${userWalletAddress}' for node '${nodeId}'`);\n    }\n    throw new Error(\"Failed to get verification challenge\");\n  }\n\n  const verificationChallenges: VerificationChallenge[] = await response.json();\n  return verificationChallenges;\n}\n\n/**\n * Get the pincode verification challenge response for a user wallet address.\n * @param verificationChallenge - The verification challenge.\n * @param pincode - The user's pincode.\n * @returns The pincode verification challenge response.\n */\nexport function getPincodeVerificationChallengeResponse({\n  verificationChallenge,\n  pincode,\n}: PincodeVerificationChallengeResponseArgs) {\n  if (!verificationChallenge?.challenge?.secret || !verificationChallenge?.challenge?.salt) {\n    throw new Error(\"Could not authenticate pin code, invalid challenge format\");\n  }\n\n  const { secret, salt } = verificationChallenge.challenge;\n  return generateResponse(pincode, salt, secret);\n}\n","import { fetchWithRetry } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { type Id, LOCAL_INSTANCE, STANDALONE_INSTANCE, validate } from \"@settlemint/sdk-utils/validation\";\nimport { GraphQLClient } from \"graphql-request\";\nimport { z } from \"zod/v4\";\nimport {\n  type CreateApplicationAccessTokenArgs,\n  applicationAccessTokenCreate,\n} from \"./graphql/application-access-tokens.js\";\nimport {\n  type Application,\n  type CreateApplicationArgs,\n  applicationCreate,\n  applicationDelete,\n  applicationList,\n  applicationRead,\n} from \"./graphql/application.js\";\nimport {\n  type BlockchainNetwork,\n  type CreateBlockchainNetworkArgs,\n  blockchainNetworkCreate,\n  blockchainNetworkDelete,\n  blockchainNetworkList,\n  blockchainNetworkRead,\n  blockchainNetworkRestart,\n} from \"./graphql/blockchain-network.js\";\nimport {\n  type BlockchainNode,\n  type CreateBlockchainNodeArgs,\n  blockchainNodeCreate,\n  blockchainNodeList,\n  blockchainNodeRead,\n  blockchainNodeRestart,\n} from \"./graphql/blockchain-node.js\";\nimport {\n  type CreateCustomDeploymentArgs,\n  type CustomDeployment,\n  customDeploymentRestart,\n  customdeploymentCreate,\n  customdeploymentList,\n  customdeploymentRead,\n  customdeploymentUpdate,\n} from \"./graphql/custom-deployment.js\";\nimport { getEnv } from \"./graphql/foundry.js\";\nimport {\n  type CreateInsightsArgs,\n  type Insights,\n  insightsCreate,\n  insightsList,\n  insightsRead,\n  insightsRestart,\n} from \"./graphql/insights.js\";\nimport {\n  type CreateIntegrationToolArgs,\n  type IntegrationTool,\n  integrationToolCreate,\n  integrationToolList,\n  integrationToolRead,\n  integrationToolRestart,\n} from \"./graphql/integration-tool.js\";\nimport {\n  type CreateLoadBalancerArgs,\n  type LoadBalancer,\n  loadBalancerCreate,\n  loadBalancerList,\n  loadBalancerRead,\n  loadBalancerRestart,\n} from \"./graphql/load-balancer.js\";\nimport {\n  type CreateMiddlewareArgs,\n  type Middleware,\n  type MiddlewareWithSubgraphs,\n  graphMiddlewareSubgraphs,\n  middlewareCreate,\n  middlewareList,\n  middlewareRead,\n  middlewareRestart,\n} from \"./graphql/middleware.js\";\nimport { type PlatformConfig, getPlatformConfig } from \"./graphql/platform.js\";\nimport {\n  type CreatePrivateKeyArgs,\n  type PrivateKey,\n  privateKeyCreate,\n  privateKeyList,\n  privateKeyRestart,\n  privatekeyRead,\n} from \"./graphql/private-key.js\";\nimport {\n  type CreateStorageArgs,\n  type Storage,\n  storageCreate,\n  storageList,\n  storageRead,\n  storageRestart,\n} from \"./graphql/storage.js\";\nimport {\n  type CreateWorkspaceArgs,\n  type Workspace,\n  workspaceAddCredits,\n  workspaceCreate,\n  workspaceDelete,\n  workspaceList,\n  workspaceRead,\n} from \"./graphql/workspace.js\";\nimport { type ClientOptions, ClientOptionsSchema } from \"./helpers/client-options.schema.js\";\nimport {\n  type PincodeVerificationChallengeResponseArgs,\n  type PincodeVerificationChallengesArgs,\n  type VerificationChallenge,\n  getPincodeVerificationChallengeResponse,\n  getPincodeVerificationChallenges,\n} from \"./pincode-verification.js\";\n\n/**\n * Options for the Settlemint client.\n */\nexport interface SettlemintClientOptions extends Omit<ClientOptions, \"accessToken\"> {\n  /** The access token used to authenticate with the SettleMint platform */\n  accessToken?: string;\n  /** Whether to allow anonymous access (no access token required) */\n  anonymous?: boolean;\n}\n\n/**\n * Client interface for interacting with the SettleMint platform.\n */\nexport interface SettlemintClient {\n  workspace: {\n    list: () => Promise<Workspace[]>;\n    read: (workspaceUniqueName: string) => Promise<Workspace>;\n    create: (args: CreateWorkspaceArgs) => Promise<Workspace>;\n    delete: (workspaceUniqueName: string) => Promise<Workspace>;\n    addCredits: (workspaceId: Id, amount: number) => Promise<boolean>;\n  };\n  application: {\n    list: (workspaceUniqueName: string) => Promise<Application[]>;\n    read: (applicationUniqueName: string) => Promise<Application>;\n    create: (args: CreateApplicationArgs) => Promise<Application>;\n    delete: (applicationId: Id) => Promise<Application>;\n  };\n  blockchainNetwork: {\n    list: (applicationUniqueName: string) => Promise<BlockchainNetwork[]>;\n    read: (blockchainNetworkUniqueName: string) => Promise<BlockchainNetwork>;\n    create: (args: CreateBlockchainNetworkArgs) => Promise<BlockchainNetwork>;\n    delete: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n    restart: (networkUniqueName: string) => Promise<BlockchainNetwork>;\n  };\n  blockchainNode: {\n    list: (applicationUniqueName: string) => Promise<BlockchainNode[]>;\n    read: (blockchainNodeUniqueName: string) => Promise<BlockchainNode>;\n    create: (args: CreateBlockchainNodeArgs) => Promise<BlockchainNode>;\n    restart: (nodeUniqueName: string) => Promise<BlockchainNode>;\n  };\n  loadBalancer: {\n    list: (applicationUniqueName: string) => Promise<LoadBalancer[]>;\n    read: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n    create: (args: CreateLoadBalancerArgs) => Promise<LoadBalancer>;\n    restart: (loadBalancerUniqueName: string) => Promise<LoadBalancer>;\n  };\n  middleware: {\n    list: (applicationUniqueName: string) => Promise<Middleware[]>;\n    read: (middlewareUniqueName: string) => Promise<Middleware>;\n    graphSubgraphs: (middlewareUniqueName: string, noCache?: boolean) => Promise<MiddlewareWithSubgraphs>;\n    create: (args: CreateMiddlewareArgs) => Promise<Middleware>;\n    restart: (middlewareUniqueName: string) => Promise<Middleware>;\n  };\n  integrationTool: {\n    list: (applicationUniqueName: string) => Promise<IntegrationTool[]>;\n    read: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n    create: (args: CreateIntegrationToolArgs) => Promise<IntegrationTool>;\n    restart: (integrationToolUniqueName: string) => Promise<IntegrationTool>;\n  };\n  storage: {\n    list: (applicationUniqueName: string) => Promise<Storage[]>;\n    read: (storageUniqueName: string) => Promise<Storage>;\n    create: (args: CreateStorageArgs) => Promise<Storage>;\n    restart: (storageUniqueName: string) => Promise<Storage>;\n  };\n  privateKey: {\n    list: (applicationUniqueName: string) => Promise<PrivateKey[]>;\n    read: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n    create: (args: CreatePrivateKeyArgs) => Promise<PrivateKey>;\n    restart: (privateKeyUniqueName: string) => Promise<PrivateKey>;\n  };\n  insights: {\n    list: (applicationUniqueName: string) => Promise<Insights[]>;\n    read: (insightsUniqueName: string) => Promise<Insights>;\n    create: (args: CreateInsightsArgs) => Promise<Insights>;\n    restart: (insightsUniqueName: string) => Promise<Insights>;\n  };\n  customDeployment: {\n    list: (applicationUniqueName: string) => Promise<CustomDeployment[]>;\n    read: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n    create: (args: CreateCustomDeploymentArgs) => Promise<CustomDeployment>;\n    update: (customDeploymentUniqueName: string, imageTag: string) => Promise<CustomDeployment>;\n    restart: (customDeploymentUniqueName: string) => Promise<CustomDeployment>;\n  };\n  foundry: {\n    env: (blockchainNodeUniqueName: string) => Promise<Record<string, string>>;\n  };\n  applicationAccessToken: {\n    create: (args: CreateApplicationAccessTokenArgs) => Promise<string>;\n  };\n  platform: {\n    config: () => Promise<PlatformConfig>;\n  };\n  wallet: {\n    pincodeVerificationChallengeResponse: (args: PincodeVerificationChallengeResponseArgs) => string;\n    pincodeVerificationChallenges: (\n      args: Omit<PincodeVerificationChallengesArgs, \"instance\" | \"accessToken\">,\n    ) => Promise<VerificationChallenge[]>;\n  };\n}\n\n/**\n * Creates a SettleMint client with the provided options. The client provides methods to interact with\n * various SettleMint resources like workspaces, applications, blockchain networks, blockchain nodes, middleware,\n * integration tools, storage, private keys, insights and custom deployments.\n *\n * @param {ClientOptions} options - Configuration options for the client including access token and instance URL\n * @returns {SettlemintClient} A SettleMint client object with resource-specific methods\n * @throws {Error} If options are invalid or if called in browser environment\n * @throws {ValidationError} If provided options fail schema validation\n *\n * @example\n * import { createSettleMintClient } from '@settlemint/sdk-js';\n *\n * const client = createSettleMintClient({\n *   accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n *   instance: process.env.SETTLEMINT_INSTANCE,\n * });\n *\n * // List workspaces\n * const workspaces = await client.workspace.list();\n *\n * // Read a specific workspace\n * const workspace = await client.workspace.read('workspace-unique-name');\n */\nexport function createSettleMintClient(options: SettlemintClientOptions): SettlemintClient {\n  ensureServer();\n\n  if (options.instance === STANDALONE_INSTANCE || options.instance === LOCAL_INSTANCE) {\n    if (options.anonymous) {\n      // Fallback to the public instance for anonymous access\n      // Anonymous use does not interact with platform services, only used for bootstrapping new projects using SettleMint templates\n      options.instance = \"https://console.settlemint.com\";\n    } else {\n      throw new Error(\"Standalone and local instances cannot connect to the SettleMint platform\");\n    }\n  }\n\n  const validatedOptions = options.anonymous\n    ? validate(\n        z.object({\n          ...ClientOptionsSchema.shape,\n          accessToken: z.literal(\"\"),\n        }),\n        options,\n      )\n    : validate(ClientOptionsSchema, options);\n\n  const baseUrl = new URL(validatedOptions.instance).toString().replace(/\\/$/, \"\");\n  const gqlClient = new GraphQLClient(`${baseUrl}/api/graphql`, {\n    headers: {\n      \"x-auth-token\": validatedOptions.accessToken ?? \"\",\n    },\n    fetch: (async (input: RequestInfo | URL, init?: RequestInit) => {\n      const response = await fetchWithRetry(input, init);\n      // Parse and handle GraphQL errors from response\n      const contentType = response.headers.get(\"content-type\");\n      if (contentType?.includes(\"application/json\") || contentType?.includes(\"application/graphql-response+json\")) {\n        const data: { errors: { message: string }[] } = await response.clone().json();\n        if (data.errors?.length > 0) {\n          const errorMessages = data.errors.map((e) => e.message).join(\", \");\n          throw new Error(errorMessages);\n        }\n      }\n      return response;\n    }) as typeof fetch,\n  });\n\n  return {\n    workspace: {\n      list: workspaceList(gqlClient),\n      read: workspaceRead(gqlClient),\n      create: workspaceCreate(gqlClient),\n      delete: workspaceDelete(gqlClient),\n      addCredits: workspaceAddCredits(gqlClient),\n    },\n    application: {\n      list: applicationList(gqlClient),\n      read: applicationRead(gqlClient),\n      create: applicationCreate(gqlClient),\n      delete: applicationDelete(gqlClient),\n    },\n    blockchainNetwork: {\n      list: blockchainNetworkList(gqlClient),\n      read: blockchainNetworkRead(gqlClient),\n      create: blockchainNetworkCreate(gqlClient),\n      delete: blockchainNetworkDelete(gqlClient),\n      restart: blockchainNetworkRestart(gqlClient),\n    },\n    blockchainNode: {\n      list: blockchainNodeList(gqlClient),\n      read: blockchainNodeRead(gqlClient),\n      create: blockchainNodeCreate(gqlClient),\n      restart: blockchainNodeRestart(gqlClient),\n    },\n    loadBalancer: {\n      list: loadBalancerList(gqlClient),\n      read: loadBalancerRead(gqlClient),\n      create: loadBalancerCreate(gqlClient),\n      restart: loadBalancerRestart(gqlClient),\n    },\n    middleware: {\n      list: middlewareList(gqlClient),\n      read: middlewareRead(gqlClient),\n      graphSubgraphs: graphMiddlewareSubgraphs(gqlClient),\n      create: middlewareCreate(gqlClient),\n      restart: middlewareRestart(gqlClient),\n    },\n    integrationTool: {\n      list: integrationToolList(gqlClient),\n      read: integrationToolRead(gqlClient),\n      create: integrationToolCreate(gqlClient),\n      restart: integrationToolRestart(gqlClient),\n    },\n    storage: {\n      list: storageList(gqlClient),\n      read: storageRead(gqlClient),\n      create: storageCreate(gqlClient),\n      restart: storageRestart(gqlClient),\n    },\n    privateKey: {\n      list: privateKeyList(gqlClient),\n      read: privatekeyRead(gqlClient),\n      create: privateKeyCreate(gqlClient),\n      restart: privateKeyRestart(gqlClient),\n    },\n    insights: {\n      list: insightsList(gqlClient),\n      read: insightsRead(gqlClient),\n      create: insightsCreate(gqlClient),\n      restart: insightsRestart(gqlClient),\n    },\n    customDeployment: {\n      list: customdeploymentList(gqlClient),\n      read: customdeploymentRead(gqlClient),\n      create: customdeploymentCreate(gqlClient),\n      update: customdeploymentUpdate(gqlClient),\n      restart: customDeploymentRestart(gqlClient),\n    },\n    foundry: {\n      env: getEnv(gqlClient),\n    },\n    applicationAccessToken: {\n      create: applicationAccessTokenCreate(gqlClient),\n    },\n    platform: {\n      config: getPlatformConfig(gqlClient),\n    },\n    wallet: {\n      pincodeVerificationChallengeResponse: getPincodeVerificationChallengeResponse,\n      pincodeVerificationChallenges: (args) =>\n        getPincodeVerificationChallenges({\n          ...args,\n          instance: validatedOptions.instance,\n          accessToken: validatedOptions.accessToken,\n        }),\n    },\n  };\n}\n\nexport type { Application } from \"./graphql/application.js\";\nexport type { BlockchainNetwork } from \"./graphql/blockchain-network.js\";\nexport type { BlockchainNode } from \"./graphql/blockchain-node.js\";\nexport type { CustomDeployment } from \"./graphql/custom-deployment.js\";\nexport type { Insights } from \"./graphql/insights.js\";\nexport type { IntegrationTool } from \"./graphql/integration-tool.js\";\nexport type { LoadBalancer } from \"./graphql/load-balancer.js\";\nexport type { Middleware, MiddlewareWithSubgraphs } from \"./graphql/middleware.js\";\nexport type { PrivateKey } from \"./graphql/private-key.js\";\nexport type { Storage } from \"./graphql/storage.js\";\nexport type { Workspace } from \"./graphql/workspace.js\";\nexport type { PlatformConfig } from \"./graphql/platform.js\";\nexport type { VerificationChallenge } from \"./pincode-verification.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAaA,UAYR,+BAYD;;;;;;;AC9BJ,MAAM,oBAAoB,SACvB;;;;;;;;;;;IAYF;;;;AAUD,MAAM,+BAA+B,SAClC;;;;;;;;;KAUD,CAAC,iBAAkB,EACpB;;;;AAKD,MAAM,eAAe,SAClB;;;;;;KAOD,CAAC,iBAAkB,EACpB;;;;AAKD,MAAM,kBAAkB,SACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BD,CAAC,iBAAkB,EACpB;;;;AAOD,MAAM,kBAAkB,SACrB;;;;;;KAOD,CAAC,iBAAkB,EACpB;;;;AAKD,MAAM,aAAa,SAChB;;;;IAKF;;;;;;;;AASD,MAAa,gBAAgB,CAACC,cAA2D;AACvF,QAAO,YAAY;EACjB,MAAM,EAAE,YAAY,GAAG,MAAM,UAAU,QAAQ,6BAA6B;EAC5E,MAAM,gBAAgB,WAAW,OAAoB,CAAC,KAAK,cAAc;AACvE,OAAI,KAAK,UAAU;AACnB,OAAI,UAAU,gBACZ,KAAI,KAA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