blockaidclientgo

package module
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Blockaid Go API Library

Go Reference

The Blockaid Go library provides convenient access to the Blockaid REST API from applications written in Go. The full API of this library can be found in api.md.

It is generated with Stainless.

Installation

import (
	"github.com/blockaid-official/blockaid-client-go" // imported as blockaidclientgo
)

Or to pin the version:

go get -u 'github.com/blockaid-official/blockaid-client-go@v0.16.0'

Requirements

This library requires Go 1.18+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/blockaid-official/blockaid-client-go"
	"github.com/blockaid-official/blockaid-client-go/option"
)

func main() {
	client := blockaidclientgo.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("BLOCKAID_CLIENT_API_KEY")
	)
	transactionScanResponse, err := client.Evm.JsonRpc.Scan(context.TODO(), blockaidclientgo.EvmJsonRpcScanParams{
		Chain: blockaidclientgo.F(blockaidclientgo.TransactionScanSupportedChainArbitrum),
		Data: blockaidclientgo.F(blockaidclientgo.EvmJsonRpcScanParamsData{
			Method: blockaidclientgo.F("eth_signTypedData_v4"),
			Params: blockaidclientgo.F([]interface{}{"0x49c73c9d361c04769a452E85D343b41aC38e0EE4", "{\"domain\":{\"chainId\":1,\"name\":\"Aave interest bearing WETH\",\"version\":\"1\",\"verifyingContract\":\"0x030ba81f1c18d280636f32af80b9aad02cf0854e\"},\"message\":{\"owner\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\",\"spender\":\"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd\",\"value\":\"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\"nonce\":\"0\",\"deadline\":\"1988064000\",\"holder\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\"},\"primaryType\":\"Permit\",\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Permit\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\"}]}}"}),
		}),
		Metadata: blockaidclientgo.F(blockaidclientgo.MetadataParam{
			Domain: blockaidclientgo.F("https://boredapeyartclub.com"),
		}),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", transactionScanResponse.Validation)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: blockaidclientgo.F("hello"),

	// Explicitly send `"description": null`
	Description: blockaidclientgo.Null[string](),

	Point: blockaidclientgo.F(blockaidclientgo.Point{
		X: blockaidclientgo.Int(0),
		Y: blockaidclientgo.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: blockaidclientgo.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the repsonse JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := blockaidclientgo.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Evm.JsonRpc.Scan(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *blockaidclientgo.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Evm.JsonRpc.Scan(context.TODO(), blockaidclientgo.EvmJsonRpcScanParams{
	Chain: blockaidclientgo.F(blockaidclientgo.TransactionScanSupportedChainArbitrum),
	Data: blockaidclientgo.F(blockaidclientgo.EvmJsonRpcScanParamsData{
		Method: blockaidclientgo.F("eth_signTypedData_v4"),
		Params: blockaidclientgo.F([]interface{}{"0x49c73c9d361c04769a452E85D343b41aC38e0EE4", "{\"domain\":{\"chainId\":1,\"name\":\"Aave interest bearing WETH\",\"version\":\"1\",\"verifyingContract\":\"0x030ba81f1c18d280636f32af80b9aad02cf0854e\"},\"message\":{\"owner\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\",\"spender\":\"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd\",\"value\":\"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\"nonce\":\"0\",\"deadline\":\"1988064000\",\"holder\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\"},\"primaryType\":\"Permit\",\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Permit\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\"}]}}"}),
	}),
	Metadata: blockaidclientgo.F(blockaidclientgo.MetadataParam{
		Domain: blockaidclientgo.F("https://boredapeyartclub.com"),
	}),
})
if err != nil {
	var apierr *blockaidclientgo.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/v0/evm/json-rpc/scan": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Evm.JsonRpc.Scan(
	ctx,
	blockaidclientgo.EvmJsonRpcScanParams{
		Chain: blockaidclientgo.F(blockaidclientgo.TransactionScanSupportedChainArbitrum),
		Data: blockaidclientgo.F(blockaidclientgo.EvmJsonRpcScanParamsData{
			Method: blockaidclientgo.F("eth_signTypedData_v4"),
			Params: blockaidclientgo.F([]interface{}{"0x49c73c9d361c04769a452E85D343b41aC38e0EE4", "{\"domain\":{\"chainId\":1,\"name\":\"Aave interest bearing WETH\",\"version\":\"1\",\"verifyingContract\":\"0x030ba81f1c18d280636f32af80b9aad02cf0854e\"},\"message\":{\"owner\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\",\"spender\":\"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd\",\"value\":\"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\"nonce\":\"0\",\"deadline\":\"1988064000\",\"holder\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\"},\"primaryType\":\"Permit\",\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Permit\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\"}]}}"}),
		}),
		Metadata: blockaidclientgo.F(blockaidclientgo.MetadataParam{
			Domain: blockaidclientgo.F("https://boredapeyartclub.com"),
		}),
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as param.Field[io.Reader]. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper blockaidclientgo.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := blockaidclientgo.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Evm.JsonRpc.Scan(
	context.TODO(),
	blockaidclientgo.EvmJsonRpcScanParams{
		Chain: blockaidclientgo.F(blockaidclientgo.TransactionScanSupportedChainArbitrum),
		Data: blockaidclientgo.F(blockaidclientgo.EvmJsonRpcScanParamsData{
			Method: blockaidclientgo.F("eth_signTypedData_v4"),
			Params: blockaidclientgo.F([]interface{}{"0x49c73c9d361c04769a452E85D343b41aC38e0EE4", "{\"domain\":{\"chainId\":1,\"name\":\"Aave interest bearing WETH\",\"version\":\"1\",\"verifyingContract\":\"0x030ba81f1c18d280636f32af80b9aad02cf0854e\"},\"message\":{\"owner\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\",\"spender\":\"0xa74cbd5b80f73b5950768c8dc467f1c6307c00fd\",\"value\":\"115792089237316195423570985008687907853269984665640564039457584007913129639935\",\"nonce\":\"0\",\"deadline\":\"1988064000\",\"holder\":\"0x49c73c9d361c04769a452E85D343b41aC38e0EE4\"},\"primaryType\":\"Permit\",\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Permit\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\"}]}}"}),
		}),
		Metadata: blockaidclientgo.F(blockaidclientgo.MetadataParam{
			Domain: blockaidclientgo.F("https://boredapeyartclub.com"),
		}),
	},
	option.WithMaxRetries(5),
)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]interface{}

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   blockaidclientgo.F("id_xxxx"),
    Data: blockaidclientgo.F(FooNewParamsData{
        FirstName: blockaidclientgo.F("John"),
    }),
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := blockaidclientgo.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func F

func F[T any](value T) param.Field[T]

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 FileParam

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

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).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AccountSummarySchema added in v0.12.0

type AccountSummarySchema struct {
	// Total USD diff for the requested account address
	TotalUsdDiff TotalUsdDiffSchema `json:"total_usd_diff,required"`
	// Assets diff of the requested account address
	AccountAssetsDiff []AccountSummarySchemaAccountAssetsDiff `json:"account_assets_diff"`
	// Delegated assets of the requested account address
	AccountDelegations []DelegatedAssetDetailsSchema `json:"account_delegations"`
	// Account ownerships diff of the requested account address
	AccountOwnershipsDiff []AccountSummarySchemaAccountOwnershipsDiff `json:"account_ownerships_diff"`
	JSON                  accountSummarySchemaJSON                    `json:"-"`
}

func (*AccountSummarySchema) UnmarshalJSON added in v0.12.0

func (r *AccountSummarySchema) UnmarshalJSON(data []byte) (err error)

type AccountSummarySchemaAccountAssetsDiff added in v0.12.0

type AccountSummarySchemaAccountAssetsDiff struct {
	// This field can have the runtime type of [NativeSolDetailsSchema],
	// [SplFungibleTokenDetailsSchema], [SplNonFungibleTokenDetailsSchema],
	// [CnftDetailsSchema].
	Asset interface{} `json:"asset"`
	// Incoming transfers of the asset
	In   AssetTransferDetailsSchema                `json:"in,nullable"`
	Out  AssetTransferDetailsSchema                `json:"out,nullable"`
	JSON accountSummarySchemaAccountAssetsDiffJSON `json:"-"`
	// contains filtered or unexported fields
}

func (AccountSummarySchemaAccountAssetsDiff) AsUnion added in v0.12.0

AsUnion returns a AccountSummarySchemaAccountAssetsDiffUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are NativeSolDiffSchema, SplFungibleTokenDiffSchema, SplNonFungibleTokenDiffSchema, CnftDiffSchema.

func (*AccountSummarySchemaAccountAssetsDiff) UnmarshalJSON added in v0.12.0

func (r *AccountSummarySchemaAccountAssetsDiff) UnmarshalJSON(data []byte) (err error)

type AccountSummarySchemaAccountAssetsDiffUnion added in v0.12.0

type AccountSummarySchemaAccountAssetsDiffUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by NativeSolDiffSchema, SplFungibleTokenDiffSchema, SplNonFungibleTokenDiffSchema or CnftDiffSchema.

type AccountSummarySchemaAccountOwnershipsDiff added in v0.12.0

type AccountSummarySchemaAccountOwnershipsDiff struct {
	// This field can have the runtime type of [NativeSolDetailsSchema],
	// [SplTokenOwnershipDiffSchemaAsset], [StakedSolAssetDetailsSchema].
	Asset interface{} `json:"asset,required"`
	// Incoming transfers of the asset
	In AssetTransferDetailsSchema `json:"in_,nullable"`
	// Details of the moved value
	Out AssetTransferDetailsSchema `json:"out,nullable"`
	// The owner prior to the transaction
	PreOwner string `json:"pre_owner,nullable"`
	// The owner post the transaction
	PostOwner string                                        `json:"post_owner,required"`
	JSON      accountSummarySchemaAccountOwnershipsDiffJSON `json:"-"`
	// contains filtered or unexported fields
}

func (AccountSummarySchemaAccountOwnershipsDiff) AsUnion added in v0.12.0

AsUnion returns a AccountSummarySchemaAccountOwnershipsDiffUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are NativeSolOwnershipDiffSchema, SplTokenOwnershipDiffSchema, StakedSolWithdrawAuthorityDiffSchema.

func (*AccountSummarySchemaAccountOwnershipsDiff) UnmarshalJSON added in v0.12.0

func (r *AccountSummarySchemaAccountOwnershipsDiff) UnmarshalJSON(data []byte) (err error)

type AccountSummarySchemaAccountOwnershipsDiffUnion added in v0.12.0

type AccountSummarySchemaAccountOwnershipsDiffUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by NativeSolOwnershipDiffSchema, SplTokenOwnershipDiffSchema or StakedSolWithdrawAuthorityDiffSchema.

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

AsUnion returns a AddressAssetExposureAssetUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc20TokenDetails, Erc1155TokenDetails, Erc721TokenDetails, NonercTokenDetails.

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 {
	// This field can have the runtime type of [[]Erc20ExposureExposure],
	// [[]Erc721ExposureExposure], [[]Erc1155ExposureExposure].
	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

AsUnion returns a AddressAssetExposureSpendersUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc20Exposure, Erc721Exposure, Erc1155Exposure.

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 AddressScanRequestSchemaMetadataParam added in v0.12.0

type AddressScanRequestSchemaMetadataParam struct {
	// URL of the dApp related to the address
	URL param.Field[string] `json:"url,required"`
}

func (AddressScanRequestSchemaMetadataParam) MarshalJSON added in v0.12.0

func (r AddressScanRequestSchemaMetadataParam) MarshalJSON() (data []byte, err error)

type AddressScanRequestSchemaParam added in v0.12.0

type AddressScanRequestSchemaParam struct {
	// Encoded public key
	Address  param.Field[string]                                `json:"address,required"`
	Metadata param.Field[AddressScanRequestSchemaMetadataParam] `json:"metadata,required"`
	// Chain to scan the transaction on
	Chain param.Field[string] `json:"chain"`
}

func (AddressScanRequestSchemaParam) MarshalJSON added in v0.12.0

func (r AddressScanRequestSchemaParam) MarshalJSON() (data []byte, err error)

type AddressScanResponseSchema added in v0.12.0

type AddressScanResponseSchema struct {
	// Features about the result
	Features []AddressScanResponseSchemaFeature `json:"features,required"`
	// An enumeration.
	ResultType AddressScanResponseSchemaResultType `json:"result_type,required"`
	JSON       addressScanResponseSchemaJSON       `json:"-"`
}

func (*AddressScanResponseSchema) UnmarshalJSON added in v0.12.0

func (r *AddressScanResponseSchema) UnmarshalJSON(data []byte) (err error)

type AddressScanResponseSchemaFeature added in v0.12.0

type AddressScanResponseSchemaFeature struct {
	// Description of the feature
	Description string `json:"description,required"`
	// ID of the feature
	FeatureID string `json:"feature_id,required"`
	// An enumeration.
	Type AddressScanResponseSchemaFeaturesType `json:"type,required"`
	JSON addressScanResponseSchemaFeatureJSON  `json:"-"`
}

func (*AddressScanResponseSchemaFeature) UnmarshalJSON added in v0.12.0

func (r *AddressScanResponseSchemaFeature) UnmarshalJSON(data []byte) (err error)

type AddressScanResponseSchemaFeaturesType added in v0.12.0

type AddressScanResponseSchemaFeaturesType string

An enumeration.

const (
	AddressScanResponseSchemaFeaturesTypeMalicious AddressScanResponseSchemaFeaturesType = "Malicious"
	AddressScanResponseSchemaFeaturesTypeWarning   AddressScanResponseSchemaFeaturesType = "Warning"
	AddressScanResponseSchemaFeaturesTypeBenign    AddressScanResponseSchemaFeaturesType = "Benign"
	AddressScanResponseSchemaFeaturesTypeInfo      AddressScanResponseSchemaFeaturesType = "Info"
)

func (AddressScanResponseSchemaFeaturesType) IsKnown added in v0.12.0

type AddressScanResponseSchemaResultType added in v0.12.0

type AddressScanResponseSchemaResultType string

An enumeration.

const (
	AddressScanResponseSchemaResultTypeMalicious AddressScanResponseSchemaResultType = "Malicious"
	AddressScanResponseSchemaResultTypeWarning   AddressScanResponseSchemaResultType = "Warning"
	AddressScanResponseSchemaResultTypeBenign    AddressScanResponseSchemaResultType = "Benign"
)

func (AddressScanResponseSchemaResultType) IsKnown added in v0.12.0

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

func (r *AssetDiff) UnmarshalJSON(data []byte) (err error)

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

AsUnion returns a AssetDiffAssetUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc20TokenDetails, Erc1155TokenDetails, Erc721TokenDetails, NonercTokenDetails, NativeAssetDetails.

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 string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string          `json:"raw_value"`
	JSON     assetDiffInJSON `json:"-"`
	// contains filtered or unexported fields
}

func (AssetDiffIn) AsUnion added in v0.7.3

func (r AssetDiffIn) AsUnion() AssetDiffInUnion

AsUnion returns a AssetDiffInUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

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 string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string           `json:"raw_value"`
	JSON     assetDiffOutJSON `json:"-"`
	// contains filtered or unexported fields
}

func (AssetDiffOut) AsUnion added in v0.7.3

func (r AssetDiffOut) AsUnion() AssetDiffOutUnion

AsUnion returns a AssetDiffOutUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

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 AssetTransferDetailsSchema added in v0.12.0

type AssetTransferDetailsSchema struct {
	// Raw value of the transfer
	RawValue int64 `json:"raw_value,required"`
	// Value of the transfer
	Value float64 `json:"value,required"`
	// Summarized description of the transfer
	Summary string `json:"summary,nullable"`
	// USD price of the asset
	UsdPrice float64                        `json:"usd_price,nullable"`
	JSON     assetTransferDetailsSchemaJSON `json:"-"`
}

func (*AssetTransferDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *AssetTransferDetailsSchema) UnmarshalJSON(data []byte) (err error)

type Client

type Client struct {
	Options []option.RequestOption
	Evm     *EvmService
	Solana  *SolanaService
	Stellar *StellarService
	Site    *SiteService
	Token   *TokenService
}

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.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CnftDetailsSchema added in v0.12.0

type CnftDetailsSchema struct {
	Address  string `json:"address,required"`
	Decimals int64  `json:"decimals,required"`
	Name     string `json:"name,required"`
	Symbol   string `json:"symbol,required"`
	// Type of the asset (`"CNFT"`)
	Type string                `json:"type"`
	JSON cnftDetailsSchemaJSON `json:"-"`
}

func (*CnftDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *CnftDetailsSchema) UnmarshalJSON(data []byte) (err error)

type CnftDiffSchema added in v0.12.0

type CnftDiffSchema struct {
	Asset CnftDetailsSchema `json:"asset,required"`
	// Incoming transfers of the asset
	In   AssetTransferDetailsSchema `json:"in,nullable"`
	Out  AssetTransferDetailsSchema `json:"out,nullable"`
	JSON cnftDiffSchemaJSON         `json:"-"`
}

func (*CnftDiffSchema) UnmarshalJSON added in v0.12.0

func (r *CnftDiffSchema) UnmarshalJSON(data []byte) (err error)

type CnftMintAccountDetailsSchema added in v0.12.0

type CnftMintAccountDetailsSchema struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Name of the mint
	Name string `json:"name,required"`
	// Symbol of the mint
	Symbol string `json:"symbol,required"`
	// URI of the mint
	Uri string `json:"uri,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string `json:"description,nullable"`
	// Logo of the mint
	Type CnftMintAccountDetailsSchemaType `json:"type"`
	JSON cnftMintAccountDetailsSchemaJSON `json:"-"`
}

func (*CnftMintAccountDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *CnftMintAccountDetailsSchema) UnmarshalJSON(data []byte) (err error)

type CnftMintAccountDetailsSchemaType added in v0.12.0

type CnftMintAccountDetailsSchemaType string
const (
	CnftMintAccountDetailsSchemaTypeCnftMintAccount CnftMintAccountDetailsSchemaType = "CNFT_MINT_ACCOUNT"
)

func (CnftMintAccountDetailsSchemaType) IsKnown added in v0.12.0

type CombinedValidationResult added in v0.12.0

type CombinedValidationResult struct {
	// Transaction validation result
	Validation CombinedValidationResultValidation `json:"validation,required"`
	// Transaction simulation result
	Simulation SuccessfulSimulationResultSchema `json:"simulation,nullable"`
	JSON       combinedValidationResultJSON     `json:"-"`
}

func (*CombinedValidationResult) UnmarshalJSON added in v0.12.0

func (r *CombinedValidationResult) UnmarshalJSON(data []byte) (err error)

type CombinedValidationResultValidation added in v0.12.0

type CombinedValidationResultValidation struct {
	// A list of features about this transaction explaining the validation
	Features []string `json:"features,required"`
	// An enumeration.
	Reason CombinedValidationResultValidationReason `json:"reason,required"`
	// An enumeration.
	Verdict CombinedValidationResultValidationVerdict `json:"verdict,required"`
	JSON    combinedValidationResultValidationJSON    `json:"-"`
}

Transaction validation result

func (*CombinedValidationResultValidation) UnmarshalJSON added in v0.12.0

func (r *CombinedValidationResultValidation) UnmarshalJSON(data []byte) (err error)

type CombinedValidationResultValidationReason added in v0.12.0

type CombinedValidationResultValidationReason string

An enumeration.

const (
	CombinedValidationResultValidationReasonEmpty                   CombinedValidationResultValidationReason = ""
	CombinedValidationResultValidationReasonSharedStateInBulk       CombinedValidationResultValidationReason = "shared_state_in_bulk"
	CombinedValidationResultValidationReasonUnknownProfiter         CombinedValidationResultValidationReason = "unknown_profiter"
	CombinedValidationResultValidationReasonUnfairTrade             CombinedValidationResultValidationReason = "unfair_trade"
	CombinedValidationResultValidationReasonTransferFarming         CombinedValidationResultValidationReason = "transfer_farming"
	CombinedValidationResultValidationReasonWritableAccountsFarming CombinedValidationResultValidationReason = "writable_accounts_farming"
	CombinedValidationResultValidationReasonNativeOwnershipChange   CombinedValidationResultValidationReason = "native_ownership_change"
	CombinedValidationResultValidationReasonSplTokenOwnershipChange CombinedValidationResultValidationReason = "spl_token_ownership_change"
	CombinedValidationResultValidationReasonExposureFarming         CombinedValidationResultValidationReason = "exposure_farming"
	CombinedValidationResultValidationReasonKnownAttacker           CombinedValidationResultValidationReason = "known_attacker"
	CombinedValidationResultValidationReasonInvalidSignature        CombinedValidationResultValidationReason = "invalid_signature"
	CombinedValidationResultValidationReasonOther                   CombinedValidationResultValidationReason = "other"
)

func (CombinedValidationResultValidationReason) IsKnown added in v0.12.0

type CombinedValidationResultValidationVerdict added in v0.12.0

type CombinedValidationResultValidationVerdict string

An enumeration.

const (
	CombinedValidationResultValidationVerdictBenign    CombinedValidationResultValidationVerdict = "Benign"
	CombinedValidationResultValidationVerdictWarning   CombinedValidationResultValidationVerdict = "Warning"
	CombinedValidationResultValidationVerdictMalicious CombinedValidationResultValidationVerdict = "Malicious"
)

func (CombinedValidationResultValidationVerdict) IsKnown added in v0.12.0

type DelegatedAssetDetailsSchema added in v0.12.0

type DelegatedAssetDetailsSchema struct {
	Asset DelegatedAssetDetailsSchemaAsset `json:"asset,required"`
	// The delegate's address
	Delegate string `json:"delegate,required"`
	// Details of the delegation
	Delegation AssetTransferDetailsSchema      `json:"delegation,required"`
	JSON       delegatedAssetDetailsSchemaJSON `json:"-"`
}

func (*DelegatedAssetDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *DelegatedAssetDetailsSchema) UnmarshalJSON(data []byte) (err error)

type DelegatedAssetDetailsSchemaAsset added in v0.12.0

type DelegatedAssetDetailsSchemaAsset struct {
	Address string `json:"address,required"`
	Symbol  string `json:"symbol,required"`
	Name    string `json:"name,required"`
	// Type of the asset (`"TOKEN"`)
	Type     string                               `json:"type"`
	Decimals int64                                `json:"decimals"`
	JSON     delegatedAssetDetailsSchemaAssetJSON `json:"-"`
	// contains filtered or unexported fields
}

func (DelegatedAssetDetailsSchemaAsset) AsUnion added in v0.12.0

AsUnion returns a DelegatedAssetDetailsSchemaAssetUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are SplFungibleTokenDetailsSchema, SplNonFungibleTokenDetailsSchema, CnftDetailsSchema.

func (*DelegatedAssetDetailsSchemaAsset) UnmarshalJSON added in v0.12.0

func (r *DelegatedAssetDetailsSchemaAsset) UnmarshalJSON(data []byte) (err error)

type DelegatedAssetDetailsSchemaAssetUnion added in v0.12.0

type DelegatedAssetDetailsSchemaAssetUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by SplFungibleTokenDetailsSchema, SplNonFungibleTokenDetailsSchema or CnftDetailsSchema.

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 string `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 string          `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 string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string                      `json:"raw_value"`
	JSON     erc1155ExposureExposureJSON `json:"-"`
	// contains filtered or unexported fields
}

func (Erc1155ExposureExposure) AsUnion

AsUnion returns a Erc1155ExposureExposureUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

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 string `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 string `json:"usd_price"`
	// value after divided by decimals, that was transferred from this address
	Value string        `json:"value"`
	JSON  erc20DiffJSON `json:"-"`
}

func (*Erc20Diff) UnmarshalJSON

func (r *Erc20Diff) UnmarshalJSON(data []byte) (err error)

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 string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string                    `json:"raw_value"`
	JSON     erc20ExposureExposureJSON `json:"-"`
	// contains filtered or unexported fields
}

func (Erc20ExposureExposure) AsUnion

AsUnion returns a Erc20ExposureExposureUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

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 string         `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 string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string                     `json:"raw_value"`
	JSON     erc721ExposureExposureJSON `json:"-"`
	// contains filtered or unexported fields
}

func (Erc721ExposureExposure) AsUnion

AsUnion returns a Erc721ExposureExposureUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

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 Error

type Error = apierror.Error

type EvmJsonRpcScanParams

type EvmJsonRpcScanParams struct {
	// The chain name or chain ID
	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"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmJsonRpcScanParamsBlockUnion] `json:"block"`
	// 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 EvmJsonRpcScanParamsBlockUnion added in v0.13.0

type EvmJsonRpcScanParamsBlockUnion interface {
	ImplementsEvmJsonRpcScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

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

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 EvmPostTransactionBulkScanParams added in v0.11.0

type EvmPostTransactionBulkScanParams struct {
	// The chain name or chain ID
	Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"`
	// Transaction hashes to scan
	Data param.Field[[]string] `json:"data,required"`
	// Object of additional information to validate against.
	Metadata param.Field[MetadataParam] `json:"metadata,required"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmPostTransactionBulkScanParamsBlockUnion] `json:"block"`
	// 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[[]EvmPostTransactionBulkScanParamsOption] `json:"options"`
}

func (EvmPostTransactionBulkScanParams) MarshalJSON added in v0.11.0

func (r EvmPostTransactionBulkScanParams) MarshalJSON() (data []byte, err error)

type EvmPostTransactionBulkScanParamsBlockUnion added in v0.13.0

type EvmPostTransactionBulkScanParamsBlockUnion interface {
	ImplementsEvmPostTransactionBulkScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

type EvmPostTransactionBulkScanParamsOption added in v0.11.0

type EvmPostTransactionBulkScanParamsOption string

An enumeration.

const (
	EvmPostTransactionBulkScanParamsOptionValidation    EvmPostTransactionBulkScanParamsOption = "validation"
	EvmPostTransactionBulkScanParamsOptionSimulation    EvmPostTransactionBulkScanParamsOption = "simulation"
	EvmPostTransactionBulkScanParamsOptionGasEstimation EvmPostTransactionBulkScanParamsOption = "gas_estimation"
	EvmPostTransactionBulkScanParamsOptionEvents        EvmPostTransactionBulkScanParamsOption = "events"
)

func (EvmPostTransactionBulkScanParamsOption) IsKnown added in v0.11.0

type EvmPostTransactionBulkService added in v0.11.0

type EvmPostTransactionBulkService struct {
	Options []option.RequestOption
}

EvmPostTransactionBulkService 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 NewEvmPostTransactionBulkService method instead.

func NewEvmPostTransactionBulkService added in v0.11.0

func NewEvmPostTransactionBulkService(opts ...option.RequestOption) (r *EvmPostTransactionBulkService)

NewEvmPostTransactionBulkService 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 (*EvmPostTransactionBulkService) Scan added in v0.11.0

Scan transactions that were already executed on chain, returns validation with features indicating address poisoning entites and malicious operators.

type EvmPostTransactionReportParams added in v0.15.0

type EvmPostTransactionReportParams struct {
	// Details about the report.
	Details param.Field[string] `json:"details,required"`
	// An enumeration.
	Event param.Field[EvmPostTransactionReportParamsEvent] `json:"event,required"`
	// The report parameters.
	Report param.Field[EvmPostTransactionReportParamsReportUnion] `json:"report,required"`
}

func (EvmPostTransactionReportParams) MarshalJSON added in v0.15.0

func (r EvmPostTransactionReportParams) MarshalJSON() (data []byte, err error)

type EvmPostTransactionReportParamsEvent added in v0.15.0

type EvmPostTransactionReportParamsEvent string

An enumeration.

const (
	EvmPostTransactionReportParamsEventFalsePositive EvmPostTransactionReportParamsEvent = "FALSE_POSITIVE"
	EvmPostTransactionReportParamsEventFalseNegative EvmPostTransactionReportParamsEvent = "FALSE_NEGATIVE"
)

func (EvmPostTransactionReportParamsEvent) IsKnown added in v0.15.0

type EvmPostTransactionReportParamsReport added in v0.15.0

type EvmPostTransactionReportParamsReport struct {
	Type      param.Field[EvmPostTransactionReportParamsReportType] `json:"type,required"`
	Params    param.Field[interface{}]                              `json:"params,required"`
	RequestID param.Field[string]                                   `json:"request_id"`
}

The report parameters.

func (EvmPostTransactionReportParamsReport) MarshalJSON added in v0.15.0

func (r EvmPostTransactionReportParamsReport) MarshalJSON() (data []byte, err error)

type EvmPostTransactionReportParamsReportParamReportChainTransactionHashParams added in v0.15.0

type EvmPostTransactionReportParamsReportParamReportChainTransactionHashParams struct {
	Params param.Field[EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsParams] `json:"params,required"`
	Type   param.Field[EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsType]   `json:"type,required"`
}

func (EvmPostTransactionReportParamsReportParamReportChainTransactionHashParams) MarshalJSON added in v0.15.0

type EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsParams added in v0.15.0

type EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsParams struct {
	// The chain name
	Chain param.Field[TransactionScanSupportedChain] `json:"chain,required"`
	// The transaction hash to report on.
	TxHash param.Field[string] `json:"tx_hash,required"`
}

func (EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsParams) MarshalJSON added in v0.15.0

type EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsType added in v0.15.0

type EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsType string
const (
	EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsTypeParams EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsType = "params"
)

func (EvmPostTransactionReportParamsReportParamReportChainTransactionHashParamsType) IsKnown added in v0.15.0

type EvmPostTransactionReportParamsReportRequestIDReport added in v0.15.0

type EvmPostTransactionReportParamsReportRequestIDReport struct {
	RequestID param.Field[string]                                                  `json:"request_id,required"`
	Type      param.Field[EvmPostTransactionReportParamsReportRequestIDReportType] `json:"type,required"`
}

func (EvmPostTransactionReportParamsReportRequestIDReport) MarshalJSON added in v0.15.0

func (r EvmPostTransactionReportParamsReportRequestIDReport) MarshalJSON() (data []byte, err error)

type EvmPostTransactionReportParamsReportRequestIDReportType added in v0.15.0

type EvmPostTransactionReportParamsReportRequestIDReportType string
const (
	EvmPostTransactionReportParamsReportRequestIDReportTypeRequestID EvmPostTransactionReportParamsReportRequestIDReportType = "request_id"
)

func (EvmPostTransactionReportParamsReportRequestIDReportType) IsKnown added in v0.15.0

type EvmPostTransactionReportParamsReportType added in v0.15.0

type EvmPostTransactionReportParamsReportType string
const (
	EvmPostTransactionReportParamsReportTypeParams    EvmPostTransactionReportParamsReportType = "params"
	EvmPostTransactionReportParamsReportTypeRequestID EvmPostTransactionReportParamsReportType = "request_id"
)

func (EvmPostTransactionReportParamsReportType) IsKnown added in v0.15.0

type EvmPostTransactionReportParamsReportUnion added in v0.15.0

type EvmPostTransactionReportParamsReportUnion interface {
	// contains filtered or unexported methods
}

The report parameters.

Satisfied by EvmPostTransactionReportParamsReportParamReportChainTransactionHashParams, EvmPostTransactionReportParamsReportRequestIDReport, EvmPostTransactionReportParamsReport.

type EvmPostTransactionReportResponse added in v0.15.0

type EvmPostTransactionReportResponse = interface{}

type EvmPostTransactionScanParams added in v0.11.0

type EvmPostTransactionScanParams struct {
	// The chain name or chain ID
	Chain param.Field[TransactionScanSupportedChain]    `json:"chain,required"`
	Data  param.Field[EvmPostTransactionScanParamsData] `json:"data,required"`
	// Object of additional information to validate against.
	Metadata param.Field[MetadataParam] `json:"metadata,required"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmPostTransactionScanParamsBlockUnion] `json:"block"`
	// 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[[]EvmPostTransactionScanParamsOption] `json:"options"`
}

func (EvmPostTransactionScanParams) MarshalJSON added in v0.11.0

func (r EvmPostTransactionScanParams) MarshalJSON() (data []byte, err error)

type EvmPostTransactionScanParamsBlockUnion added in v0.13.0

type EvmPostTransactionScanParamsBlockUnion interface {
	ImplementsEvmPostTransactionScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

type EvmPostTransactionScanParamsData added in v0.11.0

type EvmPostTransactionScanParamsData struct {
	// The transaction hash to scan
	TxHash param.Field[string] `json:"tx_hash,required"`
}

func (EvmPostTransactionScanParamsData) MarshalJSON added in v0.11.0

func (r EvmPostTransactionScanParamsData) MarshalJSON() (data []byte, err error)

type EvmPostTransactionScanParamsOption added in v0.11.0

type EvmPostTransactionScanParamsOption string

An enumeration.

const (
	EvmPostTransactionScanParamsOptionValidation    EvmPostTransactionScanParamsOption = "validation"
	EvmPostTransactionScanParamsOptionSimulation    EvmPostTransactionScanParamsOption = "simulation"
	EvmPostTransactionScanParamsOptionGasEstimation EvmPostTransactionScanParamsOption = "gas_estimation"
	EvmPostTransactionScanParamsOptionEvents        EvmPostTransactionScanParamsOption = "events"
)

func (EvmPostTransactionScanParamsOption) IsKnown added in v0.11.0

type EvmPostTransactionService added in v0.11.0

type EvmPostTransactionService struct {
	Options []option.RequestOption
}

EvmPostTransactionService 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 NewEvmPostTransactionService method instead.

func NewEvmPostTransactionService added in v0.11.0

func NewEvmPostTransactionService(opts ...option.RequestOption) (r *EvmPostTransactionService)

NewEvmPostTransactionService 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 (*EvmPostTransactionService) Report added in v0.15.0

Report for misclassification of an EVM post transaction.

func (*EvmPostTransactionService) Scan added in v0.11.0

Scan a transaction that was already executed on chain, returns validation with features indicating address poisoning entites and malicious operators.

type EvmService

type EvmService struct {
	Options             []option.RequestOption
	JsonRpc             *EvmJsonRpcService
	Transaction         *EvmTransactionService
	TransactionBulk     *EvmTransactionBulkService
	TransactionRaw      *EvmTransactionRawService
	UserOperation       *EvmUserOperationService
	PostTransaction     *EvmPostTransactionService
	PostTransactionBulk *EvmPostTransactionBulkService
}

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 or chain ID
	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"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmTransactionBulkScanParamsBlockUnion] `json:"block"`
	// 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 EvmTransactionBulkScanParamsBlockUnion added in v0.13.0

type EvmTransactionBulkScanParamsBlockUnion interface {
	ImplementsEvmTransactionBulkScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

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

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

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 or chain ID
	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"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmTransactionRawScanParamsBlockUnion] `json:"block"`
	// 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 EvmTransactionRawScanParamsBlockUnion added in v0.13.0

type EvmTransactionRawScanParamsBlockUnion interface {
	ImplementsEvmTransactionRawScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

type EvmTransactionRawScanParamsOption

type EvmTransactionRawScanParamsOption string

An enumeration.

const (
	EvmTransactionRawScanParamsOptionValidation    EvmTransactionRawScanParamsOption = "validation"
	EvmTransactionRawScanParamsOptionSimulation    EvmTransactionRawScanParamsOption = "simulation"
	EvmTransactionRawScanParamsOptionGasEstimation EvmTransactionRawScanParamsOption = "gas_estimation"
	EvmTransactionRawScanParamsOptionEvents        EvmTransactionRawScanParamsOption = "events"
)

func (EvmTransactionRawScanParamsOption) IsKnown

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

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 EvmTransactionReportParams added in v0.15.0

type EvmTransactionReportParams struct {
	// Details about the report.
	Details param.Field[string] `json:"details,required"`
	// An enumeration.
	Event param.Field[EvmTransactionReportParamsEvent] `json:"event,required"`
	// The report parameters.
	Report param.Field[EvmTransactionReportParamsReportUnion] `json:"report,required"`
}

func (EvmTransactionReportParams) MarshalJSON added in v0.15.0

func (r EvmTransactionReportParams) MarshalJSON() (data []byte, err error)

type EvmTransactionReportParamsEvent added in v0.15.0

type EvmTransactionReportParamsEvent string

An enumeration.

const (
	EvmTransactionReportParamsEventFalsePositive EvmTransactionReportParamsEvent = "FALSE_POSITIVE"
	EvmTransactionReportParamsEventFalseNegative EvmTransactionReportParamsEvent = "FALSE_NEGATIVE"
)

func (EvmTransactionReportParamsEvent) IsKnown added in v0.15.0

type EvmTransactionReportParamsReport added in v0.15.0

type EvmTransactionReportParamsReport struct {
	Type      param.Field[EvmTransactionReportParamsReportType] `json:"type,required"`
	Params    param.Field[interface{}]                          `json:"params,required"`
	RequestID param.Field[string]                               `json:"request_id"`
}

The report parameters.

func (EvmTransactionReportParamsReport) MarshalJSON added in v0.15.0

func (r EvmTransactionReportParamsReport) MarshalJSON() (data []byte, err error)

type EvmTransactionReportParamsReportParamReportTransactionReportParams added in v0.15.0

type EvmTransactionReportParamsReportParamReportTransactionReportParams struct {
	Params param.Field[EvmTransactionReportParamsReportParamReportTransactionReportParamsParams] `json:"params,required"`
	Type   param.Field[EvmTransactionReportParamsReportParamReportTransactionReportParamsType]   `json:"type,required"`
}

func (EvmTransactionReportParamsReportParamReportTransactionReportParams) MarshalJSON added in v0.15.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParams added in v0.15.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParams 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[EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataUnion] `json:"data,required"`
	// Object of additional information to validate against.
	Metadata param.Field[MetadataParam] `json:"metadata,required"`
}

func (EvmTransactionReportParamsReportParamReportTransactionReportParamsParams) MarshalJSON added in v0.15.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsData added in v0.16.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsData struct {
	// The source address of the transaction in hex string format
	From param.Field[string] `json:"from"`
	// The destination address of the transaction in hex string format
	To param.Field[string] `json:"to"`
	// The encoded call data of the transaction in hex string format
	Data param.Field[string] `json:"data"`
	// The value of the transaction in Wei in hex string format
	Value param.Field[string] `json:"value"`
	// 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 method of the JSON-RPC request
	Method param.Field[string]      `json:"method"`
	Params param.Field[interface{}] `json:"params,required"`
}

Transaction parameters

func (EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsData) MarshalJSON added in v0.16.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataJsonRpc added in v0.16.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataJsonRpc 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"`
}

func (EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataJsonRpc) MarshalJSON added in v0.16.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataTransaction added in v0.16.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataTransaction 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 (EvmTransactionReportParamsReportParamReportTransactionReportParamsParamsDataTransaction) MarshalJSON added in v0.16.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsType added in v0.15.0

type EvmTransactionReportParamsReportParamReportTransactionReportParamsType string
const (
	EvmTransactionReportParamsReportParamReportTransactionReportParamsTypeParams EvmTransactionReportParamsReportParamReportTransactionReportParamsType = "params"
)

func (EvmTransactionReportParamsReportParamReportTransactionReportParamsType) IsKnown added in v0.15.0

type EvmTransactionReportParamsReportRequestIDReport added in v0.15.0

type EvmTransactionReportParamsReportRequestIDReport struct {
	RequestID param.Field[string]                                              `json:"request_id,required"`
	Type      param.Field[EvmTransactionReportParamsReportRequestIDReportType] `json:"type,required"`
}

func (EvmTransactionReportParamsReportRequestIDReport) MarshalJSON added in v0.15.0

func (r EvmTransactionReportParamsReportRequestIDReport) MarshalJSON() (data []byte, err error)

type EvmTransactionReportParamsReportRequestIDReportType added in v0.15.0

type EvmTransactionReportParamsReportRequestIDReportType string
const (
	EvmTransactionReportParamsReportRequestIDReportTypeRequestID EvmTransactionReportParamsReportRequestIDReportType = "request_id"
)

func (EvmTransactionReportParamsReportRequestIDReportType) IsKnown added in v0.15.0

type EvmTransactionReportParamsReportType added in v0.15.0

type EvmTransactionReportParamsReportType string
const (
	EvmTransactionReportParamsReportTypeParams    EvmTransactionReportParamsReportType = "params"
	EvmTransactionReportParamsReportTypeRequestID EvmTransactionReportParamsReportType = "request_id"
)

func (EvmTransactionReportParamsReportType) IsKnown added in v0.15.0

type EvmTransactionReportParamsReportUnion added in v0.15.0

type EvmTransactionReportParamsReportUnion interface {
	// contains filtered or unexported methods
}

The report parameters.

Satisfied by EvmTransactionReportParamsReportParamReportTransactionReportParams, EvmTransactionReportParamsReportRequestIDReport, EvmTransactionReportParamsReport.

type EvmTransactionReportResponse added in v0.15.0

type EvmTransactionReportResponse = interface{}

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 or chain ID
	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"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmTransactionScanParamsBlockUnion] `json:"block"`
	// 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 EvmTransactionScanParamsBlockUnion added in v0.13.0

type EvmTransactionScanParamsBlockUnion interface {
	ImplementsEvmTransactionScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

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

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) Report added in v0.15.0

Report for misclassification of a transaction.

func (*EvmTransactionService) Scan

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 or chain ID
	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"`
	// The relative block for the block validation. Can be "latest" or a block number.
	Block param.Field[EvmUserOperationScanParamsBlockUnion] `json:"block"`
	// 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 EvmUserOperationScanParamsBlockUnion added in v0.13.0

type EvmUserOperationScanParamsBlockUnion interface {
	ImplementsEvmUserOperationScanParamsBlockUnion()
}

The relative block for the block validation. Can be "latest" or a block number.

Satisfied by shared.UnionInt, shared.UnionString.

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

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

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 FungibleMintAccountDetailsSchema added in v0.12.0

type FungibleMintAccountDetailsSchema struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Name of the mint
	Name string `json:"name,required"`
	// Symbol of the mint
	Symbol string `json:"symbol,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string `json:"description,nullable"`
	// Logo of the mint
	Type FungibleMintAccountDetailsSchemaType `json:"type"`
	JSON fungibleMintAccountDetailsSchemaJSON `json:"-"`
}

func (*FungibleMintAccountDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *FungibleMintAccountDetailsSchema) UnmarshalJSON(data []byte) (err error)

type FungibleMintAccountDetailsSchemaType added in v0.12.0

type FungibleMintAccountDetailsSchemaType string
const (
	FungibleMintAccountDetailsSchemaTypeFungibleMintAccount FungibleMintAccountDetailsSchemaType = "FUNGIBLE_MINT_ACCOUNT"
)

func (FungibleMintAccountDetailsSchemaType) IsKnown added in v0.12.0

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 string `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 string `json:"usd_price"`
	// value after divided by decimals, that was transferred from this address
	Value string         `json:"value"`
	JSON  nativeDiffJSON `json:"-"`
}

