Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@minkainc/sdk

minkainc38MIT0.1.13

Minka-sdk for client integration to API

minka, sdk

readme

README

Minka SDK

Minka Banking as a service SDK

Version v0.1.8

What is this repository for?

The purpose of Minka SDK is to connect with Minka REST-API.

How do I get set up?

  • Installation
$ npm install @minkainc/sdk --save
  • Usage
const minka = require("@minkainc/sdk")
const initData = {
  API_KEY: "API_KEY",
  url: "https://api.minka.io"
};
minka.init(initData);

endpoints

  • /person
  • /org
  • /gateway
  • /transfer
  • /contract
  • /item
  • /lukatag

person

  • Create a person
    let personData = {
    lukatag: "@person",
    name: "test",
    first: "legaltest",
    last: "description",
    gender: "testlogo",
    avatar: "unodostres",
    locations: [
      {
        city: "gohtam",
        country: "dc comics",
        countryCode: "DC",
        region: "test",
        state: "test",
        street: "street test"
      }
    ],
    contacts: [
      {
        type: "testa",
        value: "testa",
        isVerified: "testa"
      }
    ],
    identification: [
      {
        numberId: "12323234",
        typeId: "CC",
        dateIssue: "123123",
        verified: true,
        locationIssue: "123232"
      }
    ],
    terms: [
      {
        version: "cxvccx",
        dateConfirmed: "12233",
        channel: "12312",
        verified: "123232"
      }
    ]
    };
    minka.person.create(data)
    .then((body) => console.log(body))
  • Retrieve a person
    minka.person.read(lukatag)
    .then((body) => console.log(body))
  • Retrieve all persons
    minka.person.list(sandToken)
    .then((body) => console.log(body))
  • Retrieve balance of a person
    minka.person.balance(lukatag)
    .then((body) => console.log(body))
  • Retrieve balance of a person
    minka.person.delet3(lukatag)
    .then((body) => console.log(body))

org

  • Create an org
    let data = {
    lukatag: "@orpes",
    name: "test",
    legalName: "legaltest",
    description: "description",
    logo: "testlogo",
    website: "http://www.test.com",
    isVerified: true,
    city: "gohtam",
    country: "dc comics",
    countryCode: "DC",
    street: "st 1",
    isVerified: true,
    type: "phone",
    value: "12432534546",
    isVerified: true,
    categories: [
      {
        sector: "testa",
        industryGroup: "testa",
        industry: "testa",
        subIndustry: "testa"
      }
    ],
    terms: [
      {
        version: "cxvccx",
        dateConfirmed: "",
        channel: "12312",
        verified: "123232"
      }
    ]
    };
    minka.org.create(data)
    .then((body) => console.log(body))
  • Retrieve an org
    minka.org.read(lukatag)
    .then((body) => console.log(body))
  • Retrieve all orgs
    minka.org.list(sandToken)
    .then((body) => console.log(body))
  • Retrieve balance of an org
    minka.org.balance(lukatag)
    .then((body) => console.log(body))
  • d\elete an org
    minka.org.delet3(lukatag)
    .then((body) => console.log(body))

transfer

  • create a transfer
    let dataTransfer = {
    destination: "@batman1",
    source: "@lco",
    currency: "LCO",
    value: "100",
    charges: {
      txt: "test"
    },
    metadata: {
      description: "test",
      des: "test"
    }
    };
    minka.transfer.create(dataTransfer, token)
    .then((body) => console.log(body))
  • retrieve transfers by lukatag
    minka.transfer.read(lukatag)
    .then((body) => console.log(body))
  • authorize a transfer
    minka.transfer.auth(id, token)
    .then((body) => console.log(body))

item

  • create an item
    let dataItem = {
    org: "59f8dc679d457a7e5f2d863f",
    amount: {
      value: "100",
      currency: "LCO"
    },
    charges: [
      {
        org: "59f8dc679d457a7e5f2d863f",
        amount: {
          value: "100",
          currency: "LCO"
        },
        metadata: {
          type: "testing",
          country: "test"
        }
      }
    ],
    categories: [
      {
        sector: "test",
        industryGroup: "test",
        industry: "test",
        subIndustry: "test"
      }
    ],
    references: [],
    metadata: {
      type: "TOPUP0",
    }
    };
    minka.item.create(dataItem)
    .then(body => console.log(body));
  • retrieve an item
    minka.item.read(itemId)
    .then((body) => console.log(body))
  • retrieve all items
    minka.item.list(sandToken)
    .then((body) => console.log(body))
  • delete an item
    minka.item.delet3(itemId)
    .then((body) => console.log(body))

contract

  • create a contract
    let dataCon = {
    item: "59fbee3689767e1ae138bc3b",
    person: "59fbb331a81566198dfa215f",
    metadata: {
      data: "test"
    }
    };
    minka.contract.create(dataCon)
    .then(body => console.log(body));
  • retrieve a contract
    minka.contract.read(contractId)
    .then(body => console.log(body));
  • retrieve all contracts
    minka.contract.list(sandToken)
    .then((body) => console.log(body))
  • delete a contract
    minka.contract.delet3(contractId)
    .then(body => console.log(body));

    gateway

  • create a gateway
    let dataGate = {
    name: "testing",
    lukatag: "@gatema",
    admin: "59fbb331a81566198dfa215f",
    parameters: {
      something: "test",
      test: "test"
    }
    };
    minka.gateway.create(dataGate)
    .then(body => console.log(body));
  • retrieve a gateway
    minka.gateway.read(gateId)
    .then(body => console.log(body));
  • delete a gateway
    minka.gateway.delet3(gateId)
    .then(body => console.log(body));