# ariari-accounts-sdk

> Sdk to create ariari accounts

Latest version **0.1.5** (published 2019-12-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install ariari-accounts-sdk
pnpm add ariari-accounts-sdk
yarn add ariari-accounts-sdk
bun add ariari-accounts-sdk
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2019-12-19 |
| First published | 2019-12-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.16.0 |
| Dependencies | 4 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 (+26 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Manuela Garcia |
| Maintainers | manug96 |
| Keywords | ariari, accounts, sdk |

## Links

- npm: https://www.npmjs.com/package/ariari-accounts-sdk
- Repository: https://github.com/ariari-co/ariari-accounts-sdk
- Homepage: https://github.com/ariari-co/ariari-accounts-sdk#readme
- Issues: https://github.com/ariari-co/ariari-accounts-sdk/issues
- npm.io page: https://npm.io/package/ariari-accounts-sdk

## Dependencies (4)

- [axios](https://npm.io/package/axios.md) ^0.19.0
- [stellar-sdk](https://npm.io/package/stellar-sdk.md) ^3.3.0
- [axios-mock-adapter](https://npm.io/package/axios-mock-adapter.md) ^1.17.0
- [stellar-auth-client](https://npm.io/package/stellar-auth-client.md) ^1.0.0

## Recent versions

- 0.1.5 (latest) — 2019-12-19

## README

[![Build Status](https://travis-ci.com/ariari-co/ariari-accounts-sdk.svg?branch=master)](https://travis-ci.com/ariari-co/ariari-accounts-sdk)
[![Coverage Status](https://coveralls.io/repos/github/ariari-co/ariari-accounts-sdk/badge.svg)](https://coveralls.io/github/ariari-co/ariari-accounts-sdk)
[![David](https://img.shields.io/david/ariari-co/ariari-accounts-sdk.svg)](https://david-dm.org/ariari-co/ariari-accounts-sdk)
[![David](https://img.shields.io/david/dev/ariari-co/ariari-accounts-sdk.svg)](https://david-dm.org/ariari-co/ariari-accounts-sdk?type=dev)
# Ariari Accounts SDK library

Ariari Accounts SDK is a JavaScript library for Ariari Accounts API implementation.

## Quick Start

## Installation

Using npm:

```bash
$ npm install ariari-accounts-sdk
```

## Usage

### Initialization

```python
const accountsApiSdk = require('ariari-accounts-sdk');
const accountsApi = new AriariAccountsSdk();
```
### Create a new company

```python
const data = {
   publicKey: 'GC2Z...JXNU',
   domain: 'www.foo-domain.com',
}

accountsApi.company.create(data) # returns the newly created object company
```
- **data**\
Object with mandatory params containing the information to create a new company.
Required: true
  - **publicKey**\
  From the /.well-known/stellar.toml file that matches the domain.
  Required: true
  - **domain**\
  Of the company to be created.
  Required: true

### Authenticate a company

```python
const secret = 'SAAN...OLJ2';

accountsApi.company.login(secret) # returns the authentication token for a company
```

- **secret**\
Secret key that matches the public key used to create a new company.
Required: true

### Create a new account

```python
const customId = 'foo';

accountsApi.account.create(customId) # returns the newly created object account
```

- **customId**\
Custom label that will allow easier identification of the newly created account.
Required: false

### Authenticate an account

```python

const id = '123';
const customId = 'foo';
const publicKey = 'GC2Z...JXNU';

accountsApi.account.login({ id }) # returns the authentication token for an account
accountsApi.account.login({ customId }) # returns the authentication token for an account
accountsApi.account.login({ publicKey }) # returns the authentication token for an account
```
The user must provide either the id, public key or customId of the account to be authenticated.
- **id**\
ID of the account to be authenticated.
Required: false
- **customId**\
Custom ID of the account to be authenticated.
Required: false
- **publicKey**\
Public key of the account to be authenticated.
Required: false

### Sign a transaction

```python
const transaction = 'AAAA...AAAA==';

accountsApi.account.signTransaction(transaction) # returns the signed transaction
```

- **tx**\
Transaction XDR to be signed by the desired account.
Required: true

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

---
_Source: https://npm.io/package/ariari-accounts-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