func (*NativeDiff) UnmarshalJSON

func (r *NativeDiff) UnmarshalJSON(data []byte) (err error)

type NativeSolDetailsSchema added in v0.12.0

type NativeSolDetailsSchema struct {
	Decimals int64 `json:"decimals"`
	// Type of the asset (`"SOL"`)
	Type string                     `json:"type"`
	JSON nativeSolDetailsSchemaJSON `json:"-"`
}

func (*NativeSolDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *NativeSolDetailsSchema) UnmarshalJSON(data []byte) (err error)

type NativeSolDiffSchema added in v0.12.0

type NativeSolDiffSchema struct {
	Asset NativeSolDetailsSchema `json:"asset,required"`
	// Incoming transfers of the asset
	In   AssetTransferDetailsSchema `json:"in,nullable"`
	Out  AssetTransferDetailsSchema `json:"out,nullable"`
	JSON nativeSolDiffSchemaJSON    `json:"-"`
}

func (*NativeSolDiffSchema) UnmarshalJSON added in v0.12.0

func (r *NativeSolDiffSchema) UnmarshalJSON(data []byte) (err error)

type NativeSolOwnershipDiffSchema added in v0.12.0

type NativeSolOwnershipDiffSchema struct {
	Asset NativeSolDetailsSchema `json:"asset,required"`
	// The owner post the transaction
	PostOwner string `json:"post_owner,required"`
	// Incoming transfers of the asset
	In AssetTransferDetailsSchema `json:"in_,nullable"`
	// Details of the moved value
	Out AssetTransferDetailsSchema `json:"out,nullable"`
	// The owner prior to the transaction
	PreOwner string                           `json:"pre_owner,nullable"`
	JSON     nativeSolOwnershipDiffSchemaJSON `json:"-"`
}

func (*NativeSolOwnershipDiffSchema) UnmarshalJSON added in v0.12.0

func (r *NativeSolOwnershipDiffSchema) UnmarshalJSON(data []byte) (err error)

type NonFungibleMintAccountDetailsSchema added in v0.12.0

type NonFungibleMintAccountDetailsSchema struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Name of the mint
	Name string `json:"name,required"`
	// Symbol of the mint
	Symbol string `json:"symbol,required"`
	// URI of the mint
	Uri string `json:"uri,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string `json:"description,nullable"`
	// Logo of the mint
	Type NonFungibleMintAccountDetailsSchemaType `json:"type"`
	JSON nonFungibleMintAccountDetailsSchemaJSON `json:"-"`
}

func (*NonFungibleMintAccountDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *NonFungibleMintAccountDetailsSchema) UnmarshalJSON(data []byte) (err error)

type NonFungibleMintAccountDetailsSchemaType added in v0.12.0

type NonFungibleMintAccountDetailsSchemaType string
const (
	NonFungibleMintAccountDetailsSchemaTypeNonFungibleMintAccount NonFungibleMintAccountDetailsSchemaType = "NON_FUNGIBLE_MINT_ACCOUNT"
)

func (NonFungibleMintAccountDetailsSchemaType) IsKnown added in v0.12.0

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 PdaAccountSchema added in v0.12.0

type PdaAccountSchema struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// The address of the owning program
	Owner string `json:"owner,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string               `json:"description,nullable"`
	Type        PdaAccountSchemaType `json:"type"`
	JSON        pdaAccountSchemaJSON `json:"-"`
}

func (*PdaAccountSchema) UnmarshalJSON added in v0.12.0

func (r *PdaAccountSchema) UnmarshalJSON(data []byte) (err error)

type PdaAccountSchemaType added in v0.12.0

type PdaAccountSchemaType string
const (
	PdaAccountSchemaTypePda PdaAccountSchemaType = "PDA"
)

func (PdaAccountSchemaType) IsKnown added in v0.12.0

func (r PdaAccountSchemaType) IsKnown() bool

type ProgramAccountDetailsSchema added in v0.12.0

