Game "Wallet" & "Funding Wallet" Explained
Overview
Every created Game
on MetaFab has 2 unique wallet addresses permanently attached to it at the time of creation.
Upon your game's creation or upon using the GET /v1/games
endpoint to get your games credentials, you'll receive an object like the example below in the response body.
{
"id": "f650d779-49f8-4473-9641-ac434f8aabd0",
"walletId": "355f6014-4175-45e8-a4f2-621b7b732089",
"fundingWalletId": "87d62864-90fe-442c-a9bc-7e160ab43091",
"email": "[email protected]",
"name": "Test Game",
"publishedKey": "game_pk_LNdBVZyq+dYLsx1BJR8jjGNaTr5o4mqVqeafDfghrp+IkT5QYO7uzYspzWH/3sAV",
"secretKey": "game_sk_TMP+kfnTOTqAddMpvSoATROXdRbzCiZfpAnxn7xrwq83aV3hn9HejHVRHnSmaAqK",
"updatedAt": "2022-09-15T00:06:19.629Z",
"createdAt": "2022-09-15T00:06:19.628Z",
"wallet": {
"id": "355f6014-4175-45e8-a4f2-621b7b732089",
"address": "0x9eFe5e591BD8687E180dD8219dC6B2C96426f390"
},
"fundingWallet": {
"id": "87d62864-90fe-442c-a9bc-7e160ab43091",
"address": "0x5A21E6935D72afe031dEe79d847aCcB77B564B44"
},
"walletDecryptKey": "bb6aebb024c3211e44a07be2c4c4a2e6c7a4241c095d446ea834664bccb1dfc2"
}
If you look at the response, you'll notice your game has a wallet
and fundingWallet
, with an address
tied to both wallet types.
The address of each wallet represents the primary wallet (wallet
) and funding wallet (fundingWallet
) of your game on all EVM-based chains supported by MetaFab. The addresses are the same on all chains.
Primary Wallet
Your game's primary wallet (wallet
) is used to deploy and control smart contracts through MetaFab. When you want to create a new game currency, or launch a new set of items for example, MetaFab will authenticate your request to do so and use your wallet
. Your wallet
submit the creation of your contract to the target network of your choosing.
Native token balance from your wallet
is used to cover the cost of contract deployments or your wallet
's direct interactions with contracts.
If your wallet
does not have a sufficient native token balance for a chain you're attempting to deploy a contract to, or interact with a contract for, your API request(s) will return a 400 - Bad Request
error with a related error message.
Funding Wallet
Your game's funding wallet (fundingWallet
) is used to cover the transaction fees on behalf of your game's players to support gasless transactions. If your fundingWallet
does not have a sufficient balance of native tokens for the chain your players are interacting with, then your players will be unable to transact and API requests on their behalf will fail with a 400 - Bad Request
error with a related error message.
Please see Understanding MetaFab's Gasless Transactions
to learn more.
Updated 10 months ago