rpc

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 8 Imported by: 0

README

JSON 2.0 RPC's

All Wallet RPC's

JSON 2.0

Newer Daemon RPC's

  • These daemon RPC's also use JSON 2.0

  • They use daemon_<method-name>.go file naming convention

See Also

Wallet: https://web.getmonero.org/resources/developer-guides/wallet-rpc.html

Daemon: https://web.getmonero.org/resources/developer-guides/daemon-rpc.html#json-rpc-methods

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewPaymentID256

func NewPaymentID256() string

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

func XMRToDecimal

func XMRToDecimal(xmr uint64) string

XMRToDecimal converts a raw atomic XMR balance to human readable string.

func XMRToFloat64

func XMRToFloat64(xmr uint64) float64

XMRToFloat64 converts raw atomic XMR to a float64

Types

type AccountTag

type AccountTag struct {
	// Filter tag.
	Tag string `json:"tag"`

	// Label for the tag.
	Label string `json:"label"`

	// List of tagged account indices.
	Accounts []int `json:"accounts"`
}

type AddAddressBookRequest

type AddAddressBookRequest struct {
	Address     string `json:"address"`
	PaymentId   string `json:"payment_id,omitempty"`
	Description string `json:"description,omitempty"`
}

type AddAddressBookResponse

type AddAddressBookResponse struct {
	// The index of the address book entry.
	Index uint64 `json:"index"`
}

type Address

type Address struct {
	// AddressIndex Index of the subaddress in the account.
	AddressIndex uint64 `json:"address_index"`

	// Address at this index. Base58 representation of the public keys.
	Address string `json:"address"`

	// Balance for the subaddress (locked or unlocked).
	Balance uint64 `json:"balance"`

	// UnlockedBalance Unlocked balance for the subaddress.
	UnlockedBalance uint64 `json:"unlocked_balance"`

	// Label of the subaddress.
	Label string `json:"label"`

	// Tag for filtering accounts.
	Tag string `json:"tag"`

	// NumUnspentOutputs Number of unspent outputs available for the subaddress.
	NumUnspentOutputs uint64 `json:"num_unspent_outputs"`

	// Used states if the (sub)address has already received funds.
	Used bool `json:"used"`
}

type AutoRefreshRequest

type AutoRefreshRequest struct {
	// (Optional) Enable or disable automatic refreshing (Defaults to true).
	Enable bool `json:"enable"`

	// (Optional) The period of the wallet refresh cycle (i.e. time between refreshes) in seconds.
	Period uint64 `json:"period,omitempty"`
}

type BlockHeader

type BlockHeader struct {
	BlockSize                 uint64 `json:"block_size"`
	BlockWeight               uint64 `json:"block_weight"`
	CumulativeDifficulty      uint64 `json:"cumulative_difficulty"`
	CumulativeDifficultyTop64 uint64 `json:"cumulative_difficulty_top64"`
	Depth                     uint64 `json:"depth"`
	Difficulty                uint64 `json:"difficulty"`
	DifficultyTop64           uint64 `json:"difficulty_top64"`
	Hash                      string `json:"hash"`
	Height                    uint64 `json:"height"`
	LongTermWeight            uint64 `json:"long_term_weight"`
	MajorVersion              uint64 `json:"major_version"`
	MinerTxHash               string `json:"miner_tx_hash"`
	MinorVersion              uint64 `json:"minor_version"`
	Nonce                     uint64 `json:"nonce"`
	NumTxes                   uint64 `json:"num_txes"`
	OrphanStatus              bool   `json:"orphan_status"`
	PowHash                   string `json:"pow_hash"`
	PrevHash                  string `json:"prev_hash"`
	Reward                    uint64 `json:"reward"`
	Timestamp                 uint64 `json:"timestamp"`
	WideCumulativeDifficulty  string `json:"wide_cumulative_difficulty"`
	WideDifficulty            string `json:"wide_difficulty"`
}

type ChangeWalletPasswordRequest

type ChangeWalletPasswordRequest struct {
	// (Optional) Current wallet password, if defined.
	OldPassword string `json:"old_password,omitempty"`

	// (Optional) New wallet password, if not blank.
	NewPassword string `json:"new_password,omitempty"`
}

type CheckReserveProofRequest

type CheckReserveProofRequest struct {
	// Public address of the wallet.
	Address string `json:"address"`

	// (Optional) Should be the same message used in get_reserve_proof.
	Message string `json:"message,omitempty"`

	// Reserve signature to confirm.
	Signature string `json:"signature"`
}

type CheckReserveProofResponse

type CheckReserveProofResponse struct {
	// States if the inputs proves the reserve.
	Good bool `json:"good"`
}

type CheckSpendProofRequest

type CheckSpendProofRequest struct {
	// Transaction id.
	Txid string `json:"txid"`

	// (Optional) Should be the same message used in get_spend_proof.
	Message string `json:"message,omitempty"`

	// Spend signature to confirm.
	Signature string `json:"signature"`
}

type CheckSpendProofResponse

type CheckSpendProofResponse struct {
	// States if the inputs proves the spend.
	Good bool `json:"good"`
}

type CheckTxKeyRequest

type CheckTxKeyRequest struct {
	// Transaction id.
	Txid string `json:"txid"`

	// Transaction secret key.
	TxKey string `json:"tx_key"`

	// Destination public address of the transaction.
	Address string `json:"address"`
}

type CheckTxKeyResponse

type CheckTxKeyResponse struct {
	// Number of block mined after the one with the transaction.
	Confirmations uint64 `json:"confirmations"`

	// States if the transaction is still in pool or has been added to a block.
	InPool bool `json:"in_pool"`

	// Amount of the transaction.
	Received uint64 `json:"received"`
}

type CheckTxProofRequest

type CheckTxProofRequest struct {
	// Transaction id.
	Txid string `json:"txid"`

	// Destination public address of the transaction.
	Address string `json:"address"`

	// (Optional) Should be the same message used in get_tx_proof.
	Message string `json:"message,omitempty"`

	// Transaction signature to confirm.
	Signature string `json:"signature"`
}

type CheckTxProofResponse

type CheckTxProofResponse struct {
	// Number of block mined after the one with the transaction.
	Confirmations uint64 `json:"confirmations"`

	// States if the inputs proves the transaction.
	Good bool `json:"good"`

	// States if the transaction is still in pool or has been added to a block.
	InPool bool `json:"in_pool"`

	// Amount of the transaction.
	Received uint64 `json:"received"`
}

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(ctx context.Context, req *AddAddressBookRequest) (*AddAddressBookResponse, error)

Add an entry to the address book.

func (*Client) AutoRefresh

func (c *Client) AutoRefresh(ctx context.Context, req *AutoRefreshRequest) error

Set whether and how often to automatically refresh the current wallet.

func (*Client) ChangeWalletPassword

func (c *Client) ChangeWalletPassword(ctx context.Context, req *ChangeWalletPasswordRequest) error

Change a wallet password.

func (*Client) CheckReserveProof

func (c *Client) CheckReserveProof(ctx context.Context, req *CheckReserveProofRequest) (*CheckReserveProofResponse, error)

Proves a wallet has a disposable reserve using a signature.

func (*Client) CheckSpendProof

func (c *Client) CheckSpendProof(ctx context.Context, req *CheckSpendProofRequest) (*CheckSpendProofResponse, error)

Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address.

func (*Client) CheckTxKey

func (c *Client) CheckTxKey(ctx context.Context, req *CheckTxKeyRequest) (*CheckTxKeyResponse, error)

Check a transaction in the blockchain with its secret key.

func (*Client) CheckTxProof

func (c *Client) CheckTxProof(ctx context.Context, req *CheckTxProofRequest) (*CheckTxProofResponse, error)

Prove a transaction by checking its signature.

func (*Client) CloseWallet

func (c *Client) CloseWallet(ctx context.Context) error

Close the currently opened wallet, after trying to save it.

func (*Client) CreateAccount

func (c *Client) CreateAccount(ctx context.Context, req *CreateAccountRequest) (*CreateAccountResponse, error)

Create a new account with an optional label.

func (*Client) CreateAddress

func (c *Client) CreateAddress(ctx context.Context, req *CreateAddressRequest) (*CreateAddressResponse, error)

Create a new address for an account. Optionally, label the new address.

func (*Client) CreateWallet

func (c *Client) CreateWallet(ctx context.Context, req *CreateWalletRequest) error

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

func (*Client) DaemonGetBlock

func (c *Client) DaemonGetBlock(ctx context.Context, req *DaemonGetBlockRequest) (*DaemonGetBlockResponse, error)

Return block info from the daemon given the hash

func (*Client) DaemonGetBlockCount

func (c *Client) DaemonGetBlockCount(ctx context.Context) (*DaemonGetBlockCountResponse, error)

Return the current block count known to the daemon

func (*Client) DaemonGetBlockHeaderByHash

func (c *Client) DaemonGetBlockHeaderByHash(ctx context.Context, req *DaemonGetBlockHeaderByHashRequest) (*DaemonGetBlockHeaderResponse, error)

Return block header info from the daemon given the hash

func (*Client) DaemonGetBlockHeaderByHeight

func (c *Client) DaemonGetBlockHeaderByHeight(ctx context.Context, req *DaemonGetBlockHeaderByHeightRequest) (*DaemonGetBlockHeaderResponse, error)

Return block header info from the daemon given the height

func (*Client) DaemonGetFeeEstimate

func (c *Client) DaemonGetFeeEstimate(ctx context.Context) (*DaemonGetFeeEstimateResponse, error)

Return a fee estimate from the daemon

func (*Client) DaemonGetInfo

func (c *Client) DaemonGetInfo(ctx context.Context) (*DemonGetInfoResponse, error)

Return all basic info from the daemon

func (*Client) DaemonGetLastBlockHeader

func (c *Client) DaemonGetLastBlockHeader(ctx context.Context, req *DaemonGetLastBlockHeaderRequest) (*DaemonGetBlockHeaderResponse, error)

Return latest block header info from the daemon

func (*Client) DaemonRegtestGenerate

func (c *Client) DaemonRegtestGenerate(ctx context.Context, req *DemonRegtestGenerateRequest) (*DemonRegtestGenerateResponse, error)

Mines 1 or more blocks on nettype == regtest

func (*Client) DeleteAddressBook

func (c *Client) DeleteAddressBook(ctx context.Context, req *DeleteAddressBookRequest) error

Delete an entry from the address book.

func (*Client) DescribeTransfer

func (c *Client) DescribeTransfer(ctx context.Context, req *DescribeTransferRequest) (*DescribeTransferResponse, error)

Returns details for each transaction in an unsigned or multisig transaction set.

func (*Client) Do

func (c *Client) Do(ctx context.Context, method string, in, out interface{}) error

func (*Client) EditAddressBook

func (c *Client) EditAddressBook(ctx context.Context, req *EditAddressBookRequest) error

Edit an existing address book entry.

func (*Client) ExportKeyImages

func (c *Client) ExportKeyImages(ctx context.Context, req *ExportKeyImagesRequest) (*ExportKeyImagesResponse, error)

Export a signed set of key images.

func (*Client) ExportMultisigInfo

func (c *Client) ExportMultisigInfo(ctx context.Context) (*ExportMultisigInfoResponse, error)

Export multisig info for other participants.

func (*Client) ExportOutputs

func (c *Client) ExportOutputs(ctx context.Context, req *ExportOutputsRequest) (*ExportOutputsResponse, error)

Export all outputs in hex format.

func (*Client) FinalizeMultisig

func (c *Client) FinalizeMultisig(ctx context.Context, req *FinalizeMultisigRequest) (*FinalizeMultisigResponse, error)

Turn this wallet into a multisig wallet, extra step for N-1/N wallets.

func (*Client) GenerateFromKeys

func (c *Client) GenerateFromKeys(ctx context.Context, req *GenerateFromKeysRequest) (*GenerateFromKeysResponse, error)

Restores a wallet from a given wallet address, view key, and optional spend key.

func (*Client) GetAccountTags

func (c *Client) GetAccountTags(ctx context.Context) (*GetAccountTagsResponse, error)

Get a list of user-defined account tags.

func (*Client) GetAccounts

func (c *Client) GetAccounts(ctx context.Context, req *GetAccountsRequest) (*GetAccountsResponse, error)

Get all accounts for a wallet. Optionally filter accounts by tag.

func (*Client) GetAddress

func (c *Client) GetAddress(ctx context.Context, req *GetAddressRequest) (*GetAddressResponse, error)

Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses.

func (*Client) GetAddressBook

func (c *Client) GetAddressBook(ctx context.Context, req *GetAddressBookRequest) (*GetAddressBookResponse, error)

Retrieves entries from the address book.

func (*Client) GetAddressIndex

func (c *Client) GetAddressIndex(ctx context.Context, req *GetAddressIndexRequest) (*GetAddressIndexResponse, error)

Get account and address indexes from a specific (sub)address.

func (*Client) GetAttribute

func (c *Client) GetAttribute(ctx context.Context, req *GetAttributeRequest) (*GetAttributeResponse, error)

Get attribute value by name.

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, req *GetBalanceRequest) (*GetBalanceResponse, error)

Return the wallet's balance.

func (*Client) GetBulkPayments

func (c *Client) GetBulkPayments(ctx context.Context, req *GetBulkPaymentsRequest) (*GetBulkPaymentsResponse, error)

Get 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.

func (*Client) GetHeight

func (c *Client) GetHeight(ctx context.Context) (*GetHeightResponse, error)

Returns the wallet's current block height.

func (*Client) GetLanguages

func (c *Client) GetLanguages(ctx context.Context) (*GetLanguagesResponse, error)

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

func (*Client) GetPayments

func (c *Client) GetPayments(ctx context.Context, req *GetPaymentsRequest) (*GetPaymentsResponse, error)

Get a list of incoming payments using a given payment id.

func (*Client) GetReserveProof

func (c *Client) GetReserveProof(ctx context.Context, req *GetReserveProofRequest) (*GetReserveProofResponse, error)

Generate a signature to prove of an available amount in a wallet.

func (*Client) GetSpendProof

func (c *Client) GetSpendProof(ctx context.Context, req *GetSpendProofRequest) (*GetSpendProofResponse, error)

Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address.

func (*Client) GetTransferByTxid

func (c *Client) GetTransferByTxid(ctx context.Context, req *GetTransferByTxidRequest) (*GetTransferByTxidResponse, error)

Show information about a transfer to/from this address.

func (*Client) GetTransfers

func (c *Client) GetTransfers(ctx context.Context, req *GetTransfersRequest) (*GetTransfersResponse, error)

Returns a list of transfers.

func (*Client) GetTxKey

func (c *Client) GetTxKey(ctx context.Context, req *GetTxKeyRequest) (*GetTxKeyResponse, error)

Get transaction secret key from transaction id.

func (*Client) GetTxNotes

func (c *Client) GetTxNotes(ctx context.Context, req *GetTxNotesRequest) (*GetTxNotesResponse, error)

Get string notes for transactions.

func (*Client) GetTxProof

func (c *Client) GetTxProof(ctx context.Context, req *GetTxProofRequest) (*GetTxProofResponse, error)

Get transaction signature to prove it.

func (*Client) GetVersion

func (c *Client) GetVersion(ctx context.Context) (*GetVersionResponse, error)

Get RPC version Major & Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits.

func (*Client) ImportKeyImages

func (c *Client) ImportKeyImages(ctx context.Context, req *ImportKeyImagesRequest) (*ImportKeyImagesResponse, error)

Import signed key images list and verify their spent status.

func (*Client) ImportMultisigInfo

func (c *Client) ImportMultisigInfo(ctx context.Context, req *ImportMultisigInfoRequest) (*ImportMultisigInfoResponse, error)

Import multisig info from other participants.

func (*Client) ImportOutputs

func (c *Client) ImportOutputs(ctx context.Context, req *ImportOutputsRequest) (*ImportOutputsResponse, error)

Import outputs in hex format.

func (*Client) IncomingTransfers

func (c *Client) IncomingTransfers(ctx context.Context, req *IncomingTransfersRequest) (*IncomingTransfersResponse, error)

Return a list of incoming transfers to the wallet.

func (*Client) IsMultisig

func (c *Client) IsMultisig(ctx context.Context) (*IsMultisigResponse, error)

Check if a wallet is a multisig one.

func (*Client) LabelAccount

func (c *Client) LabelAccount(ctx context.Context, req *LabelAccountRequest) error

Label an account.

func (*Client) LabelAddress

func (c *Client) LabelAddress(ctx context.Context, req *LabelAddressRequest) error

Label an address.

func (*Client) MakeIntegratedAddress

Make an integrated address from the wallet address and a payment id.

func (*Client) MakeMultisig

func (c *Client) MakeMultisig(ctx context.Context, req *MakeMultisigRequest) (*MakeMultisigResponse, error)

Make a wallet multisig by importing peers multisig string.

func (*Client) MakeUri

func (c *Client) MakeUri(ctx context.Context, req *MakeUriRequest) (*MakeUriResponse, error)

Create a payment URI using the official URI spec.

func (*Client) OpenWallet

func (c *Client) OpenWallet(ctx context.Context, req *OpenWalletRequest) error

Open 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(ctx context.Context, req *ParseUriRequest) (*ParseUriResponse, error)

Parse a payment URI to get payment information.

func (*Client) PrepareMultisig

func (c *Client) PrepareMultisig(ctx context.Context) (*PrepareMultisigResponse, error)

Prepare a wallet for multisig by generating a multisig string to share with peers.

func (*Client) QueryKey

func (c *Client) QueryKey(ctx context.Context, req *QueryKeyRequest) (*QueryKeyResponse, error)

Return the spend or view private key.

func (*Client) Refresh

func (c *Client) Refresh(ctx context.Context, req *RefreshRequest) (*RefreshResponse, error)

Refresh a wallet after opening.

func (*Client) RelayTx

func (c *Client) RelayTx(ctx context.Context, req *RelayTxRequest) (*RelayTxResponse, error)

Relay a transaction previously created with "do_not_relay":true.

func (*Client) RescanBlockchain

func (c *Client) RescanBlockchain(ctx context.Context) error

Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself.

