walletrpc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPaymentID256

func NewPaymentID256() string

NewPaymentID256 generates a 256 bit payment ID (hex encoded).

func NewPaymentID64

func NewPaymentID64() string

NewPaymentID64 generates a 64 bit payment ID (hex encoded). With 64 bit IDs, there is a non-negligible chance of a collision if they are randomly generated. It is up to recipients generating them to sanity check for uniqueness.

1 million IDs at 64-bit (simplified): 1,000,000^2 / (2^64 * 2) = ~1/36,893,488 so there is a 50% chance a collision happens around 5.06 billion IDs generated.

func XMRToDecimal

func XMRToDecimal(xmr uint64) string

XMRToDecimal converts a raw atomic XMR balance to a more human readable format.

func XMRToFloat64

func XMRToFloat64(xmr uint64) float64

XMRToFloat64 converts raw atomic XMR to a float64

Types

type AddressBookEntry

type AddressBookEntry struct {
	Address     string `json:"address"`
	Description string `json:"description,omitempty"`
	Index       uint64 `json:"index,omitempty"`
	PaymentId   string `json:"payment_id,omitempty"`
}

AddressBookEntry Address

type Addresses

type Addresses struct {
	// address string; The 95-character hex (sub)address string.
	Address string `json:"address"`
	// label string; Label of the (sub)address
	Label string `json:"label"`
	// address_index unsigned int; index of the subaddress
	AddressIndex uint `json:"address_index"`
	// used boolean; states if the (sub)address has already received funds
	Used bool `json:"used"`
}

type Client

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

func New

func New(cfg Config) *Client

New returns a new monero-wallet-rpc client.

func (*Client) AddAddressBook

func (c *Client) AddAddressBook(entry AddressBookEntry) (index uint64, err error)

AddAddressBook adds an entry to the address book.

func (*Client) CreateAccount

func (c *Client) CreateAccount() (*CreateAccountResponse, error)

CreateAccount returns new account

func (*Client) CreateAddress

func (c *Client) CreateAddress(req CreateAddressRequest) (*CreateAddressResponse, error)

CreateAddress returns new address

func (*Client) CreateWallet

func (c *Client) CreateWallet(filename, password, language string) error

CreateWallet creates a new wallet. You need to have set the argument "–wallet-dir" when launching monero-wallet-rpc to make this work.

filename - string;
 password - string;
 language - string; Language for your wallets' seed.

func (*Client) DeleteAddressBook

func (c *Client) DeleteAddressBook(index uint64) error

DeleteAddressBook deletes an entry from the address book.

func (*Client) ExportKeyImages

func (c *Client) ExportKeyImages() (signedkeyimages []SignedKeyImage, err error)

ExportKeyImages exports a signed set of key images.

func (*Client) GetAddress

func (c *Client) GetAddress(req GetAddressRequest) (*GetAddressResponse, error)

GetAddress returns the wallet's address. address - string; The 95-character hex address string of the monero-wallet-rpc in session.

func (*Client) GetAddressBook

func (c *Client) GetAddressBook(indexes []uint64) (entries []AddressBookEntry, err error)

GetAddressBook retrieves entries from the address book. indexes - array of unsigned int; indices of the requested address book entries

func (*Client) GetAttribute

func (c *Client) GetAttribute(key string) (value string, err error)

GetAttribute gets an attribute value

func (*Client) GetBalance

func (c *Client) GetBalance(req GetBalanceRequest) (*GetBalanceResponse, error)

GetBalance returns the wallet's balance.

func (*Client) GetBulkPayments

func (c *Client) GetBulkPayments(paymentids []string, minblockheight uint64) ([]Payment, error)

GetBulkPayments returns a list of incoming payments using a given payment id, or a list of payments ids, from a given height. This method is the preferred method over get_payments because it has the same functionality but is more extendable. Either is fine for looking up transactions by a single payment ID.

