1.5.1 • Published 1 year ago

metafab-javascript v1.5.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

metafab-javascript

MetafabJavascript - JavaScript client for metafab-javascript Complete MetaFab API references and guides can be found at: https://trymetafab.com This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.5.1
  • Package version: 1.5.1
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen For more information, please visit https://trymetafab.com

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 metafab-javascript --save

Finally, you need to build the module:

npm run build
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

To use the link you just defined in your project, switch to the directory you want to use your metafab-javascript from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

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):

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 MetafabJavascript = require('metafab-javascript');


var api = new MetafabJavascript.ContractsApi()
var xAuthorization = game_sk_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP; // {String} The `secretKey` of the authenticating game.
var createContractRequest = new MetafabJavascript.CreateContractRequest(); // {CreateContractRequest} 
api.createContract(xAuthorization, createContractRequest).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://api.trymetafab.com

ClassMethodHTTP requestDescription
MetafabJavascript.ContractsApicreateContractPOST /v1/contractsCreate custom contract
MetafabJavascript.ContractsApigetContractsGET /v1/contractsGet contracts
MetafabJavascript.ContractsApireadContractGET /v1/contracts/{contractId}/readsRead contract data
MetafabJavascript.ContractsApitransferContractOwnershipPOST /v1/contracts/{contractId}/ownersTransfer contract ownership
MetafabJavascript.ContractsApiupgradeContractTrustedForwarderPOST /v1/contracts/{contractId}/forwardersUpgrade contract trusted forwarder
MetafabJavascript.ContractsApiwriteContractPOST /v1/contracts/{contractId}/writesWrite contract data
MetafabJavascript.CurrenciesApibatchTransferCurrencyPOST /v1/currencies/{currencyId}/batchTransfersBatch transfer currency
MetafabJavascript.CurrenciesApiburnCurrencyPOST /v1/currencies/{currencyId}/burnsBurn currency
MetafabJavascript.CurrenciesApicreateCurrencyPOST /v1/currenciesCreate currency
MetafabJavascript.CurrenciesApigetCurrenciesGET /v1/currenciesGet currencies
MetafabJavascript.CurrenciesApigetCurrencyBalanceGET /v1/currencies/{currencyId}/balancesGet currency balance
MetafabJavascript.CurrenciesApigetCurrencyFeesGET /v1/currencies/{currencyId}/feesGet currency fees
MetafabJavascript.CurrenciesApigetCurrencyRoleGET /v1/currencies/{currencyId}/rolesGet currency role
MetafabJavascript.CurrenciesApigrantCurrencyRolePOST /v1/currencies/{currencyId}/rolesGrant currency role
MetafabJavascript.CurrenciesApimintCurrencyPOST /v1/currencies/{currencyId}/mintsMint currency
MetafabJavascript.CurrenciesApirevokeCurrencyRoleDELETE /v1/currencies/{currencyId}/rolesRevoke currency role
MetafabJavascript.CurrenciesApisetCurrencyFeesPOST /v1/currencies/{currencyId}/feesSet currency fees
MetafabJavascript.CurrenciesApitransferCurrencyPOST /v1/currencies/{currencyId}/transfersTransfer currency
MetafabJavascript.EcosystemsApiapproveEcosystemGamePOST /v1/ecosystems/{ecosystemId}/gamesApprove ecosystem game
MetafabJavascript.EcosystemsApiauthEcosystemGET /v1/ecosystems/authAuthenticate ecosystem
MetafabJavascript.EcosystemsApiauthProfileGET /v1/profiles/authAuthenticate profile
MetafabJavascript.EcosystemsApiauthProfilePlayerGET /v1/profiles/{profileId}/games/{gameId}/players/authAuthenticate profile player
MetafabJavascript.EcosystemsApicreateEcosystemPOST /v1/ecosystemsCreate ecosystem
MetafabJavascript.EcosystemsApicreateProfilePOST /v1/profilesCreate profile
MetafabJavascript.EcosystemsApicreateProfilePlayerPOST /v1/profiles/{profileId}/games/{gameId}/playersCreate profile player
MetafabJavascript.EcosystemsApigetEcosystemGET /v1/ecosystems/{ecosystemId}Get ecosystem
MetafabJavascript.EcosystemsApigetEcosystemGameGET /v1/ecosystems/{ecosystemId}/games/{gameId}Get ecosystem game
MetafabJavascript.EcosystemsApigetEcosystemGamesGET /v1/ecosystems/{ecosystemId}/gamesGet ecosystem games
MetafabJavascript.EcosystemsApigetProfileGameGET /v1/profiles/{profileId}/games/{gameId}Get profile game
MetafabJavascript.EcosystemsApigetProfileGamesGET /v1/profiles/{profileId}/gamesGet profile games
MetafabJavascript.EcosystemsApiunapproveEcosystemGameDELETE /v1/ecosystems/{ecosystemId}/games/{gameId}Unapprove ecosystem game
MetafabJavascript.EcosystemsApiupdateEcosystemPATCH /v1/ecosystems/{ecosystemId}Update ecosystem
MetafabJavascript.EcosystemsApiupdateProfilePATCH /v1/profiles/{profileId}Update profile
MetafabJavascript.EcosystemsApiupdateProfilePlayerPATCH /v1/profiles/{profileId}/games/{gameId}/players/{playerId}Update profile player
MetafabJavascript.GamesApiauthGameGET /v1/games/authAuthenticate game
MetafabJavascript.GamesApicreateGamePOST /v1/gamesCreate game
MetafabJavascript.GamesApigetGameGET /v1/games/{gameId}Get game
MetafabJavascript.GamesApiupdateGamePATCH /v1/games/{gameId}Update game
MetafabJavascript.ItemsApibatchMintCollectionItemsPOST /v1/collections/{collectionId}/batchMintsBatch mint collection items
MetafabJavascript.ItemsApibatchTransferCollectionItemsPOST /v1/collections/{collectionId}/batchTransfersBatch transfer collection items
MetafabJavascript.ItemsApiburnCollectionItemPOST /v1/collections/{collectionId}/items/{collectionItemId}/burnsBurn collection item
MetafabJavascript.ItemsApicreateCollectionPOST /v1/collectionsCreate collection
MetafabJavascript.ItemsApicreateCollectionItemPOST /v1/collections/{collectionId}/itemsCreate collection item
MetafabJavascript.ItemsApigetCollectionApprovalGET /v1/collections/{collectionId}/approvalsGet collection approval
MetafabJavascript.ItemsApigetCollectionItemGET /v1/collections/{collectionId}/items/{collectionItemId}Get collection item
MetafabJavascript.ItemsApigetCollectionItemBalanceGET /v1/collections/{collectionId}/items/{collectionItemId}/balancesGet collection item balance
MetafabJavascript.ItemsApigetCollectionItemBalancesGET /v1/collections/{collectionId}/balancesGet collection item balances
MetafabJavascript.ItemsApigetCollectionItemSuppliesGET /v1/collections/{collectionId}/suppliesGet collection item supplies
MetafabJavascript.ItemsApigetCollectionItemSupplyGET /v1/collections/{collectionId}/items/{collectionItemId}/suppliesGet collection item supply
MetafabJavascript.ItemsApigetCollectionItemTimelockGET /v1/collections/{collectionId}/items/{collectionItemId}/timelocksGet collection item timelock
MetafabJavascript.ItemsApigetCollectionItemsGET /v1/collections/{collectionId}/itemsGet collection items
MetafabJavascript.ItemsApigetCollectionRoleGET /v1/collections/{collectionId}/rolesGet collection role
MetafabJavascript.ItemsApigetCollectionsGET /v1/collectionsGet collections
MetafabJavascript.ItemsApigrantCollectionRolePOST /v1/collections/{collectionId}/rolesGrant collection role
MetafabJavascript.ItemsApimintCollectionItemPOST /v1/collections/{collectionId}/items/{collectionItemId}/mintsMint collection item
MetafabJavascript.ItemsApirevokeCollectionRoleDELETE /v1/collections/{collectionId}/rolesRevoke collection role
MetafabJavascript.ItemsApisetCollectionApprovalPOST /v1/collections/{collectionId}/approvalsSet collection approval
MetafabJavascript.ItemsApisetCollectionItemTimelockPOST /v1/collections/{collectionId}/items/{collectionItemId}/timelocksSet collection item timelock
MetafabJavascript.ItemsApitransferCollectionItemPOST /v1/collections/{collectionId}/items/{collectionItemId}/transfersTransfer collection item
MetafabJavascript.LootboxesApicreateLootboxManagerPOST /v1/lootboxManagersCreate lootbox manager
MetafabJavascript.LootboxesApigetLootboxManagerLootboxGET /v1/lootboxManagers/{lootboxManagerId}/lootboxes/{lootboxManagerLootboxId}Get lootbox manager lootbox
MetafabJavascript.LootboxesApigetLootboxManagerLootboxesGET /v1/lootboxManagers/{lootboxManagerId}/lootboxesGet lootbox manager lootboxes
MetafabJavascript.LootboxesApigetLootboxManagersGET /v1/lootboxManagersGet lootbox managers
MetafabJavascript.LootboxesApiopenLootboxManagerLootboxPOST /v1/lootboxManagers/{lootboxManagerId}/lootboxes/{lootboxManagerLootboxId}/opensOpen lootbox manager lootbox
MetafabJavascript.LootboxesApiremoveLootboxManagerLootboxDELETE /v1/lootboxManagers/{lootboxManagerId}/lootboxes/{lootboxManagerLootboxId}Remove lootbox manager lootbox
MetafabJavascript.LootboxesApisetLootboxManagerLootboxPOST /v1/lootboxManagers/{lootboxManagerId}/lootboxesSet lootbox manager lootbox
MetafabJavascript.PlayersApiauthPlayerGET /v1/players/authAuthenticate player
MetafabJavascript.PlayersApicreatePlayerPOST /v1/playersCreate player
MetafabJavascript.PlayersApigetPlayerGET /v1/players/{playerId}Get player
MetafabJavascript.PlayersApigetPlayerDataGET /v1/players/{playerId}/dataGet player data
MetafabJavascript.PlayersApigetPlayersGET /v1/playersGet players
MetafabJavascript.PlayersApiremovePlayerConnectedWalletDELETE /v1/players/{playerId}/wallets/{playerWalletId}Remove player connected wallet
MetafabJavascript.PlayersApisetPlayerConnectedWalletPOST /v1/players/{playerId}/walletsSet player connected wallet
MetafabJavascript.PlayersApisetPlayerDataPOST /v1/players/{playerId}/dataSet player data
MetafabJavascript.PlayersApiupdatePlayerPATCH /v1/players/{playerId}Update player
MetafabJavascript.ShopsApicreateShopPOST /v1/shopsCreate shop
MetafabJavascript.ShopsApigetShopOfferGET /v1/shops/{shopId}/offers/{shopOfferId}Get shop offer
MetafabJavascript.ShopsApigetShopOffersGET /v1/shops/{shopId}/offersGet shop offers
MetafabJavascript.ShopsApigetShopsGET /v1/shopsGet shops
MetafabJavascript.ShopsApiremoveShopOfferDELETE /v1/shops/{shopId}/offers/{shopOfferId}Remove shop offer
MetafabJavascript.ShopsApisetShopOfferPOST /v1/shops/{shopId}/offersSet shop offer
MetafabJavascript.ShopsApiuseShopOfferPOST /v1/shops/{shopId}/offers/{shopOfferId}/usesUse shop offer
MetafabJavascript.ShopsApiwithdrawFromShopPOST /v1/shops/{shopId}/withdrawalsWithdraw from shop
MetafabJavascript.TransactionsApigetTransactionGET /v1/transactions/{transactionId}Get transaction
MetafabJavascript.WalletsApicreateWalletSignaturePOST /v1/wallets/{walletId}/signaturesCreate wallet signature
MetafabJavascript.WalletsApigetWalletGET /v1/wallets/{walletId}Get wallet
MetafabJavascript.WalletsApigetWalletBalancesGET /v1/wallets/{walletId}/balancesGet wallet balances
MetafabJavascript.WalletsApigetWalletTransactionsGET /v1/wallets/{walletId}/transactionsGet wallet transactions

Documentation for Models

Documentation for Authorization

basicAuth

  • Type: HTTP basic authentication
1.5.1

1 year ago

1.5.0

1 year ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.4.1

1 year ago

1.1.4

2 years ago

1.1.3

2 years ago

1.3.0

1 year ago

1.2.1

2 years ago

1.1.43

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago