Skip to content

Commit

Permalink
removed numbers links and updated naming of in-game wallet (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
moskalyk authored Apr 12, 2024
1 parent b7e3fc0 commit b4e9ede
Show file tree
Hide file tree
Showing 109 changed files with 835 additions and 272 deletions.
6 changes: 0 additions & 6 deletions docs/components/Landing/APIsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ export const APIsSection = () => (
body="Send and optimize transactions on any chain through our performant Sequence Relayer."
link="/api/relayer/overview"
/>
{/* <Card
title="Embedded Wallets API"
icon="WalletIcon"
body="Easily onboard web3-native players with a complete Universal Wallet."
link="/"
/> */}
<Card
title="Node Gateway"
icon="NodeGatewayIcon"
Expand Down
4 changes: 2 additions & 2 deletions docs/components/Landing/GuidesSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export const GuidesSection = () => (
<div className="flex flex-wrap gap-4">
<GuideCard
title="Build a web3 game with WebGL"
body="Follow a step by step guide to build a web-based game demo that leverages Sequence Embedded Wallet with custom in-game achievement tokens."
body="Follow a step by step guide to build a web-based game demo that leverages Sequence In-Game Wallet with custom in-game achievement tokens."
link="/guides/webgl-guide/#integrate-sequencekit-with-waas"
/>
<GuideCard
title="Build a web3 game with Unity"
body="Learn how to build an engaging iOS and Android game that uses Sequence Embedded Wallets under the hood for an integrated marketplace and in-game currency."
body="Learn how to build an engaging iOS and Android game that uses Sequence In-Game Wallets under the hood for an integrated marketplace and in-game currency."
link="/guides/webgl-guide/#integrate-sequencekit-with-waas"
/>
<GuideCard
Expand Down
4 changes: 2 additions & 2 deletions docs/components/Landing/SolutionsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export const SolutionsSection = () => (
},
{
icon: 'WalletIcon',
title: 'Embedded Wallet',
title: 'In-Game Wallet',
body: 'Gasless Transactions. No popups. Deliver a seamless experience for both web2 and web3 players with Sequence Wallet-as-a-Service embedded into your game or app.',
link: '/solutions/wallets/embedded-wallet/01-overview',
link: '/solutions/wallets/in-game-wallet/01-overview',
},
{
icon: 'CollectiblesIcon',
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/api/relayer/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Meta-transactions are the idea of a transaction inside of a transaction. The ben

The best part: transactions with Sequence Relayer are compatible with any existing/deployed Ethereum contract, and thus, integrating the Sequence Relayer doesn't require any changes to your contracts or dapp.

The Sequence Relayer is usable by frontend dapps, or even in your backends. Be sure to install the corresponding SDK for your preferred language such as [Typescript](/sdk/typescript/03-guides/overview) or [Go](/sdk/go/overview).
The Sequence Relayer is usable by frontend dapps, or even in your backends. Be sure to install the corresponding SDK for your preferred language such as [Typescript](/sdk/typescript/guides/overview) or [Go](/sdk/go/overview).

## Anatomy of a Sequence transaction bundle

Expand Down
10 changes: 5 additions & 5 deletions docs/pages/guides/custom-marketplace-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ The tools will enable you to perform:

## 1. Minting

The first step is to create a collectible from the sequence Builder and mint a few tokens, which can be accomplished with this [guide](/solutions/collectibles/contracts/01-deploy-an-item-collection) and to use the `tokenId` you minted in the following steps to query and fulfill orders.
The first step is to create a collectible from the sequence Builder and mint a few tokens, which can be accomplished with this [guide](/solutions/collectibles/contracts/deploy-an-item-collection) and to use the `tokenId` you minted in the following steps to query and fulfill orders.

## 2. Wallet Authentication

For your project, you'll need a way to authenticate your user with a wallet.

Your choice from the Sequence stack is to use either an [Embedded Wallet](/solutions/wallets/embedded-wallet/01-overview) for headless and web2-like UX, or a [Universal Wallet](/solutions/wallets/universal-wallet/01-overview) with [Sequence Kit](/sdk/sequence-kit/01-overview) to reach more types of wallets.
Your choice from the Sequence stack is to use either an [In-Game Wallet](/solutions/wallets/in-game-wallet/overview) for headless and web2-like UX, or a [Universal Wallet](/solutions/wallets/universal-wallet/overview) with [Sequence Kit](/sdk/sequence-kit/overview) to reach more types of wallets.

For this guide we'll use an `Universal Sequence Wallet` with `Sequence Kit` connector (with an option for an `Embedded-Wallet`) which can authenticate users using Google or Apple auth, in addition to user brought wallets like Coinbase or Metamask.
For this guide we'll use an `Universal Sequence Wallet` with `Sequence Kit` connector (with an option for an `In-Game Wallet`) which can authenticate users using Google or Apple auth, in addition to user brought wallets like Coinbase or Metamask.

### Install packages

Expand Down Expand Up @@ -670,9 +670,9 @@ Great, everything is complete if you add the function click handler attached to
## 7. (Optional) Integrate In-Game Wallet into Sequence Kit
In order to make your sequence kit connector as [Embedded Wallet](/solutions/wallets/embedded-wallet/01-overview) enabled, we'll need to install a few package version and update our `config.ts` we used at the beginning of the guide
In order to make your sequence kit connector as [In-Game Wallet](/solutions/wallets/in-game-wallet/overview) enabled, we'll need to install a few package version and update our `config.ts` we used at the beginning of the guide
The Embedded Wallet feature allows no-confirmation transactions, which can create a smoother UX
The In-Game Wallet feature allows no-confirmation transactions, which can create a smoother UX
```
pnpm i @0xsequence/kit@2.0.5-beta.9 @0xsequence/kit-connectors@2.0.5-beta.9
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
---
slug: /relayer/building-relaying-server
---
import { Callout } from 'vocs/components'

# Building a Relaying Server

With Sequence, you can create a smart contract wallet your server can use to dispatch transactions for your users
without you having to be worried about transaction speed, throughput and re-orgs.

:::info Sequentual Transactions
<Callout type='info'>
Sequentual Transactions <br/>
By default, Sequence transactions will be executed sequentially.
:::
</Callout>

## Nodejs Server

Expand Down Expand Up @@ -123,24 +122,27 @@ if (txnReceipt.status != 1) {
}
```

:::caution Triggers migration
<Callout type='warning'>
Triggers migration
<br/>

Openning a session may trigger a migration of your Sequence wallet to a new version, this could be `v1` to `v2` or `v2` to future versions.

Migration is a one-way process, once your wallet is migrated it cannot be reverted to a previous version.

To catch any unwanted migration, you can use the `onMigration` callback.
:::
</Callout>

## Nodejs Server with Gas Sponsoring using Sequence Builder

If you want to have your transactions sponsored & paid for with a credit card, you can follow the below steps before beginning your code, at the following link: https://sequence.build/

By sponsoring your transaction, you can now just send the transaction without a fee object and not have to fund the smart contract wallet before relaying any transactions.

:::info Already Deployed Contract
<Callout type='info'>
Already Deployed Contract
For this example, we assume you have a smart contract deployed with a contract address to include in the last step.
:::
</Callout>

### A. Create Dapp

Expand Down Expand Up @@ -264,4 +266,4 @@ await Promise.all([
```

If batching transactions is not a problem for your use-case, you can call `await wallet.sendTransaction(txns)`.
You can read more about batch transactions in [Sending Batched Transactions](/solutions/wallets/universal-wallet/examples/09-send-batch-transactions).
You can read more about batch transactions in [Sending Batched Transactions](/solutions/wallets/universal-wallet/examples/send-batch-transactions).
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The Sequence Relayer can be implemented on a serverless [Cloudflare](https://clo

The following steps will guide you through how to build your hosted minter API in 4 steps:

1. [Setup Cloudflare environment with wrangler cli and deploy a test](/guides/templates/03-mint-collectibles-serverless#1-setup-cloudflare-environment-with-wrangler-cli--deploy-a-test)
2. [Deploy, sponsor and update Metadata for an ERC1155 contract with Builder](/guides/templates/03-mint-collectibles-serverless#2-deploy-sponsor-and-update-metadata-for-an-erc1155-contract-with-builder)
3. [Use EthAuthProof to prevent EOA DDoS](/guides/templates/03-mint-collectibles-serverless#3-use-ethauthproof-to-prevent-eoa-ddos)
4. [Mint a collectible to wallet](/guides/templates/03-mint-collectibles-serverless#4-mint-a-collectible-to-wallet)
1. [Setup Cloudflare environment with wrangler cli and deploy a test](/guides/templates/mint-collectibles-serverless#1-setup-cloudflare-environment-with-wrangler-cli--deploy-a-test)
2. [Deploy, sponsor and update Metadata for an ERC1155 contract with Builder](/guides/templates/mint-collectibles-serverless#2-deploy-sponsor-and-update-metadata-for-an-erc1155-contract-with-builder)
3. [Use EthAuthProof to prevent EOA DDoS](/guides/templates/mint-collectibles-serverless#3-use-ethauthproof-to-prevent-eoa-ddos)
4. [Mint a collectible to wallet](/guides/templates/mint-collectibles-serverless#4-mint-a-collectible-to-wallet)

The result, a secure API with the following specs:

Expand Down Expand Up @@ -59,7 +59,7 @@ This should print a URL, which you can enter in the browser the URL `https://<ap

## 2. Deploy, Sponsor and Update Metadata for an ERC1155 Contract with Builder

First, follow [this guide](/solutions/collectibles/contracts/01-deploy-an-item-collection) to deploy a contract.
First, follow [this guide](/solutions/collectibles/contracts/deploy-an-item-collection) to deploy a contract.

Then, one must update the role access of the contract in the Builder to only receive requests from the minter wallet address, which can be done in 2 steps.

Expand Down Expand Up @@ -118,7 +118,7 @@ Complete the role update by clicking `write` and sign the sponsored transaction.

#### Update metadata

Next, you'll need to update the metadata with your media or assets for your contract, which can be done by [following this guide](/solutions/collectibles/metadata/800-manage-metadata-builder).
Next, you'll need to update the metadata with your media or assets for your contract, which can be done by [following this guide](/solutions/collectibles/metadata/manage-metadata-builder).

#### Contract sponsoring

Expand Down Expand Up @@ -335,7 +335,7 @@ Press the `connect` button and then `copy to clipboard`.

It should be noted, it is best not to share this `ETHAuthProof` with anyone as this means someone can prove ownership of your wallet and interact with specific APIs.

Finally, replace the `url` with your app from [this step](/guides/templates/03-mint-collectibles-serverless#deploy-test), the `<some_proof>` with the generated value copied from the viewer dapp, and `<some_address>` with your wallet address and it should return just the mocked `0x` string.
Finally, replace the `url` with your app from [this step](/guides/templates/mint-collectibles-serverless#deploy-test), the `<some_proof>` with the generated value copied from the viewer dapp, and `<some_address>` with your wallet address and it should return just the mocked `0x` string.

```
curl -X POST https://your-worker.your-subdomain.workers.dev \
Expand Down Expand Up @@ -421,6 +421,6 @@ const callContract = async (request: Request, env: Env, address: string, tokenId
}
```

Once these steps are complete, you can redeploy and test with the steps outlined in this [prior step](/guides/templates/03-mint-collectibles-serverless#testing), and this time the POST request should return a transaction hash for the completed mint and the GET request would return a block number.
Once these steps are complete, you can redeploy and test with the steps outlined in this [prior step](/guides/templates/mint-collectibles-serverless#testing), and this time the POST request should return a transaction hash for the completed mint and the GET request would return a block number.

If you want to browse the full code, see [an example implementation here](https://github.com/0xsequence-demos/cloudflare-worker-sequence-relayer)
50 changes: 0 additions & 50 deletions docs/pages/guides/templates/template-embedded-wallet.mdx

This file was deleted.

50 changes: 50 additions & 0 deletions docs/pages/guides/templates/template-in-game-wallet.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Quickstart

## Try a Demo
:::info
Try out seamless UX of our in-game wallet at our [demo](https://0xsequence.github.io/demo-waas-auth/)
:::


## Template
:::info
Get started quickly with a [template](https://github.com/0xsequence/demo-waas-auth) leveraging our in-game wallet.
:::




## Getting Started

### SDK Installation

We provide TypeScript and Unity SDKs for the In-Game Wallet authentication system. You can install the TypeScript SDK with:

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

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

### Project Setup

Sequence In-Game Wallet is currently only available as a closed beta. To start using the In-Game 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
- In-Game Wallet configuration key

### Library Setup

To start using Sequence In-Game 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)
```

Note that the library is operational, but it can't be used to interact with any wallet until you have authenticated **as a user**.
12 changes: 6 additions & 6 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 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
- [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

## 1. Project setup with webpack

Expand Down Expand Up @@ -228,13 +228,13 @@ Great, now you'll have a button that makes a modal appear

## 3. Deploy a collectibles contract

You'll need to create a collectible from the [Sequence Builder](https://sequence.build) which can be accomplished with the following [guide](/solutions/collectibles/contracts/01-deploy-an-item-collection)
You'll need to create a collectible from the [Sequence Builder](https://sequence.build) which can be accomplished with the following [guide](/solutions/collectibles/contracts/deploy-an-item-collection)

We should create 2 collections: 1 for achievement tokens and the other for the planes

## 4. Deploy a remote minter & mint in-game achievement tokens

Then, in order to send transactions to the blockchain in a seamless fashion that are gasless, implement a [Cloudflare Relayer](/guides/templates/02-building-relaying-server) to mint items from a contract deployed in the previous step, ensuring that the relayer contract address is inputed as a `Minter Role`
Then, in order to send transactions to the blockchain in a seamless fashion that are gasless, implement a [Cloudflare Relayer](/guides/templates/building-relaying-server) to mint items from a contract deployed in the previous step, ensuring that the relayer contract address is inputed as a `Minter Role`

We will allow there to be multiple paths to mint collectibles: a plane collectible and an achievement collectible.

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 Embedded Wallet into Sequence Kit
## 7. (Optional) Integrate In-Game 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 Embedded 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 In-Game 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 Embedded Wallets, see [here](/solutions/wallets/embedded-wallet/01-overview)
To learn more about In-Game Wallets, see [here](/solutions/wallets/in-game-wallet/overview)
</Callout>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ For a full list of official connectors, see the [connectors](https://github.com/
| -------- | ------- |
| [\{ contractAddress: string, chainId: number \}, ...] | undefined |

If provided, this will determine which assets are to be displayed in the embedded wallet modal main view.
If provided, this will determine which assets are to be displayed in the in-game wallet modal main view.
By passing a list of displayed assets, only assets from the provided list will be displayed in the main view.
In the case that no assets are provided, all owned assets can be displayed in the main view.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function App() {
2. Wrap your app with the `KitProvider` within the `WagmiConfig` wrapper.


# Setting Up the Embedded Wallet Wrapper
To install the optional embedded wallet, add the `KitWalletProvider` below the `KitProvider` wrapper.
# Setting Up the In-Game Wallet Wrapper
To install the optional in-game wallet, add the `KitWalletProvider` below the `KitProvider` wrapper.

```jsx
import { KitWalletProvider } from '@0xsequence/kit-wallet'
Expand Down
Loading

0 comments on commit b4e9ede

Please sign in to comment.