func (*Client) RescanSpent

func (c *Client) RescanSpent(ctx context.Context) error

Rescan the blockchain for spent outputs.

func (*Client) RestoreDeterministicWallet

Create and open a wallet on the RPC server from an existing mnemonic phrase and close the currently open wallet.

func (*Client) SetAccountTagDescription

func (c *Client) SetAccountTagDescription(ctx context.Context, req *SetAccountTagDescriptionRequest) error

Set description for an account tag.

func (*Client) SetAttribute

func (c *Client) SetAttribute(ctx context.Context, req *SetAttributeRequest) error

Set arbitrary attribute.

func (*Client) SetDaemon

func (c *Client) SetDaemon(ctx context.Context, req *SetDaemonRequest) error

Connect the RPC server to a Monero daemon.

func (*Client) SetTxNotes

func (c *Client) SetTxNotes(ctx context.Context, req *SetTxNotesRequest) error

Set arbitrary string notes for transactions.

func (*Client) Sign

func (c *Client) Sign(ctx context.Context, req *SignRequest) (*SignResponse, error)

Sign a string.

func (*Client) SignMultisig

func (c *Client) SignMultisig(ctx context.Context, req *SignMultisigRequest) (*SignMultisigResponse, error)

Sign a transaction in multisig.

func (*Client) SignTransfer

func (c *Client) SignTransfer(ctx context.Context, req *SignTransferRequest) (*SignTransferResponse, error)

Sign a transaction created on a read-only wallet (in cold-signing process)

func (*Client) SplitIntegratedAddress

Retrieve the standard address and payment id corresponding to an integrated address.

func (*Client) StartMining

func (c *Client) StartMining(ctx context.Context, req *StartMiningRequest) error

Start mining in the Monero daemon.

func (*Client) StopMining

func (c *Client) StopMining(ctx context.Context) error

Stop mining in the Monero daemon.

func (*Client) StopWallet

func (c *Client) StopWallet(ctx context.Context) error

Stops the wallet, storing the current state.

func (*Client) Store

func (c *Client) Store(ctx context.Context) error

Save the wallet file.

func (*Client) SubmitMultisig

func (c *Client) SubmitMultisig(ctx context.Context, req *SubmitMultisigRequest) (*SubmitMultisigResponse, error)

Submit a signed multisig transaction.

func (*Client) SubmitTransfer

func (c *Client) SubmitTransfer(ctx context.Context, req *SubmitTransferRequest) (*SubmitTransferResponse, error)

Submit a previously signed transaction on a read-only wallet (in cold-signing process).

func (*Client) SweepAll

func (c *Client) SweepAll(ctx context.Context, req *SweepAllRequest) (*SweepAllResponse, error)

Send all unlocked balance to an address.

func (*Client) SweepDust

func (c *Client) SweepDust(ctx context.Context, req *SweepDustRequest) (*SweepDustResponse, error)

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

func (*Client) SweepSingle

func (c *Client) SweepSingle(ctx context.Context, req *SweepSingleRequest) (*SweepSingleResponse, error)

Send all of a specific unlocked output to an address.

func (*Client) TagAccounts

func (c *Client) TagAccounts(ctx context.Context, req *TagAccountsRequest) error

Apply a filtering tag to a list of accounts.

func (*Client) Transfer

func (c *Client) Transfer(ctx context.Context, req *TransferRequest) (*TransferResponse, error)

Send monero to a number of recipients.

func (*Client) TransferSplit

func (c *Client) TransferSplit(ctx context.Context, req *TransferSplitRequest) (*TransferSplitResponse, error)

Same as transfer, but can split into more than one tx if necessary.

func (*Client) UntagAccounts

func (c *Client) UntagAccounts(ctx context.Context, req *UntagAccountsRequest) error

Remove filtering tag from a list of accounts.

func (*Client) ValidateAddress

func (c *Client) ValidateAddress(ctx context.Context, req *ValidateAddressRequest) (*ValidateAddressResponse, error)

Analyzes a string to determine whether it is a valid monero wallet address and returns the result and the address specifications.

func (*Client) Verify

func (c *Client) Verify(ctx context.Context, req *VerifyRequest) (*VerifyResponse, error)

Verify a signature on a string.

type Config

type Config struct {
	Address       string
	CustomHeaders map[string]string
	Client        *http.Client
}

Config holds the configuration of a monero rpc client.

type CreateAccountRequest

type CreateAccountRequest struct {
	// (Optional) Label for the account.
	Label string `json:"label,omitempty"`
}

type CreateAccountResponse

type CreateAccountResponse struct {
	// Index of the new account.
	AccountIndex uint64 `json:"account_index"`

	// Address for this account. Base58 representation of the public keys.
	Address string `json:"address"`
}

type CreateAddressRequest

type CreateAddressRequest struct {
	// Create a new address for this account.
	AccountIndex uint64 `json:"account_index"`

	// (Optional) Label for the new address.
	Label string `json:"label,omitempty"`

	// (Optional) Number of addresses to create (Defaults to 1).
	Count uint64 `json:"count"`
}

type CreateAddressResponse

type CreateAddressResponse struct {
	// Newly created address. Base58 representation of the public keys.
	Address string `json:"address"`

	// Index of the new address under the input account.
	AddressIndex uint64 `json:"address_index"`

	// List of (count) address indeces
	AddressIndeces []uint64 `json:"address_indices"`

	// List of (count) addresses
	Addresses []string `json:"addresses"`
}

type CreateWalletRequest

type CreateWalletRequest struct {
	// Wallet file name.
	Filename string `json:"filename"`

	// (Optional) password to protect the wallet.
	Password string `json:"password,omitempty"`

	// Language for your wallets' seed.
	Language string `json:"language"`
}

type DaemonGetBlockCountResponse

type DaemonGetBlockCountResponse struct {
	Count     uint64 `json:"count"` // the number of blocks not the zero based height
	Status    string `json:"status"`
	Untrusted bool   `json:"untrusted"`
}

type DaemonGetBlockHeaderByHashRequest

type DaemonGetBlockHeaderByHashRequest struct {
	// The block's sha256 hash.
	Hash string `json:"hash"`
	// Optional; defaults to false. Add PoW hash to block_header response.
	FillPowHash bool `json:"fill_pow_hash"`
}

type DaemonGetBlockHeaderByHeightRequest

type DaemonGetBlockHeaderByHeightRequest struct {
	// The block's height.
	Height uint64 `json:"height"`
	// Optional; defaults to false. Add PoW hash to block_header response.
	FillPowHash bool `json:"fill_pow_hash"`
}

type DaemonGetBlockHeaderResponse

type DaemonGetBlockHeaderResponse struct {
	BlockHeader BlockHeader `json:"block_header"`
	Credits     uint64      `json:"credits"`
	Status      string      `json:"status"`
	TopHash     string      `json:"top_hash"`
	Untrusted   bool        `json:"untrusted"`
}

type DaemonGetBlockRequest

type DaemonGetBlockRequest struct {
	// The block's height.
	Height uint64 `json:"height"`
	// The block's sha256 hash.
	Hash string `json:"hash"`
	// Optional; defaults to false. Add PoW hash to block_header response.
	FillPowHash bool `json:"fill_pow_hash"`
}

Inputs (pick height or hash):

type DaemonGetBlockResponse

type DaemonGetBlockResponse struct {
	Blob        string      `json:"blob"`
	BlockHeader BlockHeader `json:"block_header"`
	Credits     uint64      `json:"credits"`
	Json        string      `json:"json"`          // json formatted details
	MinerTxHash string      `json:"miner_tx_hash"` // coinbase tx
	Status      string      `json:"status"`
	TopHash     string      `json:"top_hash"`
	TxHashes    []string    `json:"tx_hashes"` // non-coinbase txs
	Untrusted   bool        `json:"untrusted"`
}

type DaemonGetFeeEstimateResponse

type DaemonGetFeeEstimateResponse struct {
	Credits          uint64   `json:"credits"`
	Fee              uint64   `json:"fee"`               // atomic units / byte
	Fees             []uint64 `json:"fees"`              // base fees at different priotities: slow, normal, fast, fastest
	QuantizationMask uint64   `json:"quantization_mask"` // Final fee should be rounded up to an even multiple of this value
	Status           string   `json:"status"`
	TopHash          string   `json:"top_hash"`
	Untrusted        bool     `json:"untrusted"`
}

type DaemonGetLastBlockHeaderRequest

type DaemonGetLastBlockHeaderRequest struct {
	// Optional; defaults to false. Add PoW hash to block_header response.
	FillPowHash bool `json:"fill_pow_hash"`
}

type DeleteAddressBookRequest

type DeleteAddressBookRequest struct {
	// The index of the address book entry.
	Index uint64 `json:"index"`
}

type DemonGetInfoResponse

