wallet

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 10 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRemoteHandler

func AddRemoteHandler(
	db *gorm.DB,
	request AddRemoteRequest,
) *handler.Error

AddRemoteHandler godoc @Summary Add a remote wallet @Tags Wallet @Accept json @Param request body AddRemoteRequest true "Request body" @Success 204 @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /wallet/remote [post]

func AddWalletHandler

func AddWalletHandler(
	db *gorm.DB,
	datasetName string,
	wallet string,
) (string, *handler.Error)

AddWalletHandler godoc @Summary Associate a new wallet with a dataset @Tags Wallet @Produce json @Accept json @Param name path string true "Dataset name" @Param wallet path string true "Wallet Address" @Success 200 {object} string @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName}/wallet/{wallet} [post]

func ImportHandler

func ImportHandler(
	db *gorm.DB,
	request ImportRequest,
) *handler.Error

ImportHandler godoc @Summary Import a private key @Tags Wallet @Accept json @Param request body ImportRequest true "Request body" @Success 204 @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /wallet [post]

func ListHandler

func ListHandler(
	db *gorm.DB,
) ([]model.Wallet, *handler.Error)

ListHandler godoc @Summary List all imported wallets @Tags Wallet @Produce json @Success 200 {array} model.Wallet @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /wallets [get]

func ListWalletHandler

func ListWalletHandler(
	db *gorm.DB,
	datasetName string,
) ([]model.Wallet, *handler.Error)

ListWalletHandler godoc @Summary List all wallets of a dataset. @Tags Wallet @Produce json @Param name path string true "Dataset name" @Success 200 {array} model.Wallet @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName}/wallets [get]

func RemoveHandler

func RemoveHandler(
	db *gorm.DB,
	address string,
) *handler.Error

RemoveHandler godoc @Summary Remove a wallet @Tags Wallet @Param address path string true "Address" @Success 204 @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /wallet/{address} [delete]

func RemoveWalletHandler

func RemoveWalletHandler(
	db *gorm.DB,
	datasetName string,
	wallet string,
) *handler.Error

RemoveWalletHandler godoc @Summary Remove an associated wallet from a dataset @Tags Wallet @Param name path string true "Dataset name" @Param wallet path string true "Wallet Address" @Success 204 @Failure 400 {object} handler.HTTPError @Failure 500 {object} handler.HTTPError @Router /dataset/{datasetName}/wallet/{wallet} [delete]

Types

type AddRemoteRequest

type AddRemoteRequest struct {
	Address    string `json:"address"`    // Address is the Filecoin full address of the wallet
	RemotePeer string `json:"remotePeer"` // RemotePeer is the remote peer ID of the wallet, for remote signing purpose
	LotusAPI   string `json:"lotusApi" swaggerignore:"true"`
	LotusToken string `json:"lotusToken" swaggerignore:"true"`
}

type ImportRequest

type ImportRequest struct {
	PrivateKey string `json:"privateKey"` // This is the exported private key from lotus wallet export
	LotusAPI   string `json:"lotusApi" swaggerignore:"true"`
	LotusToken string `json:"lotusToken" swaggerignore:"true"`
}

Jump to

Keyboard shortcuts

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