mirror of
https://github.com/FlipsideCrypto/near-bos-gateway.git
synced 2026-02-06 11:18:24 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
90b031fad6
5
.gitignore
vendored
5
.gitignore
vendored
@ -10,6 +10,7 @@
|
||||
|
||||
# production
|
||||
/build
|
||||
/dist
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
@ -17,6 +18,7 @@
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
.wrangler/
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
@ -27,6 +29,3 @@ yarn-error.log*
|
||||
|
||||
target
|
||||
neardev
|
||||
|
||||
# OS X
|
||||
.DS_Store
|
||||
|
||||
@ -43,6 +43,9 @@ module.exports = () => ({
|
||||
static: path.resolve(__dirname, "../dist"),
|
||||
port: 3000,
|
||||
compress: true,
|
||||
historyApiFallback: {
|
||||
disableDotRule: true,
|
||||
},
|
||||
},
|
||||
plugins: [new HotModuleReplacementPlugin()],
|
||||
});
|
||||
|
||||
@ -6,7 +6,7 @@ module.exports = () => {
|
||||
return {
|
||||
output: {
|
||||
path: path.resolve(__dirname, "../dist"),
|
||||
publicPath: "./",
|
||||
publicPath: "/",
|
||||
filename: "[name].[contenthash].bundle.js",
|
||||
},
|
||||
devtool: false,
|
||||
|
||||
211
functions/[[accountId]]/widget/[[index]].js
Normal file
211
functions/[[accountId]]/widget/[[index]].js
Normal file
@ -0,0 +1,211 @@
|
||||
import {
|
||||
socialGet,
|
||||
imageToUrl,
|
||||
wrapImage,
|
||||
DefaultProfileImage,
|
||||
} from "../../common";
|
||||
|
||||
class MetaTitleInjector {
|
||||
constructor({ title }) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
element(element) {
|
||||
element.setAttribute("content", this.title);
|
||||
}
|
||||
}
|
||||
|
||||
class MetaImageInjector {
|
||||
constructor({ image, authorImage }) {
|
||||
this.image = image;
|
||||
this.authorImage = authorImage;
|
||||
}
|
||||
|
||||
element(element) {
|
||||
if (this.image) {
|
||||
element.setAttribute("content", this.image);
|
||||
} else if (this.authorImage) {
|
||||
element.setAttribute("content", this.authorImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MetaTwitterCardInjector {
|
||||
constructor({ image }) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
element(element) {
|
||||
if (!this.image) {
|
||||
element.setAttribute("content", "summary");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MetaDescriptionInjector {
|
||||
constructor({ shortDescription }) {
|
||||
this.shortDescription = shortDescription;
|
||||
}
|
||||
|
||||
element(element) {
|
||||
element.setAttribute(
|
||||
"content",
|
||||
this.shortDescription?.replaceAll("\n", " ")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class TitleInjector {
|
||||
constructor({ title }) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
element(element) {
|
||||
element.setInnerContent(this.title);
|
||||
}
|
||||
}
|
||||
|
||||
class NoscriptDescriptionInjector {
|
||||
constructor({ description }) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
element(element) {
|
||||
element.setInnerContent(this.description);
|
||||
}
|
||||
}
|
||||
|
||||
function defaultData() {
|
||||
const image = "https://near.social/assets/logo.png";
|
||||
const title = "Near Social";
|
||||
const description = "Social data protocol built on NEAR";
|
||||
return {
|
||||
image,
|
||||
title,
|
||||
description,
|
||||
};
|
||||
}
|
||||
|
||||
async function postData(env, url, data, isPost) {
|
||||
const accountId = url.searchParams.get("accountId");
|
||||
const blockHeight = url.searchParams.get("blockHeight");
|
||||
const [content, name, authorImage] = await Promise.all([
|
||||
socialGet(
|
||||
`${accountId}/post/${isPost ? "main" : "comment"}`,
|
||||
blockHeight,
|
||||
true
|
||||
),
|
||||
socialGet(`${accountId}/profile/name`),
|
||||
socialGet(`${accountId}/profile/image/**`),
|
||||
]);
|
||||
|
||||
data.raw = content;
|
||||
data.description = content?.text || "";
|
||||
data.image = await imageToUrl(env, content?.image);
|
||||
if (!data.image) {
|
||||
data.authorImage = await imageToUrl(env, authorImage);
|
||||
}
|
||||
data.title = isPost
|
||||
? `Post by ${name ?? accountId} | Near Social`
|
||||
: `Comment by ${name ?? accountId} | Near Social`;
|
||||
data.accountName = name;
|
||||
data.accountId = accountId;
|
||||
}
|
||||
|
||||
async function profileData(env, url, data) {
|
||||
const accountId = url.searchParams.get("accountId");
|
||||
const profile = await socialGet(`${accountId}/profile/**`);
|
||||
|
||||
const name = profile?.name;
|
||||
data.raw = profile;
|
||||
data.description =
|
||||
profile?.description || `Profile of ${accountId} on Near Social`;
|
||||
data.image = await imageToUrl(env, profile?.image);
|
||||
data.authorImage = data.image || wrapImage(DefaultProfileImage);
|
||||
data.title = name
|
||||
? `${name} (${accountId}) | Near Social`
|
||||
: `${accountId} | Near Social`;
|
||||
data.accountName = name;
|
||||
data.accountId = accountId;
|
||||
}
|
||||
|
||||
async function widgetData(env, url, data) {
|
||||
const parts = url.pathname.split("/");
|
||||
const accountId = parts[1];
|
||||
const widgetId = parts[3];
|
||||
const metadata = await socialGet(
|
||||
`${accountId}/widget/${widgetId}/metadata/**`
|
||||
);
|
||||
|
||||
const name = metadata?.name || widgetId;
|
||||
data.raw = metadata;
|
||||
data.description =
|
||||
metadata?.description || `Component ${name} created by ${accountId}`;
|
||||
data.image = await imageToUrl(env, metadata?.image);
|
||||
data.title = `${name} by ${accountId} | Near Social`;
|
||||
data.accountName = name;
|
||||
data.accountId = accountId;
|
||||
}
|
||||
|
||||
async function sourceData(env, url, data) {
|
||||
const key = url.searchParams.get("src");
|
||||
const parts = key.split("/");
|
||||
const accountId = parts[0];
|
||||
const blockHeight = url.searchParams.get("blockHeight");
|
||||
const [source, image] = await Promise.all([
|
||||
socialGet(key, blockHeight),
|
||||
socialGet(`${key}/metadata/image/**`),
|
||||
]);
|
||||
|
||||
data.raw = source;
|
||||
data.description = source || "The source code is not available.";
|
||||
data.image = null;
|
||||
data.authorImage = await imageToUrl(env, image);
|
||||
data.title = `Source code of ${key} at block height ${blockHeight} | Near Social`;
|
||||
data.accountId = accountId;
|
||||
}
|
||||
|
||||
async function generateData(env, url) {
|
||||
const data = defaultData();
|
||||
try {
|
||||
if (url.pathname === "/mob.near/widget/MainPage.Post.Page") {
|
||||
await postData(env, url, data, true);
|
||||
} else if (url.pathname === "/mob.near/widget/MainPage.Comment.Page") {
|
||||
await postData(env, url, data, false);
|
||||
} else if (url.pathname === "/mob.near/widget/ProfilePage") {
|
||||
await profileData(env, url, data);
|
||||
} else if (url.pathname === "/mob.near/widget/WidgetSource") {
|
||||
await sourceData(env, url, data);
|
||||
} else {
|
||||
await widgetData(env, url, data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
data.shortDescription = data.description.slice(0, 250);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function onRequest({ request, next, env }) {
|
||||
const url = new URL(request.url);
|
||||
if (
|
||||
url.pathname.split("/").length < 4 ||
|
||||
url.pathname.endsWith(".bundle.js")
|
||||
) {
|
||||
return next();
|
||||
}
|
||||
const data = await generateData(env, url);
|
||||
return (
|
||||
new HTMLRewriter()
|
||||
.on('meta[property="og:title"]', new MetaTitleInjector(data))
|
||||
.on('meta[property="og:image"]', new MetaImageInjector(data))
|
||||
.on('meta[name="twitter:card"]', new MetaTwitterCardInjector(data))
|
||||
.on('meta[property="og:description"]', new MetaDescriptionInjector(data))
|
||||
.on('meta[name="description"]', new MetaDescriptionInjector(data))
|
||||
// .on("head", new MetaTagInjector(data))
|
||||
.on("title", new TitleInjector(data))
|
||||
.on("noscript", new NoscriptDescriptionInjector(data))
|
||||
.transform(await next())
|
||||
);
|
||||
}
|
||||
170
functions/common.js
Normal file
170
functions/common.js
Normal file
@ -0,0 +1,170 @@
|
||||
import { Buffer } from "node:buffer";
|
||||
|
||||
export async function socialIndex(action, key, options) {
|
||||
const request = await fetch("https://api.near.social/index", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
action,
|
||||
key,
|
||||
options,
|
||||
}),
|
||||
});
|
||||
return await request.json();
|
||||
}
|
||||
|
||||
export async function socialKeys(keys, blockHeight, options) {
|
||||
const request = await fetch("https://api.near.social/keys", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
keys: [keys],
|
||||
blockHeight,
|
||||
options,
|
||||
}),
|
||||
});
|
||||
return await request.json();
|
||||
}
|
||||
|
||||
export async function socialGet(keys, blockHeight, parse) {
|
||||
const request = await fetch("https://api.near.social/get", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
keys: [keys],
|
||||
blockHeight,
|
||||
}),
|
||||
});
|
||||
let data = await request.json();
|
||||
const parts = keys.split("/");
|
||||
for (let i = 0; i < parts.length; i++) {
|
||||
const part = parts[i];
|
||||
if (part === "*" || part === "**") {
|
||||
break;
|
||||
}
|
||||
data = data?.[part];
|
||||
}
|
||||
if (parse) {
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function viewCall({ contractId, method, args }) {
|
||||
const res = await fetch("https://rpc.mainnet.near.org", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
jsonrpc: "2.0",
|
||||
id: "dontcare",
|
||||
method: "query",
|
||||
params: {
|
||||
request_type: "call_function",
|
||||
finality: "final",
|
||||
account_id: contractId,
|
||||
method_name: method,
|
||||
args_base64: btoa(JSON.stringify(args)),
|
||||
},
|
||||
}),
|
||||
});
|
||||
const json = await res.json();
|
||||
const result = Buffer.from(json.result.result).toString("utf-8");
|
||||
return JSON.parse(result);
|
||||
}
|
||||
|
||||
export async function nftToImageUrl({ contractId, tokenId }) {
|
||||
const [token, nftMetadata] = await Promise.all([
|
||||
viewCall({
|
||||
contractId,
|
||||
method: "nft_token",
|
||||
args: { token_id: tokenId },
|
||||
}),
|
||||
viewCall({
|
||||
contractId,
|
||||
method: "nft_metadata",
|
||||
args: {},
|
||||
}),
|
||||
]);
|
||||
|
||||
const tokenMetadata = token?.metadata || {};
|
||||
const tokenMedia = tokenMetadata.media || "";
|
||||
|
||||
let imageUrl =
|
||||
tokenMedia.startsWith("https://") ||
|
||||
tokenMedia.startsWith("http://") ||
|
||||
tokenMedia.startsWith("data:image")
|
||||
? tokenMedia
|
||||
: nftMetadata.base_uri
|
||||
? `${nftMetadata.base_uri}/${tokenMedia}`
|
||||
: tokenMedia.startsWith("Qm") || tokenMedia.startsWith("ba")
|
||||
? `https://ipfs.near.social/ipfs/${tokenMedia}`
|
||||
: tokenMedia;
|
||||
|
||||
if (!tokenMedia && tokenMetadata.reference) {
|
||||
const metadataUrl =
|
||||
nftMetadata.base_uri === "https://arweave.net" &&
|
||||
!tokenMetadata.reference.startsWith("https://")
|
||||
? `${nftMetadata.base_uri}/${tokenMetadata.reference}`
|
||||
: tokenMetadata.reference.startsWith("https://") ||
|
||||
tokenMetadata.reference.startsWith("http://")
|
||||
? tokenMetadata.reference
|
||||
: tokenMetadata.reference.startsWith("ar://")
|
||||
? `https://arweave.net/${tokenMetadata.reference.split("//")[1]}`
|
||||
: null;
|
||||
if (metadataUrl) {
|
||||
const res = await fetch(metadataUrl);
|
||||
const json = await res.json();
|
||||
imageUrl = json.media;
|
||||
}
|
||||
}
|
||||
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
export function wrapImage(url) {
|
||||
return url ? `https://i.near.social/large/${url}` : null;
|
||||
}
|
||||
|
||||
export async function internalImageToUrl(env, image) {
|
||||
if (image?.url) {
|
||||
return image.url;
|
||||
} else if (image?.ipfs_cid) {
|
||||
return `https://ipfs.near.social/ipfs/${image.ipfs_cid}`;
|
||||
} else if (image?.nft) {
|
||||
try {
|
||||
const { contractId, tokenId } = image.nft;
|
||||
const NftKV = env.NftKV;
|
||||
|
||||
let imageUrl = await NftKV.get(`${contractId}/${tokenId}`);
|
||||
if (!imageUrl) {
|
||||
imageUrl = await nftToImageUrl({ contractId, tokenId });
|
||||
if (imageUrl) {
|
||||
await NftKV.put(`${contractId}/${tokenId}`, imageUrl);
|
||||
}
|
||||
}
|
||||
return imageUrl;
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function imageToUrl(env, image) {
|
||||
return wrapImage(await internalImageToUrl(env, image));
|
||||
}
|
||||
|
||||
export const DefaultProfileImage =
|
||||
"https://ipfs.near.social/ipfs/bafkreibmiy4ozblcgv3fm3gc6q62s55em33vconbavfd2ekkuliznaq3zm";
|
||||
30
functions/magic/img/account/[index].js
Normal file
30
functions/magic/img/account/[index].js
Normal file
@ -0,0 +1,30 @@
|
||||
import {
|
||||
DefaultProfileImage,
|
||||
internalImageToUrl,
|
||||
socialGet,
|
||||
} from "../../../common";
|
||||
|
||||
export async function onRequest({ request, next, env }) {
|
||||
const url = new URL(request.url);
|
||||
const parts = url.pathname.split("/");
|
||||
if (parts.length !== 5) {
|
||||
return next();
|
||||
}
|
||||
const accountId = parts[4];
|
||||
const image = await socialGet(`${accountId}/profile/image/**`);
|
||||
|
||||
const destinationURL = await internalImageToUrl(env, image);
|
||||
|
||||
if (!destinationURL) {
|
||||
// return status 404
|
||||
return new Response(null, {
|
||||
status: 404,
|
||||
});
|
||||
}
|
||||
|
||||
return new Response(destinationURL, {
|
||||
headers: {
|
||||
"content-type": "text/plain;charset=UTF-8",
|
||||
},
|
||||
});
|
||||
}
|
||||
28
functions/magic/img/nft/[[index]].js
Normal file
28
functions/magic/img/nft/[[index]].js
Normal file
@ -0,0 +1,28 @@
|
||||
import { internalImageToUrl } from "../../../common";
|
||||
|
||||
export async function onRequest({ request, next, env }) {
|
||||
const url = new URL(request.url);
|
||||
const parts = url.pathname.split("/");
|
||||
if (parts.length !== 6) {
|
||||
return next();
|
||||
}
|
||||
const contractId = parts[4];
|
||||
const tokenId = parts[5];
|
||||
|
||||
const destinationURL = await internalImageToUrl(env, {
|
||||
nft: {
|
||||
contractId,
|
||||
tokenId,
|
||||
},
|
||||
});
|
||||
|
||||
return destinationURL
|
||||
? new Response(destinationURL, {
|
||||
headers: {
|
||||
"content-type": "text/plain;charset=UTF-8",
|
||||
},
|
||||
})
|
||||
: new Response(null, {
|
||||
status: 404,
|
||||
});
|
||||
}
|
||||
27
functions/sitemap/index.js
Normal file
27
functions/sitemap/index.js
Normal file
@ -0,0 +1,27 @@
|
||||
export async function onRequest({ request, next, env }) {
|
||||
return new Response(
|
||||
`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<sitemap>
|
||||
<loc>https://near.social/sitemap/posts/0</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://near.social/sitemap/widgets/</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://near.social/sitemap/profiles/</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://near.social/sitemap/sources/0</loc>
|
||||
</sitemap>
|
||||
<sitemap>
|
||||
<loc>https://near.social/sitemap/sources/50000</loc>
|
||||
</sitemap>
|
||||
</sitemapindex>`,
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/xml;charset=UTF-8",
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
37
functions/sitemap/posts/[index].js
Normal file
37
functions/sitemap/posts/[index].js
Normal file
@ -0,0 +1,37 @@
|
||||
import { socialIndex } from "../../common";
|
||||
|
||||
const Limit = 50000;
|
||||
|
||||
export const generateSitemapPosts = async (env, offset) => {
|
||||
const posts = await socialIndex("post", "main", {});
|
||||
const urls = posts.map(
|
||||
(post) =>
|
||||
` <url>
|
||||
<loc>https://near.social/mob.near/widget/MainPage.Post.Page?accountId=${post.accountId}&blockHeight=${post.blockHeight}</loc>
|
||||
<changefreq>never</changefreq>
|
||||
</url>`
|
||||
);
|
||||
console.log("urls count", urls.length);
|
||||
return urls.slice(offset, offset + Limit).join("\n");
|
||||
};
|
||||
|
||||
export async function onRequest({ request, env, next }) {
|
||||
const url = new URL(request.url);
|
||||
const parts = url.pathname.split("/");
|
||||
if (parts.length !== 4) {
|
||||
return next();
|
||||
}
|
||||
const offset = parseInt(parts[3]);
|
||||
|
||||
return new Response(
|
||||
`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
${await generateSitemapPosts(env, offset)}
|
||||
</urlset>`,
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/xml;charset=UTF-8",
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
29
functions/sitemap/profiles/index.js
Normal file
29
functions/sitemap/profiles/index.js
Normal file
@ -0,0 +1,29 @@
|
||||
import { socialKeys } from "../../common";
|
||||
|
||||
export const generateSitemapProfiles = async (env) => {
|
||||
const data = await socialKeys("*/profile");
|
||||
const accountIds = Object.keys(data);
|
||||
return accountIds
|
||||
.map(
|
||||
(accountId) =>
|
||||
` <url>
|
||||
<loc>https://near.social/mob.near/widget/ProfilePage?accountId=${accountId}</loc>
|
||||
<changefreq>monthly</changefreq>
|
||||
</url>`
|
||||
)
|
||||
.join("\n");
|
||||
};
|
||||
|
||||
export async function onRequest({ env }) {
|
||||
return new Response(
|
||||
`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
${await generateSitemapProfiles(env)}
|
||||
</urlset>`,
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/xml;charset=UTF-8",
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
50
functions/sitemap/sources/[index].js
Normal file
50
functions/sitemap/sources/[index].js
Normal file
@ -0,0 +1,50 @@
|
||||
import { socialKeys } from "../../common";
|
||||
|
||||
const MinBlockHeight = 75942518;
|
||||
const LIMIT = 50000;
|
||||
|
||||
export const generateSitemapSources = async (env, offset) => {
|
||||
const data = await socialKeys("*/widget/*", null, {
|
||||
return_type: "History",
|
||||
});
|
||||
const urls = Object.entries(data)
|
||||
.map(([accountId, widget]) =>
|
||||
Object.entries(widget.widget)
|
||||
.map(([widgetId, blockHeights]) =>
|
||||
blockHeights
|
||||
.filter((blockHeight) => blockHeight >= MinBlockHeight)
|
||||
.map(
|
||||
(blockHeight) =>
|
||||
` <url>
|
||||
<loc>https://near.social/mob.near/widget/WidgetSource?src=${accountId}/widget/${widgetId}&blockHeight=${blockHeight}</loc>
|
||||
<changefreq>never</changefreq>
|
||||
</url>`
|
||||
)
|
||||
)
|
||||
.flat()
|
||||
)
|
||||
.flat();
|
||||
console.log("urls count", urls.length);
|
||||
return urls.slice(offset, offset + LIMIT).join("\n");
|
||||
};
|
||||
|
||||
export async function onRequest({ env, request, next }) {
|
||||
const url = new URL(request.url);
|
||||
const parts = url.pathname.split("/");
|
||||
if (parts.length !== 4) {
|
||||
return next();
|
||||
}
|
||||
const offset = parseInt(parts[3]);
|
||||
|
||||
return new Response(
|
||||
`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
${await generateSitemapSources(env, offset)}
|
||||
</urlset>`,
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/xml;charset=UTF-8",
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
31
functions/sitemap/widgets/index.js
Normal file
31
functions/sitemap/widgets/index.js
Normal file
@ -0,0 +1,31 @@
|
||||
import { socialKeys } from "../../common";
|
||||
|
||||
export const generateSitemapWidgets = async (env) => {
|
||||
const data = await socialKeys("*/widget/*/metadata");
|
||||
return Object.entries(data)
|
||||
.map(([accountId, widget]) =>
|
||||
Object.keys(widget.widget).map(
|
||||
(widgetId) =>
|
||||
` <url>
|
||||
<loc>https://near.social/${accountId}/widget/${widgetId}</loc>
|
||||
<changefreq>monthly</changefreq>
|
||||
</url>`
|
||||
)
|
||||
)
|
||||
.flat()
|
||||
.join("\n");
|
||||
};
|
||||
|
||||
export async function onRequest({ env }) {
|
||||
return new Response(
|
||||
`<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
${await generateSitemapWidgets(env)}
|
||||
</urlset>`,
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/xml;charset=UTF-8",
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
19
package.json
19
package.json
@ -1,19 +1,20 @@
|
||||
{
|
||||
"name": "flipside-bos-gateway",
|
||||
"version": "0.12.3",
|
||||
"version": "0.13.0",
|
||||
"homepage": "/",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "^6.0.2",
|
||||
"@monaco-editor/react": "^4.4.6",
|
||||
"@near-wallet-selector/core": "^8.1.0",
|
||||
"@near-wallet-selector/here-wallet": "^8.1.0",
|
||||
"@near-wallet-selector/meteor-wallet": "^8.1.0",
|
||||
"@near-wallet-selector/modal-ui": "^8.1.0",
|
||||
"@near-wallet-selector/my-near-wallet": "^8.1.0",
|
||||
"@near-wallet-selector/near-wallet": "^8.1.0",
|
||||
"@near-wallet-selector/neth": "^8.1.0",
|
||||
"@near-wallet-selector/sender": "^8.1.0",
|
||||
"@near-wallet-selector/core": "^8.5.0",
|
||||
"@near-wallet-selector/here-wallet": "^8.5.0",
|
||||
"@near-wallet-selector/meteor-wallet": "^8.5.0",
|
||||
"@near-wallet-selector/modal-ui": "^8.5.0",
|
||||
"@near-wallet-selector/my-near-wallet": "^8.5.0",
|
||||
"@near-wallet-selector/near-wallet": "^8.5.0",
|
||||
"@near-wallet-selector/neth": "^8.5.0",
|
||||
"@near-wallet-selector/nightly": "^8.5.0",
|
||||
"@near-wallet-selector/sender": "^8.5.0",
|
||||
"@web3-onboard/core": "^2.16.2",
|
||||
"@web3-onboard/injected-wallets": "^2.8.4",
|
||||
"@web3-onboard/ledger": "^2.4.4",
|
||||
|
||||
@ -2,30 +2,31 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="favicon.ico" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- <meta name="description" content="Social data protocol built on NEAR" /> -->
|
||||
<!-- <meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content="@NearSocial_" />
|
||||
<meta name="twitter:image" content="https://near.social/assets/logo.png" />
|
||||
<meta property="og:image" content="https://near.social/assets/logo.png" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="Near Social" /> -->
|
||||
<!-- <meta
|
||||
property="og:description"
|
||||
content="Social data protocol built on NEAR"
|
||||
/> -->
|
||||
<link rel="apple-touch-icon" href="favicon.ico" />
|
||||
<link rel="apple-touch-icon" href="/favicon.png" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="description" content="Flipside's hosting of BOS on Near" />
|
||||
<!-- <meta name="twitter:card" content="summary_large_image" /> -->
|
||||
<!-- <meta name="twitter:site" content="@NearSocial_"> -->
|
||||
<!-- <meta property="og:image" content="https://near.social/assets/logo.png"> -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="Flipside BOS Gateway" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="Flipside's hosting of BOS on Near"
|
||||
/>
|
||||
<title>Flipside BOS Gateway</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<noscript style="white-space: pre; font-family: monospace">
|
||||
You need to enable JavaScript to run this app.
|
||||
</noscript>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
# https://www.robotstxt.org/robotstxt.html
|
||||
Sitemap: https://near.social/sitemap/
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
||||
10
src/App.js
10
src/App.js
@ -6,7 +6,7 @@ import "react-bootstrap-typeahead/css/Typeahead.css";
|
||||
import "react-bootstrap-typeahead/css/Typeahead.bs5.css";
|
||||
import "bootstrap/dist/js/bootstrap.bundle";
|
||||
import "App.scss";
|
||||
import { HashRouter as Router, Link, Route, Switch } from "react-router-dom";
|
||||
import { BrowserRouter as Router, Link, Route, Switch } from "react-router-dom";
|
||||
import EditorPage from "./pages/EditorPage";
|
||||
import ViewPage from "./pages/ViewPage";
|
||||
import { setupWalletSelector } from "@near-wallet-selector/core";
|
||||
@ -16,6 +16,7 @@ import { setupSender } from "@near-wallet-selector/sender";
|
||||
import { setupHereWallet } from "@near-wallet-selector/here-wallet";
|
||||
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet";
|
||||
import { setupNeth } from "@near-wallet-selector/neth";
|
||||
import { setupNightly } from "@near-wallet-selector/nightly";
|
||||
import { setupModal } from "@near-wallet-selector/modal-ui";
|
||||
import EmbedPage from "./pages/EmbedPage";
|
||||
import { sanitizeUrl } from "@braintree/sanitize-url";
|
||||
@ -47,9 +48,8 @@ function App(props) {
|
||||
const { initNear } = useInitNear();
|
||||
const near = useNear();
|
||||
const account = useAccount();
|
||||
const accountId = account.accountId;
|
||||
|
||||
const location = window.location;
|
||||
const accountId = account.accountId;
|
||||
|
||||
useEffect(() => {
|
||||
initNear &&
|
||||
@ -67,6 +67,7 @@ function App(props) {
|
||||
gas: "300000000000000",
|
||||
bundle: false,
|
||||
}),
|
||||
setupNightly(),
|
||||
],
|
||||
}),
|
||||
customElements: {
|
||||
@ -81,6 +82,9 @@ function App(props) {
|
||||
return <Link {...props} />;
|
||||
},
|
||||
},
|
||||
config: {
|
||||
defaultFinality: undefined,
|
||||
},
|
||||
});
|
||||
}, [initNear]);
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@ import { DesktopNavigation } from "./desktop/DesktopNavigation";
|
||||
import { MobileNavigation } from "./mobile/MobileNavigation";
|
||||
|
||||
export function NavigationWrapper(props) {
|
||||
const hideMenu = !!window?.InjectedConfig?.hideMenu;
|
||||
|
||||
const [matches, setMatches] = useState(
|
||||
window.matchMedia("(min-width: 992px)").matches
|
||||
);
|
||||
@ -12,7 +14,9 @@ export function NavigationWrapper(props) {
|
||||
.matchMedia("(min-width: 992px)")
|
||||
.addEventListener("change", (e) => setMatches(e.matches));
|
||||
}, []);
|
||||
return (
|
||||
return hideMenu ? (
|
||||
<></>
|
||||
) : (
|
||||
<>
|
||||
{matches && <DesktopNavigation {...props} />}
|
||||
{!matches && <MobileNavigation {...props} />}
|
||||
|
||||
@ -205,6 +205,18 @@ export const onboard = init({
|
||||
label: "Ethereum Classic Mainnet",
|
||||
rpcUrl: "https://etc.rivet.link",
|
||||
},
|
||||
{
|
||||
id: 84531,
|
||||
token: "ETH",
|
||||
label: "Base Goerli Testnet",
|
||||
rpcUrl: "https://goerli.base.org",
|
||||
},
|
||||
{
|
||||
id: 8453,
|
||||
token: "ETH",
|
||||
label: "Base Mainnet",
|
||||
rpcUrl: "https://mainnet.base.org",
|
||||
},
|
||||
],
|
||||
appMetadata: {
|
||||
name: "NEAR Social",
|
||||
|
||||
37
src/hooks/useHashRouterLegacy.js
Normal file
37
src/hooks/useHashRouterLegacy.js
Normal file
@ -0,0 +1,37 @@
|
||||
import { useHistory } from "react-router-dom";
|
||||
import React, { useCallback, useEffect } from "react";
|
||||
|
||||
export function useHashRouterLegacy() {
|
||||
const history = useHistory();
|
||||
|
||||
const onHashChange = useCallback(
|
||||
(event) => {
|
||||
let url = event.newURL.split("#").pop() ?? "/";
|
||||
|
||||
if (url[0] === "/") {
|
||||
history && history.replace(url);
|
||||
}
|
||||
},
|
||||
[history]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener("hashchange", onHashChange);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener("hashchange", onHashChange);
|
||||
};
|
||||
}, [onHashChange]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!history) {
|
||||
return;
|
||||
}
|
||||
const currentUrl = window.location.href;
|
||||
|
||||
if (currentUrl.includes("#")) {
|
||||
const path = currentUrl.split("#")[1];
|
||||
history.replace(path);
|
||||
}
|
||||
}, [history]);
|
||||
}
|
||||
@ -3,12 +3,5 @@ import React from "react";
|
||||
|
||||
export function useQuery() {
|
||||
let { search } = useLocation();
|
||||
if (location.search) {
|
||||
if (!search) {
|
||||
search = location.search;
|
||||
} else {
|
||||
search += `&${location.search.substring(1)}`;
|
||||
}
|
||||
}
|
||||
return React.useMemo(() => new URLSearchParams(search), [search]);
|
||||
}
|
||||
|
||||
@ -21,6 +21,7 @@ import {
|
||||
StorageType,
|
||||
toPath,
|
||||
} from "../components/Editor/FileTab";
|
||||
import { useHashRouterLegacy } from "../hooks/useHashRouterLegacy";
|
||||
|
||||
const LsKey = "social.near:v01:";
|
||||
const EditorLayoutKey = LsKey + "editorLayout:";
|
||||
@ -41,6 +42,7 @@ const Layout = {
|
||||
};
|
||||
|
||||
export default function EditorPage(props) {
|
||||
useHashRouterLegacy();
|
||||
const { widgetSrc } = useParams();
|
||||
const history = useHistory();
|
||||
const setWidgetSrc = props.setWidgetSrc;
|
||||
@ -595,7 +597,7 @@ export default function EditorPage(props) {
|
||||
{path && accountId && (
|
||||
<a
|
||||
className="btn btn-outline-primary"
|
||||
href={`#/${widgetPath}`}
|
||||
href={`/${widgetPath}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
@ -2,12 +2,14 @@ import React, { useEffect, useState } from "react";
|
||||
import { Widget } from "near-flipside-vm";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useQuery } from "../hooks/useQuery";
|
||||
import { useHashRouterLegacy } from "../hooks/useHashRouterLegacy";
|
||||
|
||||
export default function EmbedPage(props) {
|
||||
useHashRouterLegacy();
|
||||
|
||||
const { widgetSrc } = useParams();
|
||||
const query = useQuery();
|
||||
const [widgetProps, setWidgetProps] = useState({});
|
||||
|
||||
const src = widgetSrc || props.widgets.default;
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -2,13 +2,18 @@ import React, { useEffect, useState } from "react";
|
||||
import { Widget } from "near-flipside-vm";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useQuery } from "../hooks/useQuery";
|
||||
import { useHashRouterLegacy } from "../hooks/useHashRouterLegacy";
|
||||
|
||||
export default function ViewPage(props) {
|
||||
useHashRouterLegacy();
|
||||
|
||||
const { widgetSrc } = useParams();
|
||||
const query = useQuery();
|
||||
const [widgetProps, setWidgetProps] = useState({});
|
||||
|
||||
const src = widgetSrc || props.widgets.default;
|
||||
const src =
|
||||
widgetSrc || window?.InjectedConfig?.defaultWidget || props.widgets.default;
|
||||
const showMenu = !window?.InjectedConfig?.hideMenu;
|
||||
const setWidgetSrc = props.setWidgetSrc;
|
||||
const viewSourceWidget = props.widgets.viewSource;
|
||||
|
||||
@ -31,8 +36,8 @@ export default function ViewPage(props) {
|
||||
);
|
||||
}, 1);
|
||||
}, [src, query, setWidgetSrc, viewSourceWidget]);
|
||||
console.log("src", src);
|
||||
return (
|
||||
|
||||
return showMenu ? (
|
||||
<div className="container-xl">
|
||||
<div className="row">
|
||||
<div
|
||||
@ -42,9 +47,11 @@ export default function ViewPage(props) {
|
||||
paddingTop: "var(--body-top-padding)",
|
||||
}}
|
||||
>
|
||||
<Widget key={src} src={src} props={widgetProps} />{" "}
|
||||
<Widget key={src} src={src} props={widgetProps} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<Widget key={src} src={src} props={widgetProps} />
|
||||
);
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ const HTMLWebpackPlugin = require("html-webpack-plugin");
|
||||
const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
const { merge } = require("webpack-merge");
|
||||
const loadPreset = require("./config/presets/loadPreset");
|
||||
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
|
||||
const loadConfig = (mode) => require(`./config/webpack.${mode}.js`)(mode);
|
||||
|
||||
module.exports = function (env) {
|
||||
@ -83,6 +82,7 @@ module.exports = function (env) {
|
||||
template: `${paths.publicPath}/index.html`,
|
||||
favicon: `${paths.publicPath}/favicon.ico`,
|
||||
robots: `${paths.publicPath}/robots.txt`,
|
||||
publicPath: "/",
|
||||
}),
|
||||
new webpack.ProgressPlugin(),
|
||||
new webpack.ProvidePlugin({
|
||||
|
||||
197
yarn.lock
197
yarn.lock
@ -1819,7 +1819,7 @@
|
||||
dependencies:
|
||||
"@hapi/hoek" "^9.0.0"
|
||||
|
||||
"@here-wallet/core@^1.4.3":
|
||||
"@here-wallet/core@1.4.3":
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/@here-wallet/core/-/core-1.4.3.tgz#371fcc2fe4140dd3e93106f367fb6715e487c431"
|
||||
integrity sha512-HtiAd1gMKxFzbnSualrzAw9CuoGWdY9z8aCY5fkpst+z7Fa5yVvBIg+f/6BWn2PFdxIWEnKk8V051FHEX/iYxA==
|
||||
@ -1935,15 +1935,15 @@
|
||||
dependencies:
|
||||
"@lit-labs/ssr-dom-shim" "^1.0.0"
|
||||
|
||||
"@metamask/detect-provider@^2.0.0":
|
||||
"@metamask/detect-provider@2.0.0":
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@metamask/detect-provider/-/detect-provider-2.0.0.tgz#4bc2795e5e6f7d8b84b2e845058d2f222c99917d"
|
||||
integrity sha512-sFpN+TX13E9fdBDh9lvQeZdJn4qYoRb/6QF2oZZK/Pn559IhCFacPMU1rMuqyXoFQF3JSJfii2l98B87QDPeCQ==
|
||||
|
||||
"@meteorwallet/sdk@^0.6.0":
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/@meteorwallet/sdk/-/sdk-0.6.0.tgz#006b77410a7874f0c9bfc0d693f199b561f39d19"
|
||||
integrity sha512-oriaQ1gk1hpQx6V6BxsvUthDd0Bpmv3ho5Ap5pm9P0euEosWtFUVF1dTYndJE10qBG8yLW+EOOX1LZ8taXCiRA==
|
||||
"@meteorwallet/sdk@0.8.0":
|
||||
version "0.8.0"
|
||||
resolved "https://registry.yarnpkg.com/@meteorwallet/sdk/-/sdk-0.8.0.tgz#913732c1c5210a05e008a3aedc664b16c728f682"
|
||||
integrity sha512-C0x9/20t+lCMUlKSPSAbPUWjz8Ls59NwWnz/qSJM5B4qCXN3OSCcrqmpbJpSVa2wCHFhK/HuOqaKlMCr0XsQ0w==
|
||||
dependencies:
|
||||
nanoid "3.3.4"
|
||||
query-string "^7.1.1"
|
||||
@ -2152,85 +2152,97 @@
|
||||
bn.js "5.2.1"
|
||||
borsh "^0.7.0"
|
||||
|
||||
"@near-wallet-selector/core@8.1.0", "@near-wallet-selector/core@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.1.0.tgz#9886df45272cdee8466c9b751eae4d55b104e6b1"
|
||||
integrity sha512-RqVAzVZchYiisCSSBjZjcQr+aZKpmi0tK27IiMrYoTAHUStTEN4DPOiIm4VuRXZlWI0Ciq74sIAjrsj34hlA/Q==
|
||||
"@near-wallet-selector/core@8.5.0", "@near-wallet-selector/core@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.5.0.tgz#291b9103c244d0ea1fb95401e81337e0eddb9e94"
|
||||
integrity sha512-uCwu1/K1Ybx7JRaf+3RgkAee/JTcfbw9pUBYV5JpGnSBW2WvAS0srAMSzEpMFdd0e/H8eoHSNxA9T5MrCXpQeA==
|
||||
dependencies:
|
||||
rxjs "^7.8.1"
|
||||
borsh "0.7.0"
|
||||
events "3.3.0"
|
||||
js-sha256 "0.9.0"
|
||||
rxjs "7.8.1"
|
||||
|
||||
"@near-wallet-selector/here-wallet@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/here-wallet/-/here-wallet-8.1.0.tgz#3a12b969971e0d48d1e7024380d688acfcd797df"
|
||||
integrity sha512-NzxS9JNjJB819qsSYxIsaV3MfUV7MlWap53eRIyKdq/w8ZCQJpnS09PxlusTFxUfPSalhBFkF+QOod3uHGhyGg==
|
||||
"@near-wallet-selector/here-wallet@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/here-wallet/-/here-wallet-8.5.0.tgz#3174339201c021c8de336b3b3dada15490ae4347"
|
||||
integrity sha512-XNgxMNYgUH2rky9WJNidjjRu1JDIe4A3zKbw/IJ0rHNAcD3PgSxfa09FqztDHfjOwympxycXgsJBqWhBhSrkQw==
|
||||
dependencies:
|
||||
"@here-wallet/core" "^1.4.3"
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
bn.js "^5.2.0"
|
||||
"@here-wallet/core" "1.4.3"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
bn.js "5.2.1"
|
||||
|
||||
"@near-wallet-selector/meteor-wallet@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/meteor-wallet/-/meteor-wallet-8.1.0.tgz#fa35661d43081220e0e0fa0f2891149d4a079d46"
|
||||
integrity sha512-aLqJCURE072l4oxXu7/dOW1QAN+xXXQ1rKJwbk716h1gZBngXReDY9h5YCseStUs0fLOWKkeRVaJhJ15EmPPVg==
|
||||
"@near-wallet-selector/meteor-wallet@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/meteor-wallet/-/meteor-wallet-8.5.0.tgz#bc584572f229420318714d174c5aebce95d11130"
|
||||
integrity sha512-Fd4CgMeHq2YIIK3H1qqUj4YkrZQMTQjQ0AjED84wFeb5YQO3B5v+QqYRAymu/0cW97mxonVjcauoJp8UoEOLAg==
|
||||
dependencies:
|
||||
"@meteorwallet/sdk" "^0.6.0"
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
"@near-wallet-selector/wallet-utils" "8.1.0"
|
||||
"@meteorwallet/sdk" "0.8.0"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
"@near-wallet-selector/wallet-utils" "8.5.0"
|
||||
|
||||
"@near-wallet-selector/modal-ui@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/modal-ui/-/modal-ui-8.1.0.tgz#377e6542577bbd0c0a9f3a6b2c5797b4d3570f3d"
|
||||
integrity sha512-TqxJQvWSZHkXPhyslbT7yUSPHM2W0wSCf/9zXdEhuvOjKMxfKl/p9G2wRLIZ8ZSZEwKJsaJGKoCa/FPVwmhItg==
|
||||
"@near-wallet-selector/modal-ui@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/modal-ui/-/modal-ui-8.5.0.tgz#79c073a276970b737362372193c80648af79a054"
|
||||
integrity sha512-ceepPtEP45xiD5JIq6OWs/68qPseEXgNhO4CRgbv9Y7PZFrUL18uiQSXpy56/eO0Nod4CXCGPuIuIdmRz+GrKw==
|
||||
dependencies:
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
copy-to-clipboard "^3.3.3"
|
||||
qrcode "^1.5.3"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
copy-to-clipboard "3.3.3"
|
||||
qrcode "1.5.3"
|
||||
react "18.2.0"
|
||||
react-dom "18.2.0"
|
||||
|
||||
"@near-wallet-selector/my-near-wallet@8.1.0", "@near-wallet-selector/my-near-wallet@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/my-near-wallet/-/my-near-wallet-8.1.0.tgz#c1c6a7fdd30f6d3e3ebb17fea66c4d7fadb47586"
|
||||
integrity sha512-QE2cU08LYDiX5LVL1aVLql3aY7GuJWasFiEa0J0HPjXWNNw/gjgouq5CbodtdR8nA/nQEyaIseWFSRjWUpynKQ==
|
||||
"@near-wallet-selector/my-near-wallet@8.5.0", "@near-wallet-selector/my-near-wallet@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/my-near-wallet/-/my-near-wallet-8.5.0.tgz#43a18ea03be9189a5a31e37f6dbc5c82dc7065fc"
|
||||
integrity sha512-dKK/IwBLMRe7RTp0e5bOa77CFnw54osyUVKUXPv8A8C8jliLwVBDgSSUv9+K3os/Xm6A2NUKLoHppgFRbsRVpA==
|
||||
dependencies:
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
"@near-wallet-selector/wallet-utils" "8.1.0"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
"@near-wallet-selector/wallet-utils" "8.5.0"
|
||||
|
||||
"@near-wallet-selector/near-wallet@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/near-wallet/-/near-wallet-8.1.0.tgz#21182d6d6adc3a22b981a3e72a4cbc5a4bbb5b62"
|
||||
integrity sha512-OkxVJs1908lQNMIWOxmxewhPVowv8SjCnnktlSBbmwoH+eJFZSPd2z23M9/FfgIpMIYWBpCcCMCQT52l2YImwg==
|
||||
"@near-wallet-selector/near-wallet@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/near-wallet/-/near-wallet-8.5.0.tgz#dd27c7bd3aabb94526d95ea0fb85218ec93628cf"
|
||||
integrity sha512-CC2sBjwbkHEGUChTB7MsscffW8Mm9nGJifaeYxokD6gxhiEeVsU/vTcKEE7hBVSr6861h677GWEZz9bCtTZUVA==
|
||||
dependencies:
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
"@near-wallet-selector/my-near-wallet" "8.1.0"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
"@near-wallet-selector/my-near-wallet" "8.5.0"
|
||||
|
||||
"@near-wallet-selector/neth@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/neth/-/neth-8.1.0.tgz#89a71a793b306defdef1f2343aa50911a1c121c9"
|
||||
integrity sha512-okHN1s823GxHuQufaxmKDhgtf4hH5Hism69TTgH5wLaeqvMyLQ1T27qlleoaL2eh821dtlZSWTqJDoXoSqW08A==
|
||||
"@near-wallet-selector/neth@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/neth/-/neth-8.5.0.tgz#c12d4195e513e9ed0c8bf5491391037c8f59a507"
|
||||
integrity sha512-poyKWUXi9CIeQ1fZWyH0J4o9HPoP/VElC6Wm2gTUygzmHAl0sH7eN5nj58CfE/nzHPlzUYgG3zMDIX8vL/5sPg==
|
||||
dependencies:
|
||||
"@metamask/detect-provider" "^2.0.0"
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
bn.js "^5.2.0"
|
||||
ethers "^5.7.2"
|
||||
is-mobile "^4.0.0"
|
||||
near-seed-phrase "^0.2.0"
|
||||
"@metamask/detect-provider" "2.0.0"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
bn.js "5.2.1"
|
||||
ethers "5.7.2"
|
||||
is-mobile "4.0.0"
|
||||
near-seed-phrase "0.2.0"
|
||||
|
||||
"@near-wallet-selector/sender@^8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/sender/-/sender-8.1.0.tgz#587f2e31135613aa19892d44b1dcdf201d3749b0"
|
||||
integrity sha512-ejyjKwtzPVNmb5WdCqS5D88o7iHMdcKzFzkxA1G2opbQeQJAQE0eWECOaIGvXkCP++R31YX+rmw4155Xp72sFw==
|
||||
"@near-wallet-selector/nightly@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/nightly/-/nightly-8.5.0.tgz#d9c1f202da508611c0fbd48bf09a7e8068ec61a5"
|
||||
integrity sha512-b2/EHCnOwL5YpcJomIcMTI+10LP+PFWS5xdkyP+Pbbj8PqutRgMlvTCwbkOdWHa2SrvYfPXHJA+aAvjuLpXfXQ==
|
||||
dependencies:
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
is-mobile "^4.0.0"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
"@near-wallet-selector/wallet-utils" "8.5.0"
|
||||
is-mobile "4.0.0"
|
||||
|
||||
"@near-wallet-selector/wallet-utils@8.1.0":
|
||||
version "8.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/wallet-utils/-/wallet-utils-8.1.0.tgz#b5e5051a90cb5d86107b6b5ce58d12db98e6d871"
|
||||
integrity sha512-G0UDCtSgZZTcQGzKzzCc0v0wsLXt7VRVS9VSdpwg0lElTlJqW7luvOMod3tKh2dauTVTRO5L/dzFLD8haq4Bww==
|
||||
"@near-wallet-selector/sender@^8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/sender/-/sender-8.5.0.tgz#540ed218e2d8088ca82f16afbede26bb064d32ff"
|
||||
integrity sha512-OoQFbpSVR2Uvp66GM+xUUbCIAFBEXfiqfdF2SLgd9maW8W14xmDCzlGsgkIvbU3OTSGNqzMNAETELyonxNVkpQ==
|
||||
dependencies:
|
||||
"@near-wallet-selector/core" "8.1.0"
|
||||
bn.js "^5.2.0"
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
is-mobile "4.0.0"
|
||||
|
||||
"@near-wallet-selector/wallet-utils@8.5.0":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@near-wallet-selector/wallet-utils/-/wallet-utils-8.5.0.tgz#52af3ac88d5b8bec1fb23113fad4ea6484dc01d5"
|
||||
integrity sha512-gcTBcnzmpHlUu6NMCRGBW/oi6FppTdvchG2X8J2iR8aiJC+8VxG8Mk9zFyjopLbLfk2WvUfo2klZ+PCfnuKqKg==
|
||||
dependencies:
|
||||
"@near-wallet-selector/core" "8.5.0"
|
||||
bn.js "5.2.1"
|
||||
|
||||
"@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3":
|
||||
version "2.1.8-no-fsevents.3"
|
||||
@ -4559,7 +4571,7 @@ bootstrap@^5.2.1:
|
||||
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.2.3.tgz#54739f4414de121b9785c5da3c87b37ff008322b"
|
||||
integrity sha512-cEKPM+fwb3cT8NzQZYEu4HilJ3anCrWqh3CHAok1p9jXqMPsPTBhU25fBckEJHJ/p+tTxTFTsFQGM+gaHpi3QQ==
|
||||
|
||||
borsh@^0.7.0:
|
||||
borsh@0.7.0, borsh@^0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a"
|
||||
integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==
|
||||
@ -5169,7 +5181,7 @@ cookie@0.5.0:
|
||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
|
||||
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
|
||||
|
||||
copy-to-clipboard@^3.3.1, copy-to-clipboard@^3.3.3:
|
||||
copy-to-clipboard@3.3.3, copy-to-clipboard@^3.3.1:
|
||||
version "3.3.3"
|
||||
resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0"
|
||||
integrity sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==
|
||||
@ -6062,7 +6074,7 @@ ethers@5.5.4:
|
||||
"@ethersproject/web" "5.5.1"
|
||||
"@ethersproject/wordlists" "5.5.0"
|
||||
|
||||
ethers@^5.7.2:
|
||||
ethers@5.7.2, ethers@^5.7.2:
|
||||
version "5.7.2"
|
||||
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e"
|
||||
integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==
|
||||
@ -6111,7 +6123,7 @@ eventemitter3@^4.0.0, eventemitter3@^4.0.7:
|
||||
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
|
||||
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==
|
||||
|
||||
events@^3.2.0, events@^3.3.0:
|
||||
events@3.3.0, events@^3.2.0, events@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
|
||||
integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==
|
||||
@ -7205,7 +7217,7 @@ is-map@^2.0.1, is-map@^2.0.2:
|
||||
resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127"
|
||||
integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==
|
||||
|
||||
is-mobile@^4.0.0:
|
||||
is-mobile@4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-4.0.0.tgz#bba396eb9656e2739afde3053d7191da310fc758"
|
||||
integrity sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew==
|
||||
@ -7416,7 +7428,7 @@ js-base64@^2.4.9:
|
||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.6.4.tgz#f4e686c5de1ea1f867dbcad3d46d969428df98c4"
|
||||
integrity sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==
|
||||
|
||||
js-sha256@^0.9.0:
|
||||
js-sha256@0.9.0, js-sha256@^0.9.0:
|
||||
version "0.9.0"
|
||||
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966"
|
||||
integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==
|
||||
@ -8546,9 +8558,34 @@ near-api-js@^2.1.3:
|
||||
node-fetch "^2.6.1"
|
||||
tweetnacl "^1.0.1"
|
||||
|
||||
<<<<<<< HEAD
|
||||
"near-flipside-vm@git+https://github.com/FlipsideCrypto/near-bos-vm":
|
||||
version "2.2.4"
|
||||
resolved "git+https://github.com/FlipsideCrypto/near-bos-vm#397bd2372d9701f10e22991c5eb9209af19c0adb"
|
||||
=======
|
||||
near-hd-key@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/near-hd-key/-/near-hd-key-1.2.1.tgz#f508ff15436cf8a439b543220f3cc72188a46756"
|
||||
integrity sha512-SIrthcL5Wc0sps+2e1xGj3zceEa68TgNZDLuCx0daxmfTP7sFTB3/mtE2pYhlFsCxWoMn+JfID5E1NlzvvbRJg==
|
||||
dependencies:
|
||||
bip39 "3.0.2"
|
||||
create-hmac "1.1.7"
|
||||
tweetnacl "1.0.3"
|
||||
|
||||
near-seed-phrase@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/near-seed-phrase/-/near-seed-phrase-0.2.0.tgz#fb7cf89682112b1160ab68abb50dc821f49be18a"
|
||||
integrity sha512-NpmrnejpY1AdlRpDZ0schJQJtfBaoUheRfiYtQpcq9TkwPgqKZCRULV5L3hHmLc0ep7KRtikbPQ9R2ztN/3cyQ==
|
||||
dependencies:
|
||||
bip39-light "^1.0.7"
|
||||
bs58 "^4.0.1"
|
||||
near-hd-key "^1.2.1"
|
||||
tweetnacl "^1.0.2"
|
||||
|
||||
"near-social-vm@git+https://github.com/NearSocial/VM.git#2.3.1":
|
||||
version "2.3.0"
|
||||
resolved "git+https://github.com/NearSocial/VM.git#7c5bfced7f7a816d9091b173980dccb7e4473c57"
|
||||
>>>>>>> upstream/master
|
||||
dependencies:
|
||||
"@braintree/sanitize-url" "6.0.0"
|
||||
"@flipsidecrypto/sdk" "^2.0.0"
|
||||
@ -9565,7 +9602,7 @@ qrcode@1.5.1:
|
||||
pngjs "^5.0.0"
|
||||
yargs "^15.3.1"
|
||||
|
||||
qrcode@^1.5.3:
|
||||
qrcode@1.5.3:
|
||||
version "1.5.3"
|
||||
resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.3.tgz#03afa80912c0dccf12bc93f615a535aad1066170"
|
||||
integrity sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==
|
||||
@ -10207,6 +10244,13 @@ run-parallel@^1.1.9:
|
||||
dependencies:
|
||||
queue-microtask "^1.2.2"
|
||||
|
||||
rxjs@7.8.1:
|
||||
version "7.8.1"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543"
|
||||
integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==
|
||||
dependencies:
|
||||
tslib "^2.1.0"
|
||||
|
||||
rxjs@^6.6.3:
|
||||
version "6.6.7"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9"
|
||||
@ -10221,13 +10265,6 @@ rxjs@^7.5.2, rxjs@^7.5.5:
|
||||
dependencies:
|
||||
tslib "^2.1.0"
|
||||
|
||||
rxjs@^7.8.1:
|
||||
version "7.8.1"
|
||||
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543"
|
||||
integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==
|
||||
dependencies:
|
||||
tslib "^2.1.0"
|
||||
|
||||
sade@^1.7.3, sade@^1.8.1:
|
||||
version "1.8.1"
|
||||
resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user