wallet

package
v0.0.0-...-506c09b Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	USDT = "815b0b1a-2764-3736-8faa-42d694fa620a" // "USDT",
	BTC  = "c6d0c728-2624-429b-8e0d-d9d19b6592fa" // "BTC",
	BCH  = "fd11b6e3-0b87-41f1-a41f-f0e9b49e5bf0" // "BCH",
	EOS  = "6cfe566e-4aad-470b-8c9a-2fd35b49c68d" //: "EOS",
	ETH  = "43d61dcd-e413-450d-80b8-101d5e903357" //: "ETH",
	ETC  = "2204c1ee-0ea2-4add-bb9a-b3719cfff93a"
	LTC  = "76c802a2-7c88-447f-a93e-c29c9e5dd9c8"
)

Variables

This section is empty.

Functions

func AmountTooSmall

func AmountTooSmall(err error) bool

func InsufficientBalance

func InsufficientBalance(err error) bool

Types

type Asset

type Asset struct {
	AssetId     string  `json:"assetId"`
	AssetKey    string  `json:"assetKey,omitempty"`
	ChainId     string  `json:"chainId"`
	Icon        string  `json:"icon"`
	Name        string  `json:"name"`
	Symbol      string  `json:"symbol"`
	Balance     float64 `json:"balance"`
	PublicKey   string  `json:"publicKey,omitempty"`
	AccountName string  `json:"accountName,omitempty"`
	AccountTag  string  `json:"accountTag,omitempty"`
	Price       float64 `json:"price"`
	Change      float64 `json:"change"`
}

func GetAssetDetail

func GetAssetDetail(ctx context.Context, token, assetid string) (*Asset, error)

type Assets

type Assets []Asset

func GetAssets

func GetAssets(ctx context.Context, token string, includeMainChain bool) (Assets, error)

type PaymentRequest

type PaymentRequest struct {
	TraceId string `json:"traceId"`
	Amount  string `json:"amount"`
	AssetId string `json:"assetId"`
	Memo    string `json:"memo"`
}

type PriceNumber

type PriceNumber string

func (*PriceNumber) MarshalJSON

func (p *PriceNumber) MarshalJSON() ([]byte, error)

func (*PriceNumber) UnmarshalJSON

func (p *PriceNumber) UnmarshalJSON(b []byte) error

type Snapshot

type Snapshot struct {
	SnapshotId string      `json:"snapshotId"`
	AssetId    string      `json:"assetId"`
	TraceId    string      `json:"traceId"`
	Amount     PriceNumber `json:"amount"`
	Memo       string      `json:"memo"`
	CreatedAt  int64       `json:"createdAt"`

	CounterUserId string `json:"counterUserId"`

	Sender          string `json:"sender"`
	Receiver        string `json:"receiver"`
	TransactionHash string `json:"transactionHash"`
}

func QuerySnapshots

func QuerySnapshots(ctx context.Context, token, assetId string, desc bool, limit int, cursor string) ([]Snapshot, *request.Pagination, error)

func Transfer

func Transfer(ctx context.Context, token string, pin account.Pin, tr TransferRequest) (*Snapshot, error)

func Withdraw

func Withdraw(ctx context.Context, token string, pin account.Pin, wr WithdrawRequest) (*Snapshot, error)

type Status

type Status struct {
	IsPinSet bool   `json:"isPinSet"`
	MixinId  string `json:"mixinId"`
	Fullname string `json:"fullname"`
}

func GetWalletStatus

func GetWalletStatus(ctx context.Context, token string) (*Status, error)

type TransferRequest

type TransferRequest struct {
	PaymentRequest
	CounterUserId string `json:"counterUserId"`
}

type WithdrawRequest

type WithdrawRequest struct {
	PaymentRequest
	PublicKey string `json:"publicKey"` // 提现地址
}

Jump to

Keyboard shortcuts

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