metafabinc/php-sdk

Complete MetaFab API references and guides can be found at: https://trymetafab.com

1.5.1 2023-02-20 00:07 UTC

This package is not auto-updated.

Last update: 2024-04-30 20:06:32 UTC


README

Complete MetaFab API references and guides can be found at: https://trymetafab.com

For more information, please visit https://trymetafab.com.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/MetaFab/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');




$apiInstance = new MetaFab\Api\ContractsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_authorization = game_sk_02z4Mv3c85Ig0gNowY9Dq0N2kjb1xwzr27ArLE0669RrRI6dLf822iPO26K1p1FP; // string | The `secretKey` of the authenticating game.
$create_contract_request = new \MetaFab\Model\CreateContractRequest(); // \MetaFab\Model\CreateContractRequest

try {
    $result = $apiInstance->createContract($x_authorization, $create_contract_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ContractsApi->createContract: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

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

Class Method HTTP request Description
ContractsApi createContract POST /v1/contracts Create custom contract
ContractsApi getContracts GET /v1/contracts Get contracts
ContractsApi readContract GET /v1/contracts/{contractId}/reads Read contract data
ContractsApi transferContractOwnership POST /v1/contracts/{contractId}/owners Transfer contract ownership
ContractsApi upgradeContractTrustedForwarder POST /v1/contracts/{contractId}/forwarders Upgrade contract trusted forwarder
ContractsApi writeContract POST /v1/contracts/{contractId}/writes Write contract data
CurrenciesApi batchTransferCurrency POST /v1/currencies/{currencyId}/batchTransfers Batch transfer currency
CurrenciesApi burnCurrency POST /v1/currencies/{currencyId}/burns Burn currency
CurrenciesApi createCurrency POST /v1/currencies Create currency
CurrenciesApi getCurrencies GET /v1/currencies Get currencies
CurrenciesApi getCurrencyBalance GET /v1/currencies/{currencyId}/balances Get currency balance
CurrenciesApi getCurrencyFees GET /v1/currencies/{currencyId}/fees Get currency fees
CurrenciesApi getCurrencyRole GET /v1/currencies/{currencyId}/roles Get currency role
CurrenciesApi grantCurrencyRole POST /v1/currencies/{currencyId}/roles Grant currency role
CurrenciesApi mintCurrency POST /v1/currencies/{currencyId}/mints Mint currency
CurrenciesApi revokeCurrencyRole DELETE /v1/currencies/{currencyId}/roles Revoke currency role
CurrenciesApi setCurrencyFees POST /v1/currencies/{currencyId}/fees Set currency fees
CurrenciesApi transferCurrency POST /v1/currencies/{currencyId}/transfers Transfer currency
EcosystemsApi approveEcosystemGame POST /v1/ecosystems/{ecosystemId}/games Approve ecosystem game
EcosystemsApi authEcosystem GET /v1/ecosystems/auth Authenticate ecosystem
EcosystemsApi authProfile GET /v1/profiles/auth Authenticate profile
EcosystemsApi authProfilePlayer GET /v1/profiles/{profileId}/games/{gameId}/players/auth Authenticate profile player
EcosystemsApi createEcosystem POST /v1/ecosystems Create ecosystem
EcosystemsApi createProfile POST /v1/profiles Create profile
EcosystemsApi createProfilePlayer POST /v1/profiles/{profileId}/games/{gameId}/players Create profile player
EcosystemsApi getEcosystem GET /v1/ecosystems/{ecosystemId} Get ecosystem
EcosystemsApi getEcosystemGame GET /v1/ecosystems/{ecosystemId}/games/{gameId} Get ecosystem game
EcosystemsApi getEcosystemGames GET /v1/ecosystems/{ecosystemId}/games Get ecosystem games
EcosystemsApi getProfileGame GET /v1/profiles/{profileId}/games/{gameId} Get profile game
EcosystemsApi getProfileGames GET /v1/profiles/{profileId}/games Get profile games
EcosystemsApi unapproveEcosystemGame DELETE /v1/ecosystems/{ecosystemId}/games/{gameId} Unapprove ecosystem game
EcosystemsApi updateEcosystem PATCH /v1/ecosystems/{ecosystemId} Update ecosystem
EcosystemsApi updateProfile PATCH /v1/profiles/{profileId} Update profile
EcosystemsApi updateProfilePlayer PATCH /v1/profiles/{profileId}/games/{gameId}/players/{playerId} Update profile player
GamesApi authGame GET /v1/games/auth Authenticate game
GamesApi createGame POST /v1/games Create game
GamesApi getGame GET /v1/games/{gameId} Get game
GamesApi updateGame PATCH /v1/games/{gameId} Update game
ItemsApi batchMintCollectionItems POST /v1/collections/{collectionId}/batchMints Batch mint collection items
ItemsApi batchTransferCollectionItems POST /v1/collections/{collectionId}/batchTransfers Batch transfer collection items
ItemsApi burnCollectionItem POST /v1/collections/{collectionId}/items/{collectionItemId}/burns Burn collection item
ItemsApi createCollection POST /v1/collections Create collection
ItemsApi createCollectionItem POST /v1/collections/{collectionId}/items Create collection item
ItemsApi getCollectionApproval GET /v1/collections/{collectionId}/approvals Get collection approval
ItemsApi getCollectionItem GET /v1/collections/{collectionId}/items/{collectionItemId} Get collection item
ItemsApi getCollectionItemBalance GET /v1/collections/{collectionId}/items/{collectionItemId}/balances Get collection item balance
ItemsApi getCollectionItemBalances GET /v1/collections/{collectionId}/balances Get collection item balances
ItemsApi getCollectionItemSupplies GET /v1/collections/{collectionId}/supplies Get collection item supplies
ItemsApi getCollectionItemSupply GET /v1/collections/{collectionId}/items/{collectionItemId}/supplies Get collection item supply
ItemsApi getCollectionItemTimelock GET /v1/collections/{collectionId}/items/{collectionItemId}/timelocks Get collection item timelock
ItemsApi getCollectionItems GET /v1/collections/{collectionId}/items Get collection items
ItemsApi getCollectionRole GET /v1/collections/{collectionId}/roles Get collection role
ItemsApi getCollections GET /v1/collections Get collections
ItemsApi grantCollectionRole POST /v1/collections/{collectionId}/roles Grant collection role
ItemsApi mintCollectionItem POST /v1/collections/{collectionId}/items/{collectionItemId}/mints Mint collection item
ItemsApi revokeCollectionRole DELETE /v1/collections/{collectionId}/roles Revoke collection role
ItemsApi setCollectionApproval POST /v1/collections/{collectionId}/approvals Set collection approval
ItemsApi setCollectionItemTimelock POST /v1/collections/{collectionId}/items/{collectionItemId}/timelocks Set collection item timelock
ItemsApi transferCollectionItem POST /v1/collections/{collectionId}/items/{collectionItemId}/transfers Transfer collection item
LootboxesApi createLootboxManager POST /v1/lootboxManagers Create lootbox manager
LootboxesApi getLootboxManagerLootbox GET /v1/lootboxManagers/{lootboxManagerId}/lootboxes/{lootboxManagerLootboxId} Get lootbox manager lootbox
LootboxesApi getLootboxManagerLootboxes GET /v1/lootboxManagers/{lootboxManagerId}/lootboxes Get lootbox manager lootboxes
LootboxesApi getLootboxManagers GET /v1/lootboxManagers Get lootbox managers
LootboxesApi openLootboxManagerLootbox POST /v1/lootboxManagers/{lootboxManagerId}/lootboxes/{lootboxManagerLootboxId}/opens Open lootbox manager lootbox
LootboxesApi removeLootboxManagerLootbox DELETE /v1/lootboxManagers/{lootboxManagerId}/lootboxes/{lootboxManagerLootboxId} Remove lootbox manager lootbox
LootboxesApi setLootboxManagerLootbox POST /v1/lootboxManagers/{lootboxManagerId}/lootboxes Set lootbox manager lootbox
PlayersApi authPlayer GET /v1/players/auth Authenticate player
PlayersApi createPlayer POST /v1/players Create player
PlayersApi getPlayer GET /v1/players/{playerId} Get player
PlayersApi getPlayerData GET /v1/players/{playerId}/data Get player data
PlayersApi getPlayers GET /v1/players Get players
PlayersApi removePlayerConnectedWallet DELETE /v1/players/{playerId}/wallets/{playerWalletId} Remove player connected wallet
PlayersApi setPlayerConnectedWallet POST /v1/players/{playerId}/wallets Set player connected wallet
PlayersApi setPlayerData POST /v1/players/{playerId}/data Set player data
PlayersApi updatePlayer PATCH /v1/players/{playerId} Update player
ShopsApi createShop POST /v1/shops Create shop
ShopsApi getShopOffer GET /v1/shops/{shopId}/offers/{shopOfferId} Get shop offer
ShopsApi getShopOffers GET /v1/shops/{shopId}/offers Get shop offers
ShopsApi getShops GET /v1/shops Get shops
ShopsApi removeShopOffer DELETE /v1/shops/{shopId}/offers/{shopOfferId} Remove shop offer
ShopsApi setShopOffer POST /v1/shops/{shopId}/offers Set shop offer
ShopsApi useShopOffer POST /v1/shops/{shopId}/offers/{shopOfferId}/uses Use shop offer
ShopsApi withdrawFromShop POST /v1/shops/{shopId}/withdrawals Withdraw from shop
TransactionsApi getTransaction GET /v1/transactions/{transactionId} Get transaction
WalletsApi createWalletSignature POST /v1/wallets/{walletId}/signatures Create wallet signature
WalletsApi getWallet GET /v1/wallets/{walletId} Get wallet
WalletsApi getWalletBalances GET /v1/wallets/{walletId}/balances Get wallet balances
WalletsApi getWalletTransactions GET /v1/wallets/{walletId}/transactions Get wallet transactions

Models

Authorization

basicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

metafabproject@gmail.com

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.5.1
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen