1.0.1 • Published 3 years ago

milauth v1.0.1

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
3 years ago

MilaCoins API

Full documentation: api.milacoins.com

Sample Usage

const apiKey = process.env.MILACOINS_API_KEY;
const secretKey = process.env.MILACOINS_SECRET_KEY;
const url = "https://api.milacoins.com";

const milauth = require("milauth")(url, apiKey, secretKey);

Set the Environment (url)

Configure Your Credentials

  1. Go to MilaCoins Dashboard( production, sandbox)
  2. Navigate to api settings
  3. Generate the api keys
  4. add IP to the white list

Request Method

milauth.request(endpoint<String>,{method:<String>[default: 'GET'], query<Object>, body:<Object>})

Request Example

try {
  const invoices = await milauth.request("/api/v1/transactions/invoices/", {
    query: { limit: 1 },
  });
  console.log(invoices);
} catch (err) {
  console.log(err);
}

OR

milauth
  .request("/api/v1/transactions/invoices/", { query: { limit: 1 } })
  .then((res) => console.log(res))
  .catch((err) => console.error(err));

API Errors

Any response status > 399 will throw Error. Error properties:

  • requestID : string
  • code: number
  • message: string
  • name: string

Full errors list: click here

1.0.1

3 years ago

1.0.0

3 years ago

0.1.5

3 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago