cli

package
v0.0.0-...-162b478 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequest

func GetRequest(ki types.KeyInfo, addr types.Address, bankAddress string, route string, body []byte) (*request.Response, error)

func PostRequest

func PostRequest(ki types.KeyInfo, addr types.Address, bankAddress string, route string, body []byte) (*request.Response, error)

func ProxyBanksRequest

func ProxyBanksRequest(proxyAddress string, route string) (*request.Response, error)

func ProxyRetrieveRequest

func ProxyRetrieveRequest(proxyAddress string, options RetrievalOptions, route string) (*request.Response, error)

func RegisterValidators

func RegisterValidators(cli CLI) error

func Retrieval

func Retrieval(route string, options RetrievalOptions) error

Types

type AuthorizeOptions

type AuthorizeOptions struct {
	BankAddress string `json:"bankAddress"`
	Proxy       string `validate:"is-filecoin-address" json:"proxy"`
}

type AuthorizeResponse

type AuthorizeResponse struct {
	Status string                `json:"status"`
	Data   AuthorizeResponseData `json:"data"`
}

func Authorize

func Authorize(ki types.KeyInfo, addr types.Address, route string, options AuthorizeOptions) (*AuthorizeResponse, error)

type AuthorizeResponseData

type AuthorizeResponseData struct {
	FIL    types.FIL `json:"fil"`
	Escrow types.FIL `json:"escrow"`
	ID     uuid.UUID `json:"id"`
}

type BalanceOptions

type BalanceOptions struct {
	BankAddress string `json:"bankAddress"`
}

type BalanceResponse

type BalanceResponse struct {
	Status string              `json:"status"`
	Data   BalanceResponseData `json:"data"`
}

func Balance

func Balance(ki types.KeyInfo, addr types.Address, route string, options BalanceOptions) (*BalanceResponse, error)

type BalanceResponseData

type BalanceResponseData struct {
	FIL    types.FIL `json:"fil"`
	Escrow types.FIL `json:"escrow"`
}

type Bank

type Bank struct {
	URL  string    `json:"url"`
	Cost types.FIL `json:"cost"`
}

type BanksOptions

type BanksOptions struct {
	ProxyAddress string `json:"proxyAddress"`
}

type BanksResponse

type BanksResponse struct {
	Status string `json:"status"`
	Data   []Bank `json:"data"`
}

func Banks

func Banks(route string, options BanksOptions) (*BanksResponse, error)

type CLI

type CLI struct {
	Validate *validator.Validate
}

type Config

type Config struct {
	Env    string       `toml:"env"`
	Route  Route        `toml:"route"`
	Wallet types.Wallet `toml:"wallet"`
}

func LoadConfiguration

func LoadConfiguration(cfgFilePath string) Config

type DepositOptions

type DepositOptions struct {
	Amount      string `json:"amount"`
	BankAddress string `json:"bankAddress"`
}

type RefundOptions

type RefundOptions struct {
	BankAddress string `json:"bankAddress"`
}

type RefundResponse

type RefundResponse struct {
	Status string             `json:"status"`
	Data   RefundResponseData `json:"data"`
}

func Refund

func Refund(ki types.KeyInfo, addr types.Address, route string, options RefundOptions) (*RefundResponse, error)

type RefundResponseData

type RefundResponseData struct {
	FIL     types.FIL `json:"fil"`
	Escrow  types.FIL `json:"escrow"`
	Expired types.FIL `json:"expired"`
}

type RetrievalOptions

type RetrievalOptions struct {
	ProxyAddress  string `json:"proxyAddress"`
	Piece         string `json:"piece"`
	Authorization string `json:"authorization"`
}

type Route

type Route struct {
	Balance   string `toml:"balance"`
	Banks     string `toml:"banks"`
	Deposit   string `toml:"deposit"`
	Withdraw  string `toml:"withdraw"`
	Authorize string `toml:"authorize"`
	Refund    string `toml:"refund"`
	Retrieval string `toml:"retrieval"`
}

type TransactionResponse

type TransactionResponse struct {
	Status string                  `json:"status"`
	Data   TransactionResponseData `json:"data"`
}

func Deposit

func Deposit(ki types.KeyInfo, addr types.Address, route string, options DepositOptions) (*TransactionResponse, error)

func Withdraw

func Withdraw(ki types.KeyInfo, addr types.Address, route string, options WithdrawOptions) (*TransactionResponse, error)

type TransactionResponseData

type TransactionResponseData struct {
	FIL types.FIL `json:"fil"`
}

type WithdrawOptions

type WithdrawOptions struct {
	Amount      string `json:"amount"`
	Destination string `validate:"is-filecoin-address" json:"dst"`
	BankAddress string `json:"bankAddress"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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