import { WalletObject } from '@ocap/wallet';

type PartialDeep<T> = {
  [K in keyof T]?: T[K] extends object ? PartialDeep<T[K]> : T[K]
}

export as namespace GraphQLClient;

/*~ This declaration specifies that the class constructor function
 *~ is the exported object from the file
 */
export = GraphQLClient;

/*~ Write your module's methods and properties in this class */
declare class GraphQLClient {
  config: any;
  schema: void;
  constructor(endpoint: string, autoInit: boolean = true);

  getQueries(): string[];
  getSubscriptions(): string[];
  getMutations(): string[];

  /**
   * Send raw query to forge and return results
   *
   * @param {*} query
   * @memberof GraphQLClient
   * @return Promise
   */
  doRawQuery(query: any, requestOptions?: any): Promise<any>;
  doRawSubscription(query: any): Promise<any>;

  doBatchQuery(queries: object, requestOptions?: any): Promise<object>;

  fromUnitToToken(value: string): Promise<string>;
  fromTokenToUnit(amount: number): Promise<BN>;
  getTxSendMethods(): Array<string>;
  getTxEncodeMethods(): Array<string>;
  getTxSignMethods(): Array<string>;
  getTxMultiSignMethods(): Array<string>;
  getType(x: string): Object;
  decodeTx(input: string | Buffer): object;

  // Account methods
  migrateAccount(params: {
    from: WalletObject;
    to: WalletObject;
  }, extra?: any): Promise<string>;

  delegate(params: {
    from: WalletObject;
    to: WalletObject;
    privileges: Array<{ typeUrl: string; limit?: { tokens?: string[]; assets?: string[] } }> | { typeUrl: string; limit?: { tokens?: string[]; assets?: string[] } };
  }, extra?: any): Promise<[string, string]>;

  revokeDelegate(params: {
    from: WalletObject;
    to: WalletObject;
    privileges: Array<string | { toString(): string }>;
  }, extra?: any): Promise<string>;

  // Asset methods
  createAsset(params: {
    moniker: string;
    parent?: string;
    ttl?: number;
    data?: any;
    readonly?: boolean;
    transferrable?: boolean;
    display?: any;
    endpoint?: any;
    tags?: string[];
    delegator?: string;
    wallet: WalletObject;
  }, extra?: any): Promise<[string, string]>;