type DemonGetInfoResponse struct {
	Status                      string `json:"status"`
	AdjustedTime                uint64 `json:"adjusted_time"`
	AltBlocksCount              uint64 `json:"alt_blocks_count"`
	BlockweightLimit            uint64 `json:"block_weight_limit"`
	BlockWeightMedian           uint64 `json:"block_weight_median"`
	BootstrapDaemonAddress      string `json:"bootstrap_daemon_address"`
	BusySyncing                 bool   `json:"busy_syncing"`
	Credits                     uint64 `json:"credits"`
	CumulaticeDifficulty        uint64 `json:"cumulative_difficulty"`
	CumulaticeDifficultyTop64   uint64 `json:"cumulative_difficulty_top64"`
	DatabasSize                 uint64 `json:"database_size"`
	Difficulty                  uint64 `json:"difficulty"`
	DifficultyTop64             uint64 `json:"difficulty_top64"`
	FreeSpace                   uint64 `json:"free_space"`
	GreyPeerlistSize            uint64 `json:"grey_peerlist_size"`
	Height                      uint64 `json:"height"`
	HeightWithoutBootstrap      uint64 `json:"height_without_bootstrap"`
	IncomingConnectionsCount    uint64 `json:"incoming_connections_count"`
	Mainnet                     bool   `json:"mainnet"`
	NetType                     string `json:"nettype"`
	Offline                     bool   `json:"offline"`
	OutgoingConnectionsCount    uint64 `json:"outgoing_connections_count"`
	Restricted                  bool   `json:"restricted"`
	RpcConnectionsCount         uint64 `json:"rpc_connections_count"`
	Stagenet                    bool   `json:"stagenet"`
	StartTime                   uint64 `json:"start_time"`
	Sychronized                 bool   `json:"synchronized"`
	Target                      uint64 `json:"target"`
	TargetHeight                uint64 `json:"target_height"`
	Testnet                     bool   `json:"testnet"`
	TopBlockHash                string `json:"top_block_hash"`
	TopHash                     string `json:"top_hash"`
	TxCount                     uint64 `json:"tx_count"`
	TxPoolSize                  uint64 `json:"tx_pool_size"`
	Untrusted                   bool   `json:"untrusted"`
	UpdateAvailable             bool   `json:"update_available"`
	Version                     string `json:"version"`
	WasBootstrapEverUsed        bool   `json:"was_bootstrap_ever_used"`
	WhitePeerlistSize           uint64 `json:"white_peerlist_size"`
	WideCumulativeDifficultyHex string `json:"wide_cumulative_difficulty"`
	WideDifficultyHex           string `json:"wide_difficulty"`
}

type DemonRegtestGenerateRequest

type DemonRegtestGenerateRequest struct {
	AmountOfBlocks uint64 `json:"amount_of_blocks"`     // We will default to 1 here
	WalletAddress  string `json:"wallet_address"`       // Address to mine to - a wallet Primary address Account 0 Sub [0]
	PrevBlock      string `json:"prev_block,omitempty"` // I think is an old param - not sure what is for
	StartingNonce  uint64 `json:"starting_nonce"`       // Defaults to 0 here if not specified
}

type DemonRegtestGenerateResponse

type DemonRegtestGenerateResponse struct {
	Status    string   `json:"status"`
	Blocks    []string `json:"blocks"`
	Height    uint64   `json:"height"`
	Untrusted bool     `json:"untrusted"`
}

type DescribeTransferRequest

type DescribeTransferRequest struct {
	// (Optional) A hexadecimal string representing a set of unsigned transactions (empty for multisig transactions; non-multisig signed transactions are not supported).
	UnsignedTxset string `json:"unsigned_txset,omitempty"`

	// (Optional) A hexadecimal string representing the set of signing keys used in a multisig transaction (empty for unsigned transactions; non-multisig signed transactions are not supported).
	MultisigTxset string `json:"multisig_txset,omitempty"`
}

type DescribeTransferResponse

type DescribeTransferResponse struct {
	// The description of the transfer as a list:
	Desc []Description `json:"desc"`
}

type Description

type Description struct {
	// The sum of the inputs spent by the transaction in atomic units.
	AmountIn uint64 `json:"amount_in"`

	// The sum of the outputs created by the transaction in atomic units.
	AmountOut uint64 `json:"amount_out"`

	// List of recipients:
	Recipients []Destination `json:"recipients"`

	// The public address of the recipient.
	Address string `json:"address"`

	// The amount sent to the recipient in atomic units.
	Amount uint64 `json:"amount"`

	// The address of the change recipient.
	ChangeAddress string `json:"change_address"`

	// The amount sent to the change address in atomic units.
	ChangeAmount uint64 `json:"change_amount"`

	// The fee charged for the transaction in atomic units.
	Fee uint64 `json:"fee"`

	// Payment ID for this transfer (empty if not provided.
	PaymentId string `json:"payment_id"`

	// The number of inputs in the ring (1 real output + the number of decoys from the blockchain).
	RingSize uint64 `json:"ring_size"`

	// The number of blocks before the monero can be spent (0 for no lock).
	UnlockTime uint64 `json:"unlock_time"`

	// The number of fake outputs added to single-output transactions. Fake outputs have 0 amount and are sent to a random address.
	DummyOutputs uint64 `json:"dummy_outputs"`

	// Arbitrary transaction data in hexadecimal format.
	Extra string `json:"extra"`
}

type Destination

type Destination struct {
	// Amount to send to each destination, in atomic units.
	Amount uint64 `json:"amount"`

	// Destination public address.
	Address string `json:"address"`
}

type EditAddressBookRequest

type EditAddressBookRequest struct {
	// Index of the address book entry to edit.
	Index uint64 `json:"index"`

	// If true, set the address for this entry to the value of "address".
	SetAddress bool `json:"set_address"`

	// (Optional) The 95-character public address to set.
	Address string `json:"address,omitempty"`

	// If true, set the description for this entry to the value of "description".
	SetDescription bool `json:"set_description"`

	// (Optional) Human-readable description for this entry.
	Description string `json:"description,omitempty"`

	// If true, set the payment ID for this entry to the value of "payment_id".
	SetPaymentId bool `json:"set_payment_id"`

	// (Optional) Payment ID for this address.
	PaymentId string `json:"payment_id,omitempty"`
}

type Entry

type Entry struct {
	// Public address of the entry.
	Address string `json:"address"`

	// Description of this address entry.
	Description string `json:"description"`

	Index uint64 `json:"index"`
}

type ErrorCode

type ErrorCode int

TODO: review latest monero code, and get daemon rpc messages also

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 ExportKeyImagesRequest

type ExportKeyImagesRequest struct {
	// (Optional) If true, export all key images. Otherwise, export key images since the last export. (default = false)
	All bool `json:"all,omitempty"`
}

type ExportKeyImagesResponse

type ExportKeyImagesResponse struct {
	// Array of signed key images:
	SignedKeyImages []SignedKeyImage `json:"signed_key_images"`
}

type ExportMultisigInfoResponse

type ExportMultisigInfoResponse struct {
	// Multisig info in hex format for other participants.
	Info string `json:"info"`
}

type ExportOutputsRequest

type ExportOutputsRequest struct {
	// (Optional) If true, export all outputs. Otherwise, export outputs since the last export. (Defaults to false)
	All bool `json:"all,omitempty"`
}

type ExportOutputsResponse

type ExportOutputsResponse struct {
	// Wallet outputs in hex format.
	OutputsDataHex string `json:"outputs_data_hex"`
}

type FinalizeMultisigRequest

type FinalizeMultisigRequest struct {
	// List of multisig string from peers.
	MultisigInfo []string `json:"multisig_info"`

	// Wallet password
	Password string `json:"password"`
}

type FinalizeMultisigResponse

type FinalizeMultisigResponse struct {
	// Multisig wallet address.
	Address string `json:"address"`
}

type GenerateFromKeysRequest

type GenerateFromKeysRequest struct {
	// (Optional) The block height to restore the wallet from. (Defaults to 0)
	RestoreHeight uint64 `json:"restore_height,omitempty"`

	// The wallet's file name on the RPC server.
	Filename string `json:"filename"`

	// The wallet's primary address.
	Address string `json:"address"`

	// (Optional) The wallet's private spend key. (Omit to create a view-only wallet)
	SpendKey string `json:"spendkey,omitempty"`

	// The wallet's private view key.
	ViewKey string `json:"viewkey"`

	// The wallet's password.
	Password string `json:"password"`

	// If true, save the current wallet before generating the new wallet. (Defaults to true)
	AutosaveCurrent bool `json:"autosave_current"`
}

type GenerateFromKeysResponse

type GenerateFromKeysResponse struct {
	// The wallet's address.
	Address string `json:"address"`

	// Verification message indicating that the wallet was generated successfully and whether or not it is a view-only wallet.
	Info string `json:"info"`
}

type GetAccountTagsResponse

type GetAccountTagsResponse struct {
	// Array of account tag information:
	AccountTags []AccountTag `json:"account_tags"`
}

type GetAccountsRequest

type GetAccountsRequest struct {
	// (Optional) Tag for filtering accounts.
	Tag string `json:"tag,omitempty"`
}

type GetAccountsResponse

type GetAccountsResponse struct {
	// Array of subaddress account information.
	SubaddressAccounts []Address `json:"subaddress_accounts"`

	// Total balance of the selected accounts (locked or unlocked).
	TotalBalance uint64 `json:"total_balance"`

	// Total unlocked balance of the selected accounts.
	TotalUnlockedBalance uint64 `json:"total_unlocked_balance"`
}

