Skip to content

Commit

Permalink
Pass x-secret-key header with batch request (#288)
Browse files Browse the repository at this point in the history
* Use thirdweb client id and api secret key with rpc

* Remove unused code

* Remove unused code

* Pass through x-secret-keu

* Update
  • Loading branch information
adam-maj authored Nov 2, 2023
1 parent f6a58d0 commit 41bdadf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/worker/tasks/processTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
} from "../../server/schemas/transaction";
import { sendBalanceWebhook } from "../../server/utils/webhook";
import { getSdk } from "../../utils/cache/getSdk";
import { env } from "../../utils/env";
import { logger } from "../../utils/logger";
import { randomNonce } from "../utils/nonce";

Expand Down Expand Up @@ -201,6 +202,11 @@ export const processTx = async () => {
method: "POST",
headers: {
"Content-Type": "application/json",
...(provider.connection.url.includes("rpc.thirdweb.com")
? {
"x-secret-key": env.THIRDWEB_API_SECRET_KEY,
}
: {}),
},
body: JSON.stringify(rpcRequests),
});
Expand Down

0 comments on commit 41bdadf

Please sign in to comment.