Skip to content

Commit

Permalink
fix TypeScript capitalization (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris authored Mar 12, 2024
1 parent be82bd8 commit 5b62bc4
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions docs/resources/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Here is an up-to-date list of software and repositories to help you build on [SU
- [`suave-std` Solidity Libraries](/tutorials/suave-standard-library)
- [Forge](/resources/forge)
- [Golang SDK](/resources/golang-sdk)
- [`suave-viem` Typescript SDK](/resources/typescript-sdk)
- [`suave-viem` TypeScript SDK](/resources/TypeScript-sdk)

**Docs, examples and code:**

- [SUAPP Examples Repo](https://github.com/flashbots/suapp-examples)
- [SUAVE Rigil Specs](/technical/specs/rigil)
- [suave-geth](https://github.com/flashbots/suave-geth)

## Community
## Community

Here is an up-to-date list of software built by the SUAVE community:

Expand Down
12 changes: 6 additions & 6 deletions docs/resources/typescript-sdk.mdx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
---
title: Typescript SDK
description: An overview of the Typescript SDK (suave-viem)
title: TypeScript SDK
description: An overview of the TypeScript SDK (suave-viem)
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

:::info
:::info

[SUAVE-Viem](https://github.com/flashbots/suave-viem) is a fork of [viem](https://github.com/wagmi-dev/viem) that will eventually be upstreamed but is currently still in a dynamic state.

Sending Confidential Compute Requests works slightly differently, but most other functionality is similar to interacting with any other EVM chain from viem.

:::

This page describes how to work with the SUAVE-viem typescript SDK. The SDK simplifies interaction with the SUAVE Chain and provides easy-to-use functions to send transactions and query data. Below, you'll find steps on how to instantiate the library, symlink, and perform some basic actions.
This page describes how to work with the SUAVE-viem TypeScript SDK. The SDK simplifies interaction with the SUAVE Chain and provides easy-to-use functions to send transactions and query data. Below, you'll find steps on how to instantiate the library, symlink, and perform some basic actions.

## Installation

The [`@flashbots/suave-viem`](https://www.npmjs.com/package/@flashbots/suave-viem) package is available on NPM, and can be installed with any NPM-based package manager, such as **npm**, **yarn**, or **bun**.

:::warning
:::warning

Alpha Release Version

Expand Down Expand Up @@ -230,7 +230,7 @@ const ccr: TransactionRequestSuave = {

`confidentialInputs` is a field to store information that should be kept private during computation, and the data field is the typical calldata required to interact with a dapp.

If you prefer typescript, you can see how to craft your own CCRs in the [examples directory of suave-viem](https://github.com/flashbots/suave-viem/blob/main/examples/suave-web-demo/src/suave.ts).
If you prefer TypeScript, you can see how to craft your own CCRs in the [examples directory of suave-viem](https://github.com/flashbots/suave-viem/blob/main/examples/suave-web-demo/src/suave.ts).

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/technical
10 changes: 5 additions & 5 deletions docs/tutorials/build-suapps.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ keywords:
- build
- suave
- create
- typescript
- TypeScript
- viem
---

This tutorial will show you how to build a SUAPP using [`suave-viem`](https://www.npmjs.com/package/@flashbots/suave-viem), our [typescript SDK](/resources/typescript-sdk).

:::info

There are two different templates you can use for your SUAPP. One with minimal, typescript-only dependencies; and one which uses Next.
There are two different templates you can use for your SUAPP. One with minimal, TypeScript-only dependencies; and one which uses Next.

:::

Expand Down Expand Up @@ -108,12 +108,12 @@ bun dev

This template uses the same MEV-Share example contract we worked with using the [Golang SDK in the previous tutorial](/tutorials/send-transactions).

> _If you're struggling with any of the above, you can also find this pure typescript template as a standalone repo [here](https://github.com/andytudhope/build-a-suapp-ts)._
> _If you're struggling with any of the above, you can also find this pure TypeScript template as a standalone repo [here](https://github.com/andytudhope/build-a-suapp-ts)._

## Next.js Example

This template comes with a more extensive frontend framework, which uses Next (in typescript) and therefore depends on React. You can get it running by first cloning the repo and installing its dependencies.
This template comes with a more extensive frontend framework, which uses Next (in TypeScript) and therefore depends on React. You can get it running by first cloning the repo and installing its dependencies.

Make sure you have previously built and symlinked suave-viem for this to work:

Expand All @@ -135,7 +135,7 @@ Deploy the compiled contracts from the root directory (you need to have [SUAVE r

```bash
chmod +x packages/forge/deploy
yarn contracts:deploy
yarn contracts:deploy
```

You can start the frontend with:
Expand Down
22 changes: 11 additions & 11 deletions docs/tutorials/confidential-compute-requests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords:

:::info

There are a number of different ways to work with SUAVE and to craft Confidential Compute Requests (CCRs). We'll discuss how to use both the Typescript and Golang SDKs in this tutorial.
There are a number of different ways to work with SUAVE and to craft Confidential Compute Requests (CCRs). We'll discuss how to use both the TypeScript and Golang SDKs in this tutorial.

:::

Expand All @@ -21,7 +21,7 @@ There are a number of different ways to work with SUAVE and to craft Confidentia
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path d="M6.993 12c0 2.761 2.246 5.007 5.007 5.007s5.007-2.246 5.007-5.007S14.761 6.993 12 6.993 6.993 9.239 6.993 12zM12 8.993c1.658 0 3.007 1.349 3.007 3.007S13.658 15.007 12 15.007 8.993 13.658 8.993 12 10.342 8.993 12 8.993zM10.998 19h2v3h-2zm0-17h2v3h-2zm-9 9h3v2h-3zm17 0h3v2h-3zM4.219 18.363l2.12-2.122 1.415 1.414-2.12 2.122zM16.24 6.344l2.122-2.122 1.414 1.414-2.122 2.122zM6.342 7.759 4.22 5.637l1.415-1.414 2.12 2.122zm13.434 10.605-1.414 1.414-2.122-2.122 1.414-1.414z"></path></svg>
</div>
<div className="intro-text">
<div className="intro-heading">Typescript</div>
<div className="intro-heading">TypeScript</div>
<div className="intro-desc">For web developers</div>
</div>
</div>
Expand Down Expand Up @@ -52,17 +52,17 @@ There are a number of different ways to work with SUAVE and to craft Confidentia
</a>
</div>

## Typescript
## TypeScript

The [two templates from the previous tutorial](/tutorials/build-suapps) illustrate different ways of using CCRs on SUAVE.
The [two templates from the previous tutorial](/tutorials/build-suapps) illustrate different ways of using CCRs on SUAVE.

The **Next** template uses a basic contract to demonstrate the absolute basics of how CCRs work and how to use them as a developer building SUAPPs.

The **Typescript** template will lead you through how to sign a transaction on another domain (Goerli in this case), and then submit that signed transaction in the data of your CCR on SUAVE.
The **TypeScript** template will lead you through how to sign a transaction on another domain (Goerli in this case), and then submit that signed transaction in the data of your CCR on SUAVE.

### Callbacks

Let's start in the [Next template](https://github.com/andytudhope/build-a-suapp-next-ts/) and look at how CCRs work and how to use them.
Let's start in the [Next template](https://github.com/andytudhope/build-a-suapp-next-ts/) and look at how CCRs work and how to use them.

[`OnChainState.sol`](https://github.com/andytudhope/build-a-suapp-next-ts/blob/main/packages/forge/src/OnChainState.sol) demonstrates that any CCR which tries to change state directly will revert. Rather, you need to use a callback to a different function that does change state in order to ensure that data sent in a CCR remains confidential:

Expand Down Expand Up @@ -126,13 +126,13 @@ There are a few key points to understand:

### CCRs with data

What happens when we do actually want to send data in our CCR?
What happens when we do actually want to send data in our CCR?

The [Typescript template](https://github.com/flashbots/suave-viem/tree/main/examples/suave-web-demo) demonstrates how to do this by signing transactions on Goerli that you wish to be processed by Kettles on SUAVE.
The [TypeScript template](https://github.com/flashbots/suave-viem/tree/main/examples/suave-web-demo) demonstrates how to do this by signing transactions on Goerli that you wish to be processed by Kettles on SUAVE.

In this case, we need to:

1. Craft a transaction on Goerli and sign it.
1. Craft a transaction on Goerli and sign it.
2. Append relevant details like the `decryptionCondition`, `kettleAddress`, `contract` and `chainId`.
3. Use a helper function like `toConfidentialRequest` to
1. place our signed transaction in `confidentialInputs` and
Expand Down Expand Up @@ -177,7 +177,7 @@ const sendDataRecord = async (suaveWallet: any) => {
}
```

Here, we use the convenient `toConfidentialRequest()` request method once we have the signed transaction, rather than crafting it manually ourselves and setting the transaction type as we did in the Next template.
Here, we use the convenient `toConfidentialRequest()` request method once we have the signed transaction, rather than crafting it manually ourselves and setting the transaction type as we did in the Next template.

This should give you enough information to start crafting your own CCRs and learning how to leverage the benefits of credible, confidential computation.

Expand All @@ -191,7 +191,7 @@ The [**SUAPP Examples repo**](https://github.com/flashbots/suapp-examples) uses

Let's look at the [private order-flow auction example](https://github.com/flashbots/suapp-examples/blob/main/examples/app-ofa-private/main.go) to understand how to use the Golang SDK to craft more complex kinds of CCRs.

The flow of this example is similar to the Typescript MEVShare demo directly above. However, we'll use it to demonstrate a full e2e flow with CCRs:
The flow of this example is similar to the TypeScript MEVShare demo directly above. However, we'll use it to demonstrate a full e2e flow with CCRs:

1. Deploy the OFA contract.
2. Instantiate two new accounts and fund them.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/send-transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords:

:::info

Sending transactions requires that you use either the Golang or Typescript SDKs we have made available. Confidential Compute Requests (CCRs) are not EIP-1193 compatible so signing CCRs from browser wallets requires some workarounds.
Sending transactions requires that you use either the Golang or TypeScript SDKs we have made available. Confidential Compute Requests (CCRs) are not EIP-1193 compatible so signing CCRs from browser wallets requires some workarounds.

:::

Expand Down

0 comments on commit 5b62bc4

Please sign in to comment.