mexa

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const SignatureTypeEIP712 = "EIP712_SIGN"

Variables

View Source
var AddressMap = map[string]common.Address{
	"1":      common.HexToAddress("0x84a0856b038eaAd1cC7E297cF34A7e72685A8693"),
	"3":      common.HexToAddress("0x3D1D6A62c588C1Ee23365AF623bdF306Eb47217A"),
	"4":      common.HexToAddress("0xFD4973FeB2031D4409fB57afEE5dF2051b171104"),
	"5":      common.HexToAddress("0xE041608922d06a4F26C0d4c27d8bCD01daf1f792"),
	"42":     common.HexToAddress("0xF82986F574803dfFd9609BE8b9c7B92f63a1410E"),
	"56":     common.HexToAddress("0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8"),
	"97":     common.HexToAddress("0x61456BF1715C1415730076BB79ae118E806E74d2"),
	"137":    common.HexToAddress("0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8"),
	"100":    common.HexToAddress("0x86C80a8aa58e0A4fa09A69624c31Ab2a6CAD56b8"),
	"1287":   common.HexToAddress("0x3AF14449e18f2c3677bFCB5F954Dc68d5fb74a75"),
	"80001":  common.HexToAddress("0x9399BB24DBB5C4b782C70c2969F58716Ebbd6a3b"),
	"421611": common.HexToAddress("0x67454E169d613a8e9BA6b06af2D267696EAaAf41"),
}

AddressMap is a mapping of chain IDs to Biconomy forwarder contract addresses.

Functions

This section is empty.

Types

type MetaApiInfo

type MetaApiInfo struct {
	ContractAddress   common.Address `json:"contractAddress"`
	ID                string         `json:"id"`
	Name              string         `json:"name"`
	URL               string         `json:"url"`
	Version           int            `json:"version"`
	Method            string         `json:"method"`
	MethodType        string         `json:"methodType"`
	ApiType           string         `json:"apiType"`
	MetaTxLimitStatus int            `json:"metaTxLimitStatus"`
	MetaTxLimit       MetaTxLimit    `json:"metaTxLimit"`
}

type MetaApiResponse

type MetaApiResponse struct {
	Log   string        `json:"log"`
	Flag  int           `json:"flag"`
	Total int           `json:"total"`
	List  []MetaApiInfo `json:"listApis"`
}

type MetaTxLimit

type MetaTxLimit struct {
	Type              int     `json:"type"`
	Value             float32 `json:"value"`
	DurationValue     int     `json:"durationValue"`
	DurationUnit      string  `json:"day"`
	LimitStartTime    int64   `json:"limitStartTime"`
	LimitDurationInMs int64   `json:"limitDurationInMs"`
}

type MetaTxRequest

type MetaTxRequest struct {
	To            string        `json:"to"`
	From          string        `json:"from"`
	ApiId         string        `json:"apiId"`
	Params        []interface{} `json:"params"`
	SignatureType string        `json:"signatureType"`
}

type MetaTxResponse

type MetaTxResponse struct {
	TxHash string `json:"txHash"`
	Log    string `json:"log"`
	Flag   int    `json:"flag"`
}

type Mexa

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

Mexa is a MetaTransactor

func NewMexa

func NewMexa(ctx context.Context, eth *ethclient.Client, key string) (*Mexa, error)

NewMexa returns a new mexa client.

func (*Mexa) Domain

func (m *Mexa) Domain() core.TypedDataDomain

func (*Mexa) MetaApi

func (m *Mexa) MetaApi(ctx context.Context) (*MetaApiResponse, error)

MetaApi returns a list of all meta tx enabled functions.

func (*Mexa) MetaTx

func (m *Mexa) MetaTx(ctx context.Context, data *MetaTxRequest) (*MetaTxResponse, error)

MetaTx executes a meta transaction using the given data.

func (*Mexa) Nonce

func (m *Mexa) Nonce(ctx context.Context, address common.Address) (*big.Int, error)

func (*Mexa) PrimaryType

func (m *Mexa) PrimaryType() string

func (*Mexa) Types

func (m *Mexa) Types() core.Types

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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