Documentation ¶
Index ¶
- func Bool(value bool) param.Field[bool]
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type AddressAssetExposure
- type AddressAssetExposureAsset
- type AddressAssetExposureAssetType
- type AddressAssetExposureAssetUnion
- type AddressAssetExposureSpender
- type AddressAssetExposureSpendersUnion
- type AssetDiff
- type AssetDiffAsset
- type AssetDiffAssetType
- type AssetDiffAssetUnion
- type AssetDiffIn
- type AssetDiffInUnion
- type AssetDiffOut
- type AssetDiffOutUnion
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type Erc1155Diff
- type Erc1155Exposure
- type Erc1155ExposureExposure
- type Erc1155ExposureExposureUnion
- type Erc1155TokenDetails
- type Erc1155TokenDetailsType
- type Erc20Diff
- type Erc20Exposure
- type Erc20ExposureExposure
- type Erc20ExposureExposureUnion
- type Erc20TokenDetails
- type Erc20TokenDetailsType
- type Erc721Diff
- type Erc721Exposure
- type Erc721ExposureExposure
- type Erc721ExposureExposureUnion
- type Erc721TokenDetails
- type Erc721TokenDetailsType
- type Error
- type EvmJsonRpcScanParams
- type EvmJsonRpcScanParamsData
- type EvmJsonRpcScanParamsOption
- type EvmJsonRpcService
- type EvmService
- type EvmTransactionBulkScanParams
- type EvmTransactionBulkScanParamsData
- type EvmTransactionBulkScanParamsOption
- type EvmTransactionBulkService
- type EvmTransactionRawScanParams
- type EvmTransactionRawScanParamsOption
- type EvmTransactionRawService
- type EvmTransactionScanParams
- type EvmTransactionScanParamsData
- type EvmTransactionScanParamsOption
- type EvmTransactionService
- type EvmUserOperationScanParams
- type EvmUserOperationScanParamsData
- type EvmUserOperationScanParamsDataOperation
- type EvmUserOperationScanParamsOption
- type EvmUserOperationService
- type MetadataParam
- type NativeAssetDetails
- type NativeAssetDetailsType
- type NativeDiff
- type NonercTokenDetails
- type NonercTokenDetailsType
- type SiteScanHitResponse
- type SiteScanHitResponseAttackType
- type SiteScanHitResponseContractRead
- type SiteScanHitResponseContractWrite
- type SiteScanHitResponseStatus
- type SiteScanMissResponse
- type SiteScanMissResponseStatus
- type SiteScanParams
- type SiteScanParamsMetadata
- type SiteScanParamsMetadataCatalogRequestMetadata
- type SiteScanParamsMetadataCatalogRequestMetadataType
- type SiteScanParamsMetadataType
- type SiteScanParamsMetadataUnion
- type SiteScanParamsMetadataWalletRequestMetadata
- type SiteScanParamsMetadataWalletRequestMetadataType
- type SiteScanResponse
- type SiteScanResponseStatus
- type SiteScanResponseUnion
- type SiteService
- type TransactionScanFeature
- type TransactionScanFeatureType
- type TransactionScanResponse
- type TransactionScanResponseEvent
- type TransactionScanResponseEventsParam
- type TransactionScanResponseEventsParamsValueArray
- type TransactionScanResponseEventsParamsValueUnion
- type TransactionScanResponseGasEstimation
- type TransactionScanResponseGasEstimationTransactionScanGasEstimation
- type TransactionScanResponseGasEstimationTransactionScanGasEstimationError
- type TransactionScanResponseGasEstimationUnion
- type TransactionScanResponseSimulation
- type TransactionScanResponseSimulationUnion
- type TransactionScanResponseValidation
- type TransactionScanResponseValidationResultType
- type TransactionScanResponseValidationUnion
- type TransactionScanSupportedChain
- type TransactionSimulation
- type TransactionSimulationAccountSummary
- type TransactionSimulationAddressDetail
- type TransactionSimulationError
- type TransactionValidation
- type TransactionValidationError
- type TransactionValidationErrorLocUnion
- type TransactionValidationResultType
- type UsdDiff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type AddressAssetExposure ¶
type AddressAssetExposure struct { // description of the asset for the current diff Asset AddressAssetExposureAsset `json:"asset,required"` // dictionary of spender addresses where the exposure has changed during this // transaction for the current address and asset Spenders map[string]AddressAssetExposureSpender `json:"spenders,required"` JSON addressAssetExposureJSON `json:"-"` }
func (*AddressAssetExposure) UnmarshalJSON ¶
func (r *AddressAssetExposure) UnmarshalJSON(data []byte) (err error)
type AddressAssetExposureAsset ¶
type AddressAssetExposureAsset struct { // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` // address of the token Address string `json:"address,required"` // url of the token logo LogoURL string `json:"logo_url"` // asset type. Type AddressAssetExposureAssetType `json:"type,required"` // asset's decimals Decimals int64 `json:"decimals"` JSON addressAssetExposureAssetJSON `json:"-"` // contains filtered or unexported fields }
description of the asset for the current diff
func (AddressAssetExposureAsset) AsUnion ¶
func (r AddressAssetExposureAsset) AsUnion() AddressAssetExposureAssetUnion
func (*AddressAssetExposureAsset) UnmarshalJSON ¶
func (r *AddressAssetExposureAsset) UnmarshalJSON(data []byte) (err error)
type AddressAssetExposureAssetType ¶
type AddressAssetExposureAssetType string
asset type.
const ( AddressAssetExposureAssetTypeErc20 AddressAssetExposureAssetType = "ERC20" AddressAssetExposureAssetTypeErc1155 AddressAssetExposureAssetType = "ERC1155" AddressAssetExposureAssetTypeErc721 AddressAssetExposureAssetType = "ERC721" AddressAssetExposureAssetTypeNonerc AddressAssetExposureAssetType = "NONERC" )
func (AddressAssetExposureAssetType) IsKnown ¶
func (r AddressAssetExposureAssetType) IsKnown() bool
type AddressAssetExposureAssetUnion ¶
type AddressAssetExposureAssetUnion interface {
// contains filtered or unexported methods
}
description of the asset for the current diff
Union satisfied by Erc20TokenDetails, Erc1155TokenDetails, Erc721TokenDetails or NonercTokenDetails.
type AddressAssetExposureSpender ¶
type AddressAssetExposureSpender struct { Exposure interface{} `json:"exposure"` // user friendly description of the approval Summary string `json:"summary"` // the amount that was asked in the approval request for this spender from the // current address and asset Approval int64 `json:"approval"` // the expiration time of the permit2 protocol Expiration time.Time `json:"expiration" format:"date-time"` // boolean indicates whether an is_approved_for_all function was used (missing in // case of ERC20 / ERC1155) IsApprovedForAll bool `json:"is_approved_for_all"` JSON addressAssetExposureSpenderJSON `json:"-"` // contains filtered or unexported fields }
func (AddressAssetExposureSpender) AsUnion ¶
func (r AddressAssetExposureSpender) AsUnion() AddressAssetExposureSpendersUnion
func (*AddressAssetExposureSpender) UnmarshalJSON ¶
func (r *AddressAssetExposureSpender) UnmarshalJSON(data []byte) (err error)
type AddressAssetExposureSpendersUnion ¶
type AddressAssetExposureSpendersUnion interface {
// contains filtered or unexported methods
}
Union satisfied by Erc20Exposure, Erc721Exposure or Erc1155Exposure.
type AssetDiff ¶ added in v0.7.3
type AssetDiff struct { // description of the asset for the current diff Asset AssetDiffAsset `json:"asset,required"` // amount of the asset that was transferred to the address in this transaction In []AssetDiffIn `json:"in,required"` // amount of the asset that was transferred from the address in this transaction Out []AssetDiffOut `json:"out,required"` JSON assetDiffJSON `json:"-"` }
func (*AssetDiff) UnmarshalJSON ¶ added in v0.7.3
type AssetDiffAsset ¶ added in v0.7.3
type AssetDiffAsset struct { // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` // address of the token Address string `json:"address"` // url of the token logo LogoURL string `json:"logo_url"` // asset type. Type AssetDiffAssetType `json:"type,required"` // asset's decimals Decimals int64 `json:"decimals"` ChainName string `json:"chain_name"` ChainID int64 `json:"chain_id"` JSON assetDiffAssetJSON `json:"-"` // contains filtered or unexported fields }
description of the asset for the current diff
func (AssetDiffAsset) AsUnion ¶ added in v0.7.3
func (r AssetDiffAsset) AsUnion() AssetDiffAssetUnion
func (*AssetDiffAsset) UnmarshalJSON ¶ added in v0.7.3
func (r *AssetDiffAsset) UnmarshalJSON(data []byte) (err error)
type AssetDiffAssetType ¶ added in v0.7.3
type AssetDiffAssetType string
asset type.
const ( AssetDiffAssetTypeErc20 AssetDiffAssetType = "ERC20" AssetDiffAssetTypeErc1155 AssetDiffAssetType = "ERC1155" AssetDiffAssetTypeErc721 AssetDiffAssetType = "ERC721" AssetDiffAssetTypeNonerc AssetDiffAssetType = "NONERC" AssetDiffAssetTypeNative AssetDiffAssetType = "NATIVE" )
func (AssetDiffAssetType) IsKnown ¶ added in v0.7.3
func (r AssetDiffAssetType) IsKnown() bool
type AssetDiffAssetUnion ¶ added in v0.7.3
type AssetDiffAssetUnion interface {
// contains filtered or unexported methods
}
description of the asset for the current diff
Union satisfied by Erc20TokenDetails, Erc1155TokenDetails, Erc721TokenDetails, NonercTokenDetails or NativeAssetDetails.
type AssetDiffIn ¶ added in v0.7.3
type AssetDiffIn struct { // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // user friendly description of the asset transfer Summary string `json:"summary"` // id of the token TokenID int64 `json:"token_id"` Value interface{} `json:"value,required"` // url of the token logo LogoURL string `json:"logo_url"` // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value"` JSON assetDiffInJSON `json:"-"` // contains filtered or unexported fields }
func (AssetDiffIn) AsUnion ¶ added in v0.7.3
func (r AssetDiffIn) AsUnion() AssetDiffInUnion
func (*AssetDiffIn) UnmarshalJSON ¶ added in v0.7.3
func (r *AssetDiffIn) UnmarshalJSON(data []byte) (err error)
type AssetDiffInUnion ¶ added in v0.7.3
type AssetDiffInUnion interface {
// contains filtered or unexported methods
}
Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.
type AssetDiffOut ¶ added in v0.7.3
type AssetDiffOut struct { // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // user friendly description of the asset transfer Summary string `json:"summary"` // id of the token TokenID int64 `json:"token_id"` Value interface{} `json:"value,required"` // url of the token logo LogoURL string `json:"logo_url"` // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value"` JSON assetDiffOutJSON `json:"-"` // contains filtered or unexported fields }
func (AssetDiffOut) AsUnion ¶ added in v0.7.3
func (r AssetDiffOut) AsUnion() AssetDiffOutUnion
func (*AssetDiffOut) UnmarshalJSON ¶ added in v0.7.3
func (r *AssetDiffOut) UnmarshalJSON(data []byte) (err error)
type AssetDiffOutUnion ¶ added in v0.7.3
type AssetDiffOutUnion interface {
// contains filtered or unexported methods
}
Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.
type Client ¶
type Client struct { Options []option.RequestOption Evm *EvmService Site *SiteService }
Client creates a struct with services and top level methods that help with interacting with the blockaid API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r *Client)
NewClient generates a new client with the default option read from the environment (BLOCKAID_CLIENT_API_KEY). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned [url.Values] will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type Erc1155Diff ¶
type Erc1155Diff struct { // id of the token TokenID int64 `json:"token_id,required"` // value before divided by decimal, that was transferred from this address Value int64 `json:"value,required"` // url of the token logo LogoURL string `json:"logo_url"` // user friendly description of the asset transfer Summary string `json:"summary"` // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` JSON erc1155DiffJSON `json:"-"` }
func (*Erc1155Diff) UnmarshalJSON ¶
func (r *Erc1155Diff) UnmarshalJSON(data []byte) (err error)
type Erc1155Exposure ¶
type Erc1155Exposure struct { Exposure []Erc1155ExposureExposure `json:"exposure,required"` // boolean indicates whether an is_approved_for_all function was used (missing in // case of ERC20 / ERC1155) IsApprovedForAll bool `json:"is_approved_for_all,required"` // user friendly description of the approval Summary string `json:"summary"` JSON erc1155ExposureJSON `json:"-"` }
func (*Erc1155Exposure) UnmarshalJSON ¶
func (r *Erc1155Exposure) UnmarshalJSON(data []byte) (err error)
type Erc1155ExposureExposure ¶
type Erc1155ExposureExposure struct { // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // user friendly description of the asset transfer Summary string `json:"summary"` // id of the token TokenID int64 `json:"token_id"` Value interface{} `json:"value,required"` // url of the token logo LogoURL string `json:"logo_url"` // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value"` JSON erc1155ExposureExposureJSON `json:"-"` // contains filtered or unexported fields }
func (Erc1155ExposureExposure) AsUnion ¶
func (r Erc1155ExposureExposure) AsUnion() Erc1155ExposureExposureUnion
func (*Erc1155ExposureExposure) UnmarshalJSON ¶
func (r *Erc1155ExposureExposure) UnmarshalJSON(data []byte) (err error)
type Erc1155ExposureExposureUnion ¶
type Erc1155ExposureExposureUnion interface {
// contains filtered or unexported methods
}
Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.
type Erc1155TokenDetails ¶
type Erc1155TokenDetails struct { // address of the token Address string `json:"address,required"` // asset type. Type Erc1155TokenDetailsType `json:"type,required"` // url of the token logo LogoURL string `json:"logo_url"` // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` JSON erc1155TokenDetailsJSON `json:"-"` }
func (*Erc1155TokenDetails) UnmarshalJSON ¶
func (r *Erc1155TokenDetails) UnmarshalJSON(data []byte) (err error)
type Erc1155TokenDetailsType ¶
type Erc1155TokenDetailsType string
asset type.
const (
Erc1155TokenDetailsTypeErc1155 Erc1155TokenDetailsType = "ERC1155"
)
func (Erc1155TokenDetailsType) IsKnown ¶
func (r Erc1155TokenDetailsType) IsKnown() bool
type Erc20Diff ¶
type Erc20Diff struct { // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value,required"` // user friendly description of the asset transfer Summary string `json:"summary"` // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // value after divided by decimals, that was transferred from this address Value float64 `json:"value"` JSON erc20DiffJSON `json:"-"` }
func (*Erc20Diff) UnmarshalJSON ¶
type Erc20Exposure ¶
type Erc20Exposure struct { // the amount that was asked in the approval request for this spender from the // current address and asset Approval int64 `json:"approval,required"` Exposure []Erc20ExposureExposure `json:"exposure,required"` // the expiration time of the permit2 protocol Expiration time.Time `json:"expiration" format:"date-time"` // user friendly description of the approval Summary string `json:"summary"` JSON erc20ExposureJSON `json:"-"` }
func (*Erc20Exposure) UnmarshalJSON ¶
func (r *Erc20Exposure) UnmarshalJSON(data []byte) (err error)
type Erc20ExposureExposure ¶
type Erc20ExposureExposure struct { // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // user friendly description of the asset transfer Summary string `json:"summary"` // id of the token TokenID int64 `json:"token_id"` Value interface{} `json:"value,required"` // url of the token logo LogoURL string `json:"logo_url"` // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value"` JSON erc20ExposureExposureJSON `json:"-"` // contains filtered or unexported fields }
func (Erc20ExposureExposure) AsUnion ¶
func (r Erc20ExposureExposure) AsUnion() Erc20ExposureExposureUnion
func (*Erc20ExposureExposure) UnmarshalJSON ¶
func (r *Erc20ExposureExposure) UnmarshalJSON(data []byte) (err error)
type Erc20ExposureExposureUnion ¶
type Erc20ExposureExposureUnion interface {
// contains filtered or unexported methods
}
Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.
type Erc20TokenDetails ¶
type Erc20TokenDetails struct { // address of the token Address string `json:"address,required"` // asset's decimals Decimals int64 `json:"decimals,required"` // asset type. Type Erc20TokenDetailsType `json:"type,required"` // url of the token logo LogoURL string `json:"logo_url"` // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` JSON erc20TokenDetailsJSON `json:"-"` }
func (*Erc20TokenDetails) UnmarshalJSON ¶
func (r *Erc20TokenDetails) UnmarshalJSON(data []byte) (err error)
type Erc20TokenDetailsType ¶
type Erc20TokenDetailsType string
asset type.
const (
Erc20TokenDetailsTypeErc20 Erc20TokenDetailsType = "ERC20"
)
func (Erc20TokenDetailsType) IsKnown ¶
func (r Erc20TokenDetailsType) IsKnown() bool
type Erc721Diff ¶
type Erc721Diff struct { // id of the token TokenID int64 `json:"token_id,required"` // url of the token logo LogoURL string `json:"logo_url"` // user friendly description of the asset transfer Summary string `json:"summary"` // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` JSON erc721DiffJSON `json:"-"` }
func (*Erc721Diff) UnmarshalJSON ¶
func (r *Erc721Diff) UnmarshalJSON(data []byte) (err error)
type Erc721Exposure ¶
type Erc721Exposure struct { Exposure []Erc721ExposureExposure `json:"exposure,required"` // boolean indicates whether an is_approved_for_all function was used (missing in // case of ERC20 / ERC1155) IsApprovedForAll bool `json:"is_approved_for_all,required"` // user friendly description of the approval Summary string `json:"summary"` JSON erc721ExposureJSON `json:"-"` }
func (*Erc721Exposure) UnmarshalJSON ¶
func (r *Erc721Exposure) UnmarshalJSON(data []byte) (err error)
type Erc721ExposureExposure ¶
type Erc721ExposureExposure struct { // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // user friendly description of the asset transfer Summary string `json:"summary"` // id of the token TokenID int64 `json:"token_id"` Value interface{} `json:"value,required"` // url of the token logo LogoURL string `json:"logo_url"` // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value"` JSON erc721ExposureExposureJSON `json:"-"` // contains filtered or unexported fields }
func (Erc721ExposureExposure) AsUnion ¶
func (r Erc721ExposureExposure) AsUnion() Erc721ExposureExposureUnion
func (*Erc721ExposureExposure) UnmarshalJSON ¶
func (r *Erc721ExposureExposure) UnmarshalJSON(data []byte) (err error)
type Erc721ExposureExposureUnion ¶
type Erc721ExposureExposureUnion interface {
// contains filtered or unexported methods
}
Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.
type Erc721TokenDetails ¶
type Erc721TokenDetails struct { // address of the token Address string `json:"address,required"` // asset type. Type Erc721TokenDetailsType `json:"type,required"` // url of the token logo LogoURL string `json:"logo_url"` // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` JSON erc721TokenDetailsJSON `json:"-"` }
func (*Erc721TokenDetails) UnmarshalJSON ¶
func (r *Erc721TokenDetails) UnmarshalJSON(data []byte) (err error)
type Erc721TokenDetailsType ¶
type Erc721TokenDetailsType string
asset type.
const (
Erc721TokenDetailsTypeErc721 Erc721TokenDetailsType = "ERC721"
)
func (Erc721TokenDetailsType) IsKnown ¶
func (r Erc721TokenDetailsType) IsKnown() bool
type EvmJsonRpcScanParams ¶
type EvmJsonRpcScanParams struct { // The chain name Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"` // JSON-RPC request that was received by the wallet. Data param.Field[EvmJsonRpcScanParamsData] `json:"data,required"` // Object of additional information to validate against. Metadata param.Field[MetadataParam] `json:"metadata,required"` // The address of the account (wallet) received the request in hex string format AccountAddress param.Field[string] `json:"account_address"` // list of one or both of options for the desired output. "simulation" - include // simulation output in your response. "validation" - include security validation // of the transaction in your response. Default is ["validation"] Options param.Field[[]EvmJsonRpcScanParamsOption] `json:"options"` }
func (EvmJsonRpcScanParams) MarshalJSON ¶
func (r EvmJsonRpcScanParams) MarshalJSON() (data []byte, err error)
type EvmJsonRpcScanParamsData ¶
type EvmJsonRpcScanParamsData struct { // The method of the JSON-RPC request Method param.Field[string] `json:"method,required"` // The parameters of the JSON-RPC request in JSON format Params param.Field[[]interface{}] `json:"params,required"` }
JSON-RPC request that was received by the wallet.
func (EvmJsonRpcScanParamsData) MarshalJSON ¶
func (r EvmJsonRpcScanParamsData) MarshalJSON() (data []byte, err error)
type EvmJsonRpcScanParamsOption ¶
type EvmJsonRpcScanParamsOption string
An enumeration.
const ( EvmJsonRpcScanParamsOptionValidation EvmJsonRpcScanParamsOption = "validation" EvmJsonRpcScanParamsOptionSimulation EvmJsonRpcScanParamsOption = "simulation" EvmJsonRpcScanParamsOptionGasEstimation EvmJsonRpcScanParamsOption = "gas_estimation" EvmJsonRpcScanParamsOptionEvents EvmJsonRpcScanParamsOption = "events" )
func (EvmJsonRpcScanParamsOption) IsKnown ¶
func (r EvmJsonRpcScanParamsOption) IsKnown() bool
type EvmJsonRpcService ¶
type EvmJsonRpcService struct {
Options []option.RequestOption
}
EvmJsonRpcService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvmJsonRpcService method instead.
func NewEvmJsonRpcService ¶
func NewEvmJsonRpcService(opts ...option.RequestOption) (r *EvmJsonRpcService)
NewEvmJsonRpcService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvmJsonRpcService) Scan ¶
func (r *EvmJsonRpcService) Scan(ctx context.Context, body EvmJsonRpcScanParams, opts ...option.RequestOption) (res *TransactionScanResponse, err error)
Gets a json-rpc request and returns a full simulation indicating what will happen in the transaction together with a recommended action and some textual reasons of why the transaction was flagged that way.
type EvmService ¶
type EvmService struct { Options []option.RequestOption JsonRpc *EvmJsonRpcService Transaction *EvmTransactionService TransactionBulk *EvmTransactionBulkService TransactionRaw *EvmTransactionRawService UserOperation *EvmUserOperationService }
EvmService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvmService method instead.
func NewEvmService ¶
func NewEvmService(opts ...option.RequestOption) (r *EvmService)
NewEvmService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type EvmTransactionBulkScanParams ¶
type EvmTransactionBulkScanParams struct { // The chain name Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"` // Transaction bulk parameters Data param.Field[[]EvmTransactionBulkScanParamsData] `json:"data,required"` // Object of additional information to validate against. Metadata param.Field[MetadataParam] `json:"metadata,required"` // List of one or both of options for the desired output. "simulation" - include // simulation output in your response. "validation" - include security validation // of the transaction in your response. Default is ["validation"] Options param.Field[[]EvmTransactionBulkScanParamsOption] `json:"options"` }
func (EvmTransactionBulkScanParams) MarshalJSON ¶
func (r EvmTransactionBulkScanParams) MarshalJSON() (data []byte, err error)
type EvmTransactionBulkScanParamsData ¶
type EvmTransactionBulkScanParamsData struct { // The source address of the transaction in hex string format From param.Field[string] `json:"from,required"` // The encoded call data of the transaction in hex string format Data param.Field[string] `json:"data"` // The gas required for the transaction in hex string format. Gas param.Field[string] `json:"gas"` // The gas price for the transaction in hex string format. GasPrice param.Field[string] `json:"gas_price"` // The destination address of the transaction in hex string format To param.Field[string] `json:"to"` // The value of the transaction in Wei in hex string format Value param.Field[string] `json:"value"` }
func (EvmTransactionBulkScanParamsData) MarshalJSON ¶
func (r EvmTransactionBulkScanParamsData) MarshalJSON() (data []byte, err error)
type EvmTransactionBulkScanParamsOption ¶
type EvmTransactionBulkScanParamsOption string
An enumeration.
const ( EvmTransactionBulkScanParamsOptionValidation EvmTransactionBulkScanParamsOption = "validation" EvmTransactionBulkScanParamsOptionSimulation EvmTransactionBulkScanParamsOption = "simulation" EvmTransactionBulkScanParamsOptionGasEstimation EvmTransactionBulkScanParamsOption = "gas_estimation" EvmTransactionBulkScanParamsOptionEvents EvmTransactionBulkScanParamsOption = "events" )
func (EvmTransactionBulkScanParamsOption) IsKnown ¶
func (r EvmTransactionBulkScanParamsOption) IsKnown() bool
type EvmTransactionBulkService ¶
type EvmTransactionBulkService struct {
Options []option.RequestOption
}
EvmTransactionBulkService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvmTransactionBulkService method instead.
func NewEvmTransactionBulkService ¶
func NewEvmTransactionBulkService(opts ...option.RequestOption) (r *EvmTransactionBulkService)
NewEvmTransactionBulkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvmTransactionBulkService) Scan ¶
func (r *EvmTransactionBulkService) Scan(ctx context.Context, body EvmTransactionBulkScanParams, opts ...option.RequestOption) (res *[]TransactionScanResponse, err error)
Gets a bulk of transactions and returns a simulation showcasing the outcome after executing the transactions synchronously, along with a suggested course of action and textual explanations highlighting the reasons for flagging the bulk in that manner.
type EvmTransactionRawScanParams ¶
type EvmTransactionRawScanParams struct { // The address to relate the transaction to. Account address determines in which // perspective the transaction is simulated and validated. AccountAddress param.Field[string] `json:"account_address,required"` // The chain name Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"` // Hex string of the raw transaction data Data param.Field[string] `json:"data,required"` // Object of additional information to validate against. Metadata param.Field[MetadataParam] `json:"metadata,required"` // list of one or both of options for the desired output. "simulation" - include // simulation output in your response. "validation" - include security validation // of the transaction in your response. Default is ["validation"] Options param.Field[[]EvmTransactionRawScanParamsOption] `json:"options"` }
func (EvmTransactionRawScanParams) MarshalJSON ¶
func (r EvmTransactionRawScanParams) MarshalJSON() (data []byte, err error)
type EvmTransactionRawScanParamsOption ¶
type EvmTransactionRawScanParamsOption string
An enumeration.
const ( EvmTransactionRawScanParamsOptionValidation EvmTransactionRawScanParamsOption = "validation" EvmTransactionRawScanParamsOptionSimulation EvmTransactionRawScanParamsOption = "simulation" EvmTransactionRawScanParamsOptionGasEstimation EvmTransactionRawScanParamsOption = "gas_estimation" EvmTransactionRawScanParamsOptionEvents EvmTransactionRawScanParamsOption = "events" )
func (EvmTransactionRawScanParamsOption) IsKnown ¶
func (r EvmTransactionRawScanParamsOption) IsKnown() bool
type EvmTransactionRawService ¶
type EvmTransactionRawService struct {
Options []option.RequestOption
}
EvmTransactionRawService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvmTransactionRawService method instead.
func NewEvmTransactionRawService ¶
func NewEvmTransactionRawService(opts ...option.RequestOption) (r *EvmTransactionRawService)
NewEvmTransactionRawService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvmTransactionRawService) Scan ¶
func (r *EvmTransactionRawService) Scan(ctx context.Context, body EvmTransactionRawScanParams, opts ...option.RequestOption) (res *TransactionScanResponse, err error)
Gets a raw transaction and returns a full simulation indicating what will happen in the transaction together with a recommended action and some textual reasons of why the transaction was flagged that way.
type EvmTransactionScanParams ¶
type EvmTransactionScanParams struct { // The address to relate the transaction to. Account address determines in which // perspective the transaction is simulated and validated. AccountAddress param.Field[string] `json:"account_address,required"` // The chain name Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"` // Transaction parameters Data param.Field[EvmTransactionScanParamsData] `json:"data,required"` // Object of additional information to validate against. Metadata param.Field[MetadataParam] `json:"metadata,required"` // list of one or both of options for the desired output. "simulation" - include // simulation output in your response. "validation" - include security validation // of the transaction in your response. Default is ["validation"] Options param.Field[[]EvmTransactionScanParamsOption] `json:"options"` }
func (EvmTransactionScanParams) MarshalJSON ¶
func (r EvmTransactionScanParams) MarshalJSON() (data []byte, err error)
type EvmTransactionScanParamsData ¶
type EvmTransactionScanParamsData struct { // The source address of the transaction in hex string format From param.Field[string] `json:"from,required"` // The encoded call data of the transaction in hex string format Data param.Field[string] `json:"data"` // The gas required for the transaction in hex string format. Gas param.Field[string] `json:"gas"` // The gas price for the transaction in hex string format. GasPrice param.Field[string] `json:"gas_price"` // The destination address of the transaction in hex string format To param.Field[string] `json:"to"` // The value of the transaction in Wei in hex string format Value param.Field[string] `json:"value"` }
Transaction parameters
func (EvmTransactionScanParamsData) MarshalJSON ¶
func (r EvmTransactionScanParamsData) MarshalJSON() (data []byte, err error)
type EvmTransactionScanParamsOption ¶
type EvmTransactionScanParamsOption string
An enumeration.
const ( EvmTransactionScanParamsOptionValidation EvmTransactionScanParamsOption = "validation" EvmTransactionScanParamsOptionSimulation EvmTransactionScanParamsOption = "simulation" EvmTransactionScanParamsOptionGasEstimation EvmTransactionScanParamsOption = "gas_estimation" EvmTransactionScanParamsOptionEvents EvmTransactionScanParamsOption = "events" )
func (EvmTransactionScanParamsOption) IsKnown ¶
func (r EvmTransactionScanParamsOption) IsKnown() bool
type EvmTransactionService ¶
type EvmTransactionService struct {
Options []option.RequestOption
}
EvmTransactionService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvmTransactionService method instead.
func NewEvmTransactionService ¶
func NewEvmTransactionService(opts ...option.RequestOption) (r *EvmTransactionService)
NewEvmTransactionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvmTransactionService) Scan ¶
func (r *EvmTransactionService) Scan(ctx context.Context, body EvmTransactionScanParams, opts ...option.RequestOption) (res *TransactionScanResponse, err error)
Gets a transaction and returns a full simulation indicating what will happen in the transaction together with a recommended action and some textual reasons of why the transaction was flagged that way.
type EvmUserOperationScanParams ¶ added in v0.7.0
type EvmUserOperationScanParams struct { // The chain name Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"` // The user operation request that was received by the wallet Data param.Field[EvmUserOperationScanParamsData] `json:"data,required"` // Object of additional information to validate against. Metadata param.Field[MetadataParam] `json:"metadata,required"` // The address of the account (wallet) sending the request in hex string format AccountAddress param.Field[string] `json:"account_address"` // list of one or both of options for the desired output. "simulation" - include // simulation output in your response. "validation" - include security validation // of the transaction in your response. Default is ["validation"] Options param.Field[[]EvmUserOperationScanParamsOption] `json:"options"` }
func (EvmUserOperationScanParams) MarshalJSON ¶ added in v0.7.0
func (r EvmUserOperationScanParams) MarshalJSON() (data []byte, err error)
type EvmUserOperationScanParamsData ¶ added in v0.7.0
type EvmUserOperationScanParamsData struct { // The operation parameters of the user operation request Operation param.Field[EvmUserOperationScanParamsDataOperation] `json:"operation,required"` // The address of the entrypoint receiving the request in hex string format Entrypoint param.Field[string] `json:"entrypoint"` }
The user operation request that was received by the wallet
func (EvmUserOperationScanParamsData) MarshalJSON ¶ added in v0.7.0
func (r EvmUserOperationScanParamsData) MarshalJSON() (data []byte, err error)
type EvmUserOperationScanParamsDataOperation ¶ added in v0.7.0
type EvmUserOperationScanParamsDataOperation struct { // The call data value in hex string format. CallData param.Field[string] `json:"call_data"` // The call gas limit value in hex string format. CallGasLimit param.Field[string] `json:"call_gas_limit"` // The init code value in hex string format. InitCode param.Field[string] `json:"init_code"` // The max fee per gas value in hex string format. MaxFeePerGas param.Field[string] `json:"max_fee_per_gas"` // The max priority fee per gas value in hex string format. MaxPriorityFeePerGas param.Field[string] `json:"max_priority_fee_per_gas"` // The nonce value in hex string format. Nonce param.Field[string] `json:"nonce"` // The paymaster and data value in hex string format. PaymasterAndData param.Field[string] `json:"paymaster_and_data"` // The pre verification gas value in hex string format. PreVerificationGas param.Field[string] `json:"pre_verification_gas"` // The sender address of the operation in hex string format Sender param.Field[string] `json:"sender"` // The signature value in hex string format. Signature param.Field[string] `json:"signature"` // The verification gas limit value in hex string format. VerificationGasLimit param.Field[string] `json:"verification_gas_limit"` }
The operation parameters of the user operation request
func (EvmUserOperationScanParamsDataOperation) MarshalJSON ¶ added in v0.7.0
func (r EvmUserOperationScanParamsDataOperation) MarshalJSON() (data []byte, err error)
type EvmUserOperationScanParamsOption ¶ added in v0.7.0
type EvmUserOperationScanParamsOption string
An enumeration.
const ( EvmUserOperationScanParamsOptionValidation EvmUserOperationScanParamsOption = "validation" EvmUserOperationScanParamsOptionSimulation EvmUserOperationScanParamsOption = "simulation" EvmUserOperationScanParamsOptionGasEstimation EvmUserOperationScanParamsOption = "gas_estimation" EvmUserOperationScanParamsOptionEvents EvmUserOperationScanParamsOption = "events" )
func (EvmUserOperationScanParamsOption) IsKnown ¶ added in v0.7.0
func (r EvmUserOperationScanParamsOption) IsKnown() bool
type EvmUserOperationService ¶
type EvmUserOperationService struct {
Options []option.RequestOption
}
EvmUserOperationService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvmUserOperationService method instead.
func NewEvmUserOperationService ¶
func NewEvmUserOperationService(opts ...option.RequestOption) (r *EvmUserOperationService)
NewEvmUserOperationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EvmUserOperationService) Scan ¶ added in v0.7.0
func (r *EvmUserOperationService) Scan(ctx context.Context, body EvmUserOperationScanParams, opts ...option.RequestOption) (res *TransactionScanResponse, err error)
Gets a user operation request and returns a full simulation indicating what will happen in the transaction together with a recommended action and some textual reasons of why the transaction was flagged that way.
type MetadataParam ¶
type MetadataParam struct { // cross reference transaction against the domain. Domain param.Field[string] `json:"domain,required"` }
func (MetadataParam) MarshalJSON ¶
func (r MetadataParam) MarshalJSON() (data []byte, err error)
type NativeAssetDetails ¶ added in v0.7.3
type NativeAssetDetails struct { ChainID int64 `json:"chain_id,required"` ChainName string `json:"chain_name,required"` Decimals int64 `json:"decimals,required"` LogoURL string `json:"logo_url,required"` // asset type. Type NativeAssetDetailsType `json:"type,required"` // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` JSON nativeAssetDetailsJSON `json:"-"` }
func (*NativeAssetDetails) UnmarshalJSON ¶ added in v0.7.3
func (r *NativeAssetDetails) UnmarshalJSON(data []byte) (err error)
type NativeAssetDetailsType ¶ added in v0.7.3
type NativeAssetDetailsType string
asset type.
const (
NativeAssetDetailsTypeNative NativeAssetDetailsType = "NATIVE"
)
func (NativeAssetDetailsType) IsKnown ¶ added in v0.7.3
func (r NativeAssetDetailsType) IsKnown() bool
type NativeDiff ¶
type NativeDiff struct { // value before divided by decimal, that was transferred from this address RawValue int64 `json:"raw_value,required"` // user friendly description of the asset transfer Summary string `json:"summary"` // usd equal of the asset that was transferred from this address UsdPrice float64 `json:"usd_price"` // value after divided by decimals, that was transferred from this address Value float64 `json:"value"` JSON nativeDiffJSON `json:"-"` }
func (*NativeDiff) UnmarshalJSON ¶
func (r *NativeDiff) UnmarshalJSON(data []byte) (err error)
type NonercTokenDetails ¶
type NonercTokenDetails struct { // address of the token Address string `json:"address,required"` // asset type. Type NonercTokenDetailsType `json:"type,required"` // url of the token logo LogoURL string `json:"logo_url"` // string represents the name of the asset Name string `json:"name"` // asset's symbol name Symbol string `json:"symbol"` JSON nonercTokenDetailsJSON `json:"-"` }
func (*NonercTokenDetails) UnmarshalJSON ¶
func (r *NonercTokenDetails) UnmarshalJSON(data []byte) (err error)
type NonercTokenDetailsType ¶
type NonercTokenDetailsType string
asset type.
const (
NonercTokenDetailsTypeNonerc NonercTokenDetailsType = "NONERC"
)
func (NonercTokenDetailsType) IsKnown ¶
func (r NonercTokenDetailsType) IsKnown() bool
type SiteScanHitResponse ¶
type SiteScanHitResponse struct { AttackTypes map[string]SiteScanHitResponseAttackType `json:"attack_types,required"` ContractRead SiteScanHitResponseContractRead `json:"contract_read,required"` ContractWrite SiteScanHitResponseContractWrite `json:"contract_write,required"` IsMalicious bool `json:"is_malicious,required"` IsReachable bool `json:"is_reachable,required"` IsWeb3Site bool `json:"is_web3_site,required"` JsonRpcOperations []string `json:"json_rpc_operations,required"` MaliciousScore float64 `json:"malicious_score,required"` NetworkOperations []string `json:"network_operations,required"` ScanEndTime time.Time `json:"scan_end_time,required" format:"date-time"` ScanStartTime time.Time `json:"scan_start_time,required" format:"date-time"` Status SiteScanHitResponseStatus `json:"status,required"` URL string `json:"url,required"` JSON siteScanHitResponseJSON `json:"-"` }
func (*SiteScanHitResponse) UnmarshalJSON ¶
func (r *SiteScanHitResponse) UnmarshalJSON(data []byte) (err error)
type SiteScanHitResponseAttackType ¶
type SiteScanHitResponseAttackType struct { Score float64 `json:"score,required"` Threshold float64 `json:"threshold,required"` JSON siteScanHitResponseAttackTypeJSON `json:"-"` }
func (*SiteScanHitResponseAttackType) UnmarshalJSON ¶
func (r *SiteScanHitResponseAttackType) UnmarshalJSON(data []byte) (err error)
type SiteScanHitResponseContractRead ¶
type SiteScanHitResponseContractRead struct { ContractAddresses []string `json:"contract_addresses,required"` Functions map[string][]string `json:"functions,required"` JSON siteScanHitResponseContractReadJSON `json:"-"` }
func (*SiteScanHitResponseContractRead) UnmarshalJSON ¶
func (r *SiteScanHitResponseContractRead) UnmarshalJSON(data []byte) (err error)
type SiteScanHitResponseContractWrite ¶
type SiteScanHitResponseContractWrite struct { ContractAddresses []string `json:"contract_addresses,required"` Functions map[string][]string `json:"functions,required"` JSON siteScanHitResponseContractWriteJSON `json:"-"` }
func (*SiteScanHitResponseContractWrite) UnmarshalJSON ¶
func (r *SiteScanHitResponseContractWrite) UnmarshalJSON(data []byte) (err error)
type SiteScanHitResponseStatus ¶
type SiteScanHitResponseStatus string
const (
SiteScanHitResponseStatusHit SiteScanHitResponseStatus = "hit"
)
func (SiteScanHitResponseStatus) IsKnown ¶
func (r SiteScanHitResponseStatus) IsKnown() bool
type SiteScanMissResponse ¶
type SiteScanMissResponse struct { Status SiteScanMissResponseStatus `json:"status,required"` JSON siteScanMissResponseJSON `json:"-"` }
func (*SiteScanMissResponse) UnmarshalJSON ¶
func (r *SiteScanMissResponse) UnmarshalJSON(data []byte) (err error)
type SiteScanMissResponseStatus ¶
type SiteScanMissResponseStatus string
const (
SiteScanMissResponseStatusMiss SiteScanMissResponseStatus = "miss"
)
func (SiteScanMissResponseStatus) IsKnown ¶
func (r SiteScanMissResponseStatus) IsKnown() bool
type SiteScanParams ¶
type SiteScanParams struct { URL param.Field[string] `json:"url,required"` Metadata param.Field[SiteScanParamsMetadataUnion] `json:"metadata"` }
func (SiteScanParams) MarshalJSON ¶
func (r SiteScanParams) MarshalJSON() (data []byte, err error)
type SiteScanParamsMetadata ¶
type SiteScanParamsMetadata struct { Type param.Field[SiteScanParamsMetadataType] `json:"type,required"` AccountAddress param.Field[string] `json:"account_address"` }
func (SiteScanParamsMetadata) MarshalJSON ¶
func (r SiteScanParamsMetadata) MarshalJSON() (data []byte, err error)
type SiteScanParamsMetadataCatalogRequestMetadata ¶
type SiteScanParamsMetadataCatalogRequestMetadata struct {
Type param.Field[SiteScanParamsMetadataCatalogRequestMetadataType] `json:"type,required"`
}
func (SiteScanParamsMetadataCatalogRequestMetadata) MarshalJSON ¶
func (r SiteScanParamsMetadataCatalogRequestMetadata) MarshalJSON() (data []byte, err error)
type SiteScanParamsMetadataCatalogRequestMetadataType ¶
type SiteScanParamsMetadataCatalogRequestMetadataType string
const (
SiteScanParamsMetadataCatalogRequestMetadataTypeCatalog SiteScanParamsMetadataCatalogRequestMetadataType = "catalog"
)
func (SiteScanParamsMetadataCatalogRequestMetadataType) IsKnown ¶
func (r SiteScanParamsMetadataCatalogRequestMetadataType) IsKnown() bool
type SiteScanParamsMetadataType ¶
type SiteScanParamsMetadataType string
const (
SiteScanParamsMetadataTypeCatalog SiteScanParamsMetadataType = "catalog"
)
func (SiteScanParamsMetadataType) IsKnown ¶
func (r SiteScanParamsMetadataType) IsKnown() bool
type SiteScanParamsMetadataUnion ¶
type SiteScanParamsMetadataUnion interface {
// contains filtered or unexported methods
}
Satisfied by SiteScanParamsMetadataCatalogRequestMetadata, SiteScanParamsMetadataWalletRequestMetadata, SiteScanParamsMetadata.
type SiteScanParamsMetadataWalletRequestMetadata ¶
type SiteScanParamsMetadataWalletRequestMetadata struct { AccountAddress param.Field[string] `json:"account_address,required"` Type param.Field[SiteScanParamsMetadataWalletRequestMetadataType] `json:"type,required"` }
func (SiteScanParamsMetadataWalletRequestMetadata) MarshalJSON ¶
func (r SiteScanParamsMetadataWalletRequestMetadata) MarshalJSON() (data []byte, err error)
type SiteScanParamsMetadataWalletRequestMetadataType ¶
type SiteScanParamsMetadataWalletRequestMetadataType string
const (
SiteScanParamsMetadataWalletRequestMetadataTypeCatalog SiteScanParamsMetadataWalletRequestMetadataType = "catalog"
)
func (SiteScanParamsMetadataWalletRequestMetadataType) IsKnown ¶
func (r SiteScanParamsMetadataWalletRequestMetadataType) IsKnown() bool
type SiteScanResponse ¶
type SiteScanResponse struct { Status SiteScanResponseStatus `json:"status,required"` URL string `json:"url"` ScanStartTime time.Time `json:"scan_start_time" format:"date-time"` ScanEndTime time.Time `json:"scan_end_time" format:"date-time"` MaliciousScore float64 `json:"malicious_score"` IsReachable bool `json:"is_reachable"` IsWeb3Site bool `json:"is_web3_site"` IsMalicious bool `json:"is_malicious"` AttackTypes interface{} `json:"attack_types,required"` NetworkOperations interface{} `json:"network_operations,required"` JsonRpcOperations interface{} `json:"json_rpc_operations,required"` ContractWrite interface{} `json:"contract_write,required"` ContractRead interface{} `json:"contract_read,required"` JSON siteScanResponseJSON `json:"-"` // contains filtered or unexported fields }
func (SiteScanResponse) AsUnion ¶
func (r SiteScanResponse) AsUnion() SiteScanResponseUnion
func (*SiteScanResponse) UnmarshalJSON ¶
func (r *SiteScanResponse) UnmarshalJSON(data []byte) (err error)
type SiteScanResponseStatus ¶
type SiteScanResponseStatus string
const ( SiteScanResponseStatusHit SiteScanResponseStatus = "hit" SiteScanResponseStatusMiss SiteScanResponseStatus = "miss" )
func (SiteScanResponseStatus) IsKnown ¶
func (r SiteScanResponseStatus) IsKnown() bool
type SiteScanResponseUnion ¶
type SiteScanResponseUnion interface {
// contains filtered or unexported methods
}
Union satisfied by SiteScanHitResponse or SiteScanMissResponse.
type SiteService ¶
type SiteService struct {
Options []option.RequestOption
}
SiteService contains methods and other services that help with interacting with the blockaid API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSiteService method instead.
func NewSiteService ¶
func NewSiteService(opts ...option.RequestOption) (r *SiteService)
NewSiteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SiteService) Scan ¶
func (r *SiteService) Scan(ctx context.Context, body SiteScanParams, opts ...option.RequestOption) (res *SiteScanResponse, err error)
Scan Site
type TransactionScanFeature ¶
type TransactionScanFeature struct { // Textual description Description string `json:"description,required"` // Feature name FeatureID string `json:"feature_id,required"` // An enumeration. Type TransactionScanFeatureType `json:"type,required"` // Address the feature refers to Address string `json:"address"` JSON transactionScanFeatureJSON `json:"-"` }
func (*TransactionScanFeature) UnmarshalJSON ¶
func (r *TransactionScanFeature) UnmarshalJSON(data []byte) (err error)
type TransactionScanFeatureType ¶
type TransactionScanFeatureType string
An enumeration.
const ( TransactionScanFeatureTypeMalicious TransactionScanFeatureType = "Malicious" TransactionScanFeatureTypeWarning TransactionScanFeatureType = "Warning" TransactionScanFeatureTypeBenign TransactionScanFeatureType = "Benign" TransactionScanFeatureTypeInfo TransactionScanFeatureType = "Info" )
func (TransactionScanFeatureType) IsKnown ¶
func (r TransactionScanFeatureType) IsKnown() bool
type TransactionScanResponse ¶
type TransactionScanResponse struct { Block string `json:"block,required"` Chain string `json:"chain,required"` Events []TransactionScanResponseEvent `json:"events"` Features interface{} `json:"features"` GasEstimation TransactionScanResponseGasEstimation `json:"gas_estimation"` Simulation TransactionScanResponseSimulation `json:"simulation"` Validation TransactionScanResponseValidation `json:"validation"` JSON transactionScanResponseJSON `json:"-"` }
func (*TransactionScanResponse) UnmarshalJSON ¶
func (r *TransactionScanResponse) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseEvent ¶ added in v0.7.5
type TransactionScanResponseEvent struct { Data string `json:"data,required"` EmitterAddress string `json:"emitter_address,required"` Topics []string `json:"topics,required"` EmitterName string `json:"emitter_name"` Name string `json:"name"` Params []TransactionScanResponseEventsParam `json:"params"` JSON transactionScanResponseEventJSON `json:"-"` }
func (*TransactionScanResponseEvent) UnmarshalJSON ¶ added in v0.7.5
func (r *TransactionScanResponseEvent) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseEventsParam ¶ added in v0.7.5
type TransactionScanResponseEventsParam struct { Type string `json:"type,required"` Value TransactionScanResponseEventsParamsValueUnion `json:"value,required"` InternalType string `json:"internalType"` Name string `json:"name"` JSON transactionScanResponseEventsParamJSON `json:"-"` }
func (*TransactionScanResponseEventsParam) UnmarshalJSON ¶ added in v0.7.5
func (r *TransactionScanResponseEventsParam) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseEventsParamsValueArray ¶ added in v0.7.5
type TransactionScanResponseEventsParamsValueArray []interface{}
func (TransactionScanResponseEventsParamsValueArray) ImplementsTransactionScanResponseEventsParamsValueUnion ¶ added in v0.7.5
func (r TransactionScanResponseEventsParamsValueArray) ImplementsTransactionScanResponseEventsParamsValueUnion()
type TransactionScanResponseEventsParamsValueUnion ¶ added in v0.7.5
type TransactionScanResponseEventsParamsValueUnion interface {
ImplementsTransactionScanResponseEventsParamsValueUnion()
}
Union satisfied by shared.UnionString, [TransactionScanResponseEventsParamsValueUnknown] or TransactionScanResponseEventsParamsValueArray.
type TransactionScanResponseGasEstimation ¶ added in v0.7.5
type TransactionScanResponseGasEstimation struct { Used int64 `json:"used"` Estimate int64 `json:"estimate"` Error string `json:"error"` JSON transactionScanResponseGasEstimationJSON `json:"-"` // contains filtered or unexported fields }
func (TransactionScanResponseGasEstimation) AsUnion ¶ added in v0.7.5
func (r TransactionScanResponseGasEstimation) AsUnion() TransactionScanResponseGasEstimationUnion
func (*TransactionScanResponseGasEstimation) UnmarshalJSON ¶ added in v0.7.5
func (r *TransactionScanResponseGasEstimation) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseGasEstimationTransactionScanGasEstimation ¶ added in v0.7.5
type TransactionScanResponseGasEstimationTransactionScanGasEstimation struct { Estimate int64 `json:"estimate,required"` Used int64 `json:"used,required"` JSON transactionScanResponseGasEstimationTransactionScanGasEstimationJSON `json:"-"` }
func (*TransactionScanResponseGasEstimationTransactionScanGasEstimation) UnmarshalJSON ¶ added in v0.7.5
func (r *TransactionScanResponseGasEstimationTransactionScanGasEstimation) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseGasEstimationTransactionScanGasEstimationError ¶ added in v0.7.5
type TransactionScanResponseGasEstimationTransactionScanGasEstimationError struct { Error string `json:"error,required"` JSON transactionScanResponseGasEstimationTransactionScanGasEstimationErrorJSON `json:"-"` }
func (*TransactionScanResponseGasEstimationTransactionScanGasEstimationError) UnmarshalJSON ¶ added in v0.7.5
func (r *TransactionScanResponseGasEstimationTransactionScanGasEstimationError) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseGasEstimationUnion ¶ added in v0.7.5
type TransactionScanResponseGasEstimationUnion interface {
// contains filtered or unexported methods
}
Union satisfied by TransactionScanResponseGasEstimationTransactionScanGasEstimation or TransactionScanResponseGasEstimationTransactionScanGasEstimationError.
type TransactionScanResponseSimulation ¶
type TransactionScanResponseSimulation struct { AssetsDiffs interface{} `json:"assets_diffs,required"` TotalUsdDiff interface{} `json:"total_usd_diff,required"` Exposures interface{} `json:"exposures,required"` TotalUsdExposure interface{} `json:"total_usd_exposure,required"` AddressDetails interface{} `json:"address_details,required"` AccountSummary interface{} `json:"account_summary,required"` // An error message if the simulation failed. Error string `json:"error"` JSON transactionScanResponseSimulationJSON `json:"-"` // contains filtered or unexported fields }
func (TransactionScanResponseSimulation) AsUnion ¶
func (r TransactionScanResponseSimulation) AsUnion() TransactionScanResponseSimulationUnion
func (*TransactionScanResponseSimulation) UnmarshalJSON ¶
func (r *TransactionScanResponseSimulation) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseSimulationUnion ¶
type TransactionScanResponseSimulationUnion interface {
// contains filtered or unexported methods
}
Union satisfied by TransactionSimulation or TransactionSimulationError.
type TransactionScanResponseValidation ¶
type TransactionScanResponseValidation struct { // An enumeration. ResultType TransactionScanResponseValidationResultType `json:"result_type"` // A textual description that can be presented to the user about what this // transaction is doing. Description string `json:"description"` // A textual description about the reasons the transaction was flagged with // result_type. Reason string `json:"reason"` // A textual classification that can be presented to the user explaining the // reason. Classification string `json:"classification"` Features interface{} `json:"features,required"` Loc interface{} `json:"loc,required"` Msg string `json:"msg"` Type string `json:"type"` JSON transactionScanResponseValidationJSON `json:"-"` // contains filtered or unexported fields }
func (TransactionScanResponseValidation) AsUnion ¶
func (r TransactionScanResponseValidation) AsUnion() TransactionScanResponseValidationUnion
func (*TransactionScanResponseValidation) UnmarshalJSON ¶
func (r *TransactionScanResponseValidation) UnmarshalJSON(data []byte) (err error)
type TransactionScanResponseValidationResultType ¶
type TransactionScanResponseValidationResultType string
An enumeration.
const ( TransactionScanResponseValidationResultTypeBenign TransactionScanResponseValidationResultType = "Benign" TransactionScanResponseValidationResultTypeWarning TransactionScanResponseValidationResultType = "Warning" TransactionScanResponseValidationResultTypeMalicious TransactionScanResponseValidationResultType = "Malicious" )
func (TransactionScanResponseValidationResultType) IsKnown ¶
func (r TransactionScanResponseValidationResultType) IsKnown() bool
type TransactionScanResponseValidationUnion ¶
type TransactionScanResponseValidationUnion interface {
// contains filtered or unexported methods
}
Union satisfied by TransactionValidation or TransactionValidationError.
type TransactionScanSupportedChain ¶ added in v0.7.5
type TransactionScanSupportedChain string
The chain name
const ( TransactionScanSupportedChainArbitrum TransactionScanSupportedChain = "arbitrum" TransactionScanSupportedChainAvalanche TransactionScanSupportedChain = "avalanche" TransactionScanSupportedChainBase TransactionScanSupportedChain = "base" TransactionScanSupportedChainBaseSepolia TransactionScanSupportedChain = "base-sepolia" TransactionScanSupportedChainBsc TransactionScanSupportedChain = "bsc" TransactionScanSupportedChainEthereum TransactionScanSupportedChain = "ethereum" TransactionScanSupportedChainOptimism TransactionScanSupportedChain = "optimism" TransactionScanSupportedChainPolygon TransactionScanSupportedChain = "polygon" TransactionScanSupportedChainZksync TransactionScanSupportedChain = "zksync" TransactionScanSupportedChainZora TransactionScanSupportedChain = "zora" TransactionScanSupportedChainLinea TransactionScanSupportedChain = "linea" TransactionScanSupportedChainBlast TransactionScanSupportedChain = "blast" TransactionScanSupportedChainUnknown TransactionScanSupportedChain = "unknown" )
func (TransactionScanSupportedChain) IsKnown ¶ added in v0.7.5
func (r TransactionScanSupportedChain) IsKnown() bool
type TransactionSimulation ¶
type TransactionSimulation struct { // Account summary for the account address. account address is determined implicit // by the `from` field in the transaction request, or explicit by the // account_address field in the request. AccountSummary TransactionSimulationAccountSummary `json:"account_summary,required"` // a dictionary including additional information about each relevant address in the // transaction. AddressDetails map[string]TransactionSimulationAddressDetail `json:"address_details,required"` // dictionary describes the assets differences as a result of this transaction for // every involved address AssetsDiffs map[string][]AssetDiff `json:"assets_diffs,required"` // dictionary describes the exposure differences as a result of this transaction // for every involved address (as a result of any approval / setApproval / permit // function) Exposures map[string][]AddressAssetExposure `json:"exposures,required"` // dictionary represents the usd value each address gained / lost during this // transaction TotalUsdDiff map[string]UsdDiff `json:"total_usd_diff,required"` // a dictionary representing the usd value each address is exposed to, split by // spenders TotalUsdExposure map[string]map[string]string `json:"total_usd_exposure,required"` JSON transactionSimulationJSON `json:"-"` }
func (*TransactionSimulation) UnmarshalJSON ¶
func (r *TransactionSimulation) UnmarshalJSON(data []byte) (err error)
type TransactionSimulationAccountSummary ¶
type TransactionSimulationAccountSummary struct { // All assets diffs related to the account address AssetsDiffs []AssetDiff `json:"assets_diffs,required"` // All assets exposures related to the account address Exposures []AddressAssetExposure `json:"exposures,required"` // Total usd diff related to the account address TotalUsdDiff UsdDiff `json:"total_usd_diff,required"` // Total usd exposure related to the account address TotalUsdExposure map[string]string `json:"total_usd_exposure,required"` JSON transactionSimulationAccountSummaryJSON `json:"-"` }
Account summary for the account address. account address is determined implicit by the `from` field in the transaction request, or explicit by the account_address field in the request.
func (*TransactionSimulationAccountSummary) UnmarshalJSON ¶
func (r *TransactionSimulationAccountSummary) UnmarshalJSON(data []byte) (err error)
type TransactionSimulationAddressDetail ¶
type TransactionSimulationAddressDetail struct { // contains the contract's name if the address is a verified contract ContractName string `json:"contract_name"` // known name tag for the address NameTag string `json:"name_tag"` JSON transactionSimulationAddressDetailJSON `json:"-"` }
func (*TransactionSimulationAddressDetail) UnmarshalJSON ¶
func (r *TransactionSimulationAddressDetail) UnmarshalJSON(data []byte) (err error)
type TransactionSimulationError ¶ added in v0.7.3
type TransactionSimulationError struct { // An error message if the simulation failed. Error string `json:"error,required"` JSON transactionSimulationErrorJSON `json:"-"` }
func (*TransactionSimulationError) UnmarshalJSON ¶ added in v0.7.3
func (r *TransactionSimulationError) UnmarshalJSON(data []byte) (err error)
type TransactionValidation ¶
type TransactionValidation struct { // A list of features about this transaction explaining the validation. Features []TransactionScanFeature `json:"features,required"` // An enumeration. ResultType TransactionValidationResultType `json:"result_type,required"` // A textual classification that can be presented to the user explaining the // reason. Classification string `json:"classification"` // A textual description that can be presented to the user about what this // transaction is doing. Description string `json:"description"` // A textual description about the reasons the transaction was flagged with // result_type. Reason string `json:"reason"` JSON transactionValidationJSON `json:"-"` }
func (*TransactionValidation) UnmarshalJSON ¶
func (r *TransactionValidation) UnmarshalJSON(data []byte) (err error)
type TransactionValidationError ¶ added in v0.7.3
type TransactionValidationError struct { Loc []TransactionValidationErrorLocUnion `json:"loc,required"` Msg string `json:"msg,required"` Type string `json:"type,required"` JSON transactionValidationErrorJSON `json:"-"` }
func (*TransactionValidationError) UnmarshalJSON ¶ added in v0.7.3
func (r *TransactionValidationError) UnmarshalJSON(data []byte) (err error)
type TransactionValidationErrorLocUnion ¶ added in v0.7.5
type TransactionValidationErrorLocUnion interface {
ImplementsTransactionValidationErrorLocUnion()
}
Union satisfied by shared.UnionString or shared.UnionInt.
type TransactionValidationResultType ¶
type TransactionValidationResultType string
An enumeration.
const ( TransactionValidationResultTypeBenign TransactionValidationResultType = "Benign" TransactionValidationResultTypeWarning TransactionValidationResultType = "Warning" TransactionValidationResultTypeMalicious TransactionValidationResultType = "Malicious" )
func (TransactionValidationResultType) IsKnown ¶
func (r TransactionValidationResultType) IsKnown() bool