From c52bfd9d5ea58f73dba49c26ff89a0730ee4b529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Lewi=C5=84ski?= Date: Tue, 7 Nov 2023 16:11:25 +0100 Subject: [PATCH] Chore: fix minor mistakes (#100) --- pages/service/assets.mdx | 10 +++++----- pages/service/assets/managing-profile-assets.mdx | 8 ++++---- pages/service/assets/reading-profile-assets.mdx | 2 +- pages/service/companion/connecting-your-users.mdx | 6 +++--- pages/service/companion/introduction.mdx | 2 +- pages/service/companion/verifying-webhooks.mdx | 2 +- pages/service/marketplace/introduction.mdx | 4 ++-- pages/service/marketplace/listing-assets.mdx | 6 +++--- pages/service/profiles/match-profiles.mdx | 8 ++++---- pages/service/profiles/minting-profiles.mdx | 4 ++-- pages/service/profiles/treasury-profiles.mdx | 4 ++-- pages/service/profiles/users-and-profiles.mdx | 6 +++--- pages/service/transactions/custom-charges.mdx | 2 +- pages/service/transactions/custom-transactions.mdx | 2 +- .../service/transactions/profile-paid-transactions.mdx | 6 +++--- 15 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pages/service/assets.mdx b/pages/service/assets.mdx index 78602d7..9693f10 100644 --- a/pages/service/assets.mdx +++ b/pages/service/assets.mdx @@ -2,19 +2,19 @@ title: Assets in Beam --- -import { Callout } from 'nextra/components' +import { Callout } from "nextra/components"; # Assets -Asset management is a crucial part of the Beam integration within your game. Depending on-chain activities that you want to support your in-game economy, you have the option to manage assets on behalf of the profiles you created, but also list - buy and make offers on assets through the Beam sdk. - -By providing these options through the sdk, you are able to create a frictionless in-game marketplace build on beam without having to worry about creating infrastructure to support it. +Asset management is a crucial part of the Beam integration within your game. Depending on on-chain activities that you want to support in your in-game economy, you have the option to manage assets on behalf of the profiles you created, but also list - buy and make offers on assets through the Beam sdk. +By providing these options through the sdk, you are able to create a frictionless in-game marketplace built on beam without having to worry about creating infrastructure to support it. ### Roadmap Throughout the coming months, we'll be releasing additional features that will help you to provide a more complete marketplace experience, with features ranging from programmatic offers, auctions and extensive filtering options to allow you to create a full-fledged in-game marketplace solely by relying on the Beam marketplace. -Feel like something is missing, and needs to be prioritized? Check out our [2023 roadmap](/service/roadmap) or let's have a chat through build@onbeam.com + Feel like something is missing, and needs to be prioritized? Check out our + [2023 roadmap](/service/roadmap) or let's have a chat through build@onbeam.com diff --git a/pages/service/assets/managing-profile-assets.mdx b/pages/service/assets/managing-profile-assets.mdx index 9ae6155..65c92f6 100644 --- a/pages/service/assets/managing-profile-assets.mdx +++ b/pages/service/assets/managing-profile-assets.mdx @@ -12,7 +12,7 @@ Note that depending on the role of our companion app within your game, [users th ### Currency transfers (ERC20) -If we registered an ERC20 contract for your game, you are able to manage the ERC20 assets in all the profiles that you created. Sending around these tokens is easy. We simply expect you to know the ID of the sender, as well as the ID of the receiver, both of which you should have created a Profile for. +If we registered an ERC20 contract for your game, you are able to manage the ERC20 assets in all the profiles that you created. Sending these tokens around is easy. We simply expect you to know the ID of the sender, as well as the ID of the receiver, both of which you should have created a Profile for. Initiating a token transfer would look something like this. In the example below, we are not considering more complicated features like sponsoring transactions just yet - the transaction will be paid for by you - the game developer. @@ -51,12 +51,12 @@ const transaction = await beam.assets.transferAsset("your-sender-id", { // } ``` -### Native transfers (Merit Circle) +### Native transfers (BEAM) -Lastly - we offer you the possibility to transfer our native token: Merit Circle. Depending on the context of your game, you might want to be able to transfer our native token around between profiles. +Lastly - we offer you the possibility to transfer our native token: BEAM. Depending on the context of your game, you might want to be able to transfer our native token around between profiles. ```typescript -const transaction = await beam.assets.transferAsset("your-sender-id", { +const transaction = await beam.assets.transferNativeToken("your-sender-id", { receiverEntityId: "your-receiver-id", amountToTransfer: "10", // 10 means 10 - we don't expect you to consider any other format like gwei }); diff --git a/pages/service/assets/reading-profile-assets.mdx b/pages/service/assets/reading-profile-assets.mdx index e00494d..b4a1029 100644 --- a/pages/service/assets/reading-profile-assets.mdx +++ b/pages/service/assets/reading-profile-assets.mdx @@ -12,7 +12,7 @@ However, depending on the token types there are a few caveats, as we are using a By running the following method, you will receive all ERC721 and ERC1155 type assets within a profile for all the contracts we registered for your game. As there could be quite a few assets, the response is paginated. -Note that at the moment of writing, we do not expose filtering options yet - but they are expected to drop soon in order for you to filter in different ways to get to meaningful results. +Note that at the moment of writing, we do not expose filtering options yet - but they are expected to drop soon in order for you to filter in different ways to get meaningful results. ```typescript const profileAssets = await beam.assets.getProfileAssets("entity-id"); diff --git a/pages/service/companion/connecting-your-users.mdx b/pages/service/companion/connecting-your-users.mdx index 158747e..5bbc223 100644 --- a/pages/service/companion/connecting-your-users.mdx +++ b/pages/service/companion/connecting-your-users.mdx @@ -6,13 +6,13 @@ title: Connecting your users What is important to understand is that the Profiles entity within Beam is not exclusively a matter of players. Profiles could be used for various purposes, one of which is [match profiles](/service/profiles/match-profiles). -However - in our opinion - it makes a ton of sense to create a Profile for each of your players as soon as you want something to happen on-chain. You can use these player profiles to manage user assets. On-chain tokens they earned (or bought), NFTs they minted (or you minted on their behalf) all can be send to the player profile for each player. +However - in our opinion - it makes a ton of sense to create a Profile for each of your players as soon as you want something to happen on-chain. You can use these player profiles to manage a user and their assets. On-chain tokens they earned (or bought), NFTs they minted (or you minted on their behalf) all can be sent to the player profile for each player. -In order to allow players to see and manage their assets outside of your game, we offer a way to link-up their profile to an SSO authenticated user identity. While it's not required, the companion app offers an extension of the web3 experience where users are able to manage, give a way and trade assets, without you having to facilitate this. +In order to allow players to see and manage their assets outside of your game, we offer a way to link-up their profile to an SSO authenticated user identity. While it's not required, the companion app offers an extension of the web3 experience where users are able to manage, give away and trade assets, without you having to facilitate this. ### Connection request -If you want to allow players to control their assets outside of your game, providing them the web3 experience, you would need ot create a connection request for a profile. +If you want to allow players to control their assets outside of your game, providing them the web3 experience, you would need to create a connection request for a profile. ```typescript const request = await beam.profiles.createConnectionRequest("profile-id", { diff --git a/pages/service/companion/introduction.mdx b/pages/service/companion/introduction.mdx index 9585abf..26cd1a4 100644 --- a/pages/service/companion/introduction.mdx +++ b/pages/service/companion/introduction.mdx @@ -6,7 +6,7 @@ import { Callout, Cards, Card } from "nextra/components"; # Beam Companion -We recently released the Beam Companion app. The app is meant for allowing users to manage and access their on-chain NFTs earned through playing your game. +We recently released the Beam Companion app. The app allows users to manage and access their on-chain NFTs earned through playing your game. Through our SDK implementation, we give you the power to generate a secure connection request that enables the user to create a connection between their in-game profile and Beam identity account (the in-app user). diff --git a/pages/service/companion/verifying-webhooks.mdx b/pages/service/companion/verifying-webhooks.mdx index 03f1ca5..5e9a3a6 100644 --- a/pages/service/companion/verifying-webhooks.mdx +++ b/pages/service/companion/verifying-webhooks.mdx @@ -4,7 +4,7 @@ title: Verifying connections # Verify user connections -After the user scans the QR code and connects their user-account to the profile, you will receive an incoming webhook on the provided callbackUrl. +After user scans the QR code and connects their user-account to the profile, you will receive an incoming webhook on the provided callbackUrl. ```typescript const request = await beam.profiles.createConnectionRequest("profile-id", { diff --git a/pages/service/marketplace/introduction.mdx b/pages/service/marketplace/introduction.mdx index 1822f15..02a5c1f 100644 --- a/pages/service/marketplace/introduction.mdx +++ b/pages/service/marketplace/introduction.mdx @@ -9,7 +9,7 @@ import { Callout } from "nextra/components"; In order to get a marketplace going, we offer various methods that can help you get started with listing assets. Keep in mind that the marketplace itself is a pre-release product waiting to be released in Q4. -In order to create a full marketplace integration it's important to understand all of the possibilities that you have. +In order to create a full marketplace integration it is important to understand all of the possibilities that you have. - [Currencies](/service/marketplace/currencies): Supported currencies in Beam marketplace @@ -21,7 +21,7 @@ In order to create a full marketplace integration it's important to understand a ### Roadmap -Throughout the coming months, we'll be releasing additional features that will help you to provide a more complete marketplace experience, with features ranging from programmatic offers, auctions and extensive filtering options to allow you to create a full-fledged in-game marketplace solely by relying on the Beam marketplace. +Throughout the coming months, we'll be releasing additional features that will help you provide a more complete marketplace experience, with features ranging from programmatic offers, auctions and extensive filtering options to allow you to create a full-fledged in-game marketplace solely by relying on the Beam marketplace. Feel like something is missing, and needs to be prioritized? Check out our diff --git a/pages/service/marketplace/listing-assets.mdx b/pages/service/marketplace/listing-assets.mdx index a4bb4b2..a9b9954 100644 --- a/pages/service/marketplace/listing-assets.mdx +++ b/pages/service/marketplace/listing-assets.mdx @@ -1,6 +1,6 @@ ## Listing an asset -In order to list an asset on behalf of a profile you need to pass us some information about the listing. +In order to list an asset on behalf of a profile you need to give us some information about the listing. ```typescript const transaction = await beam.marketplace.listAsset('profile-seller-id', { @@ -16,11 +16,11 @@ const transaction = await beam.marketplace.listAsset('profile-seller-id', { // } ``` -Different intricacies on the different selling types will be provided at a later date. To keep things simple, we advice to start listing with the 'FixedPrice' sell type only. +Different intricacies on the different selling types will be provided at a later date. To keep things simple, we advise you to start listing with the 'FixedPrice' sell type only. ## Accessing listed items for your game -At the moment, we provide a method that allows you to retrieve all the listed items of a profile. Since we just listed an item, you can now verify whenever the item is actually for sale by calling the `getListedAssetsForProfile` method. +At the moment, we provide a method that allows you to retrieve all the listed items of a profile. Since we just listed an item, you can now verify whenever the item is actually for sale by calling `getListedAssetsForProfile` method. ```typescript const listings = await beam.marketplace.getListedAssetsForProfile( diff --git a/pages/service/profiles/match-profiles.mdx b/pages/service/profiles/match-profiles.mdx index b35a16f..7b116ce 100644 --- a/pages/service/profiles/match-profiles.mdx +++ b/pages/service/profiles/match-profiles.mdx @@ -1,12 +1,12 @@ # Match profiles -One of the less obvious use-cases for profiles is using them for escrow. A common scenario in Web3 games are games where players put their assets on the line. Every player can participiate in a PvP-match, but has to put one of their assets on the line - and you don't want players to be able to simply disconnect or moving their assets through the companion app right before they loose a match. +One of the less obvious use-cases for profiles is using them for escrow. A common scenario in Web3 games are games where players put their assets on the line. Every player can participiate in a PvP-match, but has to put one of their assets on the line - and you don't want players to be able to simply disconnect or moving their assets through the companion app right before they lose a match. It could make sense to create a profile for these types of PvP matches - requiring everyone who wants to join a match to send one of their assets into said match profile. As the match profile was never [linked to a user](/service/profiles/users-and-profiles), it remains in your custody as the game developer - offering no way for users to further interact with these assets up until the point that you send them back to their player-profile. -Let's go through the steps you would need to take in order to properly set this up within by providing an actual scenario. In our scenario, Player A wants to create a 1v1 PvP match where the winner takes all. They go through the game it's interface for creating a match and set-up the rules/preferences for that match. +Let's go through the steps you would need to take in order to properly set this up within by providing an actual scenario. In our scenario, Player A wants to create a 1v1 PvP match where the winner takes all. They go through the game's interface for creating a match and set-up the rules/preferences for that match. -The first step you as the game developer would need to do is to create a match profile. Please note that since the match is a new profile, it's important to track which player (in our case: player A) initiated the match, and to store the matchID somewhere with the playerID. +The first step you as the game developer would need to take is to create a match profile. Please note that since the match is a new profile, it's important to track which player (in our case: player A) initiated the match, and to store the matchID somewhere with the playerID. ```typescript const match = await beam.profiles.createProfile("your-match-id"); @@ -36,7 +36,7 @@ const playerAssets = await beam.assets.getProfileAssets("your-player-a-id", { }); ``` -Once both player selected their asset they need to be moved to the match profile. Once the transfer is completed, the asset is outside of the players their control. Note that at the moment of writing we don't offer a way to 'listen' to on-chain events, but as per our [roadmap](/service/roadmap), we are aiming to have this ready at the end of 2023. +Once both players selected their assets, they need to be moved to the match profile. When transfer is completed, the assets are outside of players' control. Note that at the moment of writing we don't offer a way to 'listen' to on-chain events, but as per our [roadmap](/service/roadmap), we are aiming to have this ready at the end of 2023. Transferring player A their asset: diff --git a/pages/service/profiles/minting-profiles.mdx b/pages/service/profiles/minting-profiles.mdx index 1b85a77..31c2db4 100644 --- a/pages/service/profiles/minting-profiles.mdx +++ b/pages/service/profiles/minting-profiles.mdx @@ -1,6 +1,6 @@ # Minting profiles -Another use case for profiles could be minting-profiles. You might have asset contracts deployed on beam which need to mint on-demand - but you don't want everyone to be able mint whenever they want, so the contract has a pre-defined allowlist of addresses that are able to mint assets for the contract. +Another use case for profiles could be minting-profiles. You might have asset contracts deployed on beam which need to be minted on-demand - but you don't want everyone to be able mint whenever they want, so the contract has a pre-defined allowlist of addresses that are able to mint assets for the contract. If your contracts support extending this list of addresses, you could simply create a profile and add the address of the profile to the allowlist once. @@ -21,7 +21,7 @@ const minter = await beam.profiles.createProfile("your-minter-id"); Take the wallet address of the profile you just created, and add it to the allowlist of the contract on-chain. This gives you the possibility to use the minting profile through our SDK to mint assets on demand. -After the address is whitelisted, minting an asset is as simple as creating a new transaction on behalf of the minter profile. As the minter-profile is whitelisted, you're (through the api key) are in full control of minting assets. If you would like to mint an asset to a player's profile, it would be as simple as doing the following: +After the address is whitelisted, minting an asset is as simple as creating a new transaction on behalf of the minter profile. As the minter-profile is whitelisted, you (through the api key) are in full control of minting assets. If you would like to mint an asset to a player's profile, it would be as simple as doing the following: ```typescript const player = await beam.profiles.getProfile("your-player-id"); diff --git a/pages/service/profiles/treasury-profiles.mdx b/pages/service/profiles/treasury-profiles.mdx index 01135b2..4727ff0 100644 --- a/pages/service/profiles/treasury-profiles.mdx +++ b/pages/service/profiles/treasury-profiles.mdx @@ -19,8 +19,8 @@ const treasury = await beam.profiles.createProfile("your-treasury-id"); // } ``` -The treasury profile would be a profile like any other: an account abstraction that is within your control authorized through the API key. By us adding the contracts for your pre-minted assets to your game, and you sending the pre-minted assets to the treasury profile it's wallet address, you essentially allow yourself to move these assets around from the profile to any other of your profiles through our sdk. +The treasury profile would be a profile like any other: an account abstraction that is within your control authorized through the API key. By us adding the contracts for your pre-minted assets to your game, and you sending the pre-minted assets to the treasury's profile wallet address, you essentially allow yourself to move these assets around from the profile to any other of your profiles through our sdk. By never creating a connection request for this profile as described in the [users and profiles](/service/profiles/users-and-profiles), you won't have a risk of anyone touching the assets within the profile except for someone authorized by the API keys. -If pre-minted assets get distributed in batches, you might want to create a treasury profile per batch - or periodically send assets to the profile it's wallet address - managing these profiles is up to you. Do keep in mind that everyone who possesses or is able to get access to the read-and-write API key we provided to you, is able to move around these assets freely between profiles of your game. +If pre-minted assets get distributed in batches, you might want to create a treasury profile per batch - or periodically send assets to the profile's wallet address - managing these profiles is up to you. Do keep in mind that everyone who possesses or is able to get access to the read-and-write API key we provided to you, is able to move around these assets freely between profiles of your game. diff --git a/pages/service/profiles/users-and-profiles.mdx b/pages/service/profiles/users-and-profiles.mdx index ed5e99b..590da1b 100644 --- a/pages/service/profiles/users-and-profiles.mdx +++ b/pages/service/profiles/users-and-profiles.mdx @@ -2,13 +2,13 @@ What is important to understand is that the Profiles entity within Beam is not exclusively a matter of players. Profiles could be used for various purposes, one of which is [match profiles](/service/profiles/match-profiles). -However - in our opinion - it makes a ton of sense to create a Profile for each of your players as soon as you want something to happen on-chain. You can use these player profiles to manage user assets. On-chain tokens they earned (or bought), NFTs they minted (or you minted on their behalf) all can be send to the player profile for each player. +However - in our opinion - it makes a ton of sense to create a Profile for each of your players as soon as you want something to happen on-chain. You can use these player profiles to manage a user and their assets. On-chain tokens they earned (or bought), NFTs they minted (or you minted on their behalf) all can be sent to the player profile for each player. -In order to allow players to see and manage their assets outside of your game, we offer a way to link-up their profile to an SSO authenticated user identity. While it's not required, the companion app offers an extension of the web3 experience where users are able to manage, give a way and trade assets, without you having to facilitate this. +In order to allow players to see and manage their assets outside of your game, we offer a way to link-up their profile to an SSO authenticated user identity. While it's not required, the companion app offers an extension of the web3 experience where users are able to manage, give away and trade assets, without you having to facilitate this. ### Connection request -If you want to allow players to control their assets outside of your game, providing them the web3 experience, you would need ot create a connection request for a profile. +If you want to allow players to control their assets outside of your game, providing them the web3 experience, you would need to create a connection request for a profile. ```typescript const request = await beam.profiles.createConnectionRequest("your-player-id", { diff --git a/pages/service/transactions/custom-charges.mdx b/pages/service/transactions/custom-charges.mdx index 71ee239..38c896f 100644 --- a/pages/service/transactions/custom-charges.mdx +++ b/pages/service/transactions/custom-charges.mdx @@ -12,7 +12,7 @@ You could charge your users an X amount of diamonds by simply creating a policy, ### Economic viability -Eventually, you as a game developer will be responsible for funding the BEAM for all the transactions that are ran through our service, so if you take away in-game diamonds, you have to consider if it's economically viable to make this transaction. Let's assume a single transaction on Beam costs < 0.001 BEAM, and a diamond costs the user $ 0.05 to obtain - this means that the transaction through the policy is now not only economically viable, it also allows you to to sponsor quite some transactions for the user as the single diamond paid for the transaction in tenfold. +Eventually, you as a game developer will be responsible for funding the BEAM for all the transactions that are ran through our service, so if you take away in-game diamonds, you have to consider if it is economically viable to make this transaction. Let's assume a single transaction on Beam costs < 0.001 BEAM, and a diamond costs the user $ 0.05 to obtain - this means that the transaction through the policy is now not only economically viable, it also allows you to to sponsor quite some transactions for the user as the single diamond paid for the transaction in tenfold. ```typescript const transaction = await beam.assets.transferAsset("your-sender-id", { diff --git a/pages/service/transactions/custom-transactions.mdx b/pages/service/transactions/custom-transactions.mdx index 0f2a490..b9dfaff 100644 --- a/pages/service/transactions/custom-transactions.mdx +++ b/pages/service/transactions/custom-transactions.mdx @@ -8,7 +8,7 @@ Throughout our service, we've added multiple methods for you to manage assets fo There's a limit of 9 interactions per transaction to prevent potential security vulnerabilities. Making calls to external contracts within loops can risk Denial of Service (DoS) or transaction failures if they consume more gas than a block's limit. -You can simply do this by creating a transaction that interacts with one or more contracts in one go by padding an `interactions` array. This would look something like the snippet below. Keep in mind that everything you see below is completely contextual based on the contracts you're calling and the functions that are avaialble on said contract. +You can simply do this by creating a transaction that interacts with one or more contracts in one go by padding an `interactions` array. This would look something like the snippet below. Keep in mind that everything you see below is completely contextual based on the contracts you're calling and the functions that are available on said contract. ```typescript const transaction = await beam.transactions.createTransaction("profile-id", { diff --git a/pages/service/transactions/profile-paid-transactions.mdx b/pages/service/transactions/profile-paid-transactions.mdx index f5a1fa1..cedcf47 100644 --- a/pages/service/transactions/profile-paid-transactions.mdx +++ b/pages/service/transactions/profile-paid-transactions.mdx @@ -4,16 +4,16 @@ title: Profile-paid transactions # Profile-paid transactions -An alternative to the default of sponsoring transactions, is to make the Profile pay for a transaction. This requires the profile have enough BEAM in it to pay for the gas fees needed to handle the network transaction. This generally comes down to a very small sum of BEAM, but if you never distributed any BEAM to the Profiles that you've created, there's a big chance that none of the profiles actually have the required BEAM in place. +An alternative to the default of sponsoring transactions, is to make the Profile pay for a transaction. This requires the profile to have enough BEAM in its possession to pay for the gas fees needed to handle the network transaction. This generally comes down to a very small sum of BEAM, but if you never distributed any BEAM to the Profiles that you've created, there's a big chance that none of the profiles actually have the required BEAM in place. In order to mitigate that, you could go different directions. Which is viable to you and your userbase completely depends on your context. 1. You could tell your users to increase their in-game account BEAM funding by asking them to send BEAM to it (which we do not consider a good experience for the user) 2. You could buy BEAM and distribute it to your in-game profiles through a treasury profile -### How to make the profile pay for it's transaction? +### How to make the profile pay for its transaction? -In order to make a profile pay for it's own transaction, the only thing you need to do is provide a `sponsor: false` option when running a transaction. The `sponsor` option is something we've built into every method that triggers an on-chain transaction. +In order to make a profile pay for its own transaction, the only thing you need to do is provide a `sponsor: false` option when running a transaction. The `sponsor` option is something we've built into every method that triggers an on-chain transaction. Take into account that if the Profile doesn't actually have the necessary BEAM funded, the sdk method will throw.