Skip to content

Commit 41bdadf

Browse files
authored
Pass x-secret-key header with batch request (#288)
* Use thirdweb client id and api secret key with rpc * Remove unused code * Remove unused code * Pass through x-secret-keu * Update
1 parent f6a58d0 commit 41bdadf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/worker/tasks/processTx.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "../../server/schemas/transaction";
2121
import { sendBalanceWebhook } from "../../server/utils/webhook";
2222
import { getSdk } from "../../utils/cache/getSdk";
23+
import { env } from "../../utils/env";
2324
import { logger } from "../../utils/logger";
2425
import { randomNonce } from "../utils/nonce";
2526

@@ -201,6 +202,11 @@ export const processTx = async () => {
201202
method: "POST",
202203
headers: {
203204
"Content-Type": "application/json",
205+
...(provider.connection.url.includes("rpc.thirdweb.com")
206+
? {
207+
"x-secret-key": env.THIRDWEB_API_SECRET_KEY,
208+
}
209+
: {}),
204210
},
205211
body: JSON.stringify(rpcRequests),
206212
});

0 commit comments

Comments
 (0)