Compare commits
10 Commits
1f0f45e3f9
...
e3a8495c01
Author | SHA1 | Date | |
---|---|---|---|
e3a8495c01 | |||
ea07f91651 | |||
fb600afabc | |||
68790a4fbb | |||
723abea3d9 | |||
d46b5a052b | |||
![]() |
048fdf463b | ||
f8f07a02bb | |||
e9fd593468 | |||
f425830678 |
@ -12,10 +12,10 @@
|
|||||||
"defaultZapPoolFee": 1,
|
"defaultZapPoolFee": 1,
|
||||||
"features": {
|
"features": {
|
||||||
"analytics": true,
|
"analytics": true,
|
||||||
"subscriptions": true,
|
"subscriptions": false,
|
||||||
"deck": true,
|
"deck": false,
|
||||||
"zapPool": true,
|
"zapPool": false,
|
||||||
"communityLeaders": true,
|
"communityLeaders": false,
|
||||||
"nostrAddress": true,
|
"nostrAddress": true,
|
||||||
"pushNotifications": true
|
"pushNotifications": true
|
||||||
},
|
},
|
||||||
@ -41,17 +41,26 @@
|
|||||||
"eventLinkPrefix": "nevent",
|
"eventLinkPrefix": "nevent",
|
||||||
"profileLinkPrefix": "nprofile",
|
"profileLinkPrefix": "nprofile",
|
||||||
"defaultRelays": {
|
"defaultRelays": {
|
||||||
"wss://relay.snort.social/": { "read": true, "write": true },
|
"wss://relay.snort.social/": {
|
||||||
"wss://nostr.wine/": { "read": true, "write": false },
|
"read": true,
|
||||||
"wss://relay.damus.io/": { "read": true, "write": true },
|
"write": true
|
||||||
"wss://nos.lol/": { "read": true, "write": true }
|
},
|
||||||
|
"wss://nostr.wine/": {
|
||||||
|
"read": true,
|
||||||
|
"write": false
|
||||||
|
},
|
||||||
|
"wss://relay.damus.io/": {
|
||||||
|
"read": true,
|
||||||
|
"write": true
|
||||||
|
},
|
||||||
|
"wss://nos.lol/": {
|
||||||
|
"read": true,
|
||||||
|
"write": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"alby": {
|
"alby": {
|
||||||
"clientId": "pohiJjPhQR",
|
"clientId": "pohiJjPhQR",
|
||||||
"clientSecret": "GAl1YKLA3FveK1gLBYok"
|
"clientSecret": "GAl1YKLA3FveK1gLBYok"
|
||||||
},
|
},
|
||||||
"chatChannels": [
|
"chatChannels": []
|
||||||
{ "type": "telegram", "value": "https://t.me/irismessenger" },
|
|
||||||
{ "type": "nip28", "value": "23286a4602ada10cc10200553bff62a110e8dc0eacddf73277395a89ddf26a09" }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ export function Note(props: NoteProps) {
|
|||||||
const { data: ev, highlight, options: opt, ignoreModeration = false, className, waitUntilInView } = props;
|
const { data: ev, highlight, options: opt, ignoreModeration = false, className, waitUntilInView } = props;
|
||||||
const baseClassName = classNames("note min-h-[110px] flex flex-col gap-4 card", className ?? "");
|
const baseClassName = classNames("note min-h-[110px] flex flex-col gap-4 card", className ?? "");
|
||||||
const { isEventMuted } = useModeration();
|
const { isEventMuted } = useModeration();
|
||||||
const { ref, inView } = useInView({ triggerOnce: true, rootMargin: "2000px" });
|
const { ref, inView } = useInView({ triggerOnce: true });
|
||||||
const { ref: setSeenAtRef, inView: setSeenAtInView } = useInView({ rootMargin: "0px", threshold: 1 });
|
const { ref: setSeenAtRef, inView: setSeenAtInView } = useInView({ rootMargin: "0px", threshold: 1 });
|
||||||
const [showTranslation, setShowTranslation] = useState(true);
|
const [showTranslation, setShowTranslation] = useState(true);
|
||||||
const [translated, setTranslated] = useState<NoteTranslation | null>(translationCache.get(ev.id));
|
const [translated, setTranslated] = useState<NoteTranslation | null>(translationCache.get(ev.id));
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import "./SearchBox.css";
|
import "./SearchBox.css";
|
||||||
|
|
||||||
import { NostrLink, tryParseNostrLink } from "@snort/system";
|
import { NostrLink, tryParseNostrLink } from "@snort/system";
|
||||||
import { ChangeEvent, useEffect, useRef, useState } from "react";
|
import { ChangeEvent, useEffect, useMemo, useRef, useState } from "react";
|
||||||
import { FormattedMessage, useIntl } from "react-intl";
|
import { FormattedMessage, useIntl } from "react-intl";
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
@ -25,7 +25,8 @@ export default function SearchBox() {
|
|||||||
const [activeIndex, setActiveIndex] = useState<number>(-1);
|
const [activeIndex, setActiveIndex] = useState<number>(-1);
|
||||||
const resultListRef = useRef<HTMLDivElement | null>(null);
|
const resultListRef = useRef<HTMLDivElement | null>(null);
|
||||||
|
|
||||||
const results = useProfileSearch(search);
|
const searchFn = useProfileSearch();
|
||||||
|
const results = useMemo(() => searchFn(search), [search, searchFn]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleGlobalKeyDown = (e: KeyboardEvent) => {
|
const handleGlobalKeyDown = (e: KeyboardEvent) => {
|
||||||
|
@ -9,7 +9,7 @@ import TextareaAutosize from "react-textarea-autosize";
|
|||||||
import Avatar from "@/Components/User/Avatar";
|
import Avatar from "@/Components/User/Avatar";
|
||||||
import Nip05 from "@/Components/User/Nip05";
|
import Nip05 from "@/Components/User/Nip05";
|
||||||
import { FuzzySearchResult } from "@/Db/FuzzySearch";
|
import { FuzzySearchResult } from "@/Db/FuzzySearch";
|
||||||
import { userSearch } from "@/Hooks/useProfileSearch";
|
import useProfileSearch from "@/Hooks/useProfileSearch";
|
||||||
import searchEmoji from "@/Utils/emoji-search";
|
import searchEmoji from "@/Utils/emoji-search";
|
||||||
|
|
||||||
import messages from "../messages";
|
import messages from "../messages";
|
||||||
@ -58,6 +58,7 @@ interface TextareaProps {
|
|||||||
|
|
||||||
const Textarea = (props: TextareaProps) => {
|
const Textarea = (props: TextareaProps) => {
|
||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
|
const userSearch = useProfileSearch();
|
||||||
|
|
||||||
const userDataProvider = (token: string) => {
|
const userDataProvider = (token: string) => {
|
||||||
return userSearch(token).slice(0, 10);
|
return userSearch(token).slice(0, 10);
|
||||||
|
@ -22,7 +22,7 @@ export default function useLoginFeed() {
|
|||||||
const { publisher, system } = useEventPublisher();
|
const { publisher, system } = useEventPublisher();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
//system.checkSigs = checkSigs;
|
system.checkSigs = checkSigs;
|
||||||
}, [system, checkSigs]);
|
}, [system, checkSigs]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import fuzzySearch from "@/Db/FuzzySearch";
|
import fuzzySearch from "@/Db/FuzzySearch";
|
||||||
|
|
||||||
import useWoT from "./useWoT";
|
import useWoT, { WoT } from "./useWoT";
|
||||||
|
|
||||||
export default function useProfileSearch(search: string | undefined) {
|
export default function useProfileSearch() {
|
||||||
return userSearch(search);
|
const wot = useWoT();
|
||||||
|
return (search: string | undefined) => userSearch(wot, search);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function userSearch(search: string | undefined) {
|
function userSearch(wot: WoT, search: string | undefined) {
|
||||||
const wot = useWoT();
|
|
||||||
const searchString = search?.trim() ?? "";
|
const searchString = search?.trim() ?? "";
|
||||||
const fuseResults = (searchString?.length ?? 0) > 0 ? fuzzySearch.search(searchString) : [];
|
const fuseResults = (searchString?.length ?? 0) > 0 ? fuzzySearch.search(searchString) : [];
|
||||||
|
|
||||||
|
@ -1,28 +1,29 @@
|
|||||||
import { TaggedNostrEvent } from "@snort/system";
|
import { SystemInterface, TaggedNostrEvent } from "@snort/system";
|
||||||
import { SnortContext } from "@snort/system-react";
|
import { SnortContext } from "@snort/system-react";
|
||||||
import { useContext, useMemo } from "react";
|
import { useContext, useMemo } from "react";
|
||||||
|
|
||||||
|
export interface WoT {
|
||||||
|
sortEvents: (events: Array<TaggedNostrEvent>) => Array<TaggedNostrEvent>;
|
||||||
|
sortPubkeys: (events: Array<string>) => Array<string>;
|
||||||
|
followDistance: (pk: string) => number;
|
||||||
|
followedByCount: (pk: string) => number;
|
||||||
|
followedBy: (pk: string) => Set<string>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function wotOnSystem(system: SystemInterface) {
|
||||||
|
const sgi = system.config.socialGraphInstance;
|
||||||
|
return {
|
||||||
|
sortEvents: (events: Array<TaggedNostrEvent>) =>
|
||||||
|
events.sort((a, b) => sgi.getFollowDistance(a.pubkey) - sgi.getFollowDistance(b.pubkey)),
|
||||||
|
sortPubkeys: (events: Array<string>) => events.sort((a, b) => sgi.getFollowDistance(a) - sgi.getFollowDistance(b)),
|
||||||
|
followDistance: (pk: string) => sgi.getFollowDistance(pk),
|
||||||
|
followedByCount: (pk: string) => sgi.followedByFriendsCount(pk),
|
||||||
|
followedBy: (pk: string) => sgi.followedByFriends(pk),
|
||||||
|
instance: sgi,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default function useWoT() {
|
export default function useWoT() {
|
||||||
const system = useContext(SnortContext);
|
const system = useContext(SnortContext);
|
||||||
return useMemo(
|
return useMemo<WoT>(() => wotOnSystem(system), [system]);
|
||||||
() => ({
|
|
||||||
sortEvents: (events: Array<TaggedNostrEvent>) =>
|
|
||||||
events.sort(
|
|
||||||
(a, b) =>
|
|
||||||
system.config.socialGraphInstance.getFollowDistance(a.pubkey) -
|
|
||||||
system.config.socialGraphInstance.getFollowDistance(b.pubkey),
|
|
||||||
),
|
|
||||||
sortPubkeys: (events: Array<string>) =>
|
|
||||||
events.sort(
|
|
||||||
(a, b) =>
|
|
||||||
system.config.socialGraphInstance.getFollowDistance(a) -
|
|
||||||
system.config.socialGraphInstance.getFollowDistance(b),
|
|
||||||
),
|
|
||||||
followDistance: (pk: string) => system.config.socialGraphInstance.getFollowDistance(pk),
|
|
||||||
followedByCount: (pk: string) => system.config.socialGraphInstance.followedByFriendsCount(pk),
|
|
||||||
followedBy: (pk: string) => system.config.socialGraphInstance.followedByFriends(pk),
|
|
||||||
instance: system.config.socialGraphInstance,
|
|
||||||
}),
|
|
||||||
[system.config.socialGraphInstance],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,8 @@ const NOTES = 0;
|
|||||||
const PROFILES = 1;
|
const PROFILES = 1;
|
||||||
|
|
||||||
const Profiles = ({ keyword }: { keyword: string }) => {
|
const Profiles = ({ keyword }: { keyword: string }) => {
|
||||||
const results = useProfileSearch(keyword);
|
const searchFn = useProfileSearch();
|
||||||
|
const results = useMemo(() => searchFn(keyword), [keyword, searchFn]);
|
||||||
const ids = useMemo(() => results.map(r => r.pubkey), [results]);
|
const ids = useMemo(() => results.map(r => r.pubkey), [results]);
|
||||||
const content = keyword ? (
|
const content = keyword ? (
|
||||||
<FollowListBase
|
<FollowListBase
|
||||||
|
@ -2,16 +2,17 @@ import "./index.css";
|
|||||||
import "@szhsin/react-menu/dist/index.css";
|
import "@szhsin/react-menu/dist/index.css";
|
||||||
import "@/assets/fonts/inter.css";
|
import "@/assets/fonts/inter.css";
|
||||||
|
|
||||||
import { unixNowMs } from "@snort/shared";
|
import { unixNow, unixNowMs } from "@snort/shared";
|
||||||
import { EventBuilder } from "@snort/system";
|
import { EventBuilder } from "@snort/system";
|
||||||
import { SnortContext } from "@snort/system-react";
|
import { SnortContext } from "@snort/system-react";
|
||||||
import { StrictMode } from "react";
|
import { StrictMode } from "react";
|
||||||
import * as ReactDOM from "react-dom/client";
|
import * as ReactDOM from "react-dom/client";
|
||||||
import { createBrowserRouter, RouteObject, RouterProvider } from "react-router-dom";
|
import { createBrowserRouter, RouteObject, RouterProvider } from "react-router-dom";
|
||||||
|
|
||||||
import { preload, UserCache } from "@/Cache";
|
import { initRelayWorker, preload, Relay, UserCache } from "@/Cache";
|
||||||
import { ThreadRoute } from "@/Components/Event/Thread/ThreadRoute";
|
import { ThreadRoute } from "@/Components/Event/Thread/ThreadRoute";
|
||||||
import { IntlProvider } from "@/Components/IntlProvider/IntlProvider";
|
import { IntlProvider } from "@/Components/IntlProvider/IntlProvider";
|
||||||
|
import { db } from "@/Db";
|
||||||
import { addCachedMetadataToFuzzySearch } from "@/Db/FuzzySearch";
|
import { addCachedMetadataToFuzzySearch } from "@/Db/FuzzySearch";
|
||||||
import { AboutPage } from "@/Pages/About";
|
import { AboutPage } from "@/Pages/About";
|
||||||
import { DebugPage } from "@/Pages/CacheDebug";
|
import { DebugPage } from "@/Pages/CacheDebug";
|
||||||
@ -39,6 +40,7 @@ import { WalletSendPage } from "@/Pages/wallet/send";
|
|||||||
import ZapPoolPage from "@/Pages/ZapPool/ZapPool";
|
import ZapPoolPage from "@/Pages/ZapPool/ZapPool";
|
||||||
import { System } from "@/system";
|
import { System } from "@/system";
|
||||||
import { storeRefCode, unwrap } from "@/Utils";
|
import { storeRefCode, unwrap } from "@/Utils";
|
||||||
|
import { hasWasm, wasmInit, WasmPath } from "@/Utils/wasm";
|
||||||
import { Wallets } from "@/Wallet";
|
import { Wallets } from "@/Wallet";
|
||||||
import { setupWebLNWalletConfig } from "@/Wallet";
|
import { setupWebLNWalletConfig } from "@/Wallet";
|
||||||
|
|
||||||
@ -52,10 +54,14 @@ async function initSite() {
|
|||||||
"31990:84de35e2584d2b144aae823c9ed0b0f3deda09648530b93d1a2a146d1dea9864:app-profile",
|
"31990:84de35e2584d2b144aae823c9ed0b0f3deda09648530b93d1a2a146d1dea9864:app-profile",
|
||||||
];
|
];
|
||||||
storeRefCode();
|
storeRefCode();
|
||||||
|
if (hasWasm) {
|
||||||
|
await wasmInit(WasmPath);
|
||||||
|
await initRelayWorker();
|
||||||
|
}
|
||||||
|
|
||||||
setupWebLNWalletConfig(Wallets);
|
setupWebLNWalletConfig(Wallets);
|
||||||
|
|
||||||
//db.ready = await db.isAvailable();
|
db.ready = await db.isAvailable();
|
||||||
|
|
||||||
const login = LoginStore.snapshot();
|
const login = LoginStore.snapshot();
|
||||||
preload(login.state.follows).then(async () => {
|
preload(login.state.follows).then(async () => {
|
||||||
@ -78,7 +84,7 @@ async function initSite() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
//Relay.delete(["REQ", "cleanup", { kinds: [1, 7, 9735], until: unixNow() - Day * 30 }]);
|
Relay.delete(["REQ", "cleanup", { kinds: [1, 7, 9735], until: unixNow() - Day * 30 }]);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,25 @@
|
|||||||
import { removeUndefined, throwIfOffline } from "@snort/shared";
|
import { removeUndefined, throwIfOffline } from "@snort/shared";
|
||||||
import { mapEventToProfile, NostrEvent, NostrSystem } from "@snort/system";
|
import { mapEventToProfile, NostrEvent, NostrSystem } from "@snort/system";
|
||||||
|
|
||||||
|
import { EventsCache, Relay, RelayMetrics, SystemDb, UserCache, UserFollows, UserRelays } from "@/Cache";
|
||||||
import { addEventToFuzzySearch } from "@/Db/FuzzySearch";
|
import { addEventToFuzzySearch } from "@/Db/FuzzySearch";
|
||||||
import { LoginStore } from "@/Utils/Login";
|
import { LoginStore } from "@/Utils/Login";
|
||||||
|
import { hasWasm, WasmOptimizer } from "@/Utils/wasm";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton nostr system
|
* Singleton nostr system
|
||||||
*/
|
*/
|
||||||
export const System = new NostrSystem({
|
export const System = new NostrSystem({
|
||||||
//relays: UserRelays,
|
relays: UserRelays,
|
||||||
//events: EventsCache,
|
events: EventsCache,
|
||||||
//profiles: UserCache,
|
profiles: UserCache,
|
||||||
//relayMetrics: RelayMetrics,
|
relayMetrics: RelayMetrics,
|
||||||
//cachingRelay: Relay,
|
cachingRelay: Relay,
|
||||||
//contactLists: UserFollows,
|
contactLists: UserFollows,
|
||||||
//optimizer: hasWasm ? WasmOptimizer : undefined,
|
optimizer: hasWasm ? WasmOptimizer : undefined,
|
||||||
//db: SystemDb,
|
db: SystemDb,
|
||||||
buildFollowGraph: true,
|
buildFollowGraph: true,
|
||||||
automaticOutboxModel: true,
|
automaticOutboxModel: true,
|
||||||
checkSigs: false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
System.on("auth", async (c, r, cb) => {
|
System.on("auth", async (c, r, cb) => {
|
||||||
@ -30,8 +31,8 @@ System.on("auth", async (c, r, cb) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
System.on("event", (_, ev) => {
|
System.on("event", (_, ev) => {
|
||||||
//EventsCache.discover(ev);
|
EventsCache.discover(ev);
|
||||||
//UserCache.discover(ev);
|
UserCache.discover(ev);
|
||||||
addEventToFuzzySearch(ev);
|
addEventToFuzzySearch(ev);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/system-react",
|
"name": "@snort/system-react",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "React hooks for @snort/system",
|
"description": "React hooks for @snort/system",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "src/index.ts",
|
"module": "src/index.ts",
|
||||||
@ -17,7 +17,7 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@snort/shared": "^1.0.17",
|
"@snort/shared": "^1.0.17",
|
||||||
"@snort/system": "^1.6.0",
|
"@snort/system": "^1.6.1",
|
||||||
"react": "^18.2.0"
|
"react": "^18.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -31,7 +31,7 @@ export function useReactions(
|
|||||||
}
|
}
|
||||||
others?.(rb);
|
others?.(rb);
|
||||||
return rb;
|
return rb;
|
||||||
}, [ids]);
|
}, [ids, others]);
|
||||||
|
|
||||||
return useRequestBuilder(sub);
|
return useRequestBuilder(sub);
|
||||||
}
|
}
|
||||||
|
210
packages/system-wasm/Cargo.lock
generated
210
packages/system-wasm/Cargo.lock
generated
@ -1,6 +1,6 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 4
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
@ -19,15 +19,21 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anstyle"
|
name = "anstyle"
|
||||||
version = "1.0.8"
|
version = "1.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1"
|
checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrayvec"
|
||||||
|
version = "0.7.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.82"
|
version = "0.1.85"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1"
|
checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -36,9 +42,25 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.3.0"
|
version = "1.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitcoin-io"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitcoin_hashes"
|
||||||
|
version = "0.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16"
|
||||||
|
dependencies = [
|
||||||
|
"bitcoin-io",
|
||||||
|
"hex-conservative",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block-buffer"
|
name = "block-buffer"
|
||||||
@ -63,9 +85,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytes"
|
name = "bytes"
|
||||||
version = "1.7.1"
|
version = "1.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
|
checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cast"
|
name = "cast"
|
||||||
@ -75,9 +97,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.1.18"
|
version = "1.2.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476"
|
checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"shlex",
|
"shlex",
|
||||||
]
|
]
|
||||||
@ -117,18 +139,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.17"
|
version = "4.5.26"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac"
|
checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.17"
|
version = "4.5.26"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73"
|
checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"clap_lex",
|
"clap_lex",
|
||||||
@ -136,9 +158,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_lex"
|
name = "clap_lex"
|
||||||
version = "0.7.2"
|
version = "0.7.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97"
|
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "console_error_panic_hook"
|
name = "console_error_panic_hook"
|
||||||
@ -152,9 +174,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cpufeatures"
|
name = "cpufeatures"
|
||||||
version = "0.2.14"
|
version = "0.2.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0"
|
checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@ -197,9 +219,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-deque"
|
name = "crossbeam-deque"
|
||||||
version = "0.8.5"
|
version = "0.8.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d"
|
checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossbeam-epoch",
|
"crossbeam-epoch",
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
@ -216,9 +238,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-utils"
|
name = "crossbeam-utils"
|
||||||
version = "0.8.20"
|
version = "0.8.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80"
|
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crunchy"
|
name = "crunchy"
|
||||||
@ -295,6 +317,15 @@ version = "0.4.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hex-conservative"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd"
|
||||||
|
dependencies = [
|
||||||
|
"arrayvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is-terminal"
|
name = "is-terminal"
|
||||||
version = "0.4.13"
|
version = "0.4.13"
|
||||||
@ -317,39 +348,40 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
version = "0.13.0"
|
version = "0.14.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.11"
|
version = "1.0.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.70"
|
version = "0.3.77"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a"
|
checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"once_cell",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.158"
|
version = "0.2.169"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439"
|
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.22"
|
version = "0.4.25"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
@ -359,9 +391,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minicov"
|
name = "minicov"
|
||||||
version = "0.3.5"
|
version = "0.3.7"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5c71e683cd655513b99affab7d317deb690528255a0d5f717f1024093c12b169"
|
checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
@ -378,9 +410,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.19.0"
|
version = "1.20.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oorandom"
|
name = "oorandom"
|
||||||
@ -427,18 +459,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.86"
|
version = "1.0.93"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
|
checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.37"
|
version = "1.0.38"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@ -495,9 +527,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.10.6"
|
version = "1.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
|
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@ -507,9 +539,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-automata"
|
name = "regex-automata"
|
||||||
version = "0.4.7"
|
version = "0.4.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
|
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@ -518,9 +550,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.8.4"
|
version = "0.8.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
|
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustversion"
|
||||||
|
version = "1.0.19"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
@ -537,18 +575,14 @@ dependencies = [
|
|||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "scoped-tls"
|
|
||||||
version = "1.0.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "secp256k1"
|
name = "secp256k1"
|
||||||
version = "0.29.1"
|
version = "0.30.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
|
checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bitcoin_hashes",
|
||||||
|
"rand",
|
||||||
"secp256k1-sys",
|
"secp256k1-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -563,9 +597,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.210"
|
version = "1.0.217"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
|
checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
@ -583,9 +617,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.210"
|
version = "1.0.217"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
|
checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -594,9 +628,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.128"
|
version = "1.0.137"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8"
|
checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"memchr",
|
"memchr",
|
||||||
@ -635,9 +669,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.77"
|
version = "2.0.96"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
|
checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -651,7 +685,7 @@ dependencies = [
|
|||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
"criterion",
|
"criterion",
|
||||||
"hex",
|
"hex",
|
||||||
"itertools 0.13.0",
|
"itertools 0.14.0",
|
||||||
"rand",
|
"rand",
|
||||||
"secp256k1",
|
"secp256k1",
|
||||||
"serde",
|
"serde",
|
||||||
@ -680,9 +714,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.13"
|
version = "1.0.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version_check"
|
name = "version_check"
|
||||||
@ -708,24 +742,24 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen"
|
name = "wasm-bindgen"
|
||||||
version = "0.2.93"
|
version = "0.2.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5"
|
checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
"rustversion",
|
||||||
"wasm-bindgen-macro",
|
"wasm-bindgen-macro",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-backend"
|
name = "wasm-bindgen-backend"
|
||||||
version = "0.2.93"
|
version = "0.2.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
|
checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bumpalo",
|
"bumpalo",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
"syn",
|
||||||
@ -734,21 +768,22 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-futures"
|
name = "wasm-bindgen-futures"
|
||||||
version = "0.4.43"
|
version = "0.4.50"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed"
|
checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
|
"once_cell",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro"
|
name = "wasm-bindgen-macro"
|
||||||
version = "0.2.93"
|
version = "0.2.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
|
checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"wasm-bindgen-macro-support",
|
"wasm-bindgen-macro-support",
|
||||||
@ -756,9 +791,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-macro-support"
|
name = "wasm-bindgen-macro-support"
|
||||||
version = "0.2.93"
|
version = "0.2.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
|
checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -769,20 +804,21 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-shared"
|
name = "wasm-bindgen-shared"
|
||||||
version = "0.2.93"
|
version = "0.2.100"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
|
checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-test"
|
name = "wasm-bindgen-test"
|
||||||
version = "0.3.43"
|
version = "0.3.50"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "68497a05fb21143a08a7d24fc81763384a3072ee43c44e86aad1744d6adef9d9"
|
checksum = "66c8d5e33ca3b6d9fa3b4676d774c5778031d27a578c2b007f905acf816152c3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console_error_panic_hook",
|
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"minicov",
|
"minicov",
|
||||||
"scoped-tls",
|
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
"wasm-bindgen-test-macro",
|
"wasm-bindgen-test-macro",
|
||||||
@ -790,9 +826,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasm-bindgen-test-macro"
|
name = "wasm-bindgen-test-macro"
|
||||||
version = "0.3.43"
|
version = "0.3.50"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4b8220be1fa9e4c889b30fd207d4906657e7e90b12e0e6b0c8b8d8709f5de021"
|
checksum = "17d5042cc5fa009658f9a7333ef24291b1291a25b6382dd68862a7f3b969f69b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -801,9 +837,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "web-sys"
|
name = "web-sys"
|
||||||
version = "0.3.70"
|
version = "0.3.77"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0"
|
checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
|
@ -10,8 +10,8 @@ crate-type = ["cdylib", "rlib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
console_error_panic_hook = "0.1.7"
|
console_error_panic_hook = "0.1.7"
|
||||||
hex = { version = "0.4.3", features = [], default-features = false }
|
hex = { version = "0.4.3", features = [], default-features = false }
|
||||||
itertools = "0.13.0"
|
itertools = "0.14.0"
|
||||||
secp256k1 = { version = "0.29.0", features = ["global-context"] }
|
secp256k1 = { version = "0.30.0", features = ["global-context"] }
|
||||||
serde = { version = "1.0.188", features = ["derive"], default-features = false }
|
serde = { version = "1.0.188", features = ["derive"], default-features = false }
|
||||||
serde-wasm-bindgen = "0.6.5"
|
serde-wasm-bindgen = "0.6.5"
|
||||||
serde_json = "1.0.105"
|
serde_json = "1.0.105"
|
||||||
|
62
packages/system-wasm/pkg/system_wasm.d.ts
vendored
62
packages/system-wasm/pkg/system_wasm.d.ts
vendored
@ -1,72 +1,38 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
|
||||||
* @param {any} prev
|
|
||||||
* @param {any} next
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function diff_filters(prev: any, next: any): any;
|
export function diff_filters(prev: any, next: any): any;
|
||||||
/**
|
|
||||||
* @param {any} val
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function expand_filter(val: any): any;
|
export function expand_filter(val: any): any;
|
||||||
/**
|
|
||||||
* @param {any} prev
|
|
||||||
* @param {any} next
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function get_diff(prev: any, next: any): any;
|
export function get_diff(prev: any, next: any): any;
|
||||||
/**
|
|
||||||
* @param {any} val
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function flat_merge(val: any): any;
|
export function flat_merge(val: any): any;
|
||||||
/**
|
|
||||||
* @param {any} val
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function compress(val: any): any;
|
export function compress(val: any): any;
|
||||||
/**
|
|
||||||
* @param {any} val
|
|
||||||
* @param {any} target
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function pow(val: any, target: any): any;
|
export function pow(val: any, target: any): any;
|
||||||
/**
|
|
||||||
* @param {any} hash
|
|
||||||
* @param {any} sig
|
|
||||||
* @param {any} pub_key
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
export function schnorr_verify(hash: any, sig: any, pub_key: any): boolean;
|
export function schnorr_verify(hash: any, sig: any, pub_key: any): boolean;
|
||||||
/**
|
|
||||||
* @param {any} event
|
|
||||||
* @returns {boolean}
|
|
||||||
*/
|
|
||||||
export function schnorr_verify_event(event: any): boolean;
|
export function schnorr_verify_event(event: any): boolean;
|
||||||
|
|
||||||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||||
|
|
||||||
export interface InitOutput {
|
export interface InitOutput {
|
||||||
readonly memory: WebAssembly.Memory;
|
readonly memory: WebAssembly.Memory;
|
||||||
readonly diff_filters: (a: number, b: number, c: number) => void;
|
readonly diff_filters: (a: any, b: any) => [number, number, number];
|
||||||
readonly expand_filter: (a: number, b: number) => void;
|
readonly expand_filter: (a: any) => [number, number, number];
|
||||||
readonly get_diff: (a: number, b: number, c: number) => void;
|
readonly get_diff: (a: any, b: any) => [number, number, number];
|
||||||
readonly flat_merge: (a: number, b: number) => void;
|
readonly flat_merge: (a: any) => [number, number, number];
|
||||||
readonly compress: (a: number, b: number) => void;
|
readonly compress: (a: any) => [number, number, number];
|
||||||
readonly pow: (a: number, b: number, c: number) => void;
|
readonly pow: (a: any, b: any) => [number, number, number];
|
||||||
readonly schnorr_verify: (a: number, b: number, c: number, d: number) => void;
|
readonly schnorr_verify: (a: any, b: any, c: any) => [number, number, number];
|
||||||
readonly schnorr_verify_event: (a: number, b: number) => void;
|
readonly schnorr_verify_event: (a: any) => [number, number, number];
|
||||||
readonly rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
readonly rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
||||||
readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
||||||
readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
||||||
readonly rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
readonly rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
||||||
|
readonly __wbindgen_exn_store: (a: number) => void;
|
||||||
|
readonly __externref_table_alloc: () => number;
|
||||||
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
||||||
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
||||||
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
||||||
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
||||||
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
readonly __externref_table_dealloc: (a: number) => void;
|
||||||
readonly __wbindgen_exn_store: (a: number) => void;
|
readonly __wbindgen_start: () => void;
|
||||||
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
||||||
|
@ -1,28 +1,32 @@
|
|||||||
let wasm;
|
let wasm;
|
||||||
|
|
||||||
const heap = new Array(128).fill(undefined);
|
function addToExternrefTable0(obj) {
|
||||||
|
const idx = wasm.__externref_table_alloc();
|
||||||
heap.push(undefined, null, true, false);
|
wasm.__wbindgen_export_2.set(idx, obj);
|
||||||
|
return idx;
|
||||||
function getObject(idx) {
|
|
||||||
return heap[idx];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let heap_next = heap.length;
|
function handleError(f, args) {
|
||||||
|
try {
|
||||||
function dropObject(idx) {
|
return f.apply(this, args);
|
||||||
if (idx < 132) return;
|
} catch (e) {
|
||||||
heap[idx] = heap_next;
|
const idx = addToExternrefTable0(e);
|
||||||
heap_next = idx;
|
wasm.__wbindgen_exn_store(idx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function takeObject(idx) {
|
const cachedTextDecoder =
|
||||||
const ret = getObject(idx);
|
typeof TextDecoder !== "undefined"
|
||||||
dropObject(idx);
|
? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true })
|
||||||
return ret;
|
: {
|
||||||
}
|
decode: () => {
|
||||||
|
throw Error("TextDecoder not available");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
let WASM_VECTOR_LEN = 0;
|
if (typeof TextDecoder !== "undefined") {
|
||||||
|
cachedTextDecoder.decode();
|
||||||
|
}
|
||||||
|
|
||||||
let cachedUint8ArrayMemory0 = null;
|
let cachedUint8ArrayMemory0 = null;
|
||||||
|
|
||||||
@ -33,6 +37,13 @@ function getUint8ArrayMemory0() {
|
|||||||
return cachedUint8ArrayMemory0;
|
return cachedUint8ArrayMemory0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getStringFromWasm0(ptr, len) {
|
||||||
|
ptr = ptr >>> 0;
|
||||||
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
||||||
|
}
|
||||||
|
|
||||||
|
let WASM_VECTOR_LEN = 0;
|
||||||
|
|
||||||
const cachedTextEncoder =
|
const cachedTextEncoder =
|
||||||
typeof TextEncoder !== "undefined"
|
typeof TextEncoder !== "undefined"
|
||||||
? new TextEncoder("utf-8")
|
? new TextEncoder("utf-8")
|
||||||
@ -96,10 +107,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLikeNone(x) {
|
|
||||||
return x === undefined || x === null;
|
|
||||||
}
|
|
||||||
|
|
||||||
let cachedDataViewMemory0 = null;
|
let cachedDataViewMemory0 = null;
|
||||||
|
|
||||||
function getDataViewMemory0() {
|
function getDataViewMemory0() {
|
||||||
@ -113,31 +120,8 @@ function getDataViewMemory0() {
|
|||||||
return cachedDataViewMemory0;
|
return cachedDataViewMemory0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function addHeapObject(obj) {
|
function isLikeNone(x) {
|
||||||
if (heap_next === heap.length) heap.push(heap.length + 1);
|
return x === undefined || x === null;
|
||||||
const idx = heap_next;
|
|
||||||
heap_next = heap[idx];
|
|
||||||
|
|
||||||
heap[idx] = obj;
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cachedTextDecoder =
|
|
||||||
typeof TextDecoder !== "undefined"
|
|
||||||
? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true })
|
|
||||||
: {
|
|
||||||
decode: () => {
|
|
||||||
throw Error("TextDecoder not available");
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (typeof TextDecoder !== "undefined") {
|
|
||||||
cachedTextDecoder.decode();
|
|
||||||
}
|
|
||||||
|
|
||||||
function getStringFromWasm0(ptr, len) {
|
|
||||||
ptr = ptr >>> 0;
|
|
||||||
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function debugString(val) {
|
function debugString(val) {
|
||||||
@ -181,7 +165,7 @@ function debugString(val) {
|
|||||||
// Test for built-in
|
// Test for built-in
|
||||||
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
||||||
let className;
|
let className;
|
||||||
if (builtInMatches.length > 1) {
|
if (builtInMatches && builtInMatches.length > 1) {
|
||||||
className = builtInMatches[1];
|
className = builtInMatches[1];
|
||||||
} else {
|
} else {
|
||||||
// Failed to match the standard '[object ClassName]'
|
// Failed to match the standard '[object ClassName]'
|
||||||
@ -204,25 +188,23 @@ function debugString(val) {
|
|||||||
// TODO we could test for more things here, like `Set`s and `Map`s.
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
||||||
return className;
|
return className;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function takeFromExternrefTable0(idx) {
|
||||||
|
const value = wasm.__wbindgen_export_2.get(idx);
|
||||||
|
wasm.__externref_table_dealloc(idx);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @param {any} prev
|
* @param {any} prev
|
||||||
* @param {any} next
|
* @param {any} next
|
||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export function diff_filters(prev, next) {
|
export function diff_filters(prev, next) {
|
||||||
try {
|
const ret = wasm.diff_filters(prev, next);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.diff_filters(retptr, addHeapObject(prev), addHeapObject(next));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return takeObject(r0);
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return takeFromExternrefTable0(ret[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -230,19 +212,11 @@ export function diff_filters(prev, next) {
|
|||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export function expand_filter(val) {
|
export function expand_filter(val) {
|
||||||
try {
|
const ret = wasm.expand_filter(val);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.expand_filter(retptr, addHeapObject(val));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return takeObject(r0);
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return takeFromExternrefTable0(ret[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -251,19 +225,11 @@ export function expand_filter(val) {
|
|||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export function get_diff(prev, next) {
|
export function get_diff(prev, next) {
|
||||||
try {
|
const ret = wasm.get_diff(prev, next);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.get_diff(retptr, addHeapObject(prev), addHeapObject(next));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return takeObject(r0);
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return takeFromExternrefTable0(ret[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -271,19 +237,11 @@ export function get_diff(prev, next) {
|
|||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export function flat_merge(val) {
|
export function flat_merge(val) {
|
||||||
try {
|
const ret = wasm.flat_merge(val);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.flat_merge(retptr, addHeapObject(val));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return takeObject(r0);
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return takeFromExternrefTable0(ret[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -291,19 +249,11 @@ export function flat_merge(val) {
|
|||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export function compress(val) {
|
export function compress(val) {
|
||||||
try {
|
const ret = wasm.compress(val);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.compress(retptr, addHeapObject(val));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return takeObject(r0);
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return takeFromExternrefTable0(ret[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -312,19 +262,11 @@ export function compress(val) {
|
|||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
export function pow(val, target) {
|
export function pow(val, target) {
|
||||||
try {
|
const ret = wasm.pow(val, target);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.pow(retptr, addHeapObject(val), addHeapObject(target));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return takeObject(r0);
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return takeFromExternrefTable0(ret[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -334,19 +276,11 @@ export function pow(val, target) {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export function schnorr_verify(hash, sig, pub_key) {
|
export function schnorr_verify(hash, sig, pub_key) {
|
||||||
try {
|
const ret = wasm.schnorr_verify(hash, sig, pub_key);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.schnorr_verify(retptr, addHeapObject(hash), addHeapObject(sig), addHeapObject(pub_key));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return r0 !== 0;
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
}
|
||||||
|
return ret[0] !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -354,27 +288,11 @@ export function schnorr_verify(hash, sig, pub_key) {
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export function schnorr_verify_event(event) {
|
export function schnorr_verify_event(event) {
|
||||||
try {
|
const ret = wasm.schnorr_verify_event(event);
|
||||||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
if (ret[2]) {
|
||||||
wasm.schnorr_verify_event(retptr, addHeapObject(event));
|
throw takeFromExternrefTable0(ret[1]);
|
||||||
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
||||||
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
||||||
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
||||||
if (r2) {
|
|
||||||
throw takeObject(r1);
|
|
||||||
}
|
|
||||||
return r0 !== 0;
|
|
||||||
} finally {
|
|
||||||
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleError(f, args) {
|
|
||||||
try {
|
|
||||||
return f.apply(this, args);
|
|
||||||
} catch (e) {
|
|
||||||
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
||||||
}
|
}
|
||||||
|
return ret[0] !== 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function __wbg_load(module, imports) {
|
async function __wbg_load(module, imports) {
|
||||||
@ -385,7 +303,7 @@ async function __wbg_load(module, imports) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (module.headers.get("Content-Type") != "application/wasm") {
|
if (module.headers.get("Content-Type") != "application/wasm") {
|
||||||
console.warn(
|
console.warn(
|
||||||
"`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",
|
"`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -410,196 +328,21 @@ async function __wbg_load(module, imports) {
|
|||||||
function __wbg_get_imports() {
|
function __wbg_get_imports() {
|
||||||
const imports = {};
|
const imports = {};
|
||||||
imports.wbg = {};
|
imports.wbg = {};
|
||||||
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function (arg0) {
|
||||||
takeObject(arg0);
|
const ret = arg0.buffer;
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_string_get = function (arg0, arg1) {
|
|
||||||
const obj = getObject(arg1);
|
|
||||||
const ret = typeof obj === "string" ? obj : undefined;
|
|
||||||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
||||||
var len1 = WASM_VECTOR_LEN;
|
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_is_object = function (arg0) {
|
|
||||||
const val = getObject(arg0);
|
|
||||||
const ret = typeof val === "object" && val !== null;
|
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
imports.wbg.__wbindgen_is_undefined = function (arg0) {
|
imports.wbg.__wbg_call_672a4d21634d4a24 = function () {
|
||||||
const ret = getObject(arg0) === undefined;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_in = function (arg0, arg1) {
|
|
||||||
const ret = getObject(arg0) in getObject(arg1);
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_is_bigint = function (arg0) {
|
|
||||||
const ret = typeof getObject(arg0) === "bigint";
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
|
||||||
const ret = BigInt.asUintN(64, arg0);
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) {
|
|
||||||
const ret = getObject(arg0) === getObject(arg1);
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_error_new = function (arg0, arg1) {
|
|
||||||
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
|
||||||
const ret = getObject(arg0) == getObject(arg1);
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_boolean_get = function (arg0) {
|
|
||||||
const v = getObject(arg0);
|
|
||||||
const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_number_get = function (arg0, arg1) {
|
|
||||||
const obj = getObject(arg1);
|
|
||||||
const ret = typeof obj === "number" ? obj : undefined;
|
|
||||||
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_as_number = function (arg0) {
|
|
||||||
const ret = +getObject(arg0);
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_number_new = function (arg0) {
|
|
||||||
const ret = arg0;
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
|
|
||||||
const ret = getObject(arg0);
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
|
|
||||||
const ret = getStringFromWasm0(arg0, arg1);
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
|
|
||||||
const ret = getObject(arg0)[getObject(arg1)];
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
|
|
||||||
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_get_3baa728f9d58d3f6 = function (arg0, arg1) {
|
|
||||||
const ret = getObject(arg0)[arg1 >>> 0];
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_length_ae22078168b726f5 = function (arg0) {
|
|
||||||
const ret = getObject(arg0).length;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_new_a220cf903aa02ca2 = function () {
|
|
||||||
const ret = new Array();
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbindgen_is_function = function (arg0) {
|
|
||||||
const ret = typeof getObject(arg0) === "function";
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_next_de3e9db4440638b2 = function (arg0) {
|
|
||||||
const ret = getObject(arg0).next;
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_next_f9cb570345655b9a = function () {
|
|
||||||
return handleError(function (arg0) {
|
|
||||||
const ret = getObject(arg0).next();
|
|
||||||
return addHeapObject(ret);
|
|
||||||
}, arguments);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_done_bfda7aa8f252b39f = function (arg0) {
|
|
||||||
const ret = getObject(arg0).done;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_value_6d39332ab4788d86 = function (arg0) {
|
|
||||||
const ret = getObject(arg0).value;
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_iterator_888179a48810a9fe = function () {
|
|
||||||
const ret = Symbol.iterator;
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_get_224d16597dbbfd96 = function () {
|
|
||||||
return handleError(function (arg0, arg1) {
|
return handleError(function (arg0, arg1) {
|
||||||
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
const ret = arg0.call(arg1);
|
||||||
return addHeapObject(ret);
|
return ret;
|
||||||
}, arguments);
|
}, arguments);
|
||||||
};
|
};
|
||||||
imports.wbg.__wbg_call_1084a111329e68ce = function () {
|
imports.wbg.__wbg_done_769e5ede4b31c67b = function (arg0) {
|
||||||
return handleError(function (arg0, arg1) {
|
const ret = arg0.done;
|
||||||
const ret = getObject(arg0).call(getObject(arg1));
|
|
||||||
return addHeapObject(ret);
|
|
||||||
}, arguments);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_new_525245e2b9901204 = function () {
|
|
||||||
const ret = new Object();
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_set_673dda6c73d19609 = function (arg0, arg1, arg2) {
|
|
||||||
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_isArray_8364a5371e9737d8 = function (arg0) {
|
|
||||||
const ret = Array.isArray(getObject(arg0));
|
|
||||||
return ret;
|
return ret;
|
||||||
};
|
};
|
||||||
imports.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function (arg0) {
|
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function (arg0, arg1) {
|
||||||
let result;
|
|
||||||
try {
|
|
||||||
result = getObject(arg0) instanceof ArrayBuffer;
|
|
||||||
} catch (_) {
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
const ret = result;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_isSafeInteger_7f1ed56200d90674 = function (arg0) {
|
|
||||||
const ret = Number.isSafeInteger(getObject(arg0));
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_buffer_b7b08af79b0b0974 = function (arg0) {
|
|
||||||
const ret = getObject(arg0).buffer;
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_new_ea1883e1e5e86686 = function (arg0) {
|
|
||||||
const ret = new Uint8Array(getObject(arg0));
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_set_d1e79e2388520f18 = function (arg0, arg1, arg2) {
|
|
||||||
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_length_8339fcf5d8ecd12e = function (arg0) {
|
|
||||||
const ret = getObject(arg0).length;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_instanceof_Uint8Array_247a91427532499e = function (arg0) {
|
|
||||||
let result;
|
|
||||||
try {
|
|
||||||
result = getObject(arg0) instanceof Uint8Array;
|
|
||||||
} catch (_) {
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
const ret = result;
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_new_abda76e883ba8a5f = function () {
|
|
||||||
const ret = new Error();
|
|
||||||
return addHeapObject(ret);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
|
|
||||||
const ret = getObject(arg1).stack;
|
|
||||||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
||||||
const len1 = WASM_VECTOR_LEN;
|
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
||||||
};
|
|
||||||
imports.wbg.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
|
|
||||||
let deferred0_0;
|
let deferred0_0;
|
||||||
let deferred0_1;
|
let deferred0_1;
|
||||||
try {
|
try {
|
||||||
@ -610,25 +353,202 @@ function __wbg_get_imports() {
|
|||||||
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
|
imports.wbg.__wbg_get_67b2ba62fc30de12 = function () {
|
||||||
const v = getObject(arg1);
|
return handleError(function (arg0, arg1) {
|
||||||
const ret = typeof v === "bigint" ? v : undefined;
|
const ret = Reflect.get(arg0, arg1);
|
||||||
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
return ret;
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
}, arguments);
|
||||||
};
|
};
|
||||||
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
|
imports.wbg.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
|
||||||
const ret = debugString(getObject(arg1));
|
const ret = arg0[arg1 >>> 0];
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function (arg0, arg1) {
|
||||||
|
const ret = arg0[arg1];
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function (arg0) {
|
||||||
|
let result;
|
||||||
|
try {
|
||||||
|
result = arg0 instanceof ArrayBuffer;
|
||||||
|
} catch (_) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
const ret = result;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function (arg0) {
|
||||||
|
let result;
|
||||||
|
try {
|
||||||
|
result = arg0 instanceof Uint8Array;
|
||||||
|
} catch (_) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
const ret = result;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_isArray_a1eab7e0d067391b = function (arg0) {
|
||||||
|
const ret = Array.isArray(arg0);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function (arg0) {
|
||||||
|
const ret = Number.isSafeInteger(arg0);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_iterator_9a24c88df860dc65 = function () {
|
||||||
|
const ret = Symbol.iterator;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_length_a446193dc22c12f8 = function (arg0) {
|
||||||
|
const ret = arg0.length;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_length_e2d2a49132c1b256 = function (arg0) {
|
||||||
|
const ret = arg0.length;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_new_405e22f390576ce2 = function () {
|
||||||
|
const ret = new Object();
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_new_78feb108b6472713 = function () {
|
||||||
|
const ret = new Array();
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_new_8a6f238a6ece86ea = function () {
|
||||||
|
const ret = new Error();
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_new_a12002a7f91c75be = function (arg0) {
|
||||||
|
const ret = new Uint8Array(arg0);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_next_25feadfc0913fea9 = function (arg0) {
|
||||||
|
const ret = arg0.next;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_next_6574e1a8a62d1055 = function () {
|
||||||
|
return handleError(function (arg0) {
|
||||||
|
const ret = arg0.next();
|
||||||
|
return ret;
|
||||||
|
}, arguments);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
|
||||||
|
arg0[arg1 >>> 0] = arg2;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
|
||||||
|
arg0[arg1] = arg2;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
|
||||||
|
arg0.set(arg1, arg2 >>> 0);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function (arg0, arg1) {
|
||||||
|
const ret = arg1.stack;
|
||||||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||||
const len1 = WASM_VECTOR_LEN;
|
const len1 = WASM_VECTOR_LEN;
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||||
};
|
};
|
||||||
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
|
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function (arg0) {
|
||||||
throw new Error(getStringFromWasm0(arg0, arg1));
|
const ret = arg0.value;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_as_number = function (arg0) {
|
||||||
|
const ret = +arg0;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
||||||
|
const ret = BigInt.asUintN(64, arg0);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
|
||||||
|
const v = arg1;
|
||||||
|
const ret = typeof v === "bigint" ? v : undefined;
|
||||||
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
||||||
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_boolean_get = function (arg0) {
|
||||||
|
const v = arg0;
|
||||||
|
const ret = typeof v === "boolean" ? (v ? 1 : 0) : 2;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
|
||||||
|
const ret = debugString(arg1);
|
||||||
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||||
|
const len1 = WASM_VECTOR_LEN;
|
||||||
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||||
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_error_new = function (arg0, arg1) {
|
||||||
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_in = function (arg0, arg1) {
|
||||||
|
const ret = arg0 in arg1;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_init_externref_table = function () {
|
||||||
|
const table = wasm.__wbindgen_export_2;
|
||||||
|
const offset = table.grow(4);
|
||||||
|
table.set(0, undefined);
|
||||||
|
table.set(offset + 0, undefined);
|
||||||
|
table.set(offset + 1, null);
|
||||||
|
table.set(offset + 2, true);
|
||||||
|
table.set(offset + 3, false);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_is_bigint = function (arg0) {
|
||||||
|
const ret = typeof arg0 === "bigint";
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_is_function = function (arg0) {
|
||||||
|
const ret = typeof arg0 === "function";
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_is_object = function (arg0) {
|
||||||
|
const val = arg0;
|
||||||
|
const ret = typeof val === "object" && val !== null;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_is_undefined = function (arg0) {
|
||||||
|
const ret = arg0 === undefined;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) {
|
||||||
|
const ret = arg0 === arg1;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
||||||
|
const ret = arg0 == arg1;
|
||||||
|
return ret;
|
||||||
};
|
};
|
||||||
imports.wbg.__wbindgen_memory = function () {
|
imports.wbg.__wbindgen_memory = function () {
|
||||||
const ret = wasm.memory;
|
const ret = wasm.memory;
|
||||||
return addHeapObject(ret);
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_number_get = function (arg0, arg1) {
|
||||||
|
const obj = arg1;
|
||||||
|
const ret = typeof obj === "number" ? obj : undefined;
|
||||||
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
||||||
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_number_new = function (arg0) {
|
||||||
|
const ret = arg0;
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_string_get = function (arg0, arg1) {
|
||||||
|
const obj = arg1;
|
||||||
|
const ret = typeof obj === "string" ? obj : undefined;
|
||||||
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
||||||
|
var len1 = WASM_VECTOR_LEN;
|
||||||
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
||||||
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
|
||||||
|
const ret = getStringFromWasm0(arg0, arg1);
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
|
||||||
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
||||||
};
|
};
|
||||||
|
|
||||||
return imports;
|
return imports;
|
||||||
@ -642,14 +562,20 @@ function __wbg_finalize_init(instance, module) {
|
|||||||
cachedDataViewMemory0 = null;
|
cachedDataViewMemory0 = null;
|
||||||
cachedUint8ArrayMemory0 = null;
|
cachedUint8ArrayMemory0 = null;
|
||||||
|
|
||||||
|
wasm.__wbindgen_start();
|
||||||
return wasm;
|
return wasm;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initSync(module) {
|
function initSync(module) {
|
||||||
if (wasm !== undefined) return wasm;
|
if (wasm !== undefined) return wasm;
|
||||||
|
|
||||||
if (typeof module !== "undefined" && Object.getPrototypeOf(module) === Object.prototype) ({ module } = module);
|
if (typeof module !== "undefined") {
|
||||||
else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
if (Object.getPrototypeOf(module) === Object.prototype) {
|
||||||
|
({ module } = module);
|
||||||
|
} else {
|
||||||
|
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const imports = __wbg_get_imports();
|
const imports = __wbg_get_imports();
|
||||||
|
|
||||||
@ -667,9 +593,13 @@ function initSync(module) {
|
|||||||
async function __wbg_init(module_or_path) {
|
async function __wbg_init(module_or_path) {
|
||||||
if (wasm !== undefined) return wasm;
|
if (wasm !== undefined) return wasm;
|
||||||
|
|
||||||
if (typeof module_or_path !== "undefined" && Object.getPrototypeOf(module_or_path) === Object.prototype)
|
if (typeof module_or_path !== "undefined") {
|
||||||
|
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
||||||
({ module_or_path } = module_or_path);
|
({ module_or_path } = module_or_path);
|
||||||
else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
} else {
|
||||||
|
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof module_or_path === "undefined") {
|
if (typeof module_or_path === "undefined") {
|
||||||
module_or_path = new URL("system_wasm_bg.wasm", import.meta.url);
|
module_or_path = new URL("system_wasm_bg.wasm", import.meta.url);
|
||||||
|
Binary file not shown.
@ -1,20 +1,23 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export const memory: WebAssembly.Memory;
|
export const memory: WebAssembly.Memory;
|
||||||
export function diff_filters(a: number, b: number, c: number): void;
|
export const diff_filters: (a: any, b: any) => [number, number, number];
|
||||||
export function expand_filter(a: number, b: number): void;
|
export const expand_filter: (a: any) => [number, number, number];
|
||||||
export function get_diff(a: number, b: number, c: number): void;
|
export const get_diff: (a: any, b: any) => [number, number, number];
|
||||||
export function flat_merge(a: number, b: number): void;
|
export const flat_merge: (a: any) => [number, number, number];
|
||||||
export function compress(a: number, b: number): void;
|
export const compress: (a: any) => [number, number, number];
|
||||||
export function pow(a: number, b: number, c: number): void;
|
export const pow: (a: any, b: any) => [number, number, number];
|
||||||
export function schnorr_verify(a: number, b: number, c: number, d: number): void;
|
export const schnorr_verify: (a: any, b: any, c: any) => [number, number, number];
|
||||||
export function schnorr_verify_event(a: number, b: number): void;
|
export const schnorr_verify_event: (a: any) => [number, number, number];
|
||||||
export function rustsecp256k1_v0_10_0_context_create(a: number): number;
|
export const rustsecp256k1_v0_10_0_context_create: (a: number) => number;
|
||||||
export function rustsecp256k1_v0_10_0_context_destroy(a: number): void;
|
export const rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
||||||
export function rustsecp256k1_v0_10_0_default_illegal_callback_fn(a: number, b: number): void;
|
export const rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
||||||
export function rustsecp256k1_v0_10_0_default_error_callback_fn(a: number, b: number): void;
|
export const rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
||||||
export function __wbindgen_malloc(a: number, b: number): number;
|
export const __wbindgen_exn_store: (a: number) => void;
|
||||||
export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
|
export const __externref_table_alloc: () => number;
|
||||||
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
export const __wbindgen_export_2: WebAssembly.Table;
|
||||||
export function __wbindgen_exn_store(a: number): void;
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
||||||
export function __wbindgen_free(a: number, b: number, c: number): void;
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
||||||
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
||||||
|
export const __externref_table_dealloc: (a: number) => void;
|
||||||
|
export const __wbindgen_start: () => void;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
extern crate console_error_panic_hook;
|
extern crate console_error_panic_hook;
|
||||||
|
|
||||||
use secp256k1::{Message, XOnlyPublicKey, SECP256K1};
|
use crate::filter::{FlatReqFilter, ReqFilter};
|
||||||
|
use secp256k1::{XOnlyPublicKey, SECP256K1};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use crate::filter::{FlatReqFilter, ReqFilter};
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
pub mod diff;
|
pub mod diff;
|
||||||
@ -96,10 +96,11 @@ pub fn schnorr_verify(hash: JsValue, sig: JsValue, pub_key: JsValue) -> Result<b
|
|||||||
let sig_hex: String = serde_wasm_bindgen::from_value(sig)?;
|
let sig_hex: String = serde_wasm_bindgen::from_value(sig)?;
|
||||||
let pub_key_hex: String = serde_wasm_bindgen::from_value(pub_key)?;
|
let pub_key_hex: String = serde_wasm_bindgen::from_value(pub_key)?;
|
||||||
|
|
||||||
let msg = Message::from_digest_slice(&hex::decode(msg_hex).unwrap()).unwrap();
|
|
||||||
let key = XOnlyPublicKey::from_slice(&hex::decode(pub_key_hex).unwrap()).unwrap();
|
let key = XOnlyPublicKey::from_slice(&hex::decode(pub_key_hex).unwrap()).unwrap();
|
||||||
let sig = secp256k1::schnorr::Signature::from_slice(&hex::decode(sig_hex).unwrap()).unwrap();
|
let sig = secp256k1::schnorr::Signature::from_slice(&hex::decode(sig_hex).unwrap()).unwrap();
|
||||||
Ok(SECP256K1.verify_schnorr(&sig, &msg, &key).is_ok())
|
Ok(SECP256K1
|
||||||
|
.verify_schnorr(&sig, &hex::decode(msg_hex).unwrap(), &key)
|
||||||
|
.is_ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
@ -107,13 +108,23 @@ pub fn schnorr_verify_event(event: JsValue) -> Result<bool, JsValue> {
|
|||||||
console_error_panic_hook::set_once();
|
console_error_panic_hook::set_once();
|
||||||
let event_obj: Event = serde_wasm_bindgen::from_value(event)?;
|
let event_obj: Event = serde_wasm_bindgen::from_value(event)?;
|
||||||
|
|
||||||
let json = json!([0, event_obj.pubkey, event_obj.created_at, event_obj.kind, event_obj.tags, event_obj.content]);
|
let json = json!([
|
||||||
|
0,
|
||||||
|
event_obj.pubkey,
|
||||||
|
event_obj.created_at,
|
||||||
|
event_obj.kind,
|
||||||
|
event_obj.tags,
|
||||||
|
event_obj.content
|
||||||
|
]);
|
||||||
let id = sha256::digest(json.to_string().as_bytes());
|
let id = sha256::digest(json.to_string().as_bytes());
|
||||||
|
|
||||||
let msg = Message::from_digest_slice(&hex::decode(id).unwrap()).unwrap();
|
|
||||||
let key = XOnlyPublicKey::from_slice(&hex::decode(&event_obj.pubkey).unwrap()).unwrap();
|
let key = XOnlyPublicKey::from_slice(&hex::decode(&event_obj.pubkey).unwrap()).unwrap();
|
||||||
let sig = secp256k1::schnorr::Signature::from_slice(&hex::decode(&event_obj.sig.unwrap()).unwrap()).unwrap();
|
let sig =
|
||||||
Ok(SECP256K1.verify_schnorr(&sig, &msg, &key).is_ok())
|
secp256k1::schnorr::Signature::from_slice(&hex::decode(&event_obj.sig.unwrap()).unwrap())
|
||||||
|
.unwrap();
|
||||||
|
Ok(SECP256K1
|
||||||
|
.verify_schnorr(&sig, &hex::decode(id).unwrap(), &key)
|
||||||
|
.is_ok())
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/system",
|
"name": "@snort/system",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Snort nostr system package",
|
"description": "Snort nostr system package",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
4
packages/system/src/cache/user-metadata.ts
vendored
4
packages/system/src/cache/user-metadata.ts
vendored
@ -7,8 +7,8 @@ export class UserProfileCache extends FeedCache<CachedMetadata> {
|
|||||||
|
|
||||||
constructor(table?: DexieTableLike<CachedMetadata>) {
|
constructor(table?: DexieTableLike<CachedMetadata>) {
|
||||||
super("UserCache", table);
|
super("UserCache", table);
|
||||||
this.#processZapperQueue();
|
//this.#processZapperQueue();
|
||||||
this.#processNip5Queue();
|
//this.#processNip5Queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
key(of: CachedMetadata): string {
|
key(of: CachedMetadata): string {
|
||||||
|
@ -14,7 +14,7 @@ export interface TaggedNostrEvent extends NostrEvent {
|
|||||||
/**
|
/**
|
||||||
* A list of relays this event was seen on
|
* A list of relays this event was seen on
|
||||||
*/
|
*/
|
||||||
relays: Array<string>;
|
relays?: Array<string>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional context
|
* Additional context
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { SortedMap, dedupe } from "@snort/shared";
|
import { SortedMap, appendDedupe, dedupe } from "@snort/shared";
|
||||||
import { EventExt, EventType, TaggedNostrEvent } from ".";
|
import { EventExt, EventType, TaggedNostrEvent } from ".";
|
||||||
import { findTag } from "./utils";
|
import { findTag } from "./utils";
|
||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
@ -72,7 +72,7 @@ export class KeyedReplaceableNoteStore extends HookedNoteStore {
|
|||||||
const existing = this.#events.get(keyOnEvent);
|
const existing = this.#events.get(keyOnEvent);
|
||||||
if (a.created_at > (existing?.created_at ?? 0)) {
|
if (a.created_at > (existing?.created_at ?? 0)) {
|
||||||
if (existing) {
|
if (existing) {
|
||||||
a.relays = dedupe([...(existing.relays ?? []), ...a.relays]);
|
a.relays = appendDedupe(existing.relays, a.relays);
|
||||||
}
|
}
|
||||||
this.#events.set(keyOnEvent, a);
|
this.#events.set(keyOnEvent, a);
|
||||||
changes.push(a);
|
changes.push(a);
|
||||||
|
@ -160,12 +160,18 @@ export class Query extends EventEmitter<QueryEvents> {
|
|||||||
*/
|
*/
|
||||||
#replaceable: boolean = false;
|
#replaceable: boolean = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of UUID request builder instance ids appended to this query
|
||||||
|
*/
|
||||||
|
#builderInstances: Set<string>;
|
||||||
|
|
||||||
#log = debug("Query");
|
#log = debug("Query");
|
||||||
|
|
||||||
constructor(req: RequestBuilder) {
|
constructor(req: RequestBuilder) {
|
||||||
super();
|
super();
|
||||||
this.id = req.id;
|
this.id = req.id;
|
||||||
this.#feed = new NoteCollection();
|
this.#feed = new NoteCollection();
|
||||||
|
this.#builderInstances = new Set([req.instance]);
|
||||||
this.#leaveOpen = req.options?.leaveOpen ?? false;
|
this.#leaveOpen = req.options?.leaveOpen ?? false;
|
||||||
this.#timeout = req.options?.timeout ?? 5_000;
|
this.#timeout = req.options?.timeout ?? 5_000;
|
||||||
this.#groupingDelay = req.options?.groupingDelay ?? 100;
|
this.#groupingDelay = req.options?.groupingDelay ?? 100;
|
||||||
@ -181,10 +187,14 @@ export class Query extends EventEmitter<QueryEvents> {
|
|||||||
* Adds another request to this one
|
* Adds another request to this one
|
||||||
*/
|
*/
|
||||||
addRequest(req: RequestBuilder) {
|
addRequest(req: RequestBuilder) {
|
||||||
|
if (this.#builderInstances.has(req.instance)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (req.numFilters > 0) {
|
if (req.numFilters > 0) {
|
||||||
this.#log("Add query %O to %s", req, this.id);
|
this.#log("Add query %O to %s", req, this.id);
|
||||||
this.requests.push(...req.buildRaw());
|
this.requests.push(...req.buildRaw());
|
||||||
this.#start();
|
this.#start();
|
||||||
|
this.#builderInstances.add(req.instance);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/wallet",
|
"name": "@snort/wallet",
|
||||||
"version": "0.2.3",
|
"version": "0.2.4",
|
||||||
"description": "Snort wallet system package",
|
"description": "Snort wallet system package",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -23,7 +23,7 @@
|
|||||||
"@lightninglabs/lnc-web": "^0.3.1-alpha",
|
"@lightninglabs/lnc-web": "^0.3.1-alpha",
|
||||||
"@scure/base": "^1.1.6",
|
"@scure/base": "^1.1.6",
|
||||||
"@snort/shared": "^1.0.17",
|
"@snort/shared": "^1.0.17",
|
||||||
"@snort/system": "^1.6.0",
|
"@snort/system": "^1.6.1",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"eventemitter3": "^5.0.1"
|
"eventemitter3": "^5.0.1"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@snort/worker-relay",
|
"name": "@snort/worker-relay",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"description": "A nostr relay in a service worker",
|
"description": "A nostr relay in a service worker",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -126,7 +126,7 @@ export class WorkerRelayInterface {
|
|||||||
reject(cmdReply.args.error);
|
reject(cmdReply.args.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
debugLog("interface", `${cmd} took ${(unixNowMs() - start).toFixed(1)}ms`, args);
|
//debugLog("interface", `${cmd} took ${(unixNowMs() - start).toFixed(1)}ms`, args);
|
||||||
resolve(cmdReply.args);
|
resolve(cmdReply.args);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -34,7 +34,7 @@ export class SqliteRelay extends EventEmitter<RelayHandlerEvents> implements Rel
|
|||||||
await this.#open(path);
|
await this.#open(path);
|
||||||
if (this.db) {
|
if (this.db) {
|
||||||
await migrate(this);
|
await migrate(this);
|
||||||
// dont await to avoid timeout
|
// don't await to avoid timeout
|
||||||
runFixers(this);
|
runFixers(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,69 +128,76 @@ export class SqliteRelay extends EventEmitter<RelayHandlerEvents> implements Rel
|
|||||||
#insertEvent(db: Database, ev: NostrEvent) {
|
#insertEvent(db: Database, ev: NostrEvent) {
|
||||||
if (this.#seenInserts.has(ev.id)) return false;
|
if (this.#seenInserts.has(ev.id)) return false;
|
||||||
|
|
||||||
const legacyReplacable = [0, 3, 41];
|
const legacyReplaceableKinds = [0, 3, 41];
|
||||||
if (legacyReplacable.includes(ev.kind) || (ev.kind >= 10_000 && ev.kind < 20_000)) {
|
|
||||||
const oldEvents = db.selectValues("select id from events where kind = ? and pubkey = ? and created <= ?", [
|
// Handle legacy and standard replaceable events (kinds 0, 3, 41, 10000-19999)
|
||||||
|
if (legacyReplaceableKinds.includes(ev.kind) || (ev.kind >= 10_000 && ev.kind < 20_000)) {
|
||||||
|
const oldEvents = db.selectValues(`SELECT id FROM events WHERE kind = ? AND pubkey = ? AND created <= ?`, [
|
||||||
ev.kind,
|
ev.kind,
|
||||||
ev.pubkey,
|
ev.pubkey,
|
||||||
ev.created_at,
|
ev.created_at,
|
||||||
]) as Array<string>;
|
]) as Array<string>;
|
||||||
|
|
||||||
if (oldEvents.includes(ev.id)) {
|
if (oldEvents.includes(ev.id)) {
|
||||||
// we already have this event, return
|
// Already have this event
|
||||||
this.#seenInserts.add(ev.id);
|
this.#seenInserts.add(ev.id);
|
||||||
if (oldEvents.length > 1) {
|
|
||||||
const toDelete = oldEvents.filter(a => a !== ev.id);
|
|
||||||
this.#deleteById(db, toDelete);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// delete older versions
|
// Delete older events of the same kind and pubkey
|
||||||
this.#deleteById(db, oldEvents);
|
this.#deleteById(db, oldEvents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle parameterized replaceable events (kinds 30000-39999)
|
||||||
if (ev.kind >= 30_000 && ev.kind < 40_000) {
|
if (ev.kind >= 30_000 && ev.kind < 40_000) {
|
||||||
const dTag = ev.tags.find(a => a[0] === "d")![1];
|
const dTag = ev.tags.find(a => a[0] === "d")?.[1] ?? "";
|
||||||
|
|
||||||
const oldEvents = db.selectValues(
|
const oldEvents = db.selectValues(
|
||||||
"select id from events where id in (select id from events, tags where events.id = tags.event_id and tags.key = ? and tags.value = ?)",
|
`SELECT e.id
|
||||||
["d", dTag],
|
FROM events e
|
||||||
|
JOIN tags t ON e.id = t.event_id
|
||||||
|
WHERE e.kind = ? AND e.pubkey = ? AND t.key = ? AND t.value = ? AND created <= ?`,
|
||||||
|
[ev.kind, ev.pubkey, "d", dTag, ev.created_at],
|
||||||
) as Array<string>;
|
) as Array<string>;
|
||||||
|
|
||||||
if (oldEvents.includes(ev.id)) {
|
if (oldEvents.includes(ev.id)) {
|
||||||
// we have this version
|
// Already have this event
|
||||||
this.#seenInserts.add(ev.id);
|
this.#seenInserts.add(ev.id);
|
||||||
if (oldEvents.length > 1) {
|
|
||||||
const toDelete = oldEvents.filter(a => a !== ev.id);
|
|
||||||
this.#deleteById(db, toDelete);
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// delete older versions
|
// Delete older events with the same kind, pubkey, and d tag
|
||||||
this.#deleteById(db, oldEvents);
|
this.#deleteById(db, oldEvents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove relays from event json
|
// Proceed to insert the new event
|
||||||
const evInsert = {
|
const evInsert = { ...ev };
|
||||||
...ev,
|
delete evInsert["relays"]; // Remove non-DB fields
|
||||||
} as NostrEvent;
|
|
||||||
delete evInsert["relays"];
|
|
||||||
|
|
||||||
db.exec("insert or ignore into events(id, pubkey, created, kind, json, relays) values(?,?,?,?,?,?)", {
|
db.exec(
|
||||||
|
`INSERT OR IGNORE INTO events(id, pubkey, created, kind, json, relays)
|
||||||
|
VALUES(?,?,?,?,?,?)`,
|
||||||
|
{
|
||||||
bind: [ev.id, ev.pubkey, ev.created_at, ev.kind, JSON.stringify(evInsert), (ev.relays ?? []).join(",")],
|
bind: [ev.id, ev.pubkey, ev.created_at, ev.kind, JSON.stringify(evInsert), (ev.relays ?? []).join(",")],
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
const insertedEvents = db.changes();
|
const insertedEvents = db.changes();
|
||||||
if (insertedEvents > 0) {
|
if (insertedEvents > 0) {
|
||||||
|
// Insert tags
|
||||||
for (const t of ev.tags.filter(a => a[0].length === 1)) {
|
for (const t of ev.tags.filter(a => a[0].length === 1)) {
|
||||||
db.exec("insert into tags(event_id, key, value) values(?, ?, ?)", {
|
db.exec("INSERT INTO tags(event_id, key, value) VALUES(?, ?, ?)", {
|
||||||
bind: [ev.id, t[0], t[1]],
|
bind: [ev.id, t[0], t[1]],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.insertIntoSearchIndex(db, ev);
|
this.insertIntoSearchIndex(db, ev);
|
||||||
} else {
|
} else {
|
||||||
this.#updateRelays(db, ev);
|
this.#updateRelays(db, ev);
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.#seenInserts.add(ev.id);
|
this.#seenInserts.add(ev.id);
|
||||||
return insertedEvents;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -332,15 +339,6 @@ export class SqliteRelay extends EventEmitter<RelayHandlerEvents> implements Rel
|
|||||||
params.push(...vArray);
|
params.push(...vArray);
|
||||||
tx++;
|
tx++;
|
||||||
}
|
}
|
||||||
const andTags = Object.entries(req).filter(([k]) => k.startsWith("&"));
|
|
||||||
for (const [key, values] of andTags) {
|
|
||||||
for (const value of values as Array<string>) {
|
|
||||||
sql += ` inner join tags t_${tx} on events.id = t_${tx}.event_id and t_${tx}.key = ? and t_${tx}.value = ?`;
|
|
||||||
params.push(key.slice(1));
|
|
||||||
params.push(value);
|
|
||||||
tx++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (req.search) {
|
if (req.search) {
|
||||||
sql += " inner join search_content on search_content.id = events.id";
|
sql += " inner join search_content on search_content.id = events.id";
|
||||||
conditions.push("search_content match ?");
|
conditions.push("search_content match ?");
|
||||||
|
@ -4824,7 +4824,7 @@ __metadata:
|
|||||||
resolution: "@snort/system-react@workspace:packages/system-react"
|
resolution: "@snort/system-react@workspace:packages/system-react"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@snort/shared": "npm:^1.0.17"
|
"@snort/shared": "npm:^1.0.17"
|
||||||
"@snort/system": "npm:^1.6.0"
|
"@snort/system": "npm:^1.6.1"
|
||||||
"@types/react": "npm:^18.2.14"
|
"@types/react": "npm:^18.2.14"
|
||||||
react: "npm:^18.2.0"
|
react: "npm:^18.2.0"
|
||||||
typescript: "npm:^5.2.2"
|
typescript: "npm:^5.2.2"
|
||||||
@ -4859,7 +4859,7 @@ __metadata:
|
|||||||
languageName: unknown
|
languageName: unknown
|
||||||
linkType: soft
|
linkType: soft
|
||||||
|
|
||||||
"@snort/system@npm:^1.0.21, @snort/system@npm:^1.2.11, @snort/system@npm:^1.5.2, @snort/system@npm:^1.6.0, @snort/system@workspace:*, @snort/system@workspace:packages/system":
|
"@snort/system@npm:^1.0.21, @snort/system@npm:^1.2.11, @snort/system@npm:^1.5.2, @snort/system@npm:^1.6.1, @snort/system@workspace:*, @snort/system@workspace:packages/system":
|
||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@snort/system@workspace:packages/system"
|
resolution: "@snort/system@workspace:packages/system"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -4899,7 +4899,7 @@ __metadata:
|
|||||||
"@lightninglabs/lnc-web": "npm:^0.3.1-alpha"
|
"@lightninglabs/lnc-web": "npm:^0.3.1-alpha"
|
||||||
"@scure/base": "npm:^1.1.6"
|
"@scure/base": "npm:^1.1.6"
|
||||||
"@snort/shared": "npm:^1.0.17"
|
"@snort/shared": "npm:^1.0.17"
|
||||||
"@snort/system": "npm:^1.6.0"
|
"@snort/system": "npm:^1.6.1"
|
||||||
"@types/debug": "npm:^4.1.12"
|
"@types/debug": "npm:^4.1.12"
|
||||||
"@webbtc/webln-types": "npm:^3.0.0"
|
"@webbtc/webln-types": "npm:^3.0.0"
|
||||||
debug: "npm:^4.3.4"
|
debug: "npm:^4.3.4"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user