MintMe JavaScript mining configuration

Client.Anonymous

Client.Anonymous(<site-key>, [options]);

Constructor of miner object. Takes one or two arguments:

site-key String. Hexadecimal, 64 characters-length key. You can use one key on more than one domain. Statistics for sites with the same site-key are merged in user panel.
options Object. It contains fields which set behaviour of miner. See table below for details.

Possible options:

throttle Float. Sets maximum CPU usage by miner. For example to limit usage to 30% it should be 0.7
threads Integer. Set fixed number of mining threads. Default value is equal to navigator.hardwareConcurrency - count of logical processor cores.
autoThreads Bool. If true, adjust number of threads automatically. Default value is false.
forceASMJS Bool. If true, asm.js implementation of miner will be forced. Otherwise faster WebAssembly version will be used if supported. Default value is false.

Client.User

Client.User(<site-key>, <username>, [options]);

Miner object builder - It can take two or three arguments:

site-key String. Hexadecimal, 64 characters-length key. You can use one key on more than one domain. Statistics for sites with the same site-key are merged in user panel.
username String. Username can contain only letters of ISO basic Latin alphabet and dashes and can't be longer than 128 characters.
options Object. It contains fields that define the behevior of the miner. See the table below for details.

Possible options:

throttle Float. Sets max CPU usage by miner. For example, to limit the CPU usage to 30%, the value should be 0.7.
threads Integer. Sets fixed number of mining threads. The default value is equal to navigator.hardwareConcurrency - count of logical processor cores.
autoThreads Bool. The default value is false. If true, threads will be automatically adjusted.
forceASMJS Bool. If true, asm.js will be used for implementing the miner. If false, WebAssembly will be used when supported. False is set by default.

start()

miner.start([mode]);

Starts mining. Takes zero or one argument:

mode Enum. Specifies conditions of starting mining. See table below for possible modes. Default value is Client.IF_EXCLUSIVE_TAB

Modes:

Client.IF_EXCLUSIVE_TAB Start mining only if no other miner on given domain is active. When other tab with miner will be closed, current miner will start working.
Client.FORCE_EXCLUSIVE_TAB Start mining and stop miners on the same domain which don’t have Client.FORCE_MULTI_TAB option.
Client.FORCE_MULTI_TAB Start mining even if other miners is active.

stop()

miner.stop();

Stops mining. Takes zero arguments.

isRunning()

running = miner.isRunning();

Returns true if miner is started, false otherwise.

isMobile()

onMobile = miner.isMobile();

Returns true if mobile device detected, false otherwise. It can be used to start mining only on desktops and laptops.

hasWASMSupport()

wasmEnabled = miner.hasWASMSupport();

Returns true if WebAssembly is supported and enabled, false if asm.js implementation is used.

getAutoThreadsEnabled()

isAutoThreads = miner.getAutoThreadsEnabled();

Returns true if autoThreads was enabled, false otherwise. See Client.Anonymous() description for details.

setAutoThreadsEnabled()

miner.setAutoThreadsEnabled(enable);

Enables or disables autoThreads. Takes one argument:

enable Boolean. If true, enable autoThreads feature. See Client.Anonymous() description for details.

getHashesPerSecond()

hps = miner.getHashesPerSecond();

Returns number of hashes calculated per second.

getNumThreads()

threads = miner.getNumThreads();

Returns number of threads used for mining.

setNumThreads()

miner.setNumThreads(threads);

Sets number of threads used for mining. Takes one argument:

threads Integer. Number of mining threads.

getThrottle()

throttle = miner.getThrottle();

Returns value from range 0.0 to 1.0. For example value 0.3 means that CPU usage is limited to 70%.

setThrottle()

miner.setThrottle(throttle);

Sets CPU limit. Takes one argument:

throttle Float. Value from range 0.0 to 1.0. For example value 0.3 means that CPU usage is limited to 70%.

getTotalHashes()

hashes = miner.getTotalHashes([interpolate]);

Returns total count of hashes calculated since miner was created. Takes zero or one argument:

interpolate If is set to true then miner will estimate total hashes between of refreshes to provide smoothly increasing number. Default value is false.

on()

on(event, callback(args) {});

Adds callback for given event. Takes two arguments:

event String. Name of the event you want add callback to.
callback Function to call when given event occurs.

Possible events:

'open' Connection to pool was established.
'close' Connection to pool was closed.
'error' An error occurred. args.error contains string with error type.
'job' New mining job was received from pool.
'found' Job was calculated and will be send to pool.