Meter Docs
Search…
Meterify API Documentation
The meterify package is a wrapper to house all Meter-related modules, and depends on the web3.js library. If you are writing applications or scripts executing in Node.js or a browser environment, you should use Meterify.
Property
Type
Description
web3Instance
object
A web3 instance
host
string
The Meter host URL (and port, if applicable)
timeout
number
Request timeout value
Parameters of the meterify return object
Property
Type
Description
BatchRequest
function
Sets a RequestManager object and initiates batch requests
currentProvider
function
Get or set the current provider.
timeout
number
Request timeout value
eth
object
An Eth object (see: eth (insert link))
extension
extension
givenProvider
object
Return the given provider object.
providers
object
A list of providers.
provider
object
The current provider object.
_requestManager
object
A RequestManager object.
setProvider
function
Set the current provider.
utils
object
A utils object (see: (insert link))

Example

This code...
1
const meter = require("meterify").meterify;
2
const Web3 = require("web3");
3
const meterify = meter(new Web3(), "http://test.meter.io:8669");
Copied!
...returns an object:
1
{
2
eth: {
3
_requestManager: RequestManager,
4
givenProvider: MetamaskInpageProvider,
5
providers: {},
6
_provider: MeterProvider,
7
8
},
9
givenProvider: {
10
mux: ObjectMultiplex,
11
publicConfigStore: ObservableStore,
12
rpcEngine: RpcEngine,
13
send: ƒ
14
},
15
providers: {
16
WebsocketProvider: ƒ,
17
HttpProvider: ƒ,
18
IpcProvider: ƒ
19
},
20
utils: {
21
_fireError: ƒ,
22
_jsonInterfaceMethodToString: ƒ,
23
_flattenTypes: ƒ,
24
randomHex: ƒ,
25
_: ƒ,
26
27
},
28
version: "1.0.0-beta.37",
29
_provider: {
30
_events: Events,
31
_eventsCount: 1,
32
RESTHost: "http://test.meter.io:8669",
33
WSHost: "ws://test.meter.io:8669",
34
timeout: 0,
35
36
},
37
_requestManager: {
38
provider: MeterProvider,
39
providers: {},
40
subscriptions: {}
41
}
42
...
43
}
Copied!

Notes on meterify and web3

The RESTful API of Meter differs from Ethereum's JSON-RPC, and there are some methods in web3 are not supported by meterify.
Supported Web3 Methods
web3 instance ├── eth │ ├── getBlockNumber │ ├── getBalance │ ├── getStorageAt │ ├── getCode │ ├── getBlock │ ├── getTransaction │ ├── getTransactionReceipt │ ├── sendTransaction │ ├── sendSignedTransaction │ ├── call │ ├── estimateGas │ ├── getPastLogs │ ├── subscribe │ ├── clearSubscriptions │ ├── getEnergy │ ├── getChainTag │ ├── getBlockRef │ ├── accounts │ └── Contract │ ├── Constructor(new Contract()) │ ├── clone │ ├── deploy │ ├── methods │ ├── methods.myMethod.call │ ├── methods.myMethod.send │ ├── methods.myMethod.estimateGas │ ├── methods.myMethod.encodeABI │ ├── events │ ├── once │ ├── events.myEvent │ ├── events.allEvents │ └── getPastEvents └── utils

MODULES

eth

For meterify.eth see the eth reference documentation.

utils

For meterify.utils see the utils reference documentation.

module.options

A module does provide several options for configuring the transaction confirmation workflow, or for defining default values.
For the currently available option properties on a module: see the options reference documentation.
Last modified 1yr ago