  updateAsset(params: {
    address: string;
    moniker?: string;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  createAssetFactory(params: {
    factory: {
      name: string;
      description?: string;
      settlement?: string;
      limit?: number;
      trustedIssuers?: string[];
      input?: any;
      output?: any;
      data?: any;
      hooks?: any[];
      display?: any;
    };
    wallet: WalletObject;
  }, extra?: any): Promise<[string, string]>;

  acquireAsset(params: {
    itx: any;
    delegator?: string;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  // Transfer methods
  transfer(params: {
    token?: number;
    assets?: string[];
    tokens?: Array<{ address: string; value: number }>;
    to: string;
    memo?: string;
    delegator?: string;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  // Exchange methods
  prepareExchange(params: {
    offerToken?: number;
    offerAssets?: string[];
    demandToken?: number;
    demandAssets?: string[];
    offerTokens?: Array<{ address: string; value: number }>;
    demandTokens?: Array<{ address: string; value: number }>;
    receiver?: string;
    memo?: string;
    delegator?: string;
    wallet: WalletObject;
  }, extra?: any): Promise<GraphQLClient.Transaction>;

  finalizeExchange(params: {
    tx: GraphQLClient.Transaction;
    delegator?: string;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<GraphQLClient.Transaction>;

  exchange(params: {
    tx: GraphQLClient.Transaction;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  generateQueryFns(): void;
  generateSubscriptionFns(): void;
  generateMutationFns(): void;

  setGasPayer(wallet: WalletObject): void;
  pickGasPayerHeaders(req: any): any;

  // WebSocket methods from base.js
  subscribe(topic: string, callback: (data: any) => void): any;
  unsubscribe(topic: string, callback?: (data: any) => void): any;

  // Token factory methods from extension.js
  createTokenFactory(params: {
    feeRate?: number;
    curve?: {
      type?: string;
      slope?: string;
      basePrice?: string;
      fixedPrice?: string;
    };
    token: {
      name: string;
      symbol: string;
      decimal?: number;
      description?: string;
      icon?: string;
      maxTotalSupply?: string;
    };
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<[string, string]>;

  updateTokenFactory(params: {
    address: string;
    feeRate?: number;
    token?: any;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  // Token methods
  createToken(params: {
    name: string;
    description?: string;
    symbol: string;
    unit?: string;
    decimal?: number;
    icon?: string;
    totalSupply: number;
    initialSupply?: number;
    maxTotalSupply?: number;
    foreignToken?: any;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<[string, string]>;

  mintToken(params: {
    tokenFactory: string;
    amount: number;
    receiver?: string;
    maxReserve?: number;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  burnToken(params: {
    tokenFactory: string;
    amount: number;
    receiver?: string;
    minReserve?: number;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  // Staking methods
  stake(params: {
    assets?: string[];
    tokens?: Array<{ address: string; value: number }>;
    slashers?: string[];
    to: string;
    locked?: boolean;
    message?: string;
    nonce?: string;
    wallet: WalletObject;
  }, extra?: any): Promise<[string, string]>;

  revokeStake(params: {
    assets?: string[];
    tokens?: Array<{ address: string; value: number }>;
    from: string;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  slashStake(params: {
    assets?: string[];
    tokens?: Array<{ address: string; value: number }>;
    reason: string;
    from: string;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  claimStake(params: {
    from: string;
    evidence: string;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  // Asset factory methods
  preMintAsset(params: {
    factory: string;
    inputs?: object;
    owner: string;
    wallet: WalletObject;
    extra?: object;
  }): Promise<{
    asset: { address: string; owner: string; parent: string;[key: string]: any };
    factory: string;
    address: string;
    variables: Array<{ name: string; value: any }>;
    issuer: any;
    owner: string;
    [key: string]: any;
  }>;

  mintAsset(params: {
    itx: any;
    wallet: WalletObject;
  }, extra?: any): Promise<string>;

  // Rollup methods
  createRollup(params: {
    tokenAddress: string;
    vaultAddress: string;
    contractAddress: string;
    seedValidators: any[];
    minStakeAmount: string;
    maxStakeAmount?: string;
    minSignerCount?: number;
    maxSignerCount?: number;
    minBlockSize?: number;
    maxBlockSize?: number;
    minBlockInterval?: number;
    minBlockConfirmation?: number;
    minDepositAmount?: string;
    maxDepositAmount?: string;
    minWithdrawAmount?: string;
    maxWithdrawAmount?: string;
    depositFeeRate?: number;
    withdrawFeeRate?: number;
    publisherFeeShare?: number;
    proposerFeeShare?: number;
    minDepositFee?: string;
    maxDepositFee?: string;
    minWithdrawFee?: string;
    maxWithdrawFee?: string;
    leaveWaitingPeriod?: number;
    publishWaitingPeriod?: number;
    publishSlashRate?: number;
    data?: any;
    wallet: WalletObject;
  }, extra?: any): Promise<[string, string]>;

  // Context methods
  getContext(): Promise<{
    chainId: string;
    consensus: string;
    token: { address: string; decimal: number; symbol: string };
    txConfig: any;
    vaults: any;
    tokenStateMap: Map<string, any>;
  }>;

  getTokenStateMap(addressList: string[]): Promise<Map<string, { decimal: number }>>;

  sendAccountMigrateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AccountMigrateTx>>, extra?: any): Promise<string>;
  sendAcquireAssetV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV2Tx>>, extra?: any): Promise<string>;
  sendAcquireAssetV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>, extra?: any): Promise<string>;
  sendBurnTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>, extra?: any): Promise<string>;
  sendClaimBlockRewardTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>, extra?: any): Promise<string>;
  sendClaimStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimStakeTx>>, extra?: any): Promise<string>;
  sendCloseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CloseRollupTx>>, extra?: any): Promise<string>;
  sendConsumeAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ConsumeAssetTx>>, extra?: any): Promise<string>;
  sendCreateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateAssetTx>>, extra?: any): Promise<string>;
  sendCreateFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateFactoryTx>>, extra?: any): Promise<string>;
  sendCreateRollupBlockTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupBlockTx>>, extra?: any): Promise<string>;
  sendCreateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupTx>>, extra?: any): Promise<string>;
  sendCreateTokenFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenFactoryTx>>, extra?: any): Promise<string>;
  sendCreateTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenTx>>, extra?: any): Promise<string>;
  sendDelegateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DelegateTx>>, extra?: any): Promise<string>;
  sendDepositTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DepositTokenV2Tx>>, extra?: any): Promise<string>;
  sendExchangeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeTx>>, extra?: any): Promise<string>;
  sendExchangeV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeV2Tx>>, extra?: any): Promise<string>;
  sendJoinRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.JoinRollupTx>>, extra?: any): Promise<string>;
  sendLeaveRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.LeaveRollupTx>>, extra?: any): Promise<string>;
  sendMigrateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MigrateRollupTx>>, extra?: any): Promise<string>;
  sendMintAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintAssetTx>>, extra?: any): Promise<string>;
  sendMintTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>, extra?: any): Promise<string>;
  sendPauseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>, extra?: any): Promise<string>;
  sendResumeRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ResumeRollupTx>>, extra?: any): Promise<string>;
  sendReturnStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ReturnStakeTx>>, extra?: any): Promise<string>;
  sendRevokeDelegateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.RevokeDelegateTx>>, extra?: any): Promise<string>;
  sendRevokeStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.RevokeStakeTx>>, extra?: any): Promise<string>;
  sendSlashStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.SlashStakeTx>>, extra?: any): Promise<string>;
  sendStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.StakeTx>>, extra?: any): Promise<string>;
  sendTransferTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferTx>>, extra?: any): Promise<string>;
  sendTransferV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV2Tx>>, extra?: any): Promise<string>;
  sendTransferV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV3Tx>>, extra?: any): Promise<string>;
  sendUpdateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateAssetTx>>, extra?: any): Promise<string>;
  sendUpdateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>, extra?: any): Promise<string>;
  sendUpdateTokenFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateTokenFactoryTx>>, extra?: any): Promise<string>;
  sendUpgradeNodeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpgradeNodeTx>>, extra?: any): Promise<string>;
  sendWithdrawTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.WithdrawTokenV2Tx>>, extra?: any): Promise<string>;
  encodeAccountMigrateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AccountMigrateTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeAcquireAssetV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV2Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeAcquireAssetV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeBurnTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeClaimBlockRewardTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeClaimStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimStakeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCloseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CloseRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeConsumeAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ConsumeAssetTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCreateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateAssetTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCreateFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateFactoryTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCreateRollupBlockTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupBlockTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCreateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCreateTokenFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenFactoryTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeCreateTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeDelegateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DelegateTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeDepositTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DepositTokenV2Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeExchangeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeExchangeV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeV2Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeJoinRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.JoinRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeLeaveRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.LeaveRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeMigrateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MigrateRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeMintAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintAssetTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeMintTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodePauseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeResumeRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ResumeRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeReturnStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ReturnStakeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeRevokeDelegateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.RevokeDelegateTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeRevokeStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.RevokeStakeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeSlashStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.SlashStakeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.StakeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeTransferTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeTransferV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV2Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeTransferV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV3Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeUpdateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateAssetTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeUpdateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeUpdateTokenFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateTokenFactoryTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeUpgradeNodeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpgradeNodeTx>>): Promise<GraphQLClient.EncodeTxResult>;
  encodeWithdrawTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.WithdrawTokenV2Tx>>): Promise<GraphQLClient.EncodeTxResult>;
  signAccountMigrateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AccountMigrateTx>>): Promise<GraphQLClient.Transaction>;
  signAcquireAssetV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV2Tx>>): Promise<GraphQLClient.Transaction>;
  signAcquireAssetV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>): Promise<GraphQLClient.Transaction>;
  signBurnTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>): Promise<GraphQLClient.Transaction>;
  signClaimBlockRewardTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>): Promise<GraphQLClient.Transaction>;
  signClaimStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimStakeTx>>): Promise<GraphQLClient.Transaction>;
  signCloseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CloseRollupTx>>): Promise<GraphQLClient.Transaction>;
  signConsumeAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ConsumeAssetTx>>): Promise<GraphQLClient.Transaction>;
  signCreateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateAssetTx>>): Promise<GraphQLClient.Transaction>;
  signCreateFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateFactoryTx>>): Promise<GraphQLClient.Transaction>;
  signCreateRollupBlockTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupBlockTx>>): Promise<GraphQLClient.Transaction>;
  signCreateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupTx>>): Promise<GraphQLClient.Transaction>;
  signCreateTokenFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenFactoryTx>>): Promise<GraphQLClient.Transaction>;
  signCreateTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenTx>>): Promise<GraphQLClient.Transaction>;
  signDelegateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DelegateTx>>): Promise<GraphQLClient.Transaction>;
  signDepositTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DepositTokenV2Tx>>): Promise<GraphQLClient.Transaction>;
  signExchangeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeTx>>): Promise<GraphQLClient.Transaction>;
  signExchangeV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeV2Tx>>): Promise<GraphQLClient.Transaction>;
  signJoinRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.JoinRollupTx>>): Promise<GraphQLClient.Transaction>;
  signLeaveRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.LeaveRollupTx>>): Promise<GraphQLClient.Transaction>;
  signMigrateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MigrateRollupTx>>): Promise<GraphQLClient.Transaction>;
  signMintAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintAssetTx>>): Promise<GraphQLClient.Transaction>;
  signMintTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>): Promise<GraphQLClient.Transaction>;
  signPauseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>): Promise<GraphQLClient.Transaction>;
  signResumeRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ResumeRollupTx>>): Promise<GraphQLClient.Transaction>;
  signReturnStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ReturnStakeTx>>): Promise<GraphQLClient.Transaction>;
  signRevokeDelegateTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.RevokeDelegateTx>>): Promise<GraphQLClient.Transaction>;
  signRevokeStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.RevokeStakeTx>>): Promise<GraphQLClient.Transaction>;
  signSlashStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.SlashStakeTx>>): Promise<GraphQLClient.Transaction>;
  signStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.StakeTx>>): Promise<GraphQLClient.Transaction>;
  signTransferTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferTx>>): Promise<GraphQLClient.Transaction>;
  signTransferV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV2Tx>>): Promise<GraphQLClient.Transaction>;
  signTransferV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV3Tx>>): Promise<GraphQLClient.Transaction>;
  signUpdateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateAssetTx>>): Promise<GraphQLClient.Transaction>;
  signUpdateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>): Promise<GraphQLClient.Transaction>;
  signUpdateTokenFactoryTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateTokenFactoryTx>>): Promise<GraphQLClient.Transaction>;
  signUpgradeNodeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpgradeNodeTx>>): Promise<GraphQLClient.Transaction>;
  signWithdrawTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.WithdrawTokenV2Tx>>): Promise<GraphQLClient.Transaction>;
  multiSignExchangeV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ExchangeV2Tx>>): Promise<GraphQLClient.Transaction>;
  multiSignTransferV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.TransferV3Tx>>): Promise<GraphQLClient.Transaction>;
  multiSignAcquireAssetV3Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>): Promise<GraphQLClient.Transaction>;
  multiSignStakeTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.StakeTx>>): Promise<GraphQLClient.Transaction>;
  multiSignUpdateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignJoinRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.JoinRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignLeaveRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.LeaveRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignPauseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignCloseRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CloseRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignMigrateRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MigrateRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignResumeRollupTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ResumeRollupTx>>): Promise<GraphQLClient.Transaction>;
  multiSignDepositTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.DepositTokenV2Tx>>): Promise<GraphQLClient.Transaction>;
  multiSignWithdrawTokenV2Tx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.WithdrawTokenV2Tx>>): Promise<GraphQLClient.Transaction>;
  multiSignCreateRollupBlockTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupBlockTx>>): Promise<GraphQLClient.Transaction>;
  multiSignClaimBlockRewardTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>): Promise<GraphQLClient.Transaction>;
  multiSignCreateAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateAssetTx>>): Promise<GraphQLClient.Transaction>;
  multiSignConsumeAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ConsumeAssetTx>>): Promise<GraphQLClient.Transaction>;
  multiSignMintTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>): Promise<GraphQLClient.Transaction>;
  multiSignBurnTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>): Promise<GraphQLClient.Transaction>;
  getAccountState(params?: PartialDeep<GraphQLClient.GetAccountStateParams>): Promise<GraphQLClient.ResponseGetAccountState>
  getAssetState(params?: PartialDeep<GraphQLClient.GetAssetStateParams>): Promise<GraphQLClient.ResponseGetAssetState>
  getFactoryState(params?: PartialDeep<GraphQLClient.GetFactoryStateParams>): Promise<GraphQLClient.ResponseGetFactoryState>
  getDelegateState(params?: PartialDeep<GraphQLClient.GetDelegateStateParams>): Promise<GraphQLClient.ResponseGetDelegateState>
  getTokenState(params?: PartialDeep<GraphQLClient.GetTokenStateParams>): Promise<GraphQLClient.ResponseGetTokenState>
  getEvidenceState(params?: PartialDeep<GraphQLClient.GetEvidenceStateParams>): Promise<GraphQLClient.ResponseGetEvidenceState>
  getForgeState(params?: PartialDeep<GraphQLClient.GetForgeStateParams>): Promise<GraphQLClient.ResponseGetForgeState>
  getTokenFactoryState(params?: PartialDeep<GraphQLClient.GetTokenFactoryStateParams>): Promise<GraphQLClient.ResponseGetTokenFactoryState>
  getTx(params?: PartialDeep<GraphQLClient.GetTxParams>): Promise<GraphQLClient.ResponseGetTx>
  getBlock(params?: PartialDeep<GraphQLClient.GetBlockParams>): Promise<GraphQLClient.ResponseGetBlock>
  getBlocks(params?: PartialDeep<GraphQLClient.GetBlocksParams>): Promise<GraphQLClient.ResponseGetBlocks>
  getUnconfirmedTxs(params?: PartialDeep<GraphQLClient.GetUnconfirmedTxsParams>): Promise<GraphQLClient.ResponseGetUnconfirmedTxs>
  getChainInfo(): Promise<GraphQLClient.ResponseGetChainInfo>
  getConfig(params?: PartialDeep<GraphQLClient.GetConfigParams>): Promise<GraphQLClient.ResponseGetConfig>
  getNetInfo(): Promise<GraphQLClient.ResponseGetNetInfo>
  getNodeInfo(): Promise<GraphQLClient.ResponseGetNodeInfo>
  getValidatorsInfo(): Promise<GraphQLClient.ResponseGetValidatorsInfo>
  getForgeStats(): Promise<GraphQLClient.ResponseGetForgeStats>
  listAssetTransactions(params?: PartialDeep<GraphQLClient.ListAssetTransactionsParams>): Promise<GraphQLClient.ResponseListAssetTransactions>
  listAssets(params?: PartialDeep<GraphQLClient.ListAssetsParams>): Promise<GraphQLClient.ResponseListAssets>
  listBlocks(params?: PartialDeep<GraphQLClient.ListBlocksParams>): Promise<GraphQLClient.ResponseListBlocks>
  listTopAccounts(params?: PartialDeep<GraphQLClient.ListTopAccountsParams>): Promise<GraphQLClient.ResponseListTopAccounts>
  listTransactions(params?: PartialDeep<GraphQLClient.ListTransactionsParams>): Promise<GraphQLClient.ResponseListTransactions>
  listTokens(params?: PartialDeep<GraphQLClient.ListTokensParams>): Promise<GraphQLClient.ResponseListTokens>
  listFactories(params?: PartialDeep<GraphQLClient.ListFactoriesParams>): Promise<GraphQLClient.ResponseListFactories>
  getAccountTokens(params?: PartialDeep<GraphQLClient.GetAccountTokensParams>): Promise<GraphQLClient.ResponseGetAccountTokens>
  getStakeState(params?: PartialDeep<GraphQLClient.GetStakeStateParams>): Promise<GraphQLClient.ResponseGetStakeState>
  listStakes(params?: PartialDeep<GraphQLClient.ListStakesParams>): Promise<GraphQLClient.ResponseListStakes>
  getRollupState(params?: PartialDeep<GraphQLClient.GetRollupStateParams>): Promise<GraphQLClient.ResponseGetRollupState>
  listRollups(params?: PartialDeep<GraphQLClient.ListRollupsParams>): Promise<GraphQLClient.ResponseListRollups>
  getRollupBlock(params?: PartialDeep<GraphQLClient.GetRollupBlockParams>): Promise<GraphQLClient.ResponseGetRollupBlock>
  listRollupBlocks(params?: PartialDeep<GraphQLClient.ListRollupBlocksParams>): Promise<GraphQLClient.ResponseListRollupBlocks>
  listRollupValidators(params?: PartialDeep<GraphQLClient.ListRollupValidatorsParams>): Promise<GraphQLClient.ResponseListRollupValidators>
  listDelegations(params?: PartialDeep<GraphQLClient.ListDelegationsParams>): Promise<GraphQLClient.ResponseListDelegations>
  search(params?: PartialDeep<GraphQLClient.SearchParams>): Promise<GraphQLClient.ResponseSearch>
  estimateGas(params?: PartialDeep<GraphQLClient.EstimateGasParams>): Promise<GraphQLClient.ResponseEstimateGas>
  listTokenFlows(params?: PartialDeep<GraphQLClient.ListTokenFlowsParams>): Promise<GraphQLClient.ResponseListTokenFlows>
  verifyAccountRisk(params?: PartialDeep<GraphQLClient.VerifyAccountRiskParams>): Promise<GraphQLClient.ResponseVerifyAccountRisk>
  getTokenDistribution(params?: PartialDeep<GraphQLClient.GetTokenDistributionParams>): Promise<GraphQLClient.ResponseGetTokenDistribution>
  listTokenFactories(params?: PartialDeep<GraphQLClient.ListTokenFactoriesParams>): Promise<GraphQLClient.ResponseListTokenFactories>
  sendTx(params?: PartialDeep<GraphQLClient.SendTxParams>): Promise<GraphQLClient.ResponseSendTx>

}