type ProgramAccountDetailsSchema struct {
	// Encoded public key of the account
	AccountAddress string                          `json:"account_address,required"`
	Type           ProgramAccountDetailsSchemaType `json:"type,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string                          `json:"description,nullable"`
	JSON        programAccountDetailsSchemaJSON `json:"-"`
}

func (*ProgramAccountDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *ProgramAccountDetailsSchema) UnmarshalJSON(data []byte) (err error)

type ProgramAccountDetailsSchemaType added in v0.12.0

type ProgramAccountDetailsSchemaType string
const (
	ProgramAccountDetailsSchemaTypeProgram       ProgramAccountDetailsSchemaType = "PROGRAM"
	ProgramAccountDetailsSchemaTypeNativeProgram ProgramAccountDetailsSchemaType = "NATIVE_PROGRAM"
)

func (ProgramAccountDetailsSchemaType) IsKnown added in v0.12.0

type ResponseSchema added in v0.12.0

type ResponseSchema struct {
	// Encoding of the public keys
	Encoding string `json:"encoding"`
	// Error message if the simulation failed
	Error string `json:"error,nullable"`
	// Summary of the result
	Result CombinedValidationResult `json:"result,nullable"`
	JSON   responseSchemaJSON       `json:"-"`
}

func (*ResponseSchema) UnmarshalJSON added in v0.12.0

func (r *ResponseSchema) UnmarshalJSON(data []byte) (err error)

type SiteReportParams added in v0.15.0

type SiteReportParams struct {
	// Details about the report.
	Details param.Field[string] `json:"details,required"`
	// An enumeration.
	Event param.Field[SiteReportParamsEvent] `json:"event,required"`
	// The report parameters.
	Report param.Field[SiteReportParamsReportUnion] `json:"report,required"`
}

func (SiteReportParams) MarshalJSON added in v0.15.0

func (r SiteReportParams) MarshalJSON() (data []byte, err error)

type SiteReportParamsEvent added in v0.15.0

type SiteReportParamsEvent string

An enumeration.

const (
	SiteReportParamsEventFalsePositive SiteReportParamsEvent = "FALSE_POSITIVE"
	SiteReportParamsEventFalseNegative SiteReportParamsEvent = "FALSE_NEGATIVE"
)

func (SiteReportParamsEvent) IsKnown added in v0.15.0

func (r SiteReportParamsEvent) IsKnown() bool

type SiteReportParamsReport added in v0.15.0

type SiteReportParamsReport struct {
	Type      param.Field[SiteReportParamsReportType] `json:"type,required"`
	Params    param.Field[interface{}]                `json:"params,required"`
	RequestID param.Field[string]                     `json:"request_id"`
}

The report parameters.

func (SiteReportParamsReport) MarshalJSON added in v0.15.0

func (r SiteReportParamsReport) MarshalJSON() (data []byte, err error)

type SiteReportParamsReportParamReportSiteReportParams added in v0.15.0

type SiteReportParamsReportParamReportSiteReportParams struct {
	Params param.Field[SiteReportParamsReportParamReportSiteReportParamsParams] `json:"params,required"`
	Type   param.Field[SiteReportParamsReportParamReportSiteReportParamsType]   `json:"type,required"`
}

func (SiteReportParamsReportParamReportSiteReportParams) MarshalJSON added in v0.15.0

func (r SiteReportParamsReportParamReportSiteReportParams) MarshalJSON() (data []byte, err error)

type SiteReportParamsReportParamReportSiteReportParamsParams added in v0.15.0

type SiteReportParamsReportParamReportSiteReportParamsParams struct {
	// The url of the site to report on.
	URL param.Field[string] `json:"url,required"`
}

func (SiteReportParamsReportParamReportSiteReportParamsParams) MarshalJSON added in v0.15.0

type SiteReportParamsReportParamReportSiteReportParamsType added in v0.15.0

type SiteReportParamsReportParamReportSiteReportParamsType string
const (
	SiteReportParamsReportParamReportSiteReportParamsTypeParams SiteReportParamsReportParamReportSiteReportParamsType = "params"
)

func (SiteReportParamsReportParamReportSiteReportParamsType) IsKnown added in v0.15.0

type SiteReportParamsReportRequestIDReport added in v0.15.0

type SiteReportParamsReportRequestIDReport struct {
	RequestID param.Field[string]                                    `json:"request_id,required"`
	Type      param.Field[SiteReportParamsReportRequestIDReportType] `json:"type,required"`
}

func (SiteReportParamsReportRequestIDReport) MarshalJSON added in v0.15.0

func (r SiteReportParamsReportRequestIDReport) MarshalJSON() (data []byte, err error)

type SiteReportParamsReportRequestIDReportType added in v0.15.0

type SiteReportParamsReportRequestIDReportType string
const (
	SiteReportParamsReportRequestIDReportTypeRequestID SiteReportParamsReportRequestIDReportType = "request_id"
)

func (SiteReportParamsReportRequestIDReportType) IsKnown added in v0.15.0

type SiteReportParamsReportType added in v0.15.0

type SiteReportParamsReportType string
const (
	SiteReportParamsReportTypeParams    SiteReportParamsReportType = "params"
	SiteReportParamsReportTypeRequestID SiteReportParamsReportType = "request_id"
)

func (SiteReportParamsReportType) IsKnown added in v0.15.0

func (r SiteReportParamsReportType) IsKnown() bool

type SiteReportParamsReportUnion added in v0.15.0

type SiteReportParamsReportUnion interface {
	// contains filtered or unexported methods
}

The report parameters.

Satisfied by SiteReportParamsReportParamReportSiteReportParams, SiteReportParamsReportRequestIDReport, SiteReportParamsReport.

type SiteReportResponse added in v0.15.0

type SiteReportResponse = interface{}

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

type SiteScanParamsMetadataType

type SiteScanParamsMetadataType string
const (
	SiteScanParamsMetadataTypeCatalog SiteScanParamsMetadataType = "catalog"
	SiteScanParamsMetadataTypeWallet  SiteScanParamsMetadataType = "wallet"
)

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 (
	SiteScanParamsMetadataWalletRequestMetadataTypeWallet SiteScanParamsMetadataWalletRequestMetadataType = "wallet"
)

func (SiteScanParamsMetadataWalletRequestMetadataType) IsKnown

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"`
	// This field can have the runtime type of
	// [map[string]SiteScanHitResponseAttackType].
	AttackTypes interface{} `json:"attack_types,required"`
	// This field can have the runtime type of [[]string].
	NetworkOperations interface{} `json:"network_operations,required"`
	// This field can have the runtime type of [[]string].
	JsonRpcOperations interface{} `json:"json_rpc_operations,required"`
	// This field can have the runtime type of [SiteScanHitResponseContractWrite].
	ContractWrite interface{} `json:"contract_write,required"`
	// This field can have the runtime type of [SiteScanHitResponseContractRead].
	ContractRead interface{}          `json:"contract_read,required"`
	JSON         siteScanResponseJSON `json:"-"`
	// contains filtered or unexported fields
}

func (SiteScanResponse) AsUnion

AsUnion returns a SiteScanResponseUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are SiteScanHitResponse, SiteScanMissResponse.

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) Report added in v0.15.0

func (r *SiteService) Report(ctx context.Context, body SiteReportParams, opts ...option.RequestOption) (res *SiteReportResponse, err error)

Report for misclassification of a site.

func (*SiteService) Scan

func (r *SiteService) Scan(ctx context.Context, body SiteScanParams, opts ...option.RequestOption) (res *SiteScanResponse, err error)

Scan Site

type SolanaAddressScanParams added in v0.12.0

type SolanaAddressScanParams struct {
	AddressScanRequestSchema AddressScanRequestSchemaParam `json:"AddressScanRequestSchema,required"`
}

func (SolanaAddressScanParams) MarshalJSON added in v0.12.0

func (r SolanaAddressScanParams) MarshalJSON() (data []byte, err error)

type SolanaAddressService added in v0.12.0

type SolanaAddressService struct {
	Options []option.RequestOption
}

SolanaAddressService 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 NewSolanaAddressService method instead.

func NewSolanaAddressService added in v0.12.0

func NewSolanaAddressService(opts ...option.RequestOption) (r *SolanaAddressService)

NewSolanaAddressService 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 (*SolanaAddressService) Scan added in v0.12.0

Gets an address and returns a full security assessment indicating weather or not this address is malicious as well as textual reasons of why the address was flagged that way.

type SolanaMessageScanParams added in v0.12.0

type SolanaMessageScanParams struct {
	TxScanRequestSchema TxScanRequestSchemaParam `json:"TxScanRequestSchema,required"`
}

func (SolanaMessageScanParams) MarshalJSON added in v0.12.0

func (r SolanaMessageScanParams) MarshalJSON() (data []byte, err error)

type SolanaMessageService added in v0.12.0

type SolanaMessageService struct {
	Options []option.RequestOption
}

SolanaMessageService 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 NewSolanaMessageService method instead.

func NewSolanaMessageService added in v0.12.0

func NewSolanaMessageService(opts ...option.RequestOption) (r *SolanaMessageService)

NewSolanaMessageService 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 (*SolanaMessageService) Scan added in v0.12.0

Scan Messages

type SolanaService added in v0.12.0

type SolanaService struct {
	Options []option.RequestOption
	Message *SolanaMessageService
	Address *SolanaAddressService
}

SolanaService 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 NewSolanaService method instead.

func NewSolanaService added in v0.12.0

func NewSolanaService(opts ...option.RequestOption) (r *SolanaService)

NewSolanaService 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 SplFungibleTokenDetailsSchema added in v0.12.0

type SplFungibleTokenDetailsSchema struct {
	Address  string `json:"address,required"`
	Decimals int64  `json:"decimals,required"`
	Name     string `json:"name,required"`
	Symbol   string `json:"symbol,required"`
	// Type of the asset (`"TOKEN"`)
	Type string                            `json:"type"`
	JSON splFungibleTokenDetailsSchemaJSON `json:"-"`
}

func (*SplFungibleTokenDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *SplFungibleTokenDetailsSchema) UnmarshalJSON(data []byte) (err error)

type SplFungibleTokenDiffSchema added in v0.12.0

type SplFungibleTokenDiffSchema struct {
	Asset SplFungibleTokenDetailsSchema `json:"asset,required"`
	// Incoming transfers of the asset
	In   AssetTransferDetailsSchema     `json:"in,nullable"`
	Out  AssetTransferDetailsSchema     `json:"out,nullable"`
	JSON splFungibleTokenDiffSchemaJSON `json:"-"`
}

func (*SplFungibleTokenDiffSchema) UnmarshalJSON added in v0.12.0

func (r *SplFungibleTokenDiffSchema) UnmarshalJSON(data []byte) (err error)

type SplNonFungibleTokenDetailsSchema added in v0.12.0

type SplNonFungibleTokenDetailsSchema struct {
	Address  string `json:"address,required"`
	Name     string `json:"name,required"`
	Symbol   string `json:"symbol,required"`
	Decimals int64  `json:"decimals"`
	// Type of the asset (`"NFT"`)
	Type string                               `json:"type"`
	JSON splNonFungibleTokenDetailsSchemaJSON `json:"-"`
}

func (*SplNonFungibleTokenDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *SplNonFungibleTokenDetailsSchema) UnmarshalJSON(data []byte) (err error)

type SplNonFungibleTokenDiffSchema added in v0.12.0

type SplNonFungibleTokenDiffSchema struct {
	Asset SplNonFungibleTokenDetailsSchema `json:"asset,required"`
	// Incoming transfers of the asset
	In   AssetTransferDetailsSchema        `json:"in,nullable"`
	Out  AssetTransferDetailsSchema        `json:"out,nullable"`
	JSON splNonFungibleTokenDiffSchemaJSON `json:"-"`
}

func (*SplNonFungibleTokenDiffSchema) UnmarshalJSON added in v0.12.0

func (r *SplNonFungibleTokenDiffSchema) UnmarshalJSON(data []byte) (err error)

type SplTokenOwnershipDiffSchema added in v0.12.0

type SplTokenOwnershipDiffSchema struct {
	Asset SplTokenOwnershipDiffSchemaAsset `json:"asset,required"`
	// The owner post the transaction
	PostOwner string `json:"post_owner,required"`
	// Incoming transfers of the asset
	In AssetTransferDetailsSchema `json:"in_,nullable"`
	// Details of the moved value
	Out AssetTransferDetailsSchema `json:"out,nullable"`
	// The owner prior to the transaction
	PreOwner string                          `json:"pre_owner,nullable"`
	JSON     splTokenOwnershipDiffSchemaJSON `json:"-"`
}

func (*SplTokenOwnershipDiffSchema) UnmarshalJSON added in v0.12.0

func (r *SplTokenOwnershipDiffSchema) UnmarshalJSON(data []byte) (err error)

type SplTokenOwnershipDiffSchemaAsset added in v0.12.0

type SplTokenOwnershipDiffSchemaAsset struct {
	Address string `json:"address,required"`
	Symbol  string `json:"symbol,required"`
	Name    string `json:"name,required"`
	// Type of the asset (`"TOKEN"`)
	Type     string                               `json:"type"`
	Decimals int64                                `json:"decimals"`
	JSON     splTokenOwnershipDiffSchemaAssetJSON `json:"-"`
	// contains filtered or unexported fields
}

func (SplTokenOwnershipDiffSchemaAsset) AsUnion added in v0.12.0

AsUnion returns a SplTokenOwnershipDiffSchemaAssetUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are SplFungibleTokenDetailsSchema, SplNonFungibleTokenDetailsSchema.

func (*SplTokenOwnershipDiffSchemaAsset) UnmarshalJSON added in v0.12.0

func (r *SplTokenOwnershipDiffSchemaAsset) UnmarshalJSON(data []byte) (err error)

type SplTokenOwnershipDiffSchemaAssetUnion added in v0.12.0

type SplTokenOwnershipDiffSchemaAssetUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by SplFungibleTokenDetailsSchema or SplNonFungibleTokenDetailsSchema.

type StakedSolAssetDetailsSchema added in v0.12.0

type StakedSolAssetDetailsSchema struct {
	Decimals int64 `json:"decimals"`
	// Type of the asset (`"STAKED_SOL"`)
	Type string                          `json:"type"`
	JSON stakedSolAssetDetailsSchemaJSON `json:"-"`
}

func (*StakedSolAssetDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *StakedSolAssetDetailsSchema) UnmarshalJSON(data []byte) (err error)

type StakedSolWithdrawAuthorityDiffSchema added in v0.12.0

type StakedSolWithdrawAuthorityDiffSchema struct {
	// The owner post the transaction
	PostOwner string                      `json:"post_owner,required"`
	Asset     StakedSolAssetDetailsSchema `json:"asset"`
	// Incoming transfers of the asset
	In AssetTransferDetailsSchema `json:"in_,nullable"`
	// Details of the moved value
	Out AssetTransferDetailsSchema `json:"out,nullable"`
	// The owner prior to the transaction
	PreOwner string                                   `json:"pre_owner,nullable"`
	JSON     stakedSolWithdrawAuthorityDiffSchemaJSON `json:"-"`
}

func (*StakedSolWithdrawAuthorityDiffSchema) UnmarshalJSON added in v0.12.0

func (r *StakedSolWithdrawAuthorityDiffSchema) UnmarshalJSON(data []byte) (err error)

type StellarAssetContractDetailsSchema added in v0.11.0

type StellarAssetContractDetailsSchema struct {
	// Address of the asset's contract
	Address string `json:"address,required"`
	// Asset code
	Name string `json:"name,required"`
	// Asset symbol
	Symbol string `json:"symbol,required"`
	// Type of the asset (`CONTRACT`)
	Type StellarAssetContractDetailsSchemaType `json:"type"`
	JSON stellarAssetContractDetailsSchemaJSON `json:"-"`
}

func (*StellarAssetContractDetailsSchema) UnmarshalJSON added in v0.11.0

func (r *StellarAssetContractDetailsSchema) UnmarshalJSON(data []byte) (err error)

type StellarAssetContractDetailsSchemaType added in v0.11.0

type StellarAssetContractDetailsSchemaType string

Type of the asset (`CONTRACT`)

const (
	StellarAssetContractDetailsSchemaTypeContract StellarAssetContractDetailsSchemaType = "CONTRACT"
)

func (StellarAssetContractDetailsSchemaType) IsKnown added in v0.11.0

type StellarAssetTransferDetailsSchema added in v0.11.0

type StellarAssetTransferDetailsSchema struct {
	// Raw value of the transfer
	RawValue int64 `json:"raw_value,required"`
	// Value of the transfer
	Value float64 `json:"value,required"`
	// Summarized description of the transfer
	Summary string `json:"summary,nullable"`
	// USD price of the asset
	UsdPrice float64                               `json:"usd_price"`
	JSON     stellarAssetTransferDetailsSchemaJSON `json:"-"`
}

func (*StellarAssetTransferDetailsSchema) UnmarshalJSON added in v0.11.0

func (r *StellarAssetTransferDetailsSchema) UnmarshalJSON(data []byte) (err error)

type StellarService added in v0.11.0

type StellarService struct {
	Options     []option.RequestOption
	Transaction *StellarTransactionService
}

StellarService 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 NewStellarService method instead.

func NewStellarService added in v0.11.0

func NewStellarService(opts ...option.RequestOption) (r *StellarService)

NewStellarService 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 StellarTransactionScanParams added in v0.11.0

type StellarTransactionScanParams struct {
	StellarTransactionScanRequest StellarTransactionScanRequestParam `json:"StellarTransactionScanRequest,required"`
}

func (StellarTransactionScanParams) MarshalJSON added in v0.11.0

func (r StellarTransactionScanParams) MarshalJSON() (data []byte, err error)

type StellarTransactionScanRequestChain added in v0.11.0

type StellarTransactionScanRequestChain string

A CAIP-2 chain ID or a Stellar network name

const (
	StellarTransactionScanRequestChainPubnet    StellarTransactionScanRequestChain = "pubnet"
	StellarTransactionScanRequestChainFuturenet StellarTransactionScanRequestChain = "futurenet"
	StellarTransactionScanRequestChainTestnet   StellarTransactionScanRequestChain = "testnet"
)

func (StellarTransactionScanRequestChain) IsKnown added in v0.11.0

type StellarTransactionScanRequestMetadataParam added in v0.11.0

type StellarTransactionScanRequestMetadataParam struct {
	// Metadata for wallet requests
	Type param.Field[StellarTransactionScanRequestMetadataType] `json:"type,required"`
	// URL of the dApp originating the transaction
	URL param.Field[string] `json:"url"`
}

Metadata

func (StellarTransactionScanRequestMetadataParam) MarshalJSON added in v0.11.0

func (r StellarTransactionScanRequestMetadataParam) MarshalJSON() (data []byte, err error)

type StellarTransactionScanRequestMetadataStellarInAppRequestMetadataParam added in v0.11.0

type StellarTransactionScanRequestMetadataStellarInAppRequestMetadataParam struct {
	// Metadata for in-app requests
	Type param.Field[StellarTransactionScanRequestMetadataStellarInAppRequestMetadataType] `json:"type,required"`
}

