{"version":3,"file":"rpc-client.mjs","names":["tx: Tx","set: Validator[]","QueryStakingParamsResponse","txs: Uint8Array[]","results: TxData[]","beginBlockEvents: Event38[]","endBlockEvents: Event38[]"],"sources":["../../src/mocks/rpc-client.ts"],"sourcesContent":["/**\n * Mock RPC client for benchmarking and testing\n * Generates synthetic blockchain data without requiring an actual RPC node\n */\nimport {\n  createHash,\n} from \"node:crypto\";\n\nimport {\n  fromBase64, fromHex, toBech32,\n} from \"@cosmjs/encoding\";\nimport {\n  AbciQueryParams,\n  AbciQueryResponse,\n  BlockResponse,\n  BlockResultsResponse,\n  CometClient,\n  fromRfc3339WithNanoseconds,\n  StatusResponse,\n  TxData,\n} from \"@cosmjs/tendermint-rpc\";\nimport {\n  BlockResultsResponse as BlockResultsResponse38, Event as Event38,\n} from \"@cosmjs/tendermint-rpc/build/comet38/responses.js\";\nimport {\n  ModuleAccount,\n} from \"cosmjs-types/cosmos/auth/v1beta1/auth.js\";\nimport {\n  QueryModuleAccountsResponse,\n} from \"cosmjs-types/cosmos/auth/v1beta1/query.js\";\nimport {\n  QueryAllBalancesResponse,\n} from \"cosmjs-types/cosmos/bank/v1beta1/query.js\";\nimport {\n  QueryDelegatorDelegationsResponse,\n  QueryParamsResponse as QueryStakingParamsResponse,\n  QueryPoolResponse,\n  QueryValidatorDelegationsResponse,\n  QueryValidatorsRequest,\n  QueryValidatorsResponse,\n} from \"cosmjs-types/cosmos/staking/v1beta1/query.js\";\nimport {\n  Validator,\n} from \"cosmjs-types/cosmos/staking/v1beta1/staking.js\";\nimport {\n  Tx,\n} from \"cosmjs-types/cosmos/tx/v1beta1/tx.js\";\n\n/** Configuration for mock data generation */\nexport interface MockRpcConfig {\n  /** Chain ID for generated blocks */\n  chainId: string\n  /** Number of transactions per block */\n  txPerBlock: number\n  /** Starting block height */\n  startHeight: number\n  /** Latest block height available */\n  endHeight: number\n  /** Which CometBFT response shape to produce (default: 0.37) */\n  cometVersion?: \"0.37\" | \"0.38\"\n  /** Size of the synthetic validator set answered by the Validators ABCI query (default: 3) */\n  validatorCount?: number\n}\n\n/** Deterministic bech32 address from a small integer, for synthetic accounts and validators */\nexport function syntheticAddress(prefix: string, seed: number): string {\n  const bytes = new Uint8Array(20);\n  bytes[0] = seed & 0xff;\n  bytes[1] = (seed >> 8) & 0xff;\n  bytes[19] = 0x01;\n  return toBech32(prefix, bytes);\n}\n\n/** Module accounts a chain always has, with deterministic addresses (computed on first use) */\nexport function mockModuleAccounts(): Record<string, string> {\n  return {\n    fee_collector: syntheticAddress(\"cosmos\", 1001),\n    distribution: syntheticAddress(\"cosmos\", 1002),\n  };\n}\n\n/**\n * Generates a synthetic transaction with realistic structure\n */\nfunction generateMockTx(height: number, txIndex: number): Uint8Array {\n  const tx: Tx = {\n    body: {\n      messages: [\n        {\n          typeUrl: \"/cosmos.bank.v1beta1.MsgSend\",\n          value: new Uint8Array([10, 45, 99, 111, 115, 109, 111, 115, 49, 18, 45, 99, 111, 115, 109, 111, 115, 50]),\n        },\n      ],\n      memo: `Mock tx ${height}-${txIndex}`,\n      timeoutHeight: BigInt(height + 100),\n      extensionOptions: [],\n      nonCriticalExtensionOptions: [],\n    },\n    authInfo: {\n      signerInfos: [\n        {\n          publicKey: {\n            typeUrl: \"/cosmos.crypto.secp256k1.PubKey\",\n            value: new Uint8Array(33),\n          },\n          modeInfo: {\n            single: {\n              mode: 1,\n            },\n          },\n          sequence: BigInt(txIndex),\n        },\n      ],\n      fee: {\n        amount: [\n          {\n            denom: \"uatom\",\n            amount: \"5000\",\n          },\n        ],\n        gasLimit: BigInt(200000),\n        payer: \"\",\n        granter: \"\",\n      },\n      tip: undefined,\n    },\n    signatures: [new Uint8Array(64)],\n  };\n\n  return Tx.encode(tx).finish();\n}\n\nexport class MockRpcClient {\n  private chainId: string;\n  private startHeight: number;\n  private endHeight: number;\n  private txPerBlock: number;\n  private cometVersion: \"0.37\" | \"0.38\";\n  private validatorCount: number;\n\n  constructor({\n    chainId,\n    startHeight,\n    endHeight,\n    txPerBlock,\n    cometVersion,\n    validatorCount,\n  }: MockRpcConfig) {\n    this.chainId = chainId;\n    this.startHeight = startHeight;\n    this.endHeight = endHeight;\n    this.txPerBlock = txPerBlock;\n    this.cometVersion = cometVersion ?? \"0.37\";\n    this.validatorCount = validatorCount ?? 3;\n  }\n\n  /** The synthetic validator set, identical at every height */\n  validators(): Validator[] {\n    const set: Validator[] = [];\n    for (let i = 0; i < this.validatorCount; i++) {\n      set.push(Validator.fromPartial({\n        operatorAddress: syntheticAddress(\"cosmosvaloper\", i + 1),\n        jailed: false,\n        status: 3,\n        tokens: String(1000000 * (i + 1)),\n        delegatorShares: String(1000000 * (i + 1)) + \"000000000000000000\",\n        description: {\n          moniker: \"mock-validator-\" + (i + 1),\n        },\n        commission: {\n          commissionRates: {\n            rate: \"100000000000000000\",\n            maxRate: \"200000000000000000\",\n            maxChangeRate: \"10000000000000000\",\n          },\n        },\n        minSelfDelegation: \"1\",\n      }));\n    }\n    return set;\n  }\n\n  /**\n   * Answers the ABCI queries the engine and the core modules issue. Unknown paths get a\n   * non-zero code, as a real node would answer for a query it does not serve.\n   */\n  async abciQuery(params: AbciQueryParams): Promise<AbciQueryResponse> {\n    const reply = (value: Uint8Array): AbciQueryResponse => ({\n      key: new Uint8Array(),\n      value,\n      height: params.height,\n      index: 0,\n      code: 0,\n      codespace: \"\",\n      log: \"\",\n      info: \"\",\n    });\n    switch (params.path) {\n      case \"/cosmos.staking.v1beta1.Query/Validators\": {\n        const request = QueryValidatorsRequest.decode(params.data);\n        const all = this.validators();\n        const limit = Number(request.pagination?.limit ?? 100n) || 100;\n        const key = request.pagination?.key;\n        const offset = key && key.length > 0 ? key[0] : 0;\n        const page = all.slice(offset, offset + limit);\n        const next = offset + limit < all.length ? new Uint8Array([offset + limit]) : new Uint8Array();\n        return reply(QueryValidatorsResponse.encode(QueryValidatorsResponse.fromPartial({\n          validators: page,\n          pagination: {\n            nextKey: next,\n            total: BigInt(all.length),\n          },\n        })).finish());\n      }\n      case \"/cosmos.auth.v1beta1.Query/ModuleAccounts\":\n        return reply(QueryModuleAccountsResponse.encode(QueryModuleAccountsResponse.fromPartial({\n          accounts: Object.entries(mockModuleAccounts()).map(([name, address]) => ({\n            typeUrl: \"/cosmos.auth.v1beta1.ModuleAccount\",\n            value: ModuleAccount.encode(ModuleAccount.fromPartial({\n              baseAccount: {\n                address,\n              },\n              name,\n            })).finish(),\n          })),\n        })).finish());\n      case \"/cosmos.bank.v1beta1.Query/AllBalances\":\n        return reply(QueryAllBalancesResponse.encode(QueryAllBalancesResponse.fromPartial({\n          balances: [\n            {\n              denom: \"uatom\",\n              amount: \"1000000\",\n            },\n          ],\n        })).finish());\n      case \"/cosmos.staking.v1beta1.Query/Pool\":\n        return reply(QueryPoolResponse.encode(QueryPoolResponse.fromPartial({\n          pool: {\n            bondedTokens: String(this.validators().reduce((sum, v) => sum + Number(v.tokens), 0)),\n            notBondedTokens: \"0\",\n          },\n        })).finish());\n      case \"/cosmos.staking.v1beta1.Query/Params\":\n        return reply(QueryStakingParamsResponse.encode(QueryStakingParamsResponse.fromPartial({\n          params: {\n            unbondingTime: {\n              seconds: 1814400n,\n              nanos: 0,\n            },\n            maxValidators: 100,\n            maxEntries: 7,\n            historicalEntries: 10000,\n            bondDenom: \"uatom\",\n            minCommissionRate: \"0\",\n          },\n        })).finish());\n      case \"/cosmos.staking.v1beta1.Query/DelegatorDelegations\":\n        return reply(QueryDelegatorDelegationsResponse.encode(QueryDelegatorDelegationsResponse.fromPartial({\n        })).finish());\n      case \"/cosmos.staking.v1beta1.Query/ValidatorDelegations\":\n        return reply(QueryValidatorDelegationsResponse.encode(QueryValidatorDelegationsResponse.fromPartial({\n        })).finish());\n      default:\n        return {\n          ...reply(new Uint8Array()),\n          code: 6,\n          log: \"unknown request: \" + params.path,\n        };\n    }\n  }\n\n  async block(height: number): Promise<BlockResponse> {\n    const txs: Uint8Array[] = [];\n    for (let i = 0; i < this.txPerBlock; i++) {\n      txs.push(generateMockTx(height, i));\n    }\n    // Deterministic, unique per height: the blocks table has a unique constraint on the hash\n    const hashOf = (h: number) => new Uint8Array(createHash(\"sha256\").update(this.chainId + \":\" + h).digest());\n    return {\n      block: {\n        header: {\n          height: height,\n          version: {\n            block: 11,\n            app: 0,\n          },\n          time: fromRfc3339WithNanoseconds(new Date().toISOString()),\n          chainId: this.chainId,\n          lastBlockId: null,\n          lastCommitHash: new Uint8Array(),\n          dataHash: new Uint8Array(),\n          validatorsHash: new Uint8Array(),\n          nextValidatorsHash: new Uint8Array(),\n          consensusHash: new Uint8Array(),\n          appHash: new Uint8Array(),\n          lastResultsHash: new Uint8Array(),\n          evidenceHash: new Uint8Array(),\n          proposerAddress: new Uint8Array(),\n        },\n        txs: txs,\n        evidence: [],\n        lastCommit: {\n          height: height - 1,\n          round: 0,\n          blockId: {\n            hash: new Uint8Array(),\n            parts: {\n              total: 0,\n              hash: new Uint8Array(),\n            },\n          },\n          signatures: [\n            {\n              blockIdFlag: 2,\n              validatorAddress: fromHex(\"D68EEC0D2E8248F1EC64CDB585EDB61ECA432BD8\"),\n              timestamp: fromRfc3339WithNanoseconds(new Date().toISOString()),\n              signature: fromBase64(\"Z6d2P35dI6qBzfPdyIZvmZi7Imo2FmQ5kNSnpVb2UvCj0aSjRCtS59BauJFB6FDHPluOUYoz0rJ4jiOnNXh9AA==\"),\n            },\n          ],\n        },\n      },\n      blockId: {\n        hash: hashOf(height),\n        parts: {\n          total: 0,\n          hash: new Uint8Array(),\n        },\n      },\n    };\n  }\n\n  async status(): Promise<StatusResponse> {\n    return {\n      nodeInfo: {\n        protocolVersion: {\n          p2p: 8,\n          block: 11,\n          app: 0,\n        },\n        id: fromHex(\"d2982128df6a29e700980f325b0444e301c604d7\"),\n        listenAddr: \"tcp://0.0.0.0:26656\",\n        network: this.chainId,\n        version: this.cometVersion === \"0.38\" ? \"0.38.17\" : \"0.37.15\",\n        channels: \"40202122233038606100\",\n        moniker: \"node\",\n        other: new Map([[\"txIndex\", \"on\"], [\"rpcAddress\", \"tcp://0.0.0.0:26657\"]]),\n      },\n      syncInfo: {\n        latestBlockHash: fromHex(\"3F3F7A6F11FA91856BE440F8C78262307CAEAB122720D61CB14B118EF89892B5\"),\n        latestAppHash: fromHex(\"FF91D618633BDD5395763F34805E6DACF6BBFB642A2E787677BF28B39427F289\"),\n        latestBlockHeight: this.endHeight,\n        latestBlockTime: fromRfc3339WithNanoseconds(\"2025-11-06T12:58:21.271608775Z\"),\n        earliestBlockHash: fromHex(\"54473B6F28CAA85F5664F7CA3F2EEE49CD9857BDE41E0BF604B1A1DE93CBFEFF\"),\n        earliestAppHash: fromHex(\"24DFB6C312A7FD4B753444F5CD5FAC4D239BAEC09B6A79BB3D04B21B0BC1FC53\"),\n        earliestBlockHeight: 1,\n        earliestBlockTime: fromRfc3339WithNanoseconds(\"2025-05-28T07:58:54.905470438Z\"),\n        catchingUp: false,\n      },\n      validatorInfo: {\n        address: fromHex(\"1C7CE0213D96CD5578249740DC31A9D8E4D7A226\"),\n        pubkey: {\n          algorithm: \"ed25519\",\n          data: fromBase64(\"+KoTmCU6lo7NCtsfPCYpdNf0fs3aScZ8CtdgHTR/oGs=\"),\n        },\n        votingPower: 0n,\n      },\n    };\n  }\n\n  subscribeNewBlock() {\n    return {\n      addListener: (..._args: unknown[]) => {},\n      removeListener: (..._args: unknown[]) => {},\n    } as ReturnType<CometClient[\"subscribeNewBlock\"]>;\n  }\n\n  async disconnect(): Promise<void> {\n    // No-op for mock\n  }\n\n  async blockResults(height: number): Promise<BlockResultsResponse | BlockResultsResponse38> {\n    const attribute = (key: string, value: string) => ({\n      key,\n      value,\n    });\n    const feeCollector = mockModuleAccounts().fee_collector;\n    // Events a real bank module emits for the transfer each mock tx performs\n    const transferEvents = (msgIndex: number): Event38[] => [\n      {\n        type: \"message\",\n        attributes: [attribute(\"action\", \"/cosmos.bank.v1beta1.MsgSend\"), attribute(\"msg_index\", String(msgIndex))],\n      },\n      {\n        type: \"coin_spent\",\n        attributes: [attribute(\"spender\", syntheticAddress(\"cosmos\", 1)), attribute(\"amount\", \"10uatom\"), attribute(\"msg_index\", String(msgIndex))],\n      },\n      {\n        type: \"coin_received\",\n        attributes: [attribute(\"receiver\", syntheticAddress(\"cosmos\", 2)), attribute(\"amount\", \"10uatom\"), attribute(\"msg_index\", String(msgIndex))],\n      },\n    ];\n    const results: TxData[] = [];\n    for (let i = 0; i < this.txPerBlock; i++) {\n      results.push({\n        code: 0,\n        data: Buffer.from(\"success\"),\n        // CometBFT 0.37 nodes return the structured log; 0.38 nodes return an empty log and\n        // events tagged with msg_index instead\n        log: this.cometVersion === \"0.38\"\n          ? \"\"\n          : JSON.stringify([\n            {\n              msg_index: 0,\n              events: transferEvents(0),\n            },\n          ]),\n        gasWanted: BigInt(200000),\n        gasUsed: BigInt(150000),\n        // The 0.37 and 0.38 event types are structurally identical\n        events: transferEvents(0) as unknown as TxData[\"events\"],\n        codespace: \"\",\n      });\n    }\n    // Block-level flows: the fee collector receives the mint at the start of the block\n    const beginBlockEvents: Event38[] = [\n      {\n        type: \"coin_received\",\n        attributes: [attribute(\"receiver\", feeCollector), attribute(\"amount\", \"50uatom\")],\n      },\n    ];\n    const endBlockEvents: Event38[] = [\n      {\n        type: \"coin_spent\",\n        attributes: [attribute(\"spender\", feeCollector), attribute(\"amount\", \"5uatom\")],\n      },\n    ];\n    if (this.cometVersion === \"0.38\") {\n      // Cosmos SDK 0.50+ delivers both phases in one list, tagged with mode=BeginBlock / EndBlock\n      const tagged = (events: Event38[], mode: string) => events.map(event => ({\n        type: event.type,\n        attributes: [...event.attributes, attribute(\"mode\", mode)],\n      }));\n      return {\n        height,\n        results,\n        finalizeBlockEvents: [...tagged(beginBlockEvents, \"BeginBlock\"), ...tagged(endBlockEvents, \"EndBlock\")],\n        validatorUpdates: [],\n        consensusUpdates: undefined,\n      } as unknown as BlockResultsResponse38;\n    }\n    return {\n      height,\n      results,\n      beginBlockEvents,\n      endBlockEvents,\n      validatorUpdates: [],\n      consensusUpdates: undefined,\n    } as unknown as BlockResultsResponse;\n  }\n\n  async connect(): Promise<void> {\n  }\n}\n\n/**\n * Factory function to create a mock RPC client\n */\nexport function createMockRpcClient(config: MockRpcConfig): CometClient {\n  return new MockRpcClient(config) as unknown as CometClient;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiEA,SAAgB,iBAAiB,QAAgB,MAAsB;CACrE,MAAM,QAAQ,IAAI,WAAW,GAAG;AAChC,OAAM,KAAK,OAAO;AAClB,OAAM,KAAM,QAAQ,IAAK;AACzB,OAAM,MAAM;AACZ,QAAO,SAAS,QAAQ,MAAM;;;AAIhC,SAAgB,qBAA6C;AAC3D,QAAO;EACL,eAAe,iBAAiB,UAAU,KAAK;EAC/C,cAAc,iBAAiB,UAAU,KAAK;EAC/C;;;;;AAMH,SAAS,eAAe,QAAgB,SAA6B;CACnE,MAAMA,KAAS;EACb,MAAM;GACJ,UAAU,CACR;IACE,SAAS;IACT,OAAO,IAAI,WAAW;KAAC;KAAI;KAAI;KAAI;KAAK;KAAK;KAAK;KAAK;KAAK;KAAI;KAAI;KAAI;KAAI;KAAK;KAAK;KAAK;KAAK;KAAK;KAAG,CAAC;IAC1G,CACF;GACD,MAAM,WAAW,OAAO,GAAG;GAC3B,eAAe,OAAO,SAAS,IAAI;GACnC,kBAAkB,EAAE;GACpB,6BAA6B,EAAE;GAChC;EACD,UAAU;GACR,aAAa,CACX;IACE,WAAW;KACT,SAAS;KACT,OAAO,IAAI,WAAW,GAAG;KAC1B;IACD,UAAU,EACR,QAAQ,EACN,MAAM,GACP,EACF;IACD,UAAU,OAAO,QAAQ;IAC1B,CACF;GACD,KAAK;IACH,QAAQ,CACN;KACE,OAAO;KACP,QAAQ;KACT,CACF;IACD,UAAU,OAAO,IAAO;IACxB,OAAO;IACP,SAAS;IACV;GACD,KAAK;GACN;EACD,YAAY,CAAC,IAAI,WAAW,GAAG,CAAC;EACjC;AAED,QAAO,GAAG,OAAO,GAAG,CAAC,QAAQ;;AAG/B,IAAa,gBAAb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