Skip to content

Commit 3543d13

Browse files
committed
fix: pr comment
1 parent 4344462 commit 3543d13

File tree

6 files changed

+69
-66
lines changed

6 files changed

+69
-66
lines changed

examples/api/next.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,4 @@ module.exports = {
55
// Fixes https://discord.com/channels/896185694857343026/1174716239508156496
66
"@lit-protocol/bls-sdk",
77
],
8-
9-
// experimental: {
10-
// esmExternals: "loose",
11-
// },
12-
// experimental.esmExternals: 'loose'
138
};

examples/api/src/app/api/cast-embeds-metadata/by-url/route.ts

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,37 @@ export async function POST(request: NextRequest) {
2525
"url_metadata.nft_collection_id",
2626
"nft_collections.id"
2727
)
28-
.selectAll()
28+
.select([
29+
/* Select all columns with aliases to prevent collisions */
30+
31+
// URL metadata
32+
"url_metadata.image_url as url_image_url",
33+
"url_metadata.image_height as url_image_height",
34+
"url_metadata.image_width as url_image_width",
35+
"url_metadata.alt as url_alt",
36+
"url_metadata.url as url_url",
37+
"url_metadata.description as url_description",
38+
"url_metadata.title as url_title",
39+
"url_metadata.publisher as url_publisher",
40+
"url_metadata.logo_url as url_logo_url",
41+
"url_metadata.mime_type as url_mime_type",
42+
"url_metadata.nft_collection_id as nft_collection_id",
43+
"url_metadata.nft_metadata_id as nft_metadata_id",
44+
45+
// NFT Collection metadata
46+
"nft_collections.creator_address as collection_creator_address",
47+
"nft_collections.description as collection_description",
48+
"nft_collections.image_url as collection_image_url",
49+
"nft_collections.item_count as collection_item_count",
50+
"nft_collections.mint_url as collection_mint_url",
51+
"nft_collections.name as collection_name",
52+
"nft_collections.open_sea_url as collection_open_sea_url",
53+
"nft_collections.owner_count as collection_owner_count",
54+
55+
// NFT metadata
56+
"nft_metadata.token_id as nft_token_id",
57+
"nft_metadata.media_url as nft_media_url",
58+
])
2959
.execute();
3060

3161
const rowsFormatted = metadata.map((row) => {
@@ -41,44 +71,44 @@ export async function POST(request: NextRequest) {
4171
const chain = chainById[chainId];
4272

4373
nftMetadata = {
44-
mediaUrl: row.media_url || undefined,
45-
tokenId: row.token_id || undefined,
74+
mediaUrl: row.nft_media_url || undefined,
75+
tokenId: row.nft_token_id || undefined,
4676
collection: {
4777
chain: chain.network,
4878
contractAddress,
49-
creatorAddress: row.creator_address,
50-
description: row.description,
79+
creatorAddress: row.collection_creator_address,
80+
description: row.collection_description,
5181
id: row.nft_collection_id,
52-
imageUrl: row.image_url,
53-
itemCount: row.item_count,
54-
mintUrl: row.mint_url,
55-
name: row.name,
56-
openSeaUrl: row.open_sea_url || undefined,
57-
ownerCount: row.owner_count || undefined,
82+
imageUrl: row.collection_image_url,
83+
itemCount: row.collection_item_count,
84+
mintUrl: row.collection_mint_url,
85+
name: row.collection_name,
86+
openSeaUrl: row.collection_open_sea_url || undefined,
87+
ownerCount: row.collection_owner_count || undefined,
5888
creator: undefined, // TODO: Look up farcaster user by FID
5989
},
6090
};
6191
}
6292

6393
const urlMetadata: UrlMetadata = {
64-
image: row.image_url
94+
image: row.url_image_url
6595
? {
66-
url: row.image_url,
67-
height: row.image_height || undefined,
68-
width: row.image_width || undefined,
96+
url: row.url_image_url,
97+
height: row.url_image_height || undefined,
98+
width: row.url_image_width || undefined,
6999
}
70100
: undefined,
71-
alt: row.alt || undefined,
72-
description: row.description || undefined,
73-
title: row.title || undefined,
74-
publisher: row.publisher || undefined,
75-
logo: row.logo_url ? { url: row.logo_url } : undefined,
76-
mimeType: row.mime_type || undefined,
101+
alt: row.url_alt || undefined,
102+
description: row.url_description || undefined,
103+
title: row.url_title || undefined,
104+
publisher: row.url_publisher || undefined,
105+
logo: row.url_logo_url ? { url: row.url_logo_url } : undefined,
106+
mimeType: row.url_mime_type || undefined,
77107
nft: nftMetadata,
78108
};
79109

80110
return {
81-
url: row.url,
111+
url: row.url_url,
82112
urlMetadata,
83113
};
84114
});