type GetAddressBookRequest

type GetAddressBookRequest struct {
	// Indices of the requested address book entries.
	Entries []uint64 `json:"entries"`
}

type GetAddressBookResponse

type GetAddressBookResponse struct {
	// Array of entries.
	Entries []Entry `json:"entries"`
}

type GetAddressIndexRequest

type GetAddressIndexRequest struct {
	// (sub)address to look for.
	Address string `json:"address"`
}

type GetAddressIndexResponse

type GetAddressIndexResponse struct {
	// Subaddress information.
	Index SubaddressIndex `json:"index"`
}

type GetAddressRequest

type GetAddressRequest struct {
	//  Return subaddresses for this account.
	AccountIndex uint64 `json:"account_index"`

	// (Optional) List of subaddresses to return from an account.
	AddressIndex []uint64 `json:"address_index,omitempty"`
}

type GetAddressResponse

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

	// Addresses
	Addresses []Address `json:"addresses"`
}

type GetAttributeRequest

type GetAttributeRequest struct {
	// Attribute name
	Key string `json:"key"`
}

type GetAttributeResponse

type GetAttributeResponse struct {
	// Attribute value
	Value string `json:"value"`
}

type GetBalanceRequest

type GetBalanceRequest struct {
	// Return balance for this account.
	AccountIndex uint64 `json:"account_index"`

	// (Optional) Return balance detail for those subaddresses.
	AddressIndices []uint64 `json:"address_indices,omitempty"`
}

type GetBalanceResponse

type GetBalanceResponse struct {
	// The total balance of the current monero-wallet-rpc in session.
	Balance uint64 `json:"balance"`

	// Unlocked funds are those funds that are sufficiently deep enough in the Monero blockchain to be considered safe to spend.
	UnlockedBalance uint64 `json:"unlocked_balance"`

	// True if importing multisig data is needed for returning a correct balance.
	MultisigImportNeeded bool `json:"multisig_import_needed"`

	// Balance information for each subaddress in an account.
	PerSubaddress []Address `json:"per_subaddress"`
}

type GetBulkPaymentsRequest

type GetBulkPaymentsRequest struct {
	// Payment IDs used to find the payments (16 characters hex).
	PaymentIds []string `json:"payment_ids,omitempty"`

	// The block height at which to start looking for payments.
	MinBlockHeight uint64 `json:"min_block_height,omitempty"`
}

type GetBulkPaymentsResponse

type GetBulkPaymentsResponse struct {
	// List of payments:
	Payments []Payment `json:"payments"`
}

type GetHeightResponse

type GetHeightResponse struct {
	// 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.
	Height uint64 `json:"height"`
}

type GetLanguagesResponse

type GetLanguagesResponse struct {
	// List of available languages
	Languages []string `json:"languages"`
}

type GetPaymentsRequest

type GetPaymentsRequest struct {
	// Payment ID used to find the payments (16 characters hex).
	PaymentId string `json:"payment_id"`
}

type GetPaymentsResponse

type GetPaymentsResponse struct {
	// List of payments
	Payments []Payment `json:"payments"`
}

type GetReserveProofRequest

type GetReserveProofRequest struct {
	// Proves all wallet balance to be disposable.
	All bool `json:"all"`

	// Specify the account from witch to prove reserve. (ignored if all is set to true)
	AccountIndex uint64 `json:"account_index"`

	// Amount (in atomic units) to prove the account has for reserve. (ignored if all is set to true)
	Amount uint64 `json:"amount"`

	// (Optional) Add a message to the signature to further authenticate the prooving process.
	Message string `json:"message,omitempty"`
}

type GetReserveProofResponse

type GetReserveProofResponse struct {
	// Reserve signature.
	Signature string `json:"signature"`
}

type GetSpendProofRequest

type GetSpendProofRequest struct {
	// Transaction id.
	Txid string `json:"txid"`

	// (Optional) Add a message to the signature to further authenticate the prooving process.
	Message string `json:"message,omitempty"`
}

type GetSpendProofResponse

type GetSpendProofResponse struct {
	// Spend signature.
	Signature string `json:"signature"`
}

type GetTransferByTxidRequest

type GetTransferByTxidRequest struct {
	// Transaction ID used to find the transfer.
	Txid string `json:"txid"`

	// (Optional) Index of the account to query for the transfer.
	AccountIndex uint64 `json:"account_index,omitempty"`
}

type GetTransferByTxidResponse

type GetTransferByTxidResponse struct {
	// Transfer containing payment information:
	Transfer TransferByTxid `json:"transfer"`
}

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 {
	// Include incoming transfers. (Defaults to false)
	In bool `json:"in,omitempty"`

	// Include outgoing transfers. (Defaults to false)
	Out bool `json:"out,omitempty"`

	// Include pending transfers. (Defaults to false).
	Pending bool `json:"pending,omitempty"`

	// Include failed transfers. (Defaults to false)
	Failed bool `json:"failed,omitempty"`

	// Include transfers from the daemon's transaction pool. (Defaults to false)
	Pool bool `json:"pool,omitempty"`

	// (Optional) Filter transfers by block height.
	FilterByHeight bool `json:"filter_by_height,omitempty"`

	// (Optional) Minimum block height to scan for transfers, if filtering by height is enabled.
	MinHeight uint64 `json:"min_height,omitempty"`

	// (Optional) Maximum block height to scan for transfers, if filtering by height is enabled (Defaults to max block height).
	MaxHeight uint64 `json:"max_height,omitempty"`

	// (Optional) Index of the account to query for transfers. (Defaults to 0)
	AccountIndex uint64 `json:"account_index,omitempty"`

	// (Optional) List of subaddress indices to query for transfers. (Defaults to empty - all indices)
	SubaddrIndices []uint64 `json:"subaddr_indices,omitempty"`
}

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"`
}

type GetTxKeyRequest

type GetTxKeyRequest struct {
	// Transaction id.
	Txid string `json:"txid"`
}

type GetTxKeyResponse

type GetTxKeyResponse struct {
	// Transaction secret key.
	TxKey string `json:"tx_key"`
}

type GetTxNotesRequest

type GetTxNotesRequest struct {
	// Transaction ids
	Txids []string `json:"txids"`
}

type GetTxNotesResponse

type GetTxNotesResponse struct {
	// Notes for the transactions
	Notes []string `json:"notes"`
}

type GetTxProofRequest

type GetTxProofRequest struct {
	// Transaction id.
	Txid string `json:"txid"`

	// Destination public address of the transaction.
	Address string `json:"address"`

	// (Optional) add a message to the signature to further authenticate the proving process.
	Message string `json:"message,omitempty"`
}

type GetTxProofResponse

type GetTxProofResponse struct {
	// Transaction signature.
	Signature string `json:"signature"`
}

type GetVersionResponse

type GetVersionResponse struct {
	// RPC version, formatted with Major * 2^16 + Minor (Major encoded over the first 16 bits, and Minor over the last 16 bits).
	Version uint64 `json:"version"`
}

type H

type H map[string]interface{}

H is a helper map shortcut.

type ImportKeyImagesRequest

type ImportKeyImagesRequest struct {
	// Array of signed key images.
	SignedKeyImages []SignedKeyImage `json:"signed_key_images"`
}

type ImportKeyImagesResponse

type ImportKeyImagesResponse struct {
	Height uint64 `json:"height"`

	// Amount (in atomic units) spent from those key images.
	Spent uint64 `json:"spent"`

	// Amount (in atomic units) still available from those key images.
	Unspent uint64 `json:"unspent"`
}

type ImportMultisigInfoRequest

type ImportMultisigInfoRequest struct {
	// List of multisig info in hex format from other participants.
	Info []string `json:"info"`
}

type ImportMultisigInfoResponse

type ImportMultisigInfoResponse struct {
	// Number of outputs signed with those multisig info.
	NOutputs uint64 `json:"n_outputs"`
}

type ImportOutputsRequest

type ImportOutputsRequest struct {
	// Wallet outputs in hex format.
	OutputsDataHex int64 `json:"outputs_data_hex"`
}

type ImportOutputsResponse

type ImportOutputsResponse struct {
	// Number of outputs imported.
	NumImported uint64 `json:"num_imported"`
}

type IncomingTransfer

type IncomingTransfer struct {
	// Amount of this transfer.
	Amount uint64 `json:"amount"`

	// Mostly internal use, can be ignored by most users.
	GlobalIndex uint64 `json:"global_index"`

	// Key image for the incoming transfer's unspent output (empty unless verbose is true).
	KeyImage string `json:"key_image"`

	// Indicates if this transfer has been spent.
	Spent bool `json:"spent"`

	// Subaddress index for incoming transfer.
	SubaddrIndex SubaddressIndex `json:"subaddr_index"`

	// Several incoming transfers may share the same hash if they were in the same transaction.
	TxHash string `json:"tx_hash"`

	// Size of transaction in bytes.
	TxSize uint64 `json:"tx_size"`
}

type IncomingTransfersRequest

