
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
mxw-api packageIf you want the latest, stable version, install the package from NPM.
npm install --save mxw-api
If you want the bleeding edge version which is possibly unstable, you can install the package from this Git repo.
npm install --save git+https://github.com/Sentrylink/mxw-api.git
// Load the SDK (with require)
const MxwApi = require('mxw-api')
// Load the SDK (with import)
// import MxwApi from 'mxw-api'
// Define all nodes from which SDK can choose one
// The following list of nodes represents the current MXW testnet
const NODES = [
'ws://node-1.testnet.space:26657',
'ws://node-2.testnet.space:26657',
'ws://node-3.testnet.space:26657',
'ws://node-4.testnet.space:26657',
'ws://node-5.testnet.space:26657',
'ws://node-6.testnet.space:26657',
'ws://node-7.testnet.space:26657',
'ws://node-8.testnet.space:26657',
'ws://node-9.testnet.space:26657',
'ws://node-10.testnet.space:26657',
]
// Define the indexing service endpoint
// The provided URL is the Indexing service used by the testnet
const INDEXER = 'http://services.testnet.space:1234'
// Instantiate the SDK
const API = new MxwApi({
nodes: NODES,
indexer: INDEXER,
backend: 'cosmos',
})
You can find detailed usage examples in the examples folder.
examples/assets.jsexamples/alias.jsexamples/events.jsexamples/faucet.jsexamples/kyc.jsexamples/transfer.jsexamples/util.jsMXW SDK module
Kind: global namespace
Version: 0.1.4
object
object
object
PromisePromisePromiseobject
stringstringobjectstringobjectstringPromisePromisePromisePromiseobject
PromisePromisePromisePromiseobject
PromisePromiseobject
PromisePromiseobject
PromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromiseobjectEvents
Kind: static namespace of mxw
Example: examples/events.js
Set the new transaction handler.
Kind: inner method of events
| Param | Type | Description |
|---|---|---|
| fnc | function | Function that will be called on every new transaction (format: (data) => {}) |
Set the new block handler.
Kind: inner method of events
| Param | Type | Description |
|---|---|---|
| fnc | function | Function that will be called on every new block (format: (data) => {}) |
Removes a certain handler
Kind: inner method of events
| Param | Type | Description |
|---|---|---|
| type | string | Handler type ('tx' |
objectMain
Kind: static namespace of mxw
Example: examples/transfer.js
object
PromisePromisePromisePromiseReturns the balance of the given address.
Kind: inner method of main
Returns: Promise - balance - Wallet balance
| Param | Type | Description |
|---|---|---|
| address | string | Address of the wallet |
PromiseTransfer tokens from one address to another.
Kind: inner method of main
Returns: Promise - tx - Transaction result
Params: number amount - Amount of tokens
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet from which we're transfering tokens |
| address | string | Address of the wallet to which we're transfering tokens |
PromiseSigns a transfer transaction without relaying it.
Kind: inner method of main
Returns: Promise - tx - Transaction signature
Params: number amount - Amount of tokens
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet from which we're transfering tokens |
| address | string | Address of the wallet to which we're transfering tokens |
objectUtilities
Kind: static namespace of mxw
Example: examples/util.js
object
stringstringobjectstringobjectstringPromisePromisePromisePromisestringReturns wallet address.
Kind: inner method of util
Returns: string - address - Wallet address
| Param | Type | Description |
|---|---|---|
| privateKey | string | Wallet's private key |
stringReturns wallet address.
Kind: inner method of util
Returns: string - address - Wallet address
| Param | Type | Description |
|---|---|---|
| publicKey | string | Wallet's public key |
objectGenerates a new private/public key pair and a wallet address.
Kind: inner method of util
Returns: object - keyPair - Generated keypair
stringReturns wallet address.
Kind: inner method of util
Returns: string - address - Wallet address
| Param | Type | Description |
|---|---|---|
| byteArray | Buffer | Wallet's public key as a byte array |
objectDecodes a tendermint transaction.
Kind: inner method of util
Returns: object - tx - Decoded transaction
| Param | Type | Description |
|---|---|---|
| encoded | string | Base64 encoded transaction |
stringGet SHA256 hash of a given string.
Kind: inner method of util
Returns: string - hash - Hashed string
| Param | Type | Description |
|---|---|---|
| str | string | Arbitrary string |
PromiseGet a block at given height.
Kind: inner method of util
Returns: Promise - block - Block data
| Param | Type | Description |
|---|---|---|
| height | number | Block height |
PromiseGet transactions at given height.
Kind: inner method of util
Returns: Promise - txs - Transactions
| Param | Type | Description |
|---|---|---|
| height | number | Block height |
PromiseGet a single transaction by hash.
Kind: inner method of util
Returns: Promise - tx - Transaction data
| Param | Type | Description |
|---|---|---|
| hash | string | Transaction hash |
PromiseGet transactions by wallet address.
Kind: inner method of util
Returns: Promise - txs - Transactions
| Param | Type | Description |
|---|---|---|
| address | string | Wallet address |
objectAliasing module
Kind: static namespace of mxw
Example: examples/alias.js
object
PromisePromisePromisePromisePromiseSet an alias.
Kind: inner method of alias
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Wallet's private key |
| alias | string | An alias |
PromiseRemove an alias.
Kind: inner method of alias
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Wallet's private key |
| alias | string | An alias |
PromiseGets alias for a given address
Kind: inner method of alias
Returns: Promise - alias - Alias
| Param | Type | Description |
|---|---|---|
| address | string | Address of a wallet |
PromiseGets the address of an alias
Kind: inner method of alias
Returns: Promise - address - Wallet address
| Param | Type | Description |
|---|---|---|
| alias | string | An alias |
objectKYC module
Kind: static namespace of mxw
Example: examples/kyc.js
object
PromisePromisePromiseAllows users to request whitelisting from the mock KYC service.
Kind: inner method of kyc
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the KYC provider |
| whitelistAddress | string | Address that we're whitelisting |
PromiseChecks if the wallet address is whitelisted.
Kind: inner method of kyc
Returns: Promise - whitelist - Boolean
| Param | Type | Description |
|---|---|---|
| address | string | Address of a wallet |
objectFaucet module
Kind: static namespace of mxw
Example: examples/faucet.js
object
PromisePromisePromiseAllows users to see when they can request new coins from the faucet.
Kind: inner method of faucet
Returns: Promise - state - Query result
| Param | Type | Description |
|---|---|---|
| address | string | Address of the wallet |
PromiseAllows users to request coins from the faucet if they have less than 100 MXW.
Kind: inner method of faucet
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's requesting tokens |
| address | string | Address of the wallet that's receiving tokens (optional) |
objectAsset module
Kind: static namespace of mxw
Example: examples/assets.js
object
PromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromisePromiseAllows users to create a new fungible asset class.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's creating the new fungible asset class |
| classId | string | Id of the new asset class |
| dynamicSupply | bool | A flag that determines if there will be a dynamic supply |
| initialSupply | number | Initial supply of the new asset class |
| totalSupply | number | Total supply of the new asset class |
| dataLink | string | Data link |
PromiseAllows users to approve a fungible asset class.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's approving the asset class |
| classId | string | Id of the asset class |
| dataLink | string | Data link |
PromiseAllows users to reject a fungible asset class.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's rejecting the asset class |
| classId | string | Id of the asset class |
| dataLink | string | Data link |
PromiseAllows users to freeze a fungible asset class.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's freezing the asset class |
| classId | string | Id of the asset class |
| dataLink | string | Data link |
PromiseAllows users to unfreeze a fungible asset class.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's unfreezing the asset class |
| classId | string | Id of the asset class |
| dataLink | string | Data link |
PromiseAllows users to issue a fungible asset.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's issuing the asset |
| classId | string | Id of the asset class |
| owner | string | Owner of the issued asset |
| count | number | Number of assets |
PromiseAllows users to transfer fungible assets.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's transferring the asset |
| classId | string | Id of the asset class |
| count | number | Number of assets |
| newOwner | string | New owner of the issued asset |
PromiseAllows users to burn fungible assets.
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's burning the asset |
| classId | string | Id of the asset class |
| count | number | Number of assets |
PromiseAllows users to freeze a fungible asset account
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's freezing the asset account |
| classId | string | Id of the asset class |
| owner | string | Owner of the asset account |
| dataLink | string | Data link |
PromiseAllows users to unfreeze a fungible asset account
Kind: inner method of asset
Returns: Promise - tx - Transaction result
| Param | Type | Description |
|---|---|---|
| privateKey | string | Private key of the wallet that's unfreezing the asset account |
| classId | string | Id of the asset class |
| owner | string | Owner of the asset account |
| dataLink | string | Data link |
PromiseAllows users to list all available asset classes
Kind: inner method of asset
Returns: Promise - data - All asset classes
PromiseAllows users to query an asset class by class id
Kind: inner method of asset
Returns: Promise - data - Asset class
| Param | Type | Description |
|---|---|---|
| classId | string | Id of the asset class |
PromiseAllows users to query an account with assets
Kind: inner method of asset
Returns: Promise - data - Account
| Param | Type | Description |
|---|---|---|
| classId | string | Id of the asset class |
| address | string | Account address |
API.util.balance). So, after executing a transaction, you won't see the changes immediatelly. This lag is normal and it's due to Tendermint implementation.FAQs
Maxonrow blockchain SDK
We found that mxw-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.

Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.

Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.