Skip to content

Commit 8d02352

Browse files
committed
SDK: Fix getNFTs.test
1 parent 464af6a commit 8d02352

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

apps/playground-web/src/app/api/chat/route.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ import { convertToModelMessages, streamText, type UIMessage } from "ai";
33

44
// Allow streaming responses up to 5 minutes
55
export const maxDuration = 300;
6+
export const runtime = "nodejs";
7+
const SECRET_KEY = process.env.THIRDWEB_SECRET_KEY as string;
8+
9+
console.log("DEBUG api/chat: SECRET_KEY", SECRET_KEY);
610

711
const thirdwebAI = createThirdwebAI({
812
baseURL: `https://${process.env.NEXT_PUBLIC_API_URL}`,
9-
secretKey: process.env.THIRDWEB_SECRET_KEY,
13+
secretKey: SECRET_KEY,
1014
});
1115

1216
export async function POST(req: Request) {

apps/playground-web/src/app/api/paywall/route.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ import { toUnits } from "thirdweb/utils";
44
import { facilitator, settlePayment } from "thirdweb/x402";
55
import { token } from "../../payments/x402/components/constants";
66

7+
export const runtime = "nodejs";
78
// Allow streaming responses up to 5 minutes
89
export const maxDuration = 300;
910

11+
const SECRET_KEY = process.env.THIRDWEB_SECRET_KEY as string;
12+
13+
console.log("DEBUG api/paywall: SECRET_KEY", SECRET_KEY);
14+
1015
const client = createThirdwebClient({
11-
secretKey: process.env.THIRDWEB_SECRET_KEY as string,
16+
secretKey: SECRET_KEY,
1217
});
1318

1419
const BACKEND_WALLET_ADDRESS = process.env.ENGINE_BACKEND_WALLET as string;

packages/thirdweb/src/extensions/erc721/read/getNFT.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFT", () => {
4444
"uri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/1",
4545
},
4646
"owner": null,
47-
"tokenAddress": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
47+
"tokenAddress": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
4848
"tokenURI": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/1",
4949
"type": "ERC721",
5050
}

packages/thirdweb/src/extensions/erc721/read/getNFTs.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
1313
});
1414

1515
expect(nfts.length).toBe(5);
16-
// TODO (insight): re-enable once insight fixes the client id caching issue
1716
expect(nfts).toMatchInlineSnapshot(`
1817
[
1918
{
@@ -49,7 +48,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
4948
"uri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/0",
5049
},
5150
"owner": null,
52-
"tokenAddress": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
51+
"tokenAddress": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
5352
"tokenURI": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/0",
5453
"type": "ERC721",
5554
},
@@ -86,7 +85,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
8685
"uri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/1",
8786
},
8887
"owner": null,
89-
"tokenAddress": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
88+
"tokenAddress": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
9089
"tokenURI": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/1",
9190
"type": "ERC721",
9291
},
@@ -123,7 +122,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
123122
"uri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/2",
124123
},
125124
"owner": null,
126-
"tokenAddress": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
125+
"tokenAddress": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
127126
"tokenURI": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/2",
128127
"type": "ERC721",
129128
},
@@ -160,7 +159,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
160159
"uri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/3",
161160
},
162161
"owner": null,
163-
"tokenAddress": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
162+
"tokenAddress": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
164163
"tokenURI": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/3",
165164
"type": "ERC721",
166165
},
@@ -197,7 +196,7 @@ describe.runIf(process.env.TW_SECRET_KEY)("erc721.getNFTs", () => {
197196
"uri": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/4",
198197
},
199198
"owner": null,
200-
"tokenAddress": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e",
199+
"tokenAddress": "0x8a90CAb2b38dba80c64b7734e58Ee1dB38B8992e",
201200
"tokenURI": "ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/4",
202201
"type": "ERC721",
203202
},

0 commit comments

Comments
 (0)