type IncomingTransfersRequest struct {
	// "all": all the transfers, "available": only transfers which are not yet spent, OR "unavailable": only transfers which are already spent.
	TransferType string `json:"transfer_type"`

	// (Optional) Return transfers for this account. (defaults to 0)
	AccountIndex uint64 `json:"account_index,omitempty"`

	// (Optional) Return transfers sent to these subaddresses.
	SubaddrIndices []uint64 `json:"subaddr_indices,omitempty"`
}

type IncomingTransfersResponse

type IncomingTransfersResponse struct {
	Transfers []IncomingTransfer `json:"transfers"`
}

type IsMultisigResponse

type IsMultisigResponse struct {
	// States if the wallet is multisig
	Multisig bool `json:"multisig"`

	// Amount of signature needed to sign a transfer.
	Threshold uint64 `json:"threshold"`

	// Total amount of signature in the multisig wallet.
	Total uint64 `json:"total"`
}

type KeyImages

type KeyImages struct {
	KeyImages []string `json:"key_images"`
}

type LabelAccountRequest

type LabelAccountRequest struct {
	// Apply label to account at this index.
	AccountIndex uint64 `json:"account_index"`

	// Label for the account.
	Label string `json:"label"`
}

type LabelAddressRequest

type LabelAddressRequest struct {
	// Struct containing the major & minor address index.
	Index SubaddressIndex `json:"index"`

	// Label for the address.
	Label string `json:"label"`
}

type MakeIntegratedAddressRequest

type MakeIntegratedAddressRequest struct {
	// (Optional) Destination public address. (Defaults to primary address)
	StandardAddress string `json:"standard_address,omitempty"`

	// (Optional) 16 characters hex encoded. (Defaults to a random ID)
	PaymentId string `json:"payment_id,omitempty"`
}

type MakeIntegratedAddressResponse

type MakeIntegratedAddressResponse struct {
	// Hex encoded payment id.
	PaymentId string `json:"payment_id"`

	// Integrated address.
	IntegratedAddress string `json:"integrated_address"`
}

type MakeMultisigRequest

type MakeMultisigRequest struct {
	// List of multisig string from peers.
	MultisigInfo []string `json:"multisig_info"`

	// Amount of signatures needed to sign a transfer. Must be less or equal than the amount of signature in multisig_info.
	Threshold uint64 `json:"threshold"`

	// Wallet password
	Password string `json:"password"`
}

type MakeMultisigResponse

type MakeMultisigResponse struct {
	// Multisig wallet address.
	Address string `json:"address"`

	// Multisig string to share with peers to create the multisig wallet (extra step for N-1/N wallets).
	MultisigInfo string `json:"multisig_info"`
}

type MakeUriRequest

type MakeUriRequest struct {
	// Wallet address.
	Address string `json:"address"`

	// (Optional) The integer amount to receive, in atomic units.
	Amount uint64 `json:"amount,omitempty"`

	// (Optional) 16 or 64 character hexadecimal payment id.
	PaymentId string `json:"payment_id,omitempty"`

	// (Optional) Name of the payment recipient.
	RecipientName string `json:"recipient_name,omitempty"`

	// (Optional) Description of the reason for the tx.
	TxDescription string `json:"tx_description,omitempty"`
}

type MakeUriResponse

type MakeUriResponse struct {
	// This contains all the payment input information as a properly formatted payment URI.
	Uri string `json:"uri"`
}

type OpenWalletRequest

type OpenWalletRequest struct {
	// Wallet name stored in –wallet-dir.
	Filename string `json:"filename"`

	// (Optional) Only needed if the wallet has a password defined.
	Password string `json:"password,omitempty"`
}

type ParseUriRequest

type ParseUriRequest struct {
	// This contains all the payment input information as a properly formatted payment URI.
	Uri string `json:"uri"`
}

type ParseUriResponse

type ParseUriResponse struct {
	// Uri containing payment information.
	Uri UriPaymentInfo `json:"uri"`
}

type Payment

type Payment struct {
	// Payment ID matching the input parameter.
	PaymentId string `json:"payment_id"`

	// Transaction hash used as the transaction ID.
	TxHash string `json:"tx_hash"`

	// Amount for this payment.
	Amount uint64 `json:"amount"`

	// Height of the block that first confirmed this payment.
	BlockHeight uint64 `json:"block_height"`

	// Time (in block height) until this payment is safe to spend.
	UnlockTime uint64 `json:"unlock_time"`

	// SubaddrIndex index:
	SubaddrIndex SubaddressIndex `json:"subaddr_index"`

	// Account index for the subaddress.
	Major uint64 `json:"major"`

	// Index of the subaddress in the account.
	Minor uint64 `json:"minor"`

	// Address receiving the payment; Base58 representation of the public keys.
	Address string `json:"address"`
}

type PrepareMultisigResponse

type PrepareMultisigResponse struct {
	// Multisig string to share with peers to create the multisig wallet.
	MultisigInfo string `json:"multisig_info"`
}

type Priority

type Priority uint64

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 QueryKeyRequest

type QueryKeyRequest struct {
	// Which key to retrieve: "mnemonic" - the mnemonic seed (older wallets Do not have one) OR "view_key" - the view key
	KeyType string `json:"key_type"`
}

type QueryKeyResponse

type QueryKeyResponse struct {
	// The view key will be hex encoded, while the mnemonic will be a string of words.
	Key string `json:"key"`
}

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 RefreshRequest

type RefreshRequest struct {
	// (Optional) The block height from which to start refreshing.
	StartHeight uint64 `json:"start_height,omitempty"`
}

type RefreshResponse

type RefreshResponse struct {
	// Number of new blocks scanned.
	BlocksFetched uint64 `json:"blocks_fetched"`

	// States if transactions to the wallet have been found in the blocks.
	ReceivedMoney bool `json:"received_money"`
}

type RelayTxRequest

type RelayTxRequest struct {
	// Transaction metadata returned from a transfer method with get_tx_metadata set to true.
	Hex string `json:"hex"`
}

type RelayTxResponse

type RelayTxResponse struct {
	// The publically searchable transaction hash.
	TxHash string `json:"tx_hash"`
}

type RestoreDeterministicWalletRequest

type RestoreDeterministicWalletRequest struct {
	// Name of the wallet.
	Name string `json:"name"`

	// Password of the wallet.
	Password string `json:"password"`

	// Mnemonic phrase of the wallet to restore.
	Seed string `json:"seed"`

	// (Optional) Block height to restore the wallet from (default = 0).
	RestoreHeight uint64 `json:"restore_height,omitempty"`

	// (Optional) Language of the mnemonic phrase in case the old language is invalid.
	Language string `json:"language,omitempty"`

	// (Optional) Offset used to derive a new seed from the given mnemonic to recover a secret wallet from the mnemonic phrase.
	SeedOffset string `json:"seed_offset,omitempty"`

	// Whether to save the currently open RPC wallet before closing it (Defaults to true).
	AutosaveCurrent bool `json:"autosave_current"`
}

type RestoreDeterministicWalletResponse

type RestoreDeterministicWalletResponse struct {
	// 95-character hexadecimal address of the restored wallet as a string.
	Address string `json:"address"`

	// Message describing the success or failure of the attempt to restore the wallet.
	Info string `json:"info"`

	// Mnemonic phrase of the restored wallet, which is updated if the wallet was restored from a deprecated-style mnemonic phrase.
	Seed string `json:"seed"`

	// Indicates if the restored wallet was created from a deprecated-style mnemonic phrase.
	WasDeprecated bool `json:"was_deprecated"`
}

type SetAccountTagDescriptionRequest

type SetAccountTagDescriptionRequest struct {
	// Set a description for this tag.
	Tag string `json:"tag"`

	// Description for the tag.
	Description string `json:"description"`
}

type SetAttributeRequest

type SetAttributeRequest struct {
	// Attribute name
	Key string `json:"key"`

	// Attribute value
	Value string `json:"value"`
}

type SetDaemonRequest

type SetDaemonRequest struct {
	// (Optional) The URL of the daemon to connect to. (Default: "")
	Address string `json:"address,omitempty"`

	// (Optional) If false, some RPC wallet methods will be disabled. (Default: false)
	Trusted bool `json:"trusted,omitempty"`

	// (Optional) Specifies whether the Daemon uses SSL encryption. (Default: autodetect; Accepts: disabled, enabled, autodetect)
	SslSupport string `json:"ssl_support,omitempty"`

	// (Optional) The file path location of the SSL key.
	SslPrivateKeyPath string `json:"ssl_private_key_path,omitempty"`

	// (Optional) The file path location of the SSL certificate.
	SslCertificatePath string `json:"ssl_certificate_path,omitempty"`

	// (Optional) The SHA1 fingerprints accepted by the SSL certificate.
	SslAllowedFingerprints []string `json:"ssl_allowed_fingerprints,omitempty"`

	// (Optional) If false, the certificate must be signed by a trusted certificate authority. (Default: false)
	SslAllowAnyCert bool `json:"ssl_allow_any_cert,omitempty"`
}

type SetTxNotesRequest

type SetTxNotesRequest struct {
	// Transaction ids
	Txids []string `json:"txids"`

	// Notes for the transactions
	Notes []string `json:"notes"`
}

type SignMultisigRequest

type SignMultisigRequest struct {
	// Multisig transaction in hex format, as returned by transfer under multisig_txset.
	TxDataHex string `json:"tx_data_hex"`
}