declare namespace GraphQLClient {
  interface Subscription<T> {
    on(event: 'data', fn: (data: T) => any): this;
    on(event: 'error', fn: (err: Error) => void): this;
  }

  interface TxParam<T> {
    tx: {
      nonce?: number;
      from?: string;
      pk?: string;
      chainId?: string;
      delegator?: string;
      signature?: string;
      signatures?: PartialDeep<GraphQLClient.Multisig>[];
      itx?: T;
    } | Transaction;
    wallet: WalletObject,
    delegator?: string;
    signature?: string;
  }

  interface WalletTypeObject {
    pk: number;
    role: number;
    address: number;
    hash: number;
  }

  interface EncodeTxResult {
    object: object;
    buffer: Buffer;
  }


  enum Direction {
    MUTUAL,
    ONE_WAY,
    UNION,
  }

  enum EncodingType {
    BASE16,
    BASE58,
  }

  enum HashType {
    KECCAK,
    SHA3,
    SHA2,
    KECCAK_384,
    SHA3_384,
    KECCAK_512,
    SHA3_512,
  }

  enum KeyType {
    ED25519,
    SECP256K1,
    ETHEREUM,
  }

  enum RoleType {
    ROLE_ACCOUNT,
    ROLE_NODE,
    ROLE_DEVICE,
    ROLE_APPLICATION,
    ROLE_SMART_CONTRACT,
    ROLE_BOT,
    ROLE_ASSET,
    ROLE_STAKE,
    ROLE_VALIDATOR,
    ROLE_GROUP,
    ROLE_TX,
    ROLE_TETHER,
    ROLE_SWAP,
    ROLE_DELEGATION,
    ROLE_VC,
    ROLE_BLOCKLET,
    ROLE_STORE,
    ROLE_TOKEN,
    ROLE_FACTORY,
    ROLE_ROLLUP,
    ROLE_STORAGE,
    ROLE_ANY,
  }

  enum StatusCode {
    OK,
    INVALID_NONCE,
    INVALID_SIGNATURE,
    INVALID_SENDER_STATE,
    INVALID_RECEIVER_STATE,
    INSUFFICIENT_DATA,
    INSUFFICIENT_FUND,
    INVALID_OWNER,
    INVALID_TX,
    UNSUPPORTED_TX,
    EXPIRED_TX,
    TOO_MANY_TXS,
    INVALID_LOCK_STATUS,
    INVALID_REQUEST,
    INVALID_MONIKER,
    INVALID_PASSPHRASE,
    INVALID_MULTISIG,
    INVALID_WALLET,
    INVALID_CHAIN_ID,
    CONSENSUS_RPC_ERROR,
    STORAGE_RPC_ERROR,
    NOENT,
    ACCOUNT_MIGRATED,
    RPC_CONNECTION_ERROR,
    UNSUPPORTED_STAKE,
    INSUFFICIENT_STAKE,
    INVALID_STAKE_STATE,
    EXPIRED_WALLET_TOKEN,
    BANNED_UNSTAKE,
    INVALID_ASSET,
    INVALID_TX_SIZE,
    INVALID_SIGNER_STATE,
    INVALID_FORGE_STATE,
    EXPIRED_ASSET,
    UNTRANSFERRABLE_ASSET,
    READONLY_ASSET,
    CONSUMED_ASSET,
    INVALID_DEPOSIT_VALUE,
    EXCEED_DEPOSIT_CAP,
    INVALID_DEPOSIT_TARGET,
    INVALID_DEPOSITOR,
    INVALID_WITHDRAWER,
    INVALID_EXPIRY_DATE,
    INVALID_CUSTODIAN,
    INSUFFICIENT_GAS,
    INVALID_SWAP,
    INVALID_HASHKEY,
    INVALID_DELEGATION,
    INSUFFICIENT_DELEGATION,
    INVALID_DELEGATION_RULE,
    INVALID_DELEGATION_TYPE_URL,
    SENDER_NOT_AUTHORIZED,
    PROTOCOL_NOT_RUNNING,
    PROTOCOL_NOT_PAUSED,
    PROTOCOL_NOT_ACTIVATED,
    INVALID_DEACTIVATION,
    SENDER_WITHDRAW_ITEMS_FULL,
    WITHDRAW_ITEM_MISSING,
    INVALID_WITHDRAW_TX,
    INVALID_CHAIN_TYPE,
    INVALID_TIME,
    INVALID_SUBSCRIBE,
    INVALID_DID_TYPE,
    INVALID_CANDIDATE_STATE,
    VALIDATOR_NOT_FOUND,
    VALIDATOR_NOT_CHANGED,
    INVALID_FACTORY_STATE,
    INVALID_FACTORY_PROPS,
    INVALID_FACTORY_INPUT,
    INVALID_TOKEN,
    INVALID_ROLLUP,
    INVALID_BLOCK,
    FORBIDDEN,
    INTERNAL,
    TIMEOUT,
  }

  enum TokenFlowDirection {
    IN,
    OUT,
  }

  enum UpgradeAction {
    VERIFY,
    BACKUP,
    REPLACE,
    RESTART_APP,
    RESTART_DFS,
    RESTART_CONSENSUS,
    RESTART_P2P,
    RESTART_FORGE,
    ROLLBACK_IF_FAIL,
    RESTART_ALL_IF_FAIL,
    CRASH_IF_FAIL,
    DROP_ADDRESS_BOOK,
  }

  enum UpgradeType {
    CONFIG_APP,
    CONFIG_FORGE,
    CONFIG_DFS,
    CONFIG_CONSENSUS,
    CONFIG_P2P,
    EXE_APP,
    EXE_FORGE,
    EXE_DFS,
    EXE_CONSENSUS,
    EXE_P2P,
  }

  enum Validity {
    BOTH,
    VALID,
    INVALID,
  }

  interface AccountFilterInput {
    accounts: string[];
  }

  interface AddressFilterInput {
    sender: string;
    receiver: string;
    direction: GraphQLClient.Direction;
  }

  interface AssetFilterInput {
    assets: string[];
  }

  interface DelegationFilterInput {
    delegations: string[];
  }

  interface FactoryFilterInput {
    factories: string[];
  }

  interface PageInput {
    cursor: string;
    size: number;
    order: GraphQLClient.PageOrderInput[];
  }

