1.0.5 • Published 6 years ago

mp-bucket v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

mp-bucket

Easy to use library for Moneypot's bucket api.

Moneypot | API Docs

npm install mp-bucket --save

Usage:

const mp_bucket = require('mp-bucket');

mp_bucket.listBuckets({
  params: {
    auth_id: "Auth_ID_of_the_user_performing_the_request",
    app_secret: process.env.APP_SECRET || "your_app_secret"
  }
}, (err, res) => {
  if(err){
    console.error("Error:", err);
  }else{
    console.log("Res:", JSON.stringify(res));
  }
});

mp_bucket.createBucket({
  params: {
    auth_id: "Auth_ID_of_the_user_performing_the_request",
    app_secret: process.env.APP_SECRET || "your_app_secret"
  },
  fields: {
    bucket_name: "my_bucket_name",
    bucket_type: "strict", // Available types: ['closed', 'open', 'strict']
    coin: "btc"
  }
}, (err, res) => {
  if(err){
    console.error("Error:", err);
  }else{
    console.log("Res:", JSON.stringify(res));
  }
});

Methods

  • listBuckets: List all available buckets for the Auth. If not an app owner, closed buckets will NOT be listed.
  • bucketInfo: Get information about a single bucket.
  • createBucket: Create a bucket based on provided criteria.
  • destroyBucket: Destroy a bucket based on provided criteria. (Cannot be undone)
  • creditBucket: Create a credit transaction based on provided criteria. Credit transactions transfer funds into a bucket from the available auth balance of the specified user based on the coin type.
  • debitBucket: Create a debit transaction based on provided criteria. Debit transactions transfer funds from a bucket to the auth balance of the specified user based on the coin type.
  • txInfo: Get information about a specified transaction.

Bucket Types permissions

TypesOwner AuthPlayer Auth
closedCreate, View, Destroy, Credit, Debit
openCreate, View, Destroy, Credit, DebitCreate, View, Destroy, Credit, Debit
strictCreate, View, Destroy, Credit, DebitView, Credit
1.0.5

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago