requests

package
v0.0.0-...-00d0827 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualAction

func EqualAction(a, b Action) bool

EqualAction is used to compare the values of the union

func FormatActions

func FormatActions(actions ...Action) ([][]byte, error)

Types

type Action

type Action interface {
	CopyAsInterface() any
	ActionType() ActionType
}

func CopyAction

func CopyAction(v Action) Action

CopyAction copies a Action.

func NewAction

func NewAction(typ ActionType) (Action, error)

NewAction creates a new Action for the specified ActionType.

func ParseActions

func ParseActions(parts [][]byte) ([]Action, error)

ParseActions parses actions as key=value pairs.

func UnmarshalActionJSON

func UnmarshalActionJSON(data []byte) (Action, error)

UnmarshalActionJson unmarshals a Action.

type ActionType

type ActionType uint64

ActionType is the type of an Action.

const ActionTypeAddAccount ActionType = 3

ActionTypeAddAccount .

const ActionTypeCancelRequest ActionType = 1

ActionTypeCancelRequest .

const ActionTypeChangeDelegate ActionType = 8

ActionTypeChangeDelegate .

const ActionTypeChangeDelegatorPayout ActionType = 10

ActionTypeChangeDelegatorPayout .

const ActionTypeChangePayout ActionType = 5

ActionTypeChangePayout .

const ActionTypeChangeType ActionType = 9

ActionTypeChangeType .

const ActionTypeRegisterIdentity ActionType = 2

ActionTypeRegisterIdentity .

const ActionTypeRejectDelegates ActionType = 11

ActionTypeRejectDelegates .

const ActionTypeTransferTokens ActionType = 7

ActionTypeTransferTokens .

const ActionTypeUnstakeAccount ActionType = 4

ActionTypeUnstakeAccount .

const ActionTypeWithdrawTokens ActionType = 6

ActionTypeWithdrawTokens .

func ActionTypeByName

func ActionTypeByName(name string) (ActionType, bool)

ActionTypeByName returns the named Action Type.

func (ActionType) GetEnumValue

func (v ActionType) GetEnumValue() uint64

GetEnumValue returns the value of the Action Type

func (ActionType) MarshalJSON

