zkapi

package
v0.0.0-...-ca1f761 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockResp

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

func (*BlockResp) Hash

func (b *BlockResp) Hash() string

func (*BlockResp) Time

func (b *BlockResp) Time() uint64

type Client

type Client struct {
	evmapi.BaseClient
	BaseURL     string
	BlockMap    map[uint64]*BlockResp
	BlockMapMtx sync.Mutex

	MinGasPrice      string
	PaymasterFeeZero bool
	PaymasterAddress string
	PaymasterToken   string
	// contains filtered or unexported fields
}

func (*Client) Address

func (c *Client) Address() (string, string, error)

func (*Client) Balance

func (c *Client) Balance(addr string) (*big.Int, error)

func (*Client) BlockByNumber

func (c *Client) BlockByNumber(blockNumber int64) (*zktypes.Block, error)

func (*Client) ChainID

func (c *Client) ChainID() uint64

func (*Client) ConvertAddressForIn

func (c *Client) ConvertAddressForIn(addr string) string

func (*Client) ConvertAddressForOut

func (c *Client) ConvertAddressForOut(addr string) string

func (*Client) DeployContract

func (c *Client) DeployContract(prkHex string, dataBin string, contructorHex string) (string, string, error)

func (*Client) DeployTransparentUpgradeableProxy

func (c *Client) DeployTransparentUpgradeableProxy(prkHex string, logic common.Address, admin common.Address, data []byte) (string, string, error)

func (*Client) Erc1155SetApprovalForAll

func (c *Client) Erc1155SetApprovalForAll(erc1155Addr string, prkHex string, toAddr string, wait bool) (string, error)

func (*Client) Erc1155Transfer

func (c *Client) Erc1155Transfer(erc20Addr string, prkHex string, toAddr string, tokenId string, amount *big.Int) (string, error)

func (*Client) Erc20Allowance

func (c *Client) Erc20Allowance(erc20Addr string, addr string, spender string) (*big.Int, error)

func (*Client) Erc20ApproveMax

func (c *Client) Erc20ApproveMax(erc20Addr string, prkHex string, toAddr string, wait bool) (string, error)

func (*Client) Erc20Balance

func (c *Client) Erc20Balance(erc20Addr string, addr string) (*big.Int, error)

func (*Client) Erc20Info

func (c *Client) Erc20Info(erc20Addr string) (*Erc20InfoResp, error)

func (*Client) Erc20Symbol

func (c *Client) Erc20Symbol(erc20Addr string) (string, error)

func (*Client) Erc20Transfer

func (c *Client) Erc20Transfer(erc20Addr string, prkHex string, toAddr string, amount *big.Int) (string, error)

func (*Client) Erc721Transfer

func (c *Client) Erc721Transfer(contractAddr string, prkHex string, toAddr string, tokenId *big.Int) (string, error)

func (*Client) GetCachedGasPriceAndTipCap

func (c *Client) GetCachedGasPriceAndTipCap() (*big.Int, *big.Int, error)

func (*Client) GetChainID

func (c *Client) GetChainID() (uint64, error)

func (*Client) GetLastBlockNumber

func (c *Client) GetLastBlockNumber() (int64, error)

func (*Client) GetPaymasterParams

func (c *Client) GetPaymasterParams() (*zktypes.PaymasterParams, error)

func (*Client) GetPaymasterParamsWithFee

func (c *Client) GetPaymasterParamsWithFee(fee *big.Int) (*zktypes.PaymasterParams, error)

func (*Client) HybridModelInfer

func (c *Client) HybridModelInfer(contractAddress string, prkHex string, inferData string) (string, error)

func (*Client) ImageHubChargeSubscription

func (c *Client) ImageHubChargeSubscription(contractAddress string, prkHex string, userAddress string, creatorAddress string) (string, error)

func (*Client) InscribeTxs

func (c *Client) InscribeTxs(txHashs []string) (string, error)

func (*Client) NftOwnerOf

func (c *Client) NftOwnerOf(nftAddr string, tokenID string) (string, error)

func (*Client) PaymasterParams

func (c *Client) PaymasterParams() *zktypes.PaymasterParams

func (*Client) PopulateTransaction

func (c *Client) PopulateTransaction(ctx context.Context, address common.Address, tx accounts.Transaction) (*zktypes.Transaction712, error)

func (*Client) SetPaymasterParams

func (c *Client) SetPaymasterParams(tx *accounts.Transaction) error

func (*Client) SignTransaction

func (c *Client) SignTransaction(signer accounts.Signer, tx *zktypes.Transaction712) ([]byte, error)

func (*Client) SystemPromptManagerInfer

func (c *Client) SystemPromptManagerInfer(contractAddress string, prkHex string, agentId int64, inferData string, externalData string) (string, error)

func (*Client) SystemPromptManagerMint

func (c *Client) SystemPromptManagerMint(contractAddress string, prkHex string, to common.Address, uri string, data []byte, fee *big.Int) (string, error)

func (*Client) Transact

func (c *Client) Transact(contractAddr string, prkHex string, dataBytes []byte, value *big.Int) (string, error)

func (*Client) TransactionConfirmed

func (c *Client) TransactionConfirmed(hash string) error

func (*Client) Transfer

func (c *Client) Transfer(prkHex string, toAddr string, amount string, includeFee bool, wait bool) (string, error)

func (*Client) ValidateMessageSignature

func (c *Client) ValidateMessageSignature(msg string, signatureHex string, signer string) error

func (*Client) WaitMined

func (c *Client) WaitMined(hash string) error

func (*Client) ZksyncNonfungiblePositionManagerMint

func (c *Client) ZksyncNonfungiblePositionManagerMint(contractAddr string, privateHex string, weth9 common.Address, sqrtPriceX96 *big.Int, params *zksyncnonfungiblepositionmanager.INonfungiblePositionManagerMintParams) (string, error)

type Erc20InfoResp

type Erc20InfoResp struct {
	Symbol     string   `json:"symbol"`
	Name       string   `json:"name"`
	TotalSuply *big.Int `json:"total_suply"`
	Decimals   int      `json:"decimals"`
}

Jump to

Keyboard shortcuts

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