  interface PageOrderInput {
    field: string;
    type: string;
  }

  interface RangeFilterInput {
    from: string;
    to: string;
  }

  interface RequestEstimateGasInput {
    typeUrl: string;
    tx: string;
  }

  interface RequestGetAccountStateInput {
    address: string;
    keys: string[];
    height: number;
    traceMigration: boolean;
  }

  interface RequestGetAccountTokensInput {
    address: string;
    token: string;
  }

  interface RequestGetBlockInput {
    height: number;
  }

  interface RequestGetBlocksInput {
    paging: GraphQLClient.PageInput;
    heightFilter: GraphQLClient.RangeFilterInput;
    emptyExcluded: boolean;
  }

  interface RequestGetConfigInput {
    parsed: boolean;
  }

  interface RequestGetEvidenceStateInput {
    hash: string;
  }

  interface RequestGetRollupBlockInput {
    hash: string;
    height: number;
    rollupAddress: string;
  }

  interface RequestGetStateInput {
    address: string;
    keys: string[];
    height: number;
  }

  interface RequestGetTokenDistributionInput {
    tokenAddress: string;
  }

  interface RequestGetTxInput {
    hash: string;
  }

  interface RequestListAssetTransactionsInput {
    paging: GraphQLClient.PageInput;
    address: string;
  }

  interface RequestListAssetsInput {
    paging: GraphQLClient.PageInput;
    ownerAddress: string;
    factoryAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListBlocksInput {
    paging: GraphQLClient.PageInput;
    proposer: string;
    timeFilter: GraphQLClient.TimeFilterInput;
    heightFilter: GraphQLClient.RangeFilterInput;
    numTxsFilter: GraphQLClient.RangeFilterInput;
    numInvalidTxsFilter: GraphQLClient.RangeFilterInput;
  }