examples/api/src/app/api/lit-protocol-renderer/route.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { NextRequest, NextResponse } from "next/server";
22
import * as LitJsSdk from "@lit-protocol/lit-node-client";
33

44
async function getLitNodeClient() {
5-
// Initialize LitNodeClient
65
const litNodeClient = new LitJsSdk.LitNodeClient({
76
alertWhenUnauthorized: false,
87
litNetwork: "cayenne",
@@ -41,37 +40,7 @@ async function decryptData({
4140
return decryptedString;
4241
}
4342

44-
// async function retrieveFromIrys(id: string) {
45-
// const gatewayAddress = "https://gateway.irys.xyz/";
46-
// const url = `${gatewayAddress}${id}`;
47-
48-
// try {
49-
// const response = await fetch(url);
50-
51-
// if (!response.ok) {
52-
// throw new Error(`Failed to retrieve data for ID: ${id}`);
53-
// }
54-
55-
// const data = await response.json();
56-
// return [
57-
// data.cipherText,
58-
// data.dataToEncryptHash,
59-
// data.accessControlConditions,
60-
// ];
61-
// } catch (e) {
62-
// console.log("Error retrieving data ", e);
63-
// }
64-
// }
65-
6643
export async function POST(request: NextRequest) {
67-
// const { authSig, irysTransactionId } = await request.json();
68-
69-
// const [
70-
// cipherTextRetrieved,
71-
// dataToEncryptHashRetrieved,
72-
// accessControlConditions,
73-
// ] = await retrieveFromIrys(irysTransactionId);
74-
7544
const {
7645
authSig,
7746
payload: {

packages/core/src/manifest.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ type OpenLinkAction = BaseAction & {
123123
};
124124

125125
export type EthPersonalSignData = {
126-
// domain: string;
127-
// address: string;
128126
statement: string;
129-
// uri: string;
130127
version: string;
131128
chainId: string;
132129
};

packages/core/src/renderer.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,10 +1235,20 @@ export class Renderer {
12351235
{
12361236
type: "select",
12371237
isClearable: el.isClearable || false,
1238-
// perhaps this.replaceInlineContext?
1239-
placeholder: el.placeholder,
1240-
// perhaps map this.replaceInlineContext over labels?
1241-
options: el.options,
1238+
placeholder: el.placeholder
1239+
? this.replaceInlineContext(el.placeholder)
1240+
: el.placeholder,
1241+
options: el.options.map(
1242+
(
1243+
option
1244+
): {
1245+
label: string;
1246+
value: any;
1247+
} => ({
1248+
value: option.value,
1249+
label: this.replaceInlineContext(option.label),
1250+
})
1251+
),
12421252
events: {
12431253
onChange: (value: string) => {
12441254
if (el.ref) {

turbo.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"MICROLINK_API_KEY",
3333
"DATABASE_URL",
3434
"NODE_ENV",
35-
"NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID"
35+
"NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID",
36+
"GATEWAY_URL",
37+
"SIMPLEHASH_API_KEY"
3638
]
3739
}

0 commit comments

Comments
 (0)