func (StellarTransactionScanRequestMetadataStellarInAppRequestMetadataParam) MarshalJSON added in v0.11.0

type StellarTransactionScanRequestMetadataStellarInAppRequestMetadataType added in v0.11.0

type StellarTransactionScanRequestMetadataStellarInAppRequestMetadataType string

Metadata for in-app requests

const (
	StellarTransactionScanRequestMetadataStellarInAppRequestMetadataTypeInApp StellarTransactionScanRequestMetadataStellarInAppRequestMetadataType = "in_app"
)

func (StellarTransactionScanRequestMetadataStellarInAppRequestMetadataType) IsKnown added in v0.11.0

type StellarTransactionScanRequestMetadataStellarWalletRequestMetadataParam added in v0.11.0

type StellarTransactionScanRequestMetadataStellarWalletRequestMetadataParam struct {
	// Metadata for wallet requests
	Type param.Field[StellarTransactionScanRequestMetadataStellarWalletRequestMetadataType] `json:"type,required"`
	// URL of the dApp originating the transaction
	URL param.Field[string] `json:"url,required"`
}

func (StellarTransactionScanRequestMetadataStellarWalletRequestMetadataParam) MarshalJSON added in v0.11.0

type StellarTransactionScanRequestMetadataStellarWalletRequestMetadataType added in v0.11.0

type StellarTransactionScanRequestMetadataStellarWalletRequestMetadataType string

Metadata for wallet requests

const (
	StellarTransactionScanRequestMetadataStellarWalletRequestMetadataTypeWallet StellarTransactionScanRequestMetadataStellarWalletRequestMetadataType = "wallet"
)

func (StellarTransactionScanRequestMetadataStellarWalletRequestMetadataType) IsKnown added in v0.11.0

type StellarTransactionScanRequestMetadataType added in v0.11.0

type StellarTransactionScanRequestMetadataType string

Metadata for wallet requests

const (
	StellarTransactionScanRequestMetadataTypeWallet StellarTransactionScanRequestMetadataType = "wallet"
	StellarTransactionScanRequestMetadataTypeInApp  StellarTransactionScanRequestMetadataType = "in_app"
)

func (StellarTransactionScanRequestMetadataType) IsKnown added in v0.11.0

type StellarTransactionScanRequestMetadataUnionParam added in v0.11.0

type StellarTransactionScanRequestMetadataUnionParam interface {
	// contains filtered or unexported methods
}

Metadata

Satisfied by StellarTransactionScanRequestMetadataStellarWalletRequestMetadataParam, StellarTransactionScanRequestMetadataStellarInAppRequestMetadataParam, StellarTransactionScanRequestMetadataParam.

type StellarTransactionScanRequestOption added in v0.11.0

type StellarTransactionScanRequestOption string
const (
	StellarTransactionScanRequestOptionValidation StellarTransactionScanRequestOption = "validation"
	StellarTransactionScanRequestOptionSimulation StellarTransactionScanRequestOption = "simulation"
)

func (StellarTransactionScanRequestOption) IsKnown added in v0.11.0

type StellarTransactionScanRequestParam added in v0.11.0

type StellarTransactionScanRequestParam struct {
	AccountAddress param.Field[string] `json:"account_address,required"`
	// A CAIP-2 chain ID or a Stellar network name
	Chain param.Field[StellarTransactionScanRequestChain] `json:"chain,required"`
	// Metadata
	Metadata param.Field[StellarTransactionScanRequestMetadataUnionParam] `json:"metadata,required"`
	// List of XDR-encoded transactions to be scanned
	Transactions param.Field[[]string] `json:"transactions,required"`
	// List of options to include in the response
	//
	// - `simulation`: Include simulation output in the response
	// - `validation`: Include security validation of the transaction in the response
	Options param.Field[[]StellarTransactionScanRequestOption] `json:"options"`
}

func (StellarTransactionScanRequestParam) MarshalJSON added in v0.11.0

func (r StellarTransactionScanRequestParam) MarshalJSON() (data []byte, err error)

type StellarTransactionScanResponse added in v0.11.0

type StellarTransactionScanResponse struct {
	// Simulation result; Only present if simulation option is included in the request
	Simulation StellarTransactionScanResponseSimulation `json:"simulation,nullable"`
	// Validation result; Only present if validation option is included in the request
	Validation StellarTransactionScanResponseValidation `json:"validation,nullable"`
	JSON       stellarTransactionScanResponseJSON       `json:"-"`
}

func (*StellarTransactionScanResponse) UnmarshalJSON added in v0.11.0

func (r *StellarTransactionScanResponse) UnmarshalJSON(data []byte) (err error)

type StellarTransactionScanResponseSimulation added in v0.11.0

type StellarTransactionScanResponseSimulation struct {
	Status StellarTransactionScanResponseSimulationStatus `json:"status,required"`
	// This field can have the runtime type of
	// [map[string][]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiff].
	AssetsDiffs interface{} `json:"assets_diffs,required"`
	// This field can have the runtime type of
	// [map[string][]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposure].
	Exposures interface{} `json:"exposures,required"`
	// This field can have the runtime type of
	// [map[string][]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiff].
	AssetsOwnershipDiff interface{} `json:"assets_ownership_diff,required"`
	// This field can have the runtime type of
	// [[]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAddressDetail].
	AddressDetails interface{} `json:"address_details,required"`
	// This field can have the runtime type of
	// [StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummary].
	AccountSummary interface{} `json:"account_summary,required"`
	// Error message
	Error string                                       `json:"error"`
	JSON  stellarTransactionScanResponseSimulationJSON `json:"-"`
	// contains filtered or unexported fields
}

Simulation result; Only present if simulation option is included in the request

func (StellarTransactionScanResponseSimulation) AsUnion added in v0.11.0

AsUnion returns a StellarTransactionScanResponseSimulationUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are StellarTransactionScanResponseSimulationStellarSimulationResultSchema, StellarTransactionScanResponseSimulationStellarSimulationErrorSchema.

func (*StellarTransactionScanResponseSimulation) UnmarshalJSON added in v0.11.0

func (r *StellarTransactionScanResponseSimulation) UnmarshalJSON(data []byte) (err error)

type StellarTransactionScanResponseSimulationStatus added in v0.11.0

type StellarTransactionScanResponseSimulationStatus string
const (
	StellarTransactionScanResponseSimulationStatusSuccess StellarTransactionScanResponseSimulationStatus = "Success"
	StellarTransactionScanResponseSimulationStatusError   StellarTransactionScanResponseSimulationStatus = "Error"
)

func (StellarTransactionScanResponseSimulationStatus) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationErrorSchema added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationErrorSchema struct {
	// Error message
	Error  string                                                                     `json:"error,required"`
	Status StellarTransactionScanResponseSimulationStellarSimulationErrorSchemaStatus `json:"status,required"`
	JSON   stellarTransactionScanResponseSimulationStellarSimulationErrorSchemaJSON   `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationErrorSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationErrorSchemaStatus added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationErrorSchemaStatus string
const (
	StellarTransactionScanResponseSimulationStellarSimulationErrorSchemaStatusError StellarTransactionScanResponseSimulationStellarSimulationErrorSchemaStatus = "Error"
)

func (StellarTransactionScanResponseSimulationStellarSimulationErrorSchemaStatus) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchema added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchema struct {
	// Summary of the actions and asset transfers that were made by the requested
	// account address
	AccountSummary StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummary `json:"account_summary,required"`
	Status         StellarTransactionScanResponseSimulationStellarSimulationResultSchemaStatus         `json:"status,required"`
	// Details of addresses involved in the transaction
	AddressDetails []StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAddressDetail `json:"address_details"`
	// Mapping between the address of an account to the assets diff during the
	// transaction
	AssetsDiffs map[string][]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiff `json:"assets_diffs"`
	// Mapping between the address of an account to the ownership diff of the account
	// during the transaction
	AssetsOwnershipDiff map[string][]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiff `json:"assets_ownership_diff"`
	// Mapping between the address of an account to the exposure of the assets during
	// the transaction
	Exposures map[string][]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposure `json:"exposures"`
	JSON      stellarTransactionScanResponseSimulationStellarSimulationResultSchemaJSON                  `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummary added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummary struct {
	// Exposures made by the requested account address
	AccountExposures []StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposure `json:"account_exposures,required"`
	// Account ownerships diff of the requested account address
	AccountOwnershipsDiff []StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiff `json:"account_ownerships_diff,required"`
	// Total USD diff for the requested account address
	TotalUsdDiff StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryTotalUsdDiff `json:"total_usd_diff,required"`
	// Assets diffs of the requested account address
	AssetsDiffs []StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiff `json:"assets_diffs"`
	// Total USD exposure for each of the spender addresses during the transaction
	TotalUsdExposure map[string]float64                                                                      `json:"total_usd_exposure"`
	JSON             stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryJSON `json:"-"`
}

Summary of the actions and asset transfers that were made by the requested account address

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummary) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposure added in v0.13.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposure struct {
	Asset StellarAssetContractDetailsSchema `json:"asset,required"`
	// Mapping between the address of a Spender to the exposure of the asset during the
	// transaction
	Spenders map[string]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposuresSpender `json:"spenders"`
	JSON     stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposureJSON                `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposure) UnmarshalJSON added in v0.13.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposuresSpender added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposuresSpender struct {
	// Raw value of the exposure
	RawValue int64 `json:"raw_value,required"`
	// USD value of the exposure
	UsdPrice float64 `json:"usd_price,required"`
	// Value of the exposure
	Value float64 `json:"value,required"`
	// Summarized description of the exposure
	Summary string                                                                                                         `json:"summary,nullable"`
	JSON    stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposuresSpenderJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountExposuresSpender) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiff added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiff struct {
	// List of public keys that can sign on behalf of the account post-transaction
	PostSigners []string `json:"post_signers,required"`
	// List of public keys that can sign on behalf of the account pre-transaction
	PreSigners []string                                                                                                     `json:"pre_signers,required"`
	Type       StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffType `json:"type,required"`
	JSON       stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiff) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffType added in v0.13.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffType string
const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffTypeSetOptions StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffType = "SET_OPTIONS"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAccountOwnershipsDiffType) IsKnown added in v0.13.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiff added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiff struct {
	// Asset involved in the transfer
	Asset StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAsset `json:"asset,required"`
	// Incoming transfers of the asset
	In StellarAssetTransferDetailsSchema `json:"in,nullable"`
	// Outgoing transfers of the asset
	Out  StellarAssetTransferDetailsSchema                                                                 `json:"out,nullable"`
	JSON stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiff) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAsset added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAsset struct {
	// Type of the asset (`ASSET`)
	Type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType `json:"type"`
	// Asset code
	Code string `json:"code"`
	// Asset issuer address
	Issuer string `json:"issuer"`
	// Organization name
	OrgName string `json:"org_name"`
	// Organization URL
	OrgURL string `json:"org_url"`
	// Address of the asset's contract
	Address string `json:"address"`
	// Asset code
	Name string `json:"name"`
	// Asset symbol
	Symbol string                                                                                                  `json:"symbol"`
	JSON   stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetJSON `json:"-"`
	// contains filtered or unexported fields
}

Asset involved in the transfer

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAsset) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchema added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchema struct {
	// Asset code
	Code string `json:"code,required"`
	// Asset issuer address
	Issuer string `json:"issuer,required"`
	// Organization name
	OrgName string `json:"org_name,required"`
	// Organization URL
	OrgURL string `json:"org_url,required"`
	// Type of the asset (`ASSET`)
	Type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType `json:"type"`
	JSON stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType string

Type of the asset (`ASSET`)

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaTypeAsset StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType = "ASSET"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchema added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchema struct {
	// Asset code
	Code StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode `json:"code"`
	// Type of the asset (`NATIVE`)
	Type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaType `json:"type"`
	JSON stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode string

Asset code

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaCodeXlm StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode = "XLM"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaType added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaType string

Type of the asset (`NATIVE`)

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaTypeNative StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaType = "NATIVE"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetStellarNativeAssetDetailsSchemaType) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType string

Type of the asset (`ASSET`)

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetTypeAsset    StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType = "ASSET"
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetTypeNative   StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType = "NATIVE"
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetTypeContract StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType = "CONTRACT"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryAssetsDiffsAssetType) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryTotalUsdDiff added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryTotalUsdDiff struct {
	// Total incoming USD transfers
	In float64 `json:"in,required"`
	// Total outgoing USD transfers
	Out float64 `json:"out,required"`
	// Total USD transfers
	Total float64                                                                                             `json:"total"`
	JSON  stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryTotalUsdDiffJSON `json:"-"`
}

Total USD diff for the requested account address

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAccountSummaryTotalUsdDiff) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAddressDetail added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAddressDetail struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Description of the account
	Description string                                                                                 `json:"description,nullable"`
	JSON        stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAddressDetailJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAddressDetail) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiff added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiff struct {
	// Asset involved in the transfer
	Asset StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAsset `json:"asset,required"`
	// Incoming transfers of the asset
	In StellarAssetTransferDetailsSchema `json:"in,nullable"`
	// Outgoing transfers of the asset
	Out  StellarAssetTransferDetailsSchema                                                   `json:"out,nullable"`
	JSON stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiff) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAsset added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAsset struct {
	// Type of the asset (`ASSET`)
	Type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType `json:"type"`
	// Asset code
	Code string `json:"code"`
	// Asset issuer address
	Issuer string `json:"issuer"`
	// Organization name
	OrgName string `json:"org_name"`
	// Organization URL
	OrgURL string `json:"org_url"`
	// Address of the asset's contract
	Address string `json:"address"`
	// Asset code
	Name string `json:"name"`
	// Asset symbol
	Symbol string                                                                                    `json:"symbol"`
	JSON   stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetJSON `json:"-"`
	// contains filtered or unexported fields
}

Asset involved in the transfer

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAsset) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchema added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchema struct {
	// Asset code
	Code string `json:"code,required"`
	// Asset issuer address
	Issuer string `json:"issuer,required"`
	// Organization name
	OrgName string `json:"org_name,required"`
	// Organization URL
	OrgURL string `json:"org_url,required"`
	// Type of the asset (`ASSET`)
	Type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType `json:"type"`
	JSON stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType string

Type of the asset (`ASSET`)

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaTypeAsset StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType = "ASSET"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarLegacyAssetDetailsSchemaType) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchema added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchema struct {
	// Asset code
	Code StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode `json:"code"`
	// Type of the asset (`NATIVE`)
	Type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaType `json:"type"`
	JSON stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode string

Asset code

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaCodeXlm StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode = "XLM"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaCode) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaType added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaType string

Type of the asset (`NATIVE`)

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaTypeNative StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaType = "NATIVE"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetStellarNativeAssetDetailsSchemaType) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType string

Type of the asset (`ASSET`)

const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetTypeAsset    StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType = "ASSET"
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetTypeNative   StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType = "NATIVE"
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetTypeContract StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType = "CONTRACT"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsDiffsAssetType) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiff added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiff struct {
	// List of public keys that can sign on behalf of the account post-transaction
	PostSigners []string `json:"post_signers,required"`
	// List of public keys that can sign on behalf of the account pre-transaction
	PreSigners []string                                                                                     `json:"pre_signers,required"`
	Type       StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffType `json:"type,required"`
	JSON       stellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiff) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffType added in v0.13.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffType string
const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffTypeSetOptions StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffType = "SET_OPTIONS"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaAssetsOwnershipDiffType) IsKnown added in v0.13.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposure added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposure struct {
	Asset StellarAssetContractDetailsSchema `json:"asset,required"`
	// Mapping between the address of a Spender to the exposure of the asset during the
	// transaction
	Spenders map[string]StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposuresSpender `json:"spenders"`
	JSON     stellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposureJSON                `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposure) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposuresSpender added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposuresSpender struct {
	// Raw value of the exposure
	RawValue int64 `json:"raw_value,required"`
	// USD value of the exposure
	UsdPrice float64 `json:"usd_price,required"`
	// Value of the exposure
	Value float64 `json:"value,required"`
	// Summarized description of the exposure
	Summary string                                                                                    `json:"summary,nullable"`
	JSON    stellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposuresSpenderJSON `json:"-"`
}

func (*StellarTransactionScanResponseSimulationStellarSimulationResultSchemaExposuresSpender) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaStatus added in v0.11.0

type StellarTransactionScanResponseSimulationStellarSimulationResultSchemaStatus string
const (
	StellarTransactionScanResponseSimulationStellarSimulationResultSchemaStatusSuccess StellarTransactionScanResponseSimulationStellarSimulationResultSchemaStatus = "Success"
)

