api

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidJSON = errors.New("Invalid JSON structure.")
)

Functions

func HandleAccountCreate

func HandleAccountCreate(cu *custodial.Custodial) func(echo.Context) error

HandleAccountCreate godoc

@Summary		Create a new custodial account.
@Description	Create a new custodial account.
@Tags			account
@Accept			*/*
@Produce		json
@Success		200	{object}	OkResp
@Failure		500	{object}	ErrResp
@Router			/account/create [post]

func HandleNetworkAccountStatus

func HandleNetworkAccountStatus(cu *custodial.Custodial) func(echo.Context) error

HandleNetworkAccountStatus godoc

@Summary		Get an address's network balance and nonce.
@Description	Return network balance and nonce.
@Tags			network
@Accept			*/*
@Produce		json
@Param			address	path		string	true	"Account Public Key"
@Success		200		{object}	OkResp
@Failure		400		{object}	ErrResp
@Failure		500		{object}	ErrResp
@Router			/account/status/{address} [get]

func HandleSignTranserAuthorization

func HandleSignTranserAuthorization(cu *custodial.Custodial) func(echo.Context) error

HandleSignTransferAuthorization godoc

@Summary		Sign and dispatch a transfer authorization (approve) request.
@Description	Sign and dispatch a transfer authorization (approve) request.
@Tags			network
@Accept			json
@Produce		json
@Param			signTransferAuthorzationRequest	body		object{amount=uint64,authorizer=string,authorizedAddress=string,voucherAddress=string}	true	"Sign Transfer Authorization (approve) Request"
@Success		200								{object}	OkResp
@Failure		400								{object}	ErrResp
@Failure		500								{object}	ErrResp
@Router			/sign/transferAuth [post]

func HandleSignTransfer

func HandleSignTransfer(cu *custodial.Custodial) func(echo.Context) error

HandleSignTransfer godoc

@Summary		Sign and dispatch transfer request.
@Description	Sign and dispatch a transfer request.
@Tags			network
@Accept			json
@Produce		json
@Param			signTransferRequest	body		object{from=string,to=string,voucherAddress=string,amount=uint64}	true	"Sign Transfer Request"
@Success		200					{object}	OkResp
@Failure		400					{object}	ErrResp
@Failure		500					{object}	ErrResp
@Router			/sign/transfer [post]

func HandleTrackTx

func HandleTrackTx(cu *custodial.Custodial) func(echo.Context) error

HandleTrackTx godoc

@Summary		Track an OTX (Origin transaction) status.
@Description	Track an OTX (Origin transaction) status.
@Tags			track
@Accept			*/*
@Produce		json
@Param			trackingId	path		string	true	"Tracking Id"
@Success		200			{object}	OkResp
@Failure		400			{object}	ErrResp
@Failure		500			{object}	ErrResp
@Router			/track/{trackingId} [get]

func NewBadRequestError

func NewBadRequestError(message ...interface{}) *echo.HTTPError

Types

type ErrResp

type ErrResp struct {
	Ok      bool   `json:"ok"`
	Message string `json:"message"`
}

type H

type H map[string]any

type OkResp

type OkResp struct {
	Ok     bool `json:"ok"`
	Result H    `json:"result"`
}

type Validator

type Validator struct {
	ValidatorProvider *validator.Validate
}

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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