Documentation
¶
Overview ¶
Package client provides clients and typed data for Blockscout legacy, REST API v2, and ETH RPC endpoints.
Index ¶
- Constants
- type ABIEntry
- type ABIParam
- type APIError
- type AccountAbstractionAccount
- type AccountAbstractionBundle
- type AccountAbstractionBundler
- type AccountAbstractionFactory
- type AccountAbstractionParams
- type AccountAbstractionPaymaster
- type AccountAbstractionStatus
- type AccountAbstractionVersionStatus
- type AdditionalSource
- type Address
- type AddressCounters
- type AddressDetail
- type AddressListItem
- type AddressListResponse
- type AddressTabsCounters
- type AddressTokenBalance
- type AdvancedFilterItem
- type AdvancedFilterMethod
- type AdvancedFilterMethodsParams
- type AdvancedFilterResponse
- type AdvancedFilterSearchParams
- type AdvancedFiltersParams
- type ArbitrumBatch
- type ArbitrumBatchForList
- type ArbitrumClaimMessage
- type ArbitrumDASigner
- type ArbitrumDataAvailability
- type ArbitrumMessage
- type ArbitrumMinimalMessage
- type ArbitrumTransaction
- type ArbitrumWithdrawal
- type ArbitrumWithdrawalToken
- type BackendConfig
- type BackendVersion
- type BeaconDeposit
- type BeaconDepositsCount
- type Blob
- type Block
- type BlockCountdown
- type BlockReward
- type BlockScoutAPIClient
- func (client *BlockScoutAPIClient) CheckRedirect(ctx context.Context, query string) (*SearchRedirect, error)
- func (client *BlockScoutAPIClient) CheckVerifyStatus(guid string) (string, error)
- func (client *BlockScoutAPIClient) CheckVerifyStatusContext(ctx context.Context, guid string) (string, error)
- func (client *BlockScoutAPIClient) DownloadAddressCeloElectionRewardsCSV(ctx context.Context, addressHash string, params *CeloElectionRewardsParams) ([]byte, error)
- func (client *BlockScoutAPIClient) DownloadAddressInternalTransactionsCSV(ctx context.Context, addressHash string, ...) ([]byte, error)
- func (client *BlockScoutAPIClient) DownloadAddressLogsCSV(ctx context.Context, addressHash string, params *ListAddressLogsParams) ([]byte, error)
- func (client *BlockScoutAPIClient) DownloadAddressTokenTransfersCSV(ctx context.Context, addressHash string, ...) ([]byte, error)
- func (client *BlockScoutAPIClient) DownloadAddressTransactionsCSV(ctx context.Context, addressHash string, params *ListAddressTransactionsParams) ([]byte, error)
- func (client *BlockScoutAPIClient) DownloadAdvancedFiltersCSV(ctx context.Context, params *AdvancedFiltersParams) ([]byte, error)
- func (client *BlockScoutAPIClient) DownloadTokenHoldersCSV(ctx context.Context, addressHash string, params *PaginationParams) ([]byte, error)
- func (client *BlockScoutAPIClient) GetABI(addr string) (string, error)
- func (client *BlockScoutAPIClient) GetABIContext(ctx context.Context, addr string) (string, error)
- func (client *BlockScoutAPIClient) GetAccountAbstractionAccount(ctx context.Context, addressHash string) (*AccountAbstractionAccount, error)
- func (client *BlockScoutAPIClient) GetAccountAbstractionBundler(ctx context.Context, addressHash string) (*AccountAbstractionBundler, error)
- func (client *BlockScoutAPIClient) GetAccountAbstractionFactory(ctx context.Context, addressHash string) (*AccountAbstractionFactory, error)
- func (client *BlockScoutAPIClient) GetAccountAbstractionPaymaster(ctx context.Context, addressHash string) (*AccountAbstractionPaymaster, error)
- func (client *BlockScoutAPIClient) GetAccountAbstractionStatus(ctx context.Context) (*AccountAbstractionStatus, error)
- func (client *BlockScoutAPIClient) GetAccountBalance(address string) (*big.Float, error)
- func (client *BlockScoutAPIClient) GetAccountBalanceContext(ctx context.Context, address string) (*big.Float, error)
- func (client *BlockScoutAPIClient) GetAddress(ctx context.Context, addressHash string) (*AddressDetail, error)
- func (client *BlockScoutAPIClient) GetAddressCoinBalanceHistoryByDay(ctx context.Context, addressHash string) (*CoinBalanceHistoryByDay, error)
- func (client *BlockScoutAPIClient) GetAddressCounters(ctx context.Context, addressHash string) (*AddressCounters, error)
- func (client *BlockScoutAPIClient) GetAddressTabsCounters(ctx context.Context, addressHash string) (*AddressTabsCounters, error)
- func (client *BlockScoutAPIClient) GetAddressTokenBalances(ctx context.Context, addressHash string) ([]TokenBalance, error)
- func (client *BlockScoutAPIClient) GetArbitrumBatch(ctx context.Context, batchNumber int, params *SecretParams) (*ArbitrumBatch, error)
- func (client *BlockScoutAPIClient) GetArbitrumBatchByCelestiaDA(ctx context.Context, height int, transactionCommitment string, ...) (*ArbitrumBatch, error)
- func (client *BlockScoutAPIClient) GetArbitrumBatchesCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetArbitrumClaimMessage(ctx context.Context, messageID int, params *SecretParams) (*ArbitrumClaimMessage, error)
- func (client *BlockScoutAPIClient) GetArbitrumMessagesCount(ctx context.Context, direction string, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetBackendConfig(ctx context.Context) (*BackendConfig, error)
- func (client *BlockScoutAPIClient) GetBackendVersion(ctx context.Context) (*BackendVersion, error)
- func (client *BlockScoutAPIClient) GetBalance(address string, block uint64) (*big.Float, error)deprecated
- func (client *BlockScoutAPIClient) GetBalanceContext(ctx context.Context, address string, block uint64) (*big.Float, error)deprecated
- func (client *BlockScoutAPIClient) GetBalanceEthRpc(addr string) (*common.Response, error)
- func (client *BlockScoutAPIClient) GetBalanceEthRpcContext(ctx context.Context, addr string) (*common.Response, error)
- func (client *BlockScoutAPIClient) GetBalanceMulti(addrs []string) ([]common.BalanceMulti, error)
- func (client *BlockScoutAPIClient) GetBalanceMultiContext(ctx context.Context, addrs []string) ([]common.BalanceMulti, error)
- func (client *BlockScoutAPIClient) GetBeaconDepositsCount(ctx context.Context) (*BeaconDepositsCount, error)
- func (client *BlockScoutAPIClient) GetBlock(ctx context.Context, blockHashOrNumber string) (*Block, error)
- func (client *BlockScoutAPIClient) GetBlockByTime(timestamp uint64, closest string) (*common.BlockNumber, error)
- func (client *BlockScoutAPIClient) GetBlockByTimeContext(ctx context.Context, timestamp uint64, closest string) (*common.BlockNumber, error)
- func (client *BlockScoutAPIClient) GetBlockCountdown(ctx context.Context, blockNumber string) (*BlockCountdown, error)
- func (client *BlockScoutAPIClient) GetBlockInfo(blockNumberOrHash string) ([]byte, error)
- func (client *BlockScoutAPIClient) GetBlockInfoContext(ctx context.Context, blockNumberOrHash string) ([]byte, error)
- func (client *BlockScoutAPIClient) GetBlockRewardRpcApi(block uint64) (*common.BlockRewardInfo, error)
- func (client *BlockScoutAPIClient) GetBlockRewardRpcApiContext(ctx context.Context, block uint64) (*common.BlockRewardInfo, error)
- func (client *BlockScoutAPIClient) GetBridgedTokenList(opts LegacyListOptions) ([]common.TokenInfo, error)deprecated
- func (client *BlockScoutAPIClient) GetBridgedTokenListContext(ctx context.Context, opts LegacyListOptions) ([]common.TokenInfo, error)deprecated
- func (client *BlockScoutAPIClient) GetBridgedTokenListForChain(chainID int, opts LegacyListOptions) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetBridgedTokenListForChainContext(ctx context.Context, chainID int, opts LegacyListOptions) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetBridgedTokenListWithOptions(opts LegacyBridgedTokenListOptions) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetBridgedTokenListWithOptionsContext(ctx context.Context, opts LegacyBridgedTokenListOptions) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetCSVExport(ctx context.Context, uuid string) (*CSVExportStatus, error)
- func (client *BlockScoutAPIClient) GetCSVExportConfig(ctx context.Context) (*CSVExportConfig, error)
- func (client *BlockScoutAPIClient) GetCeloConfig(ctx context.Context, params *SecretParams) (*CeloConfig, error)
- func (client *BlockScoutAPIClient) GetCeloEpoch(ctx context.Context, number string, params *SecretParams) (*CeloEpochDetailed, error)
- func (client *BlockScoutAPIClient) GetCoinPriceUSD() (*common.CoinPrice, error)
- func (client *BlockScoutAPIClient) GetCoinPriceUSDContext(ctx context.Context) (*common.CoinPrice, error)
- func (client *BlockScoutAPIClient) GetCoinSupply() (*big.Float, error)
- func (client *BlockScoutAPIClient) GetCoinSupplyContext(ctx context.Context) (*big.Float, error)
- func (client *BlockScoutAPIClient) GetContractInfo(addr string) (*[]common.ContractInfo, error)
- func (client *BlockScoutAPIClient) GetContractInfoContext(ctx context.Context, addr string) (*[]common.ContractInfo, error)
- func (client *BlockScoutAPIClient) GetCurrentBlockEthRpc() (*common.Response, error)
- func (client *BlockScoutAPIClient) GetCurrentBlockEthRpcContext(ctx context.Context) (*common.Response, error)
- func (client *BlockScoutAPIClient) GetCurrentBlockRpcApi() (*big.Int, error)
- func (client *BlockScoutAPIClient) GetCurrentBlockRpcApiContext(ctx context.Context) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetDBBackgroundMigrations(ctx context.Context) (*DBBackgroundMigrations, error)
- func (client *BlockScoutAPIClient) GetEpoch(epoch uint64) (common.Epoch, error)
- func (client *BlockScoutAPIClient) GetEpochContext(ctx context.Context, epoch uint64) (common.Epoch, error)
- func (client *BlockScoutAPIClient) GetEthBalance(address string, block uint64) (*big.Float, error)
- func (client *BlockScoutAPIClient) GetEthBalanceContext(ctx context.Context, address string, block uint64) (*big.Float, error)
- func (client *BlockScoutAPIClient) GetIndexerConfig(ctx context.Context) (*IndexerConfig, error)
- func (client *BlockScoutAPIClient) GetJSONRPCURL(ctx context.Context) (*JSONRPCURL, error)
- func (client *BlockScoutAPIClient) GetLogs(params LegacyLogParams) ([]common.Log, error)
- func (client *BlockScoutAPIClient) GetLogsContext(ctx context.Context, params LegacyLogParams) ([]common.Log, error)
- func (client *BlockScoutAPIClient) GetMUDWorldSystem(ctx context.Context, world string, system string, params *SecretParams) (*MUDSystemDetails, error)
- func (client *BlockScoutAPIClient) GetMUDWorldTableRecord(ctx context.Context, world string, tableID string, recordID string, ...) (*MUDTableWithSchema, error)
- func (client *BlockScoutAPIClient) GetMUDWorldTableRecordsCount(ctx context.Context, world string, tableID string, ...) (int, error)
- func (client *BlockScoutAPIClient) GetMUDWorldTablesCount(ctx context.Context, world string, params *MUDTablesParams) (int, error)
- func (client *BlockScoutAPIClient) GetMUDWorldsCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetMainPageArbitrumLatestBatchNumber(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetMainPageIndexingStatus(ctx context.Context) (*MainPageIndexingStatus, error)
- func (client *BlockScoutAPIClient) GetMarketChart(ctx context.Context) (*MarketChart, error)
- func (client *BlockScoutAPIClient) GetMinedBlocks(address string) ([]common.MinedBlock, error)
- func (client *BlockScoutAPIClient) GetMinedBlocksContext(ctx context.Context, address string) ([]common.MinedBlock, error)
- func (client *BlockScoutAPIClient) GetMinedBlocksWithOptions(address string, opts LegacyListOptions) ([]common.MinedBlock, error)
- func (client *BlockScoutAPIClient) GetMinedBlocksWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.MinedBlock, error)
- func (client *BlockScoutAPIClient) GetNativeCoinSupply() (*big.Int, error)
- func (client *BlockScoutAPIClient) GetNativeCoinSupplyContext(ctx context.Context) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetOptimismBatch(ctx context.Context, number string, params *SecretParams) (*OptimismBatch, error)
- func (client *BlockScoutAPIClient) GetOptimismBatchByCelestiaDA(ctx context.Context, height string, commitment string, params *SecretParams) (*OptimismBatch, error)
- func (client *BlockScoutAPIClient) GetOptimismBatchesCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetOptimismDepositsCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetOptimismGamesCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetOptimismOutputRootsCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetOptimismWithdrawalsCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetPublicMetricsConfig(ctx context.Context) (*PublicMetricsConfig, error)
- func (client *BlockScoutAPIClient) GetScrollBatch(ctx context.Context, number string, params *SecretParams) (*ScrollBatch, error)
- func (client *BlockScoutAPIClient) GetScrollBatchesCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetScrollDepositsCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetScrollWithdrawalsCount(ctx context.Context, params *SecretParams) (int, error)
- func (client *BlockScoutAPIClient) GetSecondaryCoinMarketChart(ctx context.Context) (*MarketChart, error)
- func (client *BlockScoutAPIClient) GetSmartContract(ctx context.Context, addressHash string) (*SmartContract, error)
- func (client *BlockScoutAPIClient) GetSmartContractABIEntries(ctx context.Context, addressHash string) ([]ABIEntry, error)
- func (client *BlockScoutAPIClient) GetSmartContractABIRaw(ctx context.Context, addressHash string) (json.RawMessage, error)
- func (client *BlockScoutAPIClient) GetSmartContractCounters(ctx context.Context) (*SmartContractCounters, error)
- func (client *BlockScoutAPIClient) GetSmartContractLanguages(ctx context.Context) ([]string, error)
- func (client *BlockScoutAPIClient) GetSmartContractRaw(ctx context.Context, addressHash string) (json.RawMessage, error)
- func (client *BlockScoutAPIClient) GetSmartContractReadMethods(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
- func (client *BlockScoutAPIClient) GetSmartContractReadMethodsProxy(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
- func (client *BlockScoutAPIClient) GetSmartContractVerificationConfig(ctx context.Context) (*VerificationConfig, error)
- func (client *BlockScoutAPIClient) GetSmartContractWriteMethods(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
- func (client *BlockScoutAPIClient) GetSmartContractWriteMethodsProxy(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
- func (client *BlockScoutAPIClient) GetStats(ctx context.Context) (*NetworkStats, error)
- func (client *BlockScoutAPIClient) GetToken(addr string) (*common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetTokenBalance(account string, tokenAddr string) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetTokenBalanceContext(ctx context.Context, account string, tokenAddr string) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetTokenContext(ctx context.Context, addr string) (*common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetTokenCounters(ctx context.Context, addressHash string) (*TokenCounters, error)
- func (client *BlockScoutAPIClient) GetTokenHolders(contractAddress string, opts LegacyListOptions) ([]LegacyTokenHolder, error)
- func (client *BlockScoutAPIClient) GetTokenHoldersContext(ctx context.Context, contractAddress string, opts LegacyListOptions) ([]LegacyTokenHolder, error)
- func (client *BlockScoutAPIClient) GetTokenInstance(ctx context.Context, addressHash string, tokenID string) (*TokenInstance, error)
- func (client *BlockScoutAPIClient) GetTokenInstanceTransfersCount(ctx context.Context, addressHash string, tokenID string) (*TokenInstanceTransfersCount, error)
- func (client *BlockScoutAPIClient) GetTokenList(address string) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetTokenListContext(ctx context.Context, address string) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetTokenListWithOptions(address string, opts LegacyListOptions) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetTokenListWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.TokenInfo, error)
- func (client *BlockScoutAPIClient) GetTokenTotalSupply(addr string) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetTokenTotalSupplyContext(ctx context.Context, addr string) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetTokenTransfers(address string, opts LegacyListOptions) ([]common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTokenTransfersContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTokenV2(ctx context.Context, addressHash string) (*Token, error)
- func (client *BlockScoutAPIClient) GetTotalFees() (*big.Int, error)
- func (client *BlockScoutAPIClient) GetTotalFeesContext(ctx context.Context) (*big.Int, error)
- func (client *BlockScoutAPIClient) GetTotalSupplyNativeCoin() (*big.Float, error)
- func (client *BlockScoutAPIClient) GetTotalSupplyNativeCoinContext(ctx context.Context) (*big.Float, error)
- func (client *BlockScoutAPIClient) GetTransaction(ctx context.Context, txHash string) (*Transaction, error)
- func (client *BlockScoutAPIClient) GetTransactionRawTrace(ctx context.Context, txHash string) (RawTrace, error)
- func (client *BlockScoutAPIClient) GetTransactionStats(ctx context.Context) (*TransactionStats, error)
- func (client *BlockScoutAPIClient) GetTransactionSummary(ctx context.Context, txHash string) (*TransactionSummary, error)
- func (client *BlockScoutAPIClient) GetTransactionsChart(ctx context.Context) (*TransactionsChart, error)
- func (client *BlockScoutAPIClient) GetTxInfo(hash string) (*common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTxInfoContext(ctx context.Context, hash string) (*common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTxList(address string) ([]common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTxListContext(ctx context.Context, address string) ([]common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTxListInternal(address string) ([]common.InternalTransaction, error)
- func (client *BlockScoutAPIClient) GetTxListInternalContext(ctx context.Context, address string) ([]common.InternalTransaction, error)
- func (client *BlockScoutAPIClient) GetTxListInternalWithOptions(address string, opts LegacyListOptions) ([]common.InternalTransaction, error)
- func (client *BlockScoutAPIClient) GetTxListInternalWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.InternalTransaction, error)
- func (client *BlockScoutAPIClient) GetTxListWithOptions(address string, opts LegacyListOptions) ([]common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTxListWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.Transaction, error)
- func (client *BlockScoutAPIClient) GetTxReceiptStatus(hash string) (*common.Status, error)
- func (client *BlockScoutAPIClient) GetTxReceiptStatusContext(ctx context.Context, hash string) (*common.Status, error)
- func (client *BlockScoutAPIClient) GetTxStatus(hash string) (*common.TxStatus, error)
- func (client *BlockScoutAPIClient) GetTxStatusContext(ctx context.Context, hash string) (*common.TxStatus, error)
- func (client *BlockScoutAPIClient) GetUserOperation(ctx context.Context, operationHash string) (*UserOperation, error)
- func (client *BlockScoutAPIClient) GetUserOperationSummary(ctx context.Context, operationHash string) (*UserOperationSummary, error)
- func (client *BlockScoutAPIClient) GetWithdrawalCounters(ctx context.Context) (*WithdrawalCounters, error)
- func (client *BlockScoutAPIClient) GetZilliqaValidator(ctx context.Context, blsPublicKey string) (*ZilliqaValidatorDetailed, error)
- func (client *BlockScoutAPIClient) ListAccountAbstractionAccounts(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionAccount], error)
- func (client *BlockScoutAPIClient) ListAccountAbstractionBundlers(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionBundler], error)
- func (client *BlockScoutAPIClient) ListAccountAbstractionBundles(ctx context.Context, params *PaginationParams) (*PaginatedResponse[AccountAbstractionBundle], error)
- func (client *BlockScoutAPIClient) ListAccountAbstractionFactories(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionFactory], error)
- func (client *BlockScoutAPIClient) ListAccountAbstractionPaymasters(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionPaymaster], error)
- func (client *BlockScoutAPIClient) ListAddressBeaconDeposits(ctx context.Context, addressHash string, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
- func (client *BlockScoutAPIClient) ListAddressBlocksValidated(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[Block], error)
- func (client *BlockScoutAPIClient) ListAddressCeloElectionRewards(ctx context.Context, addressHash string, params *CeloElectionRewardsParams) (*PaginatedResponse[CeloElectionReward], error)
- func (client *BlockScoutAPIClient) ListAddressCoinBalanceHistory(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[CoinBalance], error)
- func (client *BlockScoutAPIClient) ListAddressInternalTransactions(ctx context.Context, addressHash string, ...) (*PaginatedResponse[InternalTransactionV2], error)
- func (client *BlockScoutAPIClient) ListAddressLogs(ctx context.Context, addressHash string, params *ListAddressLogsParams) (*PaginatedResponse[LogV2], error)
- func (client *BlockScoutAPIClient) ListAddressNFTCollections(ctx context.Context, addressHash string, ...) (*PaginatedResponse[NFTCollection], error)
- func (client *BlockScoutAPIClient) ListAddressNFTs(ctx context.Context, addressHash string, params *ListAddressNFTsParams) (*PaginatedResponse[TokenInstance], error)
- func (client *BlockScoutAPIClient) ListAddressTokenTransfers(ctx context.Context, addressHash string, ...) (*PaginatedResponse[TokenTransfer], error)
- func (client *BlockScoutAPIClient) ListAddressTokens(ctx context.Context, addressHash string, params *ListAddressTokensParams) (*PaginatedResponse[AddressTokenBalance], error)
- func (client *BlockScoutAPIClient) ListAddressTransactions(ctx context.Context, addressHash string, params *ListAddressTransactionsParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListAddressWithdrawals(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[Withdrawal], error)
- func (client *BlockScoutAPIClient) ListAddresses(ctx context.Context, params *ListAddressesParams) (*AddressListResponse, error)
- func (client *BlockScoutAPIClient) ListAdvancedFilterMethods(ctx context.Context, params *AdvancedFilterMethodsParams) ([]AdvancedFilterMethod, error)
- func (client *BlockScoutAPIClient) ListAdvancedFilters(ctx context.Context, params *AdvancedFiltersParams) (*AdvancedFilterResponse, error)
- func (client *BlockScoutAPIClient) ListAllTokenTransfers(ctx context.Context, params *ListTokenTransfersParams) (*PaginatedResponse[TokenTransfer], error)
- func (client *BlockScoutAPIClient) ListArbitrumBatchBlocks(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Block], error)
- func (client *BlockScoutAPIClient) ListArbitrumBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListArbitrumBatches(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ArbitrumBatchForList], error)
- func (client *BlockScoutAPIClient) ListArbitrumBatchesByAnyTrustDataHash(ctx context.Context, dataHash string, params *ChainListParams) (*PaginatedResponse[ArbitrumBatchForList], error)
- func (client *BlockScoutAPIClient) ListArbitrumBatchesByEigenDADataHash(ctx context.Context, dataHash string, params *ChainListParams) (*PaginatedResponse[ArbitrumBatchForList], error)
- func (client *BlockScoutAPIClient) ListArbitrumMessages(ctx context.Context, direction string, params *ChainListParams) (*PaginatedResponse[ArbitrumMessage], error)
- func (client *BlockScoutAPIClient) ListArbitrumWithdrawals(ctx context.Context, txHash string, params *SecretParams) ([]ArbitrumWithdrawal, error)
- func (client *BlockScoutAPIClient) ListBeaconDeposits(ctx context.Context, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
- func (client *BlockScoutAPIClient) ListBlockBeaconDeposits(ctx context.Context, blockHashOrNumber string, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
- func (client *BlockScoutAPIClient) ListBlockInternalTransactions(ctx context.Context, blockHashOrNumber string, params *PaginationParams) (*PaginatedResponse[InternalTransactionV2], error)
- func (client *BlockScoutAPIClient) ListBlockTransactions(ctx context.Context, blockHashOrNumber string, params *PaginationParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListBlockWithdrawals(ctx context.Context, blockHashOrNumber string, params *PaginationParams) (*PaginatedResponse[Withdrawal], error)
- func (client *BlockScoutAPIClient) ListBlocks(ctx context.Context, params *ListBlocksParams) (*PaginatedResponse[Block], error)
- func (client *BlockScoutAPIClient) ListCeloEpochElectionRewards(ctx context.Context, number string, rewardType string, ...) (*PaginatedResponse[CeloElectionReward], error)
- func (client *BlockScoutAPIClient) ListCeloEpochs(ctx context.Context, params *CeloEpochsParams) (*PaginatedResponse[CeloEpoch], error)
- func (client *BlockScoutAPIClient) ListExecutionNodeTransactions(ctx context.Context, executionNodeHash string, params *ChainListParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListHotSmartContracts(ctx context.Context, params *HotSmartContractsParams) (*PaginatedResponse[HotSmartContract], error)
- func (client *BlockScoutAPIClient) ListInternalTransactions(ctx context.Context, params *PaginationParams) (*PaginatedResponse[InternalTransactionV2], error)
- func (client *BlockScoutAPIClient) ListMUDWorldSystems(ctx context.Context, world string, params *SecretParams) ([]MUDSystem, error)
- func (client *BlockScoutAPIClient) ListMUDWorldTableRecords(ctx context.Context, world string, tableID string, params *MUDRecordsParams) (*MUDRecordsResponse, error)
- func (client *BlockScoutAPIClient) ListMUDWorldTables(ctx context.Context, world string, params *MUDTablesParams) (*PaginatedResponse[MUDTableWithSchema], error)
- func (client *BlockScoutAPIClient) ListMUDWorlds(ctx context.Context, params *MUDWorldsParams) (*PaginatedResponse[MUDWorld], error)
- func (client *BlockScoutAPIClient) ListMainPageArbitrumCommittedBatches(ctx context.Context, params *SecretParams) ([]ArbitrumBatchForList, error)
- func (client *BlockScoutAPIClient) ListMainPageArbitrumMessagesToRollup(ctx context.Context, params *SecretParams) ([]ArbitrumMinimalMessage, error)
- func (client *BlockScoutAPIClient) ListMainPageBlocks(ctx context.Context, params *PaginationParams) ([]Block, error)
- func (client *BlockScoutAPIClient) ListMainPageOptimismDeposits(ctx context.Context, params *SecretParams) ([]OptimismMainPageDeposit, error)
- func (client *BlockScoutAPIClient) ListMainPageTransactions(ctx context.Context, params *PaginationParams) ([]Transaction, error)
- func (client *BlockScoutAPIClient) ListMainPageWatchlistTransactions(ctx context.Context, params *SecretParams) ([]Transaction, error)
- func (client *BlockScoutAPIClient) ListOptimismBatchBlocks(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Block], error)
- func (client *BlockScoutAPIClient) ListOptimismBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListOptimismBatches(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismBatch], error)
- func (client *BlockScoutAPIClient) ListOptimismDeposits(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismDeposit], error)
- func (client *BlockScoutAPIClient) ListOptimismGames(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismGame], error)
- func (client *BlockScoutAPIClient) ListOptimismOutputRoots(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismOutputRoot], error)
- func (client *BlockScoutAPIClient) ListOptimismWithdrawals(ctx context.Context, params *ChainListParams) (*PaginatedResponse[Withdrawal], error)
- func (client *BlockScoutAPIClient) ListPolygonZkEVMBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListScrollBatchBlocks(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Block], error)
- func (client *BlockScoutAPIClient) ListScrollBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListScrollBatches(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ScrollBatch], error)
- func (client *BlockScoutAPIClient) ListScrollDeposits(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ScrollBridge], error)
- func (client *BlockScoutAPIClient) ListScrollWithdrawals(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ScrollBridge], error)
- func (client *BlockScoutAPIClient) ListSmartContractAuditReports(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[SmartContractAuditReport], error)
- func (client *BlockScoutAPIClient) ListSmartContracts(ctx context.Context, params *ListSmartContractsParams) (*PaginatedResponse[SmartContractListItem], error)
- func (client *BlockScoutAPIClient) ListTokenHolders(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[TokenHolder], error)
- func (client *BlockScoutAPIClient) ListTokenInstanceHolders(ctx context.Context, addressHash string, tokenID string, ...) (*PaginatedResponse[TokenHolder], error)
- func (client *BlockScoutAPIClient) ListTokenInstanceTransfers(ctx context.Context, addressHash string, tokenID string, ...) (*PaginatedResponse[TokenTransfer], error)
- func (client *BlockScoutAPIClient) ListTokenInstances(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[TokenInstance], error)
- func (client *BlockScoutAPIClient) ListTokenTransfers(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[TokenTransfer], error)
- func (client *BlockScoutAPIClient) ListTokens(ctx context.Context, params *ListTokensParams) (*PaginatedResponse[Token], error)
- func (client *BlockScoutAPIClient) ListTransactionBeaconDeposits(ctx context.Context, txHash string, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
- func (client *BlockScoutAPIClient) ListTransactionBlobs(ctx context.Context, txHash string, params *SecretParams) ([]Blob, error)
- func (client *BlockScoutAPIClient) ListTransactionExternalTransactions(ctx context.Context, txHash string, ...) ([]string, error)
- func (client *BlockScoutAPIClient) ListTransactionFHEOperations(ctx context.Context, txHash string, params *TransactionFHEOperationsParams) (*FHEOperationsResponse, error)
- func (client *BlockScoutAPIClient) ListTransactionInternalTransactions(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[InternalTransactionV2], error)
- func (client *BlockScoutAPIClient) ListTransactionLogs(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[LogV2], error)
- func (client *BlockScoutAPIClient) ListTransactionStateChanges(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[StateChange], error)
- func (client *BlockScoutAPIClient) ListTransactionTokenTransfers(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[TokenTransfer], error)
- func (client *BlockScoutAPIClient) ListTransactions(ctx context.Context, params *ListTransactionsParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListUserOperations(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[UserOperationInList], error)
- func (client *BlockScoutAPIClient) ListWatchlistTransactions(ctx context.Context, params *WatchlistTransactionsParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) ListWithdrawals(ctx context.Context, params *PaginationParams) (*PaginatedResponse[Withdrawal], error)
- func (client *BlockScoutAPIClient) ListZilliqaValidators(ctx context.Context, params *ZilliqaValidatorsParams) (*PaginatedResponse[ZilliqaValidator], error)
- func (client *BlockScoutAPIClient) ListZkSyncBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
- func (client *BlockScoutAPIClient) QuerySmartContractReadMethod(ctx context.Context, addressHash string, req QueryReadMethodRequest) ([]SmartContractReadResult, error)
- func (client *BlockScoutAPIClient) QuickSearch(ctx context.Context, params *SearchParams) ([]SearchResult, error)
- func (client *BlockScoutAPIClient) RefetchTokenInstanceMetadata(ctx context.Context, addressHash string, tokenID string, params *SecretParams) (*MetadataRefetchResponse, error)deprecated
- func (client *BlockScoutAPIClient) RefetchTokenInstanceMetadataWithRecaptcha(ctx context.Context, addressHash string, tokenID string, body RecaptchaBody) (*MetadataRefetchResponse, error)
- func (client *BlockScoutAPIClient) RefetchTokenInstancesMetadata(ctx context.Context, addressHash string, params *SecretParams) (*MetadataRefetchResponse, error)
- func (client *BlockScoutAPIClient) Search(ctx context.Context, params *SearchParams) (*PaginatedResponse[SearchResult], error)
- func (client *BlockScoutAPIClient) SearchV1(ctx context.Context, params *SearchV1Params) (*PaginatedResponse[SearchResult], error)
- func (client *BlockScoutAPIClient) SetBaseURL(baseURL string)
- func (client *BlockScoutAPIClient) SetBlockScoutApiUrl(url string)
- func (client *BlockScoutAPIClient) SetBlockScoutApiUrlV2(url string)
- func (client *BlockScoutAPIClient) VerifyContractViaSourcify(address string) (string, error)
- func (client *BlockScoutAPIClient) VerifyContractViaSourcifyContext(ctx context.Context, address string) (string, error)
- func (client *BlockScoutAPIClient) VerifyContractViaSourcifyFiles(address string, files []VerificationFile) (string, error)
- func (client *BlockScoutAPIClient) VerifyContractViaSourcifyFilesContext(ctx context.Context, address string, files []VerificationFile) (string, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaFlattenedCode(ctx context.Context, addressHash string, req VerifyFlattenedCodeRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaMultiPart(ctx context.Context, addressHash string, req VerifyMultiPartRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaSourcify(ctx context.Context, addressHash string, req VerifySourcifyRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaStandardInput(ctx context.Context, addressHash string, req VerifyStandardInputRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaVyperCode(ctx context.Context, addressHash string, req VerifyVyperCodeRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaVyperMultiPart(ctx context.Context, addressHash string, req VerifyVyperMultiPartRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySmartContractViaVyperStandardInput(ctx context.Context, addressHash string, req VerifyVyperStandardInputRequest) (*VerificationResponse, error)
- func (client *BlockScoutAPIClient) VerifySourceCode(params LegacyContractVerificationParams) (string, error)
- func (client *BlockScoutAPIClient) VerifySourceCodeContext(ctx context.Context, params LegacyContractVerificationParams) (string, error)
- func (client *BlockScoutAPIClient) VerifyVyperContract(params LegacyContractVerificationParams) (string, error)
- func (client *BlockScoutAPIClient) VerifyVyperContractContext(ctx context.Context, params LegacyContractVerificationParams) (string, error)
- type BlockUncle
- type CSVExportConfig
- type CSVExportStatus
- type CeloAggregatedElectionReward
- type CeloConfig
- type CeloElectionReward
- type CeloElectionRewardsParams
- type CeloEpoch
- type CeloEpochDetailed
- type CeloEpochsParams
- type ChainListParams
- type CoinBalance
- type CoinBalanceByDay
- type CoinBalanceHistoryByDay
- type CommitmentTransaction
- type DBBackgroundMigrations
- type DecodedInput
- type DecodedInputParam
- type ExternalLibrary
- type FHEOperation
- type FHEOperationInputs
- type FHEOperationsResponse
- type Fee
- type GasPriceDetail
- type GasPrices
- type HotSmartContract
- type HotSmartContractsParams
- type Implementation
- type IndexerConfig
- type InternalTransactionV2
- type JSONRPCURL
- type LegacyBridgedTokenListOptions
- type LegacyContractVerificationParams
- type LegacyListOptions
- type LegacyLogParams
- type LegacyTokenHolder
- type ListAddressInternalTransactionsParams
- type ListAddressLogsParams
- type ListAddressNFTCollectionsParams
- type ListAddressNFTsParams
- type ListAddressTokenTransfersParams
- type ListAddressTokensParams
- type ListAddressTransactionsParams
- type ListAddressesParams
- type ListBlocksParams
- type ListSmartContractsParams
- type ListTokenTransfersParams
- type ListTokensParams
- type ListTransactionsParams
- type LogV2
- type MUDRecord
- type MUDRecordRaw
- type MUDRecordsCountParams
- type MUDRecordsParams
- type MUDRecordsResponse
- type MUDSystem
- type MUDSystemDetails
- type MUDTable
- type MUDTableSchema
- type MUDTableWithSchema
- type MUDTablesParams
- type MUDWorld
- type MUDWorldsParams
- type MainPageIndexingStatus
- type MarketChart
- type MarketChartItem
- type Metadata
- type MetadataRefetchResponse
- type MetadataTag
- type NFTCollection
- type NetworkStats
- type OptimismBatch
- type OptimismBlob
- type OptimismDeposit
- type OptimismGame
- type OptimismMainPageDeposit
- type OptimismOutputRoot
- type Option
- type PaginatedResponse
- type PaginationParams
- type PublicMetricsConfig
- type QueryReadMethodRequest
- type RawTrace
- type RecaptchaBody
- type ScrollBatch
- type ScrollBridge
- type ScrollDataAvailability
- type SearchParams
- type SearchRedirect
- type SearchResult
- type SearchV1Params
- type SecretParams
- type SignedAuthorization
- type SmartContract
- type SmartContractAuditReport
- type SmartContractCounters
- type SmartContractListItem
- type SmartContractMethod
- type SmartContractMethodParam
- type SmartContractReadResult
- type StateChange
- type SuaveWrappedTransaction
- type Tag
- type Token
- type TokenBalance
- type TokenCounters
- type TokenHolder
- type TokenInstance
- type TokenInstanceTransfersCount
- type TokenTotal
- type TokenTransfer
- type Transaction
- type TransactionAction
- type TransactionExternalTransactionsParams
- type TransactionFHEOperationsParams
- type TransactionStats
- type TransactionSummary
- type TransactionsChart
- type TransactionsChartItem
- type UserOperation
- type UserOperationInList
- type UserOperationSummary
- type VerificationConfig
- type VerificationFile
- type VerificationResponse
- type VerifyFlattenedCodeRequest
- type VerifyMultiPartRequest
- type VerifySourcifyRequest
- type VerifyStandardInputRequest
- type VerifyVyperCodeRequest
- type VerifyVyperMultiPartRequest
- type VerifyVyperStandardInputRequest
- type WatchlistName
- type WatchlistTransactionsParams
- type Withdrawal
- type WithdrawalCounters
- type ZilliqaValidator
- type ZilliqaValidatorDetailed
- type ZilliqaValidatorsParams
Examples ¶
Constants ¶
const ( LicenseNone = "none" LicenseUnlicense = "unlicense" LicenseMIT = "mit" LicenseGNUGPLv2 = "gnu_gpl_v2" LicenseGNUGPLv3 = "gnu_gpl_v3" LicenseGNULGPLv21 = "gnu_lgpl_v2_1" LicenseGNULGPLv3 = "gnu_lgpl_v3" LicenseBSD2Clause = "bsd_2_clause" LicenseBSD3Clause = "bsd_3_clause" LicenseMPL20 = "mpl_2_0" LicenseOSL30 = "osl_3_0" LicenseApache20 = "apache_2_0" LicenseGNUAGPLv3 = "gnu_agpl_v3" LicenseBSL11 = "bsl_1_1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ABIEntry ¶ added in v0.2.0
type ABIEntry struct {
Type string `json:"type"`
Name string `json:"name,omitempty"`
Inputs []ABIParam `json:"inputs,omitempty"`
Outputs []ABIParam `json:"outputs,omitempty"`
StateMutability string `json:"stateMutability,omitempty"`
Anonymous bool `json:"anonymous,omitempty"`
}
ABIEntry describes the Blockscout ABI entry shape.
type ABIParam ¶ added in v0.2.0
type ABIParam struct {
InternalType string `json:"internalType,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type"`
Components []ABIParam `json:"components,omitempty"`
Indexed *bool `json:"indexed,omitempty"`
}
ABIParam describes the Blockscout ABI parameter shape.
type APIError ¶ added in v0.2.0
APIError describes a non-2xx HTTP response from a Blockscout endpoint.
type AccountAbstractionAccount ¶ added in v0.2.0
type AccountAbstractionAccount struct {
Address Address `json:"address"`
Factory *Address `json:"factory"`
TotalOps int `json:"total_ops"`
}
AccountAbstractionAccount describes the Blockscout account abstraction account shape.
type AccountAbstractionBundle ¶ added in v0.2.0
type AccountAbstractionBundle struct {
TransactionHash string `json:"transaction_hash"`
BundleIndex int `json:"bundle_index"`
Bundler Address `json:"bundler"`
TotalOps int `json:"total_ops"`
BlockNumber json.Number `json:"block_number"`
Timestamp *string `json:"timestamp"`
}
AccountAbstractionBundle describes the Blockscout account abstraction bundle shape.
type AccountAbstractionBundler ¶ added in v0.2.0
type AccountAbstractionBundler struct {
Address Address `json:"address"`
TotalBundles int `json:"total_bundles"`
TotalOps int `json:"total_ops"`
}
AccountAbstractionBundler describes the Blockscout account abstraction bundler shape.
type AccountAbstractionFactory ¶ added in v0.2.0
type AccountAbstractionFactory struct {
Address Address `json:"address"`
TotalAccounts int `json:"total_accounts"`
}
AccountAbstractionFactory describes the Blockscout account abstraction factory shape.
type AccountAbstractionParams ¶ added in v0.2.0
type AccountAbstractionParams struct {
Sender string `query:"sender,omitempty"`
Bundler string `query:"bundler,omitempty"`
Paymaster string `query:"paymaster,omitempty"`
Factory string `query:"factory,omitempty"`
TransactionHash string `query:"transaction_hash,omitempty"`
EntryPoint string `query:"entry_point,omitempty"`
PageSize *int `query:"page_size,omitempty"`
PageToken string `query:"page_token,omitempty"`
Sort string `query:"sort,omitempty"`
Order string `query:"order,omitempty"`
}
AccountAbstractionParams contains query parameters for account abstraction.
type AccountAbstractionPaymaster ¶ added in v0.2.0
type AccountAbstractionPaymaster struct {
Address Address `json:"address"`
TotalOps int `json:"total_ops"`
}
AccountAbstractionPaymaster describes the Blockscout account abstraction paymaster shape.
type AccountAbstractionStatus ¶ added in v0.2.0
type AccountAbstractionStatus struct {
FinishedPastIndexing bool `json:"finished_past_indexing"`
V06 AccountAbstractionVersionStatus `json:"v06"`
V07V08 AccountAbstractionVersionStatus `json:"v07_v08"`
}
AccountAbstractionStatus describes the Blockscout account abstraction status shape.
func (*AccountAbstractionStatus) UnmarshalJSON ¶ added in v0.2.0
func (s *AccountAbstractionStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the value from JSON.
type AccountAbstractionVersionStatus ¶ added in v0.2.0
type AccountAbstractionVersionStatus struct {
Enabled bool `json:"enabled"`
Live bool `json:"live"`
PastDBLogsIndexingFinished bool `json:"past_db_logs_indexing_finished"`
PastRPCLogsIndexingFinished bool `json:"past_rpc_logs_indexing_finished"`
}
AccountAbstractionVersionStatus describes the Blockscout account abstraction version status shape.
type AdditionalSource ¶ added in v0.2.0
type AdditionalSource struct {
FilePath string `json:"file_path"`
SourceCode string `json:"source_code"`
}
AdditionalSource describes the Blockscout additional source shape.
type Address ¶ added in v0.2.0
type Address struct {
Hash string `json:"hash"`
IsContract *bool `json:"is_contract"`
IsScam bool `json:"is_scam"`
IsVerified bool `json:"is_verified"`
Name *string `json:"name"`
ENSDomainName *string `json:"ens_domain_name"`
ProxyType *string `json:"proxy_type"`
Implementations []Implementation `json:"implementations"`
Metadata *Metadata `json:"metadata"`
PrivateTags []Tag `json:"private_tags"`
PublicTags []Tag `json:"public_tags"`
WatchlistNames []WatchlistName `json:"watchlist_names"`
}
Address describes the Blockscout address shape.
type AddressCounters ¶ added in v0.2.0
type AddressCounters struct {
TransactionsCount string `json:"transactions_count"`
TokenTransfersCount string `json:"token_transfers_count"`
GasUsageCount string `json:"gas_usage_count"`
ValidationsCount string `json:"validations_count"`
}
AddressCounters describes the Blockscout address counters shape.
type AddressDetail ¶ added in v0.2.0
type AddressDetail struct {
Address
CoinBalance string `json:"coin_balance"`
ExchangeRate *string `json:"exchange_rate"`
BlockNumberBalanceUpdatedAt *int `json:"block_number_balance_updated_at"`
CreatorAddressHash *string `json:"creator_address_hash"`
CreationTransactionHash *string `json:"creation_transaction_hash"`
CreationStatus *string `json:"creation_status"`
Token *Token `json:"token"`
HasValidatedBlocks bool `json:"has_validated_blocks"`
HasLogs bool `json:"has_logs"`
HasTokens bool `json:"has_tokens"`
HasTokenTransfers bool `json:"has_token_transfers"`
HasBeaconChainWithdrawals bool `json:"has_beacon_chain_withdrawals"`
WatchlistAddressID *int `json:"watchlist_address_id"`
}
AddressDetail describes the Blockscout address detail shape.
type AddressListItem ¶ added in v0.2.0
type AddressListItem struct {
Address
CoinBalance string `json:"coin_balance"`
ExchangeRate *string `json:"exchange_rate"`
TransactionsCount string `json:"transactions_count"`
TokenHoldingsCount *int `json:"token_holdings_count"`
}
AddressListItem represents one address list item returned by Blockscout.
type AddressListResponse ¶ added in v0.2.0
type AddressListResponse = PaginatedResponse[AddressListItem]
AddressListResponse is the documented /addresses response, including native coin metadata and paginated address items.
type AddressTabsCounters ¶ added in v0.2.0
type AddressTabsCounters struct {
TransactionsCount int `json:"transactions_count"`
InternalTransactionsCount int `json:"internal_transactions_count"`
TokenTransfersCount int `json:"token_transfers_count"`
TokenBalancesCount int `json:"token_balances_count"`
LogsCount int `json:"logs_count"`
ValidationsCount int `json:"validations_count"`
WithdrawalsCount int `json:"withdrawals_count"`
BeaconDepositsCount int `json:"beacon_deposits_count"`
CeloElectionRewardsCount int `json:"celo_election_rewards_count"`
}
AddressTabsCounters describes the Blockscout address tabs counters shape.
type AddressTokenBalance ¶ added in v0.2.0
type AddressTokenBalance struct {
Token Token `json:"token"`
Value string `json:"value"`
TokenID *string `json:"token_id"`
TokenInstance *TokenInstance `json:"token_instance"`
}
AddressTokenBalance describes the Blockscout address token balance shape.
type AdvancedFilterItem ¶ added in v0.2.0
type AdvancedFilterItem struct {
BlockNumber int `json:"block_number"`
CreatedContract *Address `json:"created_contract"`
Fee string `json:"fee"`
From *Address `json:"from"`
Hash string `json:"hash"`
InternalTransactionIndex *int `json:"internal_transaction_index"`
Method *string `json:"method"`
Status string `json:"status"`
Timestamp string `json:"timestamp"`
To *Address `json:"to"`
Token *Token `json:"token"`
TokenTransferBatchIndex *int `json:"token_transfer_batch_index"`
TokenTransferIndex *int `json:"token_transfer_index"`
Total *TokenTotal `json:"total"`
TransactionIndex int `json:"transaction_index"`
Type string `json:"type"`
Value *string `json:"value"`
}
AdvancedFilterItem represents one advanced filter item returned by Blockscout.
type AdvancedFilterMethod ¶ added in v0.2.0
AdvancedFilterMethod describes the Blockscout advanced filter method shape.
type AdvancedFilterMethodsParams ¶ added in v0.2.0
type AdvancedFilterMethodsParams struct {
Q string `query:"q,omitempty"`
}
AdvancedFilterMethodsParams contains query parameters for advanced filter methods.
type AdvancedFilterResponse ¶ added in v0.2.0
type AdvancedFilterResponse struct {
Items []AdvancedFilterItem `json:"items"`
NextPageParams map[string]any `json:"next_page_params"`
SearchParams AdvancedFilterSearchParams `json:"search_params"`
}
AdvancedFilterResponse contains the Blockscout response for advanced filter.
func (*AdvancedFilterResponse) ApplyNextPage ¶ added in v0.2.0
func (r *AdvancedFilterResponse) ApplyNextPage(params any) error
ApplyNextPage copies next-page cursor parameters into params.
func (*AdvancedFilterResponse) HasNextPage ¶ added in v0.2.0
func (r *AdvancedFilterResponse) HasNextPage() bool
HasNextPage reports whether the response includes cursor parameters for another page.
type AdvancedFilterSearchParams ¶ added in v0.2.0
type AdvancedFilterSearchParams struct {
TransactionTypes []string `json:"transaction_types"`
Methods map[string]any `json:"methods"`
}
AdvancedFilterSearchParams contains query parameters for advanced filter search.
type AdvancedFiltersParams ¶ added in v0.2.0
type AdvancedFiltersParams struct {
TransactionTypes string `query:"transaction_types,omitempty"`
Methods string `query:"methods,omitempty"`
AgeFrom string `query:"age_from,omitempty"`
AgeTo string `query:"age_to,omitempty"`
FromAddressHashesToInclude string `query:"from_address_hashes_to_include,omitempty"`
FromAddressHashesToExclude string `query:"from_address_hashes_to_exclude,omitempty"`
ToAddressHashesToInclude string `query:"to_address_hashes_to_include,omitempty"`
ToAddressHashesToExclude string `query:"to_address_hashes_to_exclude,omitempty"`
AmountFrom string `query:"amount_from,omitempty"`
AmountTo string `query:"amount_to,omitempty"`
TokenContractAddressHash string `query:"token_contract_address_hash,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
TransactionIndex *int `query:"transaction_index,omitempty"`
InternalTransactionIndex *int `query:"internal_transaction_index,omitempty"`
TokenTransferIndex *int `query:"token_transfer_index,omitempty"`
TokenTransferBatchIndex *int `query:"token_transfer_batch_index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
AdvancedFiltersParams contains query parameters for advanced filters.
type ArbitrumBatch ¶ added in v0.2.0
type ArbitrumBatch struct {
AfterAccHash string `json:"after_acc_hash"`
BeforeAccHash string `json:"before_acc_hash"`
CommitmentTransaction CommitmentTransaction `json:"commitment_transaction"`
DataAvailability ArbitrumDataAvailability `json:"data_availability"`
EndBlockNumber int `json:"end_block_number"`
Number int `json:"number"`
StartBlockNumber int `json:"start_block_number"`
TransactionsCount int `json:"transactions_count"`
}
ArbitrumBatch describes the Blockscout Arbitrum batch shape.
type ArbitrumBatchForList ¶ added in v0.2.0
type ArbitrumBatchForList struct {
BatchDataContainer *string `json:"batch_data_container"`
BlocksCount int `json:"blocks_count"`
CommitmentTransaction CommitmentTransaction `json:"commitment_transaction"`
Number int `json:"number"`
TransactionsCount int `json:"transactions_count"`
}
ArbitrumBatchForList describes the Blockscout Arbitrum batch for list shape.
type ArbitrumClaimMessage ¶ added in v0.2.0
type ArbitrumClaimMessage struct {
Calldata string `json:"calldata"`
OutboxAddressHash string `json:"outbox_address_hash"`
}
ArbitrumClaimMessage describes the Blockscout Arbitrum claim message shape.
type ArbitrumDASigner ¶ added in v0.2.0
type ArbitrumDASigner struct {
Key string `json:"key"`
Proof *string `json:"proof"`
Trusted bool `json:"trusted"`
}
ArbitrumDASigner describes the Blockscout Arbitrum DA signer shape.
type ArbitrumDataAvailability ¶ added in v0.2.0
type ArbitrumDataAvailability struct {
BatchDataContainer *string `json:"batch_data_container"`
BLSSignature *string `json:"bls_signature"`
BlobHeader *string `json:"blob_header"`
BlobVerificationProof *string `json:"blob_verification_proof"`
DataHash *string `json:"data_hash"`
Height *int `json:"height"`
Signers []ArbitrumDASigner `json:"signers"`
Timeout *string `json:"timeout"`
TransactionCommitment *string `json:"transaction_commitment"`
}
ArbitrumDataAvailability describes the Blockscout Arbitrum data availability shape.
type ArbitrumMessage ¶ added in v0.2.0
type ArbitrumMessage struct {
CompletionTransactionHash *string `json:"completion_transaction_hash"`
ID int `json:"id"`
OriginationAddressHash *string `json:"origination_address_hash"`
OriginationTimestamp *string `json:"origination_timestamp"`
OriginationTransactionBlockNumber *int `json:"origination_transaction_block_number"`
OriginationTransactionHash *string `json:"origination_transaction_hash"`
Status string `json:"status"`
}
ArbitrumMessage describes the Blockscout Arbitrum message shape.
type ArbitrumMinimalMessage ¶ added in v0.2.0
type ArbitrumMinimalMessage struct {
CompletionTransactionHash *string `json:"completion_transaction_hash"`
OriginationTimestamp *string `json:"origination_timestamp"`
OriginationTransactionBlockNumber *int `json:"origination_transaction_block_number"`
OriginationTransactionHash *string `json:"origination_transaction_hash"`
}
ArbitrumMinimalMessage describes the Blockscout Arbitrum minimal message shape.
type ArbitrumTransaction ¶ added in v0.2.0
type ArbitrumTransaction struct {
BatchDataContainer *string `json:"batch_data_container"`
BatchNumber *int `json:"batch_number"`
CommitmentTransaction *CommitmentTransaction `json:"commitment_transaction"`
}
ArbitrumTransaction describes the Blockscout Arbitrum transaction shape.
type ArbitrumWithdrawal ¶ added in v0.2.0
type ArbitrumWithdrawal struct {
ArbBlockNumber int `json:"arb_block_number"`
CallerAddressHash string `json:"caller_address_hash"`
CallValue string `json:"callvalue"`
CompletionTransactionHash *string `json:"completion_transaction_hash"`
Data string `json:"data"`
DestinationAddressHash string `json:"destination_address_hash"`
EthBlockNumber int `json:"eth_block_number"`
ID int `json:"id"`
L2Timestamp int `json:"l2_timestamp"`
Status string `json:"status"`
Token *ArbitrumWithdrawalToken `json:"token"`
}
ArbitrumWithdrawal describes the Blockscout Arbitrum withdrawal shape.
type ArbitrumWithdrawalToken ¶ added in v0.2.0
type ArbitrumWithdrawalToken struct {
AddressHash *string `json:"address_hash"`
Amount string `json:"amount"`
Decimals *int `json:"decimals"`
DestinationAddressHash *string `json:"destination_address_hash"`
Name *string `json:"name"`
Symbol *string `json:"symbol"`
}
ArbitrumWithdrawalToken describes the Blockscout Arbitrum withdrawal token shape.
type BackendConfig ¶ added in v0.2.0
type BackendConfig struct {
ChainType *string `json:"chain_type"`
OpenAPISpecFolderName *string `json:"openapi_spec_folder_name"`
}
BackendConfig describes the Blockscout backend config shape.
type BackendVersion ¶ added in v0.2.0
type BackendVersion struct {
Version string `json:"version"`
}
BackendVersion describes the Blockscout backend version shape.
type BeaconDeposit ¶ added in v0.2.0
type BeaconDeposit struct {
Amount string `json:"amount"`
BlockHash string `json:"block_hash"`
BlockNumber int `json:"block_number"`
BlockTimestamp string `json:"block_timestamp"`
FromAddress Address `json:"from_address"`
Index int `json:"index"`
Pubkey string `json:"pubkey"`
Signature string `json:"signature"`
Status string `json:"status"`
TransactionHash string `json:"transaction_hash"`
WithdrawalAddress *Address `json:"withdrawal_address"`
WithdrawalCredentials string `json:"withdrawal_credentials"`
}
BeaconDeposit describes the Blockscout beacon deposit shape.
type BeaconDepositsCount ¶ added in v0.2.0
type BeaconDepositsCount struct {
DepositsCount int `json:"deposits_count"`
}
BeaconDepositsCount describes the Blockscout beacon deposits count shape.
type Blob ¶ added in v0.2.0
type Blob struct {
BlobData string `json:"blob_data"`
Hash string `json:"hash"`
KZGCommitment string `json:"kzg_commitment"`
KZGProof string `json:"kzg_proof"`
}
Blob describes the Blockscout blob shape.
type Block ¶ added in v0.2.0
type Block struct {
Height int `json:"height"`
Timestamp string `json:"timestamp"`
Hash string `json:"hash"`
ParentHash string `json:"parent_hash"`
TransactionsCount int `json:"transactions_count"`
InternalTransactionsCount *int `json:"internal_transactions_count"`
Miner Address `json:"miner"`
Size int `json:"size"`
Difficulty *string `json:"difficulty"`
TotalDifficulty *string `json:"total_difficulty"`
GasUsed string `json:"gas_used"`
GasLimit string `json:"gas_limit"`
GasUsedPercentage float64 `json:"gas_used_percentage"`
GasTargetPercentage float64 `json:"gas_target_percentage"`
Nonce *string `json:"nonce"`
BaseFeePerGas *string `json:"base_fee_per_gas"`
BurntFees *string `json:"burnt_fees"`
BurntFeesPercentage *float64 `json:"burnt_fees_percentage"`
PriorityFee *string `json:"priority_fee"`
TransactionFees string `json:"transaction_fees"`
Type string `json:"type"`
Rewards []BlockReward `json:"rewards"`
UnclesHashes []BlockUncle `json:"uncles_hashes"`
WithdrawalsCount *int `json:"withdrawals_count"`
BlobTransactionsCount *int `json:"blob_transactions_count"`
BlobGasUsed *string `json:"blob_gas_used"`
ExcessBlobGas *string `json:"excess_blob_gas"`
}
Block describes the Blockscout block shape.
type BlockCountdown ¶ added in v0.2.0
type BlockCountdown struct {
CurrentBlock string `json:"current_block"`
CountdownBlock string `json:"countdown_block"`
RemainingBlocks string `json:"remaining_blocks"`
EstimatedTimeInSec string `json:"estimated_time_in_sec"`
}
BlockCountdown describes the Blockscout block countdown shape.
type BlockReward ¶ added in v0.2.0
BlockReward describes the Blockscout block reward shape.
type BlockScoutAPIClient ¶
type BlockScoutAPIClient struct {
// URL API in the format "https://instance_base_url/api".
// Configure before concurrent use.
URL string
// URL APIv2 in the format "https://instance_base_url/api/v2/".
// Configure before concurrent use.
URLv2 string
// contains filtered or unexported fields
}
BlockScoutAPIClient is a client for Blockscout legacy, REST API v2, and ETH RPC endpoints.
A configured client can be used concurrently for requests. Do not mutate URL, URLv2, or call setter methods while requests are in flight.
func New ¶ added in v0.2.0
func New(baseURL string, opts ...Option) *BlockScoutAPIClient
New creates a Blockscout API client for a base explorer or API URL.
Example ¶
package main
import (
"context"
"fmt"
"log"
blockscout "github.com/PositiveSecurity/blockscout-go-api"
"github.com/PositiveSecurity/blockscout-go-api/client"
)
func main() {
api := client.New(blockscout.EthMainnetBase)
address, err := api.GetAddress(context.Background(), "0xd8da6bf26964af9d7eed9e03e53415d37aa96045")
if err != nil {
log.Fatal(err)
}
fmt.Println(address.Hash)
}
Output:
func (*BlockScoutAPIClient) CheckRedirect ¶ added in v0.2.0
func (client *BlockScoutAPIClient) CheckRedirect(ctx context.Context, query string) (*SearchRedirect, error)
CheckRedirect checks redirect.
func (*BlockScoutAPIClient) CheckVerifyStatus ¶ added in v0.2.0
func (client *BlockScoutAPIClient) CheckVerifyStatus(guid string) (string, error)
CheckVerifyStatus returns the legacy source verification status for a GUID.
func (*BlockScoutAPIClient) CheckVerifyStatusContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) CheckVerifyStatusContext(ctx context.Context, guid string) (string, error)
CheckVerifyStatusContext returns the legacy source verification status for a GUID using ctx.
func (*BlockScoutAPIClient) DownloadAddressCeloElectionRewardsCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadAddressCeloElectionRewardsCSV(ctx context.Context, addressHash string, params *CeloElectionRewardsParams) ([]byte, error)
DownloadAddressCeloElectionRewardsCSV downloads address Celo election rewards data in CSV format from Blockscout.
func (*BlockScoutAPIClient) DownloadAddressInternalTransactionsCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadAddressInternalTransactionsCSV(ctx context.Context, addressHash string, params *ListAddressInternalTransactionsParams) ([]byte, error)
DownloadAddressInternalTransactionsCSV downloads address internal transactions data in CSV format from Blockscout.
func (*BlockScoutAPIClient) DownloadAddressLogsCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadAddressLogsCSV(ctx context.Context, addressHash string, params *ListAddressLogsParams) ([]byte, error)
DownloadAddressLogsCSV downloads address logs data in CSV format from Blockscout.
func (*BlockScoutAPIClient) DownloadAddressTokenTransfersCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadAddressTokenTransfersCSV(ctx context.Context, addressHash string, params *ListAddressTokenTransfersParams) ([]byte, error)
DownloadAddressTokenTransfersCSV downloads address token transfers data in CSV format from Blockscout.
func (*BlockScoutAPIClient) DownloadAddressTransactionsCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadAddressTransactionsCSV(ctx context.Context, addressHash string, params *ListAddressTransactionsParams) ([]byte, error)
DownloadAddressTransactionsCSV downloads address transactions data in CSV format from Blockscout.
func (*BlockScoutAPIClient) DownloadAdvancedFiltersCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadAdvancedFiltersCSV(ctx context.Context, params *AdvancedFiltersParams) ([]byte, error)
DownloadAdvancedFiltersCSV downloads advanced filters data in CSV format from Blockscout.
func (*BlockScoutAPIClient) DownloadTokenHoldersCSV ¶ added in v0.2.0
func (client *BlockScoutAPIClient) DownloadTokenHoldersCSV(ctx context.Context, addressHash string, params *PaginationParams) ([]byte, error)
DownloadTokenHoldersCSV downloads token holders data in CSV format from Blockscout.
func (*BlockScoutAPIClient) GetABI ¶
func (client *BlockScoutAPIClient) GetABI(addr string) (string, error)
GetABI returns a verified contract ABI via the legacy API.
func (*BlockScoutAPIClient) GetABIContext ¶ added in v0.2.0
GetABIContext returns a verified contract ABI via the legacy API using ctx.
func (*BlockScoutAPIClient) GetAccountAbstractionAccount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountAbstractionAccount(ctx context.Context, addressHash string) (*AccountAbstractionAccount, error)
GetAccountAbstractionAccount retrieves account abstraction account data from Blockscout.
func (*BlockScoutAPIClient) GetAccountAbstractionBundler ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountAbstractionBundler(ctx context.Context, addressHash string) (*AccountAbstractionBundler, error)
GetAccountAbstractionBundler retrieves account abstraction bundler data from Blockscout.
func (*BlockScoutAPIClient) GetAccountAbstractionFactory ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountAbstractionFactory(ctx context.Context, addressHash string) (*AccountAbstractionFactory, error)
GetAccountAbstractionFactory retrieves account abstraction factory data from Blockscout.
func (*BlockScoutAPIClient) GetAccountAbstractionPaymaster ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountAbstractionPaymaster(ctx context.Context, addressHash string) (*AccountAbstractionPaymaster, error)
GetAccountAbstractionPaymaster retrieves account abstraction paymaster data from Blockscout.
func (*BlockScoutAPIClient) GetAccountAbstractionStatus ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountAbstractionStatus(ctx context.Context) (*AccountAbstractionStatus, error)
GetAccountAbstractionStatus retrieves account abstraction status data from Blockscout.
func (*BlockScoutAPIClient) GetAccountBalance ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountBalance(address string) (*big.Float, error)
GetAccountBalance returns the latest account balance from the legacy balance action.
func (*BlockScoutAPIClient) GetAccountBalanceContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAccountBalanceContext(ctx context.Context, address string) (*big.Float, error)
GetAccountBalanceContext returns the latest account balance from the legacy balance action using ctx.
func (*BlockScoutAPIClient) GetAddress ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAddress(ctx context.Context, addressHash string) (*AddressDetail, error)
GetAddress retrieves address data from Blockscout.
func (*BlockScoutAPIClient) GetAddressCoinBalanceHistoryByDay ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAddressCoinBalanceHistoryByDay(ctx context.Context, addressHash string) (*CoinBalanceHistoryByDay, error)
GetAddressCoinBalanceHistoryByDay retrieves address coin balance history by day data from Blockscout.
func (*BlockScoutAPIClient) GetAddressCounters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAddressCounters(ctx context.Context, addressHash string) (*AddressCounters, error)
GetAddressCounters retrieves address counters data from Blockscout.
func (*BlockScoutAPIClient) GetAddressTabsCounters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAddressTabsCounters(ctx context.Context, addressHash string) (*AddressTabsCounters, error)
GetAddressTabsCounters retrieves address tabs counters data from Blockscout.
func (*BlockScoutAPIClient) GetAddressTokenBalances ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetAddressTokenBalances(ctx context.Context, addressHash string) ([]TokenBalance, error)
GetAddressTokenBalances retrieves address token balances data from Blockscout.
func (*BlockScoutAPIClient) GetArbitrumBatch ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetArbitrumBatch(ctx context.Context, batchNumber int, params *SecretParams) (*ArbitrumBatch, error)
GetArbitrumBatch retrieves Arbitrum batch data from Blockscout.
func (*BlockScoutAPIClient) GetArbitrumBatchByCelestiaDA ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetArbitrumBatchByCelestiaDA(ctx context.Context, height int, transactionCommitment string, params *SecretParams) (*ArbitrumBatch, error)
GetArbitrumBatchByCelestiaDA retrieves Arbitrum batch by Celestia DA data from Blockscout.
func (*BlockScoutAPIClient) GetArbitrumBatchesCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetArbitrumBatchesCount(ctx context.Context, params *SecretParams) (int, error)
GetArbitrumBatchesCount retrieves Arbitrum batches count data from Blockscout.
func (*BlockScoutAPIClient) GetArbitrumClaimMessage ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetArbitrumClaimMessage(ctx context.Context, messageID int, params *SecretParams) (*ArbitrumClaimMessage, error)
GetArbitrumClaimMessage retrieves Arbitrum claim message data from Blockscout.
func (*BlockScoutAPIClient) GetArbitrumMessagesCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetArbitrumMessagesCount(ctx context.Context, direction string, params *SecretParams) (int, error)
GetArbitrumMessagesCount retrieves Arbitrum messages count data from Blockscout.
func (*BlockScoutAPIClient) GetBackendConfig ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBackendConfig(ctx context.Context) (*BackendConfig, error)
GetBackendConfig retrieves backend config data from Blockscout.
func (*BlockScoutAPIClient) GetBackendVersion ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBackendVersion(ctx context.Context) (*BackendVersion, error)
GetBackendVersion retrieves backend version data from Blockscout.
func (*BlockScoutAPIClient) GetBalance
deprecated
GetBalance returns an account balance from the legacy balance action.
Deprecated: use GetAccountBalance. The block argument is kept for source compatibility and is ignored because Blockscout's balance action does not accept a block parameter. Use GetEthBalance for eth_get_balance at a block.
func (*BlockScoutAPIClient) GetBalanceContext
deprecated
added in
v0.2.0
func (client *BlockScoutAPIClient) GetBalanceContext(ctx context.Context, address string, block uint64) (*big.Float, error)
GetBalanceContext returns an account balance from the legacy balance action using ctx.
Deprecated: use GetAccountBalanceContext. The block argument is kept for source compatibility and is ignored because Blockscout's balance action does not accept a block parameter. Use GetEthBalanceContext for eth_get_balance at a block.
func (*BlockScoutAPIClient) GetBalanceEthRpc ¶
func (client *BlockScoutAPIClient) GetBalanceEthRpc(addr string) (*common.Response, error)
GetBalanceEthRpc returns the latest balance through Blockscout's ETH RPC proxy.
func (*BlockScoutAPIClient) GetBalanceEthRpcContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBalanceEthRpcContext(ctx context.Context, addr string) (*common.Response, error)
GetBalanceEthRpcContext returns the latest balance through Blockscout's ETH RPC proxy using ctx.
func (*BlockScoutAPIClient) GetBalanceMulti ¶
func (client *BlockScoutAPIClient) GetBalanceMulti(addrs []string) ([]common.BalanceMulti, error)
GetBalanceMulti returns balances for up to 20 addresses via the legacy API.
func (*BlockScoutAPIClient) GetBalanceMultiContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBalanceMultiContext(ctx context.Context, addrs []string) ([]common.BalanceMulti, error)
GetBalanceMultiContext returns balances for up to 20 addresses via the legacy API using ctx.
func (*BlockScoutAPIClient) GetBeaconDepositsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBeaconDepositsCount(ctx context.Context) (*BeaconDepositsCount, error)
GetBeaconDepositsCount retrieves beacon deposits count data from Blockscout.
func (*BlockScoutAPIClient) GetBlock ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBlock(ctx context.Context, blockHashOrNumber string) (*Block, error)
GetBlock retrieves block data from Blockscout.
func (*BlockScoutAPIClient) GetBlockByTime ¶
func (client *BlockScoutAPIClient) GetBlockByTime(timestamp uint64, closest string) (*common.BlockNumber, error)
GetBlockByTime returns the closest block number for a Unix timestamp.
func (*BlockScoutAPIClient) GetBlockByTimeContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBlockByTimeContext(ctx context.Context, timestamp uint64, closest string) (*common.BlockNumber, error)
GetBlockByTimeContext returns the closest block number for a Unix timestamp using ctx.
func (*BlockScoutAPIClient) GetBlockCountdown ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBlockCountdown(ctx context.Context, blockNumber string) (*BlockCountdown, error)
GetBlockCountdown retrieves block countdown data from Blockscout.
func (*BlockScoutAPIClient) GetBlockInfo ¶
func (client *BlockScoutAPIClient) GetBlockInfo(blockNumberOrHash string) ([]byte, error)
GetBlockInfo returns raw REST API v2 block JSON for a block number or hash.
func (*BlockScoutAPIClient) GetBlockInfoContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBlockInfoContext(ctx context.Context, blockNumberOrHash string) ([]byte, error)
GetBlockInfoContext returns raw REST API v2 block JSON using ctx.
func (*BlockScoutAPIClient) GetBlockRewardRpcApi ¶
func (client *BlockScoutAPIClient) GetBlockRewardRpcApi(block uint64) (*common.BlockRewardInfo, error)
GetBlockRewardRpcApi returns legacy block reward information for a block.
func (*BlockScoutAPIClient) GetBlockRewardRpcApiContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBlockRewardRpcApiContext(ctx context.Context, block uint64) (*common.BlockRewardInfo, error)
GetBlockRewardRpcApiContext returns legacy block reward information for a block using ctx.
func (*BlockScoutAPIClient) GetBridgedTokenList
deprecated
added in
v0.2.0
func (client *BlockScoutAPIClient) GetBridgedTokenList(opts LegacyListOptions) ([]common.TokenInfo, error)
GetBridgedTokenList returns bridged tokens via the legacy token API when supported.
Deprecated: use GetBridgedTokenListForChain or GetBridgedTokenListWithOptions, because Blockscout's bridgedTokenList action requires chainid.
func (*BlockScoutAPIClient) GetBridgedTokenListContext
deprecated
added in
v0.2.0
func (client *BlockScoutAPIClient) GetBridgedTokenListContext(ctx context.Context, opts LegacyListOptions) ([]common.TokenInfo, error)
GetBridgedTokenListContext returns bridged tokens via the legacy token API when supported using ctx.
Deprecated: use GetBridgedTokenListForChainContext or GetBridgedTokenListWithOptionsContext, because Blockscout's bridgedTokenList action requires chainid.
func (*BlockScoutAPIClient) GetBridgedTokenListForChain ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBridgedTokenListForChain(chainID int, opts LegacyListOptions) ([]common.TokenInfo, error)
GetBridgedTokenListForChain returns bridged tokens for an origin chain id.
func (*BlockScoutAPIClient) GetBridgedTokenListForChainContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBridgedTokenListForChainContext(ctx context.Context, chainID int, opts LegacyListOptions) ([]common.TokenInfo, error)
GetBridgedTokenListForChainContext returns bridged tokens for an origin chain id using ctx.
func (*BlockScoutAPIClient) GetBridgedTokenListWithOptions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBridgedTokenListWithOptions(opts LegacyBridgedTokenListOptions) ([]common.TokenInfo, error)
GetBridgedTokenListWithOptions returns bridged tokens via the legacy token API when supported.
func (*BlockScoutAPIClient) GetBridgedTokenListWithOptionsContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetBridgedTokenListWithOptionsContext(ctx context.Context, opts LegacyBridgedTokenListOptions) ([]common.TokenInfo, error)
GetBridgedTokenListWithOptionsContext returns bridged tokens via the legacy token API when supported using ctx.
func (*BlockScoutAPIClient) GetCSVExport ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCSVExport(ctx context.Context, uuid string) (*CSVExportStatus, error)
GetCSVExport retrieves CSV export data from Blockscout.
func (*BlockScoutAPIClient) GetCSVExportConfig ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCSVExportConfig(ctx context.Context) (*CSVExportConfig, error)
GetCSVExportConfig retrieves CSV export config data from Blockscout.
func (*BlockScoutAPIClient) GetCeloConfig ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCeloConfig(ctx context.Context, params *SecretParams) (*CeloConfig, error)
GetCeloConfig retrieves Celo config data from Blockscout.
func (*BlockScoutAPIClient) GetCeloEpoch ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCeloEpoch(ctx context.Context, number string, params *SecretParams) (*CeloEpochDetailed, error)
GetCeloEpoch retrieves Celo epoch data from Blockscout.
func (*BlockScoutAPIClient) GetCoinPriceUSD ¶
func (client *BlockScoutAPIClient) GetCoinPriceUSD() (*common.CoinPrice, error)
GetCoinPriceUSD returns current native coin price information.
func (*BlockScoutAPIClient) GetCoinPriceUSDContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCoinPriceUSDContext(ctx context.Context) (*common.CoinPrice, error)
GetCoinPriceUSDContext returns current native coin price information using ctx.
func (*BlockScoutAPIClient) GetCoinSupply ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCoinSupply() (*big.Float, error)
GetCoinSupply returns native coin supply as a decimal value.
func (*BlockScoutAPIClient) GetCoinSupplyContext ¶ added in v0.2.0
GetCoinSupplyContext returns native coin supply as a decimal value using ctx.
func (*BlockScoutAPIClient) GetContractInfo ¶
func (client *BlockScoutAPIClient) GetContractInfo(addr string) (*[]common.ContractInfo, error)
GetContractInfo returns verified contract source information via the legacy API.
func (*BlockScoutAPIClient) GetContractInfoContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetContractInfoContext(ctx context.Context, addr string) (*[]common.ContractInfo, error)
GetContractInfoContext returns verified contract source information via the legacy API using ctx.
func (*BlockScoutAPIClient) GetCurrentBlockEthRpc ¶
func (client *BlockScoutAPIClient) GetCurrentBlockEthRpc() (*common.Response, error)
GetCurrentBlockEthRpc returns the current block through Blockscout's ETH RPC proxy.
func (*BlockScoutAPIClient) GetCurrentBlockEthRpcContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCurrentBlockEthRpcContext(ctx context.Context) (*common.Response, error)
GetCurrentBlockEthRpcContext returns the current block through Blockscout's ETH RPC proxy using ctx.
func (*BlockScoutAPIClient) GetCurrentBlockRpcApi ¶
func (client *BlockScoutAPIClient) GetCurrentBlockRpcApi() (*big.Int, error)
GetCurrentBlockRpcApi returns the latest block number via the legacy API.
func (*BlockScoutAPIClient) GetCurrentBlockRpcApiContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetCurrentBlockRpcApiContext(ctx context.Context) (*big.Int, error)
GetCurrentBlockRpcApiContext returns the latest block number via the legacy API using ctx.
func (*BlockScoutAPIClient) GetDBBackgroundMigrations ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetDBBackgroundMigrations(ctx context.Context) (*DBBackgroundMigrations, error)
GetDBBackgroundMigrations retrieves DB background migrations data from Blockscout.
func (*BlockScoutAPIClient) GetEpoch ¶
func (client *BlockScoutAPIClient) GetEpoch(epoch uint64) (common.Epoch, error)
GetEpoch returns Celo epoch information via the legacy API.
func (*BlockScoutAPIClient) GetEpochContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetEpochContext(ctx context.Context, epoch uint64) (common.Epoch, error)
GetEpochContext returns Celo epoch information via the legacy API using ctx.
func (*BlockScoutAPIClient) GetEthBalance ¶
GetEthBalance returns an account balance from the legacy eth_get_balance action.
func (*BlockScoutAPIClient) GetEthBalanceContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetEthBalanceContext(ctx context.Context, address string, block uint64) (*big.Float, error)
GetEthBalanceContext returns an account balance from the legacy eth_get_balance action using ctx.
func (*BlockScoutAPIClient) GetIndexerConfig ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetIndexerConfig(ctx context.Context) (*IndexerConfig, error)
GetIndexerConfig retrieves indexer config data from Blockscout.
func (*BlockScoutAPIClient) GetJSONRPCURL ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetJSONRPCURL(ctx context.Context) (*JSONRPCURL, error)
GetJSONRPCURL retrieves JSON-RPC URL data from Blockscout.
func (*BlockScoutAPIClient) GetLogs ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetLogs(params LegacyLogParams) ([]common.Log, error)
GetLogs returns logs matching legacy log filter parameters.
func (*BlockScoutAPIClient) GetLogsContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetLogsContext(ctx context.Context, params LegacyLogParams) ([]common.Log, error)
GetLogsContext returns logs matching legacy log filter parameters using ctx.
func (*BlockScoutAPIClient) GetMUDWorldSystem ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMUDWorldSystem(ctx context.Context, world string, system string, params *SecretParams) (*MUDSystemDetails, error)
GetMUDWorldSystem retrieves MUD world system data from Blockscout.
func (*BlockScoutAPIClient) GetMUDWorldTableRecord ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMUDWorldTableRecord(ctx context.Context, world string, tableID string, recordID string, params *SecretParams) (*MUDTableWithSchema, error)
GetMUDWorldTableRecord retrieves MUD world table record data from Blockscout.
func (*BlockScoutAPIClient) GetMUDWorldTableRecordsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMUDWorldTableRecordsCount(ctx context.Context, world string, tableID string, params *MUDRecordsCountParams) (int, error)
GetMUDWorldTableRecordsCount retrieves MUD world table records count data from Blockscout.
func (*BlockScoutAPIClient) GetMUDWorldTablesCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMUDWorldTablesCount(ctx context.Context, world string, params *MUDTablesParams) (int, error)
GetMUDWorldTablesCount retrieves MUD world tables count data from Blockscout.
func (*BlockScoutAPIClient) GetMUDWorldsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMUDWorldsCount(ctx context.Context, params *SecretParams) (int, error)
GetMUDWorldsCount retrieves MUD worlds count data from Blockscout.
func (*BlockScoutAPIClient) GetMainPageArbitrumLatestBatchNumber ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMainPageArbitrumLatestBatchNumber(ctx context.Context, params *SecretParams) (int, error)
GetMainPageArbitrumLatestBatchNumber retrieves main page Arbitrum latest batch number data from Blockscout.
func (*BlockScoutAPIClient) GetMainPageIndexingStatus ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMainPageIndexingStatus(ctx context.Context) (*MainPageIndexingStatus, error)
GetMainPageIndexingStatus retrieves main page indexing status data from Blockscout.
func (*BlockScoutAPIClient) GetMarketChart ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMarketChart(ctx context.Context) (*MarketChart, error)
GetMarketChart retrieves market chart data from Blockscout.
func (*BlockScoutAPIClient) GetMinedBlocks ¶
func (client *BlockScoutAPIClient) GetMinedBlocks(address string) ([]common.MinedBlock, error)
GetMinedBlocks returns blocks mined by an address via the legacy API.
func (*BlockScoutAPIClient) GetMinedBlocksContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMinedBlocksContext(ctx context.Context, address string) ([]common.MinedBlock, error)
GetMinedBlocksContext returns blocks mined by an address via the legacy API using ctx.
func (*BlockScoutAPIClient) GetMinedBlocksWithOptions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMinedBlocksWithOptions(address string, opts LegacyListOptions) ([]common.MinedBlock, error)
GetMinedBlocksWithOptions returns mined blocks with legacy pagination options.
func (*BlockScoutAPIClient) GetMinedBlocksWithOptionsContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetMinedBlocksWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.MinedBlock, error)
GetMinedBlocksWithOptionsContext returns mined blocks with legacy pagination options using ctx.
func (*BlockScoutAPIClient) GetNativeCoinSupply ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetNativeCoinSupply() (*big.Int, error)
GetNativeCoinSupply returns native coin supply as a big integer.
func (*BlockScoutAPIClient) GetNativeCoinSupplyContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetNativeCoinSupplyContext(ctx context.Context) (*big.Int, error)
GetNativeCoinSupplyContext returns native coin supply as a big integer using ctx.
func (*BlockScoutAPIClient) GetOptimismBatch ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismBatch(ctx context.Context, number string, params *SecretParams) (*OptimismBatch, error)
GetOptimismBatch retrieves Optimism batch data from Blockscout.
func (*BlockScoutAPIClient) GetOptimismBatchByCelestiaDA ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismBatchByCelestiaDA(ctx context.Context, height string, commitment string, params *SecretParams) (*OptimismBatch, error)
GetOptimismBatchByCelestiaDA retrieves Optimism batch by Celestia DA data from Blockscout.
func (*BlockScoutAPIClient) GetOptimismBatchesCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismBatchesCount(ctx context.Context, params *SecretParams) (int, error)
GetOptimismBatchesCount retrieves Optimism batches count data from Blockscout.
func (*BlockScoutAPIClient) GetOptimismDepositsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismDepositsCount(ctx context.Context, params *SecretParams) (int, error)
GetOptimismDepositsCount retrieves Optimism deposits count data from Blockscout.
func (*BlockScoutAPIClient) GetOptimismGamesCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismGamesCount(ctx context.Context, params *SecretParams) (int, error)
GetOptimismGamesCount retrieves Optimism games count data from Blockscout.
func (*BlockScoutAPIClient) GetOptimismOutputRootsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismOutputRootsCount(ctx context.Context, params *SecretParams) (int, error)
GetOptimismOutputRootsCount retrieves Optimism output roots count data from Blockscout.
func (*BlockScoutAPIClient) GetOptimismWithdrawalsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetOptimismWithdrawalsCount(ctx context.Context, params *SecretParams) (int, error)
GetOptimismWithdrawalsCount retrieves Optimism withdrawals count data from Blockscout.
func (*BlockScoutAPIClient) GetPublicMetricsConfig ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetPublicMetricsConfig(ctx context.Context) (*PublicMetricsConfig, error)
GetPublicMetricsConfig retrieves public metrics config data from Blockscout.
func (*BlockScoutAPIClient) GetScrollBatch ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetScrollBatch(ctx context.Context, number string, params *SecretParams) (*ScrollBatch, error)
GetScrollBatch retrieves Scroll batch data from Blockscout.
func (*BlockScoutAPIClient) GetScrollBatchesCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetScrollBatchesCount(ctx context.Context, params *SecretParams) (int, error)
GetScrollBatchesCount retrieves Scroll batches count data from Blockscout.
func (*BlockScoutAPIClient) GetScrollDepositsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetScrollDepositsCount(ctx context.Context, params *SecretParams) (int, error)
GetScrollDepositsCount retrieves Scroll deposits count data from Blockscout.
func (*BlockScoutAPIClient) GetScrollWithdrawalsCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetScrollWithdrawalsCount(ctx context.Context, params *SecretParams) (int, error)
GetScrollWithdrawalsCount retrieves Scroll withdrawals count data from Blockscout.
func (*BlockScoutAPIClient) GetSecondaryCoinMarketChart ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSecondaryCoinMarketChart(ctx context.Context) (*MarketChart, error)
GetSecondaryCoinMarketChart retrieves secondary coin market chart data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContract ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContract(ctx context.Context, addressHash string) (*SmartContract, error)
GetSmartContract retrieves smart contract data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractABIEntries ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractABIEntries(ctx context.Context, addressHash string) ([]ABIEntry, error)
GetSmartContractABIEntries retrieves smart contract ABI entries data from Blockscout.
Example ¶
package main
import (
"context"
"fmt"
"log"
blockscout "github.com/PositiveSecurity/blockscout-go-api"
"github.com/PositiveSecurity/blockscout-go-api/client"
)
func main() {
api := client.New(blockscout.EthMainnetBase)
abi, err := api.GetSmartContractABIEntries(context.Background(), "0xdac17f958d2ee523a2206206994597c13d831ec7")
if err != nil {
log.Fatal(err)
}
fmt.Println(len(abi) > 0)
}
Output:
func (*BlockScoutAPIClient) GetSmartContractABIRaw ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractABIRaw(ctx context.Context, addressHash string) (json.RawMessage, error)
GetSmartContractABIRaw retrieves smart contract ABI raw data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractCounters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractCounters(ctx context.Context) (*SmartContractCounters, error)
GetSmartContractCounters retrieves smart contract counters data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractLanguages ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractLanguages(ctx context.Context) ([]string, error)
GetSmartContractLanguages retrieves smart contract languages data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractRaw ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractRaw(ctx context.Context, addressHash string) (json.RawMessage, error)
GetSmartContractRaw retrieves smart contract raw data from Blockscout.
Example ¶
package main
import (
"context"
"fmt"
"log"
blockscout "github.com/PositiveSecurity/blockscout-go-api"
"github.com/PositiveSecurity/blockscout-go-api/client"
)
func main() {
api := client.New(blockscout.EthMainnetBase)
raw, err := api.GetSmartContractRaw(context.Background(), "0xdac17f958d2ee523a2206206994597c13d831ec7")
if err != nil {
log.Fatal(err)
}
fmt.Println(len(raw) > 0)
}
Output:
func (*BlockScoutAPIClient) GetSmartContractReadMethods ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractReadMethods(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
GetSmartContractReadMethods retrieves smart contract read methods data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractReadMethodsProxy ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractReadMethodsProxy(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
GetSmartContractReadMethodsProxy retrieves smart contract read methods proxy data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractVerificationConfig ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractVerificationConfig(ctx context.Context) (*VerificationConfig, error)
GetSmartContractVerificationConfig retrieves smart contract verification config data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractWriteMethods ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractWriteMethods(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
GetSmartContractWriteMethods retrieves smart contract write methods data from Blockscout.
func (*BlockScoutAPIClient) GetSmartContractWriteMethodsProxy ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetSmartContractWriteMethodsProxy(ctx context.Context, addressHash string) ([]SmartContractMethod, error)
GetSmartContractWriteMethodsProxy retrieves smart contract write methods proxy data from Blockscout.
func (*BlockScoutAPIClient) GetStats ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetStats(ctx context.Context) (*NetworkStats, error)
GetStats retrieves stats data from Blockscout.
func (*BlockScoutAPIClient) GetToken ¶
func (client *BlockScoutAPIClient) GetToken(addr string) (*common.TokenInfo, error)
GetToken returns token information via the legacy token API.
func (*BlockScoutAPIClient) GetTokenBalance ¶
func (client *BlockScoutAPIClient) GetTokenBalance(account string, tokenAddr string) (*big.Int, error)
GetTokenBalance returns an account token balance via the legacy API.
func (*BlockScoutAPIClient) GetTokenBalanceContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenBalanceContext(ctx context.Context, account string, tokenAddr string) (*big.Int, error)
GetTokenBalanceContext returns an account token balance via the legacy API using ctx.
func (*BlockScoutAPIClient) GetTokenContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenContext(ctx context.Context, addr string) (*common.TokenInfo, error)
GetTokenContext returns token information via the legacy token API using ctx.
func (*BlockScoutAPIClient) GetTokenCounters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenCounters(ctx context.Context, addressHash string) (*TokenCounters, error)
GetTokenCounters retrieves token counters data from Blockscout.
func (*BlockScoutAPIClient) GetTokenHolders ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenHolders(contractAddress string, opts LegacyListOptions) ([]LegacyTokenHolder, error)
GetTokenHolders returns token holders for a contract address via the legacy API.
func (*BlockScoutAPIClient) GetTokenHoldersContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenHoldersContext(ctx context.Context, contractAddress string, opts LegacyListOptions) ([]LegacyTokenHolder, error)
GetTokenHoldersContext returns token holders for a contract address via the legacy API using ctx.
func (*BlockScoutAPIClient) GetTokenInstance ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenInstance(ctx context.Context, addressHash string, tokenID string) (*TokenInstance, error)
GetTokenInstance retrieves token instance data from Blockscout.
func (*BlockScoutAPIClient) GetTokenInstanceTransfersCount ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenInstanceTransfersCount(ctx context.Context, addressHash string, tokenID string) (*TokenInstanceTransfersCount, error)
GetTokenInstanceTransfersCount retrieves token instance transfers count data from Blockscout.
func (*BlockScoutAPIClient) GetTokenList ¶
func (client *BlockScoutAPIClient) GetTokenList(address string) ([]common.TokenInfo, error)
GetTokenList returns tokens held by an address via the legacy API.
func (*BlockScoutAPIClient) GetTokenListContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenListContext(ctx context.Context, address string) ([]common.TokenInfo, error)
GetTokenListContext returns tokens held by an address via the legacy API using ctx.
func (*BlockScoutAPIClient) GetTokenListWithOptions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenListWithOptions(address string, opts LegacyListOptions) ([]common.TokenInfo, error)
GetTokenListWithOptions returns held tokens with legacy pagination options.
func (*BlockScoutAPIClient) GetTokenListWithOptionsContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenListWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.TokenInfo, error)
GetTokenListWithOptionsContext returns held tokens with legacy pagination options using ctx.
func (*BlockScoutAPIClient) GetTokenTotalSupply ¶
func (client *BlockScoutAPIClient) GetTokenTotalSupply(addr string) (*big.Int, error)
GetTokenTotalSupply returns the token total supply via the legacy stats API.
func (*BlockScoutAPIClient) GetTokenTotalSupplyContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenTotalSupplyContext(ctx context.Context, addr string) (*big.Int, error)
GetTokenTotalSupplyContext returns the token total supply via the legacy stats API using ctx.
func (*BlockScoutAPIClient) GetTokenTransfers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenTransfers(address string, opts LegacyListOptions) ([]common.Transaction, error)
GetTokenTransfers returns token transfers for an address via the legacy API.
func (*BlockScoutAPIClient) GetTokenTransfersContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenTransfersContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.Transaction, error)
GetTokenTransfersContext returns token transfers for an address via the legacy API using ctx.
func (*BlockScoutAPIClient) GetTokenV2 ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTokenV2(ctx context.Context, addressHash string) (*Token, error)
GetTokenV2 retrieves token v2 data from Blockscout.
Example ¶
package main
import (
"context"
"fmt"
"log"
blockscout "github.com/PositiveSecurity/blockscout-go-api"
"github.com/PositiveSecurity/blockscout-go-api/client"
)
func main() {
api := client.New(blockscout.EthMainnetBase)
token, err := api.GetTokenV2(context.Background(), "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")
if err != nil {
log.Fatal(err)
}
if token.Symbol != nil {
fmt.Println(*token.Symbol)
}
}
Output:
func (*BlockScoutAPIClient) GetTotalFees ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTotalFees() (*big.Int, error)
GetTotalFees returns total fees for the current UTC day via the legacy stats API.
func (*BlockScoutAPIClient) GetTotalFeesContext ¶ added in v0.2.0
GetTotalFeesContext returns total fees for the current UTC day via the legacy stats API using ctx.
func (*BlockScoutAPIClient) GetTotalSupplyNativeCoin ¶
func (client *BlockScoutAPIClient) GetTotalSupplyNativeCoin() (*big.Float, error)
GetTotalSupplyNativeCoin returns native coin supply via the legacy stats API.
func (*BlockScoutAPIClient) GetTotalSupplyNativeCoinContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTotalSupplyNativeCoinContext(ctx context.Context) (*big.Float, error)
GetTotalSupplyNativeCoinContext returns native coin supply via the legacy stats API using ctx.
func (*BlockScoutAPIClient) GetTransaction ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTransaction(ctx context.Context, txHash string) (*Transaction, error)
GetTransaction retrieves transaction data from Blockscout.
func (*BlockScoutAPIClient) GetTransactionRawTrace ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTransactionRawTrace(ctx context.Context, txHash string) (RawTrace, error)
GetTransactionRawTrace retrieves transaction raw trace data from Blockscout.
func (*BlockScoutAPIClient) GetTransactionStats ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTransactionStats(ctx context.Context) (*TransactionStats, error)
GetTransactionStats retrieves transaction stats data from Blockscout.
func (*BlockScoutAPIClient) GetTransactionSummary ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTransactionSummary(ctx context.Context, txHash string) (*TransactionSummary, error)
GetTransactionSummary retrieves transaction summary data from Blockscout.
func (*BlockScoutAPIClient) GetTransactionsChart ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTransactionsChart(ctx context.Context) (*TransactionsChart, error)
GetTransactionsChart retrieves transactions chart data from Blockscout.
func (*BlockScoutAPIClient) GetTxInfo ¶
func (client *BlockScoutAPIClient) GetTxInfo(hash string) (*common.Transaction, error)
GetTxInfo returns legacy transaction information by hash.
func (*BlockScoutAPIClient) GetTxInfoContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxInfoContext(ctx context.Context, hash string) (*common.Transaction, error)
GetTxInfoContext returns legacy transaction information by hash using ctx.
func (*BlockScoutAPIClient) GetTxList ¶
func (client *BlockScoutAPIClient) GetTxList(address string) ([]common.Transaction, error)
GetTxList returns normal transactions for an address via the legacy API.
func (*BlockScoutAPIClient) GetTxListContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxListContext(ctx context.Context, address string) ([]common.Transaction, error)
GetTxListContext returns normal transactions for an address via the legacy API using ctx.
func (*BlockScoutAPIClient) GetTxListInternal ¶
func (client *BlockScoutAPIClient) GetTxListInternal(address string) ([]common.InternalTransaction, error)
GetTxListInternal returns internal transactions for an address via the legacy API.
func (*BlockScoutAPIClient) GetTxListInternalContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxListInternalContext(ctx context.Context, address string) ([]common.InternalTransaction, error)
GetTxListInternalContext returns internal transactions for an address via the legacy API using ctx.
func (*BlockScoutAPIClient) GetTxListInternalWithOptions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxListInternalWithOptions(address string, opts LegacyListOptions) ([]common.InternalTransaction, error)
GetTxListInternalWithOptions returns internal transactions with legacy pagination options.
func (*BlockScoutAPIClient) GetTxListInternalWithOptionsContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxListInternalWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.InternalTransaction, error)
GetTxListInternalWithOptionsContext returns internal transactions with legacy pagination options using ctx.
func (*BlockScoutAPIClient) GetTxListWithOptions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxListWithOptions(address string, opts LegacyListOptions) ([]common.Transaction, error)
GetTxListWithOptions returns normal transactions with legacy pagination options.
func (*BlockScoutAPIClient) GetTxListWithOptionsContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxListWithOptionsContext(ctx context.Context, address string, opts LegacyListOptions) ([]common.Transaction, error)
GetTxListWithOptionsContext returns normal transactions with legacy pagination options using ctx.
func (*BlockScoutAPIClient) GetTxReceiptStatus ¶
func (client *BlockScoutAPIClient) GetTxReceiptStatus(hash string) (*common.Status, error)
GetTxReceiptStatus returns a transaction receipt status by hash.
func (*BlockScoutAPIClient) GetTxReceiptStatusContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxReceiptStatusContext(ctx context.Context, hash string) (*common.Status, error)
GetTxReceiptStatusContext returns a transaction receipt status by hash using ctx.
func (*BlockScoutAPIClient) GetTxStatus ¶
func (client *BlockScoutAPIClient) GetTxStatus(hash string) (*common.TxStatus, error)
GetTxStatus returns legacy transaction execution status by hash.
func (*BlockScoutAPIClient) GetTxStatusContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetTxStatusContext(ctx context.Context, hash string) (*common.TxStatus, error)
GetTxStatusContext returns legacy transaction execution status by hash using ctx.
func (*BlockScoutAPIClient) GetUserOperation ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetUserOperation(ctx context.Context, operationHash string) (*UserOperation, error)
GetUserOperation retrieves user operation data from Blockscout.
func (*BlockScoutAPIClient) GetUserOperationSummary ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetUserOperationSummary(ctx context.Context, operationHash string) (*UserOperationSummary, error)
GetUserOperationSummary retrieves user operation summary data from Blockscout.
func (*BlockScoutAPIClient) GetWithdrawalCounters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetWithdrawalCounters(ctx context.Context) (*WithdrawalCounters, error)
GetWithdrawalCounters retrieves withdrawal counters data from Blockscout.
func (*BlockScoutAPIClient) GetZilliqaValidator ¶ added in v0.2.0
func (client *BlockScoutAPIClient) GetZilliqaValidator(ctx context.Context, blsPublicKey string) (*ZilliqaValidatorDetailed, error)
GetZilliqaValidator retrieves Zilliqa validator data from Blockscout.
func (*BlockScoutAPIClient) ListAccountAbstractionAccounts ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAccountAbstractionAccounts(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionAccount], error)
ListAccountAbstractionAccounts retrieves a list of account abstraction accounts from Blockscout.
func (*BlockScoutAPIClient) ListAccountAbstractionBundlers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAccountAbstractionBundlers(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionBundler], error)
ListAccountAbstractionBundlers retrieves a list of account abstraction bundlers from Blockscout.
func (*BlockScoutAPIClient) ListAccountAbstractionBundles ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAccountAbstractionBundles(ctx context.Context, params *PaginationParams) (*PaginatedResponse[AccountAbstractionBundle], error)
ListAccountAbstractionBundles retrieves a list of account abstraction bundles from Blockscout.
func (*BlockScoutAPIClient) ListAccountAbstractionFactories ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAccountAbstractionFactories(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionFactory], error)
ListAccountAbstractionFactories retrieves a list of account abstraction factories from Blockscout.
func (*BlockScoutAPIClient) ListAccountAbstractionPaymasters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAccountAbstractionPaymasters(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[AccountAbstractionPaymaster], error)
ListAccountAbstractionPaymasters retrieves a list of account abstraction paymasters from Blockscout.
func (*BlockScoutAPIClient) ListAddressBeaconDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressBeaconDeposits(ctx context.Context, addressHash string, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
ListAddressBeaconDeposits retrieves a list of address beacon deposits from Blockscout.
func (*BlockScoutAPIClient) ListAddressBlocksValidated ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressBlocksValidated(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[Block], error)
ListAddressBlocksValidated retrieves a list of address blocks validated from Blockscout.
func (*BlockScoutAPIClient) ListAddressCeloElectionRewards ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressCeloElectionRewards(ctx context.Context, addressHash string, params *CeloElectionRewardsParams) (*PaginatedResponse[CeloElectionReward], error)
ListAddressCeloElectionRewards retrieves a list of address Celo election rewards from Blockscout.
func (*BlockScoutAPIClient) ListAddressCoinBalanceHistory ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressCoinBalanceHistory(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[CoinBalance], error)
ListAddressCoinBalanceHistory retrieves a list of address coin balance history from Blockscout.
func (*BlockScoutAPIClient) ListAddressInternalTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressInternalTransactions(ctx context.Context, addressHash string, params *ListAddressInternalTransactionsParams) (*PaginatedResponse[InternalTransactionV2], error)
ListAddressInternalTransactions retrieves a list of address internal transactions from Blockscout.
func (*BlockScoutAPIClient) ListAddressLogs ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressLogs(ctx context.Context, addressHash string, params *ListAddressLogsParams) (*PaginatedResponse[LogV2], error)
ListAddressLogs retrieves a list of address logs from Blockscout.
func (*BlockScoutAPIClient) ListAddressNFTCollections ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressNFTCollections(ctx context.Context, addressHash string, params *ListAddressNFTCollectionsParams) (*PaginatedResponse[NFTCollection], error)
ListAddressNFTCollections retrieves a list of address NFT collections from Blockscout.
func (*BlockScoutAPIClient) ListAddressNFTs ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressNFTs(ctx context.Context, addressHash string, params *ListAddressNFTsParams) (*PaginatedResponse[TokenInstance], error)
ListAddressNFTs retrieves a list of address NFTs from Blockscout.
func (*BlockScoutAPIClient) ListAddressTokenTransfers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressTokenTransfers(ctx context.Context, addressHash string, params *ListAddressTokenTransfersParams) (*PaginatedResponse[TokenTransfer], error)
ListAddressTokenTransfers retrieves a list of address token transfers from Blockscout.
func (*BlockScoutAPIClient) ListAddressTokens ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressTokens(ctx context.Context, addressHash string, params *ListAddressTokensParams) (*PaginatedResponse[AddressTokenBalance], error)
ListAddressTokens retrieves a list of address tokens from Blockscout.
func (*BlockScoutAPIClient) ListAddressTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressTransactions(ctx context.Context, addressHash string, params *ListAddressTransactionsParams) (*PaginatedResponse[Transaction], error)
ListAddressTransactions retrieves a list of address transactions from Blockscout.
func (*BlockScoutAPIClient) ListAddressWithdrawals ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddressWithdrawals(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[Withdrawal], error)
ListAddressWithdrawals retrieves a list of address withdrawals from Blockscout.
func (*BlockScoutAPIClient) ListAddresses ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAddresses(ctx context.Context, params *ListAddressesParams) (*AddressListResponse, error)
ListAddresses retrieves a list of addresses from Blockscout.
func (*BlockScoutAPIClient) ListAdvancedFilterMethods ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAdvancedFilterMethods(ctx context.Context, params *AdvancedFilterMethodsParams) ([]AdvancedFilterMethod, error)
ListAdvancedFilterMethods retrieves a list of advanced filter methods from Blockscout.
func (*BlockScoutAPIClient) ListAdvancedFilters ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAdvancedFilters(ctx context.Context, params *AdvancedFiltersParams) (*AdvancedFilterResponse, error)
ListAdvancedFilters retrieves a list of advanced filters from Blockscout.
func (*BlockScoutAPIClient) ListAllTokenTransfers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListAllTokenTransfers(ctx context.Context, params *ListTokenTransfersParams) (*PaginatedResponse[TokenTransfer], error)
ListAllTokenTransfers retrieves a list of all token transfers from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumBatchBlocks ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumBatchBlocks(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Block], error)
ListArbitrumBatchBlocks retrieves a list of Arbitrum batch blocks from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumBatchTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
ListArbitrumBatchTransactions retrieves a list of Arbitrum batch transactions from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumBatches ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumBatches(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ArbitrumBatchForList], error)
ListArbitrumBatches retrieves a list of Arbitrum batches from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumBatchesByAnyTrustDataHash ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumBatchesByAnyTrustDataHash(ctx context.Context, dataHash string, params *ChainListParams) (*PaginatedResponse[ArbitrumBatchForList], error)
ListArbitrumBatchesByAnyTrustDataHash retrieves a list of Arbitrum batches by AnyTrust data hash from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumBatchesByEigenDADataHash ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumBatchesByEigenDADataHash(ctx context.Context, dataHash string, params *ChainListParams) (*PaginatedResponse[ArbitrumBatchForList], error)
ListArbitrumBatchesByEigenDADataHash retrieves a list of Arbitrum batches by EigenDA data hash from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumMessages ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumMessages(ctx context.Context, direction string, params *ChainListParams) (*PaginatedResponse[ArbitrumMessage], error)
ListArbitrumMessages retrieves a list of Arbitrum messages from Blockscout.
func (*BlockScoutAPIClient) ListArbitrumWithdrawals ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListArbitrumWithdrawals(ctx context.Context, txHash string, params *SecretParams) ([]ArbitrumWithdrawal, error)
ListArbitrumWithdrawals retrieves a list of Arbitrum withdrawals from Blockscout.
func (*BlockScoutAPIClient) ListBeaconDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListBeaconDeposits(ctx context.Context, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
ListBeaconDeposits retrieves a list of beacon deposits from Blockscout.
func (*BlockScoutAPIClient) ListBlockBeaconDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListBlockBeaconDeposits(ctx context.Context, blockHashOrNumber string, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
ListBlockBeaconDeposits retrieves a list of block beacon deposits from Blockscout.
func (*BlockScoutAPIClient) ListBlockInternalTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListBlockInternalTransactions(ctx context.Context, blockHashOrNumber string, params *PaginationParams) (*PaginatedResponse[InternalTransactionV2], error)
ListBlockInternalTransactions retrieves a list of block internal transactions from Blockscout.
func (*BlockScoutAPIClient) ListBlockTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListBlockTransactions(ctx context.Context, blockHashOrNumber string, params *PaginationParams) (*PaginatedResponse[Transaction], error)
ListBlockTransactions retrieves a list of block transactions from Blockscout.
func (*BlockScoutAPIClient) ListBlockWithdrawals ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListBlockWithdrawals(ctx context.Context, blockHashOrNumber string, params *PaginationParams) (*PaginatedResponse[Withdrawal], error)
ListBlockWithdrawals retrieves a list of block withdrawals from Blockscout.
func (*BlockScoutAPIClient) ListBlocks ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListBlocks(ctx context.Context, params *ListBlocksParams) (*PaginatedResponse[Block], error)
ListBlocks retrieves a list of blocks from Blockscout.
func (*BlockScoutAPIClient) ListCeloEpochElectionRewards ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListCeloEpochElectionRewards(ctx context.Context, number string, rewardType string, params *CeloElectionRewardsParams) (*PaginatedResponse[CeloElectionReward], error)
ListCeloEpochElectionRewards retrieves a list of Celo epoch election rewards from Blockscout.
func (*BlockScoutAPIClient) ListCeloEpochs ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListCeloEpochs(ctx context.Context, params *CeloEpochsParams) (*PaginatedResponse[CeloEpoch], error)
ListCeloEpochs retrieves a list of Celo epochs from Blockscout.
func (*BlockScoutAPIClient) ListExecutionNodeTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListExecutionNodeTransactions(ctx context.Context, executionNodeHash string, params *ChainListParams) (*PaginatedResponse[Transaction], error)
ListExecutionNodeTransactions retrieves a list of execution node transactions from Blockscout.
func (*BlockScoutAPIClient) ListHotSmartContracts ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListHotSmartContracts(ctx context.Context, params *HotSmartContractsParams) (*PaginatedResponse[HotSmartContract], error)
ListHotSmartContracts retrieves a list of hot smart contracts from Blockscout.
func (*BlockScoutAPIClient) ListInternalTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListInternalTransactions(ctx context.Context, params *PaginationParams) (*PaginatedResponse[InternalTransactionV2], error)
ListInternalTransactions retrieves a list of internal transactions from Blockscout.
func (*BlockScoutAPIClient) ListMUDWorldSystems ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMUDWorldSystems(ctx context.Context, world string, params *SecretParams) ([]MUDSystem, error)
ListMUDWorldSystems retrieves a list of MUD world systems from Blockscout.
func (*BlockScoutAPIClient) ListMUDWorldTableRecords ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMUDWorldTableRecords(ctx context.Context, world string, tableID string, params *MUDRecordsParams) (*MUDRecordsResponse, error)
ListMUDWorldTableRecords retrieves a list of MUD world table records from Blockscout.
func (*BlockScoutAPIClient) ListMUDWorldTables ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMUDWorldTables(ctx context.Context, world string, params *MUDTablesParams) (*PaginatedResponse[MUDTableWithSchema], error)
ListMUDWorldTables retrieves a list of MUD world tables from Blockscout.
func (*BlockScoutAPIClient) ListMUDWorlds ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMUDWorlds(ctx context.Context, params *MUDWorldsParams) (*PaginatedResponse[MUDWorld], error)
ListMUDWorlds retrieves a list of MUD worlds from Blockscout.
func (*BlockScoutAPIClient) ListMainPageArbitrumCommittedBatches ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMainPageArbitrumCommittedBatches(ctx context.Context, params *SecretParams) ([]ArbitrumBatchForList, error)
ListMainPageArbitrumCommittedBatches retrieves a list of main page Arbitrum committed batches from Blockscout.
func (*BlockScoutAPIClient) ListMainPageArbitrumMessagesToRollup ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMainPageArbitrumMessagesToRollup(ctx context.Context, params *SecretParams) ([]ArbitrumMinimalMessage, error)
ListMainPageArbitrumMessagesToRollup retrieves a list of main page Arbitrum messages to rollup from Blockscout.
func (*BlockScoutAPIClient) ListMainPageBlocks ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMainPageBlocks(ctx context.Context, params *PaginationParams) ([]Block, error)
ListMainPageBlocks retrieves a list of main page blocks from Blockscout.
func (*BlockScoutAPIClient) ListMainPageOptimismDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMainPageOptimismDeposits(ctx context.Context, params *SecretParams) ([]OptimismMainPageDeposit, error)
ListMainPageOptimismDeposits retrieves a list of main page Optimism deposits from Blockscout.
func (*BlockScoutAPIClient) ListMainPageTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMainPageTransactions(ctx context.Context, params *PaginationParams) ([]Transaction, error)
ListMainPageTransactions retrieves a list of main page transactions from Blockscout.
func (*BlockScoutAPIClient) ListMainPageWatchlistTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListMainPageWatchlistTransactions(ctx context.Context, params *SecretParams) ([]Transaction, error)
ListMainPageWatchlistTransactions returns the latest watchlist transactions for the authenticated user.
func (*BlockScoutAPIClient) ListOptimismBatchBlocks ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismBatchBlocks(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Block], error)
ListOptimismBatchBlocks retrieves a list of Optimism batch blocks from Blockscout.
func (*BlockScoutAPIClient) ListOptimismBatchTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
ListOptimismBatchTransactions retrieves a list of Optimism batch transactions from Blockscout.
func (*BlockScoutAPIClient) ListOptimismBatches ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismBatches(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismBatch], error)
ListOptimismBatches retrieves a list of Optimism batches from Blockscout.
func (*BlockScoutAPIClient) ListOptimismDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismDeposits(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismDeposit], error)
ListOptimismDeposits retrieves a list of Optimism deposits from Blockscout.
func (*BlockScoutAPIClient) ListOptimismGames ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismGames(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismGame], error)
ListOptimismGames retrieves a list of Optimism games from Blockscout.
func (*BlockScoutAPIClient) ListOptimismOutputRoots ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismOutputRoots(ctx context.Context, params *ChainListParams) (*PaginatedResponse[OptimismOutputRoot], error)
ListOptimismOutputRoots retrieves a list of Optimism output roots from Blockscout.
func (*BlockScoutAPIClient) ListOptimismWithdrawals ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListOptimismWithdrawals(ctx context.Context, params *ChainListParams) (*PaginatedResponse[Withdrawal], error)
ListOptimismWithdrawals retrieves a list of Optimism withdrawals from Blockscout.
func (*BlockScoutAPIClient) ListPolygonZkEVMBatchTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListPolygonZkEVMBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
ListPolygonZkEVMBatchTransactions retrieves a list of Polygon zkEVM batch transactions from Blockscout.
func (*BlockScoutAPIClient) ListScrollBatchBlocks ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListScrollBatchBlocks(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Block], error)
ListScrollBatchBlocks retrieves a list of Scroll batch blocks from Blockscout.
func (*BlockScoutAPIClient) ListScrollBatchTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListScrollBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
ListScrollBatchTransactions retrieves a list of Scroll batch transactions from Blockscout.
func (*BlockScoutAPIClient) ListScrollBatches ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListScrollBatches(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ScrollBatch], error)
ListScrollBatches retrieves a list of Scroll batches from Blockscout.
func (*BlockScoutAPIClient) ListScrollDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListScrollDeposits(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ScrollBridge], error)
ListScrollDeposits retrieves a list of Scroll deposits from Blockscout.
func (*BlockScoutAPIClient) ListScrollWithdrawals ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListScrollWithdrawals(ctx context.Context, params *ChainListParams) (*PaginatedResponse[ScrollBridge], error)
ListScrollWithdrawals retrieves a list of Scroll withdrawals from Blockscout.
func (*BlockScoutAPIClient) ListSmartContractAuditReports ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListSmartContractAuditReports(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[SmartContractAuditReport], error)
ListSmartContractAuditReports retrieves a list of smart contract audit reports from Blockscout.
func (*BlockScoutAPIClient) ListSmartContracts ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListSmartContracts(ctx context.Context, params *ListSmartContractsParams) (*PaginatedResponse[SmartContractListItem], error)
ListSmartContracts retrieves a list of smart contracts from Blockscout.
func (*BlockScoutAPIClient) ListTokenHolders ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTokenHolders(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[TokenHolder], error)
ListTokenHolders retrieves a list of token holders from Blockscout.
func (*BlockScoutAPIClient) ListTokenInstanceHolders ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTokenInstanceHolders(ctx context.Context, addressHash string, tokenID string, params *PaginationParams) (*PaginatedResponse[TokenHolder], error)
ListTokenInstanceHolders retrieves a list of token instance holders from Blockscout.
func (*BlockScoutAPIClient) ListTokenInstanceTransfers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTokenInstanceTransfers(ctx context.Context, addressHash string, tokenID string, params *PaginationParams) (*PaginatedResponse[TokenTransfer], error)
ListTokenInstanceTransfers retrieves a list of token instance transfers from Blockscout.
func (*BlockScoutAPIClient) ListTokenInstances ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTokenInstances(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[TokenInstance], error)
ListTokenInstances retrieves a list of token instances from Blockscout.
func (*BlockScoutAPIClient) ListTokenTransfers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTokenTransfers(ctx context.Context, addressHash string, params *PaginationParams) (*PaginatedResponse[TokenTransfer], error)
ListTokenTransfers retrieves a list of token transfers from Blockscout.
func (*BlockScoutAPIClient) ListTokens ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTokens(ctx context.Context, params *ListTokensParams) (*PaginatedResponse[Token], error)
ListTokens retrieves a list of tokens from Blockscout.
func (*BlockScoutAPIClient) ListTransactionBeaconDeposits ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionBeaconDeposits(ctx context.Context, txHash string, params *ChainListParams) (*PaginatedResponse[BeaconDeposit], error)
ListTransactionBeaconDeposits retrieves a list of transaction beacon deposits from Blockscout.
func (*BlockScoutAPIClient) ListTransactionBlobs ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionBlobs(ctx context.Context, txHash string, params *SecretParams) ([]Blob, error)
ListTransactionBlobs retrieves a list of transaction blobs from Blockscout.
func (*BlockScoutAPIClient) ListTransactionExternalTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionExternalTransactions(ctx context.Context, txHash string, params *TransactionExternalTransactionsParams) ([]string, error)
ListTransactionExternalTransactions retrieves a list of transaction external transactions from Blockscout.
func (*BlockScoutAPIClient) ListTransactionFHEOperations ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionFHEOperations(ctx context.Context, txHash string, params *TransactionFHEOperationsParams) (*FHEOperationsResponse, error)
ListTransactionFHEOperations retrieves a list of transaction FHE operations from Blockscout.
func (*BlockScoutAPIClient) ListTransactionInternalTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionInternalTransactions(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[InternalTransactionV2], error)
ListTransactionInternalTransactions retrieves a list of transaction internal transactions from Blockscout.
func (*BlockScoutAPIClient) ListTransactionLogs ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionLogs(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[LogV2], error)
ListTransactionLogs retrieves a list of transaction logs from Blockscout.
func (*BlockScoutAPIClient) ListTransactionStateChanges ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionStateChanges(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[StateChange], error)
ListTransactionStateChanges retrieves a list of transaction state changes from Blockscout.
func (*BlockScoutAPIClient) ListTransactionTokenTransfers ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactionTokenTransfers(ctx context.Context, txHash string, params *PaginationParams) (*PaginatedResponse[TokenTransfer], error)
ListTransactionTokenTransfers retrieves a list of transaction token transfers from Blockscout.
func (*BlockScoutAPIClient) ListTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListTransactions(ctx context.Context, params *ListTransactionsParams) (*PaginatedResponse[Transaction], error)
ListTransactions retrieves a list of transactions from Blockscout.
Example ¶
package main
import (
"context"
"log"
blockscout "github.com/PositiveSecurity/blockscout-go-api"
"github.com/PositiveSecurity/blockscout-go-api/client"
)
func main() {
api := client.New(blockscout.EthMainnetBase, client.WithAPIKey("optional-key"))
itemsCount := 10
params := &client.ListTransactionsParams{
ItemsCount: &itemsCount,
}
txs, err := api.ListTransactions(context.Background(), params)
if err != nil {
log.Fatal(err)
}
if txs.HasNextPage() {
if err := txs.ApplyNextPage(params); err != nil {
log.Fatal(err)
}
}
}
Output:
func (*BlockScoutAPIClient) ListUserOperations ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListUserOperations(ctx context.Context, params *AccountAbstractionParams) (*PaginatedResponse[UserOperationInList], error)
ListUserOperations retrieves a list of user operations from Blockscout.
func (*BlockScoutAPIClient) ListWatchlistTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListWatchlistTransactions(ctx context.Context, params *WatchlistTransactionsParams) (*PaginatedResponse[Transaction], error)
ListWatchlistTransactions returns transactions from the authenticated user's watchlist.
func (*BlockScoutAPIClient) ListWithdrawals ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListWithdrawals(ctx context.Context, params *PaginationParams) (*PaginatedResponse[Withdrawal], error)
ListWithdrawals retrieves a list of withdrawals from Blockscout.
func (*BlockScoutAPIClient) ListZilliqaValidators ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListZilliqaValidators(ctx context.Context, params *ZilliqaValidatorsParams) (*PaginatedResponse[ZilliqaValidator], error)
ListZilliqaValidators retrieves a list of Zilliqa validators from Blockscout.
func (*BlockScoutAPIClient) ListZkSyncBatchTransactions ¶ added in v0.2.0
func (client *BlockScoutAPIClient) ListZkSyncBatchTransactions(ctx context.Context, batchNumber int, params *ChainListParams) (*PaginatedResponse[Transaction], error)
ListZkSyncBatchTransactions retrieves a list of ZKsync batch transactions from Blockscout.
func (*BlockScoutAPIClient) QuerySmartContractReadMethod ¶ added in v0.2.0
func (client *BlockScoutAPIClient) QuerySmartContractReadMethod(ctx context.Context, addressHash string, req QueryReadMethodRequest) ([]SmartContractReadResult, error)
QuerySmartContractReadMethod queries smart contract read method through Blockscout.
func (*BlockScoutAPIClient) QuickSearch ¶ added in v0.2.0
func (client *BlockScoutAPIClient) QuickSearch(ctx context.Context, params *SearchParams) ([]SearchResult, error)
QuickSearch searches Blockscout data.
func (*BlockScoutAPIClient) RefetchTokenInstanceMetadata
deprecated
added in
v0.2.0
func (client *BlockScoutAPIClient) RefetchTokenInstanceMetadata(ctx context.Context, addressHash string, tokenID string, params *SecretParams) (*MetadataRefetchResponse, error)
RefetchTokenInstanceMetadata triggers metadata refetch for a specific NFT instance.
Deprecated: use RefetchTokenInstanceMetadataWithRecaptcha for explicit request-body semantics. When params.RecaptchaResponse is empty, params.Key is used as a compatibility fallback.
func (*BlockScoutAPIClient) RefetchTokenInstanceMetadataWithRecaptcha ¶ added in v0.2.0
func (client *BlockScoutAPIClient) RefetchTokenInstanceMetadataWithRecaptcha(ctx context.Context, addressHash string, tokenID string, body RecaptchaBody) (*MetadataRefetchResponse, error)
RefetchTokenInstanceMetadataWithRecaptcha triggers metadata refetch for a specific NFT instance.
func (*BlockScoutAPIClient) RefetchTokenInstancesMetadata ¶ added in v0.2.0
func (client *BlockScoutAPIClient) RefetchTokenInstancesMetadata(ctx context.Context, addressHash string, params *SecretParams) (*MetadataRefetchResponse, error)
RefetchTokenInstancesMetadata triggers metadata refetch for an NFT collection.
func (*BlockScoutAPIClient) Search ¶ added in v0.2.0
func (client *BlockScoutAPIClient) Search(ctx context.Context, params *SearchParams) (*PaginatedResponse[SearchResult], error)
Search searches Blockscout data.
func (*BlockScoutAPIClient) SearchV1 ¶ added in v0.2.0
func (client *BlockScoutAPIClient) SearchV1(ctx context.Context, params *SearchV1Params) (*PaginatedResponse[SearchResult], error)
SearchV1 performs unified search through the v1 search endpoint.
func (*BlockScoutAPIClient) SetBaseURL ¶ added in v0.2.0
func (client *BlockScoutAPIClient) SetBaseURL(baseURL string)
SetBaseURL configures legacy and REST API v2 URLs from a base explorer or API URL.
func (*BlockScoutAPIClient) SetBlockScoutApiUrl ¶
func (client *BlockScoutAPIClient) SetBlockScoutApiUrl(url string)
SetBlockScoutApiUrl sets the legacy Etherscan-compatible API URL.
func (*BlockScoutAPIClient) SetBlockScoutApiUrlV2 ¶
func (client *BlockScoutAPIClient) SetBlockScoutApiUrlV2(url string)
SetBlockScoutApiUrlV2 sets the REST API v2 URL.
func (*BlockScoutAPIClient) VerifyContractViaSourcify ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifyContractViaSourcify(address string) (string, error)
VerifyContractViaSourcify starts legacy Sourcify verification for an address.
func (*BlockScoutAPIClient) VerifyContractViaSourcifyContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifyContractViaSourcifyContext(ctx context.Context, address string) (string, error)
VerifyContractViaSourcifyContext starts legacy Sourcify verification for an address using ctx.
func (*BlockScoutAPIClient) VerifyContractViaSourcifyFiles ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifyContractViaSourcifyFiles(address string, files []VerificationFile) (string, error)
VerifyContractViaSourcifyFiles starts legacy Sourcify verification with source and metadata files.
func (*BlockScoutAPIClient) VerifyContractViaSourcifyFilesContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifyContractViaSourcifyFilesContext(ctx context.Context, address string, files []VerificationFile) (string, error)
VerifyContractViaSourcifyFilesContext starts legacy Sourcify verification with source and metadata files using ctx.
func (*BlockScoutAPIClient) VerifySmartContractViaFlattenedCode ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaFlattenedCode(ctx context.Context, addressHash string, req VerifyFlattenedCodeRequest) (*VerificationResponse, error)
VerifySmartContractViaFlattenedCode submits smart contract via flattened code verification to Blockscout.
func (*BlockScoutAPIClient) VerifySmartContractViaMultiPart ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaMultiPart(ctx context.Context, addressHash string, req VerifyMultiPartRequest) (*VerificationResponse, error)
VerifySmartContractViaMultiPart submits smart contract via multi part verification to Blockscout.
func (*BlockScoutAPIClient) VerifySmartContractViaSourcify ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaSourcify(ctx context.Context, addressHash string, req VerifySourcifyRequest) (*VerificationResponse, error)
VerifySmartContractViaSourcify submits smart contract via Sourcify verification to Blockscout.
func (*BlockScoutAPIClient) VerifySmartContractViaStandardInput ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaStandardInput(ctx context.Context, addressHash string, req VerifyStandardInputRequest) (*VerificationResponse, error)
VerifySmartContractViaStandardInput submits smart contract via standard input verification to Blockscout.
Example ¶
package main
import (
"context"
"log"
"strings"
blockscout "github.com/PositiveSecurity/blockscout-go-api"
"github.com/PositiveSecurity/blockscout-go-api/client"
)
func main() {
api := client.New(blockscout.EthMainnetBase)
_, err := api.VerifySmartContractViaStandardInput(context.Background(), "0x...", client.VerifyStandardInputRequest{
CompilerVersion: "v0.8.17+commit.8df45f5f",
ContractName: "Token",
LicenseType: client.LicenseMIT,
File: client.VerificationFile{
Name: "input.json",
Content: strings.NewReader(`{"language":"Solidity","sources":{"Token.sol":{"content":"contract Token {}"}}}`),
},
})
if err != nil {
log.Fatal(err)
}
}
Output:
func (*BlockScoutAPIClient) VerifySmartContractViaVyperCode ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaVyperCode(ctx context.Context, addressHash string, req VerifyVyperCodeRequest) (*VerificationResponse, error)
VerifySmartContractViaVyperCode submits smart contract via Vyper code verification to Blockscout.
func (*BlockScoutAPIClient) VerifySmartContractViaVyperMultiPart ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaVyperMultiPart(ctx context.Context, addressHash string, req VerifyVyperMultiPartRequest) (*VerificationResponse, error)
VerifySmartContractViaVyperMultiPart submits smart contract via Vyper multi part verification to Blockscout.
func (*BlockScoutAPIClient) VerifySmartContractViaVyperStandardInput ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySmartContractViaVyperStandardInput(ctx context.Context, addressHash string, req VerifyVyperStandardInputRequest) (*VerificationResponse, error)
VerifySmartContractViaVyperStandardInput submits smart contract via Vyper standard input verification to Blockscout.
func (*BlockScoutAPIClient) VerifySourceCode ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySourceCode(params LegacyContractVerificationParams) (string, error)
VerifySourceCode starts legacy Solidity source verification.
func (*BlockScoutAPIClient) VerifySourceCodeContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifySourceCodeContext(ctx context.Context, params LegacyContractVerificationParams) (string, error)
VerifySourceCodeContext starts legacy Solidity source verification using ctx.
func (*BlockScoutAPIClient) VerifyVyperContract ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifyVyperContract(params LegacyContractVerificationParams) (string, error)
VerifyVyperContract starts legacy Vyper source verification.
func (*BlockScoutAPIClient) VerifyVyperContractContext ¶ added in v0.2.0
func (client *BlockScoutAPIClient) VerifyVyperContractContext(ctx context.Context, params LegacyContractVerificationParams) (string, error)
VerifyVyperContractContext starts legacy Vyper source verification using ctx.
type BlockUncle ¶ added in v0.2.0
type BlockUncle struct {
Hash string `json:"hash"`
}
BlockUncle describes the Blockscout block uncle shape.
type CSVExportConfig ¶ added in v0.2.0
type CSVExportConfig struct {
Limit *int `json:"limit"`
}
CSVExportConfig describes the Blockscout CSV export config shape.
type CSVExportStatus ¶ added in v0.2.0
CSVExportStatus describes the Blockscout CSV export status shape.
type CeloAggregatedElectionReward ¶ added in v0.2.0
type CeloAggregatedElectionReward struct {
Count int `json:"count"`
Token *Token `json:"token"`
Total string `json:"total"`
}
CeloAggregatedElectionReward describes the Blockscout Celo aggregated election reward shape.
type CeloConfig ¶ added in v0.2.0
type CeloConfig struct {
L2MigrationBlock *int `json:"l2_migration_block"`
}
CeloConfig describes the Blockscout Celo config shape.
type CeloElectionReward ¶ added in v0.2.0
type CeloElectionReward struct {
Account Address `json:"account"`
Amount string `json:"amount"`
AssociatedAccount Address `json:"associated_account"`
BlockHash string `json:"block_hash"`
BlockNumber int `json:"block_number"`
BlockTimestamp string `json:"block_timestamp"`
EpochNumber int `json:"epoch_number"`
Token Token `json:"token"`
Type string `json:"type"`
}
CeloElectionReward describes the Blockscout Celo election reward shape.
type CeloElectionRewardsParams ¶ added in v0.2.0
type CeloElectionRewardsParams struct {
Key string `query:"key,omitempty"`
FromPeriod string `query:"from_period,omitempty"`
ToPeriod string `query:"to_period,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
EpochNumber string `query:"epoch_number,omitempty"`
Amount string `query:"amount,omitempty"`
AccountAddressHash string `query:"account_address_hash,omitempty"`
AssociatedAccountAddressHash string `query:"associated_account_address_hash,omitempty"`
Type string `query:"type,omitempty"`
}
CeloElectionRewardsParams contains query parameters for Celo election rewards.
type CeloEpoch ¶ added in v0.2.0
type CeloEpoch struct {
Distribution map[string]json.RawMessage `json:"distribution"`
EndBlockNumber int `json:"end_block_number"`
IsFinalized bool `json:"is_finalized"`
Number int `json:"number"`
StartBlockNumber int `json:"start_block_number"`
Timestamp *string `json:"timestamp"`
Type string `json:"type"`
}
CeloEpoch describes the Blockscout Celo epoch shape.
type CeloEpochDetailed ¶ added in v0.2.0
type CeloEpochDetailed struct {
CeloEpoch
AggregatedElectionRewards map[string]CeloAggregatedElectionReward `json:"aggregated_election_rewards"`
EndProcessingBlockHash *string `json:"end_processing_block_hash"`
EndProcessingBlockNumber *int `json:"end_processing_block_number"`
StartProcessingBlockHash *string `json:"start_processing_block_hash"`
StartProcessingBlockNumber *int `json:"start_processing_block_number"`
}
CeloEpochDetailed describes the Blockscout Celo epoch detailed shape.
type CeloEpochsParams ¶ added in v0.2.0
type CeloEpochsParams struct {
Key string `query:"key,omitempty"`
Number *int `query:"number,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
CeloEpochsParams contains query parameters for Celo epochs.
type ChainListParams ¶ added in v0.2.0
type ChainListParams struct {
Key string `query:"key,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
Number *int `query:"number,omitempty"`
ID *int `query:"id,omitempty"`
L1BlockNumber *int `query:"l1_block_number,omitempty"`
TransactionHash string `query:"transaction_hash,omitempty"`
}
ChainListParams contains query parameters for chain list.
type CoinBalance ¶ added in v0.2.0
type CoinBalance struct {
TransactionHash *string `json:"transaction_hash"`
BlockNumber int `json:"block_number"`
BlockTimestamp string `json:"block_timestamp"`
Delta string `json:"delta"`
Value string `json:"value"`
}
CoinBalance describes the Blockscout coin balance shape.
type CoinBalanceByDay ¶ added in v0.2.0
CoinBalanceByDay describes the Blockscout coin balance by day shape.
type CoinBalanceHistoryByDay ¶ added in v0.2.0
type CoinBalanceHistoryByDay struct {
Items []CoinBalanceByDay `json:"items"`
Days int `json:"days"`
}
CoinBalanceHistoryByDay describes the Blockscout coin balance history by day shape.
type CommitmentTransaction ¶ added in v0.2.0
type CommitmentTransaction struct {
BlockNumber *int `json:"block_number"`
Hash *string `json:"hash"`
Status *string `json:"status"`
Timestamp *string `json:"timestamp"`
}
CommitmentTransaction describes the Blockscout commitment transaction shape.
type DBBackgroundMigrations ¶ added in v0.2.0
type DBBackgroundMigrations struct {
Completed bool `json:"completed"`
}
DBBackgroundMigrations describes the Blockscout DB background migrations shape.
type DecodedInput ¶ added in v0.2.0
type DecodedInput struct {
MethodID *string `json:"method_id"`
MethodCall *string `json:"method_call"`
Parameters []DecodedInputParam `json:"parameters"`
}
DecodedInput describes the Blockscout decoded input shape.
type DecodedInputParam ¶ added in v0.2.0
type DecodedInputParam struct {
Name string `json:"name"`
Type string `json:"type"`
Value any `json:"value"`
}
DecodedInputParam describes the Blockscout decoded input parameter shape.
type ExternalLibrary ¶ added in v0.2.0
ExternalLibrary describes the Blockscout external library shape.
type FHEOperation ¶ added in v0.2.0
type FHEOperation struct {
BlockNumber int `json:"block_number"`
Caller *Address `json:"caller"`
FHEType string `json:"fhe_type"`
HCUCost int `json:"hcu_cost"`
HCUDepth int `json:"hcu_depth"`
Inputs FHEOperationInputs `json:"inputs"`
IsScalar bool `json:"is_scalar"`
LogIndex int `json:"log_index"`
Operation string `json:"operation"`
Result string `json:"result"`
Type string `json:"type"`
}
FHEOperation describes the Blockscout FHE operation shape.
type FHEOperationInputs ¶ added in v0.2.0
type FHEOperationInputs struct {
Control *string `json:"control"`
CT *string `json:"ct"`
IfFalse *string `json:"if_false"`
IfTrue *string `json:"if_true"`
LHS *string `json:"lhs"`
Plaintext *float64 `json:"plaintext"`
RHS *string `json:"rhs"`
}
FHEOperationInputs describes the Blockscout FHE operation inputs shape.
type FHEOperationsResponse ¶ added in v0.2.0
type FHEOperationsResponse struct {
Items []FHEOperation `json:"items"`
TotalHCU int `json:"total_hcu"`
MaxDepthHCU int `json:"max_depth_hcu"`
OperationCount int `json:"operation_count"`
}
FHEOperationsResponse contains the Blockscout response for FHE operations.
type GasPriceDetail ¶ added in v0.2.0
type GasPriceDetail struct {
Time float64 `json:"time"`
Wei string `json:"wei"`
BaseFee float64 `json:"base_fee"`
FiatPrice *string `json:"fiat_price"`
Price float64 `json:"price"`
PriorityFee float64 `json:"priority_fee"`
PriorityFeeWei string `json:"priority_fee_wei"`
}
GasPriceDetail describes the Blockscout gas price detail shape.
func (*GasPriceDetail) UnmarshalJSON ¶ added in v0.2.0
func (g *GasPriceDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the value from JSON.
type GasPrices ¶ added in v0.2.0
type GasPrices struct {
Slow *GasPriceDetail `json:"slow"`
Average *GasPriceDetail `json:"average"`
Fast *GasPriceDetail `json:"fast"`
}
GasPrices describes the Blockscout gas prices shape.
type HotSmartContract ¶ added in v0.2.0
type HotSmartContract struct {
Balance string `json:"balance"`
TransactionsCount string `json:"transactions_count"`
TotalGasUsed string `json:"total_gas_used"`
ContractAddress Address `json:"contract_address"`
}
HotSmartContract describes the Blockscout hot smart contract shape.
func (*HotSmartContract) UnmarshalJSON ¶ added in v0.2.0
func (h *HotSmartContract) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the value from JSON.
type HotSmartContractsParams ¶ added in v0.2.0
type HotSmartContractsParams struct {
Scale string `query:"scale,omitempty"`
ContractAddressHash string `query:"contract_address_hash,omitempty"`
TotalGasUsed string `query:"total_gas_used,omitempty"`
TransactionsCount *int `query:"transactions_count,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
HotSmartContractsParams contains query parameters for hot smart contracts.
type Implementation ¶ added in v0.2.0
Implementation describes the Blockscout implementation shape.
type IndexerConfig ¶ added in v0.2.0
type IndexerConfig struct {
IndexedBlocksRatio *string `json:"indexed_blocks_ratio"`
FinishedIndexing *bool `json:"finished_indexing"`
FinishedIndexingBlocks *bool `json:"finished_indexing_blocks"`
FinishedIndexingInternalTransactions *bool `json:"finished_indexing_internal_transactions"`
}
IndexerConfig describes the Blockscout indexer config shape.
type InternalTransactionV2 ¶ added in v0.2.0
type InternalTransactionV2 struct {
TransactionHash string `json:"transaction_hash"`
BlockNumber int `json:"block_number"`
Timestamp string `json:"timestamp"`
From Address `json:"from"`
To Address `json:"to"`
CreatedContract *Address `json:"created_contract"`
Value string `json:"value"`
Type string `json:"type"`
Success bool `json:"success"`
Error *string `json:"error"`
GasLimit *string `json:"gas_limit"`
Index int `json:"index"`
BlockIndex int `json:"block_index"`
TransactionIndex int `json:"transaction_index"`
}
InternalTransactionV2 describes the Blockscout internal transaction v2 shape.
type JSONRPCURL ¶ added in v0.2.0
type JSONRPCURL struct {
JSONRPCURL string `json:"json_rpc_url"`
}
JSONRPCURL describes the Blockscout JSON-RPC URL shape.
type LegacyBridgedTokenListOptions ¶ added in v0.2.0
type LegacyBridgedTokenListOptions struct {
LegacyListOptions
ChainID int
}
LegacyBridgedTokenListOptions contains parameters for bridgedTokenList.
type LegacyContractVerificationParams ¶ added in v0.2.0
type LegacyContractVerificationParams struct {
Address string
SourceCode string
ContractName string
CompilerVersion string
CodeFormat string
OptimizationUsed string
Runs string
ConstructorArguments string
AutodetectConstructorArguments string
EVMVersion string
LicenseType string
// Deprecated: use ConstructorArguments.
ConstructorArguements string
}
LegacyContractVerificationParams contains form fields for legacy contract verification.
type LegacyListOptions ¶ added in v0.2.0
LegacyListOptions contains common pagination and ordering options for legacy list endpoints.
type LegacyLogParams ¶ added in v0.2.0
type LegacyLogParams struct {
FromBlock string
ToBlock string
Address string
Topic0 string
Topic1 string
Topic2 string
Topic3 string
Topic0_1Opr string
Topic1_2Opr string
Topic2_3Opr string
Topic0_2Opr string
Topic0_3Opr string
Topic1_3Opr string
}
LegacyLogParams contains filters for the legacy logs endpoint.
type LegacyTokenHolder ¶ added in v0.2.0
LegacyTokenHolder describes a token holder returned by the legacy token API.
type ListAddressInternalTransactionsParams ¶ added in v0.2.0
type ListAddressInternalTransactionsParams struct {
Filter string `query:"filter,omitempty"`
FromPeriod string `query:"from_period,omitempty"`
ToPeriod string `query:"to_period,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
TransactionIndex *int `query:"transaction_index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListAddressInternalTransactionsParams contains query parameters for listing address internal transactions.
type ListAddressLogsParams ¶ added in v0.2.0
type ListAddressLogsParams struct {
Topic string `query:"topic,omitempty"`
FromPeriod string `query:"from_period,omitempty"`
ToPeriod string `query:"to_period,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListAddressLogsParams contains query parameters for listing address logs.
type ListAddressNFTCollectionsParams ¶ added in v0.2.0
type ListAddressNFTCollectionsParams struct {
Type string `query:"type,omitempty"`
TokenContractAddressHash string `query:"token_contract_address_hash,omitempty"`
TokenType string `query:"token_type,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListAddressNFTCollectionsParams contains query parameters for listing address NFT collections.
type ListAddressNFTsParams ¶ added in v0.2.0
type ListAddressNFTsParams struct {
Type string `query:"type,omitempty"`
TokenContractAddressHash string `query:"token_contract_address_hash,omitempty"`
TokenID string `query:"token_id,omitempty"`
TokenType string `query:"token_type,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListAddressNFTsParams contains query parameters for listing address NFTs.
type ListAddressTokenTransfersParams ¶ added in v0.2.0
type ListAddressTokenTransfersParams struct {
Filter string `query:"filter,omitempty"`
Type string `query:"type,omitempty"`
Token string `query:"token,omitempty"`
FromPeriod string `query:"from_period,omitempty"`
ToPeriod string `query:"to_period,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
BatchLogIndex *int `query:"batch_log_index,omitempty"`
BatchBlockHash string `query:"batch_block_hash,omitempty"`
BatchTransactionHash string `query:"batch_transaction_hash,omitempty"`
IndexInBatch *int `query:"index_in_batch,omitempty"`
}
ListAddressTokenTransfersParams contains query parameters for listing address token transfers.
type ListAddressTokensParams ¶ added in v0.2.0
type ListAddressTokensParams struct {
Type string `query:"type,omitempty"`
FiatValue string `query:"fiat_value,omitempty"`
ID *int `query:"id,omitempty"`
Value string `query:"value,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListAddressTokensParams contains query parameters for listing address tokens.
type ListAddressTransactionsParams ¶ added in v0.2.0
type ListAddressTransactionsParams struct {
Filter string `query:"filter,omitempty"`
Sort string `query:"sort,omitempty"`
Order string `query:"order,omitempty"`
FromPeriod string `query:"from_period,omitempty"`
ToPeriod string `query:"to_period,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
InsertedAt string `query:"inserted_at,omitempty"`
Hash string `query:"hash,omitempty"`
Value string `query:"value,omitempty"`
Fee string `query:"fee,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListAddressTransactionsParams contains query parameters for listing address transactions.
type ListAddressesParams ¶ added in v0.2.0
type ListAddressesParams struct {
Sort string `query:"sort,omitempty"`
Order string `query:"order,omitempty"`
FetchedCoinBalance *string `query:"fetched_coin_balance,omitempty"`
Hash string `query:"hash,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
TransactionsCount *int `query:"transactions_count,omitempty"`
}
ListAddressesParams contains query parameters for listing addresses.
type ListBlocksParams ¶ added in v0.2.0
type ListBlocksParams struct {
Type string `query:"type,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListBlocksParams contains query parameters for listing blocks.
type ListSmartContractsParams ¶ added in v0.2.0
type ListSmartContractsParams struct {
Q string `query:"q,omitempty"`
Filter string `query:"filter,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
SmartContractID *int `query:"smart_contract_id,omitempty"`
}
ListSmartContractsParams contains query parameters for listing smart contracts.
type ListTokenTransfersParams ¶ added in v0.2.0
type ListTokenTransfersParams struct {
Type string `query:"type,omitempty"`
Token string `query:"token,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
BatchLogIndex *int `query:"batch_log_index,omitempty"`
BatchBlockHash string `query:"batch_block_hash,omitempty"`
BatchTransactionHash string `query:"batch_transaction_hash,omitempty"`
IndexInBatch *int `query:"index_in_batch,omitempty"`
}
ListTokenTransfersParams contains query parameters for listing token transfers.
type ListTokensParams ¶ added in v0.2.0
type ListTokensParams struct {
Type string `query:"type,omitempty"`
Q string `query:"q,omitempty"`
Sort string `query:"sort,omitempty"`
Order string `query:"order,omitempty"`
ContractAddressHash string `query:"contract_address_hash,omitempty"`
HoldersCount *int `query:"holders_count,omitempty"`
FiatValue string `query:"fiat_value,omitempty"`
MarketCap string `query:"market_cap,omitempty"`
IsNameNull *bool `query:"is_name_null,omitempty"`
Name string `query:"name,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListTokensParams contains query parameters for listing tokens.
type ListTransactionsParams ¶ added in v0.2.0
type ListTransactionsParams struct {
Filter string `query:"filter,omitempty"`
Type string `query:"type,omitempty"`
Method string `query:"method,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
ListTransactionsParams contains query parameters for listing transactions.
type LogV2 ¶ added in v0.2.0
type LogV2 struct {
TransactionHash string `json:"transaction_hash"`
Address Address `json:"address"`
Topics []string `json:"topics"`
Data string `json:"data"`
Index int `json:"index"`
Decoded *DecodedInput `json:"decoded"`
SmartContract *Address `json:"smart_contract"`
BlockHash string `json:"block_hash"`
BlockNumber int `json:"block_number"`
}
LogV2 describes the Blockscout log v2 shape.
type MUDRecord ¶ added in v0.2.0
type MUDRecord struct {
Decoded map[string]json.RawMessage `json:"decoded"`
ID string `json:"id"`
IsDeleted bool `json:"is_deleted"`
Raw MUDRecordRaw `json:"raw"`
Timestamp string `json:"timestamp"`
}
MUDRecord describes the Blockscout MUD record shape.
type MUDRecordRaw ¶ added in v0.2.0
type MUDRecordRaw struct {
BlockNumber string `json:"block_number"`
DynamicData string `json:"dynamic_data"`
EncodedLengths string `json:"encoded_lengths"`
Key0 string `json:"key0"`
Key1 string `json:"key1"`
KeyBytes string `json:"key_bytes"`
LogIndex string `json:"log_index"`
StaticData string `json:"static_data"`
}
MUDRecordRaw describes the Blockscout MUD record raw shape.
type MUDRecordsCountParams ¶ added in v0.2.0
type MUDRecordsCountParams struct {
Key string `query:"key,omitempty"`
FilterKey0 string `query:"filter_key0,omitempty"`
FilterKey1 string `query:"filter_key1,omitempty"`
}
MUDRecordsCountParams contains query parameters for MUD records count.
type MUDRecordsParams ¶ added in v0.2.0
type MUDRecordsParams struct {
Key string `query:"key,omitempty"`
FilterKey0 string `query:"filter_key0,omitempty"`
FilterKey1 string `query:"filter_key1,omitempty"`
Sort string `query:"sort,omitempty"`
Order string `query:"order,omitempty"`
KeyBytes string `query:"key_bytes,omitempty"`
Key0 string `query:"key0,omitempty"`
Key1 string `query:"key1,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
MUDRecordsParams contains query parameters for MUD records.
type MUDRecordsResponse ¶ added in v0.2.0
type MUDRecordsResponse struct {
Items []MUDRecord `json:"items"`
NextPageParams map[string]any `json:"next_page_params"`
Schema MUDTableSchema `json:"schema"`
Table MUDTable `json:"table"`
}
MUDRecordsResponse contains the Blockscout response for MUD records.
type MUDSystemDetails ¶ added in v0.2.0
type MUDSystemDetails struct {
ABI []SmartContractMethod `json:"abi"`
Name string `json:"name"`
}
MUDSystemDetails describes the Blockscout MUD system details shape.
type MUDTable ¶ added in v0.2.0
type MUDTable struct {
TableFullName string `json:"table_full_name"`
TableID string `json:"table_id"`
TableName string `json:"table_name"`
TableNamespace string `json:"table_namespace"`
TableType string `json:"table_type"`
}
MUDTable describes the Blockscout MUD table shape.
type MUDTableSchema ¶ added in v0.2.0
type MUDTableSchema struct {
KeyNames []string `json:"key_names"`
KeyTypes []string `json:"key_types"`
ValueNames []string `json:"value_names"`
ValueTypes []string `json:"value_types"`
}
MUDTableSchema describes the Blockscout MUD table schema shape.
type MUDTableWithSchema ¶ added in v0.2.0
type MUDTableWithSchema struct {
Record *MUDRecord `json:"record"`
Schema MUDTableSchema `json:"schema"`
Table MUDTable `json:"table"`
}
MUDTableWithSchema describes the Blockscout MUD table with schema shape.
type MUDTablesParams ¶ added in v0.2.0
type MUDTablesParams struct {
Key string `query:"key,omitempty"`
Q string `query:"q,omitempty"`
FilterNamespace string `query:"filter_namespace,omitempty"`
TableID string `query:"table_id,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
MUDTablesParams contains query parameters for MUD tables.
type MUDWorld ¶ added in v0.2.0
type MUDWorld struct {
Address Address `json:"address"`
CoinBalance *string `json:"coin_balance"`
TransactionsCount *int `json:"transactions_count"`
}
MUDWorld describes the Blockscout MUD world shape.
type MUDWorldsParams ¶ added in v0.2.0
type MUDWorldsParams struct {
Key string `query:"key,omitempty"`
World string `query:"world,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
MUDWorldsParams contains query parameters for MUD worlds.
type MainPageIndexingStatus ¶ added in v0.2.0
type MainPageIndexingStatus struct {
FinishedIndexingBlocks *bool `json:"finished_indexing_blocks"`
FinishedIndexingInternalTransactions *bool `json:"finished_indexing_internal_transactions"`
IndexedBlocksRatio *string `json:"indexed_blocks_ratio"`
}
MainPageIndexingStatus describes the Blockscout main page indexing status shape.
type MarketChart ¶ added in v0.2.0
type MarketChart struct {
AvailableSupply string `json:"available_supply"`
ChartData []MarketChartItem `json:"chart_data"`
}
MarketChart describes the Blockscout market chart shape.
type MarketChartItem ¶ added in v0.2.0
type MarketChartItem struct {
Date string `json:"date"`
ClosingPrice *string `json:"closing_price"`
MarketCap *string `json:"market_cap"`
TVL *string `json:"tvl"`
SecondaryCoinClosingPrice *string `json:"secondary_coin_closing_price"`
SecondaryCoinMarketCap *string `json:"secondary_coin_market_cap"`
}
MarketChartItem represents one market chart item returned by Blockscout.
type Metadata ¶ added in v0.2.0
type Metadata struct {
Tags []MetadataTag `json:"tags"`
}
Metadata describes the Blockscout metadata shape.
type MetadataRefetchResponse ¶ added in v0.2.0
type MetadataRefetchResponse struct {
Message string `json:"message"`
}
MetadataRefetchResponse describes the result of an NFT metadata refetch request.
type MetadataTag ¶ added in v0.2.0
type MetadataTag struct {
Slug string `json:"slug"`
Name string `json:"name"`
TagType string `json:"tagType"`
Ordinal int `json:"ordinal"`
Meta any `json:"meta"`
}
MetadataTag describes the Blockscout metadata tag shape.
type NFTCollection ¶ added in v0.2.0
type NFTCollection struct {
Token Token `json:"token"`
Amount *string `json:"amount"`
TokenInstances []TokenInstance `json:"token_instances"`
}
NFTCollection describes the Blockscout NFT collection shape.
type NetworkStats ¶ added in v0.2.0
type NetworkStats struct {
AverageBlockTime float64 `json:"average_block_time"`
CoinImage *string `json:"coin_image"`
CoinPrice *string `json:"coin_price"`
CoinPriceChangePercentage *float64 `json:"coin_price_change_percentage"`
GasPriceUpdatedAt string `json:"gas_price_updated_at"`
GasPrices GasPrices `json:"gas_prices"`
GasPricesUpdateIn int `json:"gas_prices_update_in"`
GasUsedToday string `json:"gas_used_today"`
MarketCap string `json:"market_cap"`
NetworkUtilizationPercentage float64 `json:"network_utilization_percentage"`
SecondaryCoinImage *string `json:"secondary_coin_image"`
SecondaryCoinPrice *string `json:"secondary_coin_price"`
StaticGasPrice *string `json:"static_gas_price"`
TotalAddresses string `json:"total_addresses"`
TotalBlocks string `json:"total_blocks"`
TotalGasUsed string `json:"total_gas_used"`
TotalTransactions string `json:"total_transactions"`
TransactionsToday string `json:"transactions_today"`
TVL *string `json:"tvl"`
}
NetworkStats describes the Blockscout network stats shape.
type OptimismBatch ¶ added in v0.2.0
type OptimismBatch struct {
BatchDataContainer *string `json:"batch_data_container"`
Blobs []OptimismBlob `json:"blobs"`
L1Timestamp string `json:"l1_timestamp"`
L1TransactionHashes []string `json:"l1_transaction_hashes"`
L2EndBlockNumber int `json:"l2_end_block_number"`
L2StartBlockNumber int `json:"l2_start_block_number"`
Number int `json:"number"`
TransactionsCount int `json:"transactions_count"`
}
OptimismBatch describes the Blockscout Optimism batch shape.
type OptimismBlob ¶ added in v0.2.0
type OptimismBlob struct {
Cert string `json:"cert"`
Commitment string `json:"commitment"`
Hash string `json:"hash"`
Height int `json:"height"`
L1Timestamp string `json:"l1_timestamp"`
L1TransactionHash string `json:"l1_transaction_hash"`
Namespace string `json:"namespace"`
}
OptimismBlob describes the Blockscout Optimism blob shape.
type OptimismDeposit ¶ added in v0.2.0
type OptimismDeposit struct {
L1BlockNumber int `json:"l1_block_number"`
L1BlockTimestamp string `json:"l1_block_timestamp"`
L1TransactionHash string `json:"l1_transaction_hash"`
L1TransactionOrigin string `json:"l1_transaction_origin"`
L2TransactionGasLimit string `json:"l2_transaction_gas_limit"`
L2TransactionHash string `json:"l2_transaction_hash"`
}
OptimismDeposit describes the Blockscout Optimism deposit shape.
type OptimismGame ¶ added in v0.2.0
type OptimismGame struct {
ContractAddressHash string `json:"contract_address_hash"`
CreatedAt string `json:"created_at"`
GameType int `json:"game_type"`
Index int `json:"index"`
L2BlockNumber int `json:"l2_block_number"`
ResolvedAt *string `json:"resolved_at"`
Status string `json:"status"`
}
OptimismGame describes the Blockscout Optimism game shape.
type OptimismMainPageDeposit ¶ added in v0.2.0
type OptimismMainPageDeposit struct {
L1BlockNumber int `json:"l1_block_number"`
L1BlockTimestamp string `json:"l1_block_timestamp"`
L1TransactionHash string `json:"l1_transaction_hash"`
L2TransactionHash string `json:"l2_transaction_hash"`
}
OptimismMainPageDeposit describes the Blockscout Optimism main page deposit shape.
type OptimismOutputRoot ¶ added in v0.2.0
type OptimismOutputRoot struct {
L1BlockNumber int `json:"l1_block_number"`
L1Timestamp string `json:"l1_timestamp"`
L1TransactionHash string `json:"l1_transaction_hash"`
L2BlockNumber int `json:"l2_block_number"`
L2OutputIndex int `json:"l2_output_index"`
OutputRoot string `json:"output_root"`
}
OptimismOutputRoot describes the Blockscout Optimism output root shape.
type Option ¶ added in v0.2.0
type Option func(*BlockScoutAPIClient)
Option configures a BlockScoutAPIClient created with New.
func WithAPIKey ¶ added in v0.2.0
WithAPIKey adds an API key query parameter to supported requests.
func WithHTTPClient ¶ added in v0.2.0
WithHTTPClient uses a caller-provided HTTP client.
func WithTimeout ¶ added in v0.2.0
WithTimeout configures the HTTP client timeout without mutating a caller-provided HTTP client.
type PaginatedResponse ¶ added in v0.2.0
type PaginatedResponse[T any] struct { Items []T `json:"items"` NextPageParams map[string]any `json:"next_page_params"` ExchangeRate string `json:"exchange_rate,omitempty"` TotalSupply string `json:"total_supply,omitempty"` }
PaginatedResponse is the common REST API v2 list response shape.
func (*PaginatedResponse[T]) ApplyNextPage ¶ added in v0.2.0
func (r *PaginatedResponse[T]) ApplyNextPage(params any) error
ApplyNextPage copies next page parameters into a typed params struct.
func (*PaginatedResponse[T]) HasNextPage ¶ added in v0.2.0
func (r *PaginatedResponse[T]) HasNextPage() bool
HasNextPage reports whether the response includes cursor parameters for another page.
func (*PaginatedResponse[T]) NextQuery ¶ added in v0.2.0
func (r *PaginatedResponse[T]) NextQuery() url.Values
NextQuery converts next page parameters into URL query values.
type PaginationParams ¶ added in v0.2.0
type PaginationParams struct {
AddressHash string `query:"address_hash,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
PageSize *int `query:"page_size,omitempty"`
PageToken string `query:"page_token,omitempty"`
TransactionIndex *int `query:"transaction_index,omitempty"`
UniqueToken *int `query:"unique_token,omitempty"`
Value string `query:"value,omitempty"`
}
PaginationParams contains common Blockscout REST API v2 pagination fields.
type PublicMetricsConfig ¶ added in v0.2.0
type PublicMetricsConfig struct {
Enabled *bool `json:"enabled"`
}
PublicMetricsConfig describes the Blockscout public metrics config shape.
type QueryReadMethodRequest ¶ added in v0.2.0
type QueryReadMethodRequest struct {
Args []any `json:"args"`
MethodID string `json:"method_id"`
ContractType string `json:"contract_type"`
From string `json:"from,omitempty"`
}
QueryReadMethodRequest describes the request body for query read method.
type RawTrace ¶ added in v0.2.0
type RawTrace []json.RawMessage
RawTrace describes the Blockscout raw trace shape.
func (*RawTrace) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON decodes the value from JSON.
type RecaptchaBody ¶ added in v0.2.0
type RecaptchaBody struct {
RecaptchaResponse string `json:"recaptcha_response"`
}
RecaptchaBody is the JSON body required by token instance metadata refetch.
type ScrollBatch ¶ added in v0.2.0
type ScrollBatch struct {
CommitmentTransaction CommitmentTransaction `json:"commitment_transaction"`
ConfirmationTransaction CommitmentTransaction `json:"confirmation_transaction"`
DataAvailability ScrollDataAvailability `json:"data_availability"`
EndBlockNumber *int `json:"end_block_number"`
Number int `json:"number"`
StartBlockNumber *int `json:"start_block_number"`
TransactionsCount *int `json:"transactions_count"`
}
ScrollBatch describes the Blockscout Scroll batch shape.
type ScrollBridge ¶ added in v0.2.0
type ScrollBridge struct {
CompletionTransactionHash *string `json:"completion_transaction_hash"`
ID *int `json:"id"`
OriginationTimestamp *string `json:"origination_timestamp"`
OriginationTransactionBlockNumber *int `json:"origination_transaction_block_number"`
OriginationTransactionHash *string `json:"origination_transaction_hash"`
Value *string `json:"value"`
}
ScrollBridge describes the Blockscout Scroll bridge shape.
type ScrollDataAvailability ¶ added in v0.2.0
type ScrollDataAvailability struct {
BatchDataContainer string `json:"batch_data_container"`
}
ScrollDataAvailability describes the Blockscout Scroll data availability shape.
type SearchParams ¶ added in v0.2.0
type SearchParams struct {
Q string `query:"q,omitempty"`
AddressHash string `query:"address_hash,omitempty"`
BlockHash string `query:"block_hash,omitempty"`
HoldersCount *int `query:"holders_count,omitempty"`
InsertedAt string `query:"inserted_at,omitempty"`
ItemType string `query:"item_type,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
Name string `query:"name,omitempty"`
TransactionHash string `query:"transaction_hash,omitempty"`
}
SearchParams contains query parameters for search.
type SearchRedirect ¶ added in v0.2.0
type SearchRedirect struct {
Parameter *string `json:"parameter"`
Redirect *bool `json:"redirect"`
Type *string `json:"type"`
}
SearchRedirect describes the Blockscout search redirect shape.
type SearchResult ¶ added in v0.2.0
type SearchResult struct {
AddressHash string `json:"address_hash"`
AddressURL string `json:"address_url"`
Certified bool `json:"certified"`
CirculatingMarketCap *string `json:"circulating_market_cap"`
ExchangeRate *string `json:"exchange_rate"`
IconURL *string `json:"icon_url"`
IsSmartContractVerified bool `json:"is_smart_contract_verified"`
IsVerifiedViaAdminPanel bool `json:"is_verified_via_admin_panel"`
Name string `json:"name"`
Priority int `json:"priority"`
Symbol string `json:"symbol"`
TokenType string `json:"token_type"`
TokenURL string `json:"token_url"`
TotalSupply string `json:"total_supply"`
Type string `json:"type"`
BlockHash string `json:"block_hash,omitempty"`
BlockNumber *int `json:"block_number,omitempty"`
BlockType string `json:"block_type,omitempty"`
Timestamp *string `json:"timestamp,omitempty"`
TransactionHash string `json:"transaction_hash,omitempty"`
URL string `json:"url,omitempty"`
}
SearchResult describes the Blockscout search result shape.
func (*SearchResult) UnmarshalJSON ¶ added in v0.2.0
func (r *SearchResult) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the value from JSON.
type SearchV1Params ¶ added in v0.2.0
type SearchV1Params struct {
Q string `query:"q,omitempty"`
Key string `query:"key,omitempty"`
NextPageParamsType string `query:"next_page_params_type,omitempty"`
AddressHash string `query:"address_hash,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
TokenName string `query:"token_name,omitempty"`
TokenSymbol string `query:"token_symbol,omitempty"`
}
SearchV1Params contains query and cursor fields for the v1 unified search endpoint.
type SecretParams ¶ added in v0.2.0
type SecretParams struct {
Key string `query:"key,omitempty"`
RecaptchaResponse string `query:"-" json:"recaptcha_response,omitempty"`
}
SecretParams contains the optional secret key used by restricted endpoints.
type SignedAuthorization ¶ added in v0.2.0
type SignedAuthorization struct {
AddressHash string `json:"address_hash"`
Authority string `json:"authority"`
ChainID int `json:"chain_id"`
Nonce string `json:"nonce"`
R string `json:"r"`
S string `json:"s"`
V int `json:"v"`
}
SignedAuthorization describes the Blockscout signed authorization shape.
type SmartContract ¶ added in v0.2.0
type SmartContract struct {
SmartContractListItem
Name *string `json:"name"`
SourceCode *string `json:"source_code"`
DeployedBytecode *string `json:"deployed_bytecode"`
CreationBytecode *string `json:"creation_bytecode"`
ABI json.RawMessage `json:"abi"`
ConstructorArgs *string `json:"constructor_args"`
DecodedConstructorArgs json.RawMessage `json:"decoded_constructor_args"`
OptimizationRuns *int `json:"optimization_runs"`
EVMVersion *string `json:"evm_version"`
CompilerSettings json.RawMessage `json:"compiler_settings"`
AdditionalSources []AdditionalSource `json:"additional_sources"`
ExternalLibraries []ExternalLibrary `json:"external_libraries"`
Implementations []Implementation `json:"implementations"`
ProxyType *string `json:"proxy_type"`
IsVerified *bool `json:"is_verified"`
IsFullyVerified *bool `json:"is_fully_verified"`
IsPartiallyVerified *bool `json:"is_partially_verified"`
IsVerifiedViaSourcify *bool `json:"is_verified_via_sourcify"`
IsVerifiedViaEthBytecodeDB *bool `json:"is_verified_via_eth_bytecode_db"`
IsVerifiedViaVerifierAlliance *bool `json:"is_verified_via_verifier_alliance"`
IsBlueprint *bool `json:"is_blueprint"`
IsChangedBytecode *bool `json:"is_changed_bytecode"`
CanBeVisualizedViaSol2uml *bool `json:"can_be_visualized_via_sol2uml"`
FilePath *string `json:"file_path"`
SourcifyRepoURL *string `json:"sourcify_repo_url"`
VerifiedTwinAddressHash *string `json:"verified_twin_address_hash"`
}
SmartContract describes the Blockscout smart contract shape.
func (*SmartContract) UnmarshalJSON ¶ added in v0.2.0
func (contract *SmartContract) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the value from JSON.
type SmartContractAuditReport ¶ added in v0.2.0
type SmartContractAuditReport struct {
IsApproved bool `json:"is_approved"`
Submitter Address `json:"submitter"`
Name string `json:"name"`
URL string `json:"url"`
}
SmartContractAuditReport describes the Blockscout smart contract audit report shape.
type SmartContractCounters ¶ added in v0.2.0
type SmartContractCounters struct {
SmartContracts string `json:"smart_contracts"`
VerifiedSmartContracts string `json:"verified_smart_contracts"`
NewSmartContracts24h string `json:"new_smart_contracts_24h"`
NewVerifiedSmartContracts24h string `json:"new_verified_smart_contracts_24h"`
}
SmartContractCounters describes the Blockscout smart contract counters shape.
type SmartContractListItem ¶ added in v0.2.0
type SmartContractListItem struct {
Address Address `json:"address"`
Certified bool `json:"certified"`
CoinBalance string `json:"coin_balance"`
CompilerVersion string `json:"compiler_version"`
HasConstructorArgs bool `json:"has_constructor_args"`
Language string `json:"language"`
LicenseType string `json:"license_type"`
MarketCap *string `json:"market_cap"`
OptimizationEnabled bool `json:"optimization_enabled"`
TransactionsCount int `json:"transactions_count"`
VerifiedAt string `json:"verified_at"`
}
SmartContractListItem represents one smart contract list item returned by Blockscout.
type SmartContractMethod ¶ added in v0.2.0
type SmartContractMethod struct {
Type string `json:"type"`
StateMutability string `json:"stateMutability"`
Name string `json:"name"`
Inputs []SmartContractMethodParam `json:"inputs"`
Outputs []SmartContractMethodParam `json:"outputs"`
MethodID string `json:"method_id"`
}
SmartContractMethod describes the Blockscout smart contract method shape.
type SmartContractMethodParam ¶ added in v0.2.0
type SmartContractMethodParam struct {
InternalType string `json:"internalType"`
Name string `json:"name"`
Type string `json:"type"`
Components []SmartContractMethodParam `json:"components,omitempty"`
}
SmartContractMethodParam describes the Blockscout smart contract method parameter shape.
type SmartContractReadResult ¶ added in v0.2.0
SmartContractReadResult describes the Blockscout smart contract read result shape.
type StateChange ¶ added in v0.2.0
type StateChange struct {
Address Address `json:"address"`
IsMiner bool `json:"is_miner"`
BalanceBefore *string `json:"balance_before"`
BalanceAfter *string `json:"balance_after"`
TokenBalancesBefore []any `json:"token_balances_before"`
TokenBalancesAfter []any `json:"token_balances_after"`
}
StateChange describes the Blockscout state change shape.
type SuaveWrappedTransaction ¶ added in v0.2.0
type SuaveWrappedTransaction struct {
DecodedInput *DecodedInput `json:"decoded_input"`
Fee Fee `json:"fee"`
GasLimit *string `json:"gas_limit"`
GasPrice *string `json:"gas_price"`
Hash string `json:"hash"`
MaxFeePerGas *string `json:"max_fee_per_gas"`
MaxPriorityFeePerGas *string `json:"max_priority_fee_per_gas"`
Method *string `json:"method"`
Nonce *int `json:"nonce"`
RawInput string `json:"raw_input"`
To *Address `json:"to"`
Type *int `json:"type"`
Value *string `json:"value"`
}
SuaveWrappedTransaction describes the Blockscout SUAVE wrapped transaction shape.
type Tag ¶ added in v0.2.0
type Tag struct {
AddressHash string `json:"address_hash"`
DisplayName string `json:"display_name"`
Label string `json:"label"`
}
Tag describes the Blockscout tag shape.
type Token ¶ added in v0.2.0
type Token struct {
AddressHash string `json:"address_hash"`
Name *string `json:"name"`
Symbol *string `json:"symbol"`
Decimals *string `json:"decimals"`
Type *string `json:"type"`
TotalSupply *string `json:"total_supply"`
HoldersCount *string `json:"holders_count"`
ExchangeRate *string `json:"exchange_rate"`
CirculatingMarketCap *string `json:"circulating_market_cap"`
Volume24h *string `json:"volume_24h"`
IconURL *string `json:"icon_url"`
}
Token describes the Blockscout token shape.
type TokenBalance ¶ added in v0.2.0
type TokenBalance struct {
Value string `json:"value"`
Token *Token `json:"token"`
TokenID *string `json:"token_id"`
TokenInstance *TokenInstance `json:"token_instance"`
}
TokenBalance describes the Blockscout token balance shape.
type TokenCounters ¶ added in v0.2.0
type TokenCounters struct {
TokenHoldersCount string `json:"token_holders_count"`
TransfersCount string `json:"transfers_count"`
}
TokenCounters describes the Blockscout token counters shape.
type TokenHolder ¶ added in v0.2.0
type TokenHolder struct {
Address Address `json:"address"`
Value string `json:"value"`
TokenID *string `json:"token_id"`
}
TokenHolder describes the Blockscout token holder shape.
type TokenInstance ¶ added in v0.2.0
type TokenInstance struct {
ID string `json:"id"`
Metadata any `json:"metadata"`
Owner *Address `json:"owner"`
Token *Token `json:"token"`
ExternalAppURL *string `json:"external_app_url"`
AnimationURL *string `json:"animation_url"`
ImageURL *string `json:"image_url"`
IsUnique *bool `json:"is_unique"`
Thumbnails any `json:"thumbnails"`
MediaType *string `json:"media_type"`
MediaURL *string `json:"media_url"`
}
TokenInstance describes the Blockscout token instance shape.
type TokenInstanceTransfersCount ¶ added in v0.2.0
type TokenInstanceTransfersCount struct {
TransfersCount int `json:"transfers_count"`
}
TokenInstanceTransfersCount describes the Blockscout token instance transfers count shape.
type TokenTotal ¶ added in v0.2.0
type TokenTotal struct {
Value *string `json:"value"`
Decimals *string `json:"decimals"`
TokenID *string `json:"token_id"`
TokenInstance *TokenInstance `json:"token_instance"`
}
TokenTotal describes the Blockscout token total shape.
type TokenTransfer ¶ added in v0.2.0
type TokenTransfer struct {
TransactionHash string `json:"transaction_hash"`
BlockHash string `json:"block_hash"`
BlockNumber int `json:"block_number"`
Timestamp *string `json:"timestamp"`
From Address `json:"from"`
To Address `json:"to"`
Token Token `json:"token"`
Total *TokenTotal `json:"total"`
Type string `json:"type"`
Method *string `json:"method"`
LogIndex int `json:"log_index"`
}
TokenTransfer describes the Blockscout token transfer shape.
type Transaction ¶ added in v0.2.0
type Transaction struct {
Hash string `json:"hash"`
Result string `json:"result"`
Status *string `json:"status"`
BlockNumber *int `json:"block_number"`
Timestamp *string `json:"timestamp"`
From Address `json:"from"`
To *Address `json:"to"`
CreatedContract *Address `json:"created_contract"`
Confirmations int `json:"confirmations"`
ConfirmationDuration []float64 `json:"confirmation_duration"`
Value string `json:"value"`
Fee Fee `json:"fee"`
GasPrice *string `json:"gas_price"`
Type *int `json:"type"`
GasUsed *string `json:"gas_used"`
GasLimit string `json:"gas_limit"`
MaxFeePerGas *string `json:"max_fee_per_gas"`
MaxPriorityFeePerGas *string `json:"max_priority_fee_per_gas"`
BaseFeePerGas *string `json:"base_fee_per_gas"`
PriorityFee *string `json:"priority_fee"`
TransactionBurntFee *string `json:"transaction_burnt_fee"`
Nonce int `json:"nonce"`
Position *int `json:"position"`
RevertReason json.RawMessage `json:"revert_reason"`
RawInput string `json:"raw_input"`
DecodedInput *DecodedInput `json:"decoded_input"`
TokenTransfers []TokenTransfer `json:"token_transfers"`
TokenTransfersOverflow *bool `json:"token_transfers_overflow"`
Actions []TransactionAction `json:"actions"`
ExchangeRate *string `json:"exchange_rate"`
HistoricExchangeRate *string `json:"historic_exchange_rate"`
Method *string `json:"method"`
TransactionTypes []string `json:"transaction_types"`
TransactionTag *string `json:"transaction_tag"`
HasErrorInInternalTransactions *bool `json:"has_error_in_internal_transactions"`
AuthorizationList []SignedAuthorization `json:"authorization_list"`
FHEOperationsCount *int `json:"fhe_operations_count"`
BlobGasUsed *string `json:"blob_gas_used"`
BlobVersionedHashes []string `json:"blob_versioned_hashes"`
BurntBlobFee *string `json:"burnt_blob_fee"`
L1Fee *string `json:"l1_fee"`
L1GasPrice *string `json:"l1_gas_price"`
Arbitrum *ArbitrumTransaction `json:"arbitrum"`
ZkEVMSequenceHash *string `json:"zkevm_sequence_hash"`
ZkEVMVerifyHash *string `json:"zkevm_verify_hash"`
AllowedPeekers []string `json:"allowed_peekers"`
ExecutionNode *Address `json:"execution_node"`
Wrapped *SuaveWrappedTransaction `json:"wrapped"`
}
Transaction describes the Blockscout transaction shape.
type TransactionAction ¶ added in v0.2.0
type TransactionAction struct {
Protocol string `json:"protocol"`
Type string `json:"type"`
Data any `json:"data"`
}
TransactionAction describes the Blockscout transaction action shape.
type TransactionExternalTransactionsParams ¶ added in v0.2.0
type TransactionExternalTransactionsParams struct {
Key string `query:"key,omitempty"`
}
TransactionExternalTransactionsParams contains query parameters for transaction external transactions.
type TransactionFHEOperationsParams ¶ added in v0.2.0
type TransactionFHEOperationsParams struct {
Key string `query:"key,omitempty"`
}
TransactionFHEOperationsParams contains query parameters for transaction FHE operations.
type TransactionStats ¶ added in v0.2.0
type TransactionStats struct {
TransactionsCount24h string `json:"transactions_count_24h"`
PendingTransactionsCount string `json:"pending_transactions_count"`
TransactionFeesSum24h string `json:"transaction_fees_sum_24h"`
TransactionFeesAvg24h string `json:"transaction_fees_avg_24h"`
}
TransactionStats describes the Blockscout transaction stats shape.
type TransactionSummary ¶ added in v0.2.0
type TransactionSummary struct {
Result string `json:"result"`
}
TransactionSummary describes the Blockscout transaction summary shape.
type TransactionsChart ¶ added in v0.2.0
type TransactionsChart struct {
ChartData []TransactionsChartItem `json:"chart_data"`
}
TransactionsChart describes the Blockscout transactions chart shape.
type TransactionsChartItem ¶ added in v0.2.0
type TransactionsChartItem struct {
Date string `json:"date"`
TransactionsCount int `json:"transactions_count"`
}
TransactionsChartItem represents one transactions chart item returned by Blockscout.
type UserOperation ¶ added in v0.2.0
type UserOperation struct {
Aggregator *string `json:"aggregator"`
AggregatorSignature *string `json:"aggregator_signature"`
BlockNumber string `json:"block_number"`
Bundler Address `json:"bundler"`
Sender Address `json:"sender"`
EntryPoint Address `json:"entry_point"`
EntryPointVersion string `json:"entry_point_version"`
Fee string `json:"fee"`
Hash string `json:"hash"`
Status bool `json:"status"`
Timestamp *string `json:"timestamp"`
TransactionHash string `json:"transaction_hash"`
Nonce string `json:"nonce"`
CallGasLimit string `json:"call_gas_limit"`
VerificationGasLimit string `json:"verification_gas_limit"`
PreVerificationGas string `json:"pre_verification_gas"`
GasPrice string `json:"gas_price"`
GasUsed string `json:"gas_used"`
Gas string `json:"gas"`
MaxFeePerGas string `json:"max_fee_per_gas"`
MaxPriorityFeePerGas string `json:"max_priority_fee_per_gas"`
CallData string `json:"call_data"`
ExecuteCallData *string `json:"execute_call_data"`
ExecuteTarget *Address `json:"execute_target"`
Factory *Address `json:"factory"`
Paymaster *Address `json:"paymaster"`
Signature string `json:"signature"`
SponsorType string `json:"sponsor_type"`
RevertReason *string `json:"revert_reason"`
DecodedCallData *DecodedInput `json:"decoded_call_data"`
DecodedExecuteCallData *DecodedInput `json:"decoded_execute_call_data"`
Index int `json:"index"`
BundleIndex int `json:"bundle_index"`
UserLogsCount int `json:"user_logs_count"`
UserLogsStartIndex int `json:"user_logs_start_index"`
Consensus *bool `json:"consensus"`
BlockHash string `json:"block_hash"`
Raw json.RawMessage `json:"raw"`
}
UserOperation describes the Blockscout user operation shape.
type UserOperationInList ¶ added in v0.2.0
type UserOperationInList struct {
Address Address `json:"address"`
BlockNumber string `json:"block_number"`
EntryPoint Address `json:"entry_point"`
EntryPointVersion string `json:"entry_point_version"`
Fee string `json:"fee"`
Hash string `json:"hash"`
Status bool `json:"status"`
Timestamp *string `json:"timestamp"`
TransactionHash string `json:"transaction_hash"`
}
UserOperationInList describes the Blockscout user operation in list shape.
type UserOperationSummary ¶ added in v0.2.0
type UserOperationSummary struct {
Summary string `json:"summary"`
}
UserOperationSummary describes the Blockscout user operation summary shape.
type VerificationConfig ¶ added in v0.2.0
type VerificationConfig struct {
SolidityCompilerVersions []string `json:"solidity_compiler_versions"`
SolidityEVMVersions []string `json:"solidity_evm_versions"`
VyperCompilerVersions []string `json:"vyper_compiler_versions"`
VyperEVMVersions []string `json:"vyper_evm_versions"`
VerificationOptions []string `json:"verification_options"`
LicenseTypes map[string]int `json:"license_types"`
IsRustVerifierMicroserviceEnabled bool `json:"is_rust_verifier_microservice_enabled"`
}
VerificationConfig describes the Blockscout verification config shape.
type VerificationFile ¶ added in v0.2.0
VerificationFile describes the Blockscout verification file shape.
type VerificationResponse ¶ added in v0.2.0
type VerificationResponse struct {
Message string `json:"message"`
}
VerificationResponse contains the Blockscout response for verification.
type VerifyFlattenedCodeRequest ¶ added in v0.2.0
type VerifyFlattenedCodeRequest struct {
CompilerVersion string `json:"compiler_version"`
LicenseType string `json:"license_type"`
SourceCode string `json:"source_code"`
ContractName string `json:"contract_name"`
IsOptimizationEnabled *bool `json:"is_optimization_enabled,omitempty"`
OptimizationRuns *int `json:"optimization_runs,omitempty"`
EVMVersion string `json:"evm_version,omitempty"`
Libraries map[string]string `json:"libraries,omitempty"`
AutodetectConstructorArgs *bool `json:"autodetect_constructor_args,omitempty"`
ConstructorArgs string `json:"constructor_args,omitempty"`
}
VerifyFlattenedCodeRequest describes the request body for verify flattened code.
type VerifyMultiPartRequest ¶ added in v0.2.0
type VerifyMultiPartRequest struct {
CompilerVersion string
LicenseType string
EVMVersion string
IsOptimizationEnabled *bool
OptimizationRuns *int
Libraries map[string]string
Files []VerificationFile
}
VerifyMultiPartRequest describes the request body for verify multi part.
type VerifySourcifyRequest ¶ added in v0.2.0
type VerifySourcifyRequest struct {
Files []VerificationFile
ChosenContractIndex *int
}
VerifySourcifyRequest describes the request body for verify Sourcify.
type VerifyStandardInputRequest ¶ added in v0.2.0
type VerifyStandardInputRequest struct {
CompilerVersion string
ContractName string
LicenseType string
AutodetectConstructorArgs *bool
ConstructorArgs string
File VerificationFile
}
VerifyStandardInputRequest describes the request body for verify standard input.
type VerifyVyperCodeRequest ¶ added in v0.2.0
type VerifyVyperCodeRequest struct {
CompilerVersion string `json:"compiler_version"`
LicenseType string `json:"license_type"`
SourceCode string `json:"source_code"`
ContractName string `json:"contract_name"`
EVMVersion string `json:"evm_version"`
ConstructorArgs *string `json:"constructor_args,omitempty"`
}
VerifyVyperCodeRequest describes the request body for verify Vyper code.
type VerifyVyperMultiPartRequest ¶ added in v0.2.0
type VerifyVyperMultiPartRequest struct {
CompilerVersion string
LicenseType string
EVMVersion string
Files []VerificationFile
Interfaces []VerificationFile
}
VerifyVyperMultiPartRequest describes the request body for verify Vyper multi part.
type VerifyVyperStandardInputRequest ¶ added in v0.2.0
type VerifyVyperStandardInputRequest struct {
CompilerVersion string
LicenseType string
EVMVersion string
Files []VerificationFile
}
VerifyVyperStandardInputRequest describes the request body for verify Vyper standard input.
type WatchlistName ¶ added in v0.2.0
WatchlistName describes the Blockscout watchlist name shape.
type WatchlistTransactionsParams ¶ added in v0.2.0
type WatchlistTransactionsParams struct {
Key string `query:"key,omitempty"`
BlockNumber *int `query:"block_number,omitempty"`
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
}
WatchlistTransactionsParams contains filters for authenticated watchlist transactions.
type Withdrawal ¶ added in v0.2.0
type Withdrawal struct {
Index int `json:"index"`
ValidatorIndex int `json:"validator_index"`
Amount string `json:"amount"`
BlockNumber *int `json:"block_number"`
Receiver *Address `json:"receiver"`
Timestamp *string `json:"timestamp"`
}
Withdrawal describes the Blockscout withdrawal shape.
type WithdrawalCounters ¶ added in v0.2.0
type WithdrawalCounters struct {
WithdrawalsCount string `json:"withdrawals_count"`
}
WithdrawalCounters describes the Blockscout withdrawal counters shape.
type ZilliqaValidator ¶ added in v0.2.0
type ZilliqaValidator struct {
Balance string `json:"balance"`
BLSPublicKey string `json:"bls_public_key"`
Index int `json:"index"`
}
ZilliqaValidator describes the Blockscout Zilliqa validator shape.
type ZilliqaValidatorDetailed ¶ added in v0.2.0
type ZilliqaValidatorDetailed struct {
ZilliqaValidator
AddedAtBlockNumber int `json:"added_at_block_number"`
ControlAddress *Address `json:"control_address"`
PeerID *string `json:"peer_id"`
RewardAddress *Address `json:"reward_address"`
SigningAddress *Address `json:"signing_address"`
StakeUpdatedAtBlockNumber int `json:"stake_updated_at_block_number"`
}
ZilliqaValidatorDetailed describes the Blockscout Zilliqa validator detailed shape.
type ZilliqaValidatorsParams ¶ added in v0.2.0
type ZilliqaValidatorsParams struct {
Index *int `query:"index,omitempty"`
ItemsCount *int `query:"items_count,omitempty"`
Sort string `query:"sort,omitempty"`
Order string `query:"order,omitempty"`
}
ZilliqaValidatorsParams contains query parameters for Zilliqa validators.