metapro
  • 🤝Welcome!
  • 💻metapro market
    • Set your account
    • Connect wallet + web3 login
    • Side panel
      • Transfer NFT
        • Multiple transfer (Airdrop NFT)
          • Import CSV List
      • Sell NFT
        • Initial NFT Selling (INS)
          • How to setup INS auction
          • How to buy on INS auction
        • Buy Now
          • How to setup Buy Now auction
          • How to buy on Buy Now auction
        • Auction (Bidding)
          • How to setup Auction
          • How to buy on Auction
      • All NFT assets
    • Buy Crypto
    • Top Menu
      • Profile
        • Profile Marketplace
        • My games
        • My assets
          • Royalty
        • Activities
      • Referral Panel
        • Register your downline
        • Downline wallets
        • My referral link
      • Profile Settings
      • Developer Portal
      • Logout
    • Assets
      • Marketplace
        • Auction Card
      • Most favorite
      • Newest assets
        • Asset Card
    • Games
      • Show all games
    • Leaderboard
    • Create asset (minter)
      • Gaming asset specification
      • How to create (mint) asset
        • 1. Setup NFT token
        • 2. Setup metadata
        • 3. Add meta asset
        • 4. Mint meta asset
        • 5. Meta asset created
    • Developers Portal
      • Create team
      • Create game
      • Developers Portal Panel
      • Unity Plugin
      • How to list game on metapro market?
    • Creators
    • Teams
    • Users
    • Wallet App
    • Launcher
    • Market and auction component fees
  • 🚀METAPRO LAUNCHER
    • What is metapro launcher?
    • Download launcher
    • Set your account
      • Login to launcher
    • Home
    • Games
      • Game card on launcher
        • Assets in this game
      • Install game on launcher
      • Update game on launcher
    • My games
      • Installed
      • Not installed
      • Wishlist
    • My assets
      • Collected assets
      • Created assets
      • Wishlist
    • NODEs app
  • 📱metapro one
    • About non-custodial wallet
    • Download & set up
      • Create new metapro wallet
      • Import existing wallet
    • Settings
      • Avatar
      • Multiple wallets
      • Wallet name
      • Private Key
        • Protect Private Key
        • How to find my Private Key
      • Recovery Phrases
        • Protect Recovery Phrases
        • How to find my Recovery Phrases
      • Application version
    • Network switch
    • Deposit (Tokens and Collectibles)
    • Send (Tokens and Collectibles)
      • Send Tokens
      • Send Collectibles (NFT)
    • Buy (Buy and Sell Crypto)
    • Browser
    • My assets
      • Tokens
        • Asset view
        • Adding Tokens
        • Activities
      • Collectibles (NFT)
      • Game assets (NFTma)
    • Explore
      • Apps
      • Collections (NFT)
      • Game assets (NFTma)
    • How to claim Airdrop
    • How to import wallet from MetaMask to metapro
    • Supported devices
  • ⛓️metapro protocol
    • API
      • Users service
      • Teams service
      • Apps service
      • Nft service
      • Nft events service
    • Meta asset
    • Metadata structure
    • Protocole structure
    • Unity Plugin
      • About metapro Unity plugin
      • What's new
      • Guides
        • Installation
        • Requirements
        • Package samples
        • Quick start
          • 1. Editor
            • Access tool
            • Import game key
            • Download resources
            • App data object
            • Change game key
            • Use app data in script
          • 2. Play mode (PC)
            • Enable Web3 in your game
            • Choose provider
            • Connect wallet
            • Login with Web3
            • Display user data
            • Show app tokens
            • Use user and app data from script
          • 3. Play mode (Mobile)
            • Enable Web3 in Your game
            • Choose provider
            • Connect wallet
            • Login with Web3
        • AFP (Additional Features Packages)
          • 1. Safe token transfer
          • 2. Phoenix
        • Troubleshooting
      • Reference
        • MetaproAPPSetup
        • Editor Window
        • Plugin Manager
        • Web3 connection providers
          • metapro
          • Wallet Connect
          • MetaMask
        • WindowController
        • AFP (Additional Features Packages)
          • SafeTransferFrom
          • Phoenix
  • 🛠️WALLET CONNECTOR
    • Introduction
    • Basic informations
      • Next 13 integration
      • React integration
      • Manual installation
  • 👨‍💻Developer Documentation
    • Introduction to Developer Documentation
      • What is a Meta asset?
      • What are the Benefits of Using Tokens as Access Keys for the Game Application
      • Why should I Choose the Meta Assets as the Access Keys for the Game Application?
      • How Does It Work, Exactly?
    • Available Environments
    • Blockchain Communication and information retrieval
      • How can we verify/distinguish a user?
      • How can we track a user's transactions?
      • What information can we obtain?
    • Integration with the Leaderboard service
    • Integration for in-Wallet Apps
    • Integration for Telegram Mini Apps
      • Integration Architecture and Configuration
      • Authorization and Session Management
      • Example Integration and Features
      • Code Examples from the Repository
      • Summary and Appendices
    • Developer documentation for the Construct 3 Plugin
      • Construct 3 - Install plugin
      • Plugin Configuration
      • User onboarding and authorization
      • User Management
      • Score System
      • Leaderboard System
      • Referral System
      • Gameplay
      • Smart Contract Interactions
      • User NFTs
      • Error Handling
      • Additional Getters for Plugin Properties
    • Integration Web3 with Your Game
      • What is Web3
      • Blockchain Basics
      • Differences between chains
      • What is a NFT
      • Advantages of Web3 Gaming
      • Examples of Web3 Games
    • Onboarding the Web3 Player
      • Value for Players
      • Explanation of Cryptocurrency Wallet
      • Rewards for Tournament Participation
      • Reselling Owned Assets
      • Integration of Metapro Wallet Connector
      • Displaying Data for Unlogged Users
      • How to Get Authorization Data
      • User Authorization Benefits
    • Creating Your First Meta Asset
      • The Difference between NFT and Meta Asset
      • Security and Transparency
      • Concept and Value of Meta Assets
      • How and Where to Create Your Meta Asset
        • Step-by-Step Guide on How to Create Your Asset
        • Explanation of URI (Metadata structure)
        • Explanation of the Meta Asset Data taken from our Back End
    • Implementing Meta Assets into Your Game
      • Integrate your Meta Asset to your game using Unity
      • Verify User Tokens Ownership
      • Displaying All User-Owned Tokens
      • Displaying All Assets Assigned to the Game on the Metapro Market
    • Smart Contracts
      • MetaproINS
        • Read Contract
        • Write Contract
      • MetaproBuyNow
        • Read Contract
        • Write Contract
      • MetaproAuction
        • Read Contract
        • Write Contract
      • MetaproMetaAsset
        • Read Contract
        • Write Contract
      • MetaproRoyalty
        • Read Contract
        • Write Contract
      • MetaproReferral
        • Read Contract
        • Write Contract
      • MetaproAirdrop
        • Read Contract
        • Write Contract
    • Universal Links & App Links with WalletConnect
  • 🔎General information
    • Blockchain
    • Blockchain Network Fee
    • Blockchain Native Token
    • Token ERC-1155 vs ERC-721
  • 📄Release Notes
    • Introduction to the Release Notes
    • Marketplace Updates
      • Release 07.03.2024
      • Release 06.03.2024
      • Release 04.03.2024
      • Release 19.02.2024
      • Release 24.01.2024
      • Release 09.01.2024
      • Release 03.01.2024
      • Release 21.12.2023
      • Release 18.12.2023
      • Release 13.12.2023
      • Release 12.12.2023
      • Release 02.12.2023
      • Release 30.11.2023
      • Release 24.11.2023
      • Release 22.11.2023
      • Release 17.11.2023
      • Release 13.11.2023
      • Release 09.11.2023
      • Release 08.11.2023
      • Release 07.11.2023
      • Release 31.10.2023
      • Release 26.10.2023
      • Release 25.10.2023
      • Release 24.10.2023
      • Release 18.10.2023
      • Release 05.10.2023
      • Release 03.10.2023
      • Release 29.09.2023
      • Release 18.09.2023
      • Release 14.09.2023
      • Release 12.09.2023
      • Release 06.09.2023
      • Release 25.08.2023
      • Release 17.08.2023
      • Release 04.08.2023
      • Release 31.07.2023
      • Release 21.07.2023
      • Release 18.07.2023
      • Release 13.07.2023
    • Games Launcher Updates
      • Release 13.03.2024
      • Release 24.01.2024
      • Release 04.01.2024
      • Release 22.11.2023
      • Release 03.10.2023
      • Release 31.07.2023
      • Release 27.07.2023
      • Release 20.07.2023
      • Release 13.07.2023
    • Wallet Updates
      • Release 04.03.2024
      • Release 03.10.2023
      • Release 29.09.2023
      • Release 15.09.2023
      • Release 30.08.2023
      • Release 18.07.2023
