bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 6쪽 중 2쪽
r platform SDKs. Accounts made with this API are owned by your players, meaning no action can be performed without users approval. This is facilitated by signing transactions and
Sessions
. It is the recommended approach for most games.
Automation Service
A
custodial
service to implement distribution/automation in your backend services. This is ideally used for your game server or other backend services that require automated actions. You are the custodian of all the assets owned by these accounts.
Would you like to start right away? Jump ahead to our SDKs for the
Unity
and
Unreal
game engines. They utilize the self-custodial Player approach.
Player Service
If you’re looking to implement your game onto the Beam Network, we highly recommend you get started with our
Player Service
. We offer multiple solutions to help you use our self-custodial Player API on both the server and client sides. Since the user controls the private key that owns the account we deploy, there is no doubt about who owns the asset—the gamer.
Implementation
: How to get started.
Operations
: An introduction to Operations.
Sessions
: An introduction to Sessions.
Transactions
: Understand how to run sponsored, self-paid, and custom charge transactions.
Assets
: Simplify in-game asset management.
Marketplace
: List, buy, and make offers on other people’s assets.
Exchange
: Convert tokens based on configured liquidity pools.
Automation Service
While the
Player Service
offers everything needed to get you going, you might be interested in a programmatic solution for various back-end purposes. For example, if you’re looking to create a programmatic minter that you can control through one of our clients, the Automation API is the one you’re looking for.
Automation Profiles are smart contract accounts that game developers can use to manage their own crypto assets in connection with their games. They’re helpful for automating certain tasks - such as sending rewards to players, without needing to do everything manually. The Automation Profiles may only be used for the game developer’s own assets and cannot be used to store or manage crypto assets that belong to others.
Profiles
: Understanding Automation API wallets.
Policies
: Understand and create policies.
Trading
: Trade assets and tokens between two profiles securely.
Misc
Profiles between Automation and Player APIs are not interchangeable. If you want to transfer assets from one to another, you can do so, using their respective Account (Wallet) Addresses. Profiles are free to create, and you can make as many as you need.
Keep in mind that actual
Account Abstraction
is deployed on the blockchain on first transaction performed by that account. Because of this, the first transaction might be a bit slower than any subsequent action.
Getting started
Introduction
## /sdk/api/api-clients
SDK
Beam API
HTTP Clients
API Clients
We auto generate clients in few languages for our APIs to help you get started quickly.
We have separate clients available for both Automation and Player APIs.
Automation API clients
All Automation API clients are meant to be used on the
server side
, as it is crucial to not expose any of the api keys we provided publicly. It’s meant to be used with Secret API Key.
✅
Node.js (Typescript)
✅
C# (.NET 6+)
Player API clients
The Player API clients can be used in the client-side code, as the Publishable API Key that is required to interact with the self-custody services can be exposed without risk. All Player operations need to be signed by the User(or
Session
).
✅
Typescript (browser & server)
✅
C# (.NET 6+)
If you want to use a different language, you can always use our
API Reference
to get started. The API is RESTful and you can use any HTTP client to make requests.
Just remember to pass your API key in the
x-api-key
header.
⚠️
If you encounter any bugs, issues or something is missing, let us know at
build@onbeam.com
or post an Issue in our
beam-api-clients
Github repository.
Beam Dashboard
API Reference
## /sdk/platform-clients/introduction
SDK
Platform clients
Introduction
Platform clients
Platform clients are libraries or plugins we created to make it easier for you to integrate Beam into your game. They are available for the most popular game engines and platforms, including Unity and Unreal Engine. We also offer Web SDK for web-based games and applications, which has an added benefit of being WAGMI compatible.
They all contain a built-in
Player API Client
but most importantly, they allow you to easily introduce
Sessions
and
Connect your users to your game
.
API Terms
Unity
## /sdk/beam-dashboard
SDK
Beam Dashboard
Beam Dashboard
Beam Dashboard is an all-in-one place for managing your Game and its assets. You can register your game, add contracts, manage funds and API keys.
You can access the game dashboard at:
Beta
Production
https://dashboard.beta.onbeam.com
https://dashboard.onbeam.com
Dashboard allows you to:
View and manage API Keys for your game
Manage alerts sent when your BEAM Balance is low
Manage your game Members (other Developers) and their access to the game
Manage your games Smart Contracts
Edit basic game information like name, description, images, PEGI ratings
Set a webhook for when Players connect to your game
Environments
HTTP Clients
## /sdk/player-service/player-introduction
SDK
Player Service
Introduction
Introduction to the Player API
Through our Player API implementation, you can set up self-custodial user accounts with Beam. The solution is based on self-custodial private keys and newly deployed account abstractions. Existing Automation
Profiles
won’t be available for use in self-custodial Player solution.
What is self custody?
Self-custody means that a private key is only owned by the user who can sign transactions. The private key for each user is generated in the browser when they start interacting with
Sessions
and
Operations
.
When they do, they will be required to authorize with a social identity, from which a private key is generated, sharded and securely stored.
Disclaimer
Our self-custodial implementation is
subject to change
, while the basis of the implementation will remain more or less the same, we have different improvements in mind that will make the experience even better - for both you (the game developer) and the end user.
Getting started with self custody
Implementation
: How to get started
Operations
: An introduction to Operations
Sessions
: An introduction to Sessions
Transactions
: Understand how to run sponsored, self-paid and custom charge transactions.
Assets
: Simplify in-game asset management.
Marketplace
: List, buy and make offers on other peoples assets.
Exchange
: Convert tokens based on configured liquidity pools.
Player or Automation Service
Implementation
## /sdk/player-service/transactions/introduction
SDK
Player Service
Transactions
Introduction
Introduction to Transactions
Through Profiles you were able to create a bunch of in-game accounts for your users and your own utility purposes. We’ve also explained how these in-game accounts can be funded with assets through minting. Before we dive into managing those assets within profiles, it’s good to have a general understanding about transactions.
Within the context of our SDK, a transaction is a transfer of assets from one profile to another - but since our underlying technology is blockchain, a transaction can also simply be explained as any on-chain transaction happening for your profiles (which are account abstractions).
Transactions and gas
Generally speaking, for every transaction that you make on Beam, a very tiny amount of BEAM is being used to handle that transaction. This also means that every transaction you make through our sdk will cost a fraction of BEAM - it’s up to you to decide whenever that BEAM will be sponsored by you, by the Profile for which you make the transaction or through creating a custom charge policy that charges the user an in-game asset to handle the transaction. What is best for you and your users completely depends on what type of game you’re making. Below you will find a couple of options we provide through the SDK for you to chose from. You could go a different direction with every transaction you make as, depending on the context.
It’s worth noting that Profile creation does not cost any gas initially. The on-chain account abstraction will actually be deployed during first transaction for that Profile. This will cause the initial transaction expenditure to be double the amount of a regular transaction.
Getting started with transactions
Sponsored transactions
: Learn about sponsored transactions for your users
Profile-paid transactions
: Learn about how to make a profile pay for it’s own transactions through BEAM
Custom charges
: A guide to managing and updating your game’s assets and details within Beam
Custom transactions
: Understand how to interact with any on-chain asset contract
Signing with sessions
Sponsored transactions
## /sdk/player-service/operations/introduction
SDK
Player Service
Operations
Introduction
Introduction to Operations
Operations are the cornerstone of the self-custodial Player service in Beam. They facilitate the interaction between you and the end-user, who needs to sign certain transactions.
Everything you do in the new self-custodial service that requires a signature, will return an Operation to be handled.
An Operation can consist out of a
single
or
multiple
transactions. Depending on the actions you would like to initiate - a user would sometimes need to provide multiple signatures. A good example of this situation would be interacting with the Marketplace: an Operation might consist out of a transaction to approve the Seaport contract required to interact with the marketplace, as well as the actual Seaport Order to be signed by the user in order to get processed by the Marketplace.
Getting started with operations
Creating operations
: Learn about how to create operations for your users
Operation processing
: Learn how users can interact with Operations
Connecting users
Creating operations
## /sdk/player-service/sessions/introduction
SDK
Player Service
Sessions
Introduction
Introduction to Sessions
A self-custody implementation for your users means that the ownership of the account abstraction used, is
owned
by the private key in control of the user. Every time you want to interact with the blockchain on the users’ behalf, you will need to ask them to sign a transaction.
This experience can be troublesome and cause interruptions - both for you as the developer and for the gamer. In order to minimize the friction involved, we offer Sessions.
What is a session?
A session is, in essence, a
temporary authorized and limited-in-scope
private key, that can sign transactions on behalf of the self-custodial account abstraction for your users.
While this sounds intimidating, we created a useful abstraction in our Platform SDKs that allow you to generate a session, and ask the user to authorize those sessions through a web interface.
Getting started with sessions
Creating sessions
: Learn how to create a session for your users
Signing with sessions
: Learn how to use sessions to sign for Operations
Processing operations
Creating sessions
## /sdk/player-service/assets/introduction
SDK
Player Service
Assets
Introduction
Introduction to Assets
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 of the players you created, but also list, buy and make offers on assets through the Beam SDK. By nature of self-custodial Player accounts, most operations require the Player to sign the operation, either directly or via
Sessions
.
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.
🛠️
Feel like something is missing, and needs to be prioritized? Let’s have a chat through
build@onbeam.com
!
Custom transactions
Reading player assets
## /sdk/player-service/marketplace/introduction
SDK
Player Service
Marketplace
Introduction
Introduction to the Marketplace
In order to get an in-game marketplace set up, we offer various methods that can help you get started with listing assets.
Before creating a full marketplace integration it is important to understand all of the possibilities that you have. Here are some articles to get you started:
Currencies
: Supported currencies in Beam marketplace
Create a listing
: Listing an asset for sale
Buying a listed item
: Buying a listed asset through Sphere through the SDK
Offers
: Allow profiles to create offers on listed and unlisted assets
Roadmap
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? Let’s have a chat through
build@onbeam.com
!
Managing player assets
Currencies
## /sdk/player-service/exchange/introduction
SDK
Player Service
Exchange
Introduction
Introduction to the Exchange
The API allows you to convert any in-game tokens or BEAM associated with a profile, using Beam’s
decentralized exchange
swap.onbeam.com
.
Conversion rates are determined via an
Automated Market Maker
mechanism, and depend on supply and demand of the respective tokens.
You can learn more about setting up a
liquidity pool
for your own tokens
here
, in order to enable trading.
🛠️
Feel like something is missing, and needs to be prioritized? Let’s have a chat through
build@onbeam.com
!
Offers
Converting tokens
## /sdk/automation-service/automation-introduction
SDK
Automation Service
Introduction
Introduction to the Automation API
Through the Automation API, you’re able to create
Profiles
to control assets and distribute them to your users.
What is the managed service?
The managed service in Beam is, in technical design, very similar to our
self-custody
solution. The key difference is that the managed services are exactly what the name says - they are managed, by us (and yourself). Through the
Secret
API key, you will be able to create
Profiles
and manage assets accordingly.
Disclaimer
It’s important to understand that the managed service and its features are
not meant to be used to control user assets
. If you are looking to implement parts of our service to do that, please refer to our
self-custody
solution.
Getting started with self custody
Profiles
: Understand the role of Profiles as your players’ on-chain inventories and more.
Policies
: Understanding and creating policies.
Trading
: Trade assets and tokens between two profiles securely.
Webhooks
Introduction
## /sdk/automation-service/policies/introduction
SDK
Automation Service
Policies
Introduction
Introduction to Policies
Policies are the means to make Profiles pay for transactions in an on-chain, in-game ERC-20 token - but not necessarily the native one. If your game supports an in-game ERC-20 token - let’s call it Gold - and you would like to charge your user an X amount of Gold for every on-chain transaction you facilitate, Policies are the feature you’re looking for.
A policy is nothing else than a simple set of rules, which you can reference in every transaction that you make - the rules you define are up to you.
Understanding policies
: Explainer on the different types of policies
Managing policies
: How to create, retrieve and delete policies
Using policies
: How to use the policies you defined
Treasury profiles
Understanding policies
## /sdk/automation-service/automation-reporting
SDK
Automation Service
Reporting
Reporting
Throughout time you’ll run transactions to move on-chain assets for the
Profiles
you create. As for all blockchains - for each transaction, gas needs to be spent in order to fulfill a transaction. In order to provide you with insights into the data, we provide a couple of simple methods that allow you to pull up this data.
Game report
A report per game will get you a complete overview for your game, for every chain you support. This could come in handy if your game is targetting two chains to reach a wider target audience.
Note:
chain information is environment specific, meaning that you won’t find both Testnet and Mainnet information within the same response.
const
report
=
await
beam.reporting.
getTotalGameUsage
();
// {
// "chains": [
// {
// "policies": [
// {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "chainId": 13337,
// "policy": {
// "id": "string",
// "name": "string",
// "model": "ContractFunctions",
// "chainId": 0
// },
// "periods": [
// {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "start": 0,
// "end": 0
// }
// ]
// }
// ],
// "summary": {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "chainId": 13337
// }
// }
// ]
// }
Chain report
For most developers, retrieving a report for the specific chain they’re building on will suffice. The
getTotalGameUsageByChain
method allows you to do just that, provided that you passed a supported
chainId
to the method.
If you’re developing on Beam (chain), you will be able to retrieve your games gas expenses by passing the following chain id’s:
13337
- Testnet
4337
- Mainnet
const
report
=
await
beam.reporting.
getTotalGameUsageByChain
(
13337
);
// {
// "policies": [
// {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "chainId": 13337,
// "policy": {
// "id": "string",
// "name": "string",
// "model": "ContractFunctions",
// "chainId": 0
// },
// "periods": [
// {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "start": 0,
// "end": 0
// }
// ]
// }
// ],
// "summary": {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "chainId": 13337
// }
// }
Policy report
For more granular reporting per policy, you’re able to retrieve the information for one specific policy by providing the
policyId
.
const
report
=
await
beam.reporting.
getPolicyUsage
(
"clozl24n600003b6ysfapkqq1"
);
// {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "chainId": 13337,
// "policy": {
// "id": "string",
// "name": "string",
// "model": "ContractFunctions",
// "chainId": 0
// },
// "periods": [
// {
// "totalTransactionFeeInUSD": "string",
// "totalTransactionFee": "string",
// "averageTransactionFee": "string",
// "transactionCount": 0,
// "start": 0,
// "end": 0
// }
// ]
// }
Execute a trade
Environments
## /sdk/automation-service/trading/introduction
SDK
Automation Service
Trading
Introduction
Introduction to Trading
If you’re building a trading based game that doesn’t necessarily rely on buying and selling, Trading is for you. The methods related to trading provide you with the means to transfer assets between two Profiles, without having to deal with the risk that one of the Profiles doesn’t receive their promised a프로젝트로 돌아가기