payment_ids - array of: string
min_block_height - unsigned int; The block height at which to start looking for payments.

func (*Client) GetHeight

func (c *Client) GetHeight() (uint64, error)

GetHeight returns the wallet's current block height. height - unsigned int; The current monero-wallet-rpc's blockchain height. If the wallet has been offline for a long time, it may need to catch up with the daemon.

func (*Client) GetLanguages

func (c *Client) GetLanguages() (languages []string, err error)

GetLanguages gets a list of available languages for your wallet's seed.

func (*Client) GetPayments

func (c *Client) GetPayments(paymentid string) ([]Payment, error)

GetPayments returns a list of incoming payments using a given payment id.

func (*Client) GetTransferByTxID

func (c *Client) GetTransferByTxID(req GetTransferByTxidRequest) (*GetTransferByTxidResponse, error)

GetTransferByTxID shows information about a transfer to/from this address.

func (*Client) GetTransfers

func (c *Client) GetTransfers(req GetTransfersRequest) (*GetTransfersResponse, error)

GetTransfers returns a list of transfers.

func (*Client) GetTxNotes

func (c *Client) GetTxNotes(txids []string) (notes []string, err error)

GetTxNotes gets string notes for transactions.

func (*Client) ImportKeyImages

func (c *Client) ImportKeyImages(signedkeyimages []SignedKeyImage) (resp *ImportKeyImageResponse, err error)

ImportKeyImages imports signed key images list and verify their spent status.

func (*Client) IncomingTransfers

IncomingTransfers returns a list of incoming transfers to the wallet.

func (*Client) MakeIntegratedAddress

func (c *Client) MakeIntegratedAddress(paymentid string) (integratedaddr string, err error)

MakeIntegratedAddress makes an integrated address from the wallet address and a payment id. payment_id - string; hex encoded; can be empty, in which case a random payment id is generated

func (*Client) MakeURI

func (c *Client) MakeURI(req URIDef) (uri string, err error)

MakeURI creates a payment URI using the official URI spec.

func (*Client) OpenWallet

func (c *Client) OpenWallet(filename, password string) error

OpenWallet opens a wallet. You need to have set the argument "–wallet-dir" when launching monero-wallet-rpc to make this work.

func (*Client) ParseURI

func (c *Client) ParseURI(uri string) (parsed *URIDef, err error)

ParseURI parses a payment URI to get payment information.

func (*Client) QueryKey

func (c *Client) QueryKey(keytype QueryKeyType) (key string, err error)

QueryKey returns the spend or view private key (or mnemonic seed).

func (*Client) RescanBlockchain

func (c *Client) RescanBlockchain() error

RescanBlockchain rescans blockchain from scratch.

func (*Client) RescanSpent

func (c *Client) RescanSpent() error

RescanSpent rescans the blockchain for spent outputs.

func (*Client) SetAttribute

func (c *Client) SetAttribute(key string, value string) error

SetAttribute sets an attribute value

func (*Client) SetTxNotes

func (c *Client) SetTxNotes(txids, notes []string) error

SetTxNotes sets arbitrary string notes for transactions.

func (*Client) Sign

func (c *Client) Sign(data string) (signature string, err error)

Sign signs a string.

func (*Client) SplitIntegratedAddress

func (c *Client) SplitIntegratedAddress(integratedaddr string) (paymentid, address string, err error)

SplitIntegratedAddress retrieves the standard address and payment id corresponding to an integrated address.

func (*Client) StartMining

func (c *Client) StartMining(threads uint, background, ignorebattery bool) error

StartMining starts mining in the Monero daemon.

threads_count - unsigned int; Number of threads created for mining
do_background_mining - boolean;
ignore_battery - boolean;

func (*Client) StopMining

func (c *Client) StopMining() error

StopMining stops mining in the Monero daemon.

func (*Client) StopWallet

func (c *Client) StopWallet() error