type SignMultisigResponse

type SignMultisigResponse struct {
	// Multisig transaction in hex format.
	TxDataHex string `json:"tx_data_hex"`

	// List of transaction Hash.
	TxHashList []string `json:"tx_hash_list"`
}

type SignRequest

type SignRequest struct {
	// Anything you need to sign.
	Data string `json:"data"`
}

type SignResponse

type SignResponse struct {
	// Signature generated against the "data" and the account public address.
	Signature string `json:"signature"`
}

type SignTransferRequest

type SignTransferRequest struct {
	// Set of unsigned tx returned by "transfer" or "transfer_split" methods.
	UnsignedTxset string `json:"unsigned_txset"`

	// (Optional) If true, return the raw transaction data. (Defaults to false)
	ExportRaw bool `json:"export_raw,omitempty"`
}

type SignTransferResponse

type SignTransferResponse struct {
	// Set of signed tx to be used for submitting transfer.
	SignedTxset string `json:"signed_txset"`

	// The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`

	// The tx raw data of every transaction.
	TxRawList []string `json:"tx_raw_list"`
}

type SignedKeyImage

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

type SplitIntegratedAddressRequest

type SplitIntegratedAddressRequest struct {
	IntegratedAddress string `json:"integrated_address"`
}

type SplitIntegratedAddressResponse

type SplitIntegratedAddressResponse struct {
	// States if the address is a subaddress
	IsSubaddress bool `json:"is_subaddress"`

	// Hex encoded payment.
	Payment string `json:"payment"`

	StandardAddress string `json:"standard_address"`
}

type StartMiningRequest

type StartMiningRequest struct {
	// Number of threads created for mining.
	ThreadsCount uint64 `json:"threads_count"`

	// Allow to start the miner in smart mining mode.
	DoBackgroundMining bool `json:"do_background_mining"`

	// Ignore battery status (for smart mining only)
	IgnoreBattery bool `json:"ignore_battery"`
}

type SubaddressIndex

type SubaddressIndex struct {
	// Major  Account index.
	Major uint64 `json:"major"`

	// Minor  Address index.
	Minor uint64 `json:"minor"`
}

type SubmitMultisigRequest

type SubmitMultisigRequest struct {
	// Multisig transaction in hex format, as returned by sign_multisig under tx_data_hex.
	TxDataHex string `json:"tx_data_hex"`
}

type SubmitMultisigResponse

type SubmitMultisigResponse struct {
	// List of transaction Hash.
	TxHashList []string `json:"tx_hash_list"`
}

type SubmitTransferRequest

type SubmitTransferRequest struct {
	// Set of signed tx returned by "sign_transfer"
	TxDataHex string `json:"tx_data_hex"`
}

type SubmitTransferResponse

type SubmitTransferResponse struct {
	// The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`
}

type SweepAllRequest

type SweepAllRequest struct {
	// Destination public address.
	Address string `json:"address"`

	// Sweep transactions from this account.
	AccountIndex uint64 `json:"account_index"`

	// (Optional) Sweep from this set of subaddresses in the account.
	SubaddrIndices []uint64 `json:"subaddr_indices,omitempty"`

	// (Optional) Use outputs in all subaddresses within an account.
	SubaddrIndicesAll bool `json:"subaddr_indices_all,omitempty"`

	// (Optional) Priority for sending the sweep transfer, partially determines fee.
	Priority Priority `json:"priority,omitempty"`

	// Specify the number of separate outputs of smaller denomination that will be created by sweep operation.
	Outputs uint64 `json:"outputs,omitempty"`

	// Sets ringsize to n (mixin + 1).
	RingSize uint64 `json:"ring_size,omitempty"`

	// Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`

	// (Optional, defaults to a random ID) 16 characters hex encoded.
	PaymentId string `json:"payment_id,omitempty"`

	// (Optional) Return the transaction keys after sending.
	GetTxKeys bool `json:"get_tx_keys,omitempty"`

	// (Optional) Include outputs below this amount.
	BelowAmount uint64 `json:"below_amount,omitempty"`

	// (Optional) If true, Do not relay this sweep transfer. (Defaults to false)
	DoNotRelay bool `json:"do_not_relay,omitempty"`

	// (Optional) return the transactions as hex encoded string. (Defaults to false)
	GetTxHex bool `json:"get_tx_hex,omitempty"`

	// (Optional) return the transaction metadata as a string. (Defaults to false)
	GetTxMetadata bool `json:"get_tx_metadata,omitempty"`
}

type SweepAllResponse

type SweepAllResponse struct {
	// The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`

	// The transaction keys for every transaction.
	TxKeyList []string `json:"tx_key_list"`

	// The amount transferred for every transaction.
	AmountList []int `json:"amount_list"`

	// The amount of fees paid for every transaction.
	FeeList []int `json:"fee_list"`

	// Metric used for adjusting fee.
	WeightList []int `json:"weight_list"`

	// The tx as hex string for every transaction.
	TxBlobList []string `json:"tx_blob_list"`

	// List of transaction metadata needed to relay the transactions later.
	TxMetadataList []string `json:"tx_metadata_list"`

	// The set of signing keys used in a multisig transaction (empty for non-multisig).
	MultisigTxset string `json:"multisig_txset"`

	// Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`

	SpentKeyImagesList []KeyImages `json:"spent_key_images_list"`
}

type SweepDustRequest

type SweepDustRequest struct {
	// (Optional) Return the transaction keys after sending.
	GetTxKeys bool `json:"get_tx_keys,omitempty"`

	// (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"`

	// (Optional) Return the transactions as hex string after sending. (Defaults to false)
	GetTxHex bool `json:"get_tx_hex,omitempty"`

	// (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false)
	GetTxMetadata bool `json:"get_tx_metadata,omitempty"`
}

type SweepDustResponse

type SweepDustResponse struct {
	// The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`

	// The transaction keys for every transaction.
	TxKeyList []string `json:"tx_key_list"`

	// The amount transferred for every transaction.
	AmountList []int `json:"amount_list"`

	// The amount of fees paid for every transaction.
	FeeList []int `json:"fee_list"`

	// Metric used to calculate transaction fee.
	WeightList []int `json:"weight_list"`

	// The tx as hex string for every transaction.
	TxBlobList []string `json:"tx_blob_list"`

	// List of transaction metadata needed to relay the transactions later.
	TxMetadataList []string `json:"tx_metadata_list"`

	// The set of signing keys used in a multisig transaction (empty for non-multisig).
	MultisigTxset string `json:"multisig_txset"`

	// Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`

	// Key images of spent outputs.
	SpentKeyImagesList []KeyImages `json:"spent_key_images_list"`
}

type SweepSingleRequest

type SweepSingleRequest struct {
	// Destination public address.
	Address string `json:"address"`

	// (Optional) Priority for sending the sweep transfer, partially determines fee.
	Priority Priority `json:"priority,omitempty"`

	// Specify the number of separate outputs of smaller denomination that will be created by sweep operation.
	Outputs uint64 `json:"outputs,omitempty"`

	// Sets ringsize to n (mixin + 1).
	RingSize uint64 `json:"ring_size,omitempty"`

	// Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`

	// (Optional, defaults to a random ID) 16 characters hex encoded.
	PaymentId string `json:"payment_id,omitempty"`

	// (Optional) Return the transaction keys after sending.
	GetTxKey bool `json:"get_tx_key,omitempty"`

	// Key image of specific output to sweep.
	KeyImage string `json:"key_image"`

	// (Optional) If true, Do not relay this sweep transfer. (Defaults to false)
	DoNotRelay bool `json:"do_not_relay,omitempty"`

	// (Optional) return the transactions as hex encoded string. (Defaults to false)
	GetTxHex bool `json:"get_tx_hex,omitempty"`

	// (Optional) return the transaction metadata as a string. (Defaults to false)
	GetTxMetadata bool `json:"get_tx_metadata,omitempty"`
}

type SweepSingleResponse

type SweepSingleResponse struct {
	// The tx hashes of every transaction.
	TxHash []string `json:"tx_hash"`

	// The transaction keys for every transaction.
	TxKey []string `json:"tx_key"`

	// The amount transferred for every transaction.
	Amount []int `json:"amount"`

	// The amount of fees paid for every transaction.
	Fee []int `json:"fee"`

	// Metric used to calculate transaction fee.
	Weight uint64 `json:"weight"`

	// The tx as hex string for every transaction.
	TxBlob []string `json:"tx_blob"`

	// List of transaction metadata needed to relay the transactions later.
	TxMetadata []string `json:"tx_metadata"`

	// The set of signing keys used in a multisig transaction (empty for non-multisig).
	MultisigTxset string `json:"multisig_txset"`

	// Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`

	// Key images of spent outputs.
	SpentKeyImages []KeyImages `json:"spent_key_images"`
}

type TagAccountsRequest

type TagAccountsRequest struct {
	// Tag for the accounts.
	Tag string `json:"tag"`

	// Tag this list of accounts.
	Accounts []uint64 `json:"accounts"`
}

type Transfer

