2.0.4 • Published 4 years ago

ambrosus-javascript-sdk v2.0.4

Weekly downloads
74
License
MIT
Repository
github
Last release
4 years ago

alt text

Ambrosus SDK

Build Status Coverage Status

Library for simple interaction with Ambrosus API.

Overview

Prerequisite

In order to use Ambrosus SDK, first you need to have a developers account.\ You can apply for one here.

Ambrosus team will send you an email with your account address and secret key.

Important note: PLEASE DO NOT SHARE YOUR SECRET WITH ANYONE. \ We do not store your secret for security reasons, so please save it somewhere safe, in order to use it in SDK.

To use Ambrosus SDK, you will need your address and secret key.\ Now we can go to setup.

Installation

$ npm install ambrosus-javascript-sdk --save

Usage

Import the SDK in your javascript file

// with the classic require...
const AmbrosusSDK = require('ambrosus-javascript-sdk')
// ... or with the new import directive.
import AmbrosusSDK from 'ambrosus-javascript-sdk'

Initializing the Ambrosus library. The following properties can be passed while initializing the library. The ideal way to pass the properties is using the environment variables.

PropertyTypeDefinationExample.
secretstringSecret key you received in email.0x6823520c03ad7b17....
rpcURLstringRPC URL of the blockchain network.https://network.ambrosus-test.com
apiEndpointstringHermes API url.https://test-nop.ambrosus-test.com
headeresobjectheader object for api request{Authorization: 'AMB ....'}

Intializing SDK to request or querying data.

const ambrosus = new AmbrosusSDK({
  apiEndpoint: 'https://test-nop.ambrosus-test.com',
});

Initializing SDK to create assets and events.

ambrosus = new AmbrosusSDK({
  secret: '0x6823520c03ad7b17....',
  apiEndpoint: 'https://test-nop.ambrosus-test.com',
});

We can initialize the SDK by directly providing the authorization header, so that secret key will not be required for creating assets and events

const ambrosus = new AmbrosusSDK({
  headers: {
    Authorization: 'AMB ....',
  },
  apiEndpoint: 'https://test-nop.ambrosus-test.com',
});

Initializing SDK to work with the blockchain network.

ambrosus = new AmbrosusSDK({
  rpcURL: 'https://network.ambrosus-test.com',
  secret: '0x6823520c03ad7b17....',
});

Examples

See working Examples of how the SDK can be used.

Contribution

Please refer to project's code style guidelines and guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

It is mandatory to follow our code of conduct described in CONTRIBUTING.md.

API Coverage

  • Assets
    • Get by ID.
    • Get by Object.
    • Get by identifiers.
    • Get multiple Assets.
    • Create Asset.
  • Events
    • Get by ID.
    • Get by Object.
    • Get by identifiers.
    • Get multiple Events.
    • Create Event
    • Parse Events.
  • Bundles
    • Get Bundle by ID.
    • Get Bundle by object
  • Accounts
    • Add Account.
  • Transaction
    • Send Transaction.
    • Get Transaction.
    • Get Transaction Receipt.
    • Get Transaction Count.
  • Blocks
    • Get Blocks.
    • Get Latest Block.
  • Service
    • Get Private Key Pair.
    • Get Account.
    • Get Address.
    • Sign
    • Encrypt Private key.
    • Decrypt Private key.
    • Verify Events.
    • RPC Validation.

License

This project is licensed under MIT.

2.0.4

4 years ago

2.0.2

4 years ago

2.0.0

5 years ago

0.12.0

5 years ago

0.11.4

5 years ago

0.11.3

5 years ago

0.11.2

5 years ago

0.11.1

5 years ago

0.11.0

5 years ago

0.10.0

6 years ago

0.9.3

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.6

6 years ago

0.7.5

6 years ago

0.7.4

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.4

6 years ago

0.5.0

6 years ago

0.4.3

6 years ago

0.4.0

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago