From 45a036704b29a3d6c7ec41f8680f0bb0c2e4093a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Gru=CC=88ning?= Date: Fri, 13 Dec 2024 15:58:58 +0100 Subject: [PATCH 1/6] added CollapsibleDetails component, added docs on parameter + return types for unreal indexer --- docs/components/CollapsibleDetails.tsx | 25 +++++ .../pages/sdk/unreal/read-from-blockchain.mdx | 102 ++++++++++++++++-- 2 files changed, 119 insertions(+), 8 deletions(-) create mode 100644 docs/components/CollapsibleDetails.tsx diff --git a/docs/components/CollapsibleDetails.tsx b/docs/components/CollapsibleDetails.tsx new file mode 100644 index 00000000000..e6d2bb27025 --- /dev/null +++ b/docs/components/CollapsibleDetails.tsx @@ -0,0 +1,25 @@ +interface CollapsibleDetailsProps { + title: string; + items: { + key: string; + value: string; + }[] +} + +export const CollapsibleDetails = (props: CollapsibleDetailsProps) => { + return ( +
+ {props.title} +
+ {props.items.map((item, index) => { + return ( +
+

{item.key}

+

{item.value}

+
+ ) + })} +
+
+ ) +} \ No newline at end of file diff --git a/docs/pages/sdk/unreal/read-from-blockchain.mdx b/docs/pages/sdk/unreal/read-from-blockchain.mdx index 568898e7848..44dfdc9e820 100644 --- a/docs/pages/sdk/unreal/read-from-blockchain.mdx +++ b/docs/pages/sdk/unreal/read-from-blockchain.mdx @@ -3,6 +3,7 @@ title: Sequence - Web3 Gaming Platform - Unreal SDK Sequence API description: Documentation for Unreal SDK API for reading from the blockchain with the Sequence infrastructure stack for web3 gaming. --- +import {CollapsibleDetails} from "../../../components/CollapsibleDetails.tsx"; import TabbedContent from "../../../components/TabbedContent"; # Read From Blockchain @@ -17,9 +18,11 @@ Select the Chain ID from which you want to retrieve user information. By default -:::warning -Make sure that you use the correct Chain Id for your project from [Sequence's Builder](https://sequence.build). -::: + ## Get Ether Balance @@ -48,10 +51,20 @@ Use the Indexer API to retrieve the Ether balance for a specified wallet address + + + + ## Get Token Balances Retrieve the user's token balances for ERC20, ERC721, and ERC1155 tokens. This will return an array of all tokens -owned by the user. Ensure that 'includeMetadata' is enabled to include contract information in the response. +owned by the user.
@@ -82,10 +95,30 @@ owned by the user. Ensure that 'includeMetadata' is enabled to include contract
+ + + + ## Get Token Supplies -Retrieve the token supplies for an ERC20, ERC721, or ERC1155 token. Make sure 'includeMetadata' is enabled to -include contract information in the response. +Retrieve the token supplies for an ERC20, ERC721, or ERC1155 token.
@@ -116,10 +149,26 @@ include contract information in the response.
+ + + + ## Get Token Supplies Map -Retrieve a collection of token supplies for ERC20, ERC721, or ERC1155 tokens. Make sure 'includeMetadata' is enabled to -include contract information in the response. +Retrieve a collection of token supplies for ERC20, ERC721, or ERC1155 tokens.
@@ -152,6 +201,23 @@ include contract information in the response.
+FSeqTokenList Map))', + value: "A map of token IDs that you want to retrieve data from." + }, + { + key: 'Include Metadata (Boolean)', + value: "Enable this flag if you want to receive token metadata in the response." + }]} +/> + + + ## Get Transaction History Retrieve the transaction history for a wallet- or token address. @@ -187,3 +253,23 @@ For example, here we get all transaction for the current user. ``` + + + + From 0861f1f589081cfa02604889aa10f3ff9a5931be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Gru=CC=88ning?= Date: Fri, 13 Dec 2024 18:26:04 +0100 Subject: [PATCH 2/6] added borderless options for tabbed content, used in unreal docs --- docs/components/TabbedContent/style.css | 5 +++ docs/pages/sdk/unreal/authentication.mdx | 24 +++++++------- .../pages/sdk/unreal/read-from-blockchain.mdx | 24 +++++++------- docs/pages/sdk/unreal/write-to-blockchain.mdx | 32 +++++++++---------- 4 files changed, 45 insertions(+), 40 deletions(-) diff --git a/docs/components/TabbedContent/style.css b/docs/components/TabbedContent/style.css index b36c01cbccc..17861a57255 100644 --- a/docs/components/TabbedContent/style.css +++ b/docs/components/TabbedContent/style.css @@ -33,4 +33,9 @@ border-radius: 0.4rem; border: 1px solid rgba(0, 158, 255, 0.165); background-color: rgba(0, 143, 245, 0.098); +} + +.tabbed-content__content.borderless { + padding: 0; + border: unset; } \ No newline at end of file diff --git a/docs/pages/sdk/unreal/authentication.mdx b/docs/pages/sdk/unreal/authentication.mdx index ddcdb49f37b..448df674c40 100644 --- a/docs/pages/sdk/unreal/authentication.mdx +++ b/docs/pages/sdk/unreal/authentication.mdx @@ -16,7 +16,7 @@ Sign in users with any email, and they will receive a one-time password in their Listen for the Email Requires Code event. -
+
{'img'}
@@ -32,7 +32,7 @@ On mobile platforms, listen for the `Id Token Received` event. ### Get Google Id Token -
+
{'img'}
@@ -40,7 +40,7 @@ On mobile platforms, listen for the `Id Token Received` event. ### Get Apple Id Token -
+
{'img'}
@@ -50,7 +50,7 @@ On mobile platforms, listen for the `Id Token Received` event. Use this method to start a session using a valid Id token from Google or Apple. -
+
{'img'}
@@ -63,7 +63,7 @@ during [Configuration](/sdk/unreal/configuration) and [configure PlayFab in the ### Register a new PlayFab user -
+
{'img'}
@@ -71,7 +71,7 @@ during [Configuration](/sdk/unreal/configuration) and [configure PlayFab in the ### Login with existing PlayFab user -
+
{'img'}
@@ -85,7 +85,7 @@ If you have your own PlayFab integration, you are welcome to use it. Once you've You can sign in users as guests. However, note that they will lose access to their wallet if they uninstall the app or sign out. -
+
{'img'}
@@ -98,7 +98,7 @@ account in order to have persistent credentials with which they can access their While a user is authenticated with the Sequence API, you can add an additional login method by using the appropriate federate account call. -
+
{'img'}
@@ -108,11 +108,11 @@ While a user is authenticated with the Sequence API, you can add an additional l Clear the credentials cache and sign out the current user. -
+
{'img'}
-
+
```cpp const TOptional WalletOptional = USequenceWallet::Get(); if (WalletOptional.IsSet() && WalletOptional.GetValue()) @@ -129,11 +129,11 @@ Clear the credentials cache and sign out the current user. List the active sessions. -
+
{'img'}
-
+
```cpp const TSuccessCallback> OnSuccess = [=](TArray Response) { diff --git a/docs/pages/sdk/unreal/read-from-blockchain.mdx b/docs/pages/sdk/unreal/read-from-blockchain.mdx index 44dfdc9e820..2c2d82296fa 100644 --- a/docs/pages/sdk/unreal/read-from-blockchain.mdx +++ b/docs/pages/sdk/unreal/read-from-blockchain.mdx @@ -13,7 +13,7 @@ import TabbedContent from "../../../components/TabbedContent"; Select the Chain ID from which you want to retrieve user information. By default, this is set to Polygon. -
+
{'img'}
@@ -29,12 +29,12 @@ Select the Chain ID from which you want to retrieve user information. By default Use the Indexer API to retrieve the Ether balance for a specified wallet address, such as the local user's address. -
+
{'img'}
-
- ```cpp +
+ ```cpp twoslash // Define success and failure callbacks const TSuccessCallback GenericSuccess = [=](const FEtherBalance& etherBalance) { }; const FFailureCallback GenericFailure = [=](const FSequenceError& Error) { }; @@ -67,11 +67,11 @@ Retrieve the user's token balances for ERC20, ERC721, and ERC1155 tokens. This w owned by the user. -
+
{'img'}
-
+
```cpp const TSuccessCallback GenericSuccess = [=](const FGetTokenBalancesReturn& tokenBalances) { @@ -121,11 +121,11 @@ owned by the user. Retrieve the token supplies for an ERC20, ERC721, or ERC1155 token. -
+
{'img'}
-
+
```cpp const TSuccessCallback GenericSuccess = [=](const FGetTokenSuppliesReturn& tokenSupplies) { @@ -171,11 +171,11 @@ Retrieve the token supplies for an ERC20, ERC721, or ERC1155 token. Retrieve a collection of token supplies for ERC20, ERC721, or ERC1155 tokens. -
+
{'img'}
-
+
```cpp const TSuccessCallback GenericSuccess = [=](const FGetTokenSuppliesMapReturn& tokenSuppliesMap) { @@ -224,11 +224,11 @@ Retrieve the transaction history for a wallet- or token address. For example, here we get all transaction for the current user. -
+
{'img'}
-
+
```cpp const TSuccessCallback GenericSuccess = [=](const FGetTransactionHistoryReturn& transactionHistory) { diff --git a/docs/pages/sdk/unreal/write-to-blockchain.mdx b/docs/pages/sdk/unreal/write-to-blockchain.mdx index 5d50813af84..4b3ad97e5c3 100644 --- a/docs/pages/sdk/unreal/write-to-blockchain.mdx +++ b/docs/pages/sdk/unreal/write-to-blockchain.mdx @@ -14,11 +14,11 @@ When transferring tokens, listen to the `Send Transaction` event when the transa Sign a given message as a hex string. For example, you can use this signature to validate content on your backend. -
+
{'img'}
-
+
```cpp const TSuccessCallback OnResponse = [this] (const FSeqSignMessageResponse_Response& Response) { @@ -44,11 +44,11 @@ Sign a given message as a hex string. For example, you can use this signature to Send native token balances to other users, such as sending ETH on the Ethereum Mainnet. -
+
{'img'}
-
+
```cpp FRawTransaction T; T.data = "0x0"; @@ -66,11 +66,11 @@ Send native token balances to other users, such as sending ETH on the Ethereum M Send your custom ERC20 tokens from Builder to users, or transfer existing tokens like USDC or WETH. -
+
{'img'}
-
+
```cpp // Create the ERC20 transaction FERC20Transaction T20; @@ -89,11 +89,11 @@ Send your custom ERC20 tokens from Builder to users, or transfer existing tokens Enable your users to send NFTs to others. -
+
{'img'}
-
+
```cpp // Create the ERC721 transaction FERC721Transaction T721; @@ -113,11 +113,11 @@ Enable your users to send NFTs to others. Enable your users to send Collectibles to others. -
+
{'img'}
-
+
```cpp // Create the ERC1155 transaction FERC1155Transaction T1155; @@ -140,11 +140,11 @@ Enable your users to send Collectibles to others. *Note: if you want call contracts with the Raw type you'll want include the header #include "ABI/ABI.h" in order to use the ABI to encode the data for a contract call.* -
+
{'img'}
-
+
```cpp void UMyClass::BurnToken(TArray> Txn, FString ContractAddress, int32 TokenId, int32 Amount) { @@ -172,11 +172,11 @@ Enable your users to send Collectibles to others. When working with Blueprints, it is easier to call a contract via server-side encoding using a Delayed Encode transaction. -
+
{'img'}
-
+
```cpp FDelayedTransaction DelayedEncodeTxn; DelayedEncodeTxn.to = ERC20Address; @@ -201,11 +201,11 @@ Once the fee options are received, select a fee option and use the `SendTransact the transaction with the selected fee. -
+
{'img'}
-
+
```cpp // Define the callback for handling the fee options response const TFunction)> OnFeeResponse = [Transactions, OnSuccess, OnFailure](const TArray& Response) From 1117d2c2a5160f9be5fa932bce77d0b2199df23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Gru=CC=88ning?= Date: Fri, 13 Dec 2024 18:28:02 +0100 Subject: [PATCH 3/6] fixed unreal typo --- docs/pages/sdk/unreal/read-from-blockchain.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/sdk/unreal/read-from-blockchain.mdx b/docs/pages/sdk/unreal/read-from-blockchain.mdx index 2c2d82296fa..dea94fba53a 100644 --- a/docs/pages/sdk/unreal/read-from-blockchain.mdx +++ b/docs/pages/sdk/unreal/read-from-blockchain.mdx @@ -221,7 +221,7 @@ Retrieve a collection of token supplies for ERC20, ERC721, or ERC1155 tokens. ## Get Transaction History Retrieve the transaction history for a wallet- or token address. -For example, here we get all transaction for the current user. +For example, here we get all transactions for the current user.
From 348b912d6f009882078f75d46bde0ec014646058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Gru=CC=88ning?= Date: Fri, 13 Dec 2024 18:40:46 +0100 Subject: [PATCH 4/6] removed redundant line from unreal's write-to-blockchain --- docs/pages/sdk/unreal/write-to-blockchain.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/pages/sdk/unreal/write-to-blockchain.mdx b/docs/pages/sdk/unreal/write-to-blockchain.mdx index 4b3ad97e5c3..b4844259444 100644 --- a/docs/pages/sdk/unreal/write-to-blockchain.mdx +++ b/docs/pages/sdk/unreal/write-to-blockchain.mdx @@ -7,8 +7,6 @@ import TabbedContent from "../../../components/TabbedContent"; # Write to Blockchain -When transferring tokens, listen to the `Send Transaction` event when the transaction is finished. - ## Sign Message Sign a given message as a hex string. For example, you can use this signature to validate content on your backend. From 7b294d36cd80af846fa41b074c4297d90233887a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Gru=CC=88ning?= Date: Mon, 16 Dec 2024 14:23:27 +0100 Subject: [PATCH 5/6] added unreal bootstrap-your-game section --- docs/pages/sdk/unreal/bootstrap_game.mdx | 88 +++++++++++++++++++ docs/public/img/unreal/feature_inventory.png | 3 + .../img/unreal/feature_inventory_demo.gif | 3 + docs/public/img/unreal/feature_sale.png | 3 + docs/public/img/unreal/feature_sale_demo.gif | 3 + docs/public/img/unreal/feature_wallet.png | 3 + .../public/img/unreal/feature_wallet_demo.gif | 3 + nav.ts | 3 +- 8 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 docs/pages/sdk/unreal/bootstrap_game.mdx create mode 100644 docs/public/img/unreal/feature_inventory.png create mode 100644 docs/public/img/unreal/feature_inventory_demo.gif create mode 100644 docs/public/img/unreal/feature_sale.png create mode 100644 docs/public/img/unreal/feature_sale_demo.gif create mode 100644 docs/public/img/unreal/feature_wallet.png create mode 100644 docs/public/img/unreal/feature_wallet_demo.gif diff --git a/docs/pages/sdk/unreal/bootstrap_game.mdx b/docs/pages/sdk/unreal/bootstrap_game.mdx new file mode 100644 index 00000000000..cd19f2bfab4 --- /dev/null +++ b/docs/pages/sdk/unreal/bootstrap_game.mdx @@ -0,0 +1,88 @@ +--- +title: Sequence - Web3 Gaming Platform - Unreal SDK Sequence API +description: Documentation for Unreal SDK API for reading from the blockchain with the Sequence infrastructure stack for web3 gaming. +--- + +import {CollapsibleDetails} from "../../../components/CollapsibleDetails.tsx"; +import TabbedContent from "../../../components/TabbedContent"; + +# Bootstrap your Game + +Sequence's Unreal SDK includes a range of features to help you bootstrap your game. +You can create them as shown below or duplicate the `.uasset` files from the `Plugins/SequencePlugin Content/Samples/` +folder and customize them to fit your needs. + +## Inventory + +Create the `Sequence Inventory` widget to display a QR code to receive funds or send funds to other wallets. + +{'img'} +{'img'} + + + +## Primary Sale + +Create the `Sequence Primary Sale` widget to display a QR code to receive funds or send funds to other wallets. + +{'img'} +{'img'} + + + +## My Wallet View + +Create the `Sequence Profile` widget to display a QR code to receive funds or send funds to other wallets. + +{'img'} +{'img'} + + diff --git a/docs/public/img/unreal/feature_inventory.png b/docs/public/img/unreal/feature_inventory.png new file mode 100644 index 00000000000..2cfa05f2e04 --- /dev/null +++ b/docs/public/img/unreal/feature_inventory.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3625192a9c3bca5cae39288ea624aafb83b322beb4f40147b78d19ba75b7a12d +size 132263 diff --git a/docs/public/img/unreal/feature_inventory_demo.gif b/docs/public/img/unreal/feature_inventory_demo.gif new file mode 100644 index 00000000000..c28f75e0ca8 --- /dev/null +++ b/docs/public/img/unreal/feature_inventory_demo.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38764f486f3f6c7ac4bbdfde2146e2334a27c3aba28c4af5ce389f515f3aaeb8 +size 523265 diff --git a/docs/public/img/unreal/feature_sale.png b/docs/public/img/unreal/feature_sale.png new file mode 100644 index 00000000000..b831946952a --- /dev/null +++ b/docs/public/img/unreal/feature_sale.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f6f67e835997d86d42737a654077c3773fba38f3b3cb782930fdef90d1d116e +size 215468 diff --git a/docs/public/img/unreal/feature_sale_demo.gif b/docs/public/img/unreal/feature_sale_demo.gif new file mode 100644 index 00000000000..3eabb253f4c --- /dev/null +++ b/docs/public/img/unreal/feature_sale_demo.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c965247bc5134dd89decf7703ee75681cc6b6778eb39ef605b34b979e1aee40 +size 590678 diff --git a/docs/public/img/unreal/feature_wallet.png b/docs/public/img/unreal/feature_wallet.png new file mode 100644 index 00000000000..619fae424ff --- /dev/null +++ b/docs/public/img/unreal/feature_wallet.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91d6197767b668a0d933bcdc284298bd0e33c22a9b83473a2bf6e3635fd82585 +size 109612 diff --git a/docs/public/img/unreal/feature_wallet_demo.gif b/docs/public/img/unreal/feature_wallet_demo.gif new file mode 100644 index 00000000000..9c26c49327e --- /dev/null +++ b/docs/public/img/unreal/feature_wallet_demo.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b358e6f643d423c861fac7cb937631a2d1fff90faa73534610d20db082f0b1de +size 279227 diff --git a/nav.ts b/nav.ts index b8ad0b990fd..46ddeead075 100644 --- a/nav.ts +++ b/nav.ts @@ -692,7 +692,8 @@ export const sidebar = { { text: 'Installation', link: '/sdk/unreal/installation' }, { text: 'Configuration', link: '/sdk/unreal/configuration' }, { text: 'Blueprint Subsystems', link: '/sdk/unreal/subsystems' }, - { text: 'Bootstrap your UI', link: '/sdk/unreal/user_interfaces' }, + { text: "Bootstrap your Game", link: "/sdk/unreal/bootstrap_game" }, + { text: 'Sign-In UI', link: '/sdk/unreal/user_interfaces' }, { text: 'Authenticate Users', link: '/sdk/unreal/authentication' }, { text: 'Write to Blockchain', link: '/sdk/unreal/write-to-blockchain' }, { text: 'Read from Blockchain', link: '/sdk/unreal/read-from-blockchain' }, From e66ed29b4ce8eeaba172b1971d07143765220627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andy=20Gru=CC=88ning?= Date: Mon, 16 Dec 2024 14:51:23 +0100 Subject: [PATCH 6/6] unreal docs tweaks --- docs/pages/sdk/unreal/configuration.mdx | 6 ------ docs/pages/sdk/unreal/introduction.mdx | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/pages/sdk/unreal/configuration.mdx b/docs/pages/sdk/unreal/configuration.mdx index 53dbc275ca0..69efd65c4cf 100644 --- a/docs/pages/sdk/unreal/configuration.mdx +++ b/docs/pages/sdk/unreal/configuration.mdx @@ -16,13 +16,7 @@ In your Project's Build.cs file ([where to find](https://forums.unrealengine.com { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); - //The line below is what you want PrivateDependencyModuleNames.AddRange(new string[] { "SequencePlugin" }); - // Uncomment if you are using Slate UI - // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); - // Uncomment if you are using online features - // PrivateDependencyModuleNames.Add("OnlineSubsystem"); - // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true } ``` diff --git a/docs/pages/sdk/unreal/introduction.mdx b/docs/pages/sdk/unreal/introduction.mdx index 1dd919a2a93..88df6aad726 100644 --- a/docs/pages/sdk/unreal/introduction.mdx +++ b/docs/pages/sdk/unreal/introduction.mdx @@ -23,7 +23,7 @@ Please view our [Platform Requirements](/sdk/unreal/platforms) ## Supported Authentication Methods -Start the integration in any of [your Blueprints](/sdk/unreal/platforms) +Start the integration using our [Subsystems for Blueprints](/sdk/unreal/subsystems) - Email with One-Time-Password - Google- & Apple Single Sign On