func (StellarTransactionScanResponseSimulationStellarSimulationResultSchemaStatus) IsKnown added in v0.11.0

type StellarTransactionScanResponseSimulationUnion added in v0.11.0

type StellarTransactionScanResponseSimulationUnion interface {
	// contains filtered or unexported methods
}

Simulation result; Only present if simulation option is included in the request

Union satisfied by StellarTransactionScanResponseSimulationStellarSimulationResultSchema or StellarTransactionScanResponseSimulationStellarSimulationErrorSchema.

type StellarTransactionScanResponseValidation added in v0.11.0

type StellarTransactionScanResponseValidation struct {
	Status StellarTransactionScanResponseValidationStatus `json:"status,required"`
	// Verdict of the validation
	ResultType StellarTransactionScanResponseValidationResultType `json:"result_type"`
	// A textual description about the validation result
	Description string `json:"description"`
	// A textual description about the reasons the transaction was flagged with
	// result_type
	Reason StellarTransactionScanResponseValidationReason `json:"reason"`
	// A textual classification that can be presented to the user explaining the
	// reason.
	Classification string `json:"classification"`
	// This field can have the runtime type of
	// [[]StellarTransactionScanResponseValidationStellarValidationResultSchemaFeature].
	Features interface{} `json:"features,required"`
	// Error message
	Error string                                       `json:"error"`
	JSON  stellarTransactionScanResponseValidationJSON `json:"-"`
	// contains filtered or unexported fields
}

Validation result; Only present if validation option is included in the request

func (StellarTransactionScanResponseValidation) AsUnion added in v0.11.0

AsUnion returns a StellarTransactionScanResponseValidationUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are StellarTransactionScanResponseValidationStellarValidationResultSchema, StellarTransactionScanResponseValidationStellarValidationErrorSchema.

func (*StellarTransactionScanResponseValidation) UnmarshalJSON added in v0.11.0

func (r *StellarTransactionScanResponseValidation) UnmarshalJSON(data []byte) (err error)

type StellarTransactionScanResponseValidationReason added in v0.11.0

type StellarTransactionScanResponseValidationReason string

A textual description about the reasons the transaction was flagged with result_type

const (
	StellarTransactionScanResponseValidationReasonEmpty                 StellarTransactionScanResponseValidationReason = ""
	StellarTransactionScanResponseValidationReasonKnownAttacker         StellarTransactionScanResponseValidationReason = "known_attacker"
	StellarTransactionScanResponseValidationReasonKnownFraudulentAsset  StellarTransactionScanResponseValidationReason = "known_fraudulent_asset"
	StellarTransactionScanResponseValidationReasonMaliciousMemo         StellarTransactionScanResponseValidationReason = "malicious_memo"
	StellarTransactionScanResponseValidationReasonUnfairTrade           StellarTransactionScanResponseValidationReason = "unfair_trade"
	StellarTransactionScanResponseValidationReasonTransferFarming       StellarTransactionScanResponseValidationReason = "transfer_farming"
	StellarTransactionScanResponseValidationReasonNativeOwnershipChange StellarTransactionScanResponseValidationReason = "native_ownership_change"
	StellarTransactionScanResponseValidationReasonOther                 StellarTransactionScanResponseValidationReason = "other"
)

func (StellarTransactionScanResponseValidationReason) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationResultType added in v0.11.0

type StellarTransactionScanResponseValidationResultType string

Verdict of the validation

const (
	StellarTransactionScanResponseValidationResultTypeBenign    StellarTransactionScanResponseValidationResultType = "Benign"
	StellarTransactionScanResponseValidationResultTypeWarning   StellarTransactionScanResponseValidationResultType = "Warning"
	StellarTransactionScanResponseValidationResultTypeMalicious StellarTransactionScanResponseValidationResultType = "Malicious"
)

func (StellarTransactionScanResponseValidationResultType) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationStatus added in v0.11.0

type StellarTransactionScanResponseValidationStatus string
const (
	StellarTransactionScanResponseValidationStatusSuccess StellarTransactionScanResponseValidationStatus = "Success"
	StellarTransactionScanResponseValidationStatusError   StellarTransactionScanResponseValidationStatus = "Error"
)

func (StellarTransactionScanResponseValidationStatus) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationErrorSchema added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationErrorSchema struct {
	// Error message
	Error  string                                                                     `json:"error,required"`
	Status StellarTransactionScanResponseValidationStellarValidationErrorSchemaStatus `json:"status,required"`
	JSON   stellarTransactionScanResponseValidationStellarValidationErrorSchemaJSON   `json:"-"`
}

