wallet

package
v0.0.0-...-5bf7b43 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMultiRecipients = 64

Variables

This section is empty.

Functions

func EncodeRecipients

func EncodeRecipients(idToAmount map[uint64]int64) (string, error)

Types

type GetAccountReply

type GetAccountReply struct {
	UnconfirmedBalanceNQT int64  `json:"unconfirmedBalanceNQT,string"`
	GuaranteedBalanceNQT  int64  `json:"guaranteedBalanceNQT,string"`
	EffectiveBalanceNXT   int64  `json:"effectiveBalanceNXT,string"`
	AccountRS             string `json:"accountRS"`
	Name                  string `json:"name"`
	ForgedBalanceNQT      int64  `json:"forgedBalanceNQT,string"`
	BalanceNQT            int64  `json:"balanceNQT,string"`
	PublicKey             string `json:"publicKey"`
	Account               uint64 `json:"account,string"`
	// contains filtered or unexported fields
}

type GetAccountRequest

type GetAccountRequest struct {
	Account uint64 `url:"account"`
	// contains filtered or unexported fields
}

type GetAccountTransactionsReply

type GetAccountTransactionsReply struct {
	Transactions []struct {
		SenderPublicKey string `json:"senderPublicKey"`
		Signature       string `json:"signature"`
		FeeNQT          int64  `json:"feeNQT,string"`
		Type            int    `json:"type"`
		Confirmations   int    `json:"confirmations"`
		FullHash        string `json:"fullHash"`
		Version         int    `json:"version"`
		EcBlockID       uint64 `json:"ecBlockId,string"`
		SignatureHash   string `json:"signatureHash"`
		Attachment      struct {
			VersionMessage int    `json:"version.Message"`
			MessageIsText  bool   `json:"messageIsText"`
			Message        string `json:"message"`
		} `json:"attachment"`
		SenderRS       string `json:"senderRS"`
		Subtype        int    `json:"subtype"`
		AmountNQT      int64  `json:"amountNQT,string"`
		Sender         uint64 `json:"sender,string"`
		RecipientRS    string `json:"recipientRS"`
		Recipient      uint64 `json:"recipient,string"`
		EcBlockHeight  uint64 `json:"ecBlockHeight"`
		Block          string `json:"block"`
		BlockTimestamp int64  `json:"blockTimestamp"`
		Deadline       uint64 `json:"deadline"`
		Transaction    uint64 `json:"transaction,string"`
		Timestamp      int64  `json:"timestamp"`
		Height         uint64 `json:"height"`
	} `json:"transactions"`
	// contains filtered or unexported fields
}

type GetAccountTransactionsRequest

type GetAccountTransactionsRequest struct {
	Account               uint64 `url:"account,string"`
	Timestamp             int64  `url:"timestamp,omitempty"`
	Type                  int    `url:"type,omitempty"`
	Subtype               int    `url:"type,omitempty"`
	FirstIndex            int    `url:"firstIndex,omitempty"`
	LastIndex             int    `url:"lastIndex,omitempty"`
	NumberOfConfirmations int    `url:"numberOfConfirmations,omitempty"`
	// contains filtered or unexported fields
}

type GetAccountsWithRewardRecipientReply

type GetAccountsWithRewardRecipientReply struct {
	Recipients []Uint64Str `json:"accounts"`
	// contains filtered or unexported fields
}

type GetAccountsWithRewardRecipientRequest

type GetAccountsWithRewardRecipientRequest struct {
	AccountID uint64 `url:"account"`
	// contains filtered or unexported fields
}

type GetBlockReply

type GetBlockReply struct {
	PreviousBlockHash    string      `json:"previousBlockHash"`
	PayloadLength        int         `json:"payloadLength"`
	TotalAmountNQT       int64       `json:"totalAmountNQT,string"`
	GenerationSignature  string      `json:"generationSignature"`
	Generator            uint64      `json:"generator,string"`
	GeneratorPublicKey   string      `json:"generatorPublicKey"`
	BaseTarget           uint64      `json:"baseTarget,string"`
	PayloadHash          string      `json:"payloadHash"`
	GeneratorRS          string      `json:"generatorRS"`
	BlockReward          int64       `json:"blockReward,string"`
	ScoopNum             uint32      `json:"scoopNum"`
	NumberOfTransactions int         `json:"numberOfTransactions"`
	BlockSignature       string      `json:"blockSignature"`
	Transactions         []Uint64Str `json:"transactions"`
	Nonce                uint64      `json:"nonce,string"`
	Version              int         `json:"version"`
	TotalFeeNQT          int64       `json:"totalFeeNQT,string"`
	PreviousBlock        uint64      `json:"previousBlock,string"`
	Block                uint64      `json:"block,string"`
	NextBlock            uint64      `json:"nextBlock,string"`
	Height               uint64      `json:"height"`
	Timestamp            int32       `json:"timestamp"`
	// contains filtered or unexported fields
}

type GetBlockRequest

type GetBlockRequest struct {
	Block               uint64 `url:"block,omitempty"`
	Height              uint64 `url:"height,omitempty"`
	Timestamp           int64  `url:"timestamp,omitempty"`
	IncludeTransactions bool   `url:"includeTransactions,omitempty"`
	// contains filtered or unexported fields
}

type GetMiningInfoReply

type GetMiningInfoReply struct {
	GenerationSignature string `json:"generationSignature"`
	BaseTarget          uint64 `json:"baseTarget,string"`
	Height              uint64 `json:"height,string"`
	// contains filtered or unexported fields
}

type GetMiningInfoRequest

type GetMiningInfoRequest struct {
	// contains filtered or unexported fields
}

type GetTransactionReply

type GetTransactionReply struct {
	SenderPublicKey string `json:"senderPublicKey"`
	Signature       string `json:"signature"`
	FeeNQT          int64  `json:"feeNQT,string"`
	Type            int    `json:"type"`
	Confirmations   int    `json:"confirmations"`
	FullHash        string `json:"fullHash"`
	Version         int    `json:"version"`
	EcBlockID       uint64 `json:"ecBlockId,string"`
	SignatureHash   string `json:"signatureHash"`
	// TODO: recipients should be decoded into something like
	// struct { AccountID uint64, Amount int64 }
	Attachment struct {
		Recipients              [][]string `json:"recipients"`
		VersionMultiOutCreation int        `json:"version.MultiOutCreation"`
	} `json:"attachment"`
	SenderRS       string `json:"senderRS"`
	Subtype        int    `json:"subtype"`
	AmountNQT      int64  `json:"amountNQT,string"`
	Sender         uint64 `json:"sender,string"`
	EcBlockHeight  uint64 `json:"ecBlockHeight"`
	Block          uint64 `json:"block,string"`
	BlockTimestamp int64  `json:"blockTimestamp"`
	Deadline       int    `json:"deadline"`
	Transaction    uint64 `json:"transaction,string"`
	Timestamp      int64  `json:"timestamp"`
	Height         uint64 `json:"height"`
	// contains filtered or unexported fields
}

type GetTransactionRequest

type GetTransactionRequest struct {
	Transaction uint64 `url:"transaction,omitempty"`
	FullHash    string `url:"fullHash,omitempty"`
	// contains filtered or unexported fields
}

type SendMoneyMultiReply

type SendMoneyMultiReply struct {
	TxID uint64 `json:"transaction,string"`
	// contains filtered or unexported fields
}

type SendMoneyMultiRequest

type SendMoneyMultiRequest struct {
	Recipients                    string `url:"recipients"`
	FeeNQT                        int64  `url:"feeNQT,string"`
	Deadline                      uint   `url:"deadline"`
	ReferencedTransactionFullHash string `url:"referencedTransactionFullHash,omitempty"`
	Broadcast                     bool   `url:"broadcast,omitempty"`
	SecretPhrase                  string `url:"secretPhrase"`
	// contains filtered or unexported fields
}

type SendMoneyReply

type SendMoneyReply struct {
	TxID uint64 `json:"transaction,string"`
	// contains filtered or unexported fields
}

type SendMoneyRequest

type SendMoneyRequest struct {
	Recipient                     uint64 `url:"recipient,string"`
	AmountNQT                     int64  `url:"amountNQT,string"`
	FeeNQT                        int64  `url:"feeNQT,string"`
	Deadline                      uint   `url:"deadline"`
	ReferencedTransactionFullHash string `url:"referencedTransactionFullHash,omitempty"`
	Broadcast                     bool   `url:"broadcast,omitempty"`
	SecretPhrase                  string `url:"secretPhrase"`
	// contains filtered or unexported fields
}

type SubmitNonceReply

type SubmitNonceReply struct {
	Deadline uint64 `json:"deadline"`
	Result   string `json:"result"`
	// contains filtered or unexported fields
}

type SubmitNonceRequest

type SubmitNonceRequest struct {
	AccountID    uint64 `url:"accountId"`
	Nonce        uint64 `url:"nonce"`
	SecretPhrase string `url:"secretPhrase"`
	// contains filtered or unexported fields
}

type Uint64Str

type Uint64Str uint64

func (Uint64Str) MarshalJSON

func (i Uint64Str) MarshalJSON() ([]byte, error)

func (*Uint64Str) UnmarshalJSON

func (i *Uint64Str) UnmarshalJSON(b []byte) error

type Wallet

type Wallet interface {
	// BroadcastTransaction() (*BroadcastTransactionReply, error)
	// BuyAlias() (*BuyAliasReply, error)
	// CalculateFullHash() (*CalculateFullHashReply, error)
	// CancelAskOrder() (*CancelAskOrderReply, error)
	// CancelBidOrder() (*CancelBidOrderReply, error)
	// CreateATProgram() (*CreateATProgramReply, error)
	// DecodeHallmark() (*DecodeHallmarkReply, error)
	// DecodeToken() (*DecodeTokenReply, error)
	// DecryptFrom() (*DecryptFromReply, error)
	// DgsDelisting() (*DgsDelistingReply, error)
	// DgsDelivery() (*DgsDeliveryReply, error)
	// DgsFeedback() (*DgsFeedbackReply, error)
	// DgsListing() (*DgsListingReply, error)
	// DgsPriceChange() (*DgsPriceChangeReply, error)
	// DgsPurchase() (*DgsPurchaseReply, error)
	// DgsQuantityChange() (*DgsQuantityChangeReply, error)
	// DgsRefund() (*DgsRefundReply, error)
	// EncryptTo() (*EncryptToReply, error)
	// EscrowSign() (*EscrowSignReply, error)
	// GenerateToken() (*GenerateTokenReply, error)
	// GetAT() (*GetATReply, error)
	// GetATDetails() (*GetATDetailsReply, error)
	// GetATIds() (*GetATIdsReply, error)
	// GetATLong() (*GetATLongReply, error)
	GetAccount(*GetAccountRequest) (*GetAccountReply, error)
	// GetAccountATs() (*GetAccountATsReply, error)
	// GetAccountBlockIds() (*GetAccountBlockIdsReply, error)
	// GetAccountBlocks() (*GetAccountBlocksReply, error)
	// GetAccountCurrentAskOrderIds() (*GetAccountCurrentAskOrderIdsReply, error)
	// GetAccountCurrentAskOrders() (*GetAccountCurrentAskOrdersReply, error)
	// GetAccountCurrentBidOrderIds() (*GetAccountCurrentBidOrderIdsReply, error)
	// GetAccountCurrentBidOrders() (*GetAccountCurrentBidOrdersReply, error)
	// GetAccountEscrowTransactions() (*GetAccountEscrowTransactionsReply, error)
	// GetAccountId() (*GetAccountIdReply, error)
	// GetAccountLessors() (*GetAccountLessorsReply, error)
	// GetAccountPublicKey() (*GetAccountPublicKeyReply, error)
	// GetAccountSubscriptions() (*GetAccountSubscriptionsReply, error)
	// GetAccountTransactionIds() (*GetAccountTransactionIdsReply, error)
	GetAccountTransactions(*GetAccountTransactionsRequest) (*GetAccountTransactionsReply, error)
	GetAccountsWithRewardRecipient(*GetAccountsWithRewardRecipientRequest) (
		*GetAccountsWithRewardRecipientReply, error)
	// GetAlias() (*GetAliasReply, error)
	// GetAliases() (*GetAliasesReply, error)
	// GetAllAssets() (*GetAllAssetsReply, error)
	// GetAllOpenAskOrders() (*GetAllOpenAskOrdersReply, error)
	// GetAllOpenBidOrders() (*GetAllOpenBidOrdersReply, error)
	// GetAllTrades() (*GetAllTradesReply, error)
	// GetAskOrder() (*GetAskOrderReply, error)
	// GetAskOrderIds() (*GetAskOrderIdsReply, error)
	// GetAskOrders() (*GetAskOrdersReply, error)
	// GetAsset() (*GetAssetReply, error)
	// GetAssetAccounts() (*GetAssetAccountsReply, error)
	// GetAssetIds() (*GetAssetIdsReply, error)
	// GetAssetTransfers() (*GetAssetTransfersReply, error)
	// GetAssets() (*GetAssetsReply, error)
	// GetAssetsByIssuer() (*GetAssetsByIssuerReply, error)
	// GetBalance() (*GetBalanceReply, error)
	// GetBidOrder() (*GetBidOrderReply, error)
	// GetBidOrderIds() (*GetBidOrderIdsReply, error)
	// GetBidOrders() (*GetBidOrdersReply, error)
	GetBlock(*GetBlockRequest) (*GetBlockReply, error)
	// GetBlockId() (*GetBlockIdReply, error)
	// GetBlockchainStatus() (*GetBlockchainStatusReply, error)
	// GetBlocks() (*GetBlocksReply, error)
	// GetConstants() (*GetConstantsReply, error)
	// GetDGSGood() (*GetDGSGoodReply, error)
	// GetDGSGoods() (*GetDGSGoodsReply, error)
	// GetDGSPendingPurchases() (*GetDGSPendingPurchasesReply, error)
	// GetDGSPurchase() (*GetDGSPurchaseReply, error)
	// GetDGSPurchases() (*GetDGSPurchasesReply, error)
	// GetECBlock() (*GetECBlockReply, error)
	// GetEscrowTransaction() (*GetEscrowTransactionReply, error)
	// GetGuaranteedBalance() (*GetGuaranteedBalanceReply, error)
	GetMiningInfo() (*GetMiningInfoReply, error)
	// GetMyInfo() (*GetMyInfoReply, error)
	// GetPeer() (*GetPeerReply, error)
	// GetPeers() (*GetPeersReply, error)
	// GetRewardRecipient() (*GetRewardRecipientReply, error)
	// GetState() (*GetStateReply, error)
	// GetSubscription() (*GetSubscriptionReply, error)
	// GetSubscriptionsToAccount() (*GetSubscriptionsToAccountReply, error)
	// GetTime() (*GetTimeReply, error)
	// GetTrades() (*GetTradesReply, error)
	GetTransaction(*GetTransactionRequest) (*GetTransactionReply, error)
	// GetTransactionBytes() (*GetTransactionBytesReply, error)
	// GetUnconfirmedTransactionIds() (*GetUnconfirmedTransactionIdsReply, error)
	// GetUnconfirmedTransactions() (*GetUnconfirmedTransactionsReply, error)
	// IssueAsset() (*IssueAssetReply, error)
	// LeaseBalance() (*LeaseBalanceReply, error)
	// LongConvert() (*LongConvertReply, error)
	// MarkHost() (*MarkHostReply, error)
	// ParseTransaction() (*ParseTransactionReply, error)
	// PlaceAskOrder() (*PlaceAskOrderReply, error)
	// PlaceBidOrder() (*PlaceBidOrderReply, error)
	// ReadMessage() (*ReadMessageReply, error)
	// RsConvert() (*RsConvertReply, error)
	// SellAlias() (*SellAliasReply, error)
	// SendMessage() (*SendMessageReply, error)
	SendMoney(*SendMoneyRequest) (*SendMoneyReply, error)
	SendMoneyMulti(*SendMoneyMultiRequest) (*SendMoneyMultiReply, error)
	// SendMoneyEscrow() (*SendMoneyEscrowReply, error)
	// SendMoneySubscription() (*SendMoneySubscriptionReply, error)
	// SetAccountInfo() (*SetAccountInfoReply, error)
	// SetAlias() (*SetAliasReply, error)
	// SetRewardRecipient() (*SetRewardRecipientReply, error)
	// SignTransaction() (*SignTransactionReply, error)
	SubmitNonce(*SubmitNonceRequest) (*SubmitNonceReply, error)
}

func NewWallet

func NewWallet(url string, timeout time.Duration, trustAll bool) Wallet

Jump to

Keyboard shortcuts

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