  interface RequestListDelegationsInput {
    paging: GraphQLClient.PageInput;
    from: string;
    to: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListFactoriesInput {
    paging: GraphQLClient.PageInput;
    ownerAddress: string;
    addressList: string[];
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListRollupBlocksInput {
    paging: GraphQLClient.PageInput;
    rollupAddress: string;
    tokenAddress: string;
    proposer: string;
    validatorFilter: GraphQLClient.ValidatorFilterInput;
    txFilter: GraphQLClient.TxFilterInput;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListRollupValidatorsInput {
    paging: GraphQLClient.PageInput;
    rollupAddress: string;
  }

  interface RequestListRollupsInput {
    paging: GraphQLClient.PageInput;
    tokenAddress: string;
    foreignTokenAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListStakesInput {
    paging: GraphQLClient.PageInput;
    addressFilter: GraphQLClient.AddressFilterInput;
    timeFilter: GraphQLClient.TimeFilterInput;
    assetFilter: GraphQLClient.AssetFilterInput;
  }

  interface RequestListTokenFlowsInput {
    paging: GraphQLClient.PageInput;
    accountAddress: string;
    tokenAddress: string;
    depth: number;
    direction: GraphQLClient.TokenFlowDirection;
  }

  interface RequestListTokensInput {
    paging: GraphQLClient.PageInput;
    issuerAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListTopAccountsInput {
    paging: GraphQLClient.PageInput;
    tokenAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface RequestListTransactionsInput {
    paging: GraphQLClient.PageInput;
    timeFilter: GraphQLClient.TimeFilterInput;
    addressFilter: GraphQLClient.AddressFilterInput;
    typeFilter: GraphQLClient.TypeFilterInput;
    validityFilter: GraphQLClient.ValidityFilterInput;
    factoryFilter: GraphQLClient.FactoryFilterInput;
    tokenFilter: GraphQLClient.TokenFilterInput;
    assetFilter: GraphQLClient.AssetFilterInput;
    accountFilter: GraphQLClient.AccountFilterInput;
    txFilter: GraphQLClient.TxFilterInput;
    rollupFilter: GraphQLClient.RollupFilterInput;
    stakeFilter: GraphQLClient.StakeFilterInput;
    delegationFilter: GraphQLClient.DelegationFilterInput;
    tokenFactoryFilter: GraphQLClient.TokenFactoryFilterInput;
  }

  interface RequestSearchInput {
    paging: GraphQLClient.PageInput;
    keyword: string;
  }

  interface RequestSendTxInput {
    tx: string;
    wallet: GraphQLClient.WalletInfoInput;
    token: string;
    commit: boolean;
    extra: string;
  }

  interface RequestVerifyAccountRiskInput {
    accountAddress: string;
    tokenAddress: string;
  }

  interface RollupFilterInput {
    rollups: string[];
  }

  interface StakeFilterInput {
    stakes: string[];
  }

  interface TimeFilterInput {
    startDateTime: string;
    endDateTime: string;
    field: string;
  }

  interface TokenFactoryFilterInput {
    tokenFactories: string[];
  }

  interface TokenFilterInput {
    tokens: string[];
  }

  interface TxFilterInput {
    txs: string[];
  }

  interface TypeFilterInput {
    types: string[];
  }

  interface ValidatorFilterInput {
    validators: string[];
  }

  interface ValidityFilterInput {
    validity: GraphQLClient.Validity;
  }

  interface WalletInfoInput {
    type: GraphQLClient.WalletTypeInput;
    sk: string;
    pk: string;
    address: string;
  }

  interface WalletTypeInput {
    pk: GraphQLClient.KeyType;
    hash: GraphQLClient.HashType;
    address: GraphQLClient.EncodingType;
    role: GraphQLClient.RoleType;
  }

  interface AccountConfig {
    address: string;
    pk: string;
    balance: string;
  }

  interface AccountMigrateTx {
    pk: string;
    type: GraphQLClient.WalletType;
    address: string;
    data: GraphQLClient.Any;
  }

  interface AccountState {
    balance: string;
    nonce: string;
    numTxs: string;
    address: string;
    pk: string;
    type: GraphQLClient.WalletType;
    moniker: string;
    context: GraphQLClient.StateContext;
    issuer: string;
    gasBalance: string;
    migratedTo: string[];
    migratedFrom: string[];
    numAssets: string;
    tokens: GraphQLClient.IndexedTokenInput[];
    data: GraphQLClient.Any;
  }

  interface AccountToken {
    address: string;
    symbol: string;
    balance: string;
    decimal: number;
  }

  interface AcquireAssetV2Tx {
    factory: string;
    address: string;
    assets: string[];
    variables: GraphQLClient.VariableInput[];
    issuer: GraphQLClient.NFTIssuer;
    data: GraphQLClient.Any;
  }

  interface AcquireAssetV3Tx {
    factory: string;
    address: string;
    inputs: GraphQLClient.TransactionInput[];
    owner: string;
    variables: GraphQLClient.VariableInput[];
    issuer: GraphQLClient.NFTIssuer;
    data: GraphQLClient.Any;
  }

  interface Any {
    typeUrl: string;
    value: string;
  }

  interface AssetFactoryHook {
    name: string;
    type: string;
    hook: string;
  }

  interface AssetFactoryInput {
    value: string;
    tokens: GraphQLClient.TokenInput[];
    assets: string[];
    variables: GraphQLClient.VariableInput[];
  }

  interface AssetFactoryState {
    address: string;
    owner: string;
    name: string;
    description: string;
    settlement: string;
    limit: number;
    trustedIssuers: string[];
    input: GraphQLClient.IndexedFactoryInput;
    output: GraphQLClient.CreateAssetTx;
    hooks: GraphQLClient.AssetFactoryHook[];
    data: GraphQLClient.Any;
    context: GraphQLClient.StateContext;
    balance: string;
    tokens: GraphQLClient.IndexedTokenInput[];
    numMinted: number;
    display: GraphQLClient.NFTDisplay;
    lastSettlement: string;
  }

  interface AssetLimit {
    address: string[];
    to: string[];
    txCount: number;
    validUntil: number;
    rate: GraphQLClient.RateLimit;
    txSent: number;
    lastTx: number;
  }

  interface AssetState {
    address: string;
    owner: string;
    moniker: string;
    readonly: boolean;
    transferrable: boolean;
    ttl: number;
    consumedTime: string;
    issuer: string;
    parent: string;
    endpoint: GraphQLClient.NFTEndpoint;
    display: GraphQLClient.NFTDisplay;
    tags: string[];
    context: GraphQLClient.StateContext;
    data: GraphQLClient.Any;
  }

  interface BlockID {
    hash: string;
    partsHeader: GraphQLClient.PartSetHeader;
  }

  interface BlockInfo {
    height: string;
    numTxs: number;
    time: string;
    appHash: string;
    proposer: string;
    txs: GraphQLClient.TransactionInfo[];
    totalTxs: string;
    invalidTxs: GraphQLClient.TransactionInfo[];
    txsHashes: string[];
    invalidTxsHashes: string[];
    consensusHash: string;
    dataHash: string;
    evidenceHash: string;
    lastCommitHash: string;
    lastResultsHash: string;
    nextValidatorsHash: string;
    validatorsHash: string;
    version: GraphQLClient.Version;
    lastBlockId: GraphQLClient.BlockID;
  }

  interface BlockInfoSimple {
    height: string;
    numTxs: number;
    time: string;
    appHash: string;
    proposer: string;
    totalTxs: string;
    txsHashes: string[];
    invalidTxsHashes: string[];
    consensusHash: string;
    dataHash: string;
    evidenceHash: string;
    lastCommitHash: string;
    lastResultsHash: string;
    nextValidatorsHash: string;
    validatorsHash: string;
    version: GraphQLClient.Version;
    lastBlockId: GraphQLClient.BlockID;
  }

  interface ChainInfo {
    id: string;
    network: string;
    moniker: string;
    consensusVersion: string;
    synced: boolean;
    appHash: string;
    blockHash: string;
    blockHeight: string;
    blockTime: string;
    address: string;
    votingPower: string;
    totalTxs: string;
    version: string;
    forgeAppsVersion: GraphQLClient.ChainInfo_ForgeAppsVersionEntry[];
    supportedTxs: string[];
  }

  interface ChainInfo_ForgeAppsVersionEntry {
    key: string;
    value: string;
  }

  interface ClaimBlockRewardTx {
    rollup: string;
    blockHeight: number;
    blockHash: string;
    evidence: GraphQLClient.Evidence;
    publisher: string;
    data: GraphQLClient.Any;
  }

  interface ClaimStakeTx {
    address: string;
    evidence: GraphQLClient.Evidence;
    data: GraphQLClient.Any;
  }

  interface CloseRollupTx {
    rollup: string;
    message: string;
    data: GraphQLClient.Any;
  }

  interface ConsensusParams {
    maxBytes: string;
    maxGas: string;
    maxValidators: number;
    maxCandidates: number;
    pubKeyTypes: string[];
    validators: GraphQLClient.Validator[];
    validatorChanged: boolean;
    paramChanged: boolean;
  }

  interface ConsumeAssetTx {
    address: string;
    data: GraphQLClient.Any;
  }

  interface CreateAssetTx {
    moniker: string;
    data: GraphQLClient.Any;
    readonly: boolean;
    transferrable: boolean;
    ttl: number;
    parent: string;
    address: string;
    issuer: string;
    endpoint: GraphQLClient.NFTEndpoint;
    display: GraphQLClient.NFTDisplay;
    tags: string[];
  }

  interface CreateFactoryTx {
    name: string;
    description: string;
    settlement: string;
    limit: number;
    trustedIssuers: string[];
    input: GraphQLClient.AssetFactoryInput;
    output: GraphQLClient.CreateAssetTx;
    hooks: GraphQLClient.AssetFactoryHook[];
    address: string;
    display: GraphQLClient.NFTDisplay;
    data: GraphQLClient.Any;
  }

  interface CreateRollupBlockTx {
    hash: string;
    height: number;
    merkleRoot: string;
    previousHash: string;
    txsHash: string;
    txs: string[];
    proposer: string;
    signatures: GraphQLClient.Multisig[];
    rollup: string;
    minReward: string;
    governance: boolean;
    data: GraphQLClient.Any;
  }

  interface CreateRollupTx {
    address: string;
    tokenAddress: string;
    vaultAddress: string;
    contractAddress: string;
    seedValidators: GraphQLClient.RollupValidator[];
    minStakeAmount: string;
    maxStakeAmount: string;
    minSignerCount: number;
    maxSignerCount: number;
    minBlockSize: number;
    maxBlockSize: number;
    minBlockInterval: number;
    minBlockConfirmation: number;
    foreignChainType: string;
    foreignChainId: string;
    depositFeeRate: number;
    withdrawFeeRate: number;
    proposerFeeShare: number;
    minDepositAmount: string;
    minWithdrawAmount: string;
    maxDepositAmount: string;
    maxWithdrawAmount: string;
    minDepositFee: string;
    maxDepositFee: string;
    minWithdrawFee: string;
    maxWithdrawFee: string;
    paused: boolean;
    leaveWaitingPeriod: number;
    publisherFeeShare: number;
    publishWaitingPeriod: number;
    publishSlashRate: number;
    data: GraphQLClient.Any;
  }

  interface CreateTokenTx {
    name: string;
    description: string;
    symbol: string;
    unit: string;
    decimal: number;
    icon: string;
    totalSupply: string;
    address: string;
    initialSupply: string;
    maxTotalSupply: string;
    foreignToken: GraphQLClient.ForeignToken;
    spenders: string[];
    website: string;
    metadata: GraphQLClient.Any;
    data: GraphQLClient.Any;
  }

  interface CurveConfig {
    type: string;
    basePrice: string;
    fixedPrice: string;
    slope: string;
    constant: number;
  }

  interface DelegateConfig {
    deltaInterval: number;
    typeUrls: string[];
  }

  interface DelegateLimit {
    tokens: GraphQLClient.TokenLimit[];
    assets: GraphQLClient.AssetLimit[];
  }

  interface DelegateOp {
    typeUrl: string;
    rules: string[];
    limit: GraphQLClient.DelegateLimit;
  }

  interface DelegateOpState {
    rule: string;
    numTxs: number;
    numTxsDelta: number;
    balance: string;
    balanceDelta: string;
    limit: GraphQLClient.DelegateLimit;
  }

  interface DelegateState {
    address: string;
    ops: GraphQLClient.DelegateState_OpsEntry[];
    from: string;
    to: string;
    context: GraphQLClient.StateContext;
    data: GraphQLClient.Any;
  }

  interface DelegateState_OpsEntry {
    key: string;
    value: GraphQLClient.DelegateOpState;
  }

  interface DelegateTx {
    address: string;
    to: string;
    ops: GraphQLClient.DelegateOp[];
    data: GraphQLClient.Any;
  }

  interface DepositTokenV2Tx {
    token: GraphQLClient.TokenInput;
    to: string;
    proposer: string;
    evidence: GraphQLClient.Evidence;
    rollup: string;
    actualFee: string;
    data: GraphQLClient.Any;
  }

  interface Evidence {
    hash: string;
  }

  interface EvidenceState {
    hash: string;
    data: string;
    context: GraphQLClient.StateContext;
  }

  interface ExchangeInfo {
    value: string;
    assets: string[];
  }

  interface ExchangeInfoV2 {
    value: string;
    assets: string[];
    tokens: GraphQLClient.TokenInput[];
  }

  interface ExchangeTx {
    to: string;
    sender: GraphQLClient.ExchangeInfo;
    receiver: GraphQLClient.ExchangeInfo;
    expiredAt: string;
    data: GraphQLClient.Any;
  }

  interface ExchangeV2Tx {
    to: string;
    sender: GraphQLClient.ExchangeInfoV2;
    receiver: GraphQLClient.ExchangeInfoV2;
    expiredAt: string;
    data: GraphQLClient.Any;
  }

  interface ForeignToken {
    type: string;
    contractAddress: string;
    chainType: string;
    chainName: string;
    chainId: number;
  }

  interface ForgeState {
    address: string;
    consensus: GraphQLClient.ConsensusParams;
    tasks: GraphQLClient.ForgeState_TasksEntry[];
    version: string;
    token: GraphQLClient.ForgeToken;
    txConfig: GraphQLClient.TransactionConfig;
    upgradeInfo: GraphQLClient.UpgradeInfo;
    accountConfig: GraphQLClient.AccountConfig[];
    vaults: GraphQLClient.VaultConfig;
    reservedSymbols: string[];
    data: GraphQLClient.Any;
  }

  interface ForgeState_TasksEntry {
    key: number;
    value: GraphQLClient.UpgradeTasks;
  }

  interface ForgeStats {
    numBlocks: string[];
    numTxs: string[];
    numStakes: string[];
    numValidators: number[];
    numAccountMigrateTxs: string[];
    numCreateAssetTxs: string[];
    numConsensusUpgradeTxs: number[];
    numDeclareTxs: string[];
    numDeclareFileTxs: string[];
    numExchangeTxs: string[];
    numStakeTxs: string[];
    numSysUpgradeTxs: number[];
    numTransferTxs: string[];
    numUpdateAssetTxs: string[];
    numConsumeAssetTxs: string[];
    tps: number[];
    maxTps: number;
    avgTps: number;
    avgBlockTime: number;
  }

  interface ForgeToken {
    name: string;
    symbol: string;
    unit: string;
    description: string;
    icon: string;
    decimal: number;
    initialSupply: string;
    totalSupply: string;
    inflationRate: number;
    address: string;
  }

  interface GasEstimate {
    max: string;
  }

  interface GeoInfo {
    city: string;
    country: string;
    latitude: number;
    longitude: number;
  }

  interface IndexedAccountState {
    address: string;
    balance: string;
    numAssets: string;
    numTxs: string;
    nonce: string;
    genesisTime: string;
    renaissanceTime: string;
    moniker: string;
    migratedFrom: string;
    migratedTo: string;
    totalReceivedStakes: string;
    totalStakes: string;
    totalUnstakes: string;
    recentNumTxs: string[];
    tokens: GraphQLClient.TokenInfo[];
  }

  interface IndexedAssetState {
    address: string;
    owner: string;
    genesisTime: string;
    renaissanceTime: string;
    moniker: string;
    readonly: boolean;
    consumedTime: string;
    issuer: string;
    parent: string;
    transferrable: boolean;
    ttl: string;
    display: GraphQLClient.NFTDisplay;
    endpoint: GraphQLClient.NFTEndpoint;
    tags: string[];
    data: GraphQLClient.Any;
  }

  interface IndexedBlock {
    height: string;
    time: string;
    proposer: string;
    numTxs: string;
    numInvalidTxs: string;
  }

  interface IndexedDelegationState {
    address: string;
    from: string;
    to: string;
    genesisTime: string;
    renaissanceTime: string;
    ops: GraphQLClient.IndexedDelegationState_OpsEntry[];
    data: GraphQLClient.Any;
  }

  interface IndexedDelegationState_OpsEntry {
    key: string;
    value: GraphQLClient.DelegateOpState;
  }

  interface IndexedFactoryInput {
    value: string;
    tokens: GraphQLClient.IndexedTokenInput[];
    assets: string[];
    variables: GraphQLClient.VariableInput[];
  }

  interface IndexedFactoryState {
    address: string;
    owner: string;
    name: string;
    description: string;
    settlement: string;
    limit: string;
    trustedIssuers: string[];
    input: GraphQLClient.IndexedFactoryInput;
    output: GraphQLClient.CreateAssetTx;
    hooks: GraphQLClient.AssetFactoryHook[];
    data: GraphQLClient.Any;
    balance: string;
    tokens: GraphQLClient.TokenInfo[];
    numMinted: number;
    lastSettlement: string;
    genesisTime: string;
    renaissanceTime: string;
    display: GraphQLClient.NFTDisplay;
  }

  interface IndexedRollupBlock {
    hash: string;
    height: number;
    merkleRoot: string;
    previousHash: string;
    txsHash: string;
    txs: string[];
    proposer: string;
    signatures: GraphQLClient.Multisig[];
    genesisTime: string;
    renaissanceTime: string;
    rollup: string;
    mintedAmount: string;
    burnedAmount: string;
    rewardAmount: string;
    governance: boolean;
    tokenInfo: GraphQLClient.IndexedTokenInput;
    data: GraphQLClient.Any;
  }

  interface IndexedRollupState {
    address: string;
    tokenAddress: string;
    vaultAddress: string;
    contractAddress: string;
    seedValidators: GraphQLClient.RollupValidator[];
    validators: GraphQLClient.RollupValidator[];
    minStakeAmount: string;
    maxStakeAmount: string;
    minSignerCount: number;
    maxSignerCount: number;
    minBlockSize: number;
    maxBlockSize: number;
    minBlockInterval: number;
    genesisTime: string;
    renaissanceTime: string;
    tokenInfo: GraphQLClient.IndexedTokenInput;
    issuer: string;
    depositFeeRate: number;
    withdrawFeeRate: number;
    proposerFeeShare: number;
    minDepositAmount: string;
    minWithdrawAmount: string;
    blockHeight: number;
    blockHash: string;
    minBlockConfirmation: number;
    totalDepositAmount: string;
    totalWithdrawAmount: string;
    maxDepositAmount: string;
    maxWithdrawAmount: string;
    minDepositFee: string;
    maxDepositFee: string;
    minWithdrawFee: string;
    maxWithdrawFee: string;
    paused: boolean;
    foreignToken: GraphQLClient.ForeignToken;
    leaveWaitingPeriod: number;
    publisherFeeShare: number;
    publishWaitingPeriod: number;
    publishSlashRate: number;
    migrateHistory: string[];
    closed: boolean;
    vaultHistory: string[];
    data: GraphQLClient.Any;
  }

  interface IndexedRollupValidator {
    pk: string;
    address: string;
    moniker: string;
    endpoint: string;
    joinTime: string;
    leaveTime: string;
    genesisTime: string;
    renaissanceTime: string;
    totalStake: string;
    revokedStake: string;
    availableStake: string;
    totalGain: string;
    proposedBlockCount: number;
    verifiedBlockCount: number;
    latestBlockHeight: number;
    latestBlockHash: string;
    rollup: string;
  }

  interface IndexedStakeState {
    address: string;
    sender: string;
    receiver: string;
    tokens: GraphQLClient.TokenInfo[];
    assets: string[];
    revocable: boolean;
    genesisTime: string;
    renaissanceTime: string;
    message: string;
    revokeWaitingPeriod: number;
    revokedTokens: GraphQLClient.TokenInfo[];
    revokedAssets: string[];
    slashers: string[];
    nonce: string;
    data: GraphQLClient.Any;
  }

  interface IndexedTokenFactoryState {
    address: string;
    owner: string;
    tokenAddress: string;
    reserveAddress: string;
    curve: GraphQLClient.CurveConfig;
    feeRate: number;
    currentSupply: string;
    reserveBalance: string;
    status: string;
    genesisTime: string;
    renaissanceTime: string;
    token: GraphQLClient.IndexedTokenInput;
    reserveToken: GraphQLClient.IndexedTokenInput;
    data: GraphQLClient.Any;
  }

  interface IndexedTokenFlow {
    value: string;
    hash: string;
    from: string;
    to: string;
  }

  interface IndexedTokenInput {
    address: string;
    value: string;
    decimal: number;
    unit: string;
    symbol: string;
  }

  interface IndexedTokenState {
    name: string;
    description: string;
    symbol: string;
    unit: string;
    decimal: number;
    issuer: string;
    icon: string;
    totalSupply: string;
    initialSupply: string;
    maxTotalSupply: string;
    address: string;
    genesisTime: string;
    renaissanceTime: string;
    foreignToken: GraphQLClient.ForeignToken;
    tokenFactoryAddress: string;
    website: string;
    spenders: string[];
    minters: string[];
    type: string;
    metadata: GraphQLClient.Any;
    data: GraphQLClient.Any;
  }

  interface IndexedTransaction {
    hash: string;
    sender: string;
    receiver: string;
    time: string;
    type: string;
    tx: GraphQLClient.Transaction;
    valid: boolean;
    code: string;
    tokenSymbols: GraphQLClient.TokenSymbol[];
    receipts: GraphQLClient.TransactionReceipt[];
  }

  interface JoinRollupTx {
    rollup: string;
    endpoint: string;
    evidence: GraphQLClient.Evidence;
    signatures: GraphQLClient.Multisig[];
    data: GraphQLClient.Any;
  }

  interface KVPair {
    key: string;
    value: string;
  }

  interface LeaveRollupTx {
    rollup: string;
    evidence: GraphQLClient.Evidence;
    signatures: GraphQLClient.Multisig[];
    data: GraphQLClient.Any;
  }

  interface MigrateRollupTx {
    rollup: string;
    to: string;
    type: string;
    message: string;
    data: GraphQLClient.Any;
  }

  interface MintAssetTx {
    factory: string;
    address: string;
    assets: string[];
    variables: GraphQLClient.VariableInput[];
    owner: string;
    data: GraphQLClient.Any;
  }

  interface Multisig {
    signer: string;
    pk: string;
    signature: string;
    delegator: string;
    data: GraphQLClient.Any;
  }

  interface NFTDisplay {
    type: string;
    content: string;
  }

  interface NFTEndpoint {
    id: string;
    scope: string;
  }

  interface NFTIssuer {
    id: string;
    pk: string;
    name: string;
  }

  interface NetInfo {
    listening: boolean;
    listeners: string[];
    nPeers: number;
    peers: GraphQLClient.PeerInfo[];
  }

  interface NodeInfo {
    id: string;
    network: string;
    moniker: string;
    consensusVersion: string;
    synced: boolean;
    appHash: string;
    blockHash: string;
    blockHeight: string;
    blockTime: string;
    address: string;
    votingPower: string;
    totalTxs: string;
    version: string;
    forgeAppsVersion: GraphQLClient.NodeInfo_ForgeAppsVersionEntry[];
    supportedTxs: string[];
    ip: string;
    geoInfo: GraphQLClient.GeoInfo;
    p2pAddress: string;
  }

  interface NodeInfo_ForgeAppsVersionEntry {
    key: string;
    value: string;
  }

  interface PageInfo {
    cursor: string;
    next: boolean;
    total: number;
  }

  interface PartSetHeader {
    total: number;
    hash: string;
  }

  interface PauseRollupTx {
    rollup: string;
    data: GraphQLClient.Any;
  }

  interface PeerInfo {
    id: string;
    network: string;
    consensusVersion: string;
    moniker: string;
    ip: string;
    geoInfo: GraphQLClient.GeoInfo;
  }

  interface PubKey {
    type: string;
    data: string;
  }

  interface RateLimit {
    interval: number;
    anchor: number;
  }

  interface ReceiptChange {
    target: string;
    action: string;
    value: string;
  }

  interface ResponseEstimateGas {
    code: string;
    estimate: GraphQLClient.GasEstimate;
  }

  interface ResponseGetAccountState {
    code: string;
    state: GraphQLClient.AccountState;
  }

  interface ResponseGetAccountTokens {
    code: string;
    tokens: GraphQLClient.AccountToken[];
  }

  interface ResponseGetAssetState {
    code: string;
    state: GraphQLClient.AssetState;
  }

  interface ResponseGetBlock {
    code: string;
    block: GraphQLClient.BlockInfo;
  }

  interface ResponseGetBlocks {
    code: string;
    page: GraphQLClient.PageInfo;
    blocks: GraphQLClient.BlockInfoSimple[];
  }

  interface ResponseGetChainInfo {
    code: string;
    info: GraphQLClient.ChainInfo;
  }

  interface ResponseGetConfig {
    code: string;
    config: string;
  }

  interface ResponseGetDelegateState {
    code: string;
    state: GraphQLClient.DelegateState;
  }

  interface ResponseGetEvidenceState {
    code: string;
    state: GraphQLClient.EvidenceState;
  }

  interface ResponseGetFactoryState {
    code: string;
    state: GraphQLClient.AssetFactoryState;
  }

  interface ResponseGetForgeState {
    code: string;
    state: GraphQLClient.ForgeState;
  }

  interface ResponseGetForgeStats {
    code: string;
    forgeStats: GraphQLClient.ForgeStats;
  }

  interface ResponseGetNetInfo {
    code: string;
    netInfo: GraphQLClient.NetInfo;
  }

  interface ResponseGetNodeInfo {
    code: string;
    info: GraphQLClient.NodeInfo;
  }

  interface ResponseGetRollupBlock {
    code: string;
    block: GraphQLClient.RollupBlock;
  }

  interface ResponseGetRollupState {
    code: string;
    state: GraphQLClient.RollupState;
  }

  interface ResponseGetStakeState {
    code: string;
    state: GraphQLClient.StakeState;
  }

  interface ResponseGetTokenDistribution {
    code: string;
    data: GraphQLClient.TokenDistribution;
  }

  interface ResponseGetTokenFactoryState {
    code: string;
    state: GraphQLClient.TokenFactoryState;
  }

  interface ResponseGetTokenState {
    code: string;
    state: GraphQLClient.TokenState;
  }

  interface ResponseGetTx {
    code: string;
    info: GraphQLClient.TransactionInfo;
  }

  interface ResponseGetUnconfirmedTxs {
    code: string;
    page: GraphQLClient.PageInfo;
    unconfirmedTxs: GraphQLClient.UnconfirmedTxs;
  }

  interface ResponseGetValidatorsInfo {
    code: string;
    validatorsInfo: GraphQLClient.ValidatorsInfo;
  }

  interface ResponseListAssetTransactions {
    code: string;
    page: GraphQLClient.PageInfo;
    transactions: GraphQLClient.IndexedTransaction[];
  }

  interface ResponseListAssets {
    code: string;
    page: GraphQLClient.PageInfo;
    assets: GraphQLClient.IndexedAssetState[];
  }

  interface ResponseListBlocks {
    code: string;
    page: GraphQLClient.PageInfo;
    blocks: GraphQLClient.IndexedBlock[];
  }

  interface ResponseListDelegations {
    code: string;
    page: GraphQLClient.PageInfo;
    delegations: GraphQLClient.IndexedDelegationState[];
  }

  interface ResponseListFactories {
    code: string;
    page: GraphQLClient.PageInfo;
    factories: GraphQLClient.IndexedFactoryState[];
  }

  interface ResponseListRollupBlocks {
    code: string;
    page: GraphQLClient.PageInfo;
    blocks: GraphQLClient.IndexedRollupBlock[];
  }

  interface ResponseListRollupValidators {
    code: string;
    page: GraphQLClient.PageInfo;
    validators: GraphQLClient.IndexedRollupValidator[];
  }

  interface ResponseListRollups {
    code: string;
    page: GraphQLClient.PageInfo;
    rollups: GraphQLClient.IndexedRollupState[];
  }

  interface ResponseListStakes {
    code: string;
    page: GraphQLClient.PageInfo;
    stakes: GraphQLClient.IndexedStakeState[];
  }

  interface ResponseListTokenFactories {
    code: string;
    page: GraphQLClient.PageInfo;
    tokenFactories: GraphQLClient.IndexedTokenFactoryState[];
  }

  interface ResponseListTokenFlows {
    code: string;
    page: GraphQLClient.PageInfo;
    data: GraphQLClient.IndexedTokenFlow[];
  }

  interface ResponseListTokens {
    code: string;
    page: GraphQLClient.PageInfo;
    tokens: GraphQLClient.IndexedTokenState[];
  }

  interface ResponseListTopAccounts {
    code: string;
    page: GraphQLClient.PageInfo;
    accounts: GraphQLClient.IndexedAccountState[];
  }

  interface ResponseListTransactions {
    code: string;
    page: GraphQLClient.PageInfo;
    transactions: GraphQLClient.IndexedTransaction[];
  }

  interface ResponseSearch {
    code: string;
    page: GraphQLClient.PageInfo;
    results: GraphQLClient.SearchResult[];
  }

  interface ResponseSendTx {
    code: string;
    hash: string;
  }

  interface ResponseVerifyAccountRisk {
    code: string;
    data: GraphQLClient.VerifyAccountRiskResult;
  }

  interface ResumeRollupTx {
    rollup: string;
    data: GraphQLClient.Any;
  }

  interface ReturnStakeTx {
    address: string;
    outputs: GraphQLClient.TransactionInput[];
    message: string;
    data: GraphQLClient.Any;
  }

  interface RevokeDelegateTx {
    address: string;
    to: string;
    typeUrls: string[];
    data: GraphQLClient.Any;
  }

  interface RevokeStakeTx {
    address: string;
    outputs: GraphQLClient.TransactionInput[];
    data: GraphQLClient.Any;
  }

  interface RollupBlock {
    hash: string;
    height: number;
    merkleRoot: string;
    previousHash: string;
    txsHash: string;
    txs: string[];
    proposer: string;
    signatures: GraphQLClient.Multisig[];
    rollup: string;
    mintedAmount: string;
    burnedAmount: string;
    rewardAmount: string;
    minReward: string;
    governance: boolean;
    context: GraphQLClient.StateContext;
    data: GraphQLClient.Any;
  }

  interface RollupState {
    address: string;
    tokenAddress: string;
    vaultAddress: string;
    contractAddress: string;
    seedValidators: GraphQLClient.RollupValidator[];
    validators: GraphQLClient.RollupValidator[];
    minStakeAmount: string;
    maxStakeAmount: string;
    minSignerCount: number;
    maxSignerCount: number;
    minBlockSize: number;
    maxBlockSize: number;
    minBlockInterval: number;
    minBlockConfirmation: number;
    issuer: string;
    depositFeeRate: number;
    withdrawFeeRate: number;
    proposerFeeShare: number;
    publisherFeeShare: number;
    minDepositAmount: string;
    minWithdrawAmount: string;
    blockHeight: number;
    blockHash: string;
    tokenInfo: GraphQLClient.IndexedTokenInput;
    totalDepositAmount: string;
    totalWithdrawAmount: string;
    maxDepositAmount: string;
    maxWithdrawAmount: string;
    minDepositFee: string;
    maxDepositFee: string;
    minWithdrawFee: string;
    maxWithdrawFee: string;
    paused: boolean;
    foreignToken: GraphQLClient.ForeignToken;
    leaveWaitingPeriod: number;
    publishWaitingPeriod: number;
    publishSlashRate: number;
    migrateHistory: string[];
    closed: boolean;
    vaultHistory: string[];
    context: GraphQLClient.StateContext;
    data: GraphQLClient.Any;
  }

  interface RollupValidator {
    pk: string;
    address: string;
    endpoint: string;
  }

  interface SearchResult {
    type: string;
    id: string;
  }

  interface SlashStakeTx {
    address: string;
    outputs: GraphQLClient.TransactionInput[];
    message: string;
    data: GraphQLClient.Any;
  }

  interface StakeState {
    address: string;
    sender: string;
    receiver: string;
    tokens: GraphQLClient.IndexedTokenInput[];
    assets: string[];
    revocable: boolean;
    message: string;
    revokeWaitingPeriod: number;
    revokedTokens: GraphQLClient.IndexedTokenInput[];
    revokedAssets: string[];
    slashers: string[];
    nonce: string;
    context: GraphQLClient.StateContext;
    data: GraphQLClient.Any;
  }

  interface StakeTx {
    address: string;
    receiver: string;
    inputs: GraphQLClient.TransactionInput[];
    locked: boolean;
    message: string;
    revokeWaitingPeriod: number;
    slashers: string[];
    nonce: string;
    data: GraphQLClient.Any;
  }

  interface StateContext {
    genesisTx: GraphQLClient.TransactionInfo;
    renaissanceTx: GraphQLClient.TransactionInfo;
    genesisTime: string;
    renaissanceTime: string;
  }

  interface TokenDistribution {
    tokenAddress: string;
    txTime: string;
    account: string;
    gas: string;
    fee: string;
    slashedVault: string;
    stake: string;
    revokedStake: string;
    gasStake: string;
  }

  interface TokenFactoryState {
    address: string;
    tokenAddress: string;
    reserveAddress: string;
    currentSupply: string;
    reserveBalance: string;
    owner: string;
    feeRate: number;
    curve: GraphQLClient.CurveConfig;
    context: GraphQLClient.StateContext;
    token: GraphQLClient.TokenState;
    reserveToken: GraphQLClient.TokenState;
    data: GraphQLClient.Any;
  }

  interface TokenInfo {
    address: string;
    balance: string;
    decimal: number;
    unit: string;
    symbol: string;
  }

  interface TokenInput {
    address: string;
    value: string;
  }

  interface TokenLimit {
    address: string;
    to: string[];
    txCount: number;
    txAllowance: string;
    totalAllowance: string;
    validUntil: number;
    rate: GraphQLClient.RateLimit;
    txSent: number;
    spentAllowance: string;
    lastTx: number;
    decimal: number;
    symbol: string;
  }

  interface TokenState {
    address: string;
    issuer: string;
    name: string;
    description: string;
    symbol: string;
    unit: string;
    decimal: number;
    icon: string;
    totalSupply: string;
    initialSupply: string;
    maxTotalSupply: string;
    foreignToken: GraphQLClient.ForeignToken;
    tokenFactoryAddress: string;
    website: string;
    spenders: string[];
    minters: string[];
    type: string;
    metadata: GraphQLClient.Any;
    context: GraphQLClient.StateContext;
    data: GraphQLClient.Any;
  }

  interface TokenSymbol {
    address: string;
    symbol: string;
    decimal: number;
    unit: string;
  }

  interface Transaction {
    from: string;
    delegator: string;
    nonce: string;
    chainId: string;
    pk: string;
    signature: string;
    signatures: GraphQLClient.Multisig[];
    itxJson: undefined;
    sender: string;
    receiver: string;
    serviceFee: string;
    gasFee: string;
    gasPaid: string;
  }

  interface TransactionConfig {
    maxAssetSize: number;
    maxListSize: number;
    maxMultisig: number;
    delegate: GraphQLClient.DelegateConfig;
    txFee: GraphQLClient.TxFeeConfig[];
    txGas: GraphQLClient.TxGasConfig;
    txStake: GraphQLClient.TxStakeConfig;
  }

  interface TransactionInfo {
    tx: GraphQLClient.Transaction;
    height: string;
    index: number;
    hash: string;
    tags: GraphQLClient.KVPair[];
    code: string;
    time: string;
    receipts: GraphQLClient.TransactionReceipt[];
    sender: string;
    receiver: string;
    tokenSymbols: GraphQLClient.TokenSymbol[];
  }

  interface TransactionInput {
    owner: string;
    tokens: GraphQLClient.TokenInput[];
    assets: string[];
  }

  interface TransactionReceipt {
    address: string;
    changes: GraphQLClient.ReceiptChange[];
  }

  interface TransferTx {
    to: string;
    value: string;
    assets: string[];
    data: GraphQLClient.Any;
  }

  interface TransferV2Tx {
    to: string;
    value: string;
    assets: string[];
    tokens: GraphQLClient.TokenInput[];
    data: GraphQLClient.Any;
  }

  interface TransferV3Tx {
    inputs: GraphQLClient.TransactionInput[];
    outputs: GraphQLClient.TransactionInput[];
    data: GraphQLClient.Any;
  }

  interface TxFeeConfig {
    typeUrl: string;
    fee: string;
  }

  interface TxGasConfig {
    price: number;
    createState: number;
    updateState: number;
    dataStorage: number;
    minStake: string;
    maxStake: string;
    stakeLockPeriod: number;
  }

  interface TxStakeConfig {
    createToken: string;
    createCreditToken: string;
    createTokenLockPeriod: number;
  }

  interface UnconfirmedTxs {
    nTxs: number;
    txs: GraphQLClient.Transaction[];
  }

  interface UpdateAssetTx {
    address: string;
    moniker: string;
    consumed: boolean;
    data: GraphQLClient.Any;
  }

  interface UpdateRollupTx {
    minStakeAmount: string;
    maxStakeAmount: string;
    minSignerCount: number;
    maxSignerCount: number;
    minBlockSize: number;
    maxBlockSize: number;
    minBlockInterval: number;
    minBlockConfirmation: number;
    depositFeeRate: number;
    withdrawFeeRate: number;
    proposerFeeShare: number;
    minDepositAmount: string;
    minWithdrawAmount: string;
    maxDepositAmount: string;
    maxWithdrawAmount: string;
    minDepositFee: string;
    maxDepositFee: string;
    minWithdrawFee: string;
    maxWithdrawFee: string;
    publisherFeeShare: number;
    leaveWaitingPeriod: number;
    publishWaitingPeriod: number;
    publishSlashRate: number;
    rollup: string;
    data: GraphQLClient.Any;
  }

  interface UpgradeInfo {
    height: string;
    version: string;
  }

  interface UpgradeNodeTx {
    height: number;
    version: string;
    override: boolean;
  }

  interface UpgradeTask {
    type: GraphQLClient.UpgradeType;
    dataHash: string;
    actions: GraphQLClient.UpgradeAction[];
  }

  interface UpgradeTasks {
    item: GraphQLClient.UpgradeTask[];
  }

  interface Validator {
    address: string;
    power: string;
  }

  interface ValidatorInfo {
    address: string;
    pubKey: GraphQLClient.PubKey;
    votingPower: string;
    proposerPriority: string;
    name: string;
    geoInfo: GraphQLClient.GeoInfo;
  }

  interface ValidatorsInfo {
    blockHeight: string;
    validators: GraphQLClient.ValidatorInfo[];
  }

  interface VariableInput {
    name: string;
    value: string;
    description: string;
    required: boolean;
  }

  interface VaultConfig {
    slashedStake: string;
    txFee: string;
    txGas: string[];
  }

  interface VerifyAccountRiskResult {
    isRisky: boolean;
    reason: string;
    data: GraphQLClient.VerifyAccountRiskResult_BalanceRisky;
  }

  interface VerifyAccountRiskResult_BalanceRisky {
    address: string;
    balance: string;
    transferIn: string;
    transferOut: string;
    accountCount: number;
    txCount: number;
  }

  interface Version {
    block: number;
    app: number;
  }

  interface WalletType {
    pk: GraphQLClient.KeyType;
    hash: GraphQLClient.HashType;
    address: GraphQLClient.EncodingType;
    role: GraphQLClient.RoleType;
  }

  interface WithdrawTokenV2Tx {
    token: GraphQLClient.TokenInput;
    to: string;
    rollup: string;
    proposer: string;
    maxFee: string;
    actualFee: string;
    data: GraphQLClient.Any;
  }


  interface GetAccountStateParams {
    address: string;
    height: string;
    keys: string[];
    traceMigration: boolean;
  }

  interface GetAssetStateParams {
    address: string;
    height: string;
    keys: string[];
  }

  interface GetFactoryStateParams {
    address: string;
  }

  interface GetDelegateStateParams {
    address: string;
    height: string;
    keys: string[];
  }

  interface GetTokenStateParams {
    address: string;
  }

  interface GetEvidenceStateParams {
    hash: string;
  }

  interface GetForgeStateParams {
    height: string;
    keys: string[];
  }

  interface GetTokenFactoryStateParams {
    address: string;
  }

  interface GetTxParams {
    hash: string;
  }

  interface GetBlockParams {
    height: string;
  }

  interface GetBlocksParams {
    emptyExcluded: boolean;
    heightFilter: GraphQLClient.RangeFilterInput;
    paging: GraphQLClient.PageInput;
  }

  interface GetUnconfirmedTxsParams {
    paging: GraphQLClient.PageInput;
  }

  interface GetConfigParams {
    parsed: boolean;
  }

  interface ListAssetTransactionsParams {
    address: string;
    paging: GraphQLClient.PageInput;
  }

  interface ListAssetsParams {
    ownerAddress: string;
    paging: GraphQLClient.PageInput;
    factoryAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface ListBlocksParams {
    heightFilter: GraphQLClient.RangeFilterInput;
    numInvalidTxsFilter: GraphQLClient.RangeFilterInput;
    numTxsFilter: GraphQLClient.RangeFilterInput;
    paging: GraphQLClient.PageInput;
    proposer: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface ListTopAccountsParams {
    paging: GraphQLClient.PageInput;
    tokenAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface ListTransactionsParams {
    addressFilter: GraphQLClient.AddressFilterInput;
    paging: GraphQLClient.PageInput;
    timeFilter: GraphQLClient.TimeFilterInput;
    typeFilter: GraphQLClient.TypeFilterInput;
    validityFilter: GraphQLClient.ValidityFilterInput;
    factoryFilter: GraphQLClient.FactoryFilterInput;
    tokenFilter: GraphQLClient.TokenFilterInput;
    assetFilter: GraphQLClient.AssetFilterInput;
    accountFilter: GraphQLClient.AccountFilterInput;
    txFilter: GraphQLClient.TxFilterInput;
    rollupFilter: GraphQLClient.RollupFilterInput;
    stakeFilter: GraphQLClient.StakeFilterInput;
    delegationFilter: GraphQLClient.DelegationFilterInput;
    tokenFactoryFilter: GraphQLClient.TokenFactoryFilterInput;
    includeItxData: boolean;
  }

  interface ListTokensParams {
    issuerAddress: string;
    paging: GraphQLClient.PageInput;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface ListFactoriesParams {
    ownerAddress: string;
    addressList: string[];
    paging: GraphQLClient.PageInput;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface GetAccountTokensParams {
    address: string;
    token: string;
  }

  interface GetStakeStateParams {
    address: string;
    height: string;
    keys: string[];
  }

  interface ListStakesParams {
    addressFilter: GraphQLClient.AddressFilterInput;
    assetFilter: GraphQLClient.AssetFilterInput;
    timeFilter: GraphQLClient.TimeFilterInput;
    paging: GraphQLClient.PageInput;
  }

  interface GetRollupStateParams {
    address: string;
    height: string;
    keys: string[];
  }

  interface ListRollupsParams {
    paging: GraphQLClient.PageInput;
    tokenAddress: string;
    erc20TokenAddress: string;
    foreignTokenAddress: string;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface GetRollupBlockParams {
    hash: string;
    height: string;
    rollupAddress: string;
  }

  interface ListRollupBlocksParams {
    paging: GraphQLClient.PageInput;
    rollupAddress: string;
    tokenAddress: string;
    proposer: string;
    validatorFilter: GraphQLClient.ValidatorFilterInput;
    txFilter: GraphQLClient.TxFilterInput;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface ListRollupValidatorsParams {
    paging: GraphQLClient.PageInput;
    rollupAddress: string;
  }

  interface ListDelegationsParams {
    from: string;
    to: string;
    paging: GraphQLClient.PageInput;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface SearchParams {
    paging: GraphQLClient.PageInput;
    keyword: string;
  }

  interface EstimateGasParams {
    typeUrl: string;
    tx: string;
  }

  interface ListTokenFlowsParams {
    accountAddress: string;
    tokenAddress: string;
    paging: GraphQLClient.PageInput;
    depth: number;
    direction: GraphQLClient.TokenFlowDirection;
  }

  interface VerifyAccountRiskParams {
    accountAddress: string;
    tokenAddress: string;
  }

  interface GetTokenDistributionParams {
    tokenAddress: string;
  }

  interface ListTokenFactoriesParams {
    tokenAddress: string;
    reserveAddress: string;
    owner: string;
    paging: GraphQLClient.PageInput;
    timeFilter: GraphQLClient.TimeFilterInput;
  }

  interface SendTxParams {
    commit: boolean;
    token: string;
    tx: string;
    wallet: string;
    extra: string;
  }

}