func (*StellarTransactionScanResponseValidationStellarValidationErrorSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationErrorSchemaStatus added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationErrorSchemaStatus string
const (
	StellarTransactionScanResponseValidationStellarValidationErrorSchemaStatusError StellarTransactionScanResponseValidationStellarValidationErrorSchemaStatus = "Error"
)

func (StellarTransactionScanResponseValidationStellarValidationErrorSchemaStatus) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchema added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchema struct {
	// A textual classification that can be presented to the user explaining the
	// reason.
	Classification string `json:"classification,required"`
	// A textual description about the validation result
	Description string `json:"description,required"`
	// A list of features about this transaction explaining the validation
	Features []StellarTransactionScanResponseValidationStellarValidationResultSchemaFeature `json:"features,required"`
	// A textual description about the reasons the transaction was flagged with
	// result_type
	Reason StellarTransactionScanResponseValidationStellarValidationResultSchemaReason `json:"reason,required"`
	// Verdict of the validation
	ResultType StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType `json:"result_type,required"`
	Status     StellarTransactionScanResponseValidationStellarValidationResultSchemaStatus     `json:"status,required"`
	JSON       stellarTransactionScanResponseValidationStellarValidationResultSchemaJSON       `json:"-"`
}

func (*StellarTransactionScanResponseValidationStellarValidationResultSchema) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaFeature added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaFeature struct {
	// Address the feature refers to
	Address string `json:"address,required"`
	// Textual description
	Description string `json:"description,required"`
	FeatureID   string `json:"feature_id,required"`
	// Feature Classification
	Type StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType `json:"type,required"`
	JSON stellarTransactionScanResponseValidationStellarValidationResultSchemaFeatureJSON  `json:"-"`
}

func (*StellarTransactionScanResponseValidationStellarValidationResultSchemaFeature) UnmarshalJSON added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType string

Feature Classification

const (
	StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesTypeBenign    StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType = "Benign"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesTypeWarning   StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType = "Warning"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesTypeMalicious StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType = "Malicious"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesTypeInfo      StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType = "Info"
)

func (StellarTransactionScanResponseValidationStellarValidationResultSchemaFeaturesType) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaReason added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaReason string

A textual description about the reasons the transaction was flagged with result_type

const (
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonEmpty                 StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = ""
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonKnownAttacker         StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "known_attacker"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonKnownFraudulentAsset  StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "known_fraudulent_asset"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonMaliciousMemo         StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "malicious_memo"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonUnfairTrade           StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "unfair_trade"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonTransferFarming       StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "transfer_farming"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonNativeOwnershipChange StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "native_ownership_change"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaReasonOther                 StellarTransactionScanResponseValidationStellarValidationResultSchemaReason = "other"
)

func (StellarTransactionScanResponseValidationStellarValidationResultSchemaReason) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType string

Verdict of the validation

const (
	StellarTransactionScanResponseValidationStellarValidationResultSchemaResultTypeBenign    StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType = "Benign"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaResultTypeWarning   StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType = "Warning"
	StellarTransactionScanResponseValidationStellarValidationResultSchemaResultTypeMalicious StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType = "Malicious"
)

func (StellarTransactionScanResponseValidationStellarValidationResultSchemaResultType) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaStatus added in v0.11.0

type StellarTransactionScanResponseValidationStellarValidationResultSchemaStatus string
const (
	StellarTransactionScanResponseValidationStellarValidationResultSchemaStatusSuccess StellarTransactionScanResponseValidationStellarValidationResultSchemaStatus = "Success"
)

func (StellarTransactionScanResponseValidationStellarValidationResultSchemaStatus) IsKnown added in v0.11.0

type StellarTransactionScanResponseValidationUnion added in v0.11.0

type StellarTransactionScanResponseValidationUnion interface {
	// contains filtered or unexported methods
}

Validation result; Only present if validation option is included in the request

Union satisfied by StellarTransactionScanResponseValidationStellarValidationResultSchema or StellarTransactionScanResponseValidationStellarValidationErrorSchema.

type StellarTransactionService added in v0.11.0

type StellarTransactionService struct {
	Options []option.RequestOption
}

StellarTransactionService 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 NewStellarTransactionService method instead.

func NewStellarTransactionService added in v0.11.0

func NewStellarTransactionService(opts ...option.RequestOption) (r *StellarTransactionService)

NewStellarTransactionService 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 (*StellarTransactionService) Scan added in v0.11.0

Scan Transactions

type SuccessfulSimulationResultSchema added in v0.12.0

type SuccessfulSimulationResultSchema struct {
	// Summary of the requested account address
	AccountSummary AccountSummarySchema `json:"account_summary,required"`
	// Summary of the accounts involved in the transaction simulation
	AccountsDetails []SuccessfulSimulationResultSchemaAccountsDetail `json:"accounts_details,required"`
	// Summary of the assets involved in the transaction simulation
	AssetsDiff map[string][]SuccessfulSimulationResultSchemaAssetsDiff `json:"assets_diff,required"`
	// Summary of ownership changes, By account address
	AssetsOwnershipDiff map[string][]SuccessfulSimulationResultSchemaAssetsOwnershipDiff `json:"assets_ownership_diff,required"`
	// Summary of the delegations, by account address
	Delegations map[string][]DelegatedAssetDetailsSchema `json:"delegations,required"`
	JSON        successfulSimulationResultSchemaJSON     `json:"-"`
}

func (*SuccessfulSimulationResultSchema) UnmarshalJSON added in v0.12.0

func (r *SuccessfulSimulationResultSchema) UnmarshalJSON(data []byte) (err error)

type SuccessfulSimulationResultSchemaAccountsDetail added in v0.12.0

type SuccessfulSimulationResultSchemaAccountsDetail struct {
	Type SuccessfulSimulationResultSchemaAccountsDetailsType `json:"type"`
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Description of the account
	Description string `json:"description,nullable"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Encoded public key of the mint
	MintAddress string `json:"mint_address"`
	// Encoded public key of the owner
	OwnerAddress string `json:"owner_address"`
	// Name of the mint
	Name string `json:"name"`
	// Symbol of the mint
	Symbol string `json:"symbol"`
	Logo string `json:"logo"`
	// URI of the mint
	Uri string `json:"uri"`
	// The address of the owning program
	Owner string                                             `json:"owner"`
	JSON  successfulSimulationResultSchemaAccountsDetailJSON `json:"-"`
	// contains filtered or unexported fields
}

func (SuccessfulSimulationResultSchemaAccountsDetail) AsUnion added in v0.12.0

AsUnion returns a SuccessfulSimulationResultSchemaAccountsDetailsUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are SystemAccountDetailsSchema, TokenAccountDetailsSchema, FungibleMintAccountDetailsSchema, NonFungibleMintAccountDetailsSchema, ProgramAccountDetailsSchema, PdaAccountSchema, CnftMintAccountDetailsSchema.

func (*SuccessfulSimulationResultSchemaAccountsDetail) UnmarshalJSON added in v0.12.0

func (r *SuccessfulSimulationResultSchemaAccountsDetail) UnmarshalJSON(data []byte) (err error)

type SuccessfulSimulationResultSchemaAccountsDetailsType added in v0.12.0

type SuccessfulSimulationResultSchemaAccountsDetailsType string
const (
	SuccessfulSimulationResultSchemaAccountsDetailsTypeSystemAccount          SuccessfulSimulationResultSchemaAccountsDetailsType = "SYSTEM_ACCOUNT"
	SuccessfulSimulationResultSchemaAccountsDetailsTypeTokenAccount           SuccessfulSimulationResultSchemaAccountsDetailsType = "TOKEN_ACCOUNT"
	SuccessfulSimulationResultSchemaAccountsDetailsTypeFungibleMintAccount    SuccessfulSimulationResultSchemaAccountsDetailsType = "FUNGIBLE_MINT_ACCOUNT"
	SuccessfulSimulationResultSchemaAccountsDetailsTypeNonFungibleMintAccount SuccessfulSimulationResultSchemaAccountsDetailsType = "NON_FUNGIBLE_MINT_ACCOUNT"
	SuccessfulSimulationResultSchemaAccountsDetailsTypeProgram                SuccessfulSimulationResultSchemaAccountsDetailsType = "PROGRAM"
	SuccessfulSimulationResultSchemaAccountsDetailsTypeNativeProgram          SuccessfulSimulationResultSchemaAccountsDetailsType = "NATIVE_PROGRAM"
	SuccessfulSimulationResultSchemaAccountsDetailsTypePda                    SuccessfulSimulationResultSchemaAccountsDetailsType = "PDA"
	SuccessfulSimulationResultSchemaAccountsDetailsTypeCnftMintAccount        SuccessfulSimulationResultSchemaAccountsDetailsType = "CNFT_MINT_ACCOUNT"
)

func (SuccessfulSimulationResultSchemaAccountsDetailsType) IsKnown added in v0.12.0

type SuccessfulSimulationResultSchemaAccountsDetailsUnion added in v0.12.0

type SuccessfulSimulationResultSchemaAccountsDetailsUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by SystemAccountDetailsSchema, TokenAccountDetailsSchema, FungibleMintAccountDetailsSchema, NonFungibleMintAccountDetailsSchema, ProgramAccountDetailsSchema, PdaAccountSchema or CnftMintAccountDetailsSchema.

type SuccessfulSimulationResultSchemaAssetsDiff added in v0.12.0

type SuccessfulSimulationResultSchemaAssetsDiff struct {
	// This field can have the runtime type of [NativeSolDetailsSchema],
	// [SplFungibleTokenDetailsSchema], [SplNonFungibleTokenDetailsSchema],
	// [CnftDetailsSchema].
	Asset interface{} `json:"asset"`
	// Incoming transfers of the asset
	In   AssetTransferDetailsSchema                     `json:"in,nullable"`
	Out  AssetTransferDetailsSchema                     `json:"out,nullable"`
	JSON successfulSimulationResultSchemaAssetsDiffJSON `json:"-"`
	// contains filtered or unexported fields
}

func (SuccessfulSimulationResultSchemaAssetsDiff) AsUnion added in v0.12.0

AsUnion returns a SuccessfulSimulationResultSchemaAssetsDiffUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are NativeSolDiffSchema, SplFungibleTokenDiffSchema, SplNonFungibleTokenDiffSchema, CnftDiffSchema.

func (*SuccessfulSimulationResultSchemaAssetsDiff) UnmarshalJSON added in v0.12.0

func (r *SuccessfulSimulationResultSchemaAssetsDiff) UnmarshalJSON(data []byte) (err error)

type SuccessfulSimulationResultSchemaAssetsDiffUnion added in v0.12.0

type SuccessfulSimulationResultSchemaAssetsDiffUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by NativeSolDiffSchema, SplFungibleTokenDiffSchema, SplNonFungibleTokenDiffSchema or CnftDiffSchema.

type SuccessfulSimulationResultSchemaAssetsOwnershipDiff added in v0.12.0

type SuccessfulSimulationResultSchemaAssetsOwnershipDiff struct {
	// This field can have the runtime type of [NativeSolDetailsSchema],
	// [SplTokenOwnershipDiffSchemaAsset], [StakedSolAssetDetailsSchema].
	Asset interface{} `json:"asset,required"`
	// Incoming transfers of the asset
	In AssetTransferDetailsSchema `json:"in_,nullable"`
	// Details of the moved value
	Out AssetTransferDetailsSchema `json:"out,nullable"`
	// The owner prior to the transaction
	PreOwner string `json:"pre_owner,nullable"`
	// The owner post the transaction
	PostOwner string                                                  `json:"post_owner,required"`
	JSON      successfulSimulationResultSchemaAssetsOwnershipDiffJSON `json:"-"`
	// contains filtered or unexported fields
}

func (SuccessfulSimulationResultSchemaAssetsOwnershipDiff) AsUnion added in v0.12.0

AsUnion returns a SuccessfulSimulationResultSchemaAssetsOwnershipDiffUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are NativeSolOwnershipDiffSchema, SplTokenOwnershipDiffSchema, StakedSolWithdrawAuthorityDiffSchema.

func (*SuccessfulSimulationResultSchemaAssetsOwnershipDiff) UnmarshalJSON added in v0.12.0

func (r *SuccessfulSimulationResultSchemaAssetsOwnershipDiff) UnmarshalJSON(data []byte) (err error)

type SuccessfulSimulationResultSchemaAssetsOwnershipDiffUnion added in v0.12.0

type SuccessfulSimulationResultSchemaAssetsOwnershipDiffUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by NativeSolOwnershipDiffSchema, SplTokenOwnershipDiffSchema or StakedSolWithdrawAuthorityDiffSchema.

type SystemAccountDetailsSchema added in v0.12.0

type SystemAccountDetailsSchema struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string                         `json:"description,nullable"`
	Type        SystemAccountDetailsSchemaType `json:"type"`
	JSON        systemAccountDetailsSchemaJSON `json:"-"`
}

func (*SystemAccountDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *SystemAccountDetailsSchema) UnmarshalJSON(data []byte) (err error)

type SystemAccountDetailsSchemaType added in v0.12.0

type SystemAccountDetailsSchemaType string
const (
	SystemAccountDetailsSchemaTypeSystemAccount SystemAccountDetailsSchemaType = "SYSTEM_ACCOUNT"
)

func (SystemAccountDetailsSchemaType) IsKnown added in v0.12.0

type TokenAccountDetailsSchema added in v0.12.0

type TokenAccountDetailsSchema struct {
	// Encoded public key of the account
	AccountAddress string `json:"account_address,required"`
	// Encoded public key of the mint
	MintAddress string `json:"mint_address,required"`
	// Encoded public key of the owner
	OwnerAddress string `json:"owner_address,required"`
	// Whether the account had been written to during the simulation
	WasWrittenTo bool `json:"was_written_to,required"`
	// Description of the account
	Description string                        `json:"description,nullable"`
	Type        TokenAccountDetailsSchemaType `json:"type"`
	JSON        tokenAccountDetailsSchemaJSON `json:"-"`
}

func (*TokenAccountDetailsSchema) UnmarshalJSON added in v0.12.0

func (r *TokenAccountDetailsSchema) UnmarshalJSON(data []byte) (err error)

type TokenAccountDetailsSchemaType added in v0.12.0

type TokenAccountDetailsSchemaType string
const (
	TokenAccountDetailsSchemaTypeTokenAccount TokenAccountDetailsSchemaType = "TOKEN_ACCOUNT"
)

func (TokenAccountDetailsSchemaType) IsKnown added in v0.12.0

func (r TokenAccountDetailsSchemaType) IsKnown() bool

type TokenReportParams added in v0.15.0

type TokenReportParams struct {
	// Details about the report.
	Details param.Field[string] `json:"details,required"`
	// An enumeration.
	Event param.Field[TokenReportParamsEvent] `json:"event,required"`
	// The report parameters.
	Report param.Field[TokenReportParamsReportUnion] `json:"report,required"`
}

func (TokenReportParams) MarshalJSON added in v0.15.0

func (r TokenReportParams) MarshalJSON() (data []byte, err error)

type TokenReportParamsEvent added in v0.15.0

type TokenReportParamsEvent string

An enumeration.

const (
	TokenReportParamsEventFalsePositive TokenReportParamsEvent = "FALSE_POSITIVE"
	TokenReportParamsEventFalseNegative TokenReportParamsEvent = "FALSE_NEGATIVE"
)

func (TokenReportParamsEvent) IsKnown added in v0.15.0

func (r TokenReportParamsEvent) IsKnown() bool

type TokenReportParamsReport added in v0.15.0

type TokenReportParamsReport struct {
	Type      param.Field[TokenReportParamsReportType] `json:"type,required"`
	Params    param.Field[interface{}]                 `json:"params,required"`
	RequestID param.Field[string]                      `json:"request_id"`
}

The report parameters.

func (TokenReportParamsReport) MarshalJSON added in v0.15.0

func (r TokenReportParamsReport) MarshalJSON() (data []byte, err error)

type TokenReportParamsReportParamReportTokenReportParams added in v0.16.0

type TokenReportParamsReportParamReportTokenReportParams struct {
	Params param.Field[TokenReportParamsReportParamReportTokenReportParamsParams] `json:"params,required"`
	Type   param.Field[TokenReportParamsReportParamReportTokenReportParamsType]   `json:"type,required"`
}

func (TokenReportParamsReportParamReportTokenReportParams) MarshalJSON added in v0.16.0

func (r TokenReportParamsReportParamReportTokenReportParams) MarshalJSON() (data []byte, err error)

type TokenReportParamsReportParamReportTokenReportParamsParams added in v0.16.0

type TokenReportParamsReportParamReportTokenReportParamsParams struct {
	// The address of the token to report on.
	Address param.Field[string] `json:"address,required"`
	// The chain name
	Chain param.Field[TokenScanSupportedChain] `json:"chain,required"`
}

func (TokenReportParamsReportParamReportTokenReportParamsParams) MarshalJSON added in v0.16.0

type TokenReportParamsReportParamReportTokenReportParamsType added in v0.16.0

type TokenReportParamsReportParamReportTokenReportParamsType string
const (
	TokenReportParamsReportParamReportTokenReportParamsTypeParams TokenReportParamsReportParamReportTokenReportParamsType = "params"
)

func (TokenReportParamsReportParamReportTokenReportParamsType) IsKnown added in v0.16.0

type TokenReportParamsReportRequestIDReport added in v0.15.0

type TokenReportParamsReportRequestIDReport struct {
	RequestID param.Field[string]                                     `json:"request_id,required"`
	Type      param.Field[TokenReportParamsReportRequestIDReportType] `json:"type,required"`
}

func (TokenReportParamsReportRequestIDReport) MarshalJSON added in v0.15.0

func (r TokenReportParamsReportRequestIDReport) MarshalJSON() (data []byte, err error)

type TokenReportParamsReportRequestIDReportType added in v0.15.0

type TokenReportParamsReportRequestIDReportType string
const (
	TokenReportParamsReportRequestIDReportTypeRequestID TokenReportParamsReportRequestIDReportType = "request_id"
)

func (TokenReportParamsReportRequestIDReportType) IsKnown added in v0.15.0

type TokenReportParamsReportType added in v0.15.0

type TokenReportParamsReportType string
const (
	TokenReportParamsReportTypeParams    TokenReportParamsReportType = "params"
	TokenReportParamsReportTypeRequestID TokenReportParamsReportType = "request_id"
)

func (TokenReportParamsReportType) IsKnown added in v0.15.0

func (r TokenReportParamsReportType) IsKnown() bool

type TokenReportParamsReportUnion added in v0.15.0

type TokenReportParamsReportUnion interface {
	// contains filtered or unexported methods
}

The report parameters.

Satisfied by TokenReportParamsReportParamReportTokenReportParams, TokenReportParamsReportRequestIDReport, TokenReportParamsReport.

type TokenReportResponse added in v0.15.0

type TokenReportResponse = interface{}

type TokenScanParams added in v0.7.6

type TokenScanParams struct {
	// Token address to validate (EVM / Solana / Stellar)
	Address param.Field[string] `json:"address,required"`
	// The chain name
	Chain param.Field[TokenScanSupportedChain] `json:"chain,required"`
	// Object of additional information to validate against.
	Metadata param.Field[TokenScanParamsMetadata] `json:"metadata"`
}

func (TokenScanParams) MarshalJSON added in v0.7.6

func (r TokenScanParams) MarshalJSON() (data []byte, err error)

type TokenScanParamsMetadata added in v0.7.6

type TokenScanParamsMetadata struct {
	// cross reference transaction against the domain.
	Domain param.Field[string] `json:"domain"`
}

Object of additional information to validate against.

func (TokenScanParamsMetadata) MarshalJSON added in v0.7.6

func (r TokenScanParamsMetadata) MarshalJSON() (data []byte, err error)

type TokenScanResponse added in v0.7.6

type TokenScanResponse struct {
	// Dictionary of detected attacks found during the scan
	AttackTypes map[string]TokenScanResponseAttackType `json:"attack_types,required"`
	// Score between 0 to 1 (double)
	MaliciousScore string `json:"malicious_score,required"`
	// An enumeration.
	ResultType TokenScanResponseResultType `json:"result_type,required"`
	JSON       tokenScanResponseJSON       `json:"-"`
}

func (*TokenScanResponse) UnmarshalJSON added in v0.7.6

func (r *TokenScanResponse) UnmarshalJSON(data []byte) (err error)

type TokenScanResponseAttackType added in v0.7.6

type TokenScanResponseAttackType struct {
	// Score between 0 to 1 (double) that indicates the assurance this attack happened
	Score string `json:"score,required"`
	// Object contains an extra information related to the attack
	Features interface{} `json:"features"`
	// If score is higher or equal to this field, the token is using this attack type
	Threshold string                          `json:"threshold"`
	JSON      tokenScanResponseAttackTypeJSON `json:"-"`
}

func (*TokenScanResponseAttackType) UnmarshalJSON added in v0.7.6

func (r *TokenScanResponseAttackType) UnmarshalJSON(data []byte) (err error)

type TokenScanResponseResultType added in v0.7.6

type TokenScanResponseResultType string

An enumeration.

const (
	TokenScanResponseResultTypeBenign    TokenScanResponseResultType = "Benign"
	TokenScanResponseResultTypeWarning   TokenScanResponseResultType = "Warning"
	TokenScanResponseResultTypeMalicious TokenScanResponseResultType = "Malicious"
	TokenScanResponseResultTypeSpam      TokenScanResponseResultType = "Spam"
)

func (TokenScanResponseResultType) IsKnown added in v0.7.6

func (r TokenScanResponseResultType) IsKnown() bool

type TokenScanSupportedChain added in v0.7.6

type TokenScanSupportedChain string

The chain name

const (
	TokenScanSupportedChainArbitrum  TokenScanSupportedChain = "arbitrum"
	TokenScanSupportedChainAvalanche TokenScanSupportedChain = "avalanche"
	TokenScanSupportedChainBase      TokenScanSupportedChain = "base"
	TokenScanSupportedChainBsc       TokenScanSupportedChain = "bsc"
	TokenScanSupportedChainEthereum  TokenScanSupportedChain = "ethereum"
	TokenScanSupportedChainOptimism  TokenScanSupportedChain = "optimism"
	TokenScanSupportedChainPolygon   TokenScanSupportedChain = "polygon"
	TokenScanSupportedChainZora      TokenScanSupportedChain = "zora"
	TokenScanSupportedChainSolana    TokenScanSupportedChain = "solana"
	TokenScanSupportedChainStellar   TokenScanSupportedChain = "stellar"
	TokenScanSupportedChainLinea     TokenScanSupportedChain = "linea"
	TokenScanSupportedChainBlast     TokenScanSupportedChain = "blast"
	TokenScanSupportedChainZksync    TokenScanSupportedChain = "zksync"
	TokenScanSupportedChainScroll    TokenScanSupportedChain = "scroll"
	TokenScanSupportedChainDegen     TokenScanSupportedChain = "degen"
)

func (TokenScanSupportedChain) IsKnown added in v0.7.6

func (r TokenScanSupportedChain) IsKnown() bool

type TokenService added in v0.7.6

type TokenService struct {
	Options []option.RequestOption
}

TokenService 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 NewTokenService method instead.

func NewTokenService added in v0.7.6

func NewTokenService(opts ...option.RequestOption) (r *TokenService)

NewTokenService 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 (*TokenService) Report added in v0.15.0

func (r *TokenService) Report(ctx context.Context, body TokenReportParams, opts ...option.RequestOption) (res *TokenReportResponse, err error)

Report for misclassification of a token.

func (*TokenService) Scan added in v0.7.6

func (r *TokenService) Scan(ctx context.Context, body TokenScanParams, opts ...option.RequestOption) (res *TokenScanResponse, err error)

Gets a token address and scan the token to identify any indication of malicious behaviour

type TotalUsdDiffSchema added in v0.12.0

type TotalUsdDiffSchema struct {
	// Total incoming USD transfers
	In float64 `json:"in,required"`
	// Total outgoing USD transfers
	Out float64 `json:"out,required"`
	// Total USD transfers
	Total float64                `json:"total,required"`
	JSON  totalUsdDiffSchemaJSON `json:"-"`
}

func (*TotalUsdDiffSchema) UnmarshalJSON added in v0.12.0

func (r *TotalUsdDiffSchema) UnmarshalJSON(data []byte) (err error)

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"`
	AccountAddress string                               `json:"account_address"`
	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 {
	Status   TransactionScanResponseGasEstimationStatus `json:"status,required"`
	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

AsUnion returns a TransactionScanResponseGasEstimationUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are TransactionScanResponseGasEstimationTransactionScanGasEstimation, TransactionScanResponseGasEstimationTransactionScanGasEstimationError.

func (*TransactionScanResponseGasEstimation) UnmarshalJSON added in v0.7.5

func (r *TransactionScanResponseGasEstimation) UnmarshalJSON(data []byte) (err error)

type TransactionScanResponseGasEstimationStatus added in v0.8.0

type TransactionScanResponseGasEstimationStatus string
const (
	TransactionScanResponseGasEstimationStatusSuccess TransactionScanResponseGasEstimationStatus = "Success"
	TransactionScanResponseGasEstimationStatusError   TransactionScanResponseGasEstimationStatus = "Error"
)

func (TransactionScanResponseGasEstimationStatus) IsKnown added in v0.8.0

type TransactionScanResponseGasEstimationTransactionScanGasEstimation added in v0.7.5

type TransactionScanResponseGasEstimationTransactionScanGasEstimation struct {
	Estimate int64                                                                  `json:"estimate,required"`
	Status   TransactionScanResponseGasEstimationTransactionScanGasEstimationStatus `json:"status,required"`
	Used     int64                                                                  `json:"used,required"`
	JSON     transactionScanResponseGasEstimationTransactionScanGasEstimationJSON   `json:"-"`
}

func (*TransactionScanResponseGasEstimationTransactionScanGasEstimation) UnmarshalJSON added in v0.7.5

type TransactionScanResponseGasEstimationTransactionScanGasEstimationError added in v0.7.5

type TransactionScanResponseGasEstimationTransactionScanGasEstimationError struct {
	Error  string                                                                      `json:"error,required"`
	Status TransactionScanResponseGasEstimationTransactionScanGasEstimationErrorStatus `json:"status,required"`
	JSON   transactionScanResponseGasEstimationTransactionScanGasEstimationErrorJSON   `json:"-"`
}

func (*TransactionScanResponseGasEstimationTransactionScanGasEstimationError) UnmarshalJSON added in v0.7.5

type TransactionScanResponseGasEstimationTransactionScanGasEstimationErrorStatus added in v0.8.0

type TransactionScanResponseGasEstimationTransactionScanGasEstimationErrorStatus string
const (
	TransactionScanResponseGasEstimationTransactionScanGasEstimationErrorStatusError TransactionScanResponseGasEstimationTransactionScanGasEstimationErrorStatus = "Error"
)

func (TransactionScanResponseGasEstimationTransactionScanGasEstimationErrorStatus) IsKnown added in v0.8.0

type TransactionScanResponseGasEstimationTransactionScanGasEstimationStatus added in v0.8.0

type TransactionScanResponseGasEstimationTransactionScanGasEstimationStatus string
const (
	TransactionScanResponseGasEstimationTransactionScanGasEstimationStatusSuccess TransactionScanResponseGasEstimationTransactionScanGasEstimationStatus = "Success"
)

func (TransactionScanResponseGasEstimationTransactionScanGasEstimationStatus) IsKnown added in v0.8.0

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 {
	// A string indicating if the simulation was successful or not.
	Status TransactionScanResponseSimulationStatus `json:"status,required"`
	// This field can have the runtime type of [map[string][]AssetDiff].
	AssetsDiffs interface{} `json:"assets_diffs,required"`
	// This field can have the runtime type of [map[string]UsdDiff].
	TotalUsdDiff interface{} `json:"total_usd_diff,required"`
	// This field can have the runtime type of [map[string][]AddressAssetExposure].
	Exposures interface{} `json:"exposures,required"`
	// This field can have the runtime type of [map[string]map[string]string].
	TotalUsdExposure interface{} `json:"total_usd_exposure,required"`
	// This field can have the runtime type of
	// [map[string]TransactionSimulationAddressDetail].
	AddressDetails interface{} `json:"address_details,required"`
	// This field can have the runtime type of [TransactionSimulationAccountSummary].
	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

AsUnion returns a TransactionScanResponseSimulationUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are TransactionSimulation, TransactionSimulationError.

func (*TransactionScanResponseSimulation) UnmarshalJSON

func (r *TransactionScanResponseSimulation) UnmarshalJSON(data []byte) (err error)

type TransactionScanResponseSimulationStatus added in v0.8.0

type TransactionScanResponseSimulationStatus string

A string indicating if the simulation was successful or not.

const (
	TransactionScanResponseSimulationStatusSuccess TransactionScanResponseSimulationStatus = "Success"
	TransactionScanResponseSimulationStatusError   TransactionScanResponseSimulationStatus = "Error"
)

func (TransactionScanResponseSimulationStatus) IsKnown added in v0.8.0

type TransactionScanResponseSimulationUnion

type TransactionScanResponseSimulationUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by TransactionSimulation or TransactionSimulationError.

type TransactionScanResponseValidation

type TransactionScanResponseValidation struct {
	// A string indicating if the simulation was successful or not.
	Status TransactionScanResponseValidationStatus `json:"status,required"`
	// An enumeration.
	ResultType TransactionScanResponseValidationResultType `json:"result_type,required"`
	// 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"`
	// This field can have the runtime type of [[]TransactionScanFeature].
	Features interface{} `json:"features"`
	// An error message if the validation failed.
	Error string                                `json:"error"`
	JSON  transactionScanResponseValidationJSON `json:"-"`
	// contains filtered or unexported fields
}

func (TransactionScanResponseValidation) AsUnion

AsUnion returns a TransactionScanResponseValidationUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are TransactionValidation, TransactionValidationError.

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"
	TransactionScanResponseValidationResultTypeError     TransactionScanResponseValidationResultType = "Error"
)

func (TransactionScanResponseValidationResultType) IsKnown

type TransactionScanResponseValidationStatus added in v0.9.1

type TransactionScanResponseValidationStatus string

A string indicating if the simulation was successful or not.

const (
	TransactionScanResponseValidationStatusSuccess TransactionScanResponseValidationStatus = "Success"
)

func (TransactionScanResponseValidationStatus) IsKnown added in v0.9.1

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"
	TransactionScanSupportedChainZksyncSepolia   TransactionScanSupportedChain = "zksync-sepolia"
	TransactionScanSupportedChainZora            TransactionScanSupportedChain = "zora"
	TransactionScanSupportedChainLinea           TransactionScanSupportedChain = "linea"
	TransactionScanSupportedChainBlast           TransactionScanSupportedChain = "blast"
	TransactionScanSupportedChainScroll          TransactionScanSupportedChain = "scroll"
	TransactionScanSupportedChainEthereumSepolia TransactionScanSupportedChain = "ethereum-sepolia"
	TransactionScanSupportedChainDegen           TransactionScanSupportedChain = "degen"
	TransactionScanSupportedChainAvalancheFuji   TransactionScanSupportedChain = "avalanche-fuji"
	TransactionScanSupportedChainImmutableZkevm  TransactionScanSupportedChain = "immutable-zkevm"
)

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"`
	// A string indicating if the simulation was successful or not.
	Status TransactionSimulationStatus `json:"status,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 []TransactionSimulationAccountSummaryAssetsDiff `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 TransactionSimulationAccountSummaryAssetsDiff added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiff struct {
	// description of the asset for the current diff
	Asset TransactionSimulationAccountSummaryAssetsDiffsAsset `json:"asset,required"`
	// amount of the asset that was transferred to the address in this transaction
	In []TransactionSimulationAccountSummaryAssetsDiffsIn `json:"in,required"`
	// amount of the asset that was transferred from the address in this transaction
	Out []TransactionSimulationAccountSummaryAssetsDiffsOut `json:"out,required"`
	// shows the balance before making the transaction and after
	BalanceChanges TransactionSimulationAccountSummaryAssetsDiffsBalanceChanges `json:"balance_changes"`
	JSON           transactionSimulationAccountSummaryAssetsDiffJSON            `json:"-"`
}

func (*TransactionSimulationAccountSummaryAssetsDiff) UnmarshalJSON added in v0.14.0

func (r *TransactionSimulationAccountSummaryAssetsDiff) UnmarshalJSON(data []byte) (err error)

type TransactionSimulationAccountSummaryAssetsDiffsAsset added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsAsset 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 TransactionSimulationAccountSummaryAssetsDiffsAssetType `json:"type,required"`
	// asset's decimals
	Decimals  int64                                                   `json:"decimals"`
	ChainName string                                                  `json:"chain_name"`
	ChainID   int64                                                   `json:"chain_id"`
	JSON      transactionSimulationAccountSummaryAssetsDiffsAssetJSON `json:"-"`
	// contains filtered or unexported fields
}

description of the asset for the current diff

func (TransactionSimulationAccountSummaryAssetsDiffsAsset) AsUnion added in v0.14.0

AsUnion returns a TransactionSimulationAccountSummaryAssetsDiffsAssetUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc20TokenDetails, Erc1155TokenDetails, Erc721TokenDetails, NonercTokenDetails, NativeAssetDetails.

func (*TransactionSimulationAccountSummaryAssetsDiffsAsset) UnmarshalJSON added in v0.14.0

func (r *TransactionSimulationAccountSummaryAssetsDiffsAsset) UnmarshalJSON(data []byte) (err error)

type TransactionSimulationAccountSummaryAssetsDiffsAssetType added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsAssetType string

asset type.

const (
	TransactionSimulationAccountSummaryAssetsDiffsAssetTypeErc20   TransactionSimulationAccountSummaryAssetsDiffsAssetType = "ERC20"
	TransactionSimulationAccountSummaryAssetsDiffsAssetTypeErc1155 TransactionSimulationAccountSummaryAssetsDiffsAssetType = "ERC1155"
	TransactionSimulationAccountSummaryAssetsDiffsAssetTypeErc721  TransactionSimulationAccountSummaryAssetsDiffsAssetType = "ERC721"
	TransactionSimulationAccountSummaryAssetsDiffsAssetTypeNonerc  TransactionSimulationAccountSummaryAssetsDiffsAssetType = "NONERC"
	TransactionSimulationAccountSummaryAssetsDiffsAssetTypeNative  TransactionSimulationAccountSummaryAssetsDiffsAssetType = "NATIVE"
)

func (TransactionSimulationAccountSummaryAssetsDiffsAssetType) IsKnown added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsAssetUnion added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsAssetUnion interface {
	// contains filtered or unexported methods
}

description of the asset for the current diff

Union satisfied by Erc20TokenDetails, Erc1155TokenDetails, Erc721TokenDetails, NonercTokenDetails or NativeAssetDetails.

type TransactionSimulationAccountSummaryAssetsDiffsBalanceChanges added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsBalanceChanges struct {
	// balance of the account after making the transaction
	After TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesAfter `json:"after,required"`
	// balance of the account before making the transaction
	Before TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesBefore `json:"before,required"`
	JSON   transactionSimulationAccountSummaryAssetsDiffsBalanceChangesJSON   `json:"-"`
}

shows the balance before making the transaction and after

func (*TransactionSimulationAccountSummaryAssetsDiffsBalanceChanges) UnmarshalJSON added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesAfter added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesAfter struct {
	// value before divided by decimal, that was transferred from this address
	RawValue string `json:"raw_value,required"`
	// usd equal of the asset that was transferred from this address
	UsdPrice string `json:"usd_price"`
	// value after divided by decimals, that was transferred from this address
	Value string                                                                `json:"value"`
	JSON  transactionSimulationAccountSummaryAssetsDiffsBalanceChangesAfterJSON `json:"-"`
}

balance of the account after making the transaction

func (*TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesAfter) UnmarshalJSON added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesBefore added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesBefore struct {
	// value before divided by decimal, that was transferred from this address
	RawValue string `json:"raw_value,required"`
	// usd equal of the asset that was transferred from this address
	UsdPrice string `json:"usd_price"`
	// value after divided by decimals, that was transferred from this address
	Value string                                                                 `json:"value"`
	JSON  transactionSimulationAccountSummaryAssetsDiffsBalanceChangesBeforeJSON `json:"-"`
}

balance of the account before making the transaction

func (*TransactionSimulationAccountSummaryAssetsDiffsBalanceChangesBefore) UnmarshalJSON added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsIn added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsIn struct {
	// usd equal of the asset that was transferred from this address
	UsdPrice string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string                                               `json:"raw_value"`
	JSON     transactionSimulationAccountSummaryAssetsDiffsInJSON `json:"-"`
	// contains filtered or unexported fields
}

func (TransactionSimulationAccountSummaryAssetsDiffsIn) AsUnion added in v0.14.0

AsUnion returns a TransactionSimulationAccountSummaryAssetsDiffsInUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

func (*TransactionSimulationAccountSummaryAssetsDiffsIn) UnmarshalJSON added in v0.14.0

func (r *TransactionSimulationAccountSummaryAssetsDiffsIn) UnmarshalJSON(data []byte) (err error)

type TransactionSimulationAccountSummaryAssetsDiffsInUnion added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsInUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.

type TransactionSimulationAccountSummaryAssetsDiffsOut added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsOut struct {
	// usd equal of the asset that was transferred from this address
	UsdPrice string `json:"usd_price"`
	// user friendly description of the asset transfer
	Summary string `json:"summary"`
	// id of the token
	TokenID int64 `json:"token_id"`
	// value before divided by decimal, that was transferred from this address
	Value string `json:"value"`
	// url of the token logo
	LogoURL string `json:"logo_url"`
	// value before divided by decimal, that was transferred from this address
	RawValue string                                                `json:"raw_value"`
	JSON     transactionSimulationAccountSummaryAssetsDiffsOutJSON `json:"-"`
	// contains filtered or unexported fields
}

func (TransactionSimulationAccountSummaryAssetsDiffsOut) AsUnion added in v0.14.0

AsUnion returns a TransactionSimulationAccountSummaryAssetsDiffsOutUnion interface which you can cast to the specific types for more type safety.

Possible runtime types of the union are Erc1155Diff, Erc721Diff, Erc20Diff, NativeDiff.

func (*TransactionSimulationAccountSummaryAssetsDiffsOut) UnmarshalJSON added in v0.14.0

func (r *TransactionSimulationAccountSummaryAssetsDiffsOut) UnmarshalJSON(data []byte) (err error)

type TransactionSimulationAccountSummaryAssetsDiffsOutUnion added in v0.14.0

type TransactionSimulationAccountSummaryAssetsDiffsOutUnion interface {
	// contains filtered or unexported methods
}

Union satisfied by Erc1155Diff, Erc721Diff, Erc20Diff or NativeDiff.

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"`
	// A string indicating if the simulation was successful or not.
	Status TransactionSimulationErrorStatus `json:"status,required"`
	JSON   transactionSimulationErrorJSON   `json:"-"`
}

