Machinomy is a library for micropayments in Ether (and ERC20 tokens) over HTTP. Machinomy provides API to send and receive a minuscule amount of money instantly. Core method is buy. The method does all the heavy lifting providing an easy interface for micropayments.
You can find ES5 example in this folder of the project.
Ethereum account address that sends the money.
Web3 instance that manages Machinomy.account's private key
Entrypoint for a purchasing.
buy for the first time from the same receiver, the method opens a channel with a deposit equal to
Next method call forms a payment and sends it via http to
The method then returns a token and channel id, in form of BuyResult.
Returns the list of opened channels.
Share the money between sender and reciver according to payments made.
For example a channel was opened with 10 Ether. Sender makes 6 purchases, 1 Ether each. Total value transferred is 6 Ether. If a party closes the channel, the money deposited to the channel are split. The receiver gets 6 Ether. 4 unspent Ethers return to the sender.
A channel can be closed in two ways, according to what party initiates that. The method nicely abstracts over that, so you do not need to know what is really going on under the hood. For more details on how payment channels work refer to a website.
Put more money into the channel.
Size of deposit in Wei.
Return information about the payment by id.
Generated using TypeDoc