type Transfer struct {
	// Public address of the transfer.
	Address string `json:"address"`

	// Amount of this transfer.
	Amount uint64 `json:"amount"`

	// Number of blocks mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).
	Confirmations uint64 `json:"confirmations"`

	// True if the key image(s) for the transfer have been seen before.
	DoubleSpendSeen bool `json:"double_spend_seen"`

	// Transaction fee for this transfer.
	Fee uint64 `json:"fee"`

	// Height of the first block that confirmed this transfer (0 if not mined yet).
	Height uint64 `json:"height"`

	// Note about this transfer.
	Note string `json:"note"`

	// Payment ID for this transfer.
	PaymentId string `json:"payment_id"`

	// Account and subaddress index.
	SubaddrIndex SubaddressIndex `json:"subaddr_index"`

	// Estimation of the confirmations needed for the transaction to be included in a block.
	SuggestedConfirmationsThreshold uint64 `json:"suggested_confirmations_threshold"`

	// POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet).
	Timestamp uint64 `json:"timestamp"`

	// Transaction ID for this transfer.
	Txid string `json:"txid"`

	// Transfer type.
	Type string `json:"type"`

	// Number of blocks until transfer is safely spendable.
	UnlockTime uint64 `json:"unlock_time"`
}

type TransferByTxid

type TransferByTxid struct {
	// Public address of the transfer.
	Address string `json:"address"`

	// Amount of this transfer.
	Amount uint64 `json:"amount"`

	// Number of blocks mined since the block containing this transaction (or block height at which the transaction should be added to a block if not yet confirmed).
	Confirmations uint64 `json:"confirmations"`

	// Array of JSON objects containing transfer destinations.
	Destinations []Destination `json:"destinations"`

	// True if the key image(s) for the transfer have been seen before.
	DoubleSpendSeen bool `json:"double_spend_seen"`

	// Transaction fee for this transfer.
	Fee uint64 `json:"fee"`

	// Height of the first block that confirmed this transfer (0 if not mined yet).
	Height uint64 `json:"height"`

	// Note about this transfer.
	Note string `json:"note"`

	// Payment ID for this transfer.
	PaymentId string `json:"payment_id"`

	// Account and subaddress index.
	SubaddrIndex SubaddressIndex `json:"subaddr_index"`

	// Estimation of the confirmations needed for the transaction to be included in a block.
	SuggestedConfirmationsThreshold uint64 `json:"suggested_confirmations_threshold"`

	// POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet).
	Timestamp uint64 `json:"timestamp"`

	// Transaction ID for this transfer.
	Txid string `json:"txid"`

	// Transfer type.
	Type string `json:"type"`

	// Number of blocks until transfer is safely spendable.
	UnlockTime uint64 `json:"unlock_time"`
}

type TransferRequest

type TransferRequest struct {
	// Array of destinations to receive XMR.
	Destinations []Destination `json:"destinations"`

	// (Optional) Transfer from this account index. (Defaults to 0)
	AccountIndex uint64 `json:"account_index,omitempty"`

	// (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices)
	SubaddrIndices []uint64 `json:"subaddr_indices,omitempty"`

	// (Optional) Subtract fee from output(s) - Choose which destinations to fund the tx fee from instead of the change output.
	SubtractFeeFromOutputs []uint64 `json:"subtract_fee_from_outputs,omitempty"`

	// Set a priority for the transaction. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority.
	Priority Priority `json:"priority"`

	// Number of outputs to mix in the transaction (this output + N decoys from the blockchain).
	RingSize uint64 `json:"ring_size"`

	// Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`

	// (Optional) Return the transaction key after sending.
	GetTxKey bool `json:"get_tx_key,omitempty"`

	// (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"`

	// Return the transaction as hex string after sending (Defaults to false)
	GetTxHex bool `json:"get_tx_hex"`

	// Return the metadata needed to relay the transaction. (Defaults to false)
	GetTxMetadata bool `json:"get_tx_metadata"`
}

type TransferResponse

type TransferResponse struct {
	// Amount transferred for the transaction.
	Amount uint64 `json:"amount"`

	// Value of the fee charged for the txn.
	Fee uint64 `json:"fee"`

	// Set of multisig transactions in the process of being signed (empty for non-multisig).
	MultisigTxset interface{} `json:"multisig_txset"`

	// Raw transaction represented as hex string, if get_tx_hex is true.
	TxBlob string `json:"tx_blob"`

	// The publically searchable transaction hash.
	TxHash string `json:"tx_hash"`

	// The transaction key if get_tx_key is true, otherwise, blank string.
	TxKey string `json:"tx_key"`

	// Set of transaction metadata needed to relay this transfer later, if get_tx_metadata is true.
	TxMetadata string `json:"tx_metadata"`

	// Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`
}

type TransferSplitRequest

type TransferSplitRequest struct {
	// Array of destinations to receive XMR.
	Destinations []Destination `json:"destinations"`

	// (Optional) Transfer from this account index. (Defaults to 0)
	AccountIndex uint64 `json:"account_index,omitempty"`

	// (Optional) Transfer from this set of subaddresses. (Defaults to empty - all indices)
	SubaddrIndices []uint64 `json:"subaddr_indices,omitempty"`

	// Sets ringsize to n (mixin + 1).
	RingSize uint64 `json:"ring_size"`

	// Number of blocks before the monero can be spent (0 to not add a lock).
	UnlockTime uint64 `json:"unlock_time"`

	// (Defaults to a random ID) 16 characters hex encoded.
	PaymentId string `json:"payment_id,omitempty"`

	// (Optional) Return the transaction keys after sending.
	GetTxKeys bool `json:"get_tx_keys,omitempty"`

	// Set a priority for the transactions. Accepted Values are: 0-3 for: default, unimportant, normal, elevated, priority.
	Priority Priority `json:"priority"`

	// (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"`

	// Return the transactions as hex string after sending
	GetTxHex bool `json:"get_tx_hex"`

	// Return list of transaction metadata needed to relay the transfer later.
	GetTxMetadata bool `json:"get_tx_metadata"`
}

type TransferSplitResponse

type TransferSplitResponse struct {
	// The tx hashes of every transaction.
	TxHashList []string `json:"tx_hash_list"`

	// The transaction keys for every transaction.
	TxKeyList []string `json:"tx_key_list"`

	// The amount transferred for every transaction.
	AmountList []int `json:"amount_list"`

	// The amount of fees paid for every transaction.
	FeeList []int `json:"fee_list"`

	// Metric used to calculate transaction fee.
	WeightList []int `json:"weight_list"`

	// The tx as hex string for every transaction.
	TxBlobList []string `json:"tx_blob_list"`

	// List of transaction metadata needed to relay the transactions later.
	TxMetadataList []string `json:"tx_metadata_list"`

	// The set of signing keys used in a multisig transaction (empty for non-multisig).
	MultisigTxset string `json:"multisig_txset"`

	// Set of unsigned tx for cold-signing purposes.
	UnsignedTxset string `json:"unsigned_txset"`

	// Key images of spent outputs.
	SpentKeyImagesList []KeyImages `json:"spent_key_images_list"`
}

type UntagAccountsRequest

type UntagAccountsRequest struct {
	// Remove tag from this list of accounts.
	Accounts []uint64 `json:"accounts"`
}

type UriPaymentInfo

type UriPaymentInfo struct {
	// Wallet address.
	Address string `json:"address"`

	// Amount to receive, in atomic units (0 if not provided)
	Amount uint64 `json:"amount"`

	// 16 or 64 character hexadecimal payment id (empty if not provided).
	PaymentId string `json:"payment_id"`

	// Name of the payment recipient (empty if not provided).
	RecipientName string `json:"recipient_name"`

	// Description of the reason for the tx (empty if not provided).
	TxDescription string `json:"tx_description"`
}

type ValidateAddressRequest

type ValidateAddressRequest struct {
	// The address to validate.
	Address string `json:"address"`

	// (Optional) If true, consider addresses belonging to any of the three Monero networks (mainnet, stagenet, and testnet) valid. Otherwise, only consider an address valid if it belongs to the network on which the rpc-wallet's current daemon is running (Defaults to false).
	AnyNetType bool `json:"any_net_type,omitempty"`

	// (Optional) If true, consider OpenAlias-formatted addresses valid (Defaults to false).
	AllowOpenalias bool `json:"allow_openalias,omitempty"`
}

type ValidateAddressResponse

type ValidateAddressResponse struct {
	// True if the input address is a valid Monero address.
	Valid bool `json:"valid"`

	// True if the given address is an integrated address.
	Integrated bool `json:"integrated"`

	// True if the given address is a subaddress
	Subaddress bool `json:"subaddress"`

	// Specifies which of the three Monero networks (mainnet, stagenet, and testnet) the address belongs to.
	Nettype string `json:"nettype"`

	// If the address is OpenAlias it will be returned here
	OpenaliasAddress string `json:"openalias_address"`
}

type VerifyRequest

type VerifyRequest struct {
	// What should have been signed.
	Data string `json:"data"`

	// Public address of the wallet used to sign the data.
	Address string `json:"address"`

	// Signature generated by sign method.
	Signature string `json:"signature"`
}

type VerifyResponse

type VerifyResponse struct {
	Good bool `json:"good"`
}

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

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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