func (*TransactionSimulationError) UnmarshalJSON added in v0.7.3

func (r *TransactionSimulationError) UnmarshalJSON(data []byte) (err error)

type TransactionSimulationErrorStatus added in v0.8.0

type TransactionSimulationErrorStatus string

A string indicating if the simulation was successful or not.

const (
	TransactionSimulationErrorStatusError TransactionSimulationErrorStatus = "Error"
)

func (TransactionSimulationErrorStatus) IsKnown added in v0.8.0

type TransactionSimulationStatus added in v0.8.0

type TransactionSimulationStatus string

A string indicating if the simulation was successful or not.

const (
	TransactionSimulationStatusSuccess TransactionSimulationStatus = "Success"
)

func (TransactionSimulationStatus) IsKnown added in v0.8.0

func (r TransactionSimulationStatus) IsKnown() bool

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 string indicating if the simulation was successful or not.
	Status TransactionValidationStatus `json:"status,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 {
	// A textual classification that can be presented to the user explaining the
	// reason.
	Classification TransactionValidationErrorClassification `json:"classification,required"`
	// A textual description that can be presented to the user about what this
	// transaction is doing.
	Description TransactionValidationErrorDescription `json:"description,required"`
	// An error message if the validation failed.
	Error string `json:"error,required"`
	// A list of features about this transaction explaining the validation.
	Features []TransactionScanFeature `json:"features,required"`
	// A textual description about the reasons the transaction was flagged with
	// result_type.
	Reason TransactionValidationErrorReason `json:"reason,required"`
	// A string indicating if the transaction is safe to sign or not.
	ResultType TransactionValidationErrorResultType `json:"result_type,required"`
	// A string indicating if the simulation was successful or not.
	Status TransactionValidationErrorStatus `json:"status,required"`
	JSON   transactionValidationErrorJSON   `json:"-"`
}

func (*TransactionValidationError) UnmarshalJSON added in v0.7.3

func (r *TransactionValidationError) UnmarshalJSON(data []byte) (err error)

type TransactionValidationErrorClassification added in v0.7.3

type TransactionValidationErrorClassification string

A textual classification that can be presented to the user explaining the reason.

const (
	TransactionValidationErrorClassificationEmpty TransactionValidationErrorClassification = ""
)

func (TransactionValidationErrorClassification) IsKnown added in v0.7.3

type TransactionValidationErrorDescription added in v0.7.3

type TransactionValidationErrorDescription string

A textual description that can be presented to the user about what this transaction is doing.

const (
	TransactionValidationErrorDescriptionEmpty TransactionValidationErrorDescription = ""
)

func (TransactionValidationErrorDescription) IsKnown added in v0.7.3

type TransactionValidationErrorReason added in v0.7.3

type TransactionValidationErrorReason string

A textual description about the reasons the transaction was flagged with result_type.

const (
	TransactionValidationErrorReasonEmpty TransactionValidationErrorReason = ""
)

func (TransactionValidationErrorReason) IsKnown added in v0.7.3

type TransactionValidationErrorResultType added in v0.7.3

type TransactionValidationErrorResultType string

A string indicating if the transaction is safe to sign or not.

const (
	TransactionValidationErrorResultTypeError TransactionValidationErrorResultType = "Error"
)

func (TransactionValidationErrorResultType) IsKnown added in v0.7.3

type TransactionValidationErrorStatus added in v0.9.1

type TransactionValidationErrorStatus string

A string indicating if the simulation was successful or not.

const (
	TransactionValidationErrorStatusSuccess TransactionValidationErrorStatus = "Success"
)

func (TransactionValidationErrorStatus) IsKnown added in v0.9.1

type TransactionValidationResultType

type TransactionValidationResultType string

An enumeration.

const (
	TransactionValidationResultTypeBenign    TransactionValidationResultType = "Benign"
	TransactionValidationResultTypeWarning   TransactionValidationResultType = "Warning"
	TransactionValidationResultTypeMalicious TransactionValidationResultType = "Malicious"
)

func (TransactionValidationResultType) IsKnown

type TransactionValidationStatus added in v0.9.1

type TransactionValidationStatus string

A string indicating if the simulation was successful or not.

const (
	TransactionValidationStatusSuccess TransactionValidationStatus = "Success"
)

func (TransactionValidationStatus) IsKnown added in v0.9.1

func (r TransactionValidationStatus) IsKnown() bool

type TxScanRequestSchemaMetadataParam added in v0.12.0

type TxScanRequestSchemaMetadataParam struct {
	// URL of the dApp that originated the transaction
	URL param.Field[string] `json:"url"`
}

func (TxScanRequestSchemaMetadataParam) MarshalJSON added in v0.12.0

func (r TxScanRequestSchemaMetadataParam) MarshalJSON() (data []byte, err error)

type TxScanRequestSchemaParam added in v0.12.0

type TxScanRequestSchemaParam struct {
	// Encoded public key of the account to simulate the transaction on
	AccountAddress param.Field[string]                           `json:"account_address,required"`
	Metadata       param.Field[TxScanRequestSchemaMetadataParam] `json:"metadata,required"`
	// Transactions to scan
	Transactions param.Field[[]string] `json:"transactions,required"`
	// Chain to scan the transaction on
	Chain param.Field[string] `json:"chain"`
	// Encoding of the transaction and public keys
	Encoding param.Field[string] `json:"encoding"`
	// The RPC method used by dApp to propose the transaction
	Method param.Field[string] `json:"method"`
}

func (TxScanRequestSchemaParam) MarshalJSON added in v0.12.0

func (r TxScanRequestSchemaParam) MarshalJSON() (data []byte, err error)

type UsdDiff

type UsdDiff struct {
	In    string      `json:"in,required"`
	Out   string      `json:"out,required"`
	Total string      `json:"total,required"`
	JSON  usdDiffJSON `json:"-"`
}

func (*UsdDiff) UnmarshalJSON

func (r *UsdDiff) UnmarshalJSON(data []byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL