Documentation ¶
Index ¶
- Constants
- Variables
- func CloseOffer(ctx context.Context, id string) (*mint.OfferResource, error)
- func Confirm(ctx context.Context, action string) error
- func CreateAsset(ctx context.Context, name string) (*mint.AssetResource, error)
- func CreateOffer(ctx context.Context, pair string, amount big.Int, price string) (*mint.OfferResource, error)
- func CreateTransaction(ctx context.Context, pair string, amount big.Int, destination string, ...) (*mint.TransactionResource, error)
- func ListAssetBalances(ctx context.Context, asset string) ([]mint.BalanceResource, error)
- func ListAssetOffers(ctx context.Context, asset string, propagation mint.PgType) ([]mint.OfferResource, error)
- func ListAssets(ctx context.Context) ([]mint.AssetResource, error)
- func ListBalances(ctx context.Context) ([]mint.BalanceResource, error)
- func NewClose() cli.Command
- func NewHelp() cli.Command
- func NewList() cli.Command
- func NewLogin() cli.Command
- func NewLogout() cli.Command
- func NewMint() cli.Command
- func NewPay() cli.Command
- func NewRegister() cli.Command
- func NewTrust() cli.Command
- func RegisterUser(ctx context.Context, reg MintRegister, username string, email string) (*register.UserResource, error)
- func RetrieveAsset(ctx context.Context, name string) (*mint.AssetResource, error)
- func RetrieveOffer(ctx context.Context, id string) (*mint.OfferResource, error)
- func SettleTransaction(ctx context.Context, id string) (*mint.TransactionResource, error)
- type Candidate
- type Candidates
- type Close
- type Help
- type List
- func (c *List) Execute(ctx context.Context) error
- func (c *List) ExecuteAssets(ctx context.Context) error
- func (c *List) ExecuteBalances(ctx context.Context) error
- func (c *List) ExecuteTrustlines(ctx context.Context) error
- func (c *List) Help(ctx context.Context)
- func (c *List) Name() cli.CmdName
- func (c *List) OutList(ctx context.Context, list [][][2]string) error
- func (c *List) Parse(ctx context.Context, args []string) error
- type Login
- type Logout
- type Mint
- type MintRegister
- type ObjType
- type Pay
- type Register
- type Trust
Constants ¶
const ( // CmdNmClose is the command name. CmdNmClose cli.CmdName = "close" )
const ( // CmdNmHelp is the command name. CmdNmHelp cli.CmdName = "help" )
const ( // CmdNmLogin is the command name. CmdNmLogin cli.CmdName = "login" )
const ( // CmdNmLogout is the command name. CmdNmLogout cli.CmdName = "logout" )
const ( // CmdNmMint is the command name. CmdNmMint cli.CmdName = "mint" )
const ( // CmdNmPay is the command name. CmdNmPay cli.CmdName = "pay" )
const ( // CmdNmRegister is the command name. CmdNmRegister cli.CmdName = "register" )
const ( // CmdNmTrust is the command name. CmdNmTrust cli.CmdName = "trust" )
Variables ¶
var PriceRegexp = regexp.MustCompile(
"^([0-9]+)\\/([0-9]+)$")
PriceRegexp is used to validate and parse a price.
var PublicMints = []MintRegister{ MintRegister{ Name: "Settle", Host: "settle.network", Description: "Mint maintained by the Settle developers.", RegisterURL: map[env.Environment]string{ env.Production: "https://register.settle.network/users", env.QA: "https://qa-register.settle.network/users", }, }, }
PublicMints is a list of proposed public mints that offer registration form the cli.
Functions ¶
func CloseOffer ¶
CloseOffer closes an offer specified by token.
func CreateAsset ¶
CreateAsset creates an asset for the currently authenticated user.
func CreateOffer ¶
func CreateOffer( ctx context.Context, pair string, amount big.Int, price string, ) (*mint.OfferResource, error)
CreateOffer creates an offer for the currently authenticated user.
func CreateTransaction ¶
func CreateTransaction( ctx context.Context, pair string, amount big.Int, destination string, path []string, ) (*mint.TransactionResource, error)
CreateTransaction creates a transaction for the currently authenticated user.
func ListAssetBalances ¶
ListAssetBalances list balances for one of the current user's asset.
func ListAssetOffers ¶
func ListAssetOffers( ctx context.Context, asset string, propagation mint.PgType, ) ([]mint.OfferResource, error)
ListAssetOffers list offers for the specified asset
func ListAssets ¶
func ListAssets( ctx context.Context, ) ([]mint.AssetResource, error)
ListAssets list assets for the current user.
func ListBalances ¶
func ListBalances( ctx context.Context, ) ([]mint.BalanceResource, error)
ListBalances list balances of the current user.
func NewRegister ¶
NewRegister constructs and initializes the command.
func RegisterUser ¶
func RegisterUser( ctx context.Context, reg MintRegister, username string, email string, ) (*register.UserResource, error)
RegisterUser registers a user on the provded mint register service.
func RetrieveAsset ¶
RetrieveAsset retrieves an asset, returning nil if it does not exist.
func RetrieveOffer ¶
RetrieveOffer retrieves an offer, returning nil if it does not exist.
func SettleTransaction ¶
SettleTransaction settles a transaction for the currently authenticated user.
Types ¶
type Candidate ¶
type Candidate struct { Path []mint.OfferResource BaseAsset string Amount big.Int }
Candidate represents a candidate base asset, offer path and amount to pay the required amount of quote asset.
type Candidates ¶
type Candidates []Candidate
Candidates is a slice of Candidate implementing sort.Interface
type Close ¶
type Close struct {
ID string
}
Close close an existing trustline.
type Help ¶
Help a user up to a certain amount of a given asset they issued.
type List ¶
List assets, balances, balances for an asset and trustlines.
func (*List) ExecuteAssets ¶
ExecuteAssets the list command for assets.
func (*List) ExecuteBalances ¶
ExecuteBalances the list command for balances.
func (*List) ExecuteTrustlines ¶
ExecuteTrustlines the list command for balances.
type Login ¶
type Login struct { }
Login a user up to a certain amount of a given asset they issued.
type Logout ¶
type Logout struct { }
Logout a user up to a certain amount of a given asset they issued.
type Mint ¶
type Mint struct {
Asset string
}
Mint a user up to a certain amount of a given asset they issued.
type MintRegister ¶
type MintRegister struct { Name string Host string Description string RegisterURL map[env.Environment]string }
MintRegister contains all the required information to register to a mint from the cli.
type Pay ¶
Pay a user up to a certain amount of a given asset they issued.
func (*Pay) ComputeCandidates ¶
func (c *Pay) ComputeCandidates( ctx context.Context, ) (Candidates, error)
ComputeCandidates computes candidates to pay the require amount of quote asset.
type Register ¶
type Register struct { }
Register a user up to a certain amount of a given asset they issued.