Home

Awesome

Mpurse

Extension for Monaparty.

Pre-built packages

Available at

Basic Usage

Via Browser Action

Via Content Script

Inject an instance of Mpurse into a Window object.

Properties

updateEmitter: EventEmitter

Exposes an EventEmitter that emits two events: stateChanged and addressChanged.

window.mpurse.updateEmitter.removeAllListeners()
  .on('stateChanged', isUnlocked => console.log(isUnlocked))
  .on('addressChanged', address => console.log(address));

Methods

getAddress()

const address = await window.mpurse.getAddress();

sendAsset()

const txHash = await window.mpurse.sendAsset(
  'MLinW5mA2Rnu7EjDQpnsrh6Z8APMBH6rAt',
  'XMP', 
  114.114, 
  'plain',
  'test'
);

signRawTransaction()

const signedTx = await window.mpurse.signRawTransaction(tx);

signMessage()

const signature = await window.mpurse.signMessage('Test Message');

sendRawTransaction()

const txHash = await window.mpurse.sendRawTransaction(tx);

mpchain()

Mpchain API.

Valid methods are address, asset , balance , balances , bets , block , broadcasts , btcpays , burns , dividends , history , holders , issuances , market , markets , market_history , market_orderbook , market_orders , mempool , network , orders , order_matches , sends , send_tx and tx.

For details, see the document.

const mpchainParams = {address: 'MLinW5mA2Rnu7EjDQpnsrh6Z8APMBH6rAt'};
const balance = await window.mpurse.mpchain('balances', mpchainParams);

counterBlock()

Counterblock API. (via https://mpchain.info/api/cb)

const cbParams = {assetsList: ['XMP']};
const assets = await window.mpurse.counterBlock('get_assets_info', cbParams);

counterParty()

Counterparty API. (via https://mpchain.info/api/cb)

const cpParams = {address: 'MLinW5mA2Rnu7EjDQpnsrh6Z8APMBH6rAt'};
const unspentTxouts = await window.mpurse.counterParty('get_unspent_txouts', cpParams);