Skip to content

Commit

Permalink
Chore: fix minor mistakes (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
lewinskimaciej authored Nov 7, 2023
1 parent 4d31c44 commit c52bfd9
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
10 changes: 5 additions & 5 deletions pages/service/assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Callout emoji="🛠️">
Feel like something is missing, and needs to be prioritized? Check out our [2023 roadmap](/service/roadmap) or let's have a chat through [email protected]
Feel like something is missing, and needs to be prioritized? Check out our
[2023 roadmap](/service/roadmap) or let's have a chat through [email protected]
</Callout>
8 changes: 4 additions & 4 deletions pages/service/assets/managing-profile-assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
});
Expand Down
2 changes: 1 addition & 1 deletion pages/service/assets/reading-profile-assets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions pages/service/companion/connecting-your-users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
2 changes: 1 addition & 1 deletion pages/service/companion/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion pages/service/companion/verifying-webhooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
4 changes: 2 additions & 2 deletions pages/service/marketplace/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

<Callout emoji="🛠️">
Feel like something is missing, and needs to be prioritized? Check out our
Expand Down
6 changes: 3 additions & 3 deletions pages/service/marketplace/listing-assets.mdx
Original file line number Diff line number Diff line change
@@ -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', {
Expand All @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions pages/service/profiles/match-profiles.mdx
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions pages/service/profiles/minting-profiles.mdx
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions pages/service/profiles/treasury-profiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions pages/service/profiles/users-and-profiles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down
Loading

1 comment on commit c52bfd9

@vercel
Copy link

@vercel vercel bot commented on c52bfd9 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

beam-docs – ./

beam-docs-merit-circle.vercel.app
beam-docs-git-main-merit-circle.vercel.app
docs.onbeam.com

Please sign in to comment.