diff --git a/packages/web3/package.json b/packages/web3/package.json index 56572329f..3bf3caa18 100644 --- a/packages/web3/package.json +++ b/packages/web3/package.json @@ -34,7 +34,7 @@ "author": "Alephium dev ", "config": { "alephium_version": "3.9.0", - "explorer_backend_version": "2.2.6" + "explorer_backend_version": "2.3.2" }, "scripts": { "build": "rm -rf dist/* && npx tsc --build . && webpack", diff --git a/packages/web3/src/api/api-explorer.ts b/packages/web3/src/api/api-explorer.ts index 42db9a6c0..6a6a89dab 100644 --- a/packages/web3/src/api/api-explorer.ts +++ b/packages/web3/src/api/api-explorer.ts @@ -9,54 +9,46 @@ * --------------------------------------------------------------- */ -/** Val */ -export type Val = ValAddress | ValArray | ValBool | ValByteVec | ValI256 | ValU256 - -/** ContractOutput */ -export interface ContractOutput { - /** @format address */ - address: string - /** @format int32 */ - hint: number +/** AcceptedTransaction */ +export interface AcceptedTransaction { /** @format 32-byte-hash */ - spent?: string + hash: string + /** @format block-hash */ + blockHash: string + /** @format int64 */ + timestamp: number + inputs?: Input[] + outputs?: Output[] + version: number + networkId: number + scriptOpt?: string + /** @format int32 */ + gasAmount: number /** @format uint256 */ - attoAlphAmount: string - tokens?: Token[] - fixedOutput: boolean + gasPrice: string + scriptExecutionOk: boolean + inputSignatures?: string[] + scriptSignatures?: string[] + coinbase: boolean type: string - /** @format 32-byte-hash */ - key: string -} - -/** IntervalType */ -export enum IntervalType { - Daily = 'daily', - Hourly = 'hourly', - Weekly = 'weekly' } -/** Token */ -export interface Token { +/** AddressBalance */ +export interface AddressBalance { /** @format uint256 */ - amount: string - /** @format 32-byte-hash */ - id: string -} - -/** ContractLivenessLocation */ -export interface ContractLivenessLocation { - /** @format block-hash */ - blockHash: string - /** @format 32-byte-hash */ - txHash: string - /** @format int64 */ - timestamp: number + balance: string + /** @format uint256 */ + lockedBalance: string } -/** NonStandard */ -export interface NonStandard { - type: string +/** AddressInfo */ +export interface AddressInfo { + /** @format uint256 */ + balance: string + /** @format uint256 */ + lockedBalance: string + /** @format int32 */ + txNumber: number } /** AddressTokenBalance */ @@ -69,325 +61,271 @@ export interface AddressTokenBalance { lockedBalance: string } -/** OutputRef */ -export interface OutputRef { +/** AmountHistory */ +export interface AmountHistory { + amountHistory?: string[][] +} + +/** AssetOutput */ +export interface AssetOutput { /** @format int32 */ hint: number /** @format 32-byte-hash */ key: string -} - -/** Input */ -export interface Input { - /** @format address */ - address?: string - contractInput: boolean - /** @format hex-string */ - unlockScript?: string /** @format uint256 */ - attoAlphAmount?: string + attoAlphAmount: string + /** @format address */ + address: string tokens?: Token[] - /** @format 32-byte-hash */ - txHashRef?: string - outputRef: OutputRef -} - -/** PerChainCount */ -export interface PerChainCount { - /** @format int32 */ - chainFrom: number - /** @format int32 */ - chainTo: number /** @format int64 */ - count: number + lockTime?: number + /** @format hex-string */ + message?: string + /** @format 32-byte-hash */ + spent?: string + fixedOutput: boolean + type: string } -/** Unknown */ -export interface Unknown { - id: string - type: string +/** BadRequest */ +export interface BadRequest { + detail: string } /** BlockEntry */ export interface BlockEntry { /** @format block-hash */ - parent?: string + hash: string + /** @format int64 */ + timestamp: number /** @format group-index */ chainFrom: number - /** @format 32-byte-hash */ - depStateHash: string + /** @format group-index */ + chainTo: number + /** @format int32 */ + height: number deps?: string[] /** @format hex-string */ nonce: string version: number - /** @format hex-string */ - target: string - mainChain: boolean + /** @format 32-byte-hash */ + depStateHash: string /** @format 32-byte-hash */ txsHash: string - /** @format group-index */ - chainTo: number - ghostUncles?: GhostUncle[] - /** @format bigint */ - hashRate: string /** @format int32 */ txNumber: number + /** @format hex-string */ + target: string + /** @format bigint */ + hashRate: string /** @format block-hash */ - hash: string - /** @format int32 */ - height: number - /** @format int64 */ - timestamp: number -} - -/** ContractParent */ -export interface ContractParent { - /** @format address */ parent?: string + mainChain: boolean + ghostUncles?: GhostUncle[] } -/** ServiceUnavailable */ -export interface ServiceUnavailable { - detail: string -} - -/** ValI256 */ -export interface ValI256 { - type: string +/** BlockEntryLite */ +export interface BlockEntryLite { + /** @format block-hash */ + hash: string + /** @format int64 */ + timestamp: number + /** @format group-index */ + chainFrom: number + /** @format group-index */ + chainTo: number + /** @format int32 */ + height: number + /** @format int32 */ + txNumber: number + mainChain: boolean /** @format bigint */ - value: string + hashRate: string } /** ContractLiveness */ export interface ContractLiveness { /** @format address */ parent?: string - interfaceId?: StdInterfaceId - destruction?: ContractLivenessLocation creation: ContractLivenessLocation + destruction?: ContractLivenessLocation + interfaceId?: StdInterfaceId } -/** AssetOutput */ -export interface AssetOutput { - /** @format address */ - address: string +/** ContractLivenessLocation */ +export interface ContractLivenessLocation { + /** @format block-hash */ + blockHash: string + /** @format 32-byte-hash */ + txHash: string /** @format int64 */ - lockTime?: number + timestamp: number +} + +/** ContractOutput */ +export interface ContractOutput { /** @format int32 */ hint: number /** @format 32-byte-hash */ - spent?: string + key: string /** @format uint256 */ attoAlphAmount: string + /** @format address */ + address: string tokens?: Token[] + /** @format 32-byte-hash */ + spent?: string fixedOutput: boolean type: string - /** @format hex-string */ - message?: string - /** @format 32-byte-hash */ - key: string } -/** NFT */ -export interface NFT { - id: string - type: string +/** ContractParent */ +export interface ContractParent { + /** @format address */ + parent?: string } -/** AcceptedTransaction */ -export interface AcceptedTransaction { - outputs?: Output[] +/** Event */ +export interface Event { /** @format block-hash */ blockHash: string - scriptSignatures?: string[] - inputs?: Input[] - scriptExecutionOk: boolean - type: string - scriptOpt?: string - version: number - coinbase: boolean - inputSignatures?: string[] - /** @format int32 */ - gasAmount: number - networkId: number /** @format 32-byte-hash */ - hash: string - /** @format uint256 */ - gasPrice: string - /** @format int64 */ - timestamp: number -} - -/** HolderInfo */ -export interface HolderInfo { + txHash: string /** @format address */ - address: string - /** @format uint256 */ - balance: string + contractAddress: string + /** @format address */ + inputAddress?: string + /** @format int32 */ + eventIndex: number + fields?: Val[] } -/** TokenSupply */ -export interface TokenSupply { - /** @format uint256 */ - circulating: string - /** @format uint256 */ - total: string - /** @format uint256 */ - reserved: string - /** @format uint256 */ - maximum: string - /** @format uint256 */ - locked: string +/** ExplorerInfo */ +export interface ExplorerInfo { + releaseVersion: string + commit: string + /** @format int32 */ + migrationsVersion: number /** @format int64 */ - timestamp: number + lastFinalizedInputTime: number + /** @format int64 */ + lastHoldersUpdate: number } -/** PendingTransaction */ -export interface PendingTransaction { - outputs?: Output[] - /** @format group-index */ - chainFrom: number - /** @format int64 */ - lastSeen: number - /** @format group-index */ - chainTo: number - inputs?: Input[] - /** @format int32 */ - gasAmount: number +/** FungibleToken */ +export interface FungibleToken { + id: string type: string - /** @format 32-byte-hash */ - hash: string - /** @format uint256 */ - gasPrice: string } -/** TransactionLike */ -export type TransactionLike = AcceptedTransaction | PendingTransaction - -/** LogbackValue */ -export interface LogbackValue { - level: string +/** FungibleTokenMetadata */ +export interface FungibleTokenMetadata { + /** @format 32-byte-hash */ + id: string + symbol: string name: string -} - -/** ValU256 */ -export interface ValU256 { - type: string /** @format uint256 */ - value: string + decimals: string } -/** BlockEntryLite */ -export interface BlockEntryLite { - mainChain: boolean - /** @format group-index */ - chainFrom: number - /** @format group-index */ - chainTo: number - /** @format bigint */ - hashRate: string - /** @format int32 */ - txNumber: number +/** GhostUncle */ +export interface GhostUncle { /** @format block-hash */ - hash: string - /** @format int32 */ - height: number - /** @format int64 */ - timestamp: number + blockHash: string + /** @format address */ + miner: string } -/** PerChainHeight */ -export interface PerChainHeight { - /** @format int32 */ - chainFrom: number - /** @format int32 */ - chainTo: number +/** Hashrate */ +export interface Hashrate { /** @format int64 */ + timestamp: number + hashrate: number value: number - /** @format int64 */ - height: number } -/** ValByteVec */ -export interface ValByteVec { - type: string - /** @format hex-string */ - value: string +/** HolderInfo */ +export interface HolderInfo { + /** @format address */ + address: string + /** @format uint256 */ + balance: string } -/** TokenStdInterfaceId */ -export enum TokenStdInterfaceId { - Fungible = 'fungible', - NonFungible = 'non-fungible', - NonStandard = 'non-standard' +/** Input */ +export interface Input { + outputRef: OutputRef + /** @format hex-string */ + unlockScript?: string + /** @format 32-byte-hash */ + txHashRef?: string + /** @format address */ + address?: string + /** @format uint256 */ + attoAlphAmount?: string + tokens?: Token[] + contractInput: boolean } -/** ExplorerInfo */ -export interface ExplorerInfo { - releaseVersion: string - commit: string - /** @format int64 */ - lastHoldersUpdate: number - /** @format int32 */ - migrationsVersion: number - /** @format int64 */ - lastFinalizedInputTime: number +/** InternalServerError */ +export interface InternalServerError { + detail: string } -/** ValArray */ -export interface ValArray { - type: string - value: Val[] +/** IntervalType */ +export enum IntervalType { + Daily = 'daily', + Hourly = 'hourly', + Weekly = 'weekly' } -/** BadRequest */ -export interface BadRequest { - detail: string +/** ListBlocks */ +export interface ListBlocks { + /** @format int32 */ + total: number + blocks?: BlockEntryLite[] } -/** Hashrate */ -export interface Hashrate { - hashrate: number - value: number - /** @format int64 */ - timestamp: number +/** LogbackValue */ +export interface LogbackValue { + name: string + level: string } -/** Transaction */ -export interface Transaction { - outputs?: Output[] - /** @format block-hash */ - blockHash: string - scriptSignatures?: string[] +/** MempoolTransaction */ +export interface MempoolTransaction { + /** @format 32-byte-hash */ + hash: string + /** @format group-index */ + chainFrom: number + /** @format group-index */ + chainTo: number inputs?: Input[] - scriptExecutionOk: boolean - scriptOpt?: string - version: number - coinbase: boolean - inputSignatures?: string[] + outputs?: Output[] /** @format int32 */ gasAmount: number - networkId: number - /** @format 32-byte-hash */ - hash: string /** @format uint256 */ gasPrice: string /** @format int64 */ - timestamp: number + lastSeen: number } -/** FungibleToken */ -export interface FungibleToken { +/** NFT */ +export interface NFT { id: string type: string } -/** GhostUncle */ -export interface GhostUncle { - /** @format block-hash */ - blockHash: string +/** NFTCollection */ +export interface NFTCollection { + type: string +} + +/** NFTCollectionMetadata */ +export interface NFTCollectionMetadata { /** @format address */ - miner: string + address: string + collectionUri: string } /** NFTCollectionWithRoyalty */ @@ -395,140 +333,259 @@ export interface NFTCollectionWithRoyalty { type: string } -/** PerChainTimedCount */ -export interface PerChainTimedCount { - totalCountPerChain?: PerChainCount[] - /** @format int64 */ - timestamp: number +/** NFTMetadata */ +export interface NFTMetadata { + /** @format 32-byte-hash */ + id: string + tokenUri: string + /** @format 32-byte-hash */ + collectionId: string + /** @format uint256 */ + nftIndex: string } -/** MempoolTransaction */ -export interface MempoolTransaction { - outputs?: Output[] +/** NonStandard */ +export interface NonStandard { + type: string +} + +/** NotFound */ +export interface NotFound { + detail: string + resource: string +} + +/** Output */ +export type Output = AssetOutput | ContractOutput + +/** OutputRef */ +export interface OutputRef { + /** @format int32 */ + hint: number + /** @format 32-byte-hash */ + key: string +} + +/** PendingTransaction */ +export interface PendingTransaction { + /** @format 32-byte-hash */ + hash: string /** @format group-index */ chainFrom: number - /** @format int64 */ - lastSeen: number /** @format group-index */ chainTo: number inputs?: Input[] + outputs?: Output[] /** @format int32 */ gasAmount: number - /** @format 32-byte-hash */ - hash: string /** @format uint256 */ gasPrice: string + /** @format int64 */ + lastSeen: number + type: string } -export enum TokensWithPrice { - WETH = 'WETH', - ALPH = 'ALPH', - USDT = 'USDT', - AYIN = 'AYIN', - DAI = 'DAI', - USDC = 'USDC', - WBTC = 'WBTC' +/** PerChainCount */ +export interface PerChainCount { + /** @format int32 */ + chainFrom: number + /** @format int32 */ + chainTo: number + /** @format int64 */ + count: number } -export enum MaxSizeTokens { - Value80 = 80 +/** PerChainDuration */ +export interface PerChainDuration { + /** @format int32 */ + chainFrom: number + /** @format int32 */ + chainTo: number + /** @format int64 */ + duration: number + /** @format int64 */ + value: number } -/** NFTCollection */ -export interface NFTCollection { - type: string +/** PerChainHeight */ +export interface PerChainHeight { + /** @format int32 */ + chainFrom: number + /** @format int32 */ + chainTo: number + /** @format int64 */ + height: number + /** @format int64 */ + value: number } -export enum MaxSizeAddressesForTokens { - Value80 = 80 +/** PerChainTimedCount */ +export interface PerChainTimedCount { + /** @format int64 */ + timestamp: number + totalCountPerChain?: PerChainCount[] } -/** InternalServerError */ -export interface InternalServerError { +/** ServiceUnavailable */ +export interface ServiceUnavailable { detail: string } -/** TimedPrices */ -export interface TimedPrices { - timestamps?: number[] - prices?: number[] +/** StdInterfaceId */ +export type StdInterfaceId = FungibleToken | NFT | NFTCollection | NFTCollectionWithRoyalty | NonStandard | Unknown + +/** SubContracts */ +export interface SubContracts { + subContracts?: string[] } /** TimedCount */ export interface TimedCount { - /** @format int64 */ - totalCountAllChains: number /** @format int64 */ timestamp: number + /** @format int64 */ + totalCountAllChains: number } -/** NFTMetadata */ -export interface NFTMetadata { - /** @format uint256 */ - nftIndex: string - tokenUri: string +/** TimedPrices */ +export interface TimedPrices { + timestamps?: number[] + prices?: number[] +} + +/** Token */ +export interface Token { /** @format 32-byte-hash */ id: string - /** @format 32-byte-hash */ - collectionId: string + /** @format uint256 */ + amount: string } -/** PerChainDuration */ -export interface PerChainDuration { - /** @format int64 */ - duration: number - /** @format int32 */ - chainFrom: number - /** @format int32 */ - chainTo: number - /** @format int64 */ - value: number +/** TokenInfo */ +export interface TokenInfo { + /** @format 32-byte-hash */ + token: string + /** Raw interface id, e.g. 0001 */ + stdInterfaceId?: TokenStdInterfaceId | string } -/** StdInterfaceId */ -export type StdInterfaceId = FungibleToken | NFT | NFTCollection | NFTCollectionWithRoyalty | NonStandard | Unknown +/** TokenStdInterfaceId */ +export enum TokenStdInterfaceId { + Fungible = 'fungible', + NonFungible = 'non-fungible', + NonStandard = 'non-standard' +} -/** Output */ -export type Output = AssetOutput | ContractOutput +/** TokenSupply */ +export interface TokenSupply { + /** @format int64 */ + timestamp: number + /** @format uint256 */ + total: string + /** @format uint256 */ + circulating: string + /** @format uint256 */ + reserved: string + /** @format uint256 */ + locked: string + /** @format uint256 */ + maximum: string +} -/** TransactionInfo */ -export interface TransactionInfo { +/** Transaction */ +export interface Transaction { + /** @format 32-byte-hash */ + hash: string /** @format block-hash */ blockHash: string + /** @format int64 */ + timestamp: number + inputs?: Input[] + outputs?: Output[] + version: number + networkId: number + scriptOpt?: string + /** @format int32 */ + gasAmount: number + /** @format uint256 */ + gasPrice: string + scriptExecutionOk: boolean + inputSignatures?: string[] + scriptSignatures?: string[] coinbase: boolean +} + +/** TransactionInfo */ +export interface TransactionInfo { /** @format 32-byte-hash */ hash: string + /** @format block-hash */ + blockHash: string /** @format int64 */ timestamp: number + coinbase: boolean } +/** TransactionLike */ +export type TransactionLike = AcceptedTransaction | PendingTransaction + /** Unauthorized */ export interface Unauthorized { detail: string } -/** NFTCollectionMetadata */ -export interface NFTCollectionMetadata { - collectionUri: string - /** @format address */ - address: string +/** Unknown */ +export interface Unknown { + id: string + type: string } +/** Val */ +export type Val = ValAddress | ValArray | ValBool | ValByteVec | ValI256 | ValU256 + /** ValAddress */ export interface ValAddress { - type: string /** @format address */ value: string + type: string } -export enum PaginationPageDefault { - Value1 = 1 +/** ValArray */ +export interface ValArray { + value: Val[] + type: string } /** ValBool */ export interface ValBool { - type: string value: boolean + type: string +} + +/** ValByteVec */ +export interface ValByteVec { + /** @format hex-string */ + value: string + type: string +} + +/** ValI256 */ +export interface ValI256 { + /** @format bigint */ + value: string + type: string +} + +/** ValU256 */ +export interface ValU256 { + /** @format uint256 */ + value: string + type: string +} + +export enum PaginationLimitDefault { + Value20 = 20, + Value10 = 10 } export enum PaginationLimitMax { @@ -536,14 +593,16 @@ export enum PaginationLimitMax { Value20 = 20 } -/** FungibleTokenMetadata */ -export interface FungibleTokenMetadata { - symbol: string - /** @format uint256 */ - decimals: string - name: string - /** @format 32-byte-hash */ - id: string +export enum PaginationPageDefault { + Value1 = 1 +} + +export enum MaxSizeTokens { + Value80 = 80 +} + +export enum MaxSizeAddressesForTokens { + Value80 = 80 } export enum MaxSizeAddresses { @@ -565,75 +624,6 @@ export enum Currencies { Aud = 'aud' } -export enum PaginationLimitDefault { - Value20 = 20, - Value10 = 10 -} - -/** AddressInfo */ -export interface AddressInfo { - /** @format uint256 */ - balance: string - /** @format uint256 */ - lockedBalance: string - /** @format int32 */ - txNumber: number -} - -/** AddressBalance */ -export interface AddressBalance { - /** @format uint256 */ - balance: string - /** @format uint256 */ - lockedBalance: string -} - -/** AmountHistory */ -export interface AmountHistory { - amountHistory?: string[][] -} - -/** Event */ -export interface Event { - /** @format block-hash */ - blockHash: string - /** @format address */ - inputAddress?: string - /** @format address */ - contractAddress: string - /** @format int32 */ - eventIndex: number - fields?: Val[] - /** @format 32-byte-hash */ - txHash: string -} - -/** ListBlocks */ -export interface ListBlocks { - /** @format int32 */ - total: number - blocks?: BlockEntryLite[] -} - -/** SubContracts */ -export interface SubContracts { - subContracts?: string[] -} - -/** TokenInfo */ -export interface TokenInfo { - /** Raw interface id, e.g. 0001 */ - stdInterfaceId?: TokenStdInterfaceId | string - /** @format 32-byte-hash */ - token: string -} - -/** NotFound */ -export interface NotFound { - resource: string - detail: string -} - import 'cross-fetch/polyfill' import { convertHttpResponse } from './utils' @@ -851,16 +841,15 @@ export class HttpClient { * @version 1.0 */ export class Api extends HttpClient { - contracts = { + blocks = { /** - * @description Get sub contract addresses + * @description List latest blocks * - * @tags Contracts - * @name GetContractsContractAddressSubContracts - * @request GET:/contracts/{contract_address}/sub-contracts + * @tags Blocks + * @name GetBlocks + * @request GET:/blocks */ - getContractsContractAddressSubContracts: ( - contractAddress: string, + getBlocks: ( query?: { /** * Page number @@ -875,11 +864,13 @@ export class Api extends HttpClient - this.request({ - path: `/contracts/${contractAddress}/sub-contracts`, + this.request({ + path: `/blocks`, method: 'GET', query: query, format: 'json', @@ -887,30 +878,65 @@ export class Api extends HttpClient - this.request({ - path: `/contracts/${contractAddress}/current-liveness`, + getBlocksBlockHash: (blockHash: string, params: RequestParams = {}) => + this.request({ + path: `/blocks/${blockHash}`, method: 'GET', format: 'json', ...params }).then(convertHttpResponse), /** - * @description Get contract parent address if exist + * @description Get block's transactions * - * @tags Contracts - * @name GetContractsContractAddressParent - * @request GET:/contracts/{contract_address}/parent + * @tags Blocks + * @name GetBlocksBlockHashTransactions + * @request GET:/blocks/{block_hash}/transactions */ - getContractsContractAddressParent: (contractAddress: string, params: RequestParams = {}) => - this.request({ - path: `/contracts/${contractAddress}/parent`, + getBlocksBlockHashTransactions: ( + blockHash: string, + query?: { + /** + * Page number + * @format int32 + * @min 1 + */ + page?: number + /** + * Number of items per page + * @format int32 + * @min 0 + * @max 100 + */ + limit?: number + }, + params: RequestParams = {} + ) => + this.request({ + path: `/blocks/${blockHash}/transactions`, + method: 'GET', + query: query, + format: 'json', + ...params + }).then(convertHttpResponse) + } + transactions = { + /** + * @description Get a transaction with hash + * + * @tags Transactions + * @name GetTransactionsTransactionHash + * @request GET:/transactions/{transaction_hash} + */ + getTransactionsTransactionHash: (transactionHash: string, params: RequestParams = {}) => + this.request({ + path: `/transactions/${transactionHash}`, method: 'GET', format: 'json', ...params @@ -918,16 +944,96 @@ export class Api extends HttpClient - this.request({ - path: `/addresses/used`, + getAddressesAddress: (address: string, params: RequestParams = {}) => + this.request({ + path: `/addresses/${address}`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description List transactions of a given address + * + * @tags Addresses + * @name GetAddressesAddressTransactions + * @request GET:/addresses/{address}/transactions + */ + getAddressesAddressTransactions: ( + address: string, + query?: { + /** + * Page number + * @format int32 + * @min 1 + */ + page?: number + /** + * Number of items per page + * @format int32 + * @min 0 + * @max 100 + */ + limit?: number + }, + params: RequestParams = {} + ) => + this.request({ + path: `/addresses/${address}/transactions`, + method: 'GET', + query: query, + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description List transactions for given addresses + * + * @tags Addresses + * @name PostAddressesTransactions + * @request POST:/addresses/transactions + */ + postAddressesTransactions: ( + query?: { + /** + * inclusive + * @format int64 + * @min 0 + */ + fromTs?: number + /** + * exclusive + * @format int64 + * @min 0 + */ + toTs?: number + /** + * Page number + * @format int32 + * @min 1 + */ + page?: number + /** + * Number of items per page + * @format int32 + * @min 0 + * @max 100 + */ + limit?: number + }, + data?: string[], + params: RequestParams = {} + ) => + this.request({ + path: `/addresses/transactions`, method: 'POST', + query: query, body: data, type: ContentType.Json, format: 'json', @@ -935,13 +1041,13 @@ export class Api extends HttpClient extends HttpClient - this.request({ - path: `/addresses/${address}/export-transactions/csv`, - method: 'GET', - query: query, - format: 'text', - ...params - }).then(convertHttpResponse), - - /** - * @description Get address balance - * - * @tags Addresses - * @name GetAddressesAddressBalance - * @request GET:/addresses/{address}/balance - */ - getAddressesAddressBalance: (address: string, params: RequestParams = {}) => - this.request({ - path: `/addresses/${address}/balance`, - method: 'GET', - format: 'json', - ...params - }).then(convertHttpResponse), - - /** - * @description List mempool transactions of a given address - * - * @tags Addresses - * @name GetAddressesAddressMempoolTransactions - * @request GET:/addresses/{address}/mempool/transactions - */ - getAddressesAddressMempoolTransactions: (address: string, params: RequestParams = {}) => - this.request< - MempoolTransaction[], - BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable - >({ - path: `/addresses/${address}/mempool/transactions`, - method: 'GET', - format: 'json', - ...params - }).then(convertHttpResponse), - - /** - * @description List address tokens - * - * @tags Addresses - * @name GetAddressesAddressTokensTokenIdTransactions - * @request GET:/addresses/{address}/tokens/{token_id}/transactions - */ - getAddressesAddressTokensTokenIdTransactions: ( - address: string, - tokenId: string, - query?: { /** * Page number * @format int32 @@ -1026,13 +1077,28 @@ export class Api extends HttpClient this.request({ - path: `/addresses/${address}/tokens/${tokenId}/transactions`, + path: `/addresses/${address}/timeranged-transactions`, method: 'GET', query: query, format: 'json', ...params }).then(convertHttpResponse), + /** + * @description Get total transactions of a given address + * + * @tags Addresses + * @name GetAddressesAddressTotalTransactions + * @request GET:/addresses/{address}/total-transactions + */ + getAddressesAddressTotalTransactions: (address: string, params: RequestParams = {}) => + this.request({ + path: `/addresses/${address}/total-transactions`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse), + /** * @description Get latest transaction information of a given address * @@ -1049,40 +1115,49 @@ export class Api extends HttpClient - this.request({ - path: `/addresses/${address}/total-transactions`, + getAddressesAddressMempoolTransactions: (address: string, params: RequestParams = {}) => + this.request< + MempoolTransaction[], + BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable + >({ + path: `/addresses/${address}/mempool/transactions`, method: 'GET', format: 'json', ...params }).then(convertHttpResponse), /** - * @description List transactions of a given address within a time-range + * @description Get address balance * * @tags Addresses - * @name GetAddressesAddressTimerangedTransactions - * @request GET:/addresses/{address}/timeranged-transactions + * @name GetAddressesAddressBalance + * @request GET:/addresses/{address}/balance */ - getAddressesAddressTimerangedTransactions: ( + getAddressesAddressBalance: (address: string, params: RequestParams = {}) => + this.request({ + path: `/addresses/${address}/balance`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description List address tokens + * + * @tags Addresses + * @name GetAddressesAddressTokens + * @request GET:/addresses/{address}/tokens + * @deprecated + */ + getAddressesAddressTokens: ( address: string, - query: { - /** - * @format int64 - * @min 0 - */ - fromTs: number - /** - * @format int64 - * @min 0 - */ - toTs: number + query?: { /** * Page number * @format int32 @@ -1099,8 +1174,8 @@ export class Api extends HttpClient - this.request({ - path: `/addresses/${address}/timeranged-transactions`, + this.request({ + path: `/addresses/${address}/tokens`, method: 'GET', query: query, format: 'json', @@ -1108,14 +1183,15 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/addresses/${address}/transactions`, + path: `/addresses/${address}/tokens/${tokenId}/transactions`, method: 'GET', query: query, format: 'json', @@ -1142,58 +1218,48 @@ export class Api extends HttpClient - this.request({ - path: `/addresses/${address}/amount-history`, + getAddressesAddressTokensTokenIdBalance: (address: string, tokenId: string, params: RequestParams = {}) => + this.request< + AddressTokenBalance, + BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable + >({ + path: `/addresses/${address}/tokens/${tokenId}/balance`, method: 'GET', - query: query, format: 'json', ...params }).then(convertHttpResponse), /** - * @description List transactions for given addresses + * @description Get public key of p2pkh addresses, the address needs to have at least one input. * * @tags Addresses - * @name PostAddressesTransactions - * @request POST:/addresses/transactions + * @name GetAddressesAddressPublicKey + * @request GET:/addresses/{address}/public-key */ - postAddressesTransactions: ( + getAddressesAddressPublicKey: (address: string, params: RequestParams = {}) => + this.request({ + path: `/addresses/${address}/public-key`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description Get address tokens with balance + * + * @tags Addresses + * @name GetAddressesAddressTokensBalance + * @request GET:/addresses/{address}/tokens-balance + */ + getAddressesAddressTokensBalance: ( + address: string, query?: { - /** - * inclusive - * @format int64 - * @min 0 - */ - fromTs?: number - /** - * exclusive - * @format int64 - * @min 0 - */ - toTs?: number /** * Page number * @format int32 @@ -1208,13 +1274,30 @@ export class Api extends HttpClient - this.request({ - path: `/addresses/transactions`, - method: 'POST', + this.request< + AddressTokenBalance[], + BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable + >({ + path: `/addresses/${address}/tokens-balance`, + method: 'GET', query: query, + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description Are the addresses used (at least 1 transaction) + * + * @tags Addresses, Addresses + * @name PostAddressesUsed + * @request POST:/addresses/used + */ + postAddressesUsed: (data?: string[], params: RequestParams = {}) => + this.request({ + path: `/addresses/used`, + method: 'POST', body: data, type: ContentType.Json, format: 'json', @@ -1225,11 +1308,10 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/addresses/${address}/amount-history-DEPRECATED`, + path: `/addresses/${address}/export-transactions/csv`, method: 'GET', query: query, - format: 'json', + format: 'text', ...params }).then(convertHttpResponse), /** - * @description List address tokens + * No description * * @tags Addresses - * @name GetAddressesAddressTokens - * @request GET:/addresses/{address}/tokens + * @name GetAddressesAddressAmountHistoryDeprecated + * @request GET:/addresses/{address}/amount-history-DEPRECATED * @deprecated */ - getAddressesAddressTokens: ( + getAddressesAddressAmountHistoryDeprecated: ( address: string, - query?: { + query: { /** - * Page number - * @format int32 - * @min 1 + * @format int64 + * @min 0 */ - page?: number + fromTs: number /** - * Number of items per page - * @format int32 + * @format int64 * @min 0 - * @max 100 */ - limit?: number + toTs: number + 'interval-type': IntervalType }, params: RequestParams = {} ) => - this.request({ - path: `/addresses/${address}/tokens`, + this.request({ + path: `/addresses/${address}/amount-history-DEPRECATED`, method: 'GET', query: query, format: 'json', @@ -1290,91 +1369,68 @@ export class Api extends HttpClient - this.request< - AddressTokenBalance[], - BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable - >({ - path: `/addresses/${address}/tokens-balance`, + this.request({ + path: `/addresses/${address}/amount-history`, method: 'GET', query: query, format: 'json', ...params - }).then(convertHttpResponse), - + }).then(convertHttpResponse) + } + infos = { /** - * @description Get address balance of given token + * @description Get explorer informations * - * @tags Addresses - * @name GetAddressesAddressTokensTokenIdBalance - * @request GET:/addresses/{address}/tokens/{token_id}/balance + * @tags Infos + * @name GetInfos + * @request GET:/infos */ - getAddressesAddressTokensTokenIdBalance: (address: string, tokenId: string, params: RequestParams = {}) => - this.request< - AddressTokenBalance, - BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable - >({ - path: `/addresses/${address}/tokens/${tokenId}/balance`, + getInfos: (params: RequestParams = {}) => + this.request({ + path: `/infos`, method: 'GET', format: 'json', ...params }).then(convertHttpResponse), /** - * @description Get address information + * @description List latest height for each chain * - * @tags Addresses - * @name GetAddressesAddress - * @request GET:/addresses/{address} + * @tags Infos + * @name GetInfosHeights + * @request GET:/infos/heights */ - getAddressesAddress: (address: string, params: RequestParams = {}) => - this.request({ - path: `/addresses/${address}`, + getInfosHeights: (params: RequestParams = {}) => + this.request({ + path: `/infos/heights`, method: 'GET', format: 'json', ...params }).then(convertHttpResponse), - /** - * @description Get public key of p2pkh addresses, the address needs to have at least one input. - * - * @tags Addresses - * @name GetAddressesAddressPublicKey - * @request GET:/addresses/{address}/public-key - */ - getAddressesAddressPublicKey: (address: string, params: RequestParams = {}) => - this.request({ - path: `/addresses/${address}/public-key`, - method: 'GET', - format: 'json', - ...params - }).then(convertHttpResponse) - } - infos = { /** * @description Get token supply list * @@ -1409,35 +1465,20 @@ export class Api extends HttpClient + getInfosSupplyTotalAlph: (params: RequestParams = {}) => this.request({ - path: `/infos/supply/locked-alph`, + path: `/infos/supply/total-alph`, method: 'GET', format: 'text', ...params }).then(convertHttpResponse), - /** - * @description Get explorer informations - * - * @tags Infos - * @name GetInfos - * @request GET:/infos - */ - getInfos: (params: RequestParams = {}) => - this.request({ - path: `/infos`, - method: 'GET', - format: 'json', - ...params - }).then(convertHttpResponse), - /** * @description Get the ALPH circulating supply * @@ -1454,65 +1495,50 @@ export class Api extends HttpClient + getInfosSupplyReservedAlph: (params: RequestParams = {}) => this.request({ - path: `/infos/supply/total-alph`, + path: `/infos/supply/reserved-alph`, method: 'GET', format: 'text', ...params }).then(convertHttpResponse), /** - * @description Get the total number of transactions + * @description Get the ALPH locked supply * * @tags Infos - * @name GetInfosTotalTransactions - * @request GET:/infos/total-transactions + * @name GetInfosSupplyLockedAlph + * @request GET:/infos/supply/locked-alph */ - getInfosTotalTransactions: (params: RequestParams = {}) => + getInfosSupplyLockedAlph: (params: RequestParams = {}) => this.request({ - path: `/infos/total-transactions`, + path: `/infos/supply/locked-alph`, method: 'GET', format: 'text', ...params }).then(convertHttpResponse), /** - * @description Get the ALPH reserved supply + * @description Get the total number of transactions * * @tags Infos - * @name GetInfosSupplyReservedAlph - * @request GET:/infos/supply/reserved-alph + * @name GetInfosTotalTransactions + * @request GET:/infos/total-transactions */ - getInfosSupplyReservedAlph: (params: RequestParams = {}) => + getInfosTotalTransactions: (params: RequestParams = {}) => this.request({ - path: `/infos/supply/reserved-alph`, + path: `/infos/total-transactions`, method: 'GET', format: 'text', ...params }).then(convertHttpResponse), - /** - * @description List latest height for each chain - * - * @tags Infos - * @name GetInfosHeights - * @request GET:/infos/heights - */ - getInfosHeights: (params: RequestParams = {}) => - this.request({ - path: `/infos/heights`, - method: 'GET', - format: 'json', - ...params - }).then(convertHttpResponse), - /** * @description Get the average block time for each chain * @@ -1530,90 +1556,44 @@ export class Api extends HttpClient - this.request({ - path: `/utils/sanity-check`, - method: 'PUT', - ...params - }).then(convertHttpResponse), - - /** - * @description Update global log level, accepted: TRACE, DEBUG, INFO, WARN, ERROR - * - * @tags Utils - * @name PutUtilsUpdateGlobalLoglevel - * @request PUT:/utils/update-global-loglevel - */ - putUtilsUpdateGlobalLoglevel: (data: 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR', params: RequestParams = {}) => - this.request({ - path: `/utils/update-global-loglevel`, - method: 'PUT', - body: data, - ...params - }).then(convertHttpResponse), - - /** - * @description Update logback values - * - * @tags Utils - * @name PutUtilsUpdateLogConfig - * @request PUT:/utils/update-log-config - */ - putUtilsUpdateLogConfig: (data?: LogbackValue[], params: RequestParams = {}) => - this.request({ - path: `/utils/update-log-config`, - method: 'PUT', - body: data, - type: ContentType.Json, - ...params - }).then(convertHttpResponse) - } - tokens = { + mempool = { /** - * @description Return metadata for the given fungible tokens, if metadata doesn't exist or token isn't a fungible, it won't be in the output list + * @description list mempool transactions * - * @tags Tokens - * @name PostTokensFungibleMetadata - * @request POST:/tokens/fungible-metadata + * @tags Mempool + * @name GetMempoolTransactions + * @request GET:/mempool/transactions */ - postTokensFungibleMetadata: (data?: string[], params: RequestParams = {}) => + getMempoolTransactions: ( + query?: { + /** + * Page number + * @format int32 + * @min 1 + */ + page?: number + /** + * Number of items per page + * @format int32 + * @min 0 + * @max 100 + */ + limit?: number + }, + params: RequestParams = {} + ) => this.request< - FungibleTokenMetadata[], + MempoolTransaction[], BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable >({ - path: `/tokens/fungible-metadata`, - method: 'POST', - body: data, - type: ContentType.Json, - format: 'json', - ...params - }).then(convertHttpResponse), - - /** - * @description List given tokens information - * - * @tags Tokens - * @name PostTokens - * @request POST:/tokens - */ - postTokens: (data?: string[], params: RequestParams = {}) => - this.request({ - path: `/tokens`, - method: 'POST', - body: data, - type: ContentType.Json, + path: `/mempool/transactions`, + method: 'GET', + query: query, format: 'json', ...params - }).then(convertHttpResponse), - + }).then(convertHttpResponse) + } + tokens = { /** * @description List token information * @@ -1653,13 +1633,30 @@ export class Api extends HttpClient + this.request({ + path: `/tokens`, + method: 'POST', + body: data, + type: ContentType.Json, + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description List token transactions + * + * @tags Tokens + * @name GetTokensTokenIdTransactions + * @request GET:/tokens/{token_id}/transactions + */ + getTokensTokenIdTransactions: ( tokenId: string, query?: { /** @@ -1678,8 +1675,8 @@ export class Api extends HttpClient - this.request({ - path: `/tokens/holders/token/${tokenId}`, + this.request({ + path: `/tokens/${tokenId}/transactions`, method: 'GET', query: query, format: 'json', @@ -1687,13 +1684,13 @@ export class Api extends HttpClient extends HttpClient - this.request({ - path: `/tokens/${tokenId}/transactions`, + this.request({ + path: `/tokens/${tokenId}/addresses`, method: 'GET', query: query, format: 'json', ...params }).then(convertHttpResponse), + /** + * @description Return metadata for the given fungible tokens, if metadata doesn't exist or token isn't a fungible, it won't be in the output list + * + * @tags Tokens + * @name PostTokensFungibleMetadata + * @request POST:/tokens/fungible-metadata + */ + postTokensFungibleMetadata: (data?: string[], params: RequestParams = {}) => + this.request< + FungibleTokenMetadata[], + BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable + >({ + path: `/tokens/fungible-metadata`, + method: 'POST', + body: data, + type: ContentType.Json, + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description Return metadata for the given nft tokens, if metadata doesn't exist or token isn't a nft, it won't be in the output list + * + * @tags Tokens + * @name PostTokensNftMetadata + * @request POST:/tokens/nft-metadata + */ + postTokensNftMetadata: (data?: string[], params: RequestParams = {}) => + this.request({ + path: `/tokens/nft-metadata`, + method: 'POST', + body: data, + type: ContentType.Json, + format: 'json', + ...params + }).then(convertHttpResponse), + /** * @description Return metadata for the given nft collection addresses, if metadata doesn't exist or address isn't a nft collection, it won't be in the output list * @@ -1741,14 +1775,13 @@ export class Api extends HttpClient extends HttpClient - this.request({ - path: `/tokens/${tokenId}/addresses`, + this.request({ + path: `/tokens/holders/alph`, method: 'GET', query: query, format: 'json', @@ -1775,13 +1808,14 @@ export class Api extends HttpClient extends HttpClient this.request({ - path: `/tokens/holders/alph`, + path: `/tokens/holders/token/${tokenId}`, method: 'GET', query: query, format: 'json', ...params - }).then(convertHttpResponse), - - /** - * @description Return metadata for the given nft tokens, if metadata doesn't exist or token isn't a nft, it won't be in the output list - * - * @tags Tokens - * @name PostTokensNftMetadata - * @request POST:/tokens/nft-metadata - */ - postTokensNftMetadata: (data?: string[], params: RequestParams = {}) => - this.request({ - path: `/tokens/nft-metadata`, - method: 'POST', - body: data, - type: ContentType.Json, - format: 'json', - ...params }).then(convertHttpResponse) } - market = { + charts = { /** - * No description + * @description `interval-type` query param: hourly, daily * - * @tags Market - * @name PostMarketPrices - * @request POST:/market/prices + * @tags Charts + * @name GetChartsHashrates + * @summary Get hashrate chart in H/s + * @request GET:/charts/hashrates */ - postMarketPrices: ( + getChartsHashrates: ( query: { - currency: string + /** + * @format int64 + * @min 0 + */ + fromTs: number + /** + * @format int64 + * @min 0 + */ + toTs: number + 'interval-type': IntervalType }, - data?: string[], params: RequestParams = {} ) => - this.request({ - path: `/market/prices`, - method: 'POST', + this.request({ + path: `/charts/hashrates`, + method: 'GET', query: query, - body: data, - type: ContentType.Json, format: 'json', ...params }).then(convertHttpResponse), /** - * No description + * @description `interval-type` query param: hourly, daily * - * @tags Market - * @name GetMarketPricesSymbolCharts - * @request GET:/market/prices/{symbol}/charts + * @tags Charts + * @name GetChartsTransactionsCount + * @summary Get transaction count history + * @request GET:/charts/transactions-count */ - getMarketPricesSymbolCharts: ( - symbol: string, + getChartsTransactionsCount: ( query: { - currency: string - }, - params: RequestParams = {} - ) => - this.request({ - path: `/market/prices/${symbol}/charts`, - method: 'GET', - query: query, - format: 'json', - ...params - }).then(convertHttpResponse) - } - blocks = { - /** - * @description Get block's transactions - * - * @tags Blocks - * @name GetBlocksBlockHashTransactions - * @request GET:/blocks/{block_hash}/transactions - */ - getBlocksBlockHashTransactions: ( - blockHash: string, - query?: { /** - * Page number - * @format int32 - * @min 1 + * @format int64 + * @min 0 */ - page?: number + fromTs: number /** - * Number of items per page - * @format int32 + * @format int64 * @min 0 - * @max 100 */ - limit?: number + toTs: number + 'interval-type': IntervalType }, params: RequestParams = {} ) => - this.request({ - path: `/blocks/${blockHash}/transactions`, - method: 'GET', - query: query, - format: 'json', - ...params - }).then(convertHttpResponse), - - /** - * @description Get a block with hash - * - * @tags Blocks - * @name GetBlocksBlockHash - * @request GET:/blocks/{block_hash} - */ - getBlocksBlockHash: (blockHash: string, params: RequestParams = {}) => - this.request({ - path: `/blocks/${blockHash}`, + this.request({ + path: `/charts/transactions-count`, method: 'GET', + query: query, format: 'json', ...params }).then(convertHttpResponse), /** - * @description List latest blocks + * @description `interval-type` query param: hourly, daily * - * @tags Blocks - * @name GetBlocks - * @request GET:/blocks + * @tags Charts + * @name GetChartsTransactionsCountPerChain + * @summary Get transaction count history per chain + * @request GET:/charts/transactions-count-per-chain */ - getBlocks: ( - query?: { + getChartsTransactionsCountPerChain: ( + query: { /** - * Page number - * @format int32 - * @min 1 + * @format int64 + * @min 0 */ - page?: number + fromTs: number /** - * Number of items per page - * @format int32 + * @format int64 * @min 0 - * @max 100 */ - limit?: number - /** Reverse pagination */ - reverse?: boolean + toTs: number + 'interval-type': IntervalType }, params: RequestParams = {} ) => - this.request({ - path: `/blocks`, + this.request< + PerChainTimedCount[], + BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable + >({ + path: `/charts/transactions-count-per-chain`, method: 'GET', query: query, format: 'json', ...params }).then(convertHttpResponse) } - transactions = { - /** - * @description Get a transaction with hash - * - * @tags Transactions - * @name GetTransactionsTransactionHash - * @request GET:/transactions/{transaction_hash} - */ - getTransactionsTransactionHash: (transactionHash: string, params: RequestParams = {}) => - this.request({ - path: `/transactions/${transactionHash}`, - method: 'GET', - format: 'json', - ...params - }).then(convertHttpResponse) - } contractEvents = { /** * @description Get contract events by transaction id @@ -2057,140 +2026,161 @@ export class Api extends HttpClient + this.request({ + path: `/contracts/${contractAddress}/current-liveness`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description Get contract parent address if exist + * + * @tags Contracts + * @name GetContractsContractAddressParent + * @request GET:/contracts/{contract_address}/parent + */ + getContractsContractAddressParent: (contractAddress: string, params: RequestParams = {}) => + this.request({ + path: `/contracts/${contractAddress}/parent`, + method: 'GET', + format: 'json', + ...params + }).then(convertHttpResponse), + + /** + * @description Get sub contract addresses + * + * @tags Contracts + * @name GetContractsContractAddressSubContracts + * @request GET:/contracts/{contract_address}/sub-contracts + */ + getContractsContractAddressSubContracts: ( + contractAddress: string, + query?: { /** - * @format int64 - * @min 0 + * Page number + * @format int32 + * @min 1 */ - fromTs: number + page?: number /** - * @format int64 + * Number of items per page + * @format int32 * @min 0 + * @max 100 */ - toTs: number - 'interval-type': IntervalType + limit?: number }, params: RequestParams = {} ) => - this.request< - PerChainTimedCount[], - BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable - >({ - path: `/charts/transactions-count-per-chain`, + this.request({ + path: `/contracts/${contractAddress}/sub-contracts`, method: 'GET', query: query, format: 'json', ...params - }).then(convertHttpResponse), - + }).then(convertHttpResponse) + } + market = { /** - * @description `interval-type` query param: hourly, daily + * No description * - * @tags Charts - * @name GetChartsTransactionsCount - * @summary Get transaction count history - * @request GET:/charts/transactions-count + * @tags Market + * @name PostMarketPrices + * @request POST:/market/prices */ - getChartsTransactionsCount: ( + postMarketPrices: ( query: { - /** - * @format int64 - * @min 0 - */ - fromTs: number - /** - * @format int64 - * @min 0 - */ - toTs: number - 'interval-type': IntervalType + currency: string }, + data?: string[], params: RequestParams = {} ) => - this.request({ - path: `/charts/transactions-count`, - method: 'GET', + this.request({ + path: `/market/prices`, + method: 'POST', query: query, + body: data, + type: ContentType.Json, format: 'json', ...params }).then(convertHttpResponse), /** - * @description `interval-type` query param: hourly, daily + * No description * - * @tags Charts - * @name GetChartsHashrates - * @summary Get hashrate chart in H/s - * @request GET:/charts/hashrates + * @tags Market + * @name GetMarketPricesSymbolCharts + * @request GET:/market/prices/{symbol}/charts */ - getChartsHashrates: ( + getMarketPricesSymbolCharts: ( + symbol: string, query: { - /** - * @format int64 - * @min 0 - */ - fromTs: number - /** - * @format int64 - * @min 0 - */ - toTs: number - 'interval-type': IntervalType + currency: string }, params: RequestParams = {} ) => - this.request({ - path: `/charts/hashrates`, + this.request({ + path: `/market/prices/${symbol}/charts`, method: 'GET', query: query, format: 'json', ...params }).then(convertHttpResponse) } - mempool = { + utils = { /** - * @description list mempool transactions + * @description Perform a sanity check * - * @tags Mempool - * @name GetMempoolTransactions - * @request GET:/mempool/transactions + * @tags Utils + * @name PutUtilsSanityCheck + * @request PUT:/utils/sanity-check */ - getMempoolTransactions: ( - query?: { - /** - * Page number - * @format int32 - * @min 1 - */ - page?: number - /** - * Number of items per page - * @format int32 - * @min 0 - * @max 100 - */ - limit?: number - }, - params: RequestParams = {} - ) => - this.request< - MempoolTransaction[], - BadRequest | Unauthorized | NotFound | InternalServerError | ServiceUnavailable - >({ - path: `/mempool/transactions`, - method: 'GET', - query: query, - format: 'json', + putUtilsSanityCheck: (params: RequestParams = {}) => + this.request({ + path: `/utils/sanity-check`, + method: 'PUT', + ...params + }).then(convertHttpResponse), + + /** + * @description Update global log level, accepted: TRACE, DEBUG, INFO, WARN, ERROR + * + * @tags Utils + * @name PutUtilsUpdateGlobalLoglevel + * @request PUT:/utils/update-global-loglevel + */ + putUtilsUpdateGlobalLoglevel: (data: 'TRACE' | 'DEBUG' | 'INFO' | 'WARN' | 'ERROR', params: RequestParams = {}) => + this.request({ + path: `/utils/update-global-loglevel`, + method: 'PUT', + body: data, + ...params + }).then(convertHttpResponse), + + /** + * @description Update logback values + * + * @tags Utils + * @name PutUtilsUpdateLogConfig + * @request PUT:/utils/update-log-config + */ + putUtilsUpdateLogConfig: (data?: LogbackValue[], params: RequestParams = {}) => + this.request({ + path: `/utils/update-log-config`, + method: 'PUT', + body: data, + type: ContentType.Json, ...params }).then(convertHttpResponse) }