mexa

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PrimaryType = "ERC20ForwardRequest"
	Name        = "Biconomy Forwarder"
	Version     = "1"
)
View Source
const SignatureTypeEIP712 = "EIP712_SIGN"

Variables

View Source
var ForwarderAddressMap = 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"),
}

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

View Source
var Types = core.Types{
	"EIP712Domain": []core.Type{
		{Name: "name", Type: "string"},
		{Name: "version", Type: "string"},
		{Name: "verifyingContract", Type: "address"},
		{Name: "salt", Type: "bytes32"},
	},
	"ERC20ForwardRequest": []core.Type{
		{Name: "from", Type: "address"},
		{Name: "to", Type: "address"},
		{Name: "token", Type: "address"},
		{Name: "txGas", Type: "uint256"},
		{Name: "tokenGasPrice", Type: "uint256"},
		{Name: "batchId", Type: "uint256"},
		{Name: "batchNonce", Type: "uint256"},
		{Name: "deadline", Type: "uint256"},
		{Name: "data", Type: "bytes"},
	},
}

Functions

This section is empty.

Types

type Message

type Message struct {
	From          common.Address `json:"from"`
	To            common.Address `json:"to"`
	Token         common.Address `json:"token"`
	TxGas         uint64         `json:"txGas"`
	TokenGasPrice string         `json:"tokenGasPrice"`
	BatchId       *big.Int       `json:"batchId"`
	BatchNonce    *big.Int       `json:"batchNonce"`
	Deadline      *big.Int       `json:"deadline"`
	Data          string         `json:"data"`
}

func (*Message) TypedData

func (m *Message) TypedData() core.TypedDataMessage

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 common.Hash `json:"txHash"`
	Log    string      `json:"log"`
	Flag   int         `json:"flag"`
}

type Mexa

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

Mexa implements EIP712 meta transactions.

func NewTransactor added in v0.0.5

func NewTransactor(eth *ethclient.Client, address common.Address, jsonABI string, apiKey string) (*Mexa, error)

NewTransactor returns a transactor using the given address and json to build meta transaction requests.

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) Transact added in v0.0.3

func (m *Mexa) Transact(opts *gasless.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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