This package has been deprecated

Author message:

WARNING: This project has been renamed to @builtbybit/api-wrapper. Install using @builtbybit/api-wrapper instead.

mcm-js-api-wrapper
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

MC-Market's Official Node.js API Wrapper

npm npm type definitions npm npm version NPM

An official asynchronous Node.js wrapper for MC-Market's Ultimate API.

  • A Promise-based design built upon axios.
  • Stalls requests when a dynamic rate limiting error is encountered.
  • Full coverage of the Ultimate API.
  • A comprehensive set of relevant usage examples.
  • Automatically generated TypeScript declarations.
  • Automatically generated and hosted documentation.

Installation & Basic Usage

Install via npm:

npm i mcm-js-api-wrapper

Initialise wrapper and fetch information about yourself via Promise's .then() notation:

const { Wrapper, Token, TokenType } = require("mcm-js-api-wrapper");

let token = new Token(TokenType.PRIVATE, "Find @ https://www.mc-market.org/account/api");
let wrapper = new Wrapper();

// We catch any Promise rejections ourselves.
wrapper.init(token).then(wrapper.members().self().then(self => {
    console.log(self);
})).catch(error => {
    console.log("ERROR: " + error);
});

Initialise wrapper and fetch information about yourself via async/await:

const { Wrapper, Token, TokenType } = require("mcm-js-api-wrapper");

let token = new Token(TokenType.PRIVATE, "Find @ https://www.mc-market.org/account/api");
let wrapper = new Wrapper();
...

// Let the caller catch any Promise rejections. Else, use a try-catch block.
await wrapper.init(token);
console.log(await wrapper.members().self());

An comprehensive set of examples can be found under the /examples directory.

Contributions

We welcome contributions in the form of bug fixes or otherwise. All pull requests will be reviewed and changes may be requested before merging. Though, please seek advice regarding the introduction of additional features via an issue before working on them - we may have reasons not to introduce the given feature, or may want to introduce it via a different approach.

Whilst no contribution guidelines exist currently, please ensure you:

  • Develop with readability in mind.
  • Comment appropriately where non-obvious approaches or invariants are being enforced.
  • Include documentation comments where appropriate.
  • Never regenerate live documentation - this is done upon each version release.
  • Regenerate staged documentation via npm run doc-staged.
  • Regenerate type declarations via npm run type if modifying class/function signatures.
  • Use npm run lint and correct any linting errors within your final commit.

Issues & Support

The issues tracker for this repository should only be used to report bugs or issues with this official Node.js wrapper.

For bugs or issues related to the Ultimate API itself, please open a support ticket or create a bug report on our platform.

Package Sidebar

Install

npm i mcm-js-api-wrapper

Weekly Downloads

1

Version

1.1.5

License

MIT

Unpacked Size

12.3 MB

Total Files

1619

Last publish

Collaborators

  • majored