gateway

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(gatewayURL string, log utils.SimpleLogger) *Client

func NewTestClient

func NewTestClient(t *testing.T) *Client

NewTestClient returns a client and a function to close a test server.

func (*Client) AddTransaction

func (c *Client) AddTransaction(ctx context.Context, txn json.RawMessage) (json.RawMessage, error)

func (*Client) WithAPIKey added in v0.9.2

func (c *Client) WithAPIKey(key string) *Client

func (*Client) WithListener added in v0.9.3

func (c *Client) WithListener(l EventListener) *Client

func (*Client) WithUserAgent added in v0.6.0

func (c *Client) WithUserAgent(ua string) *Client

type Error added in v0.5.0

type Error struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

func (Error) Error added in v0.5.0

func (e Error) Error() string

type ErrorCode added in v0.5.0

type ErrorCode string
var (
	InvalidContractClass            ErrorCode = "StarknetErrorCode.INVALID_CONTRACT_CLASS"
	UndeclaredClass                 ErrorCode = "StarknetErrorCode.UNDECLARED_CLASS"
	ClassAlreadyDeclared            ErrorCode = "StarknetErrorCode.CLASS_ALREADY_DECLARED"
	InsufficientMaxFee              ErrorCode = "StarknetErrorCode.INSUFFICIENT_MAX_FEE"
	InsufficientAccountBalance      ErrorCode = "StarknetErrorCode.INSUFFICIENT_ACCOUNT_BALANCE"
	ValidateFailure                 ErrorCode = "StarknetErrorCode.VALIDATE_FAILURE"
	ContractBytecodeSizeTooLarge    ErrorCode = "StarknetErrorCode.CONTRACT_BYTECODE_SIZE_TOO_LARGE"
	DuplicatedTransaction           ErrorCode = "StarknetErrorCode.DUPLICATED_TRANSACTION"
	InvalidTransactionNonce         ErrorCode = "StarknetErrorCode.INVALID_TRANSACTION_NONCE"
	CompilationFailed               ErrorCode = "StarknetErrorCode.COMPILATION_FAILED"
	InvalidCompiledClassHash        ErrorCode = "StarknetErrorCode.INVALID_COMPILED_CLASS_HASH"
	ContractClassObjectSizeTooLarge ErrorCode = "StarknetErrorCode.CONTRACT_CLASS_OBJECT_SIZE_TOO_LARGE"
	InvalidTransactionVersion       ErrorCode = "StarknetErrorCode.INVALID_TRANSACTION_VERSION"
	InvalidContractClassVersion     ErrorCode = "StarknetErrorCode.INVALID_CONTRACT_CLASS_VERSION"
)

type EventListener added in v0.9.3

type EventListener interface {
	OnResponse(urlPath string, status int, took time.Duration)
}

type SelectiveListener added in v0.9.3

type SelectiveListener struct {
	OnResponseCb func(urlPath string, status int, took time.Duration)
}

func (*SelectiveListener) OnResponse added in v0.9.3

func (l *SelectiveListener) OnResponse(urlPath string, status int, took time.Duration)

Jump to

Keyboard shortcuts

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