Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added On-Ramp blueprint support #483

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/components/TabbedContent/style.css
Original file line number Diff line number Diff line change
@@ -7,14 +7,14 @@
padding: 10px;
cursor: pointer;
border-radius: 0.4rem;
border: 1px solid rgba(0, 158, 255, 0.165);
background-color: rgba(0, 143, 245, 0.098);
border: 1px solid rgba(82, 29, 232, 0.4);
background-color: rgba(82, 29, 232, 0.2);
transition: background-color 0.4s ease;
outline: none;
}

.tabbed-content__menu-button:hover {
background-color: rgba(0, 143, 245, 0.2);
background-color: rgba(82, 29, 232, 0.3);
}

.tabbed-content__menu-button:focus {
@@ -23,7 +23,7 @@

.tabbed-content__menu-button--active,
.tabbed-content__menu-button--active:hover {
background-color: #007bff;
background-color: rgba(82, 29, 232, 1);
color: white;
}

36 changes: 3 additions & 33 deletions docs/pages/sdk/unreal/configuration.mdx
Original file line number Diff line number Diff line change
@@ -21,14 +21,13 @@ In your Project's Build.cs file ([where to find](https://forums.unrealengine.com
```

## Create a config file
Navigate to `[YourProjectDirectory]/Config`, create a file named `SequenceConfig.ini`, and add the following lines:
Navigate to `[YourProjectDirectory]/Config`, create a file named `SequenceConfig.ini`, and add the following content:

```
[/Script/Sequence.Config]

FallbackEncryptionKey = ""
WaaSConfigKey = ""
ProjectAccessKey = ""
WaaSConfigKey = "Go to https://sequence.build/ under Onboard > Embedded Wallet"
ProjectAccessKey = "Go to https://sequence.build/ under Settings > API Keys"
GoogleClientID = ""
AppleClientID = ""
FacebookClientID = ""
@@ -37,37 +36,8 @@ PlayFabTitleID = ""
RedirectUrl = "https://api.sequence.app"
```

## Add your project keys
Fill in `[YourProjectDirectory]/Config/SequenceConfig.ini` with the appropriate values for your project.

`WaaS Config Key` - You can get this key in [Sequence Builder](https://sequence.build/) under **Onboard > Embedded Wallet**

`Project Access Key` - You can get this key in [Sequence Builder](https://sequence.build/) under **Settings > API Keys**

`Fallback Encryption Key` - Create a 32-character long alphanumeric encryption key.

::::

:::tip
Make sure to get the WaaS keys from **Production Mode**.
:::

:::warning
Don't forget to [configure your embedded wallet settings in the Builder](/solutions/builder/embedded-wallet/index)!
:::

## Security

In order to prevent tampering with data you must encrypt your packaged project using Unreals packaging settings. You can refer to [these docs](https://dev.epicgames.com/documentation/en-us/unreal-engine/packaging-unreal-engine-projects?application_version=5.3) for more information.

:::tip
You can use a password manager (or any other secure randomness source) to generate this encryption key
:::

:::warning
Only alphanumeric characters are accepted!
:::

:::danger
**STOP!** Everything on this page is very important! Please double-check that you have done everything!
:::
8 changes: 4 additions & 4 deletions docs/pages/sdk/unreal/introduction.mdx
Original file line number Diff line number Diff line change
@@ -7,23 +7,23 @@ description: Documentation for Unreal SDK overview for the Sequence infrastructu

The Sequence Unreal Embedded Wallet SDK provides full Sequence [Embedded Wallet](/solutions/wallets/embedded-wallet/overview) and [Indexer](/api/indexer/overview) integration for games built on the Unreal Framework. We provide full Blueprint support for a seamless integration experience.

Get started with our [Boilerplate Project](/sdk/unreal/installation#using-our-boilerplate-project) or use the [latest version of Sequence's Unreal SDK](/sdk/unreal/installation#using-the-latest-github-release) in your existing project.
Get started with our [Quickstart Guide.](/sdk/unreal/quickstart)

<img alt={'img'} src={'/img/unreal/unreal_intro.gif'}/>

## Supported Platforms

Please view our [Platform Requirements](/sdk/unreal/platforms)

- Unreal Engine 5.4, 5.3 & 5.2
- Unreal Engine 5.5, 5.4, 5.3 & 5.2
- Android
- iOS
- PC Standalone
- Mac Standalone

## Supported Authentication Methods
## Supported Login Methods

Start the integration using our [Subsystems for Blueprints](/sdk/unreal/subsystems)
Start the integration using our [Session Subsystem for Blueprints](/sdk/unreal/authentication).

- Email with One-Time-Password
- Google- & Apple Single Sign On
161 changes: 109 additions & 52 deletions docs/pages/sdk/unreal/onboard-user-funds.mdx
Original file line number Diff line number Diff line change
@@ -1,66 +1,123 @@
# OnRamp
---
title: Sequence - Web3 Gaming Platform - Unreal SDK Overview
description: Documentation for Unreal SDK overview for the Sequence infrastructure stack for web3 gaming.
---

import {CollapsibleDetails} from "../../../components/CollapsibleDetails.tsx";
import TabbedContent from "../../../components/TabbedContent";

# On-Ramp with Credit Card

If you wish for your users to be able to pay for things in your game using cryptocurrencies, you'll find our Transak integration to be very helpful.
Transak allows users to purchase a variety of cryptocurrencies on a variety of blockchains using their credit card using a user friendly web interface. Learn more about Transak [here](https://transak.com/).

## On-Ramp User Funds via Credit Card
## Generate On-Ramp URL

To generate a link for your user's Transak on-ramping.

<TabbedContent labels={["Blueprint", "C++"]}>
<div className="tabbed-content__content borderless">
<img alt={'img'} src={'/img/unreal/pay_onramp_link.png'}/>
</div>

<div className="tabbed-content__content borderless">
```cpp
UTransakOnRamp* Transak = UTransakOnRamp::Init("UserWalletAddress");
FString OnRampLink = Transak->GetTransakLink("USD", "100", "BTC", "network1,network2", false);
// You can tailor the user experience by providing different default values for the parameters.
```
</div>
</TabbedContent>

<CollapsibleDetails title={'Parameters'} items={[{
key: 'Wallet Address (FString)',
value: "The address of the user who receives the purchased amount of cryptocurrency."
},{
key: 'Fiat Currency (FString)',
value: "The default fiat currency displayed in the On-Ramp modal."
},{
key: 'Fiat Amount (FString)',
value: "The default fiat amount displayed in the On-Ramp modal."
},{
key: 'Crypto Currency (FString)',
value: "The cryptocurrency the user is allowed to purchase."
},{
key: 'Networks (FString)',
value: "List of networks the user can select, separated by a comma. For example: 'ethereum, mainnet'."
},{
key: 'Disable Wallet Address Form (Boolean)',
value: "Set this value to 'false' to allow users to edit their wallet address."
}]}/>

<CollapsibleDetails title={'Return Types'} items={[{
key: 'Return Type (FString)',
value: "The On-Ramp link used to open in a WebView or external Web Browser."
}]}/>

## Open On-Ramp URL

To generate a link for your user's Transak on-ramping:

```cpp
UTransakOnRamp* Transak = UTransakOnRamp::Init("UserWalletAddress");
FString OnRampLink = Transak->GetTransakLink("USD", "100", "BTC", "network1,network2", false);
// You can tailor the user experience by providing different default values for the parameters.
```
<TabbedContent labels={["Blueprint", "C++"]}>
<div className="tabbed-content__content borderless">
<img alt={'img'} src={'/img/unreal/pay_open_onramp.png'}/>
</div>

<div className="tabbed-content__content borderless">
```cpp
UTransakOnRamp* Transak = UTransakOnRamp::Init("UserWalletAddress");
Transak->OpenTransakLink("USD", "100", "BTC", "network1,network2", false);
// This will automatically open the generated Transak On-Ramp link in the default web browser.
```
</div>
</TabbedContent>

From here, you can open the OnRampLink using `FPlatformProcess::LaunchURL`. Alternatively, you can use:
<CollapsibleDetails title={'Parameters'} items={[{
key: 'Wallet Address (FString)',
value: "The address of the user who receives the purchased amount of cryptocurrency."
},{
key: 'Fiat Currency (FString)',
value: "The default fiat currency displayed in the On-Ramp modal."
},{
key: 'Fiat Amount (FString)',
value: "The default fiat amount displayed in the On-Ramp modal."
},{
key: 'Crypto Currency (FString)',
value: "The cryptocurrency the user is allowed to purchase."
},{
key: 'Networks (FString)',
value: "List of networks the user can select, separated by a comma. For example: 'ethereum, mainnet'."
},{
key: 'Disable Wallet Address Form (Boolean)',
value: "Set this value to 'false' to allow users to edit their wallet address."
}]}/>

```cpp
UTransakOnRamp* Transak = UTransakOnRamp::Init("UserWalletAddress");
Transak->OpenTransakLink("USD", "100", "BTC", "network1,network2", false);
// This will automatically open the generated Transak On-Ramp link in the default web browser.
```
## Get Supported Countries

## Check Supported Countries
To check the countries supported by Transak and learn about how they are supported, use the `GetSupportedCountries` method.

```cpp
Transak->GetSupportedCountries(
[](TArray<FSupportedCountry> SupportedCountries) {
// Handle the supported countries, e.g., log their names
for (const FSupportedCountry& Country : SupportedCountries) {
UE_LOG(LogTemp, Log, TEXT("Country: %s"), *Country.CountryName);
}
},
[](FSequenceError Error) {
// Handle any errors that occur
UE_LOG(LogTemp, Error, TEXT("Encountered error fetching supported countries from Transak: %s"), *Error.ErrorMessage);
}
);
```

## Using Transak from USequenceWallet

You can also access the Transak functionalities straight from `USequenceWallet`:

```cpp
const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
if (WalletOptional.IsSet() && WalletOptional.GetValue())
{
USequenceWallet* Wallet = WalletOptional.GetValue();
Wallet->GetSupportedTransakCountries(
[](TArray<FSupportedCountry> SupportedCountries) {
// Handle the supported countries, e.g., log their names
for (const FSupportedCountry& Country : SupportedCountries) {
<TabbedContent labels={["Blueprint", "C++"]}>
<div className="tabbed-content__content borderless">
<img alt={'img'} src={'/img/unreal/pay_get_supported_countries.png'}/>
</div>

<div className="tabbed-content__content borderless">
```cpp
Transak->GetSupportedCountries(
[](TArray<FSupportedCountry> SupportedCountries) {
for (const FSupportedCountry& Country : SupportedCountries) {
UE_LOG(LogTemp, Log, TEXT("Country: %s"), *Country.CountryName);
}
},
[](FSequenceError Error) {
// Handle any errors that occur
UE_LOG(LogTemp, Error, TEXT("Encountered error fetching supported countries from Transak: %s"), *Error.ErrorMessage);
}
);
}
// Open the Transak link in the default browser
Wallet->OpenTransakLink("USD", "100", "BTC", "network1,network2", false);
```
},
[](FSequenceError Error) {
UE_LOG(LogTemp, Error, TEXT("Encountered error fetching supported countries from Transak: %s"), *Error.ErrorMessage);
}
);
```
</div>
</TabbedContent>

<CollapsibleDetails title={'Return Types'} items={[{
key: 'Supported Countries (Array of FSupportedCountry)',
value: "List of objects that include information for each country, such as the name or currency code."
}]}/>
4 changes: 4 additions & 0 deletions docs/pages/sdk/unreal/platforms.mdx
Original file line number Diff line number Diff line change
@@ -13,6 +13,10 @@ To set your system up for Packaging please refer to the following links:
- [Mac Specific Software Requirements](https://dev.epicgames.com/documentation/en-us/unreal-engine/hardware-and-software-specifications-for-unreal-engine)
- [Setting up Visual Studio for Unreal on Windows](https://dev.epicgames.com/documentation/en-us/unreal-engine/setting-up-visual-studio-development-environment-for-cplusplus-projects-in-unreal-engine)

## Security

In order to prevent tampering with data you must encrypt your packaged project using Unreals packaging settings. You can refer to [these docs](https://dev.epicgames.com/documentation/en-us/unreal-engine/packaging-unreal-engine-projects?application_version=5.3) for more information.

## Hardware Requirements

For Hardware Requirements with Unreal please refer to [these docs](https://dev.epicgames.com/documentation/en-us/unreal-engine/hardware-and-software-specifications-for-unreal-engine?application_version=5.3)
41 changes: 41 additions & 0 deletions docs/pages/sdk/unreal/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Sequence - Web3 Gaming Platform - Unreal SDK Sequence API
description: Quickstart Documentation for Sequence's Unreal SDK.
---

# Quickstart

::::steps

## Install the Unreal SDK

Download and install the latest version of Sequence's Unreal SDK from [GitHub](https://github.com/0xsequence/sequence-unreal/releases), or start a new project from scratch
by downloading our [Unreal Project Boilerplate](https://github.com/0xsequence/unreal-embedded-wallet-boilerplate).

## Configure the SDK

Sign in and create a project on [Sequence Builder](https://sequence.build).

Get your `Project Access Key` and `WaaS Configuration Key` from `Onboard > Embedded Wallet`,
and add them to your [Project's Sequence Config File](/sdk/unreal/configuration).

## Integrate E-Mail Login

Start by establishing a wallet session using an email OTP. Execute the `Start Email Login Async` node to send a
one-time password to the specified email address. Then, use the `Confirm Email Login with Code Async` node with the
received password to complete the login.

Once you’ve your first features integrated, you can continue with [additional login providers](/sdk/unreal/authentication)
such as Google, Apple, or PlayFab.

<img alt={'img'} src={'/img/unreal/email_otp.png'}/>

## Test Sequence's Features

Sequence's Unreal SDK includes a variety of Blueprints to help you quickly start your game.
Once everything is configured, you can create widgets to display an Inventory, Wallet View, or In-Game Store.
Checkout [how to integrate a Wallet View](/sdk/unreal/bootstrap_game#my-wallet-view) using just three Blueprint nodes to view and send funds.

<img alt={'img'} src={'/img/unreal/feature_wallet_demo.gif'} style={{borderRadius: 15, width: '100%'}}/>

::::
6 changes: 6 additions & 0 deletions docs/pages/sdk/unreal/subsystems.mdx
Original file line number Diff line number Diff line change
@@ -27,6 +27,12 @@ Use Sequence's Indexer Subsystem to retrieve user information, such as their bal

<img alt={'img'} src={'/img/unreal/subsystem_indexer.png'}/>

## Sequence Pay

Use Sequence's Pay Subsystem to access On-Ramp functionality and allow users to buy crypto using credit cards.

<img alt={'img'} src={'/img/unreal/subsystem_pay.png'}/>

## Sequence Utility

Use Sequence's Utility Subsystem for convenience functions that encapsulate common use cases into smaller Blueprint nodes.
3 changes: 3 additions & 0 deletions docs/public/img/unreal/pay_get_supported_countries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/public/img/unreal/pay_onramp_link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/public/img/unreal/pay_open_onramp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/public/img/unreal/subsystem_pay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion nav.ts
Original file line number Diff line number Diff line change
@@ -704,6 +704,7 @@ export const sidebar = {
match: '/sdk/unreal/introduction',
items: [
{ text: 'Introduction', link: '/sdk/unreal/introduction' },
{ text: 'Quickstart', link: '/sdk/unreal/quickstart' },
{ text: 'Installation', link: '/sdk/unreal/installation' },
{ text: 'Configuration', link: '/sdk/unreal/configuration' },
{ text: 'Blueprint Subsystems', link: '/sdk/unreal/subsystems' },
@@ -712,7 +713,7 @@ export const sidebar = {
{ 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' },
{ text: 'On-Ramp via Credit Card', link: '/sdk/unreal/onboard-user-funds' },
{ text: 'On-Ramp with Credit Card', link: '/sdk/unreal/onboard-user-funds' },
{ text: 'Advanced Blockchain Interactions', link: '/sdk/unreal/advanced' },
{ text: 'Platform Requirements', link: '/sdk/unreal/platforms' },
],