StopWallet stops the wallet, storing the current state.

func (*Client) Store

func (c *Client) Store() error

Store saves the blockchain.

func (*Client) SweepAll

func (c *Client) SweepAll(req SweepAllRequest) (resp *SweepAllResponse, err error)

SweepAll sends all unlocked balance to an address.

func (*Client) SweepDust

func (c *Client) SweepDust() (txHashList []string, err error)

SweepDust sends all dust outputs back to the wallet's, to make them easier to spend (and mix).

func (*Client) SweepSingle

func (c *Client) SweepSingle(req SweepSingleRequest) (resp *SweepSingleResponse, err error)

SweepSingle sends all of a specific unlocked output to an address.

func (*Client) Transfer

func (c *Client) Transfer(req TransferRequest) (*TransferResponse, error)

Transfer sends monero to a number of recipients.

func (*Client) TransferSplit

func (c *Client) TransferSplit(req TransferRequest) (resp *TransferSplitResponse, err error)

TransferSplit is same as transfer, but can split into more than one tx if necessary.

func (*Client) Verify

func (c *Client) Verify(data, address, signature string) (good bool, err error)

Verify verifies a signature on a string.

type Config

type Config struct {
	Address       string
	CustomHeaders map[string]string
	Transport     http.RoundTripper
}

Config holds the configuration of a monero rpc client.

type CreateAccountResponse

type CreateAccountResponse struct {
	AccountIndex uint64 `json:"account_index"`
	Address      string `json:"address"`
}

type CreateAddressRequest

type CreateAddressRequest struct {
	AccountIndex uint64 `json:"account_index"`
	Label        string `json:"label"`
}

type CreateAddressResponse

type CreateAddressResponse struct {
	Address      string `json:"address"`
	AddressIndex uint64 `json:"address_index"`
}

type Destination

type Destination struct {
	// Amount - unsigned int; Amount to send to each destination, in atomic units.
	Amount uint64 `json:"amount"`
	// Address - string; Destination public address.
	Address string `json:"address"`
}

Destination to receive XMR

type ErrorCode

type ErrorCode int

ErrorCode is a monero-wallet-rpc error code. Copied from https://github.com/monero-project/monero/blob/release-v0.11.0.0/src/wallet/wallet_rpc_server_error_codes.h

const (
	// ErrUnknown - E_UNKNOWN_ERROR
	ErrUnknown ErrorCode = -1
	// ErrWrongAddress - E_WRONG_ADDRESS
	ErrWrongAddress ErrorCode = -2
	// ErrDaemonIsBusy - E_DAEMON_IS_BUSY
	ErrDaemonIsBusy ErrorCode = -3
	// ErrGenericTransferError - E_GENERIC_TRANSFER_ERROR
	ErrGenericTransferError ErrorCode = -4
	// ErrWrongPaymentID - E_WRONG_PAYMENT_ID
	ErrWrongPaymentID ErrorCode = -5
	// ErrTransferType - E_TRANSFER_TYPE
	ErrTransferType ErrorCode = -6
	// ErrDenied - E_DENIED
	ErrDenied ErrorCode = -7
	// ErrWrongTxID - E_WRONG_TXID
	ErrWrongTxID ErrorCode = -8
	// ErrWrongSignature - E_WRONG_SIGNATURE
	ErrWrongSignature ErrorCode = -9
	// ErrWrongKeyImage - E_WRONG_KEY_IMAGE
	ErrWrongKeyImage ErrorCode = -10
	// ErrWrongURI - E_WRONG_URI
	ErrWrongURI ErrorCode = -11
	// ErrWrongIndex - E_WRONG_INDEX
	ErrWrongIndex ErrorCode = -12
	// ErrNotOpen - E_NOT_OPEN
	ErrNotOpen ErrorCode = -13
)

type GetAddressRequest

type GetAddressRequest struct {
	// account_index - unsigned int; Return subaddresses for this account.
	AccountIndex uint `json:"account_index"`
	// address_index - array of unsigned int; (Optional) List of subaddresses to return from an account.
	AddressIndex []uint `json:"address_index"`
}

type GetAddressResponse

type GetAddressResponse struct {
	// address - string; The 95-character hex address string of the monero-wallet-rpc in session.
	Address   string      `json:"address"`
	Addresses []Addresses `json:"addresses"`
}

type GetBalanceRequest

type GetBalanceRequest struct {
	// account_index - unsigned int; Return subaddresses for this account.
	AccountIndex uint `json:"account_index"`
	// address_indices - array of unsigned int; (Optional) List of subaddresses to return from an account.
	AddressIndices []uint `json:"address_indices"`
}

type GetBalanceResponse

type GetBalanceResponse struct {
	Balance              uint64           `json:"balance"`
	UnlockedBalance      uint64           `json:"unlocked_balance"`
	MultisigImportNeeded bool             `json:"multisig_import_needed"`
	PerSubaddress        []SubaddressInfo `json:"per_subaddress"`
}

type GetIncomingTransferRequest

type GetIncomingTransferRequest struct {
	TransferType   GetTransferType `json:"transfer_type"`
	AccountIndex   uint            `json:"account_index"`
	SubaddrIndices SubAddrIndex    `json:"subaddr_indices"`
	Verbose        bool            `json:"verbose"`
}

type GetIncomingTransferResponse

type GetIncomingTransferResponse struct {
	Transfer []IncTransfer `json:"transfer"`
}

type GetTransferByTxidRequest

type GetTransferByTxidRequest struct {
	TxId         string `json:"txid"`
	AccountIndex uint   `json:"account_index,omitempty"`
}

type GetTransferByTxidResponse

type GetTransferByTxidResponse struct {
	Transfer Transfer `json:"transfer"`
}

Transfer is the transfer data of

type GetTransferType

type GetTransferType string

GetTransferType is a string that contains the possible types: "all": all the transfers; "available": only transfers which are not yet spent; "unavailable": only transfers which are already spent.

const (
	// TransferAll - all the transfers
	TransferAll GetTransferType = "all"
	// TransferAvailable - only transfers which are not yet spent
	TransferAvailable GetTransferType = "available"
	// TransferUnavailable - only transfers which are already spent
	TransferUnavailable GetTransferType = "unavailable"
)

type GetTransfersRequest

type GetTransfersRequest struct {
	In             bool     `json:"in"`
	Out            bool     `json:"out"`
	Pending        bool     `json:"pending"`
	Failed         bool     `json:"failed"`
	Pool           bool     `json:"pool"`
	FilterByHeight bool     `json:"filter_by_height"`
	MinHeight      uint64   `json:"min_height"`
	MaxHeight      uint64   `json:"max_height"`
	AccountIndex   uint64   `json:"account_index"`
	SubAddrIndex   []uint64 `json:"subaddr_indices"`
}

GetTransfersRequest = GetTransfers body

type GetTransfersResponse

type GetTransfersResponse struct {
	In      []Transfer `json:"in"`
	Out     []Transfer `json:"out"`
	Pending []Transfer `json:"pending"`
	Failed  []Transfer `json:"failed"`
	Pool    []Transfer `json:"pool"`
}

GetTransfersResponse = GetTransfers output

type H

type H map[string]interface{}

H is a helper map shortcut.

type ImportKeyImageResponse

type ImportKeyImageResponse struct {
	Height  uint64 `json:"height"`
	Spent   uint64 `json:"spent"`
	Unspent uint64 `json:"unspent"`
}

ImportKeyImageResponse is the result of ImportKeyImages()

type IncTransfer

