-
Notifications
You must be signed in to change notification settings - Fork 619
New engine docs #6951
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
Merged
Merged
New engine docs #6951
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
745ef45
overview complete
saminacodes 0259d69
engine-completed
saminacodes 99f34b4
added vault documentation
saminacodes f05bfa9
vault docs complete
saminacodes 834ae03
Update apps/portal/src/app/vault/security/page.mdx
saminacodes 3ceb449
Update apps/portal/src/app/engine/faq/page.mdx
saminacodes 3a0cd99
Update apps/portal/src/app/engine/configure-wallets/page.mdx
saminacodes c93f7a9
Merge branch 'main' into new-engine-docs
saminacodes 2caa2bb
added v3
saminacodes 69cb908
recreate get started
saminacodes 4f5479d
fixed broken pages
saminacodes 58d5562
Merge branch 'main' into new-engine-docs
saminacodes 392198b
fixed icon lint errors
saminacodes 77a17f2
Update apps/portal/src/app/vault/page.mdx
saminacodes f758f85
lucide-icon change
saminacodes c568671
lint errors
saminacodes f392aed
Merge branch 'main' into new-engine-docs
saminacodes 05d760a
Merge remote-tracking branch 'origin/main' into new-engine-docs
joaquim-verges 40d16ac
version selector
joaquim-verges File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
apps/portal/src/app/engine-v3/configure-wallets/smart-server-wallet/page.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { Details } from "@doc"; | ||
|
|
||
| # Server Wallets | ||
|
|
||
| Smart server wallets are the recommended way to perform blockchain operations with Engine. | ||
|
|
||
| You can create smart server wallets by navigating to Engine > Server Wallets in your project dashboard. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { Callout, Details } from "@doc"; | ||
|
|
||
| # Engine FAQs | ||
|
|
||
| More information coming soon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,258 @@ | ||
| import { Callout, Step, Steps, Tabs, TabsContent, TabsTrigger, TabsList } from "@doc"; | ||
|
|
||
| # Get started | ||
|
|
||
| Learn how to get started with thirdweb Engine. This guide will walk you through the steps to start building with thirdweb Engine by creating a Vault, server wallets, and integrating into your application. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Create a thirdweb project. If you don't have a project yet, [learn how to create a project](/account/api-keys/create). | ||
|
|
||
| ## Engine Setup | ||
|
|
||
| <Steps> | ||
| <Step title="Navigate to Engine"> | ||
| In your project dashboard, navigate to **Engine** to get started. | ||
| </Step> | ||
|
|
||
| <Step title="Create Vault"> | ||
| Create a vault to manage your Engine's server wallets. After setup, you can manage your Vault to create additional access tokens or rotate admin keys. | ||
|
|
||
| <Callout variant="info" title="Vault"> | ||
| Vault is thirdweb's key management service designed to store smart server wallets non-custodially. Learn more about [Vault]. | ||
| </Callout> | ||
| </Step> | ||
|
|
||
| <Step title="Create Server Wallet"> | ||
| Create a server wallet to perform blockchain actions with Engine. | ||
|
|
||
| <Callout variant="info" title="Server Wallet"> | ||
| Server wallets are smart wallets Engine uses to perform blockchain actions. [Learn more about server wallets](/engine/configure-wallets/server-wallets). | ||
| </Callout> | ||
| </Step> | ||
|
|
||
| <Step title="Send Test Transaction"> | ||
| To verify your server wallet setup and see how transactions work, you can send a test transaction in the next step. This sends a no-op transaction—a transaction with zero value—to your own wallet. | ||
|
|
||
| You can send additional test transactions or proceed with the full setup whenever you're ready. | ||
| </Step> | ||
|
|
||
| <Step title="Integrate with your app"> | ||
| Integrate Engine into your application using the thirdweb SDK or Engine API. [View full API reference.](https://client.scalar.com/workspace/default/request/yq_Wx56PL4Ur6jOZsAOpA) | ||
|
|
||
| <Tabs defaultValue="curl"> | ||
| <TabsList> | ||
| <TabsTrigger value="curl">Curl</TabsTrigger> | ||
| <TabsTrigger value="javascript">JavaScript</TabsTrigger> | ||
| <TabsTrigger value="python">Python</TabsTrigger> | ||
| <TabsTrigger value="go">Go</TabsTrigger> | ||
| <TabsTrigger value="c-sharp">C#</TabsTrigger> | ||
| </TabsList> | ||
|
|
||
| <TabsContent value="curl"> | ||
| ```bash | ||
| curl -X POST "https://engine-cloud-dev-l8wt.chainsaw-dev.zeet.app/v1/write/contract" \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "x-secret-key: <your-project-secret-key>" \ | ||
| -H "x-vault-access-token: <your-vault-access-token>" \ | ||
| -d '{ | ||
| "executionOptions": { | ||
| "from": "<your-server-wallet-address>", | ||
| "chainId": "84532" | ||
| }, | ||
| "params": [ | ||
| { | ||
| "contractAddress": "0x...", | ||
| "method": "function mintTo(address to, uint256 amount)", | ||
| "params": ["0x...", "100"] | ||
| } | ||
| ] | ||
| }' | ||
| ``` | ||
|
|
||
| </TabsContent> | ||
|
|
||
| <TabsContent value="javascript"> | ||
| ```typescript | ||
| const response = await fetch( | ||
| "https://engine-cloud-dev-l8wt.chainsaw-dev.zeet.app/v1/write/contract", | ||
| { | ||
| method: "POST", | ||
| headers: { | ||
| "Content-Type": "application/json", | ||
| "x-secret-key": "<your-project-secret-key>", | ||
| "x-vault-access-token": "<your-vault-access-token>", | ||
| }, | ||
| body: JSON.stringify({ | ||
| executionOptions: { | ||
| from: "<your-server-wallet-address>", | ||
| chainId: "84532", | ||
| }, | ||
| params: [ | ||
| { | ||
| contractAddress: "0x...", | ||
| method: "function mintTo(address to, uint256 amount)", | ||
| params: ["0x...", "100"], | ||
| }, | ||
| ], | ||
| }), | ||
| } | ||
| ); | ||
| ``` | ||
| </TabsContent> | ||
|
|
||
| <TabsContent value="python"> | ||
| ```python | ||
| import requests | ||
| import json | ||
|
|
||
| url = "https://engine-cloud-dev-l8wt.chainsaw-dev.zeet.app/v1/write/contract" | ||
| headers = { | ||
| "Content-Type": "application/json", | ||
| "x-secret-key": "<your-project-secret-key>", | ||
| "x-vault-access-token": "<your-vault-access-token>" | ||
| } | ||
| payload = { | ||
| "executionOptions": { | ||
| "from": "<your-server-wallet-address>", | ||
| "chainId": "84532" | ||
| }, | ||
| "params": [ | ||
| { | ||
| "contractAddress": "0x...", | ||
| "method": "function mintTo(address to, uint256 amount)", | ||
| "params": ["0x...", "100"] | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| response = requests.post(url, headers=headers, json=payload) | ||
| result = response.json() | ||
| ``` | ||
| </TabsContent> | ||
|
|
||
| <TabsContent value="go"> | ||
| ```go | ||
| package main | ||
|
|
||
| import ( | ||
| "bytes" | ||
| "encoding/json" | ||
| "fmt" | ||
| "net/http" | ||
| ) | ||
|
|
||
| func main() { | ||
| url := "https://engine-cloud-dev-l8wt.chainsaw-dev.zeet.app/v1/write/contract" | ||
|
|
||
| // Create the request payload | ||
| type Param struct { | ||
| ContractAddress string `json:"contractAddress"` | ||
| Method string `json:"method"` | ||
| Params []string `json:"params"` | ||
| } | ||
|
|
||
| type RequestBody struct { | ||
| ExecutionOptions struct { | ||
| From string `json:"from"` | ||
| ChainId string `json:"chainId"` | ||
| } `json:"executionOptions"` | ||
| Params []Param `json:"params"` | ||
| } | ||
|
|
||
| requestBody := RequestBody{ | ||
| Params: []Param{ | ||
| { | ||
| ContractAddress: "0x...", | ||
| Method: "function mintTo(address to, uint256 amount)", | ||
| Params: []string{"0x...", "100"}, | ||
| }, | ||
| }, | ||
| } | ||
| requestBody.ExecutionOptions.From = "<your-server-wallet-address>" | ||
| requestBody.ExecutionOptions.ChainId = "84532" | ||
|
|
||
| jsonData, _ := json.Marshal(requestBody) | ||
|
|
||
| // Create the HTTP request | ||
| req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData)) | ||
| req.Header.Set("Content-Type", "application/json") | ||
| req.Header.Set("x-secret-key", "<your-project-secret-key>") | ||
| req.Header.Set("x-vault-access-token", "<your-vault-access-token>") | ||
|
|
||
| // Send the request | ||
| client := &http.Client{} | ||
| resp, err := client.Do(req) | ||
| if err != nil { | ||
| fmt.Println("Error:", err) | ||
| return | ||
| } | ||
| defer resp.Body.Close() | ||
|
|
||
| // Process the response | ||
| var result map[string]interface{} | ||
| json.NewDecoder(resp.Body).Decode(&result) | ||
| fmt.Println("Response:", result) | ||
| } | ||
| ``` | ||
| </TabsContent> | ||
|
|
||
| <TabsContent value="c-sharp"> | ||
| ``` | ||
| using System; | ||
| using System.Net.Http; | ||
| using System.Text; | ||
| using System.Text.Json; | ||
| using System.Threading.Tasks; | ||
|
|
||
| class Program | ||
| { | ||
| static async Task Main() | ||
| { | ||
| var url = "https://engine-cloud-dev-l8wt.chainsaw-dev.zeet.app/v1/write/contract"; | ||
|
|
||
| var requestData = new | ||
| { | ||
| executionOptions = new | ||
| { | ||
| from = "<your-server-wallet-address>", | ||
| chainId = "84532" | ||
| }, | ||
| @params = new[] | ||
| { | ||
| new | ||
| { | ||
| contractAddress = "0x...", | ||
| method = "function mintTo(address to, uint256 amount)", | ||
| @params = new[] { "0x...", "100" } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| var json = JsonSerializer.Serialize(requestData); | ||
| var content = new StringContent(json, Encoding.UTF8, "application/json"); | ||
|
|
||
| using var httpClient = new HttpClient(); | ||
| httpClient.DefaultRequestHeaders.Add("x-secret-key", "<your-project-secret-key>"); | ||
| httpClient.DefaultRequestHeaders.Add("x-vault-access-token", "<your-vault-access-token>"); | ||
|
|
||
| var response = await httpClient.PostAsync(url, content); | ||
| var responseContent = await response.Content.ReadAsStringAsync(); | ||
|
|
||
| Console.WriteLine(responseContent); | ||
| } | ||
| } | ||
| ``` | ||
| </TabsContent> | ||
| </Tabs> | ||
|
|
||
| <Callout variant="info" title="TypeScript SDK"> | ||
| You can use the full [TypeScript SDK](/references/typescript/v5/serverWallet) in your backend, allowing you to use: | ||
| - The full catalog of extension functions | ||
| - The prepareContractCall function to encode your transactions | ||
| - The full account interface, predefined chains, and more | ||
| The SDK handles encoding your transactions, signing them to Engine and polling for status. | ||
| </Callout> | ||
| </Step> | ||
| </Steps> | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.