Documentation ¶
Index ¶
- Constants
- type Action
- type CollectibleOutput
- type CollectibleTransaction
- type Configuration
- type Group
- func (grp *Group) AddNode(id string, threshold int, timestamp time.Time) error
- func (grp *Group) AddWorker(wkr Worker)
- func (grp *Group) BuildCollectibleMintTransaction(ctx context.Context, receiver string, nfo []byte) error
- func (grp *Group) BuildTransaction(ctx context.Context, assetId string, receivers []string, threshold int, ...) error
- func (grp *Group) CreateCollectibleRequest(ctx context.Context, action, raw string) (*cr, error)
- func (grp *Group) GenesisId() string
- func (grp *Group) GetMembers() []string
- func (grp *Group) GetThreshold() int
- func (grp *Group) ListActiveNodes() ([]string, int, time.Time, error)
- func (grp *Group) ReadCollectibleOutputs(ctx context.Context, members []string, threshold uint8, offset time.Time, ...) ([]*CollectibleOutput, error)
- func (grp *Group) RemoveNode(id string, threshold int, timestamp time.Time) error
- func (grp *Group) Run(ctx context.Context)
- func (grp *Group) SetOutputGrouper(per func(out *Output) string)
- func (grp *Group) SignCollectible(ctx context.Context, reqID, pin string) (*cr, error)
- type Iteration
- type Output
- type Store
- type Transaction
- type Worker
Constants ¶
View Source
const ( ActionStateInitial = 10 ActionStateDone = 11 )
View Source
const ( CollectibleMetaTokenId = "2f8aa18a-3cb8-31d5-95bc-5a4f2e25dc2f" CollectibleMixinAssetId = "1700941284a95f31b25ec8c546008f208f88eee4419ccdcdbe6e3195e60128ca" )
View Source
const ( IterationActionAdd = 11 IterationActionRemove = 12 )
View Source
const ( OutputStateUnspent = 10 OutputStateSigned = 11 OutputStateSpent = 12 )
View Source
const ( TransactionStateInitial = 10 TransactionStateSigning = 11 TransactionStateSigned = 12 TransactionStateSnapshot = 13 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectibleOutput ¶
type CollectibleOutput struct { Type string `json:"type"` UserId string `json:"user_id"` OutputId string `json:"output_id"` TokenId string `json:"token_id"` TransactionHash crypto.Hash `json:"transaction_hash"` OutputIndex int `json:"output_index"` Amount string `json:"amount"` SendersThreshold int64 `json:"senders_threshold"` Senders []string `json:"senders"` ReceiversThreshold int64 `json:"receivers_threshold"` Receivers []string `json:"receivers"` Memo string `json:"memo"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` SignedBy string `json:"signed_by"` SignedTx string `json:"signed_tx"` JsonState string `json:"state" msgpack:"-"` State int `json:"-"` }
func (*CollectibleOutput) StateName ¶
func (out *CollectibleOutput) StateName() string
type CollectibleTransaction ¶
type Configuration ¶
type Configuration struct { App struct { ClientId string `toml:"client-id"` SessionId string `toml:"session-id"` PrivateKey string `toml:"private-key"` PinToken string `toml:"pin-token"` PIN string `toml:"pin"` } `toml:"app"` Genesis struct { Members []string `toml:"members"` Threshold int `toml:"threshold"` Timestamp int64 `toml:"timestamp"` } `toml:"genesis"` }
func Setup ¶
func Setup(path string) (*Configuration, error)
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func BuildGroup ¶
func (*Group) BuildCollectibleMintTransaction ¶
func (*Group) BuildTransaction ¶
func (grp *Group) BuildTransaction(ctx context.Context, assetId string, receivers []string, threshold int, amount, memo string, traceId, groupId string) error
the app should decide a unique trace id so that the MTG will not double spend
func (*Group) CreateCollectibleRequest ¶
func (*Group) GetMembers ¶
func (*Group) GetThreshold ¶
func (*Group) ListActiveNodes ¶
func (*Group) ReadCollectibleOutputs ¶
func (*Group) RemoveNode ¶
func (*Group) SetOutputGrouper ¶ added in v0.0.6
type Iteration ¶
a node joins or leaves the group with an iteration this is for the evolution mechanism of MTG TODO not implemented yet
type Output ¶
type Output struct { GroupId string UserID string UTXOID string AssetID string TransactionHash crypto.Hash OutputIndex int Sender string Amount decimal.Decimal Threshold uint8 Members []string Memo string State int CreatedAt time.Time UpdatedAt time.Time SignedBy string SignedTx string }
func NewOutputFromMultisig ¶
func NewOutputFromMultisig(utxo *mixin.MultisigUTXO) *Output
type Store ¶
type Store interface { WriteProperty(key, val []byte) error ReadProperty(key []byte) ([]byte, error) WriteIteration(ir *Iteration) error ListIterations() ([]*Iteration, error) WriteOutput(utxo *Output, traceId string) error WriteOutputs(utxos []*Output, traceId string) error ListOutputsForTransaction(traceId string) ([]*Output, error) ListOutputsForAsset(groupId string, state, assetId string, limit int) ([]*Output, error) WriteAction(act *Action) error ListActions(limit int) ([]*Output, error) WriteTransaction(tx *Transaction) error ReadTransactionByTraceId(traceId string) (*Transaction, error) ReadTransactionByHash(hash crypto.Hash) (*Transaction, error) ListTransactions(state int, limit int) ([]*Transaction, error) WriteCollectibleOutput(utxo *CollectibleOutput, traceId string) error WriteCollectibleOutputs(utxos []*CollectibleOutput, traceId string) error ListCollectibleOutputsForTransaction(traceId string) ([]*CollectibleOutput, error) ListCollectibleOutputsForToken(state, tokenId string, limit int) ([]*CollectibleOutput, error) WriteCollectibleAction(act *Action) error ListCollectibleActions(limit int) ([]*CollectibleOutput, error) WriteCollectibleTransaction(traceId string, tx *CollectibleTransaction) error ReadCollectibleTransaction(traceId string) (*CollectibleTransaction, error) ReadCollectibleTransactionByHash(hash crypto.Hash) (*CollectibleTransaction, error) ListCollectibleTransactions(state int, limit int) ([]*CollectibleTransaction, error) }
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.