type IncTransfer struct {
	Amount uint64 `json:"amount"`
	// Mostly internal use, can be ignored by most users.
	GlobalIndex  uint64 `json:"global_index"`
	KeyImage     string `json:"key_image"`
	Spent        bool   `json:"spent"`
	SubaddrIndex uint   `json:"subaddr_index"`
	// Several incoming transfers may share the same hash
	// if they were in the same transaction.
	TxHash string `json:"tx_hash"`
	TxSize uint64 `json:"tx_size"`
}

IncTransfer is returned by IncomingTransfers

type Payment

type Payment struct {
	PaymentId    string       `json:"payment_id"`
	TxHash       string       `json:"tx_hash"`
	Amount       uint64       `json:"amount"`
	BlockHeight  uint64       `json:"block_height"`
	UnlockTime   uint64       `json:"unlock_time"`
	SubaddrIndex SubAddrIndex `json:"subaddr_index"`
	Address      string       `json:"address"`
}

Payment ...

type Priority

type Priority uint

Priority represents a transaction priority

const (
	PriorityDefault     Priority = 0
	PriorityUnimportant Priority = 1
	PriorityNormal      Priority = 2
	PriorityElevated    Priority = 3
	PriorityPriority    Priority = 4
)

Accepted Values are: 0-4 for: default, unimportant, normal, elevated, priority.

type QueryKeyType

type QueryKeyType string

QueryKeyType is the parameter to send with QueryKey()

const (
	// QueryKeyMnemonic is the mnemonic seed
	QueryKeyMnemonic QueryKeyType = "mnemonic"
	// QueryKeyView is the private view key
	QueryKeyView QueryKeyType = "view_key"
	// QueryKeySpend is the private spend key
	QueryKeySpend QueryKeyType = "spend_key" //TODO: test
)

type SignedKeyImage

type SignedKeyImage struct {
	KeyImage  string `json:"key_image"`
	Signature string `json:"signature"`
}

SignedKeyImage - The key image is an alternate public key computed on a second base point, Hp(P), instead of G. It is required in traceable ring signature construction to ensure multiple signatures with the same real key are linked.

type SubAddrIndex

type SubAddrIndex struct {
	Major uint `json:"major"`
	Minor uint `json:"minor"`
}

type SubaddressInfo

type SubaddressInfo struct {
	AddressIndex      uint64 `json:"address_index"`
	Address           string `json:"address"`
	Balance           uint64 `json:"balance"`
	UnlockedBalance   uint64 `json:"unlocked_balance"`
	Label             string `json:"label"`
	NumUnspentOutputs uint64 `json:"num_unspent_outputs"`
}

type SweepAllRequest

type SweepAllRequest struct {
	// address - string; Destination public address.
	Address string `json:"address"`
	// priority - unsigned int; (Optional)
	Priority Priority `json:"priority,omitempty"`
	// mixin - unsigned int; Number of outpouts from the blockchain to mix with (0 means no mixing).
	Mixin uint64 `json:"mixin"`
	// unlock_time - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`
	// payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
	PaymentID string `json:"payment_id,omitempty"`
	// get_tx_keys - boolean; (Optional) Return the transaction keys after sending.
	GetTxKeys bool `json:"get_tx_keys,omitempty"`
	// below_amount - unsigned int; (Optional)
	BelowAmount uint64 `json:"below_amount"`
	// do_not_relay - boolean; (Optional)
	DoNotRelay bool `json:"do_not_relay,omitempty"`
	// get_tx_hex - boolean; (Optional) return the transactions as hex encoded string.
	GetTxHex bool `json:"get_tx_hex,omitempty"`
}

SweepAllRequest is the struct to send all unlocked balance to an address.

type SweepAllResponse

type SweepAllResponse struct {
	// tx_hash_list - array of: string. The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`
	// tx_blob_list - array of: string. The tx as hex string for every transaction.
	TxBlobList []string `json:"tx_blob_list"`
	// tx_key_list - array of: string. The transaction keys for every transaction.
	TxKeyList []string `json:"tx_key_list"`
}

SweepAllResponse is a typical response of a SweepAllRequest

type SweepSingleRequest

type SweepSingleRequest struct {
	// address - string; Destination public address.
	Address string `json:"address"`
	// account_index - unsigned int; Sweep transactions from this account.
	AccountIndex uint64 `json:"account_index"`
	// priority - unsigned int; (Optional)
	Priority Priority `json:"priority,omitempty"`
	// mixin - unsigned int; Number of outpouts from the blockchain to mix with (0 means no mixing).
	Mixin uint64 `json:"mixin,omitempty"`
	// RingSize - unsigned int; Number of outputs to mix in the transaction (this output + N decoys from the blockchain).
	RingSize uint64 `json:"ring_size,omitempty"`
	// unlock_time - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`
	// payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
	PaymentId string `json:"payment_id,omitempty"`
	// get_tx_keys - boolean; (Optional) Return the transaction keys after sending.
	GetTxKeys bool `json:"get_tx_keys,omitempty"`
	// get_tx_metadata - boolean; (Optional) return the transaction metadata as a string. (Defaults to false)
	GetTxMetadata bool `json:"get_tx_metadata,omitempty"`
	//  string; Key image of specific output to sweep.
	KeyImage string `json:"key_image"`
	// below_amount - unsigned int; (Optional)
	BelowAmount uint64 `json:"below_amount"`
	// do_not_relay - boolean; (Optional)
	DoNotRelay bool `json:"do_not_relay,omitempty"`
	// get_tx_hex - boolean; (Optional) return the transactions as hex encoded string.
	GetTxHex bool `json:"get_tx_hex,omitempty"`
}

SweepSingleRequest is the struct to send single unlocked balance to an address.

type SweepSingleResponse

type SweepSingleResponse struct {
	// tx_hash_list - string. The tx hashes of every transaction.
	TxHash string `json:"tx_hash"`
	// tx_key_list - string. The transaction keys for every transaction.
	TxKey string `json:"tx_key"`
	// amount - integer. The amount transferred for every transaction.
	Amount uint64 `json:"amount"`
	// fee - integer. The amount of fees paid for every transaction.
	Fee uint64 `json:"fee"`
	// tx_blob - string. The tx as hex string for every transaction.
	TxBlob string `json:"tx_blob"`
	// tx_metadata - string. List of transaction metadata needed to relay the transactions later.
	TxMetadata string `json:"tx_metadata"`
	// multisig_txset - string. The set of signing keys used in a multisig transaction (empty for non-multisig).
	MultisigTxset string `json:"multisig_txset"`
	// unsigned_txset - string. Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`
}

SweepSingleResponse is a typical response of a SweepSingleRequest

type Transfer

type Transfer struct {
	Address                         string       `json:"address"`
	Amount                          uint64       `json:"amount"`
	Confirmations                   uint64       `json:"confirmations"`
	DoubleSpendSeen                 bool         `json:"double_spend_seen"`
	Fee                             uint64       `json:"fee"`
	Height                          uint64       `json:"height"`
	Note                            string       `json:"note"`
	PaymentId                       string       `json:"payment_id"`
	SubaddrIndex                    SubAddrIndex `json:"subaddr_index"`
	SuggestedConfirmationsThreshold uint         `json:"suggested_confirmations_threshold"`
	Timestamp                       uint64       `json:"timestamp"`
	TxId                            string       `json:"txid"`
	Type                            string       `json:"type"`
	UnlockTime                      uint64       `json:"unlock_time"`
}

type TransferRequest

type TransferRequest struct {
	// Destinations - array of destinations to receive XMR:
	Destinations []Destination `json:"destinations"`
	// account_index - unsigned int; (Optional) Transfer from this account index. (Defaults to 0)
	AccountIndex uint `json:"account_index"`
	// subaddr_indices - array of unsigned int; (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices)
	SubaddrIndices []uint `json:"subaddr_indices"`
	// priority - unsigned int; Set a priority for the transaction.
	// Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority.
	Priority Priority `json:"priority"`
	// Mixin - unsigned int; Number of outpouts from the blockchain to mix with (0 means no mixing).
	Mixin    uint64 `json:"mixin"`
	RingSize uint   `json:"ring_size"`
	// unlock_time - unsigned int; Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`
	// payment_id - string; (Optional) Random 32-byte/64-character hex string to identify a transaction.
	PaymentId string `json:"payment_id,omitempty"`
	// get_tx_key - boolean; (Optional) Return the transaction key after sending.
	GetTxKey bool `json:"get_tx_key"`
	// do_not_relay - boolean; (Optional) If true, the newly created transaction will not be relayed to the monero network. (Defaults to false)
	DoNotRelay bool `json:"do_not_relay,omitempty"`
	// get_tx_hex - boolean; Return the transaction as hex string after sending
	GetTxHex bool `json:"get_tx_hex,omitempty"`
	// get_tx_metadata - boolean; Return the metadata needed to relay the transaction. (Defaults to false)
	GetTxMetadata bool `json:"get_tx_metadata"`
}

TransferRequest is the request body of the Transfer client rpc call.

type TransferResponse

type TransferResponse struct {
	// amount - Amount transferred for the transaction.
	Amonut uint64 `json:"amonut"`
	// fee - Integer value of the fee charged for the txn.
	Fee uint64 `json:"fee"`
	//multisig_txset - Set of multisig transactions in the process of being signed (empty for non-multisig).
	MultisigTxset string `json:"multisig_txset"`
	// tx_blob - Transaction as hex string if get_tx_hex is true
	TxBlob string `json:"tx_blob,omitempty"`
	// tx_hash - String for the publically searchable transaction hash
	TxHash string `json:"tx_hash"`
	// tx_key - String for the transaction key if get_tx_key is true, otherwise, blank string.
	TxKey string `json:"tx_key,omitempty"`
	// get_tx_metadata - string; Return the metadata needed to relay the transaction. (Defaults to false)
	TxMetadata string `json:"tx_metadata"`
	// unsigned_txset - String. Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`
}

TransferResponse is the successful output of a Transfer()

type TransferSplitResponse

type TransferSplitResponse struct {
	// fee_list - array of: integer. The amount of fees paid for every transaction.
	FeeList []uint64 `json:"fee_list"`
	// tx_hash_list - array of: string. The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`
	// tx_blob_list - array of: string. The tx as hex string for every transaction.
	TxBlobList []string `json:"tx_blob_list"`
	// amount_list - array of: integer. The amount transferred for every transaction..
	AmountList []uint64 `json:"amount_list"`
	// tx_key_list - array of: string. The transaction keys for every transaction.
	TxKeyList []string `json:"tx_key_list"`
}

TransferSplitResponse is the successful output of a TransferSplit()

type URIDef

type URIDef struct {
	// address - wallet address string
	Address string `json:"address"`
	// amount (optional) - the integer amount to receive, in atomic units
	Amount uint64 `json:"amount,omitempty"`
	// payment_id (optional) - 16 or 64 character hexadecimal payment id string
	PaymentID string `json:"payment_id,omitempty"`
	// recipient_name (optional) - string name of the payment recipient
	RecipientName string `json:"recipient_name,omitempty"`
	// tx_description (optional) - string describing the reason for the tx
	TxDescription string `json:"tx_description,omitempty"`
}

URIDef is the skeleton of the MakeURI()

type WalletError

type WalletError struct {
	Code    ErrorCode `json:"code"`
	Message string    `json:"message"`
}

WalletError is the error structured returned by the monero-wallet-rpc

func GetWalletError

func GetWalletError(err error) (isWalletError bool, werr *WalletError)

GetWalletError checks if an erro interface is a wallet-rpc error.

func (*WalletError) Error

func (we *WalletError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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