0.0.1 • Published 5 months ago

cpay-mtn-api v0.0.1

Weekly downloads
-
License
Unlicense
Repository
-
Last release
5 months ago

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

ClassMethodHTTP requestDescription
MastercardMultiTokenNetworkApi.AccountsApiaccountPostPOST /customers/{ica}/accountsRegister a new consumer account identity.
MastercardMultiTokenNetworkApi.AccountsApiaccountSearchPOST /customers/{ica}/accounts/searchesSearch for an account's details.
MastercardMultiTokenNetworkApi.AccountsApiaccountUpdatePUT /customers/{ica}/accountsUpdates an account.
MastercardMultiTokenNetworkApi.AliasResolutionApigetAliasResolutionRequestGET /customers/{ica}/alias-resolutions/{request_id}Retrieve an account resolution request.
MastercardMultiTokenNetworkApi.AliasResolutionApigetAliasResolutionRequestsGET /customers/{ica}/alias-resolutionsRetrieve account resolution requests.
MastercardMultiTokenNetworkApi.AliasResolutionApiresolveAccountAliasPOST /customers/{ica}/alias-resolutionsCreates an account resolution request.
MastercardMultiTokenNetworkApi.AliasResolutionApiupdateAccountResolutionRequestPUT /customers/{ica}/alias-resolutions/{request_id}Update an account resolution request.
MastercardMultiTokenNetworkApi.CryptoAddressesApiaddCryptoAddressPOST /customers/{ica}/crypto-addressesAdds a preferred crypto address for an account.
MastercardMultiTokenNetworkApi.CryptoAddressesApidecommissionCryptoAddressDELETE /customers/{ica}/crypto-addresses/{crypto_address_id}Decommissions a crypto address.
MastercardMultiTokenNetworkApi.CryptoAddressesApigetCryptoAddressGET /customers/{ica}/crypto-addresses/{crypto_address_id}Gets a crypto address.
MastercardMultiTokenNetworkApi.CryptoAddressesApiupdateCryptoAddressPUT /customers/{ica}/crypto-addresses/{crypto_address_id}Updates a crypto address.
MastercardMultiTokenNetworkApi.EarmarksApiearmarkSearchGET /customers/{ica}/earmarksRetrieve earmarks details
MastercardMultiTokenNetworkApi.EarmarksApigetEarmarkGET /customers/{ica}/earmarks/{earmark_id}Retrieve an earmark by using earmarkId
MastercardMultiTokenNetworkApi.EarmarksApipostEarmarkPOST /customers/{ica}/earmarksCreates an Earmark request
MastercardMultiTokenNetworkApi.EarmarksApiupdateEarmarkPUT /customers/{ica}/earmarks/{earmark_id}Update an earmark
MastercardMultiTokenNetworkApi.EarmarksApiupdateEarmarkForCancelPUT /customers/{ica}/earmarks/{earmark_id}/cancelRequest to cancel an earmark
MastercardMultiTokenNetworkApi.EarmarksApiupdateEarmarkForDepositsPUT /customers/{ica}/earmarks/{earmark_id}/depositsDeposit funds for an Earmark.
MastercardMultiTokenNetworkApi.EarmarksApiupdateEarmarkForReleasePUT /customers/{ica}/earmarks/{earmark_id}/releaseRequest to release funds for an earmark
MastercardMultiTokenNetworkApi.FiatManagementApigetFiatBalanceGET /customers/{ica}/fiat-balancesRetrieves an existing fiat balance for a given customer.
MastercardMultiTokenNetworkApi.FiatWithdrawalsApicreateFiatWithdrawalPOST /customers/{ica}/fiat-withdrawalsInitiates a new fiat withdrawal.
MastercardMultiTokenNetworkApi.FiatWithdrawalsApigetFiatWithdrawalGET /customers/{ica}/fiat-withdrawals/{fiat_withdrawal_id}Retrieves an existing fiat withdrawal.
MastercardMultiTokenNetworkApi.MarketApigetPricesGET /customers/{ica}/pricesRetrieve prices.
MastercardMultiTokenNetworkApi.MarketApigetQuotesGET /customers/{ica}/quotesRetrieve latest quote.
MastercardMultiTokenNetworkApi.OrdersApigetOrderGET /customers/{ica}/orders/{order_id}Retrieve a consumer order.
MastercardMultiTokenNetworkApi.OrdersApiorderPostPOST /customers/{ica}/ordersPlace a new consumer order.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApigetP2PInstructionRequestGET /customers/{ica}/peer-to-peer-instructions/{instruction_id}Retrieve a P2P instruction request.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApigetP2PInstructionRequestsGET /customers/{ica}/peer-to-peer-instructionsRetrieve P2P Instruction requests.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApiresolveP2PInstructionRequestPOST /customers/{ica}/peer-to-peer-instructionsCreates a P2P instruction request.
MastercardMultiTokenNetworkApi.PeerToPeerInstructionsApiupdateP2PInstructionRequestPUT /customers/{ica}/peer-to-peer-instructions/{instruction_id}Update a P2P instruction request.
MastercardMultiTokenNetworkApi.ReportsApicreateReportPOST /customers/{ica}/reportsCreate a report request
MastercardMultiTokenNetworkApi.ReportsApigetReportGET /customers/{ica}/reports/{report_id}Retrieve a report request
MastercardMultiTokenNetworkApi.ReportsApigetReportRequestsGET /customers/{ica}/reportsRetrieve report requests
MastercardMultiTokenNetworkApi.TokenManagementApigetBalancesPOST /customers/{ica}/token-balancesRetrieve token balance.
MastercardMultiTokenNetworkApi.TokenManagementApigetOperationGET /customers/{ica}/token-operations/{operation_id}Retrieve details of token operation.
MastercardMultiTokenNetworkApi.TokenManagementApisubmitOperationPOST /customers/{ica}/token-operationsSubmit token operation.
MastercardMultiTokenNetworkApi.TokenSettlementApigetSettlementAdvisementGET /customers/{ica}/token-settlement-advisementsGet Settlement Advisement.
MastercardMultiTokenNetworkApi.TravelRulesApiputBeneficiaryDetailsPUT /customers/{ica}/travel-rule-transfers/{travel_rule_transfer_id}/beneficiary-detailsProvide beneficiary information required as per travel rules.
MastercardMultiTokenNetworkApi.TravelRulesApiputOriginatorDetailsPUT /customers/{ica}/travel-rule-transfers/{travel_rule_transfer_id}/originator-detailsProvide originator information required as per travel rules.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.