Powered by GitBook
On this page
  • What is the in-Wallet app?
  • The Biggest Advantages of Using In-Wallet Apps
  • Use Cases for Your Project
  • How can I list my game in metapro Wallet?
  • Possible scenarios to list the game
  • 1. Simple web application
  • 2. Integration with in-Wallet provider
  • 3. Integration with metaproID system using in-Wallet provider
  • Endpoints needed to integrate in-Wallet app with metaproID
  • Generate login hash
  • Check if the user exists based on the wallet address
  • Logging into an existing account or creating a new account
  1. Developer Documentation

Integration for in-Wallet Apps

PreviousIntegration with the Leaderboard serviceNextIntegration for Telegram Mini Apps

Last updated 7 months ago

What is the in-Wallet app?

In-wallet apps present opportunities for browser game developers by providing direct access to a large and engaged audience of metapro wallet users. The interface, where these wallet-integrated games are launched, enables quick and smooth interaction with wallet users, allowing developers to harness the vast potential of the web3 ecosystem. Additionally, the built-in provider facilitates web3 transactions and direct connections with wallet users, eliminating the need for traditional logins and passwords.

The Biggest Advantages of Using In-Wallet Apps

  • Account Creation and DApp Integration: Easily create game accounts and DApps using web3 login directly from the wallet.

  • Enhanced Security: All transactions are encrypted, ensuring high-level security as a core priority of the metapro protocol.

  • Built-in Provider Support: In-wallet apps support logging into the injected provider, allowing any project that connects to web3 this way to use it without needing to develop additional features.

  • Developer-Friendly Documentation: Comprehensive and developer-friendly documentation enables the use of many powerful metapro features, including game leaderboards and NFT listings.

  • Community-Driven Development (CDD): metapro adopts a Community-Driven Development approach, considering the needs of the community and the projects integrating with us to build an exceptional gaming ecosystem.

