Documentation
¶
Index ¶
- Constants
- type Account
- type AssetAmount
- type Buffer
- type FillOrderOperation
- type LimitOrderCancelOperation
- type LimitOrderCreateOperation
- type Memo
- type ObjectID
- type OpType
- type Operation
- type Operations
- type Options
- type Permission
- type Price
- type Suint32
- type Suint64
- type Time
- type Transaction
- type TransferOperation
- type UnknownOperation
Constants ¶
const Layout = `"2006-01-02T15:04:05"`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
ID ObjectID `json:"id"`
MembershipExpirationDate Time `json:"membership_expiration_date"`
Registrar ObjectID `json:"registrar"`
Referrer ObjectID `json:"referrer"`
LifetimeReferrer ObjectID `json:"lifetime_referrer"`
NetworkFeePercentage uint32 `json:"network_fee_percentage"`
LifetimeReferrerFeePercentage uint32 `json:"lifetime_referrer_fee_percentage"`
ReferrerRewardsPercentage uint32 `json:"referrer_rewards_percentage"`
Name string `json:"name"`
Statistics string `json:"statistics"`
Options Options `json:"options"`
Owner Permission `json:"owner"`
Active Permission `json:"active"`
}
type AssetAmount ¶
func (*AssetAmount) UnmarshalJSON ¶
func (aa *AssetAmount) UnmarshalJSON(b []byte) (err error)
RPC client might return asset amount as uint64 or string, therefore a custom unmarshaller is used
type Buffer ¶
type Buffer []byte
func (*Buffer) FromString ¶
func (Buffer) MarshalJSON ¶
func (*Buffer) UnmarshalJSON ¶
type FillOrderOperation ¶
type FillOrderOperation struct {
Order ObjectID
Account ObjectID
Pays AssetAmount
Recives AssetAmount
Fee AssetAmount
Price Price
IsMaker bool
}
FillOrderOpType
func (*FillOrderOperation) Type ¶
func (op *FillOrderOperation) Type() OpType
type LimitOrderCancelOperation ¶
type LimitOrderCancelOperation struct {
Fee AssetAmount `json:"fee"`
FeePayingAccount ObjectID `json:"fee_paying_account"`
Order ObjectID `json:"order"`
Extensions []json.RawMessage `json:"extensions"`
}
LimitOrderCancelOpType
func (*LimitOrderCancelOperation) Marshal ¶
func (op *LimitOrderCancelOperation) Marshal(encoder *encoding.Encoder) error
func (*LimitOrderCancelOperation) Type ¶
func (op *LimitOrderCancelOperation) Type() OpType
type LimitOrderCreateOperation ¶
type LimitOrderCreateOperation struct {
Fee AssetAmount `json:"fee"`
Seller ObjectID `json:"seller"`
AmountToSell AssetAmount `json:"amount_to_sell"`
MinToReceive AssetAmount `json:"min_to_receive"`
Expiration Time `json:"expiration"`
FillOrKill bool `json:"fill_or_kill"`
Extensions []json.RawMessage `json:"extensions"`
}
LimitOrderCreateOperation
func (*LimitOrderCreateOperation) Marshal ¶
func (op *LimitOrderCreateOperation) Marshal(encoder *encoding.Encoder) error
func (*LimitOrderCreateOperation) Type ¶
func (op *LimitOrderCreateOperation) Type() OpType
type Memo ¶
type ObjectID ¶
On the BitShares blockchains there are no addresses, but objects identified by a unique id, an type and a space in the form: space.type.id
func MustParseObjectID ¶
func ParseObjectID ¶
func (*ObjectID) MarshalJSON ¶
func (*ObjectID) UnmarshalJSON ¶
type Operations ¶
type Operations []Operation
func (Operations) MarshalJSON ¶
func (ops Operations) MarshalJSON() ([]byte, error)
func (*Operations) UnmarshalJSON ¶
func (ops *Operations) UnmarshalJSON(b []byte) (err error)
type Permission ¶
type Permission struct {
WeightThreshold uint32 `json:"weight_threshold"`
AccountAuths []interface{} `json:"account_auths"`
KeyAuths []interface{} `json:"key_auths"`
AddressAuths []interface{} `json:"address_auths"`
}
type Price ¶
type Price struct {
Base AssetAmount `json:"base"`
Quote AssetAmount `json:"quote"`
}
type Suint32 ¶
type Suint32 uint32
Suint32 uint32 with redeclared JSON unmarshal; Can be parsed from uint32 either string
func (*Suint32) UnmarshalJSON ¶
type Suint64 ¶
type Suint64 uint64
Suint64 uint64 with redeclared JSON unmarshal; Can be parsed from uint64 either string
func (*Suint64) UnmarshalJSON ¶
type Transaction ¶
type Transaction struct {
RefBlockNum uint16 `json:"ref_block_num"`
RefBlockPrefix uint32 `json:"ref_block_prefix"`
Expiration Time `json:"expiration"`
Operations Operations `json:"operations"`
Signatures []string `json:"signatures"`
TransactionID string
}
func (*Transaction) Marshal ¶
func (tx *Transaction) Marshal(encoder *encoding.Encoder) error
Marshal implements encoding.Marshaller interface.
func (*Transaction) PushOperation ¶
func (tx *Transaction) PushOperation(op Operation)
PushOperation can be used to add an operation into the encoding.
type TransferOperation ¶
type TransferOperation struct {
From ObjectID `json:"from"`
To ObjectID `json:"to"`
Amount AssetAmount `json:"amount"`
Fee AssetAmount `json:"fee"`
Memo Memo `json:"memo"`
Extensions []json.RawMessage `json:"extensions"`
}
TransferOperation
func NewTransferOperation ¶
func NewTransferOperation(from, to ObjectID, amount, fee AssetAmount) *TransferOperation
NewTransferOperation returns a new instance of TransferOperation
func (*TransferOperation) Marshal ¶
func (op *TransferOperation) Marshal(encoder *encoding.Encoder) error
func (*TransferOperation) Type ¶
func (op *TransferOperation) Type() OpType
type UnknownOperation ¶
type UnknownOperation struct {
Data json.RawMessage
// contains filtered or unexported fields
}
UnknownOperation
func (*UnknownOperation) Type ¶
func (op *UnknownOperation) Type() OpType