Documentation
¶
Index ¶
- Variables
- type API
- func (api *API) Chains(ctx context.Context) ([]Chain, error)
- func (api *API) CheckAllByAddresses(ctx context.Context, addresses []string, chainIds []string) ([]CheckAllStatus, error)
- func (api *API) CheckByAddresses(ctx context.Context, addresses []string, chainIds []string) ([]CheckStatus, error)
- func (api *API) GetContractAddresses(ctx context.Context, chainID string) (*ContractAddresses, error)
- func (api *API) GetFile(ctx context.Context, chainID, address, match, filename string) (*Metadata, error)
- func (api *API) GetFileTree(ctx context.Context, chainID, address string) (*FileTree, error)
- func (api *API) GetFileTreeFullMatches(ctx context.Context, chainID, address string) ([]string, error)
- func (api *API) GetFiles(ctx context.Context, chainID, address string) (*Sources, error)
- func (api *API) GetFilesFullMatch(ctx context.Context, chainID, address string) ([]File, error)
- func (api *API) Health(ctx context.Context) (string, error)
- type Chain
- type ChainIdStatus
- type CheckAllStatus
- type CheckStatus
- type Compiler
- type ContractAddresses
- type Doc
- type Error
- type Explorer
- type File
- type FileTree
- type Metadata
- type NativeCurrency
- type Output
- type Settings
- type Source
- type Sources
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("file not found")
)
errors
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API -
func (*API) Chains ¶
Chains - Returns the chains (networks) added to the Sourcify. Contains both supported, unsupported, monitored, unmonitored chains.
func (*API) CheckAllByAddresses ¶
func (api *API) CheckAllByAddresses(ctx context.Context, addresses []string, chainIds []string) ([]CheckAllStatus, error)
CheckAllByAddresses - Checks if contract with the desired chain and address is verified and in the repository. It will search for both perfect and partial matches.
func (*API) CheckByAddresses ¶
func (api *API) CheckByAddresses(ctx context.Context, addresses []string, chainIds []string) ([]CheckStatus, error)
CheckByAddresses - Checks if contract with the desired chain and address is verified and in the repository. It will only search for perfect matches.
func (*API) GetContractAddresses ¶
func (api *API) GetContractAddresses(ctx context.Context, chainID string) (*ContractAddresses, error)
GetContractAddresses - Returns all verified contracts from the repository for the desired chain. Searches for full and partial matches.
func (*API) GetFile ¶
func (api *API) GetFile(ctx context.Context, chainID, address, match, filename string) (*Metadata, error)
GetFile - gets the file from the repository server
func (*API) GetFileTree ¶
GetFileTree - returns repository URLs for every file in the source tree for the desired chain and address. Searches for full and partial matches.
func (*API) GetFileTreeFullMatches ¶
func (api *API) GetFileTreeFullMatches(ctx context.Context, chainID, address string) ([]string, error)
GetFileTreeFullMatches - Returns repository URLs for every file in the source tree for the desired chain and address. Searches only for full matches.
func (*API) GetFiles ¶
GetFiles - Returns all verified sources from the repository for the desired contract address and chain, including metadata.json. Searches for full and partial matches.
func (*API) GetFilesFullMatch ¶
GetFilesFullMatch - Returns all verified sources from the repository for the desired contract address and chain, including metadata.json. Searches only for full matches.
type Chain ¶
type Chain struct {
Name string `json:"name"`
Chain string `json:"chain"`
Network string `json:"network"`
Icon string `json:"icon"`
RPC []string `json:"rpc"`
Faucets []string `json:"faucets"`
NativeCurrency NativeCurrency `json:"nativeCurrency"`
InfoURL string `json:"infoURL"`
ShortName string `json:"shortName"`
ChainID int64 `json:"chainId"`
NetworkID int64 `json:"networkId"`
Slip44 int64 `json:"slip44"`
Ens struct {
Registry string `json:"registry"`
} `json:"ens"`
Explorers []Explorer `json:"explorers"`
Supported bool `json:"supported"`
Monitored bool `json:"monitored"`
ContractFetchAddress string `json:"contractFetchAddress"`
TxRegex string `json:"txRegex"`
}
Chain -
type ChainIdStatus ¶
ChainIdStatus -
type CheckAllStatus ¶
type CheckAllStatus struct {
Address string `json:"address"`
ChainIds []ChainIdStatus `json:"chainIds"`
}
CheckAllStatus -
type CheckStatus ¶
type CheckStatus struct {
Address string `json:"address"`
Status string `json:"status"`
ChainIds []string `json:"chainIds"`
}
CheckStatus -
type ContractAddresses ¶
ContractAddresses -
type Doc ¶
type Doc struct {
Kind string `json:"kind"`
Methods map[string]stdJSON.RawMessage `json:"methods"`
Version int `json:"version"`
}
Doc -
type Explorer ¶
type Explorer struct {
Name string `json:"name"`
URL string `json:"url"`
Standard string `json:"standard"`
}
Explorer -
type File ¶
type File struct {
Name string `json:"name"`
Path string `json:"path"`
Content string `json:"content"`
}
File -
type Metadata ¶
type Metadata struct {
Compiler Compiler `json:"compiler"`
Language string `json:"language"`
Output Output `json:"output"`
Settings Settings `json:"settings"`
Sources map[string]Source `json:"sources"`
Version int `json:"version"`
}
Metadata -
func ParseMetadata ¶
ParseMetadata - try to parse metadata.json
type NativeCurrency ¶
type NativeCurrency struct {
Name string `json:"name"`
Symbol string `json:"symbol"`
Decimals int `json:"decimals"`
}
NativeCurrency -
type Output ¶
type Output struct {
ABI stdJSON.RawMessage `json:"abi"`
DevDoc Doc `json:"devdoc"`
UserDoc Doc `json:"userdoc"`
}
Output -
type Settings ¶
type Settings struct {
CompilationTarget map[string]string `json:"compilationTarget"`
EvmVersion string `json:"evmVersion"`
Libraries struct{} `json:"libraries"`
Metadata struct {
BytecodeHash string `json:"bytecodeHash"`
} `json:"metadata"`
Optimizer struct {
Enabled bool `json:"enabled"`
Runs int `json:"runs"`
} `json:"optimizer"`
Remappings []interface{} `json:"remappings"`
}
Settings -