Use Cases for Your Project

  • Retention: Foster user engagement by building a community around games, utilizing shared leaderboards, and allowing users to easily add in-wallet games to their favorites.

  • Web3 Transactions: Conduct secure transactions using a multichain wallet, offering flexibility beyond a single network.

How can I list my game in metapro Wallet?

Any project can easily apply to metapro to list its game within the wallet. If the game is ready and has essential elements like a title, description, and a link where users can start playing, the next step is simply to fill out a straightforward submission form and provide promotional materials for the game. User engagement can increase when they utilize the wallet's built-in features, such as logging into the game via the integrated web3 provider within the same window where the game launches. Link to form:

Possible scenarios to list the game

1. Simple web application

Browser game development is typically associated with the use of HTML, CSS, and JavaScript. Many developers also leverage pre-built engines like Construct2/Construct3, Godot, GameMaker, and others. Regardless of the tools used, developers should prioritize ensuring that the game runs smoothly and delivers an enjoyable experience.

Metapro Wallet allows you to list simple web applications. These applications can be added to our directory even if they do not have advanced features such as login methods, external integrations, or user management systems.

We only require that the application be fully functional and comply with the security and usability guidelines that apply to our application. As a result, even the simplest applications that serve entertainment, education, or other purposes can easily find their place in metapro Wallet and be accessible to a wide range of users.

2. Integration with in-Wallet provider

Each in-wallet game is launched within the wallet window, which has direct access to the web3 provider. By using the @ethersproject/providers library, we can create an instance of the provider that includes a signer—i.e., the wallet user.

It's important to note that this approach does not rely on the WalletConnect package but instead uses the injected Ethereum provider directly.

import {ExternalProvider, Web3Provider} from '@ethersproject/providers'

const provider = new Web3Provider(window.ethereum as ExternalProvider)

const signer = await privider.getSigner()
const address = await signer.getAccount()

// address that is currently logged in from provider

Reading the web3 data

const balance = await provider.getBalance(accountAddress);
console.log(`Balance: ${balance.toString()} wei`);

const blockNumber = await provider.getBlockNumber();
console.log(`Current block number: ${blockNumber}`);

const gasPrice = await provider.getGasPrice();
console.log(`Current gas price: ${gasPrice.toString()} wei`);

const network = await provider.getNetwork();
console.log(`Network: ${network.name} (${network.chainId})`);

Sending transactions

const blockNumber = await provider.send('eth_blockNumber', []);

const balance = await provider.send('eth_getBalance', ['0xYourAccountAddress', 'latest']);

const chainId = await provider.send('eth_chainId', []);

3. Integration with metaproID system using in-Wallet provider

In the metaproID ecosystem, developers have the option to list their apps as in-Wallet Apps in our metapro Wallet. To get the most out of our ecosystem, developers can integrate their apps into metaproID using Web3 technology.

Integration with metaproID via in-Wallet provider

MetaproID provides a comprehensive API to manage user identity and authorization within the ecosystem. Developers can add support for Web3 in their in-Wallet Apps to allow users to securely log in and interact with the app using their cryptocurrency wallets.

Example of the login process

  1. The user initiates the login process via the app.

  2. A Web3Provider object is created in the browser using window.ethereum.

  3. A GET request is made to /v2/auth/web3/signature/hash with a header containing the wallet address (x-account-wallet).

  4. The user signs a message using the personal_sign function.

  5. The signed message is returned to the API, which checks if the user has an account and whether they have accepted the terms of service.

  6. If the user has an account and has accepted the terms, a POST request is sent to /v2/auth/web3/login to complete the login process.

Example of the account creation process

The process is similar to the login process, with the difference being that if the user does not have an account or has not accepted the terms, additional information is sent during the POST request to /v2/auth/web3/login, such as personal details and terms acceptance.

Endpoints needed to integrate in-Wallet app with metaproID

Generate login hash

GET /v2/auth/web3/signature/hash

This endpoint is used to get a hash for the login process. It is required to log in with a wallet address.

Headers

Name
Example value

x-account-wallet

0xd1afbab5cacb45491ce002a6026c1401340eae6a

Response

{
  "hash": "string"
}

Check if the user exists based on the wallet address

GET /v2/auth/web3/check/{wallet}

Check if the user has an account in the system and if he has to accept the regulations based on WEB3

Params

Name
Type
Required
Description

wallet

string

true

The wallet address to check

Query

Name
Type
Required
Description

projectId

string

true

The project ID to check the wallet against

externalAccountType

string

false

The type of external account to check

Response

{
  "hasAccount": true,
  "hasRulesChecked": true,
  "hasExternalAccount": true
}
{
  "statusCode": 400,
  "messages": [
    "Name must be in string format",
    "Name must be minimum 2 characters long"
  ],
  "error": "Bad Request"
}

Logging into an existing account or creating a new account

POST /v2/auth/web3/login

Login user if he exists in the database or create a new account

Headers

Name
Example value

x-account-login-hash

FjWEtwGDoWmD7NAk5b6niTZFAG1Di-r6BgtzmLqWWBFGlKbPiM

x-account-wallet

0xd1afbab5cacb45491ce002a6026c1401340eae6a

Body

Name
Type
Required
Description

wallet

string

true

Wallet address

signature

string

true

Signature

projectId

string

true

Project ID

rulesChecked

boolean

false

Rules checkbox used in the registration process or in the rules acceptance process with an existing account

personalDetails

object

false

Personal details of the user used in the registration process

referralSettingsId

string

false

Referral settings ID used in the registration process

referralCode

string

false

Referral code used in the registration process

externalLoginData

object

false

External login data used in the registration process

Response

{
  "token": {
    "accessToken": "string",
    "tokenType": "string"
  },
  "account": {
    "id": "572843fa-9eb3-45d6-82ba-33ba5b4406c7",
    "userId": "572843fa-9eb3-45d6-82ba-33ba5b4406c7",
    "isMetaproAdmin": false,
    "elympicsUserId": "572843fa-9eb3-45d6-82ba-33ba5b4406c7",
    "role": [
      "user"
    ],
    "addresses": [
      {
        "wallet": "0xdd094342c13F9E4340E2c07C63D9fD98e7BA1C62"
      }
    ],
    "socialMedia": [
      {
        "name": "steam",
        "value": "https://steam.com/my-account",
        "createdAt": "2022-05-25T16:17:01.797Z",
        "updatedAt": "2022-05-25T16:17:01.797Z"
      }
    ],
    "externalAccounts": [
      {
        "name": "steam",
        "data": {},
        "createdAt": "2022-05-25T16:17:01.797Z",
        "updatedAt": "2022-05-25T16:17:01.797Z"
      }
    ],
    "rulesCheckbox": {
      "checked": true,
      "updatedAt": "2022-05-25T16:17:01.797Z"
    },
    "personalDetails": {
      "email": "email@test.com",
      "username": "johny_bravo",
      "country": "PL",
      "firstName": "Adam",
      "lastName": "Kowalski",
      "birthDate": "2022-05-25T16:17:01.797Z",
      "bio": "Some text about me",
      "avatar": "qwer-qwer-qwer-qwer.png",
      "banner": "fda-fda-fdsa-fdas.jpg",
      "updatedAt": "2022-05-25T16:17:01.797Z"
    },
    "engagementPoints": 0,
    "visitedAt": "2022-05-25T16:17:01.797Z",
    "createdAt": "2022-05-25T16:17:01.797Z",
    "updatedAt": "2022-05-25T16:17:01.797Z"
  }
}
{
  "statusCode": 400,
  "messages": [
    "Name must be in string format",
    "Name must be minimum 2 characters long"
  ],
  "error": "Bad Request"
}

DEMO repo: DEMO app build:

👨‍💻
https://forms.clickup.com/26441698/f/t6xz2-11152/384ALI6TOS1JCO0H89
https://github.com/Augmented-Life-Studio/metapro-injected-web
https://demo-app.metapro.one
Diagram illustrates the login flow in metaproID
The diagram shows an example of the user login process for metaproID using provider web3