Skip to content

Commit e1eb437

Browse files
authored
[Breaking] Rename x-wallet-address header to x-backend-wallet-address (#168)
1 parent b1535cf commit e1eb437

Some content is hidden

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

81 files changed

+225
-83
lines changed

.env.benchmark.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ THIRDWEB_API_SECRET_KEY = ""
1515
# At minimum, you need to configure a chain and a wallet address
1616
# ============================================================================= #
1717
BENCHMARK_CHAIN = "mumbai"
18-
BENCHMARK_WALLET_ADDRESS = ""
18+
BENCHMARK_BACKEND_WALLET_ADDRESS = ""
19+
20+
# If you want to test with a smart wallet, you can use this header as well
21+
# BENCHMARK_ACCOUNT_ADDRESS
1922

2023
# Then you can configure the contract address and function to call
2124
# NOTE: If you don't configure a contract address and function call, an ERC20

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ POSTGRES_CONNECTION_URL="postgresql://postgres:postgres@host.docker.internal:543
8686
- In development mode, go to the server url to see an admin interface
8787
- Every request to the server requires an authentication token for admin actions use the thirdweb SecretKey. Use the `Authorization` Header to set the value shown below:
8888
- `Authorization: Bearer: <thirdweb SecretKey>`
89-
- Every write request to the server also requires the `x-wallet-address` header to specify which admin wallet to send a transaction with. Use the following format to set this header:
89+
- Every write request to the server also requires the `x-backend-wallet-address` header to specify which admin wallet to send a transaction with. Use the following format to set this header:
9090

91-
- `X-Wallet-Address: 0x3ecdbf3b911d0e9052b64850693888b008e18373`
91+
- `x-backend-wallet-address: 0x3ecdbf3b911d0e9052b64850693888b008e18373`
9292

9393
- Contract API
9494

core/schema/index.ts

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const grantAdmin = async (fastify: FastifyInstance) => {
4040
handler: async (req, rep) => {
4141
const { chain, contract_address } = req.params;
4242
const { signer_address } = req.body;
43-
const walletAddress = req.headers["x-wallet-address"] as string;
43+
const walletAddress = req.headers["x-backend-wallet-address"] as string;
4444
const accountAddress = req.headers["x-account-address"] as string;
4545
const chainId = getChainIdFromChain(chain);
4646

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const grantSession = async (fastify: FastifyInstance) => {
3737
handler: async (req, rep) => {
3838
const { chain, contract_address } = req.params;
3939
const { signerAddress, ...permissions } = req.body;
40-
const walletAddress = req.headers["x-wallet-address"] as string;
40+
const walletAddress = req.headers["x-backend-wallet-address"] as string;
4141
const accountAddress = req.headers["x-account-address"] as string;
4242
const chainId = getChainIdFromChain(chain);
4343

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const revokeAdmin = async (fastify: FastifyInstance) => {
4040
handler: async (req, rep) => {
4141
const { chain, contract_address } = req.params;
4242
const { wallet_address } = req.body;
43-
const walletAddress = req.headers["x-wallet-address"] as string;
43+
const walletAddress = req.headers["x-backend-wallet-address"] as string;
4444
const accountAddress = req.headers["x-account-address"] as string;
4545
const chainId = getChainIdFromChain(chain);
4646

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const revokeSession = async (fastify: FastifyInstance) => {
4040
handler: async (req, rep) => {
4141
const { chain, contract_address } = req.params;
4242
const { wallet_address } = req.body;
43-
const walletAddress = req.headers["x-wallet-address"] as string;
43+
const walletAddress = req.headers["x-backend-wallet-address"] as string;
4444
const accountAddress = req.headers["x-account-address"] as string;
4545
const chainId = getChainIdFromChain(chain);
4646

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const updateSession = async (fastify: FastifyInstance) => {
4242
handler: async (req, rep) => {
4343
const { chain, contract_address } = req.params;
4444
const { signerAddress, ...permissions } = req.body;
45-
const walletAddress = req.headers["x-wallet-address"] as string;
45+
const walletAddress = req.headers["x-backend-wallet-address"] as string;
4646
const accountAddress = req.headers["x-account-address"] as string;
4747
const chainId = getChainIdFromChain(chain);
4848

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const createAccount = async (fastify: FastifyInstance) => {
4545
handler: async (req, rep) => {
4646
const { chain, contract_address } = req.params;
4747
const { admin_address, extra_data } = req.body;
48-
const walletAddress = req.headers["x-wallet-address"] as string;
48+
const walletAddress = req.headers["x-backend-wallet-address"] as string;
4949
const accountAddress = req.headers["x-account-address"] as string;
5050
const chainId = getChainIdFromChain(chain);
5151

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export async function erc1155airdrop(fastify: FastifyInstance) {
7171
handler: async (request, reply) => {
7272
const { chain, contract_address } = request.params;
7373
const { token_id, addresses } = request.body;
74-
const walletAddress = request.headers["x-wallet-address"] as string;
74+
const walletAddress = request.headers[
75+
"x-backend-wallet-address"
76+
] as string;
7577
const accountAddress = request.headers["x-account-address"] as string;
7678
const chainId = getChainIdFromChain(chain);
7779
const contract = await getContract({

0 commit comments

Comments
 (0)