1.0.0 • Published 4 years ago

@arianee/arianeejs-server v1.0.0

Weekly downloads
694
License
ISC
Repository
github
Last release
4 years ago

Build Status

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

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.

curl POST https://arianeeexample.cleverapps.io/buyCredits -H Content-Type:application/json -H -d "["certificate",1]"

Example

Create event: createArianeeEvent

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

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

(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}!`));
}())
1.0.0

4 years ago

0.24.0

4 years ago

0.23.0

4 years ago

0.22.0

4 years ago

0.20.0

4 years ago

0.19.0

4 years ago

0.18.0

4 years ago

0.17.0

4 years ago

0.15.0

4 years ago

0.16.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.12.0

4 years ago

0.11.0

5 years ago

0.10.0

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago

0.0.1-beta

5 years ago