Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reforest/celadon
π²The middleware that gives back to the environment.
https://github.com/reforest/celadon
cosmos crypto ecofriendly environmental hackathon impact-hub jaavscript lambocoin lotion middleware mining mit-license node reforest sanfrancisco tendermint
Last synced: 6 days ago
JSON representation
π²The middleware that gives back to the environment.
- Host: GitHub
- URL: https://github.com/reforest/celadon
- Owner: reforest
- License: mit
- Created: 2018-04-07T04:09:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-04-10T01:06:46.000Z (over 6 years ago)
- Last Synced: 2024-10-10T09:25:58.701Z (25 days ago)
- Topics: cosmos, crypto, ecofriendly, environmental, hackathon, impact-hub, jaavscript, lambocoin, lotion, middleware, mining, mit-license, node, reforest, sanfrancisco, tendermint
- Language: JavaScript
- Homepage: https://reforest.github.io/celadon/
- Size: 2.75 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Celadon
A lotionjs transaction middleware, which take a little part of the donation amount to donate to the non-profit organization you choose.## Installation
```command
$ npm i --save celadon
```## Use it as a handler
```javascript
import lotion from 'lotion';
import { handler as CeladonHandler } from 'celadon';let app = lotion({
devMode: true,
initialState: {
...data
}
});app.use(CeladonHandler);
app.listen(3000);
```## Use it in your own handler
```javascript
// app.js
import lotion from 'lotion';
import handler from './handler';let app = lotion({
devMode: true,
initialState: {
...data
}
});app.use(handler);
app.listen(3000);// in handler.js
import { trasactionWithCeledon, donateTo, NPOs } from 'celadon';
console.log(NPOs);
// ['celadon_wallet', 'cosmos_wallet', 'impacthub_wallet', 'andy_wallettttttt']export default function handler(state, tx) {
// verify the tx
// secp256k1.verify(tx.data, tx.signature, tx.data.from)let senderAddress = tx.data.from.toString('hex')
let receiverAddress = tx.data.to.toString('hex')
trasactionWithCeledon(state, {
from: senderAddress,
to: receiverAddress,
org: donateTo(NPOs),
feePortion: tx.data.feePortion,
amount: tx.data.amount
})
}
```### Choose your NPOs
```javascript
donateTo() // default to celadon_wallet
donateTo('cosmos_wallet')
donateTo(['cosmos_wallet', 'impacthub_wallet', 'andy_wallettttttt'])
```## Walkthrough
![introduction - celadon middlware](https://github.com/reforest/celadon/blob/master/introduction%20-%20celadon%20middleware.png?raw=true)
![Stack Diagram](https://github.com/reforest/celadon/blob/master/images/Screen%20Shot%202018-04-08%20at%207.58.34%20PM.png?raw=true)
## Join the NPOs wallet list
- send an [issue](https://github.com/reforest/celadon/issues)
- or send us [email]([email protected])## Author
[reforest](https://github.com/reforest)
## Resources
- [lotionjs](https://lotionjs.com/)
- [Tendermint](https://github.com/tendermint/tendermint)
- [Cosmos](https://cosmos.network/)## Standard
[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)
## License
[MIT](https://github.com/reforest/celadon/blob/master/LICENSE)