api

package
v0.0.0-...-efac809 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BehaviorTypeLogin          = 1
	BehaviorTypeSignRawTx      = 2
	BehaviorTypeSignSignature  = 3
	BehaviorTypePairedDevice   = 4
	BehaviorTypeSetupPIN       = 5
	BehaviorTypeBackup         = 6
	BehaviorTypeDecryptMessage = 7
)
View Source
const (
	BehaviorResultPending = 0
	BehaviorResultReject  = 1
	BehaviorResultAccept  = 2
	BehaviorResultExpired = 3
	BehaviorResultFailed  = 4
)

Variables

View Source
var APICode = beego.AppConfig.DefaultString("api_code", "")
View Source
var APISecret = beego.AppConfig.DefaultString("api_secret", "")

Functions

func DownloadWalletBackupFile

func DownloadWalletBackupFile(token string, qs []string) (fileBinary []byte, err error)

func RandomString

func RandomString(length int) string

Types

type BackupWalletRequest

type BackupWalletRequest struct {
	Question string `json:"question"`
	Answer   string `json:"answer"`
}

type BackupWalletResponse

type BackupWalletResponse struct {
	OrderID int64  `json:"order_id"`
	Token   string `json:"token"`
}

func BackupWallet

func BackupWallet(request *BackupWalletRequest, qs []string) (response *BackupWalletResponse, err error)

type CallbackStruct

type CallbackStruct struct {
	OrderID        int64  `json:"order_id"`
	CompanyID      int64  `json:"company_id"`
	BehaviorType   int    `json:"behavior_type"`
	BehaviorResult int    `json:"behavior_result"`
	Input          string `json:"input"`
	Output         string `json:"output"`
}

type CommonResponse

type CommonResponse struct {
	OrderID int64 `json:"order_id"`
}

func DecryptMessage

func DecryptMessage(request *DecryptMessageRequest, qs []string) (response *CommonResponse, err error)

func SignMessage

func SignMessage(request *SignMessageRequest, qs []string) (response *CommonResponse, err error)

func SignTransaction

func SignTransaction(request *SignTransactionRequest, qs []string) (response *CommonResponse, err error)

type DecryptMessageRequest

type DecryptMessageRequest struct {
	Secret string `json:"secret"`
}

type ErrorCodeResponse

type ErrorCodeResponse struct {
	ErrMsg  string `json:"error,omitempty"`
	ErrCode int    `json:"error_code,omitempty"`
}

type GetNonceRequest

type GetNonceRequest struct {
	Address   string `json:"address"`
	CompanyID int64  `json:"company_id"`
}

type GetNonceResponse

type GetNonceResponse struct {
	Nonce int64 `json:"nonce"`
}

type GetOrderStatusRequest

type GetOrderStatusRequest struct {
	OrderIDs []int64 `json:"order_ids"`
}

type GetOrderStatusResponse

type GetOrderStatusResponse struct {
	OrderStatus []OrderStatus `json:"order_status"`
}

func GetOrderStatus

func GetOrderStatus(request *GetOrderStatusRequest, qs []string) (response *GetOrderStatusResponse, err error)

type GetUserResponse

type GetUserResponse struct {
	UserEmail    string `json:"user_email"`
	CompanyID    int64  `json:"company_id"`
	IsPairDevice bool   `json:"is_pair_device"`
	IsSetupPin   bool   `json:"is_setup_pin"`
	IsDoBackup   bool   `json:"is_do_backup"`
	Wallets      []struct {
		Type      string `json:"type"`
		Address   string `json:"address"`
		PublicKey string `json:"public_key"`
	} `json:"wallets"`
}

func GetUser

func GetUser(qs []string) (response *GetUserResponse, err error)

type LoginVerifyRequest

type LoginVerifyRequest struct {
	Ip        string `json:"ip"`
	UserAgent string `json:"user_agent"`
	ExpiresAt int64  `json:"expires_at"`
}

type LoginVerifyResponse

type LoginVerifyResponse struct {
	OrderID   int64 `json:"order_id"`
	ExpiresAt int64 `json:"expires_at"`
}

func LoginVerify

func LoginVerify(request *LoginVerifyRequest, qs []string) (response *LoginVerifyResponse, err error)

type OrderStatus

type OrderStatus struct {
	IsExist        bool                   `json:"is_exist"`
	OrderID        int64                  `json:"order_id"`
	BehaviorType   int                    `json:"behavior_type"`
	BehaviorResult int                    `json:"behavior_result"`
	Addon          map[string]interface{} `json:"addon"`
}

type PairDeviceResponse

type PairDeviceResponse struct {
	OrderID int64  `json:"order_id"`
	URL     string `json:"url"`
}

func PairDevice

func PairDevice(qs []string) (response *PairDeviceResponse, err error)

type RegisterUserRequest

type RegisterUserRequest struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Language string `json:"locale"`
}

type RegisterUserResponse

type RegisterUserResponse struct {
	Email string `json:"email"`
}

func RegisterUser

func RegisterUser(request *RegisterUserRequest, qs []string) (response *RegisterUserResponse, err error)

type RepairDeviceRequest

type RepairDeviceRequest struct {
	Token     string `json:"token,omitempty"`
	VerifyNum int64  `json:"verify_num,omitempty"`
}

type RepairDeviceResponse

type RepairDeviceResponse struct {
	OrderID int64  `json:"order_id,omitempty"`
	Token   string `json:"token,omitempty"`
	URL     string `json:"url,omitempty"`
}

func RepairDevice

func RepairDevice(request *RepairDeviceRequest, qs []string) (response *RepairDeviceResponse, err error)

type RestoreWalletsRequest

type RestoreWalletsRequest struct {
	Token    string `json:"token"`
	Question string `json:"question"`
	Answer   string `json:"answer"`
}

type RestoreWalletsResponse

type RestoreWalletsResponse struct {
	Token string `json:"token"`
}

func RestoreWallets

func RestoreWallets(request *RestoreWalletsRequest, qs []string) (response *RestoreWalletsResponse, err error)

type SetupPINResponse

type SetupPINResponse struct {
	OrderID int64 `json:"order_id"`
}

func SetupPIN

func SetupPIN(qs []string) (response *SetupPINResponse, err error)

type SignMessageRequest

type SignMessageRequest struct {
	Message string `json:"message"`
}

type SignTransactionRequest

type SignTransactionRequest struct {
	To       *string `json:"to"`
	GasLimit uint64  `json:"gas_limit"`
	GasPrice int64   `json:"gas_price"`
	Value    int64   `json:"value"`
	Input    string  `json:"input"`
	Private  bool    `json:"private"`
}

type UploadWalletBackupFileResponse

type UploadWalletBackupFileResponse struct {
	Token    string `json:"token"`
	Question string `json:"question"`
}

func UploadWalletBackupFile

func UploadWalletBackupFile(fileBinary []byte, qs []string) (response *UploadWalletBackupFileResponse, err error)

Jump to

Keyboard shortcuts

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