cpay-mtn-api

0.0.1 • Public • Published

MastercardMultiTokenNetworkAPI

MastercardMultiTokenNetworkApi - JavaScript client for MastercardMultiTokenNetworkAPI MTN (Multi Token Network) API is for customers and their consumers to

  • create account

  • buy/sell/hold cryptos

  • resolve alias and addresses

  • mint/transfer/burn tokenized deposits on blockchain This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 0.0.1

  • Package version: 0.0.1

  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://developer.mastercard.com/support

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install MastercardMultiTokenNetworkAPI --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your MastercardMultiTokenNetworkAPI from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('MastercardMultiTokenNetworkAPI') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var MastercardMultiTokenNetworkApi = require('MastercardMultiTokenNetworkAPI');


var api = new MastercardMultiTokenNetworkApi.AccountsApi()
var ica = 12321; // {String} Used for Customer identification in all service requests for a registered customer.
var account = new MastercardMultiTokenNetworkApi.Account(); // {Account} Request to create a new account for a registered customer.

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.accountPost(ica, account, callback);

Documentation for API Endpoints

All URIs are relative to https://api.mastercard.com/crypto

Class Method HTTP request Description
MastercardMultiTokenNetworkApi.AccountsApi accountPost POST /customers/{ica}/accounts Register a new consumer account identity.
MastercardMultiTokenNetworkApi.AccountsApi accountSearch POST /customers/{ica}/accounts/searches Search for an account's details.
MastercardMultiTokenNetworkApi.AccountsApi accountUpdate PUT /customers/{ica}/accounts Updates an account.
MastercardMultiTokenNetworkApi.AliasResolutionApi getAliasResolutionRequest GET /customers/{ica}/alias-resolutions/{request_id} Retrieve an account resolution request.
MastercardMultiTokenNetworkApi.AliasResolutionApi getAliasResolutionRequests GET /customers/{ica}/alias-resolutions Retrieve account resolution requests.
MastercardMultiTokenNetworkApi.AliasResolutionApi resolveAccountAlias POST /customers/{ica}/alias-resolutions Creates an account resolution request.
MastercardMultiTokenNetworkApi.AliasResolutionApi updateAccountResolutionRequest PUT /customers/{ica}/alias-resolutions/{request_id} Update an account resolution request.
MastercardMultiTokenNetworkApi.CryptoAddressesApi addCryptoAddress POST /customers/{ica}/crypto-addresses Adds a preferred crypto address for an account.
MastercardMultiTokenNetworkApi.CryptoAddressesApi decommissionCryptoAddress DELETE /customers/{ica}/crypto-addresses/{crypto_address_id} Decommissions a crypto address.
MastercardMultiTokenNetworkApi.CryptoAddressesApi getCryptoAddress GET /customers/{ica}/crypto-addresses/{crypto_address_id} Gets a crypto address.
MastercardMultiTokenNetworkApi.CryptoAddressesApi updateCryptoAddress PUT /customers/{ica}/crypto-addresses/{crypto_address_id} Updates a crypto address.
MastercardMultiTokenNetworkApi.EarmarksApi earmarkSearch GET /customers/{ica}/earmarks Retrieve earmarks details
MastercardMultiTokenNetworkApi.EarmarksApi getEarmark GET /customers/{ica}/earmarks/{earmark_id} Retrieve an earmark by using earmarkId
MastercardMultiTokenNetworkApi.EarmarksApi postEarmark POST /customers/{ica}/earmarks Creates an Earmark request
MastercardMultiTokenNetworkApi.EarmarksApi updateEarmark PUT /customers/{ica}/earmarks/{earmark_id} Update an earmark
MastercardMultiTokenNetworkApi.EarmarksApi updateEarmarkForCancel PUT /customers/{ica}/earmarks/{earmark_id}/cancel Request to cancel an earmark
MastercardMultiTokenNetworkApi.EarmarksApi updateEarmarkForDeposits PUT /customers/{ica}/earmarks/{earmark_id}/deposits Deposit funds for an Earmark.
MastercardMultiTokenNetworkApi.EarmarksApi updateEarmarkForRelease PUT /customers/{ica}/earmarks/{earmark_id}/release Request to release funds for an earmark
MastercardMultiTokenNetworkApi.FiatManagementApi getFiatBalance GET /customers/{ica}/fiat-balances Retrieves an existing fiat balance for a given customer.
MastercardMultiTokenNetworkApi.FiatWithdrawalsApi createFiatWithdrawal POST /customers/{ica}/fiat-withdrawals Initiates a new fiat withdrawal.
MastercardMultiTokenNetworkApi.FiatWithdrawalsApi getFiatWithdrawal GET /customers/{ica}/fiat-withdrawals/{fiat_withdrawal_id} Retrieves an existing fiat withdrawal.
MastercardMultiTokenNetworkApi.MarketApi getPrices GET /customers/{ica}/prices Retrieve prices.
MastercardMultiTokenNetworkApi.MarketApi getQuotes GET /customers/{ica}/quotes Retrieve latest quote.
MastercardMultiTokenNetworkApi.OrdersApi getOrder GET /customers/{ica}/orders/{order_id} Retrieve a consumer order.
MastercardMultiTokenNetworkApi.OrdersApi orderPost POST /customers/{ica}/orders Place a new consumer order.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApi getP2PInstructionRequest GET /customers/{ica}/peer-to-peer-instructions/{instruction_id} Retrieve a P2P instruction request.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApi getP2PInstructionRequests GET /customers/{ica}/peer-to-peer-instructions Retrieve P2P Instruction requests.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApi resolveP2PInstructionRequest POST /customers/{ica}/peer-to-peer-instructions Creates a P2P instruction request.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApi updateP2PInstructionRequest PUT /customers/{ica}/peer-to-peer-instructions/{instruction_id} Update a P2P instruction request.
MastercardMultiTokenNetworkApi.ReportsApi createReport POST /customers/{ica}/reports Create a report request
MastercardMultiTokenNetworkApi.ReportsApi getReport GET /customers/{ica}/reports/{report_id} Retrieve a report request
MastercardMultiTokenNetworkApi.ReportsApi getReportRequests GET /customers/{ica}/reports Retrieve report requests
MastercardMultiTokenNetworkApi.TokenManagementApi getBalances POST /customers/{ica}/token-balances Retrieve token balance.
MastercardMultiTokenNetworkApi.TokenManagementApi getOperation GET /customers/{ica}/token-operations/{operation_id} Retrieve details of token operation.
MastercardMultiTokenNetworkApi.TokenManagementApi submitOperation POST /customers/{ica}/token-operations Submit token operation.
MastercardMultiTokenNetworkApi.TokenSettlementApi getSettlementAdvisement GET /customers/{ica}/token-settlement-advisements Get Settlement Advisement.
MastercardMultiTokenNetworkApi.TravelRulesApi putBeneficiaryDetails PUT /customers/{ica}/travel-rule-transfers/{travel_rule_transfer_id}/beneficiary-details Provide beneficiary information required as per travel rules.
MastercardMultiTokenNetworkApi.TravelRulesApi putOriginatorDetails PUT /customers/{ica}/travel-rule-transfers/{travel_rule_transfer_id}/originator-details Provide originator information required as per travel rules.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

Readme

Keywords

none

Package Sidebar

Install

npm i cpay-mtn-api

Weekly Downloads

1

Version

0.0.1

License

Unlicense

Unpacked Size

439 kB

Total Files

92

Last publish

Collaborators

  • shaynos