Skip to content

Commit

Permalink
Embedded Wallet section edits and standardization (#40)
Browse files Browse the repository at this point in the history
* Standardize Embedded Wallet naming

* Fix issues with Embedded Wallet intro and quickstart

* Fix code sample issues with WaaS examples

---------

Co-authored-by: James Lawton <[email protected]>
  • Loading branch information
taylanpince and JamesLawton authored Apr 11, 2024
1 parent d253752 commit 0ce6fe0
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 172 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
docs/dist
docs/dist
.DS_Store
pnpm-lock.yaml
8 changes: 4 additions & 4 deletions docs/pages/guides/webgl-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The tools will enable you to perform:
- [4. Deploy a remote minter and mint in-game tokens](/guides/webgl-guide#4-deploy-a-remote-minter--mint-in-game-achievement-tokens): Perform gasless relayed transactions with Cloudflare workers
- [5. Leverage items in-game](/guides/webgl-guide#5-leverage-items-in-game): Integrate collectibles in the game using the Sequence Indexer
- [6. Burn in-game achievement tokens](/guides/webgl-guide#6-burn-in-game-achievement-tokens): Burn game achievements with wagmi
- [7. (Optional) Integrate In-Game Wallet into Sequence Kit](/guides/webgl-guide#7-optional-integrate-in-game-wallet-into-sequence-kit): Enable smooth UX without the use of signer signed messages
- [7. (Optional) Integrate Embedded Wallet into Sequence Kit](/guides/webgl-guide#7-optional-integrate-in-game-wallet-into-sequence-kit): Enable smooth UX without the use of signer signed messages

## 1. Project setup with webpack

Expand Down Expand Up @@ -534,9 +534,9 @@ async fetchTokensFromBurn(tokenID){

And you're done, you can view a full example of the code [here](https://github.com/0xsequence-demos/template-webgl-js-sequence-kit-starter)

## 7. (Optional) Integrate In-Game Wallet into Sequence Kit
## 7. (Optional) Integrate Embedded Wallet into Sequence Kit

If you'd like to smooth the user journey to allow no user transaction signing across the board, you can enable an In-Game Wallet by updating your configuration of your Sequence Kit react component.
If you'd like to smooth the user journey to allow no user transaction signing across the board, you can enable an Embedded Wallet by updating your configuration of your Sequence Kit react component.

By accomplishing this, we reduce a pop-up when burning tokens with `wagmi`, since rewarding achievement tokens and minting collectibles are completed using a cloudflare relayer for gasless transactions.

Expand Down Expand Up @@ -608,5 +608,5 @@ And that's it, no more integration is required for transaction flows to complete
---

<Callout type='info'>
To learn more about In-Game Wallets, see [here](/solutions/wallets/embedded-wallet/01-overview)
To learn more about Embedded Wallets, see [here](/solutions/wallets/embedded-wallet/01-overview)
</Callout>
2 changes: 1 addition & 1 deletion docs/pages/sdk/unreal/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ slug: /unreal-waas-sdk

# Introduction

The Sequence Unreal In-Game Wallet SDK provides full Sequence [In-Game Wallet](/solutions/wallets/embedded-wallet/01-overview) and [Indexer](/api/indexer/overview) integration for games built on the Unreal Framework.
The Sequence Unreal Embedded Wallet SDK provides full Sequence [Embedded Wallet](/solutions/wallets/embedded-wallet/01-overview) and [Indexer](/api/indexer/overview) integration for games built on the Unreal Framework.

This SDK follows [Semantic Versioning](https://semver.org/) (`major.minor.patch`). While we're still in `0.x.y` builds, API breaking changes can be made at any time. After `1.0.0`, breaking changes will always cause a `major` version increment, non-breaking new features will cause a `minor` version increment, and bugfixes will cause a `patch` version increment.

Expand Down
42 changes: 42 additions & 0 deletions docs/pages/solutions/builder/embedded-wallet.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Embedded Wallet in Builder
You can configure a [Sequence Embedded Wallet](/solutions/wallets/embedded-wallet/01-overview) in Builder and integrate your own OAuth accounts to enable easy onboarding to your games. Configuration page in Builder [is available here](https://sequence.build/project/default/wallet/embedded-wallet).

## Login Providers
Sequence Embedded Wallet supports the following login providers:

### Google Auth
If you would like to support Google Auth, you need to make sure that a project is configured at your [Google Cloud Console](https://console.cloud.google.com/) along with the proper OAuth 2.0 client ID. You can find the relevant section under APIs & Services > [Credentials](https://console.cloud.google.com/apis/credentials). After setting up the proper origins and redirect URIs for your project, copy the Client ID and paste it into the Google Client ID field after adding a Google login provider.

You can find a detailed tutorial on [how to configure Google Auth here](https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid).

### Apple Auth
If you would like to offer Apple Auth, you need to make sure that an application is configured at your [Apple Developer Console](https://developer.apple.com/account) account. More information on how to configure Sign in with Apple [can be found here](https://developer.apple.com/help/account/configure-app-capabilities/configure-sign-in-with-apple-for-the-web/). Once you have all requirements completed, share the unique identifier for the Services ID you created as part of your onboarding package after adding an Apple login provider.

## Allowed Origins
This additional security measure will prevent unauthorized usage of your WaaS configuration outside of domains you whitelisted. Add any development and production URLs under Allowed Origins. By default all subpaths under theses hosts will be allowed.

You must define allowed origins with a valid scheme (i.e. `https`).

## Recovery Wallet
WaaS requires the public address for a recovery wallet that you control. This recovery wallet will be used for recovering user wallets in a disaster scenario, so it must be controlled by you and must be kept safe at all times.

We recommend that:

- You use [Gnosis Safe](https://safe.global/) for setting up the wallet
- You ensure you have at least 2, ideally 3+ signers configured and required for every transaction
- Every signer is protected by a hardware wallet

Once the recovery wallet is setup properly, provide the public address for it. Recovery wallet cannot be modified once your configuration is saved.

## Initial Configuration and Update Code
Once you have all information prepared, go ahead and create your Embedded Wallet configuration. During initial setup, Builder will provide you with an update code. This code will be required for all subsequent modifications to your Embedded Wallet configuration, so it must be stored safely.

## Configuration Changes
To make modifications to your Embedded Wallet configuration, navigate to the Embedded Wallet section again and make the necessary changes. Then click "Save Configuration" and enter your update code to deploy the changes.

## SDK Integrations
Now that you have your Embedded Wallet configuration up, go ahead and follow our guides on how to integrate with the SDKs:

- [TypeScript SDK](/solutions/wallets/embedded-wallet/01-overview)
- [Unity SDK](/sdk/unity/01-overview)
- [Unreal SDK](/sdk/unreal/01-overview)
10 changes: 9 additions & 1 deletion docs/pages/solutions/wallets/embedded-wallet/01-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Sequence Embedded Wallet (or Wallet-as-a-Service) enables the creation, manageme

Sequence Embedded Wallet offers real non-custodial wallets and the system guarantees that each created wallet can only be accessed with the consent of the owner of the wallet. This is made possible by utilizing the power of [AWS Nitro Enclaves](https://aws.amazon.com/ec2/nitro/nitro-enclaves/) to handle sensitive data in a secure environment that nobody can access - not even Sequence.

At the same time, the smooth user experience makes them forget they are interacting with Web3. All the aspects of it are controlled by you, with no popups or interruptions, the wallet abstracted away by a few SDK or API calls.
## Try a Demo

:::info
Try out the seamless onboarding of Sequence Embedded Wallet [here](https://waas-demo.sequence.xyz/)
:::

Once you are ready dive into implementation, follow the [quickstart guide](/solutions/wallets/embedded-wallet/02-quickstart).

## Architecture overview

Project-scoped wallets on your terms but with unmatched security giving your users peace of mind? Yes, now you can eat your cake and have it too.
58 changes: 29 additions & 29 deletions docs/pages/solutions/wallets/embedded-wallet/02-quickstart.mdx
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# Quickstart

## Try a Demo
You can quickly try out a Sequence Embedded Wallet integration before doing a complete configuration specific to your application. There are several ways to test out the features:

:::info
Try out seamless UX of our embedded wallet at our [demo](https://0xsequence.github.io/demo-waas-auth/)
:::
- Try out [Sequence WaaS demo](https://waas-demo.sequence.xyz/), showcasing a sample authentication and transaction flow leveraging Sequence Kit for web applications
- Play with [Aviator](https://0xsequence.github.io/waas-airplane-demo/), a complete WebGL game built using Embedded Wallet, leveraging [Sequence Marketplace API](/solutions/marketplaces/orderbook/01-overview) as well as [serverless Cloudflare Worker](/guides/templates/03-mint-collectibles-serverless) for minting
- Browse [Jelly Forest source code](https://github.com/0xsequence-demos/jelly-forest), our Unity WaaS SDK demo implementation that natively runs on iOS and Android

## Template
You can also do a quick integration of Embedded Wallet into your own application by using the following test configuration keys:

:::info
Get started quickly with a [template](https://github.com/0xsequence/demo-waas-auth) leveraging our embedded wallet.
:::
- Project Access Key: `AQAAAAAAAEGvyZiWA9FMslYeG_yayXaHnSI`
- WaaS Configuration Key: `eyJwcm9qZWN0SWQiOjE2ODE1LCJycGNTZXJ2ZXIiOiJodHRwczovL3dhYXMuc2VxdWVuY2UuYXBwIn0=`

## Getting Started
These will leverage Sequence's own Google and Apple test authentication configurations and are whitelisted for `localhost` usage only. They cannot be used in a production setup.

### SDK Installation
To see how to integrate these keys into a sample demo application, you can browse the [Demo WaaS repository](https://github.com/0xsequence/demo-waas-auth).

You can also view SDK-specific guides here:

- [TypeScript SDK](/solutions/wallets/embedded-wallet/02-quickstart)
- [Unity SDK](/sdk/unity/01-overview)
- [Unreal SDK](/sdk/unreal/01-overview)

We provide TypeScript and Unity SDKs for the Embedded Wallet authentication system. You can install the TypeScript SDK with:
When you are ready to configure your own Embedded Wallet, you can [follow the Builder guide here](/solutions/builder/embedded-wallet).

## Getting Started with TypeScript SDK

### SDK Installation
You can install the TypeScript SDK with:

```bash
pnpm install @0xsequence/waas
```

For more information on the Unity Embedded Wallet SDK, please refer to the TODO add link [Unity SDK documentation](#TODO)

### Project Setup

Sequence Embedded Wallet is currently only available as a closed beta. To start using the Embedded Wallet SDKs, you'll need to contact the Sequence team and acquire API credentials. Once this is done, you will be provided with two keys:

- Project access key
- Embedded Wallet configuration key
You can test out the library with the Project Access Key and WaaS Configuration Key provided above. Once you are ready to configure your own Embedded Wallet, follow [the Builder guide here](/solutions/builder/embedded-wallet).

### Library Setup

To start using Sequence Embedded Wallet SDK, you'll need to create a new instance of the `waas` class:

```typescript
import { SequenceWaaS } from "@0xsequence/waas";

const waas = new SequenceWaaS(
{
projectAccessKey: `${process.env.PROJECT_ACCESS_KEY}`,
waasConfigKey: `${process.env.WAAS_CONFIG_KEY}`,
network: "mumbai",
},
defaults.TEST
);
import { SequenceWaaS } from '@0xsequence/waas'

const waas = new SequenceWaaS({
projectAccessKey: `${process.env.PROJECT_ACCESS_KEY}`,
waasConfigKey: `${process.env.WAAS_CONFIG_KEY}`,
network: 'arbitrum-nova'
})
```

Note that the library is operational, but it can't be used to interact with any wallet until you have authenticated **as a user**.
Loading

0 comments on commit 0ce6fe0

Please sign in to comment.