github.com/cryptohub-digital/blockbook@v0.3.5-0.20240403155730-99ab40b9104c/blockbook-api.ts (about)

     1  /* Do not change, this code is generated from Golang structs */
     2  
     3  export interface APIError {
     4      Text: string;
     5      Public: boolean;
     6  }
     7  export interface AddressAlias {
     8      Type: string;
     9      Alias: string;
    10  }
    11  export interface EthereumInternalTransfer {
    12      type: number;
    13      from: string;
    14      to: string;
    15      value: string;
    16  }
    17  export interface EthereumParsedInputParam {
    18      type: string;
    19      values?: string[];
    20  }
    21  export interface EthereumParsedInputData {
    22      methodId: string;
    23      name: string;
    24      function?: string;
    25      params?: EthereumParsedInputParam[];
    26  }
    27  export interface EthereumSpecific {
    28      type?: number;
    29      createdContract?: string;
    30      status: number;
    31      error?: string;
    32      nonce: number;
    33      gasLimit: number;
    34      gasUsed?: number;
    35      gasPrice: string;
    36      data?: string;
    37      parsedData?: EthereumParsedInputData;
    38      internalTransfers?: EthereumInternalTransfer[];
    39  }
    40  export interface MultiTokenValue {
    41      id?: string;
    42      value?: string;
    43  }
    44  export interface TokenTransfer {
    45      type: string;
    46      from: string;
    47      to: string;
    48      contract: string;
    49      name: string;
    50      symbol: string;
    51      decimals: number;
    52      value?: string;
    53      multiTokenValues?: MultiTokenValue[];
    54  }
    55  export interface Vout {
    56      value?: string;
    57      n: number;
    58      spent?: boolean;
    59      spentTxId?: string;
    60      spentIndex?: number;
    61      spentHeight?: number;
    62      hex?: string;
    63      asm?: string;
    64      addresses: string[];
    65      isAddress: boolean;
    66      isOwn?: boolean;
    67      type?: string;
    68  }
    69  export interface Vin {
    70      txid?: string;
    71      vout?: number;
    72      sequence?: number;
    73      n: number;
    74      addresses?: string[];
    75      isAddress: boolean;
    76      isOwn?: boolean;
    77      value?: string;
    78      hex?: string;
    79      asm?: string;
    80      coinbase?: string;
    81  }
    82  export interface Tx {
    83      txid: string;
    84      version?: number;
    85      lockTime?: number;
    86      vin: Vin[];
    87      vout: Vout[];
    88      blockHash?: string;
    89      blockHeight: number;
    90      confirmations: number;
    91      confirmationETABlocks?: number;
    92      confirmationETASeconds?: number;
    93      blockTime: number;
    94      size?: number;
    95      vsize?: number;
    96      value: string;
    97      valueIn?: string;
    98      fees?: string;
    99      hex?: string;
   100      rbf?: boolean;
   101      coinSpecificData?: any;
   102      tokenTransfers?: TokenTransfer[];
   103      ethereumSpecific?: EthereumSpecific;
   104      addressAliases?: { [key: string]: AddressAlias };
   105  }
   106  export interface FeeStats {
   107      txCount: number;
   108      totalFeesSat: string;
   109      averageFeePerKb: number;
   110      decilesFeePerKb: number[];
   111  }
   112  export interface ContractInfo {
   113      type: string;
   114      contract: string;
   115      name: string;
   116      symbol: string;
   117      decimals: number;
   118      createdInBlock?: number;
   119      destructedInBlock?: number;
   120  }
   121  export interface Token {
   122      type: 'XPUBAddress' | 'ERC20' | 'ERC721' | 'ERC1155';
   123      name: string;
   124      path?: string;
   125      contract?: string;
   126      transfers: number;
   127      symbol?: string;
   128      decimals?: number;
   129      balance?: string;
   130      baseValue?: number;
   131      secondaryValue?: number;
   132      ids?: string[];
   133      multiTokenValues?: MultiTokenValue[];
   134      totalReceived?: string;
   135      totalSent?: string;
   136  }
   137  export interface Address {
   138      page?: number;
   139      totalPages?: number;
   140      itemsOnPage?: number;
   141      address: string;
   142      balance: string;
   143      totalReceived?: string;
   144      totalSent?: string;
   145      unconfirmedBalance: string;
   146      unconfirmedTxs: number;
   147      txs: number;
   148      addrTxCount?: number;
   149      nonTokenTxs?: number;
   150      internalTxs?: number;
   151      transactions?: Tx[];
   152      txids?: string[];
   153      nonce?: string;
   154      usedTokens?: number;
   155      tokens?: Token[];
   156      secondaryValue?: number;
   157      tokensBaseValue?: number;
   158      tokensSecondaryValue?: number;
   159      totalBaseValue?: number;
   160      totalSecondaryValue?: number;
   161      contractInfo?: ContractInfo;
   162      erc20Contract?: ContractInfo;
   163      addressAliases?: { [key: string]: AddressAlias };
   164  }
   165  export interface Utxo {
   166      txid: string;
   167      vout: number;
   168      value: string;
   169      height?: number;
   170      confirmations: number;
   171      address?: string;
   172      path?: string;
   173      lockTime?: number;
   174      coinbase?: boolean;
   175  }
   176  export interface BalanceHistory {
   177      time: number;
   178      txs: number;
   179      received: string;
   180      sent: string;
   181      sentToSelf: string;
   182      rates?: { [key: string]: number };
   183      txid?: string;
   184  }
   185  export interface BlockInfo {
   186      Hash: string;
   187      Time: number;
   188      Txs: number;
   189      Size: number;
   190      Height: number;
   191  }
   192  export interface Blocks {
   193      page?: number;
   194      totalPages?: number;
   195      itemsOnPage?: number;
   196      blocks: BlockInfo[];
   197  }
   198  export interface Block {
   199      page?: number;
   200      totalPages?: number;
   201      itemsOnPage?: number;
   202      hash: string;
   203      previousBlockHash?: string;
   204      nextBlockHash?: string;
   205      height: number;
   206      confirmations: number;
   207      size: number;
   208      time?: number;
   209      version: string;
   210      merkleRoot: string;
   211      nonce: string;
   212      bits: string;
   213      difficulty: string;
   214      tx?: string[];
   215      txCount: number;
   216      txs?: Tx[];
   217      addressAliases?: { [key: string]: AddressAlias };
   218  }
   219  export interface BlockRaw {
   220      hex: string;
   221  }
   222  export interface BackendInfo {
   223      error?: string;
   224      chain?: string;
   225      blocks?: number;
   226      headers?: number;
   227      bestBlockHash?: string;
   228      difficulty?: string;
   229      sizeOnDisk?: number;
   230      version?: string;
   231      subversion?: string;
   232      protocolVersion?: string;
   233      timeOffset?: number;
   234      warnings?: string;
   235      consensus_version?: string;
   236      consensus?: any;
   237  }
   238  export interface InternalStateColumn {
   239      name: string;
   240      version: number;
   241      rows: number;
   242      keyBytes: number;
   243      valueBytes: number;
   244      updated: string;
   245  }
   246  export interface BlockbookInfo {
   247      coin: string;
   248      host: string;
   249      version: string;
   250      gitCommit: string;
   251      buildTime: string;
   252      syncMode: boolean;
   253      initialSync: boolean;
   254      inSync: boolean;
   255      bestHeight: number;
   256      lastBlockTime: string;
   257      inSyncMempool: boolean;
   258      lastMempoolTime: string;
   259      mempoolSize: number;
   260      decimals: number;
   261      dbSize: number;
   262      hasFiatRates?: boolean;
   263      hasTokenFiatRates?: boolean;
   264      currentFiatRatesTime?: string;
   265      historicalFiatRatesTime?: string;
   266      historicalTokenFiatRatesTime?: string;
   267      dbSizeFromColumns?: number;
   268      dbColumns?: InternalStateColumn[];
   269      about: string;
   270  }
   271  export interface SystemInfo {
   272      blockbook: BlockbookInfo;
   273      backend: BackendInfo;
   274  }
   275  export interface FiatTicker {
   276      ts?: number;
   277      rates: { [key: string]: number };
   278      error?: string;
   279  }
   280  export interface FiatTickers {
   281      tickers: FiatTicker[];
   282  }
   283  export interface AvailableVsCurrencies {
   284      ts?: number;
   285      available_currencies: string[];
   286      error?: string;
   287  }
   288  export interface WsReq {
   289      id: string;
   290      method:
   291          | 'getAccountInfo'
   292          | 'getInfo'
   293          | 'getBlockHash'
   294          | 'getBlock'
   295          | 'getAccountUtxo'
   296          | 'getBalanceHistory'
   297          | 'getTransaction'
   298          | 'getTransactionSpecific'
   299          | 'estimateFee'
   300          | 'sendTransaction'
   301          | 'subscribeNewBlock'
   302          | 'unsubscribeNewBlock'
   303          | 'subscribeNewTransaction'
   304          | 'unsubscribeNewTransaction'
   305          | 'subscribeAddresses'
   306          | 'unsubscribeAddresses'
   307          | 'subscribeFiatRates'
   308          | 'unsubscribeFiatRates'
   309          | 'ping'
   310          | 'getCurrentFiatRates'
   311          | 'getFiatRatesForTimestamps'
   312          | 'getFiatRatesTickersList'
   313          | 'getMempoolFilters';
   314      params: any;
   315  }
   316  export interface WsRes {
   317      id: string;
   318      data: any;
   319  }
   320  export interface WsAccountInfoReq {
   321      descriptor: string;
   322      details?: 'basic' | 'tokens' | 'tokenBalances' | 'txids' | 'txslight' | 'txs';
   323      tokens?: 'derived' | 'used' | 'nonzero';
   324      pageSize?: number;
   325      page?: number;
   326      from?: number;
   327      to?: number;
   328      contractFilter?: string;
   329      secondaryCurrency?: string;
   330      gap?: number;
   331  }
   332  export interface WsBackendInfo {
   333      version?: string;
   334      subversion?: string;
   335      consensus_version?: string;
   336      consensus?: any;
   337  }
   338  export interface WsInfoRes {
   339      name: string;
   340      shortcut: string;
   341      decimals: number;
   342      version: string;
   343      bestHeight: number;
   344      bestHash: string;
   345      block0Hash: string;
   346      testnet: boolean;
   347      backend: WsBackendInfo;
   348  }
   349  export interface WsBlockHashReq {
   350      height: number;
   351  }
   352  export interface WsBlockHashRes {
   353      hash: string;
   354  }
   355  export interface WsBlockReq {
   356      id: string;
   357      pageSize?: number;
   358      page?: number;
   359  }
   360  export interface WsAccountUtxoReq {
   361      descriptor: string;
   362  }
   363  export interface WsBalanceHistoryReq {
   364      descriptor: string;
   365      from?: number;
   366      to?: number;
   367      currencies?: string[];
   368      gap?: number;
   369      groupBy?: number;
   370  }
   371  export interface WsTransactionReq {
   372      txid: string;
   373  }
   374  export interface WsTransactionSpecificReq {
   375      txid: string;
   376  }
   377  export interface WsEstimateFeeReq {
   378      blocks?: number[];
   379      specific?: {
   380          conservative?: boolean;
   381          txsize?: number;
   382          from?: string;
   383          to?: string;
   384          data?: string;
   385          value?: string;
   386      };
   387  }
   388  export interface WsEstimateFeeRes {
   389      feePerTx?: string;
   390      feePerUnit?: string;
   391      feeLimit?: string;
   392  }
   393  export interface WsSendTransactionReq {
   394      hex: string;
   395  }
   396  export interface WsSubscribeAddressesReq {
   397      addresses: string[];
   398  }
   399  export interface WsSubscribeFiatRatesReq {
   400      currency?: string;
   401      tokens?: string[];
   402  }
   403  export interface WsCurrentFiatRatesReq {
   404      currencies?: string[];
   405      token?: string;
   406  }
   407  export interface WsFiatRatesForTimestampsReq {
   408      timestamps: number[];
   409      currencies?: string[];
   410      token?: string;
   411  }
   412  export interface WsFiatRatesTickersListReq {
   413      timestamp?: number;
   414      token?: string;
   415  }
   416  export interface WsMempoolFiltersReq {
   417      scriptType: string;
   418      fromTimestamp: number;
   419  }
   420  export interface MempoolTxidFilterEntries {
   421      entries?: { [key: string]: string };
   422  }