func (v ActionType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Action Type to JSON as a string.

func (*ActionType) SetEnumValue

func (v *ActionType) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (ActionType) String

func (v ActionType) String() string

String returns the name of the Action Type.

func (*ActionType) UnmarshalJSON

func (v *ActionType) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Action Type from JSON as a string.

type AddAccount

type AddAccount struct {
	Account  *url.URL          `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Type     types.AccountType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Payout   *url.URL          `json:"payout,omitempty" form:"payout" query:"payout"`
	Delegate *url.URL          `json:"delegate,omitempty" form:"delegate" query:"delegate"`
}

func (*AddAccount) ActionType

func (*AddAccount) ActionType() ActionType

func (*AddAccount) Copy

func (v *AddAccount) Copy() *AddAccount

func (*AddAccount) CopyAsInterface

func (v *AddAccount) CopyAsInterface() interface{}

func (*AddAccount) Equal

func (v *AddAccount) Equal(u *AddAccount) bool

func (*AddAccount) MarshalJSON

func (v *AddAccount) MarshalJSON() ([]byte, error)

func (*AddAccount) UnmarshalJSON

func (v *AddAccount) UnmarshalJSON(data []byte) error

type CancelRequest

type CancelRequest struct {
	Request *url.TxID `json:"request,omitempty" form:"request" query:"request" validate:"required"`
}

func (*CancelRequest) ActionType

func (*CancelRequest) ActionType() ActionType

func (*CancelRequest) Copy

func (v *CancelRequest) Copy() *CancelRequest

func (*CancelRequest) CopyAsInterface

func (v *CancelRequest) CopyAsInterface() interface{}

func (*CancelRequest) Equal

func (v *CancelRequest) Equal(u *CancelRequest) bool

func (*CancelRequest) MarshalJSON

func (v *CancelRequest) MarshalJSON() ([]byte, error)

func (*CancelRequest) UnmarshalJSON

func (v *CancelRequest) UnmarshalJSON(data []byte) error

type ChangeDelegate

type ChangeDelegate struct {
	Account  *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Delegate *url.URL `json:"delegate,omitempty" form:"delegate" query:"delegate" validate:"required"`
}

func (*ChangeDelegate) ActionType

func (*ChangeDelegate) ActionType() ActionType

func (*ChangeDelegate) Copy

func (v *ChangeDelegate) Copy() *ChangeDelegate

func (*ChangeDelegate) CopyAsInterface

func (v *ChangeDelegate) CopyAsInterface() interface{}

func (*ChangeDelegate) Equal

func (v *ChangeDelegate) Equal(u *ChangeDelegate) bool

func (*ChangeDelegate) MarshalJSON

func (v *ChangeDelegate) MarshalJSON() ([]byte, error)

func (*ChangeDelegate) UnmarshalJSON

func (v *ChangeDelegate) UnmarshalJSON(data []byte) error

type ChangeDelegatorPayout

type ChangeDelegatorPayout struct {
	Identity    *url.URL `json:"identity,omitempty" form:"identity" query:"identity" validate:"required"`
	Destination *url.URL `json:"destination,omitempty" form:"destination" query:"destination" validate:"required"`
}

func (*ChangeDelegatorPayout) ActionType

func (*ChangeDelegatorPayout) ActionType() ActionType

func (*ChangeDelegatorPayout) Copy

func (*ChangeDelegatorPayout) CopyAsInterface

func (v *ChangeDelegatorPayout) CopyAsInterface() interface{}

func (*ChangeDelegatorPayout) Equal

func (*ChangeDelegatorPayout) MarshalJSON

func (v *ChangeDelegatorPayout) MarshalJSON() ([]byte, error)

func (*ChangeDelegatorPayout) UnmarshalJSON

func (v *ChangeDelegatorPayout) UnmarshalJSON(data []byte) error

type ChangePayout

type ChangePayout struct {
	Account     *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Destination *url.URL `json:"destination,omitempty" form:"destination" query:"destination" validate:"required"`
}

func (*ChangePayout) ActionType

func (*ChangePayout) ActionType() ActionType

func (*ChangePayout) Copy

func (v *ChangePayout) Copy() *ChangePayout

func (*ChangePayout) CopyAsInterface

func (v *ChangePayout) CopyAsInterface() interface{}

func (*ChangePayout) Equal

func (v *ChangePayout) Equal(u *ChangePayout) bool

func (*ChangePayout) MarshalJSON

func (v *ChangePayout) MarshalJSON() ([]byte, error)

func (*ChangePayout) UnmarshalJSON

func (v *ChangePayout) UnmarshalJSON(data []byte) error

type ChangeType

type ChangeType struct {
	Account *url.URL          `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Type    types.AccountType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
}

func (*ChangeType) ActionType

func (*ChangeType) ActionType() ActionType

func (*ChangeType) Copy

func (v *ChangeType) Copy() *ChangeType

func (*ChangeType) CopyAsInterface

func (v *ChangeType) CopyAsInterface() interface{}

func (*ChangeType) Equal

func (v *ChangeType) Equal(u *ChangeType) bool

func (*ChangeType) MarshalJSON

func (v *ChangeType) MarshalJSON() ([]byte, error)

func (*ChangeType) UnmarshalJSON

func (v *ChangeType) UnmarshalJSON(data []byte) error

type RegisterIdentity

type RegisterIdentity struct {
	Identity *url.URL `json:"identity,omitempty" form:"identity" query:"identity" validate:"required"`
}

func (*RegisterIdentity) ActionType

func (*RegisterIdentity) ActionType() ActionType

func (*RegisterIdentity) Copy

func (*RegisterIdentity) CopyAsInterface

func (v *RegisterIdentity) CopyAsInterface() interface{}

func (*RegisterIdentity) Equal

func (v *RegisterIdentity) Equal(u *RegisterIdentity) bool

func (*RegisterIdentity) MarshalJSON

func (v *RegisterIdentity) MarshalJSON() ([]byte, error)

func (*RegisterIdentity) UnmarshalJSON

func (v *RegisterIdentity) UnmarshalJSON(data []byte) error

type RejectDelegates

type RejectDelegates struct {
	Identity *url.URL `json:"identity,omitempty" form:"identity" query:"identity" validate:"required"`
}

func (*RejectDelegates) ActionType

func (*RejectDelegates) ActionType() ActionType

func (*RejectDelegates) Copy

func (v *RejectDelegates) Copy() *RejectDelegates

func (*RejectDelegates) CopyAsInterface

func (v *RejectDelegates) CopyAsInterface() interface{}

func (*RejectDelegates) Equal

func (v *RejectDelegates) Equal(u *RejectDelegates) bool

func (*RejectDelegates) MarshalJSON

func (v *RejectDelegates) MarshalJSON() ([]byte, error)

func (*RejectDelegates) UnmarshalJSON

func (v *RejectDelegates) UnmarshalJSON(data []byte) error

type TransferTokens

type TransferTokens struct {
	Account   *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Recipient *url.URL `json:"recipient,omitempty" form:"recipient" query:"recipient" validate:"required"`
	Amount    *big.Int `json:"amount,omitempty" form:"amount" query:"amount" validate:"required"`
}

func (*TransferTokens) ActionType

func (*TransferTokens) ActionType() ActionType

func (*TransferTokens) Copy

func (v *TransferTokens) Copy() *TransferTokens

func (*TransferTokens) CopyAsInterface

func (v *TransferTokens) CopyAsInterface() interface{}

func (*TransferTokens) Equal

func (v *TransferTokens) Equal(u *TransferTokens) bool

func (*TransferTokens) MarshalJSON

func (v *TransferTokens) MarshalJSON() ([]byte, error)

func (*TransferTokens) UnmarshalJSON

func (v *TransferTokens) UnmarshalJSON(data []byte) error

type UnstakeAccount

type UnstakeAccount struct {
	Account *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
}

func (*UnstakeAccount) ActionType

func (*UnstakeAccount) ActionType() ActionType

func (*UnstakeAccount) Copy

func (v *UnstakeAccount) Copy() *UnstakeAccount

func (*UnstakeAccount) CopyAsInterface

func (v *UnstakeAccount) CopyAsInterface() interface{}

func (*UnstakeAccount) Equal

func (v *UnstakeAccount) Equal(u *UnstakeAccount) bool

func (*UnstakeAccount) MarshalJSON

func (v *UnstakeAccount) MarshalJSON() ([]byte, error)

func (*UnstakeAccount) UnmarshalJSON

func (v *UnstakeAccount) UnmarshalJSON(data []byte) error

type WithdrawTokens

type WithdrawTokens struct {
	Account   *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Recipient *url.URL `json:"recipient,omitempty" form:"recipient" query:"recipient" validate:"required"`
	Amount    *big.Int `json:"amount,omitempty" form:"amount" query:"amount" validate:"required"`
}

func (*WithdrawTokens) ActionType

func (*WithdrawTokens) ActionType() ActionType

func (*WithdrawTokens) Copy

func (v *WithdrawTokens) Copy() *WithdrawTokens

func (*WithdrawTokens) CopyAsInterface

func (v *WithdrawTokens) CopyAsInterface() interface{}

func (*WithdrawTokens) Equal

func (v *WithdrawTokens) Equal(u *WithdrawTokens) bool

func (*WithdrawTokens) MarshalJSON

func (v *WithdrawTokens) MarshalJSON() ([]byte, error)

func (*WithdrawTokens) UnmarshalJSON

func (v *WithdrawTokens) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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