Skip to content

Commit c7e9cc2

Browse files
authored
docs: Add summary; update descriptions (#180)
1 parent 7e01d91 commit c7e9cc2

File tree

146 files changed

+348
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+348
-211
lines changed

.github/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ For OSS contributions, we use a [Forking Workflow](https://www.atlassian.com/git
1414

1515
To begin:
1616

17-
1. [Create a fork](https://github.com/thirdweb-dev/web3-api/fork) of this repository to your own GitHub account.
17+
1. [Create a fork](https://github.com/thirdweb-dev/engine/fork) of this repository to your own GitHub account.
1818

1919
2. [Clone your fork](https://help.github.com/articles/cloning-a-repository/) to your local device.
2020

core/schema/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const chainResponseSchema = Type.Object({
3939

4040
export const walletAuthSchema = Type.Object({
4141
"x-backend-wallet-address": Type.String({
42-
description: "Wallet address",
42+
description: "Backend wallet address",
4343
}),
4444
"x-account-address": Type.Optional(
4545
Type.String({

docs/1-user-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# thirdweb web3-api User Guide
1+
# thirdweb Engine User Guide
22

33
## Getting Started
44

@@ -25,7 +25,7 @@
2525

2626
### PostgreSQL DB
2727

28-
A PostgreSQL DB is required to run web3-api, both the server and worker need access to it. Check [installation guide](./.github/installations.md) for more details.
28+
A PostgreSQL DB is required to run _Engine_, both the server and worker need access to it. Check [installation guide](./.github/installations.md) for more details.
2929

3030
Once you have PostgreSQL DB running set the POSTGRES_CONNECTION_URL environment variable:
3131

server/api/backend-wallet/create.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export const createWallet = async (fastify: FastifyInstance) => {
3030
method: "POST",
3131
url: "/backend-wallet/create",
3232
schema: {
33-
description: "Create a new backend wallet",
33+
summary: "Create backend wallet",
34+
description: "Create a backend wallet.",
3435
tags: ["Backend Wallet"],
3536
operationId: "backendWallet_create",
3637
response: {

server/api/backend-wallet/getAll.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export async function getAll(fastify: FastifyInstance) {
3434
method: "GET",
3535
url: "/backend-wallet/get-all",
3636
schema: {
37-
description: "Get all created EOA wallet",
37+
summary: "Get all backend wallets",
38+
description: "Get all backend wallets.",
3839
tags: ["Backend Wallet"],
3940
operationId: "backendWallet_getAll",
4041
response: {

server/api/backend-wallet/getBalance.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export async function getBalance(fastify: FastifyInstance) {
3939
method: "GET",
4040
url: "/backend-wallet/:chain/:wallet_address/get-balance",
4141
schema: {
42-
description: "Get Wallet Balance",
42+
summary: "Get balance",
43+
description: "Get the native balance for a backend wallet.",
4344
tags: ["Backend Wallet"],
4445
operationId: "backendWallet_getBalance",
4546
params: requestSchema,

server/api/backend-wallet/import.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ export const importWallet = async (fastify: FastifyInstance) => {
9999
method: "POST",
100100
url: "/backend-wallet/import",
101101
schema: {
102-
description: "Import a wallet that has already been created",
102+
summary: "Import backend wallet",
103+
description: "Import an existing wallet as a backend wallet.",
103104
tags: ["Backend Wallet"],
104105
operationId: "backendWallet_import",
105106
body: RequestBodySchema,

server/api/chain/get.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,18 @@ const responseSchema = Type.Object({
1515
responseSchema.examples = [
1616
{
1717
result: {
18-
result: {
19-
name: "Mumbai",
20-
chain: "Polygon",
21-
rpc: ["https://mumbai.rpc.thirdweb.com/${THIRDWEB_API_SECRET_KEY}"],
22-
nativeCurrency: {
23-
name: "MATIC",
24-
symbol: "MATIC",
25-
decimals: 18,
26-
},
27-
shortName: "maticmum",
28-
chainId: 80001,
29-
testnet: true,
30-
slug: "mumbai",
18+
name: "Mumbai",
19+
chain: "Polygon",
20+
rpc: ["https://mumbai.rpc.thirdweb.com/${THIRDWEB_API_SECRET_KEY}"],
21+
nativeCurrency: {
22+
name: "MATIC",
23+
symbol: "MATIC",
24+
decimals: 18,
3125
},
26+
shortName: "maticmum",
27+
chainId: 80001,
28+
testnet: true,
29+
slug: "mumbai",
3230
},
3331
},
3432
];
@@ -42,7 +40,8 @@ export async function getChainData(fastify: FastifyInstance) {
4240
method: "GET",
4341
url: "/chain/get",
4442
schema: {
45-
description: "Get a particular chain information",
43+
summary: "Get chain details",
44+
description: "Get details about a chain.",
4645
tags: ["Chain"],
4746
operationId: "chain",
4847
querystring: chainRequestQuerystringSchema,

server/api/chain/getAll.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export async function getAllChainData(fastify: FastifyInstance) {
5353
method: "GET",
5454
url: "/chain/get-all",
5555
schema: {
56-
description: "Get all chains information",
56+
summary: "Get all chain details",
57+
description: "Get details about all supported chains.",
5758
tags: ["Chain"],
5859
operationId: "getAllChainData",
5960
response: {

server/api/contract/events/getAllEvents.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export async function getAllEvents(fastify: FastifyInstance) {
6666
method: "GET",
6767
url: "/contract/:chain/:contract_address/events/get-all",
6868
schema: {
69-
description:
70-
"Get a list of all the events emitted from this contract during the specified time period",
69+
summary: "Get all events",
70+
description: "Get a list of all blockchain events for this contract.",
7171
tags: ["Contract-Events"],
7272
operationId: "getAllEvents",
7373
params: requestSchema,

server/api/contract/events/getEvents.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ export async function getEvents(fastify: FastifyInstance) {
7070
method: "POST",
7171
url: "/contract/:chain/:contract_address/events/get",
7272
schema: {
73+
summary: "Get events",
7374
description:
74-
"Get a list of the events of a specific type emitted from this contract during the specified time period",
75+
"Get a list of specific blockchain events emitted from this contract.",
7576
tags: ["Contract-Events"],
7677
operationId: "getEvents",
7778
params: requestSchema,

server/api/contract/extensions/account/read/getAllAdmins.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export const getAllAdmins = async (fastify: FastifyInstance) => {
2222
method: "GET",
2323
url: "/contract/:chain/:contract_address/account/admins/get-all",
2424
schema: {
25-
description: "Get all admins on an account",
25+
summary: "Get all admins",
26+
description: "Get all admins for a smart account.",
2627
tags: ["Account"],
2728
operationId: "account:get-all-admins",
2829
params: contractParamSchema,

server/api/contract/extensions/account/read/getAllSessions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export const getAllSessions = async (fastify: FastifyInstance) => {
2121
method: "GET",
2222
url: "/contract/:chain/:contract_address/account/sessions/get-all",
2323
schema: {
24-
description: "Get all sessions on an account",
24+
summary: "Get all session keys",
25+
description: "Get all session keys for a smart account.",
2526
tags: ["Account"],
2627
operationId: "account:get-all-sessions",
2728
params: contractParamSchema,

server/api/contract/extensions/account/write/grantAdmin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const grantAdmin = async (fastify: FastifyInstance) => {
2626
method: "POST",
2727
url: "/contract/:chain/:contract_address/account/admins/grant",
2828
schema: {
29-
description: "Grant a wallet admin permissions",
29+
summary: "Grant admin",
30+
description: "Grant a smart account's admin permission.",
3031
tags: ["Account"],
3132
operationId: "account:grant-admin",
3233
headers: walletAuthSchema,

server/api/contract/extensions/account/write/grantSession.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export const grantSession = async (fastify: FastifyInstance) => {
2323
method: "POST",
2424
url: "/contract/:chain/:contract_address/account/sessions/create",
2525
schema: {
26-
description: "Create a new session",
26+
summary: "Create session key",
27+
description: "Create a session key for a smart account.",
2728
tags: ["Account"],
2829
operationId: "account:grant-session",
2930
params: contractParamSchema,

server/api/contract/extensions/account/write/revokeAdmin.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const revokeAdmin = async (fastify: FastifyInstance) => {
2626
method: "POST",
2727
url: "/contract/:chain/:contract_address/account/admins/revoke",
2828
schema: {
29-
description: "Revoke a wallet's admin permissions",
29+
summary: "Revoke admin",
30+
description: "Revoke a smart account's admin permission.",
3031
tags: ["Account"],
3132
operationId: "account:revoke-admin",
3233
headers: walletAuthSchema,

server/api/contract/extensions/account/write/revokeSession.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const revokeSession = async (fastify: FastifyInstance) => {
2626
method: "POST",
2727
url: "/contract/:chain/:contract_address/account/sessions/revoke",
2828
schema: {
29-
description: "Revoke a session",
29+
summary: "Revoke session key",
30+
description: "Revoke a session key for a smart account.",
3031
tags: ["Account"],
3132
operationId: "account:revoke-session",
3233
params: contractParamSchema,

server/api/contract/extensions/account/write/updateSession.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export const updateSession = async (fastify: FastifyInstance) => {
2828
method: "POST",
2929
url: "/contract/:chain/:contract_address/account/sessions/update",
3030
schema: {
31-
description: "Update a session",
31+
summary: "Update session key",
32+
description: "Update a session key for a smart account.",
3233
tags: ["Account"],
3334
operationId: "account:update-session",
3435
params: contractParamSchema,

server/api/contract/extensions/accountFactory/read/getAllAccounts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export const getAllAccounts = async (fastify: FastifyInstance) => {
2222
method: "GET",
2323
url: "/contract/:chain/:contract_address/account-factory/get-all-accounts",
2424
schema: {
25-
description: "Get all the accounts on an account factory",
25+
summary: "Get all smart accounts",
26+
description: "Get all the smart accounts for this account factory.",
2627
tags: ["Account Factory"],
2728
operationId: "account-factory:get-all-accounts",
2829
params: contractParamSchema,

server/api/contract/extensions/accountFactory/read/getAssociatedAccounts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export const getAssociatedAccounts = async (fastify: FastifyInstance) => {
3030
method: "GET",
3131
url: "/contract/:chain/:contract_address/account-factory/get-associated-accounts",
3232
schema: {
33+
summary: "Get associated smart accounts",
3334
description:
34-
"Get all the accounts on an account factory with a specified wallet as a signer",
35+
"Get all the smart accounts for this account factory associated with the specific admin wallet.",
3536
tags: ["Account Factory"],
3637
operationId: "account-factory:get-associated-accounts",
3738
params: contractParamSchema,

server/api/contract/extensions/accountFactory/read/isAccountDeployed.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ export const isAccountDeployed = async (fastify: FastifyInstance) => {
3535
method: "GET",
3636
url: "/contract/:chain/:contract_address/account-factory/is-account-deployed",
3737
schema: {
38+
summary: "Check if deployed",
3839
description:
39-
"Check if the account for a given admin address has been deployed",
40+
"Check if a smart account has been deployed to the blockchain.",
4041
tags: ["Account Factory"],
4142
operationId: "account-factory:is-account-deployed",
4243
params: contractParamSchema,

server/api/contract/extensions/accountFactory/read/predictAccountAddress.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export const predictAccountAddress = async (fastify: FastifyInstance) => {
3434
method: "GET",
3535
url: "/contract/:chain/:contract_address/account-factory/predict-account-address",
3636
schema: {
37-
description: "Get the counter-factual address of a new account",
37+
summary: "Predict smart account address",
38+
description: "Get the counterfactual address of a smart account.",
3839
tags: ["Account Factory"],
3940
operationId: "account-factory:predict-account-address",
4041
params: contractParamSchema,

server/api/contract/extensions/accountFactory/write/createAccount.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export const createAccount = async (fastify: FastifyInstance) => {
3131
method: "POST",
3232
url: "/contract/:chain/:contract_address/account-factory/create-account",
3333
schema: {
34-
description: "Create a new account on the account factory",
34+
summary: "Create smart account",
35+
description: "Create a smart account for this account factory.",
3536
tags: ["Account Factory"],
3637
operationId: "account-factory:create-account",
3738
params: contractParamSchema,

server/api/contract/extensions/erc1155/read/balanceOf.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export async function erc1155BalanceOf(fastify: FastifyInstance) {
4343
method: "GET",
4444
url: "/contract/:chain/:contract_address/erc1155/balance-of",
4545
schema: {
46-
description: "Check the balance Of the wallet address",
46+
summary: "Get balance",
47+
description:
48+
"Get the balance of a specific wallet address for this ERC-1155 contract.",
4749
tags: ["ERC1155"],
4850
operationId: "erc1155_balanceOf",
4951
params: requestSchema,

server/api/contract/extensions/erc1155/read/get.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ export async function erc1155Get(fastify: FastifyInstance) {
5353
method: "GET",
5454
url: "/contract/:chain/:contract_address/erc1155/get",
5555
schema: {
56-
description: "Get the metadata of a single NFT.",
56+
summary: "Get details",
57+
description: "Get the details for a token in an ERC-1155 contract.",
5758
tags: ["ERC1155"],
5859
operationId: "erc1155_get",
5960
params: requestSchema,

server/api/contract/extensions/erc1155/read/getAll.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export async function erc1155GetAll(fastify: FastifyInstance) {
6262
method: "GET",
6363
url: "/contract/:chain/:contract_address/erc1155/get-all",
6464
schema: {
65-
description: "Get all NFTs from a given contract.",
65+
summary: "Get all details",
66+
description: "Get details for all tokens in an ERC-1155 contract.",
6667
tags: ["ERC1155"],
6768
operationId: "erc1155_getAll",
6869
params: requestSchema,

server/api/contract/extensions/erc1155/read/getOwned.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ export async function erc1155GetOwned(fastify: FastifyInstance) {
6060
method: "GET",
6161
url: "/contract/:chain/:contract_address/erc1155/get-owned",
6262
schema: {
63+
summary: "Get owned tokens",
6364
description:
64-
"Get all NFTs owned by a specific wallet from a given contract.",
65+
"Get all tokens in an ERC-1155 contract owned by a specific wallet.",
6566
tags: ["ERC1155"],
6667
operationId: "erc1155_getOwned",
6768
params: requestSchema,

server/api/contract/extensions/erc1155/read/isApproved.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ export async function erc1155IsApproved(fastify: FastifyInstance) {
4343
method: "GET",
4444
url: "/contract/:chain/:contract_address/erc1155/is-approved",
4545
schema: {
46+
summary: "Check if approved transfers",
4647
description:
47-
"Get whether this wallet has approved transfers from the given operator.",
48+
"Check if the specific wallet has approved transfers from a specific operator wallet.",
4849
tags: ["ERC1155"],
4950
operationId: "erc1155_isApproved",
5051
params: requestSchema,

server/api/contract/extensions/erc1155/read/signatureGenerate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export async function erc1155SignatureGenerate(fastify: FastifyInstance) {
4040
method: "POST",
4141
url: "/contract/:chain/:contract_address/erc1155/signature/generate",
4242
schema: {
43-
description: `Generate a signature that a wallet address can use to mint the specified number of NFTs.
44-
This is typically an admin operation, where the owner of the contract generates a signature that
45-
allows another wallet to mint tokens.`,
43+
summary: "Generate signature",
44+
description:
45+
"Generate a signature granting access for another wallet to mint tokens from this ERC-721 contract. This method is typically called by the token contract owner.",
4646
tags: ["ERC1155"],
4747
operationId: "erc1155_signature_generate",
4848
params: requestSchema,

server/api/contract/extensions/erc1155/read/totalCount.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export async function erc1155TotalCount(fastify: FastifyInstance) {
2929
method: "GET",
3030
url: "/contract/:chain/:contract_address/erc1155/total-count",
3131
schema: {
32-
description: "Get the total number of NFTs minted.",
32+
summary: "Get total supply",
33+
description:
34+
"Get the total supply in circulation for this ERC-1155 contract.",
3335
tags: ["ERC1155"],
3436
operationId: "erc1155_totalCount",
3537
params: requestSchema,

server/api/contract/extensions/erc1155/read/totalSupply.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export async function erc1155TotalSupply(fastify: FastifyInstance) {
3838
method: "GET",
3939
url: "/contract/:chain/:contract_address/erc1155/total-supply",
4040
schema: {
41-
description: "Get the total number of NFTs minted.",
41+
summary: "Get total supply",
42+
description:
43+
"Get the total supply in circulation for this ERC-1155 contract.",
4244
tags: ["ERC1155"],
4345
operationId: "erc1155_totalSupply",
4446
params: requestSchema,

server/api/contract/extensions/erc1155/write/airdrop.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export async function erc1155airdrop(fastify: FastifyInstance) {
5757
method: "POST",
5858
url: "/contract/:chain/:contract_address/erc1155/airdrop",
5959
schema: {
60-
description: "Airdrop a ERC1155 NFT to multiple wallets.",
60+
summary: "Airdrop tokens",
61+
description: "Airdrop ERC-1155 tokens to specific wallets.",
6162
tags: ["ERC1155"],
6263
operationId: "erc1155_airdrop",
6364
params: requestSchema,

server/api/contract/extensions/erc1155/write/burn.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ export async function erc1155burn(fastify: FastifyInstance) {
4040
method: "POST",
4141
url: "/contract/:chain/:contract_address/erc1155/burn",
4242
schema: {
43-
description: "Burn an NFT.",
43+
summary: "Burn token",
44+
description: "Burn ERC-1155 tokens in the caller wallet.",
4445
tags: ["ERC1155"],
4546
operationId: "erc1155_burn",
4647
params: requestSchema,

server/api/contract/extensions/erc1155/write/burnBatch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export async function erc1155burnBatch(fastify: FastifyInstance) {
4646
method: "POST",
4747
url: "/contract/:chain/:contract_address/erc1155/burn-batch",
4848
schema: {
49-
description: "Burn multiple NFTs.",
49+
summary: "Burn tokens (batch)",
50+
description: "Burn a batch of ERC-1155 tokens in the caller wallet.",
5051
tags: ["ERC1155"],
5152
operationId: "erc1155_burnBatch",
5253
params: requestSchema,

server/api/contract/extensions/erc1155/write/claimTo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export async function erc1155claimTo(fastify: FastifyInstance) {
4444
method: "POST",
4545
url: "/contract/:chain/:contract_address/erc1155/claim-to",
4646
schema: {
47-
description: "Claim an NFT to a specific wallet.",
47+
summary: "Claim tokens to wallet",
48+
description: "Claim ERC-1155 tokens to a specific wallet.",
4849
tags: ["ERC1155"],
4950
operationId: "erc1155_claimTo",
5051
params: requestSchema,

0 commit comments

Comments
 (0)