Function getK1NexusAddress

  • Gets the counterfactual address for a K1 Nexus account

    Type Parameters

    • ExtendedPublicClient extends {
          account: undefined;
          batch?: {
              multicall?: boolean | {
                  batchSize?: number;
                  wait?: number;
              };
          };
          cacheTime: number;
          call: ((parameters) => Promise<CallReturnType>);
          ccipRead?: false | {
              request?: ((parameters) => Promise<`0x${string}`>);
          };
          chain: undefined | Chain;
          createBlockFilter: (() => Promise<{
              id: `0x${string}`;
              request: EIP1193RequestFn<readonly [{
                  Method: "eth_getFilterChanges";
                  Parameters: [filterId: `0x${string}`];
                  ReturnType: `0x${string}`[] | RpcLog[];
              }, {
                  Method: "eth_getFilterLogs";
                  Parameters: [filterId: `0x${string}`];
                  ReturnType: RpcLog[];
              }, {
                  Method: "eth_uninstallFilter";
                  Parameters: [filterId: `0x${string}`];
                  ReturnType: boolean;
              }]>;
              type: "block";
          }>);
          createContractEventFilter: (<const abi, eventName, args, strict, fromBlock, toBlock>(args) => Promise<CreateContractEventFilterReturnType<abi, eventName, args, strict, fromBlock, toBlock>>);
          createEventFilter: (<const abiEvent, const abiEvents, strict, fromBlock, toBlock, _EventName, _Args>(args?) => Promise<{
              [K in string | number | symbol]: Filter<"event", abiEvents, _EventName, _Args, strict, fromBlock, toBlock>[K]
          }>);
          createPendingTransactionFilter: (() => Promise<{
              id: `0x${string}`;
              request: EIP1193RequestFn<readonly [{
                  Method: "eth_getFilterChanges";
                  Parameters: [filterId: `0x${string}`];
                  ReturnType: `0x${string}`[] | RpcLog[];
              }, {
                  Method: "eth_getFilterLogs";
                  Parameters: [filterId: `0x${string}`];
                  ReturnType: RpcLog[];
              }, {
                  Method: "eth_uninstallFilter";
                  Parameters: [filterId: `0x${string}`];
                  ReturnType: boolean;
              }]>;
              type: "transaction";
          }>);
          estimateContractGas: (<chain, const abi, functionName, args>(args) => Promise<bigint>);
          estimateFeesPerGas: (<chainOverride, type>(args?) => Promise<EstimateFeesPerGasReturnType<type>>);
          estimateGas: ((args) => Promise<bigint>);
          estimateMaxPriorityFeePerGas: (<chainOverride>(args?) => Promise<bigint>);
          extend: (<const client>(fn) => Client<Transport, undefined | Chain, undefined, PublicRpcSchema, {
              [K in string | number | symbol]: client[K]
          } & PublicActions<Transport, undefined | Chain>>);
          getBalance: ((args) => Promise<bigint>);
          getBlobBaseFee: (() => Promise<bigint>);
          getBlock: (<includeTransactions, blockTag>(args?) => Promise<{
              baseFeePerGas: null | bigint;
              blobGasUsed: bigint;
              difficulty: bigint;
              excessBlobGas: bigint;
              extraData: `0x${string}`;
              gasLimit: bigint;
              gasUsed: bigint;
              hash: blockTag extends "pending"
                  ? null
                  : `0x${string}`;
              logsBloom: blockTag extends "pending"
                  ? null
                  : `0x${string}`;
              miner: `0x${string}`;
              mixHash: `0x${string}`;
              nonce: blockTag extends "pending"
                  ? null
                  : `0x${string}`;
              number: blockTag extends "pending"
                  ? null
                  : bigint;
              parentHash: `0x${string}`;
              receiptsRoot: `0x${string}`;
              sealFields: `0x${string}`[];
              sha3Uncles: `0x${string}`;
              size: bigint;
              stateRoot: `0x${string}`;
              timestamp: bigint;
              totalDifficulty: null | bigint;
              transactions: includeTransactions extends true
                  ? ({
                      accessList?: undefined;
                      authorizationList?: undefined;
                      blobVersionedHashes?: undefined;
                      blockHash: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : `0x${string}`;
                      blockNumber: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : bigint;
                      chainId?: number;
                      from: `0x${string}`;
                      gas: bigint;
                      gasPrice: bigint;
                      hash: `0x${string}`;
                      input: `0x${string}`;
                      maxFeePerBlobGas?: undefined;
                      maxFeePerGas?: undefined;
                      maxPriorityFeePerGas?: undefined;
                      nonce: number;
                      r: `0x${string}`;
                      s: `0x${string}`;
                      to: null | `0x${string}`;
                      transactionIndex: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : number;
                      type: "legacy";
                      typeHex: null | `0x${string}`;
                      v: bigint;
                      value: bigint;
                      yParity?: undefined;
                  } | {
                      accessList: AccessList;
                      authorizationList?: undefined;
                      blobVersionedHashes?: undefined;
                      blockHash: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : `0x${string}`;
                      blockNumber: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : bigint;
                      chainId: number;
                      from: `0x${string}`;
                      gas: bigint;
                      gasPrice: bigint;
                      hash: `0x${string}`;
                      input: `0x${string}`;
                      maxFeePerBlobGas?: undefined;
                      maxFeePerGas?: undefined;
                      maxPriorityFeePerGas?: undefined;
                      nonce: number;
                      r: `0x${string}`;
                      s: `0x${string}`;
                      to: null | `0x${string}`;
                      transactionIndex: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : number;
                      type: "eip2930";
                      typeHex: null | `0x${string}`;
                      v: bigint;
                      value: bigint;
                      yParity: number;
                  } | {
                      accessList: AccessList;
                      authorizationList?: undefined;
                      blobVersionedHashes?: undefined;
                      blockHash: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : `0x${string}`;
                      blockNumber: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : bigint;
                      chainId: number;
                      from: `0x${string}`;
                      gas: bigint;
                      gasPrice?: undefined;
                      hash: `0x${string}`;
                      input: `0x${string}`;
                      maxFeePerBlobGas?: undefined;
                      maxFeePerGas: bigint;
                      maxPriorityFeePerGas: bigint;
                      nonce: number;
                      r: `0x${string}`;
                      s: `0x${string}`;
                      to: null | `0x${string}`;
                      transactionIndex: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : number;
                      type: "eip1559";
                      typeHex: null | `0x${string}`;
                      v: bigint;
                      value: bigint;
                      yParity: number;
                  } | {
                      accessList: AccessList;
                      authorizationList?: undefined;
                      blobVersionedHashes: readonly `0x${string}`[];
                      blockHash: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : `0x${string}`;
                      blockNumber: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : bigint;
                      chainId: number;
                      from: `0x${string}`;
                      gas: bigint;
                      gasPrice?: undefined;
                      hash: `0x${string}`;
                      input: `0x${string}`;
                      maxFeePerBlobGas: bigint;
                      maxFeePerGas: bigint;
                      maxPriorityFeePerGas: bigint;
                      nonce: number;
                      r: `0x${string}`;
                      s: `0x${string}`;
                      to: null | `0x${string}`;
                      transactionIndex: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : number;
                      type: "eip4844";
                      typeHex: null | `0x${string}`;
                      v: bigint;
                      value: bigint;
                      yParity: number;
                  } | {
                      accessList: AccessList;
                      authorizationList: SignedAuthorizationList;
                      blobVersionedHashes?: undefined;
                      blockHash: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : `0x${string}`;
                      blockNumber: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : bigint;
                      chainId: number;
                      from: `0x${string}`;
                      gas: bigint;
                      gasPrice?: undefined;
                      hash: `0x${string}`;
                      input: `0x${string}`;
                      maxFeePerBlobGas?: undefined;
                      maxFeePerGas: bigint;
                      maxPriorityFeePerGas: bigint;
                      nonce: number;
                      r: `0x${string}`;
                      s: `0x${string}`;
                      to: null | `0x${string}`;
                      transactionIndex: (blockTag extends "pending"
                              ? true
                              : false) extends true
                          ? null
                          : number;
                      type: "eip7702";
                      typeHex: null | `0x${string}`;
                      v: bigint;
                      value: bigint;
                      yParity: number;
                  })[]
                  : `0x${string}`[];
              transactionsRoot: `0x${string}`;
              uncles: `0x${string}`[];
              withdrawals?: Withdrawal[];
              withdrawalsRoot?: `0x${string}`;
          }>);
          getBlockNumber: ((args?) => Promise<bigint>);
          getBlockTransactionCount: ((args?) => Promise<number>);
          getBytecode: ((args) => Promise<GetCodeReturnType>);
          getChainId: (() => Promise<number>);
          getCode: ((args) => Promise<GetCodeReturnType>);
          getContractEvents: (<const abi, eventName, strict, fromBlock, toBlock>(args) => Promise<GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>>);
          getEip712Domain: ((args) => Promise<GetEip712DomainReturnType>);
          getEnsAddress: ((args) => Promise<GetEnsAddressReturnType>);
          getEnsAvatar: ((args) => Promise<GetEnsAvatarReturnType>);
          getEnsName: ((args) => Promise<GetEnsNameReturnType>);
          getEnsResolver: ((args) => Promise<`0x${string}`>);
          getEnsText: ((args) => Promise<GetEnsTextReturnType>);
          getFeeHistory: ((args) => Promise<GetFeeHistoryReturnType>);
          getFilterChanges: (<filterType, const abi, eventName, strict, fromBlock, toBlock>(args) => Promise<GetFilterChangesReturnType<filterType, abi, eventName, strict, fromBlock, toBlock>>);
          getFilterLogs: (<const abi, eventName, strict, fromBlock, toBlock>(args) => Promise<GetFilterLogsReturnType<abi, eventName, strict, fromBlock, toBlock>>);
          getGasPrice: (() => Promise<bigint>);
          getLogs: (<const abiEvent, const abiEvents, strict, fromBlock, toBlock>(args?) => Promise<GetLogsReturnType<abiEvent, abiEvents, strict, fromBlock, toBlock>>);
          getProof: ((args) => Promise<GetProofReturnType>);
          getStorageAt: ((args) => Promise<GetStorageAtReturnType>);
          getTransaction: (<blockTag>(args) => Promise<{
              accessList?: undefined;
              authorizationList?: undefined;
              blobVersionedHashes?: undefined;
              blockHash: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : `0x${string}`;
              blockNumber: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : bigint;
              chainId?: number;
              from: `0x${string}`;
              gas: bigint;
              gasPrice: bigint;
              hash: `0x${string}`;
              input: `0x${string}`;
              maxFeePerBlobGas?: undefined;
              maxFeePerGas?: undefined;
              maxPriorityFeePerGas?: undefined;
              nonce: number;
              r: `0x${string}`;
              s: `0x${string}`;
              to: null | `0x${string}`;
              transactionIndex: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : number;
              type: "legacy";
              typeHex: null | `0x${string}`;
              v: bigint;
              value: bigint;
              yParity?: undefined;
          } | {
              accessList: AccessList;
              authorizationList?: undefined;
              blobVersionedHashes?: undefined;
              blockHash: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : `0x${string}`;
              blockNumber: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : bigint;
              chainId: number;
              from: `0x${string}`;
              gas: bigint;
              gasPrice: bigint;
              hash: `0x${string}`;
              input: `0x${string}`;
              maxFeePerBlobGas?: undefined;
              maxFeePerGas?: undefined;
              maxPriorityFeePerGas?: undefined;
              nonce: number;
              r: `0x${string}`;
              s: `0x${string}`;
              to: null | `0x${string}`;
              transactionIndex: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : number;
              type: "eip2930";
              typeHex: null | `0x${string}`;
              v: bigint;
              value: bigint;
              yParity: number;
          } | {
              accessList: AccessList;
              authorizationList?: undefined;
              blobVersionedHashes?: undefined;
              blockHash: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : `0x${string}`;
              blockNumber: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : bigint;
              chainId: number;
              from: `0x${string}`;
              gas: bigint;
              gasPrice?: undefined;
              hash: `0x${string}`;
              input: `0x${string}`;
              maxFeePerBlobGas?: undefined;
              maxFeePerGas: bigint;
              maxPriorityFeePerGas: bigint;
              nonce: number;
              r: `0x${string}`;
              s: `0x${string}`;
              to: null | `0x${string}`;
              transactionIndex: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : number;
              type: "eip1559";
              typeHex: null | `0x${string}`;
              v: bigint;
              value: bigint;
              yParity: number;
          } | {
              accessList: AccessList;
              authorizationList?: undefined;
              blobVersionedHashes: readonly `0x${string}`[];
              blockHash: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : `0x${string}`;
              blockNumber: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : bigint;
              chainId: number;
              from: `0x${string}`;
              gas: bigint;
              gasPrice?: undefined;
              hash: `0x${string}`;
              input: `0x${string}`;
              maxFeePerBlobGas: bigint;
              maxFeePerGas: bigint;
              maxPriorityFeePerGas: bigint;
              nonce: number;
              r: `0x${string}`;
              s: `0x${string}`;
              to: null | `0x${string}`;
              transactionIndex: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : number;
              type: "eip4844";
              typeHex: null | `0x${string}`;
              v: bigint;
              value: bigint;
              yParity: number;
          } | {
              accessList: AccessList;
              authorizationList: SignedAuthorizationList;
              blobVersionedHashes?: undefined;
              blockHash: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : `0x${string}`;
              blockNumber: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : bigint;
              chainId: number;
              from: `0x${string}`;
              gas: bigint;
              gasPrice?: undefined;
              hash: `0x${string}`;
              input: `0x${string}`;
              maxFeePerBlobGas?: undefined;
              maxFeePerGas: bigint;
              maxPriorityFeePerGas: bigint;
              nonce: number;
              r: `0x${string}`;
              s: `0x${string}`;
              to: null | `0x${string}`;
              transactionIndex: (blockTag extends "pending"
                      ? true
                      : false) extends true
                  ? null
                  : number;
              type: "eip7702";
              typeHex: null | `0x${string}`;
              v: bigint;
              value: bigint;
              yParity: number;
          }>);
          getTransactionConfirmations: ((args) => Promise<bigint>);
          getTransactionCount: ((args) => Promise<number>);
          getTransactionReceipt: ((args) => Promise<TransactionReceipt>);
          key: string;
          multicall: (<const contracts, allowFailure>(args) => Promise<MulticallReturnType<contracts, allowFailure>>);
          name: string;
          pollingInterval: number;
          prepareTransactionRequest: (<const request, chainOverride, accountOverride>(args) => Promise<{
              [K in string | number | symbol]: (UnionRequiredBy<Extract<UnionOmit<(...), (...)> & ((...) extends (...)
                  ? (...)
                  : (...)) & ((...) extends (...)
                  ? (...)
                  : (...)), IsNever<(...)> extends true
                  ? unknown
                  : ExactPartial<(...)>> & {
                  chainId?: number;
              }, ParameterTypeToParameters<request["parameters"] extends readonly PrepareTransactionRequestParameterType[]
                  ? any[any][number]
                  : "chainId" | "nonce" | "type" | "gas" | "blobVersionedHashes" | "fees">> & (unknown extends request["kzg"]
                  ? {}
                  : Pick<request, "kzg">))[K]
          }>);
          readContract: (<const abi, functionName, args>(args) => Promise<ReadContractReturnType<abi, functionName, args>>);
          request: EIP1193RequestFn<PublicRpcSchema>;
          sendRawTransaction: ((args) => Promise<`0x${string}`>);
          simulateContract: (<const abi, functionName, args, chainOverride, accountOverride>(args) => Promise<SimulateContractReturnType<abi, functionName, args, undefined | Chain, undefined | Account, chainOverride, accountOverride>>);
          transport: TransportConfig<string, EIP1193RequestFn> & Record<string, any>;
          type: string;
          uid: string;
          uninstallFilter: ((args) => Promise<boolean>);
          verifyMessage: ((args) => Promise<boolean>);
          verifySiweMessage: ((args) => Promise<boolean>);
          verifyTypedData: ((args) => Promise<boolean>);
          waitForTransactionReceipt: ((args) => Promise<TransactionReceipt>);
          watchBlockNumber: ((args) => WatchBlockNumberReturnType);
          watchBlocks: (<includeTransactions, blockTag>(args) => WatchBlocksReturnType);
          watchContractEvent: (<const abi, eventName, strict>(args) => WatchContractEventReturnType);
          watchEvent: (<const abiEvent, const abiEvents, strict>(args) => WatchEventReturnType);
          watchPendingTransactions: ((args) => WatchPendingTransactionsReturnType);
      }

    Parameters

    Returns Promise<`0x${string}`>

    Promise resolving to the Address of the counterfactual account

    Example

    const accountAddress = await getK1NexusAddress({
    publicClient: viemPublicClient,
    signerAddress: "0x123...",
    index: BigInt(0),
    attesters: ["0xabc..."],
    threshold: 1
    });