Home Reference Source
import Wallet from 'moneyro/src/Wallet.mjs'
public class | source

Wallet

Extends:

src/RPC.js~RPC → Wallet

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

Method Summary

Public Methods
public

async create(fileName: string, password: string, language: string): Promise<{}>

Create a new wallet.

public

async getAddress(): Promise<GetAddressResponse>

Returns the wallet's current block height.

public

async getBalance(): Promise<GetBalanceResponse>

Return the wallet's balance.

public

async getHeight(): Promise<GetHeightResponse>

public

async getPayments(paymentId: *): Promise<GetPaymentsResponse>

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

public

async open(fileName: string, password: string): Promise<{}>

Open a wallet.

public

async stop(): Promise<{}>

Stops the wallet, storing the current state.

public

async transfer(destinations: Destinations, mixin: uint, unlockTime: uint, priority: 0 | 1 | 2 | 3, getTxHex: boolean, paymentId: string, getTxKey: boolean, doNotRelay: boolean): Promise<TransferResponse>

Send monero to a number of recipients.

Private Methods
private

_getOptions(method: *, params: {}): *

Public Constructors

public constructor() source

Public Members

public password: * source

public username: * source

Public Methods

public async create(fileName: string, password: string, language: string): Promise<{}> source

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

Params:

NameTypeAttributeDescription
fileName string

File name.

password string

Password.

language string

Language for your wallets' seed.

Return:

Promise<{}>

public async getAddress(): Promise<GetAddressResponse> source

Returns the wallet's current block height.

Return:

Promise<GetAddressResponse>

public async getBalance(): Promise<GetBalanceResponse> source

Return the wallet's balance.

Return:

Promise<GetBalanceResponse>

public async getHeight(): Promise<GetHeightResponse> source

Return:

Promise<GetHeightResponse>

public async getPayments(paymentId: *): Promise<GetPaymentsResponse> source

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

Params:

NameTypeAttributeDescription
paymentId *

Payment id.

Return:

Promise<GetPaymentsResponse>

public async open(fileName: string, password: string): Promise<{}> source

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

Params:

NameTypeAttributeDescription
fileName string

File name.

password string

Password.

Return:

Promise<{}>

public async stop(): Promise<{}> source

Stops the wallet, storing the current state.

Return:

Promise<{}>

public async transfer(destinations: Destinations, mixin: uint, unlockTime: uint, priority: 0 | 1 | 2 | 3, getTxHex: boolean, paymentId: string, getTxKey: boolean, doNotRelay: boolean): Promise<TransferResponse> source

Send monero to a number of recipients.

Params:

NameTypeAttributeDescription
destinations Destinations

Array of destinations to receive XMR.

mixin uint

Number of outpouts from the blockchain to mix with (0 means no mixing).

unlockTime uint

Number of blocks before the monero can be spent (0 to not add a lock).

priority 0 | 1 | 2 | 3
getTxHex boolean
paymentId string
  • optional

Random 32-byte/64-character hex string to identify a transaction.

getTxKey boolean
  • optional
doNotRelay boolean
  • optional

Return:

Promise<TransferResponse>

Private Methods

private _getOptions(method: *, params: {}): * source

Params:

NameTypeAttributeDescription
method *
params {}
  • optional
  • default: {}

Return:

*