puc

package
v0.0.0-...-843cdbd Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccGetRequest

type AccGetRequest struct {
	Scope         ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	AccountUnique Unique    `bson:"account_unique" json:"account_unique"`
	With          *struct {
		PrivateKey bool `bson:"private_key" json:"private_key"`
		PublicKey  bool `bson:"public_key" json:"public_key"`
		Mnemonic   bool `bson:"mnemonic" json:"mnemonic"`
	} `bson:"with" json:"with"`
}

type AccLoadTransferRequest

type AccLoadTransferRequest struct {
	Scope     ref.Scope   `bson:"scope" json:"scope"` //[*]所属域
	LeadArray []*ref.Lead `bson:"lead_array" json:"lead_array"`
	Page      *load.Page  `bson:"page" json:"page"`
}

type Account

type Account struct {
	Lead       ref.Lead     `bson:"lead" json:"lead"`
	Addr       Addr         `bson:"addr" json:"addr"`
	Coin       Coin         `bson:"coin" json:"coin"`
	Balance    money.Amount `bson:"balance" json:"balance"`
	PublicKey  string       `bson:"public_key" json:"public_key"`
	Mnemonic   string       `bson:"mnemonic" json:"mnemonic"`
	PrivateKey string       `bson:"private_key" json:"private_key"`
}

type Addr

type Addr = string

type AirdropRequest

type AirdropRequest struct {
	Scope  ref.Scope    `bson:"scope" json:"scope"`                     //[*]所属域
	Lead   ref.Lead     `bson:"lead" json:"lead"`                       //[id|key]所属账户lead
	Amount money.Amount `bson:"amount" json:"amount"`                   //[*]注入金额
	Issue  ref.Collar   `bson:"issue,omitempty" json:"issue,omitempty"` //[*]对应事件
	Memo   string       `bson:"memo,omitempty" json:"memo,omitempty"`   //[-]备注
}

type Benchmark

type Benchmark struct {
	Provisions int64  `bson:"provisions" json:"provisions"`
	Currency   string `bson:"currency" json:"currency"`
}

Benchmark 游戏币的基准价值

type Coin

type Coin = string

type Information

type Information struct {
	VN          string      `bson:"vn" json:"vn"`                   //所属价值网络
	Coin        string      `bson:"coin" json:"coin"`               //COIN 编码|全网唯一
	Name        string      `bson:"name" json:"name"`               //COIN NAME
	Icon        media.Media `bson:"icon" json:"icon"`               //图标
	Issuance    int64       `bson:"issuance" json:"issuance"`       //发行量
	Circulation int64       `bson:"circulation" json:"circulation"` //流通量
	Info        more.More   `bson:"info" json:"info"`               //展示信息
	Media       media.More  `bson:"media" json:"media"`             //图文视频信息
	Available   bool        `bson:"available" json:"available"`     //是否通行
	BirthAt     time.Time   `bson:"birth_at" json:"birth_at"`       //创建时间
	ModifiedAt  time.Time   `bson:"modified_at" json:"modified_at"` //最后修改时间
}

Information 游戏币定义 只有VN守护者才有发行游戏币的资格,单个价值网络中发行的游戏币种类不超过10种

type MintageRequest

type MintageRequest struct {
	Coin     Coin  `bson:"coin" json:"coin"`
	Quantity int64 `bson:"quantity" json:"quantity"`
}

MintageRequest 铸币

type Service

type Service interface {
	WalletPreCreate(req WalletPreCreateRequest) (WalletPreCreateResponse, *errors.Error)
	WalletMnemonicCheck(req WalletMnemonicCheckRequest) (WalletMnemonicCheckResponse, *errors.Error)
	WalletCreateConfirm(req WalletCreateConfirmRequest) (*Wallet, *errors.Error)
	WalletAddAccount(req WalletAddAccRequest) (*Account, *errors.Error)
	WalletGet(req WalletGetRequest) (*Wallet, *errors.Error)
	WalletLoadAccount(req WalletLoadAccRequest) ([]*Account, *errors.Error)
	AccLoadTransfer(req AccLoadTransferRequest) ([]*Transfer, *load.Paging, *errors.Error)
	Airdrop(req AirdropRequest) (transferID string, err *errors.Error)
	AccGet(req AccGetRequest) (*Account, *errors.Error)
}

type Transfer

type Transfer struct {
	From   string       `bson:"from" json:"from"`
	To     string       `bson:"to" json:"to"`
	Amount money.Amount `bson:"amount" json:"amount"`
}

type Unique

type Unique struct {
	Addr Addr      `bson:"addr" json:"addr"`
	Lead *ref.Lead `bson:"lead" json:"lead"`
}

func (Unique) Verify

func (uni Unique) Verify() *errors.Error

type Wallet

type Wallet struct {
	Addr    Addr      `bson:"addr" json:"addr"`
	Lead    ref.Lead  `bson:"lead" json:"lead"`
	BrithAt time.Time `bson:"brith_at" json:"brith_at"`

	AccArray []*Account `bson:"acc_array" json:"acc_array"`
}

type WalletAddAccRequest

type WalletAddAccRequest struct {
	Scope        ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	WalletUnique Unique    `bson:"wallet_unique" json:"wallet_unique"`
	Name         string    `bson:"name" json:"name"`
	Coin         Coin      `bson:"coin" json:"coin"`
}

type WalletCreateConfirmRequest

type WalletCreateConfirmRequest struct {
	Scope ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	Lead  ref.Lead  `bson:"lead" json:"lead"`
}

type WalletGetRequest

type WalletGetRequest struct {
	Scope        ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	WalletUnique Unique    `bson:"wallet_unique" json:"wallet_unique"`
	With         *struct {
		Account bool `bson:"account" json:"account"`
	} `bson:"with" json:"with"`
}

type WalletImportAccRequest

type WalletImportAccRequest struct {
	Scope        ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	WalletUnique Unique    `bson:"wallet_unique" json:"wallet_unique"`
	Coin         Coin      `bson:"coin" json:"coin"`
}

WalletImportAccRequest todo

type WalletLoadAccRequest

type WalletLoadAccRequest struct {
	Scope        ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	WalletUnique Unique    `bson:"wallet_unique" json:"wallet_unique"`
}

type WalletMnemonicCheckRequest

type WalletMnemonicCheckRequest struct {
	Scope    ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	Lead     ref.Lead  `bson:"lead" json:"lead"`
	Mnemonic string    `bson:"mnemonic" json:"mnemonic"`
}

type WalletMnemonicCheckResponse

type WalletMnemonicCheckResponse struct {
	Correct bool `bson:"correct" json:"correct"`
}

type WalletPreCreateRequest

type WalletPreCreateRequest struct {
	Scope ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	Lead  ref.Lead  `bson:"lead" json:"lead"`
}

type WalletPreCreateResponse

type WalletPreCreateResponse struct {
	Scope      ref.Scope `bson:"scope" json:"scope"` //[*]所属域
	Unique     Unique    `bson:"unique" json:"unique"`
	PublicKey  string    `bson:"public_key" json:"public_key"`
	Mnemonic   string    `bson:"mnemonic" json:"mnemonic"`
	PrivateKey string    `bson:"private_key" json:"private_key"`
}

Jump to

Keyboard shortcuts

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