api

package
v0.0.0-...-7c2dc49 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetKeyReqType        = byte(1)
	GetAddrReqType       = byte(2)
	RegisterRouteToStore = byte(3)
)

Variables

This section is empty.

Functions

func HandleAddRouteToStore

func HandleAddRouteToStore(data []byte) ([]byte, error)

func HandleGetAddr

func HandleGetAddr(data []byte) ([]byte, error)

HandleGetAddr handles get addr request.

func HandleSetKey

func HandleSetKey(data []byte) ([]byte, error)

HandleSetKey handles set key request.

func RequestGetAddr

func RequestGetAddr(addr string, chainID *big.Int, contractAddr common.Address) (byte, common.Address, error)

RequestGetAddr requests get addr.

func RequestSetKey

func RequestSetKey(addr string, chainID *big.Int, contractAddr common.Address, keyType byte, key []byte) (bool, error)

RequestSetKey requests set key.

Types

type GetAddrReq

type GetAddrReq struct {
	ChainID      string `json:"chain_id"`
	ContractAddr string `json:"contract_addr"`
}

GetAddrReq is the request to get signer addr and type.

type GetAddrResp

type GetAddrResp struct {
	KeyType byte   `json:"key_type"`
	Addr    string `json:"addr"`
}

GetAddrResp is the response to get addr.

type RouteApiResponse

type RouteApiResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type SetKeyReq

type SetKeyReq struct {
	ChainID      string `json:"chain_id"`
	ContractAddr string `json:"contract_addr"`
	KeyType      byte   `json:"key_type"`
	Key          []byte `json:"key"`
}

SetKeyReq is the request to set key.

type SetKeyResp

type SetKeyResp struct {
	Success bool `json:"success"`
}

SetKeyResp is the reponse to set key.

Jump to

Keyboard shortcuts

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