Skip to content

Commit a74e1a2

Browse files
fixes
1 parent 2cdaf2a commit a74e1a2

File tree

7 files changed

+89
-33
lines changed

7 files changed

+89
-33
lines changed
Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
import { OpenApiEndpoint, createMetadata } from "@doc";
2+
3+
export const metadata = createMetadata({
4+
image: {
5+
title: "Deploy contracts",
6+
icon: "contracts",
7+
},
8+
title: "Deploy Contracts",
9+
description: "Deploy contracts on any EVM chain.",
10+
});
11+
112
# Deploy Contracts
213

314
You can deploy contracts via CLI or programatically.
@@ -16,8 +27,6 @@ You can also publish your contract to be deployable by anyone on any chain.
1627
npx thirdweb publish -k <project-secret-key>
1728
```
1829

19-
20-
2130
## Deploying via SDK
2231

2332
You can deploy contracts from ABI and bytecode.
@@ -26,15 +35,15 @@ You can deploy contracts from ABI and bytecode.
2635
import { deployContract } from "thirdweb/deploys";
2736

2837
const address = await deployContract({
29-
client,
30-
chain,
31-
bytecode: "0x...",
32-
abi: contractAbi,
33-
constructorParams: {
34-
param1: "value1",
35-
param2: 123,
36-
},
37-
salt, // optional: salt enables deterministic deploys
38+
client,
39+
chain,
40+
bytecode: "0x...",
41+
abi: contractAbi,
42+
constructorParams: {
43+
param1: "value1",
44+
param2: 123,
45+
},
46+
salt, // optional: salt enables deterministic deploys
3847
});
3948
```
4049

@@ -44,14 +53,26 @@ Or alternatively, you can deploy a contract from a previously published contract
4453
import { deployPublishedContract } from "thirdweb/deploys";
4554

4655
const address = await deployPublishedContract({
47-
client,
48-
chain,
49-
account,
50-
contractId: "MyPublishedContract",
51-
contractParams: {
52-
param1: "value1",
53-
param2: 123,
54-
},
55-
publisher: "0x...", // optional, defaults to the thirdweb deployer
56+
client,
57+
chain,
58+
account,
59+
contractId: "MyPublishedContract",
60+
contractParams: {
61+
param1: "value1",
62+
param2: 123,
63+
},
64+
publisher: "0x...", // optional, defaults to the thirdweb deployer
5665
});
57-
```
66+
```
67+
68+
## Deploy via API
69+
70+
You can also deploy contracts via API by passing the contract bytecode and ABI. This will automatically verify the contract on block explorers and add it to your project dashboard.
71+
72+
<OpenApiEndpoint path="/v1/contracts" method="POST" />
73+
74+
## List all deployed contracts
75+
76+
You can list all deployed contracts for your project.
77+
78+
<OpenApiEndpoint path="/v1/contracts" method="GET" />

apps/portal/src/app/contracts/page.mdx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,15 @@ Read, write, and deploy smart contracts on any EVM compatible blockchain.
7171

7272
### Read from Contracts
7373

74+
You can efficiently read data from multiple functions or contracts in a single request.
75+
7476
<OpenApiEndpoint path="/v1/contracts/read" method="POST" />
7577

7678
### Write to Contracts
7779

78-
<OpenApiEndpoint path="/v1/contracts/write" method="POST" />
79-
80-
### Deploy Contracts
80+
You can write multiple functions to multiple contracts on the same chain in a single request atomically, which will result in a single transaction for optimal gas efficiency.
8181

82-
<OpenApiEndpoint path="/v1/contracts" method="POST" />
83-
84-
### List Contracts
85-
86-
<OpenApiEndpoint path="/v1/contracts" method="GET" />
82+
<OpenApiEndpoint path="/v1/contracts/write" method="POST" />
8783

8884
</TabsContent>
8985

apps/portal/src/app/transactions/monitor/page.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ Monitor and get notified about transactions in your application, both on your pr
3939

4040
<TabsContent value="http">
4141

42+
### Get transaction status
43+
44+
Get the information about a transaction by its id.
45+
4246
<OpenApiEndpoint path="/v1/transactions/{transactionId}" method="GET" />
47+
48+
### List transactions
49+
50+
List all transactions for your project with filtering and pagination.
4351

4452
<OpenApiEndpoint path="/v1/transactions" method="GET" />
4553

apps/portal/src/app/transactions/sponsor/page.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ Sponsor gas fees using [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702), enab
5757

5858
EIP-7702 is the default execution mode in the [thirdweb API](https://api.thirdweb.com/reference) for your user and server wallets.
5959

60+
Example sponsored contract write request:
61+
6062
<OpenApiEndpoint path="/v1/contracts/write" method="POST" />
6163

6264
</TabsContent>

apps/portal/src/app/wallets/server/page.mdx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,38 @@ Server wallets are wallets that are managed by your own application, like a trea
3333

3434
Once created, you can use your server wallet by passing it as the `from` field of the [thirdweb API](https://api.thirdweb.com/reference#tag/transactions/post/v1/transactions).
3535

36+
### Create a new Server Wallet
37+
38+
You can create new server wallets via API by just passing an identifier. This can be any string, but we recommend using a descriptive name.
39+
3640
<OpenApiEndpoint path="/v1/wallets/server" method="POST" />
3741

38-
<OpenApiEndpoint path="/v1/wallets/server" method="GET" />
42+
### List all Server Wallets
43+
44+
You can also list all server wallets for your project to get their addresses and identifiers.
45+
46+
<OpenApiEndpoint path="/v1/wallets/server" method="GET" responseExampleOverride={{
47+
result: {
48+
pagination: {
49+
hasMore: false,
50+
limit: 20,
51+
page: 1,
52+
},
53+
wallets: [
54+
{
55+
address: "string",
56+
profiles: [
57+
{
58+
type: "server",
59+
identifier: "string",
60+
},
61+
],
62+
createdAt: "string",
63+
smartWalletAddress: "string",
64+
},
65+
],
66+
}
67+
}} />
3968

4069
</TabsContent>
4170

apps/portal/src/components/Document/APIEndpointMeta/ApiEndpoint.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function ApiEndpoint(props: { metadata: ApiEndpointMeta }) {
6262
return (
6363
<div>
6464
<div>
65-
<Heading anchorId="request" className="text-lg lg:text-lg" level={2}>
65+
<Heading anchorId="request" className="text-lg lg:text-lg" level={3}>
6666
Request
6767
</Heading>
6868
<div className="rounded-lg border">
@@ -116,7 +116,7 @@ export function ApiEndpoint(props: { metadata: ApiEndpointMeta }) {
116116
</div>
117117

118118
<div>
119-
<Heading anchorId="response" className="text-lg lg:text-lg" level={2}>
119+
<Heading anchorId="response" className="text-lg lg:text-lg" level={3}>
120120
Response
121121
</Heading>
122122
<div className="overflow-hidden rounded-lg border">

apps/portal/src/components/Document/APIEndpointMeta/OpenApiEndpoint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ function transformOpenApiToApiEndpointMeta(
370370

371371
// Use override if provided, otherwise generate from OpenAPI spec
372372
if (responseExampleOverride) {
373-
Object.assign(responseExamples, responseExampleOverride);
373+
responseExamples["200"] = JSON.stringify(responseExampleOverride, null, 2);
374374
} else {
375375
for (const [statusCode, response] of Object.entries(operation.responses)) {
376376
const content = response.content;

0 commit comments

Comments
 (0)