Versions in this module Expand all Collapse all v0 v0.2.0 Feb 9, 2022 v0.1.1 Feb 7, 2022 v0.1.0 Feb 7, 2022 Changes in this version + const DefaultAPIVersion + const DefaultOrigin + const DefaultPort + const DefaultRateLimit + const DefaultSchema + const GuildHost + const LibraryVersion + const MainnetHost + const TestnetHost + var ErrHTTPClientChange = errors.New("http.Client can only be set as option to koios.New") + var ErrHTTPClientTimeoutSetting = errors.New("http.Client.Timeout should never be 0 in production") + var ErrNoAddress = errors.New("missing address") + var ErrNoPoolID = errors.New("missing pool id") + var ErrNoTxHash = errors.New("missing transaxtion hash(es)") + var ErrOriginSet = errors.New("origin can only be set as option to koios.New") + var ErrRateLimitRange = errors.New("rate limit must be between 1-255 requests per sec") + var ErrResponseIsNotJSON = errors.New("go non json response") + var ErrURLValuesLenght = errors.New("if presenent then only single url.Values should be provided") + type AccountAction struct + ActionType string + TxHash TxHash + type AccountAddressesResponse struct + Data []Address + type AccountAsset struct + Name string + PolicyID PolicyID + Quantity Lovelace + type AccountAssetsResponse struct + Data []AccountAsset + type AccountHistoryEntry struct + ActiveStake Lovelace + Epoch EpochNo + PoolID PoolID + StakeAddress StakeAddress + type AccountHistoryResponse struct + Data []AccountHistoryEntry + type AccountInfo struct + DelegatedPool PoolID + Reserves Lovelace + Rewards Lovelace + RewardsAvailable Lovelace + Status string + TotalBalance Lovelace + Treasury Lovelace + UTxO Lovelace + Withdrawals Lovelace + type AccountInfoResponse struct + Data *AccountInfo + type AccountListResponse struct + Data []StakeAddress + type AccountRewards struct + Amount Lovelace + EarnedEpoch EpochNo + PoolID PoolID + SpendableEpoch EpochNo + Type string + type AccountRewardsResponse struct + Data []AccountRewards + type AccountUpdatesResponse struct + Data []AccountAction + type Address string + type AddressAsset struct + NameHEX string + PolicyID PolicyID + Quantity Lovelace + type AddressAssetsResponse struct + Data []AddressAsset + type AddressInfo struct + Balance Lovelace + StakeAddress StakeAddress + UTxOs []AddressUTxO + type AddressInfoResponse struct + Data *AddressInfo + type AddressTxsResponse struct + Data []TxHash + type AddressUTxO struct + AssetList []Asset + TxHash TxHash + TxIndex int + Value Lovelace + type Asset struct + Name string + PolicyID PolicyID + Quantity Lovelace + type AssetAddressListResponse struct + Data []AssetHolder + type AssetHolder struct + PaymentAddress Address + Quantity Lovelace + type AssetInfo struct + CreationTime string + Fingerprint string + MintingTxMetadata *TxInfoMetadata + Name string + NameASCII string + PolicyID PolicyID + TokenRegistryMetadata *TokenRegistryMetadata + TotalSupply Lovelace + type AssetInfoResponse struct + Data *AssetInfo + type AssetListItem struct + AssetNames struct{ ... } + PolicyID PolicyID + type AssetListResponse struct + Data []AssetListItem + type AssetName string + type AssetSummary struct + AssetName string + PolicyID PolicyID + StakedWallets int64 + TotalTransactions int64 + UnstakedAddresses int64 + type AssetSummaryResponse struct + Data *AssetSummary + type AssetTxs struct + AssetName string + PolicyID PolicyID + TxHashes []TxHash + type AssetTxsResponse struct + Data *AssetTxs + type Block struct + AbsoluteSlot int + ChildHash BlockHash + Epoch EpochNo + EpochSlot int + Hash BlockHash + Height int + OpCert string + OpCertCounter int + ParentHash BlockHash + Pool string + Size int + Time string + TxCount int + VrfKey string + type BlockHash string + type BlockInfoResponse struct + Data *Block + type BlockTxsHashesResponse struct + Data []TxHash + type BlocksResponse struct + Data []Block + type Certificate struct + Index int + Info map[string]interface{} + Type string + type Client struct + func New(opts ...Option) (*Client, error) + func (c *Client) BaseURL() string + func (c *Client) GET(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error) + func (c *Client) GetAccountAddresses(ctx context.Context, addr StakeAddress) (res *AccountAddressesResponse, err error) + func (c *Client) GetAccountAssets(ctx context.Context, addr StakeAddress) (res *AccountAssetsResponse, err error) + func (c *Client) GetAccountHistory(ctx context.Context, addr StakeAddress) (res *AccountHistoryResponse, err error) + func (c *Client) GetAccountInfo(ctx context.Context, addr Address) (res *AccountInfoResponse, err error) + func (c *Client) GetAccountList(ctx context.Context) (res *AccountListResponse, err error) + func (c *Client) GetAccountRewards(ctx context.Context, addr StakeAddress, epoch *EpochNo) (res *AccountRewardsResponse, err error) + func (c *Client) GetAccountUpdates(ctx context.Context, addr StakeAddress) (res *AccountUpdatesResponse, err error) + func (c *Client) GetAddressAssets(ctx context.Context, addr Address) (res *AddressAssetsResponse, err error) + func (c *Client) GetAddressInfo(ctx context.Context, addr Address) (res *AddressInfoResponse, err error) + func (c *Client) GetAddressTxs(ctx context.Context, addrs []Address, h uint64) (res *AddressTxsResponse, err error) + func (c *Client) GetAssetAddressList(ctx context.Context, policy PolicyID, name AssetName) (res *AssetAddressListResponse, err error) + func (c *Client) GetAssetInfo(ctx context.Context, policy PolicyID, name AssetName) (res *AssetInfoResponse, err error) + func (c *Client) GetAssetList(ctx context.Context) (res *AssetListResponse, err error) + func (c *Client) GetAssetSummary(ctx context.Context, policy PolicyID, name AssetName) (res *AssetSummaryResponse, err error) + func (c *Client) GetAssetTxs(ctx context.Context, policy PolicyID, name AssetName) (res *AssetTxsResponse, err error) + func (c *Client) GetBlockInfo(ctx context.Context, hash BlockHash) (res *BlockInfoResponse, err error) + func (c *Client) GetBlockTxHashes(ctx context.Context, hash BlockHash) (res *BlockTxsHashesResponse, err error) + func (c *Client) GetBlocks(ctx context.Context) (res *BlocksResponse, err error) + func (c *Client) GetCredentialTxs(ctx context.Context, creds []PaymentCredential, h uint64) (res *CredentialTxsResponse, err error) + func (c *Client) GetEpochInfo(ctx context.Context, epoch *EpochNo) (res *EpochInfoResponse, err error) + func (c *Client) GetEpochParams(ctx context.Context, epoch *EpochNo) (res *EpochParamsResponse, err error) + func (c *Client) GetGenesis(ctx context.Context) (res *GenesisResponse, err error) + func (c *Client) GetPoolBlocks(ctx context.Context, pid PoolID, epoch *EpochNo) (res *PoolBlocksResponse, err error) + func (c *Client) GetPoolDelegators(ctx context.Context, pid PoolID, epoch *EpochNo) (res *PoolDelegatorsResponse, err error) + func (c *Client) GetPoolInfo(ctx context.Context, pid PoolID) (res *PoolInfoResponse, err error) + func (c *Client) GetPoolInfos(ctx context.Context, pids []PoolID) (res *PoolInfosResponse, err error) + func (c *Client) GetPoolList(ctx context.Context) (res *PoolListResponse, err error) + func (c *Client) GetPoolMetadata(ctx context.Context) (res *PoolMetadataResponse, err error) + func (c *Client) GetPoolRelays(ctx context.Context) (res *PoolRelaysResponse, err error) + func (c *Client) GetPoolUpdates(ctx context.Context, pid *PoolID) (res *PoolUpdatesResponse, err error) + func (c *Client) GetScriptList(ctx context.Context) (res *ScriptListResponse, err error) + func (c *Client) GetScriptRedeemers(ctx context.Context, sh ScriptHash) (res *ScriptRedeemersResponse, err error) + func (c *Client) GetTip(ctx context.Context) (res *TipResponse, err error) + func (c *Client) GetTotals(ctx context.Context, epoch *EpochNo) (res *TotalsResponse, err error) + func (c *Client) GetTxInfo(ctx context.Context, tx TxHash) (res *TxInfoResponse, err error) + func (c *Client) GetTxMetaLabels(ctx context.Context) (res *TxMetaLabelsResponse, err error) + func (c *Client) GetTxMetadata(ctx context.Context, tx TxHash) (res *TxMetadataResponse, err error) + func (c *Client) GetTxStatus(ctx context.Context, tx TxHash) (res *TxStatusResponse, err error) + func (c *Client) GetTxsInfos(ctx context.Context, txs []TxHash) (res *TxsInfosResponse, err error) + func (c *Client) GetTxsMetadata(ctx context.Context, txs []TxHash) (res *TxsMetadataResponse, err error) + func (c *Client) GetTxsStatuses(ctx context.Context, txs []TxHash) (res *TxsStatusesResponse, err error) + func (c *Client) GetTxsUTxOs(ctx context.Context, txs []TxHash) (res *TxUTxOsResponse, err error) + func (c *Client) HEAD(ctx context.Context, path string, query url.Values, headers http.Header) (*http.Response, error) + func (c *Client) POST(ctx context.Context, body io.Reader, path string, query url.Values, ...) (*http.Response, error) + func (c *Client) SubmitSignedTx(ctx context.Context, stx TxBodyJSON) (res *SubmitSignedTxResponse, err error) + func (c *Client) TotalRequests() uint + type CredentialTxsResponse struct + Data []TxHash + type EpochInfo struct + ActiveStake string + BlkCount int + Epoch EpochNo + Fees Lovelace + FirstBlockTime string + LastBlockTime string + OutSum Lovelace + TxCount int + type EpochInfoResponse struct + Data []EpochInfo + type EpochNo uint64 + type EpochParams struct + BlockHash string + CoinsPerUtxoWord Lovelace + CollateralPercent int + CostModels string + Decentralisation float64 + Entropy string + Epoch EpochNo + Influence float64 + KeyDeposit Lovelace + MaxBhSize int + MaxBlockExMem float32 + MaxBlockExSteps float32 + MaxBlockSize int + MaxCollateralInputs int + MaxEpoch int + MaxTxExMem float32 + MaxTxExSteps float32 + MaxTxSize int + MaxValSize float32 + MinFeeA int + MinFeeB int + MinPoolCost Lovelace + MinUtxoValue int + MonetaryExpandRate float64 + Nonce string + OptimalPoolCount int + PoolDeposit Lovelace + PriceMem float64 + PriceStep float64 + ProtocolMajor int + ProtocolMinor int + TreasuryGrowthRate float64 + type EpochParamsResponse struct + Data []EpochParams + type Genesis struct + Activeslotcoeff string + Alonzogenesis string + Epochlength string + Maxkesrevolutions string + Maxlovelacesupply string + Networkid string + Networkmagic string + Securityparam string + Slotlength string + Slotsperkesperiod string + Systemstart string + Updatequorum string + type GenesisResponse struct + Data *Genesis + type Lovelace struct + type Option func(*Client) error + func APIVersion(version string) Option + func CollectRequestsStats(enabled bool) Option + func HTTPClient(client *http.Client) Option + func Host(host string) Option + func Origin(origin string) Option + func Port(port uint16) Option + func RateLimit(reqps uint8) Option + func Schema(schema string) Option + type PaymentAddr struct + Bech32 string + Cred PaymentCredential + type PaymentCredential string + type PolicyID string + type PoolBlockInfo struct + BlockNo uint64 + Epoch EpochNo + EpochSlot int + Hash BlockHash + Slot int + Time string + type PoolBlocksResponse struct + Data []PoolBlockInfo + type PoolDelegator struct + Amount Lovelace + Epoch EpochNo + StakeAddress StakeAddress + type PoolDelegatorsResponse struct + Data []PoolDelegator + type PoolID string + type PoolInfo struct + ActiveEpoch EpochNo + ActiveStake Lovelace + BlockCount uint64 + FixedCost Lovelace + ID PoolID + IDHex string + LiveDelegators uint64 + LiveSaturation float32 + LiveStake Lovelace + Margin float32 + MetaHash string + MetaJSON PoolMetaJSON + MetaURL string + OpCert string + OpCertCounter int + Owners []StakeAddress + Pledge Lovelace + Relays []Relay + RetiringEpoch *EpochNo + RewardAddr StakeAddress + Status string + VrfKeyHash string + type PoolInfoResponse struct + Data *PoolInfo + type PoolInfosResponse struct + Data []PoolInfo + type PoolListItem struct + PoolID PoolID + Ticker *string + type PoolListResponse struct + Data []PoolListItem + type PoolMetaJSON struct + Description *string + Homepage *string + Name *string + Ticker *string + type PoolMetadata struct + MetaHash string + MetaJSON PoolMetaJSON + MetaURL string + PoolID PoolID + type PoolMetadataResponse struct + Data []PoolMetadata + type PoolRelays struct + PoolID PoolID + Relays []Relay + type PoolRelaysResponse struct + Data []PoolRelays + type PoolUpdateInfo struct + ActiveEpoch EpochNo + BlockTime string + FixedCost Lovelace + ID PoolID + IDHex string + Margin float32 + MetaHash string + MetaURL string + Owners []StakeAddress + Pledge Lovelace + Relays []PoolRelays + RetiringEpoch *EpochNo + RewardAddr StakeAddress + Status string + TxHash TxHash + VrfKeyHash string + type PoolUpdatesResponse struct + Data []PoolUpdateInfo + type Relay struct + DNS *string + Ipv4 *string + Ipv6 *string + Port *uint16 + Srv *string + type RequestStats struct + DNSLookupDur time.Duration + ESTCXNDur time.Duration + ReqDur time.Duration + ReqDurStr string + ReqStartedAt time.Time + TLSHSDur time.Duration + TTFB time.Duration + type Response struct + ContentLocation string + ContentRange string + Date string + Error *ResponseError + RequestMethod string + RequestURL string + Stats *RequestStats + Status string + StatusCode int + type ResponseError struct + Code string + Details string + Hint string + Message string + type ScriptHash string + type ScriptListItem struct + CreationTxHash TxHash + ScriptHash string + type ScriptListResponse struct + Data []ScriptListItem + type ScriptRedeemer struct + DatumHash string + DatumValue map[string]interface{} + Fee Lovelace + Purpose string + TxHash TxHash + TxIndex int + UnitMem int + UnitSteps int + type ScriptRedeemers struct + Redeemers []ScriptRedeemer + ScriptHash ScriptHash + type ScriptRedeemersResponse struct + Data *ScriptRedeemers + type StakeAddress string + type SubmitSignedTxResponse struct + Data TxHash + type Tip struct + AbsSlot int + BlockNo int + BlockTime string + Epoch int + EpochSlot int + Hash string + type TipResponse struct + Data *Tip + type TokenRegistryMetadata struct + Decimals int + Description string + Logo string + Name string + Ticker string + URL string + type Totals struct + Circulation Lovelace + Epoch EpochNo + Reserves Lovelace + Reward Lovelace + Supply Lovelace + Treasury Lovelace + type TotalsResponse struct + Data []Totals + type TxBodyJSON struct + CborHex string + Description string + Type string + type TxHash string + type TxInfo struct + AbsoluteSlot int + AssetsMinted []Asset + BlockHash BlockHash + BlockHeight int + Certificates []Certificate + Collaterals []TxInput + Deposit Lovelace + Epoch EpochNo + EpochSlot int + Fee Lovelace + Inputs []TxInput + InvalidAfter int + InvalidBefore int + Metadata []TxInfoMetadata + Outputs []TxOutput + TotalOutput Lovelace + TxBlockIndex int + TxHash TxHash + TxSize int + TxTimestamp string + Withdrawals []TxsWithdrawal + type TxInfoMetadata struct + JSON map[string]interface{} + Key int + type TxInfoResponse struct + Data *TxInfo + type TxInput struct + AssetList []Asset + PaymentAddr PaymentAddr + StakeAddress StakeAddress + TxHash TxHash + TxIndex int + Value Lovelace + type TxMetaLabelsResponse struct + Data []TxMetalabel + type TxMetadata struct + Metadata map[string]interface{} + TxHash TxHash + type TxMetadataResponse struct + Data *TxMetadata + type TxMetalabel struct + Metalabel uint64 + type TxOutput struct + AssetList []Asset + PaymentAddr PaymentAddr + StakeAddress StakeAddress + TxHash TxHash + TxIndex int + Value Lovelace + type TxStatus struct + NumConfirmations uint64 + TxHash TxHash + type TxStatusResponse struct + Data *TxStatus + type TxUTxOsResponse struct + Data []UTxO + type TxsInfosResponse struct + Data []TxInfo + type TxsMetadataResponse struct + Data []TxMetadata + type TxsStatusesResponse struct + Data []TxStatus + type TxsWithdrawal struct + Amount Lovelace + StakeAddress StakeAddress + type UTxO struct + Inputs []TxInput + Outputs []TxOutput + TxHash TxHash