# @arianee/arianeejs-server

> [![Build Status](https://travis-ci.org/Arianee/arianee-server.svg?branch=master)](https://travis-ci.org/Arianee/arianee-server)

Latest version **1.0.0** (published 2021-04-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @arianee/arianeejs-server
pnpm add @arianee/arianeejs-server
yarn add @arianee/arianeejs-server
bun add @arianee/arianeejs-server
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-04-14 |
| First published | 2020-03-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 29.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Arianee |
| Maintainers | stefdelecjs, mvaullerin, arianeetech |

## Links

- npm: https://www.npmjs.com/package/@arianee/arianeejs-server
- Repository: https://github.com/Arianee/arianeejs-server
- Homepage: https://github.com/Arianee/arianeejs-server#readme
- Issues: https://github.com/Arianee/arianeejs-server/issues
- npm.io page: https://npm.io/package/@arianee/arianeejs-server

## Dependencies (10)

- [cors](https://npm.io/package/cors.md) ^2.8.5
- [jose](https://npm.io/package/jose.md) ^1.22.0
- [jrpc](https://npm.io/package/jrpc.md) ^3.1.2
- [jayson](https://npm.io/package/jayson.md) ^3.0.2
- [express](https://npm.io/package/express.md) ^4.17.1
- [supertest](https://npm.io/package/supertest.md) ^4.0.2
- [express-jwt](https://npm.io/package/express-jwt.md) ^6.0.0
- [express-bearer-token](https://npm.io/package/express-bearer-token.md) ^2.4.0
- [isobjectmatchingmodel](https://npm.io/package/isobjectmatchingmodel.md) ^1.0.1
- [jest-environment-node](https://npm.io/package/jest-environment-node.md) ^24.9.0

## Recent versions

- 1.0.0 (latest) — 2021-04-14
- 0.24.0 — 2021-04-07
- 0.23.0 — 2020-11-10
- 0.22.0 — 2020-11-10
- 0.20.0 — 2020-11-05
- 0.19.0 — 2020-11-05
- 0.18.0 — 2020-10-26
- 0.17.0 — 2020-10-12
- 0.16.0 — 2020-10-09
- 0.15.0 — 2020-10-09
- 0.14.0 — 2020-09-28
- 0.13.0 — 2020-09-24
- 0.12.0 — 2020-09-01
- 0.11.0 — 2020-06-16
- 0.10.0 — 2020-06-15
- … 10 more at https://npm.io/package/@arianee/arianeejs-server/versions

## README

[![Build Status](https://travis-ci.org/Arianee/arianee-server.svg?branch=master)](https://travis-ci.org/Arianee/arianee-server)


### What is it?

use arianeejs with http

post(nameOfMethod,[params])

ex post('url.com/requestPoa)


### process.env

process.env.useBDH => url of bdh to use bdh vault
chain => testnet, mainnet...etc
privateKey => private key of wallet

---
title: Wallet
sidebar_label: Wallet
---

### Calling methods

All methods available in arianeeJS's wallet object can be called in http.
Obviously you cannot call method like ``fromRandomKey``, or ``useBDH``. These methods are set with environment variables.

### List of availables endpoints
- GET /hello
- POST /publicKey
- POST /createCertificate
- POST /getMyCertificates
- POST /getCertificate
- POST /requestPoa
- POST /requestAria
- POST /approveStore
- POST /refuseArianeeEvent
- POST /requestCertificateOwnership
- POST /getMessageSenders
- POST /acceptArianeeEvent
- POST /createCertificateRequestOwnershipLink
- POST /storeContentInRPCServer
- POST /setMessageAuthorizationFor
- POST /getIdentity
- POST /getMyCertificatesGroupByIssuer
- POST /isCertificateOwnershipRequestable
- POST /isCertificateProofValid
- POST /getCertificateFromLink
- POST /buyCredits
- POST /balanceOfAria
- POST /balanceOfPoa
- POST /storeArianeeEvent
- POST /createCertificateProofLink
- POST /createArianeeEvent
- POST /contracts/storeContract/buyCredit/send
- POST /contracts/storeContract/getPastEvents

### Methods, endpoints and parameters

## Method without parameters
For method without parameter, just call method with empty parameters
```bash
curl -H Content-Type:application/json -H "authorization: Basic YourApiKey" POST https://arianeeexample.cleverapps.io/publicKey 
// output: 0xAC6943CEA275E8392c49905c960e580CfEaC0bd5
```

## Method with parameters
You just need to pass data as an array. Parameters are exactly the same as arianeeJS doc.
```bash
curl POST https://arianeeexample.cleverapps.io/buyCredits -H Content-Type:application/json -H -d "["certificate",1]"
```


### Example

## Create event: createArianeeEvent
```bash
curl POST https://arianeeexample.cleverapps.io/createArianeeEvent -H Content-Type:application/json 
-d "[{certificateId:certificateId,
                   content:{
                       $schema:'https://cert.arianee.org/version1/ArianeeEvent-i18n.json',
                       title:'My Title'
                   }
               }]"
```

## store Arianee event content: storeArianeeEvent
```bash
curl POST https://arianeeexample.cleverapps.io/storeArianeeEvent -H Content-Type:application/json 
-d "["YourCertificateId",yourArianeeEventId,"yourArianeeEventContent","https://arianee.cleverapps.io/arianeetestnet/rpc"]"
```


## Serving your own server

```javascript
(async function(){
    const arianee = await new Arianee().init(chain);
    const wallet = arianee.fromPrivateKey(privateKey);
    const app=await arianeeServerFactory({
                                              arianeeWallet:wallet
                                              middlewareBefore?: Function
                                              middlewareAfter?: Function
                                          });

    app.listen(port, () => console.log(`Arianee Server APP listening on port ${port}!`));
}())



```

---
_Source: https://npm.io/package/@arianee/arianeejs-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
