diff --git a/.github/workflows/deploy-example.yml b/.github/workflows/deploy-example.yml new file mode 100644 index 0000000..51de249 --- /dev/null +++ b/.github/workflows/deploy-example.yml @@ -0,0 +1,64 @@ +name: Deploy Demo UI to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "yarn" + cache-dependency-path: "**/yarn.lock" + + - name: Install dependencies + run: | + cd example + yarn install --frozen-lockfile + + - name: Install wallets deps + run: | + cd near-wallets + yarn install --frozen-lockfile + + - name: Install deps + run: | + yarn install --frozen-lockfile + + - name: Build example + run: | + cd example + yarn build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: example/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..855981a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,74 @@ +name: Release + +on: + push: + branches: + - main + +permissions: + contents: write + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Read version from package.json + id: pkg + shell: bash + run: | + VERSION=$(node -p "require('./package.json').version") + echo "version=$VERSION" >> "$GITHUB_OUTPUT" + + - name: Prepare release notes from CHANGELOG.md + id: changelog + shell: bash + run: | + VERSION="${{ steps.pkg.outputs.version }}" + CHANGELOG="CHANGELOG.md" + OUT="RELEASE_CHANGELOG.md" + awk -v ver="$VERSION" ' + $0 ~ "^# " ver "$" {print; flag=1; next} + flag && $0 ~ "^# " && $0 !~ "^# " ver "$" {flag=0} + flag {print} + ' "$CHANGELOG" > "$OUT" + if [ ! -s "$OUT" ]; then + echo "# $VERSION" > "$OUT" + echo "" >> "$OUT" + cat "$CHANGELOG" >> "$OUT" + fi + echo "notes<> $GITHUB_OUTPUT + cat "$OUT" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Create source ZIP archive + id: zip + shell: bash + run: | + ZIP_NAME="near-connect-${{ steps.pkg.outputs.version }}.zip" + git archive -o "$ZIP_NAME" HEAD . + echo "zip=$ZIP_NAME" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.pkg.outputs.version }} + name: v${{ steps.pkg.outputs.version }} + body: ${{ steps.changelog.outputs.notes }} + files: | + ${{ steps.zip.outputs.zip }} + CHANGELOG.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index d9f015c..3aa0794 100644 --- a/.gitignore +++ b/.gitignore @@ -6,13 +6,13 @@ yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* -build -public - +example/public/repository .vite +dist +.env +.yarn node_modules -dist dist-ssr *.local diff --git a/.prettierrc b/.prettierrc index acbeeec..af26d1f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,4 @@ { - "printWidth": 120, + "printWidth": 160, "tabWidth": 2 } diff --git a/.prototools b/.prototools new file mode 100644 index 0000000..de2123b --- /dev/null +++ b/.prototools @@ -0,0 +1,2 @@ +yarn="1.22.22" +node="22.17.1" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..698002d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,105 @@ +# 0.11.4 + +- Add `cspNonce` option to `NearConnector` for CSP compliance. When set, the nonce is added to both ` + + + + + `; +} +exports.default = getIframeCode; +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/build/SandboxedWallet/code.js.map b/build/SandboxedWallet/code.js.map new file mode 100644 index 0000000..9d77587 --- /dev/null +++ b/build/SandboxedWallet/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../../src/SandboxedWallet/code.ts"],"names":[],"mappings":";;AAAA,4DAA4D;AAG5D,KAAK,UAAU,aAAa,CAAC,IAAgF;IAC3G,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;IAErB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI;SACnB,UAAU,CAAC,eAAe,EAAE,wBAAwB,CAAC;SACrD,UAAU,CAAC,YAAY,EAAE,iBAAiB,CAAC;SAC3C,UAAU,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;IAErD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEnG,OAAO,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAyFL,SAAS;;wBAEA,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6BvB,QAAQ,CAAC,IAAI;kBACnB,QAAQ,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;yCAoBU,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0BxB,MAAM,CAAC,QAAQ,CAAC,IAAI;+BACV,wCAAoB;;uBAE5B,MAAM,CAAC,WAAW;mBACtB,MAAM,CAAC,OAAO;sBACX,MAAM,CAAC,UAAU;mBACpB,MAAM,CAAC,OAAO;;;qBAGZ,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC;qBACjC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAsDxB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;yEACmB,IAAI;;;;;;qEAMR,IAAI;;;;mEAIN,IAAI;;;;;;;;;;;;;;uBAchD,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA8DU,IAAI;;;;;wDAKe,IAAI;;;;;;;;;;;;;;;;;;6BAkB/B,SAAS,IAAI,IAAI;;;KAGzC,CAAC;AACN,CAAC;AAED,kBAAe,aAAa,CAAC"} \ No newline at end of file diff --git a/build/SandboxedWallet/executor.d.ts b/build/SandboxedWallet/executor.d.ts new file mode 100644 index 0000000..91f9b8d --- /dev/null +++ b/build/SandboxedWallet/executor.d.ts @@ -0,0 +1,23 @@ +import { WalletManifest, WalletPermissions } from "../types"; +import { NearConnector } from "../NearConnector"; +import IframeExecutor from "./iframe"; +declare class SandboxExecutor { + readonly connector: NearConnector; + readonly manifest: WalletManifest; + private activePanels; + readonly storageSpace: string; + constructor(connector: NearConnector, manifest: WalletManifest); + checkPermissions(action: keyof WalletPermissions, params?: { + url?: string; + entity?: string; + }): boolean | undefined; + assertPermissions(iframe: IframeExecutor, action: keyof WalletPermissions, event: MessageEvent): void; + _onMessage: (iframe: IframeExecutor, event: MessageEvent) => Promise; + private actualCode; + checkNewVersion(executor: SandboxExecutor, currentVersion: string | null): Promise; + loadCode(): Promise; + call(method: string, params: any): Promise; + getAllStorage(): Promise>; + clearStorage(): Promise; +} +export default SandboxExecutor; diff --git a/build/SandboxedWallet/executor.js b/build/SandboxedWallet/executor.js new file mode 100644 index 0000000..b05fa5d --- /dev/null +++ b/build/SandboxedWallet/executor.js @@ -0,0 +1,580 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const url_1 = require("../helpers/url"); +const uuid_1 = require("../helpers/uuid"); +const iframe_1 = __importDefault(require("./iframe")); +const cacheId = (0, uuid_1.uuid4)(); +// ─── Injected Ethereum provider discovery ──────────────────────────────────── +// Used by the `ethereum.*` bridge so sandboxed wallets (e.g. eip712-wallet) +// can talk to browser-extension wallets without breaking iframe isolation — +// only JSON-RPC `request({method, params})` crosses the boundary. +// +// Two discovery channels: +// 1. Legacy: `window.ethereum` (single global). +// 2. EIP-6963: providers dispatch `eip6963:announceProvider` in response +// to a page-emitted `eip6963:requestProvider`. Required for MetaMask +// and any other provider that no longer injects the legacy global. +const _eip6963Providers = []; +let _eip6963ListenerInstalled = false; +// Index of the provider currently exposed via `pickEthereumProvider()`. +// Advanced by `ethereum.next` so the iframe's "Use a different wallet" +// button can rotate through detected providers. +let _eip6963ProviderIndex = 0; +// Set when the iframe explicitly opts out of the injected-provider bridge +// (user picked "Use a different wallet" with no more rotations, or the +// extension revoked permission). The bridge then reports unavailable and +// the iframe falls back to its WalletConnect path. +let _ethereumBridgeDisabled = false; +// Set when the WalletConnect sign-client's `connect().approval()` rejects +// (typically because the user rejected the pairing in their wallet app). +// Reset on every new `walletConnect.connect` call. Lets the iframe surface +// the rejection without holding the approval promise itself. +let _lastWcApprovalError = null; +function installEip6963Listener() { + if (typeof window === "undefined" || _eip6963ListenerInstalled) + return; + _eip6963ListenerInstalled = true; + window.addEventListener("eip6963:announceProvider", (event) => { + const provider = event?.detail?.provider; + if (provider && !_eip6963Providers.includes(provider)) + _eip6963Providers.push(provider); + }); + // Prompt any provider that's already loaded to re-announce. Per EIP-6963 + // the wallet listens for this and re-dispatches `eip6963:announceProvider`. + window.dispatchEvent(new CustomEvent("eip6963:requestProvider")); +} +if (typeof window !== "undefined") + installEip6963Listener(); +function pickEthereumProvider() { + // Prefer EIP-6963 (multi-provider safe). Fall back to the legacy global + // `window.ethereum`, re-reading on each call so we don't cache a stale + // null from a load order race. + if (_eip6963Providers.length > 0) { + return _eip6963Providers[_eip6963ProviderIndex % _eip6963Providers.length]; + } + if (typeof window !== "undefined" && window.ethereum) + return window.ethereum; + return null; +} +async function waitForEthereumProvider(timeoutMs = 800) { + installEip6963Listener(); + const existing = pickEthereumProvider(); + if (existing) + return existing; + const start = Date.now(); + while (Date.now() - start < timeoutMs) { + // Re-emit periodically — some providers attach the listener late. + if (typeof window !== "undefined") { + window.dispatchEvent(new CustomEvent("eip6963:requestProvider")); + } + await new Promise((r) => setTimeout(r, 100)); + const found = pickEthereumProvider(); + if (found) + return found; + } + return null; +} +class SandboxExecutor { + connector; + manifest; + activePanels = {}; + storageSpace; + constructor(connector, manifest) { + this.connector = connector; + this.manifest = manifest; + this.storageSpace = manifest.id; + } + checkPermissions(action, params) { + if (action === "walletConnect") { + return !!this.manifest.permissions.walletConnect; + } + if (action === "external") { + const external = this.manifest.permissions.external; + if (!external || !params?.entity) + return false; + return external.includes(params.entity); + } + if (action === "allowsOpen") { + const openUrl = (0, url_1.parseUrl)(params?.url || ""); + if (!openUrl) + return false; + // WalletConnect needs to deeplink into arbitrary wallet apps via + // both custom schemes (`ledgerlive:`, `metamask:`, `rainbow:`, …) + // and web entry points (`https://console.fireblocks.io/v2/wc?...`, + // `https://link.metamask.io/...`, etc.). Enumerating every wallet + // is unmaintainable, so a wallet granted the `walletConnect` + // permission may open any URL except known-dangerous schemes. + const DANGEROUS_SCHEMES = new Set(["javascript:", "data:", "blob:", "file:", "about:"]); + if (DANGEROUS_SCHEMES.has(openUrl.protocol.toLowerCase())) + return false; + if (this.manifest.permissions.walletConnect === true) + return true; + const allowsOpen = this.manifest.permissions.allowsOpen; + if (!allowsOpen || !Array.isArray(allowsOpen) || allowsOpen.length === 0) + return false; + const isAllowed = allowsOpen.some((path) => { + // Protocol-only patterns like "wc:" or "metamask:" allow any URL + // with that scheme. Needed for WalletConnect deeplinks: the spec + // pairing URI is `wc:?...` which `new URL("wc:")` rejects, + // so a plain `new URL(path)` comparison would never match. + if (/^[a-z][a-z0-9+.-]*:$/i.test(path)) { + return openUrl.protocol.toLowerCase() === path.toLowerCase(); + } + const url = (0, url_1.parseUrl)(path); + if (!url) + return false; + if (openUrl.protocol !== url.protocol) + return false; + if (!!url.hostname && openUrl.hostname !== url.hostname) + return false; + if (!!url.pathname && url.pathname !== "/" && openUrl.pathname !== url.pathname) + return false; + return true; + }); + return isAllowed; + } + return this.manifest.permissions[action]; + } + assertPermissions(iframe, action, event) { + if (!this.checkPermissions(action, event.data.params)) { + iframe.postMessage({ ...event.data, status: "failed", result: "Permission denied" }); + throw new Error("Permission denied"); + } + } + _onMessage = async (iframe, event) => { + const success = (result) => { + iframe.postMessage({ ...event.data, status: "success", result: result }); + }; + const failed = (error) => { + iframe.postMessage({ ...event.data, status: "failed", result: error }); + }; + if (event.data.method === "ui.showIframe") { + iframe.show(); + success(null); + return; + } + if (event.data.method === "ui.hideIframe") { + iframe.hide(); + success(null); + return; + } + if (event.data.method === "storage.set") { + this.assertPermissions(iframe, "storage", event); + localStorage.setItem(`${this.storageSpace}:${event.data.params.key}`, event.data.params.value); + success(null); + return; + } + if (event.data.method === "storage.get") { + this.assertPermissions(iframe, "storage", event); + const value = localStorage.getItem(`${this.storageSpace}:${event.data.params.key}`); + success(value); + return; + } + if (event.data.method === "storage.keys") { + this.assertPermissions(iframe, "storage", event); + const keys = Object.keys(localStorage).filter((key) => key.startsWith(`${this.storageSpace}:`)); + success(keys); + return; + } + if (event.data.method === "storage.remove") { + this.assertPermissions(iframe, "storage", event); + localStorage.removeItem(`${this.storageSpace}:${event.data.params.key}`); + success(null); + return; + } + if (event.data.method === "panel.focus") { + const panel = this.activePanels[event.data.params.windowId]; + if (panel) + panel.focus(); + success(null); + return; + } + if (event.data.method === "panel.postMessage") { + const panel = this.activePanels[event.data.params.windowId]; + if (panel) + panel.postMessage(event.data.params.data, "*"); + success(null); + return; + } + if (event.data.method === "panel.close") { + const panel = this.activePanels[event.data.params.windowId]; + if (panel) + panel.close(); + delete this.activePanels[event.data.params.windowId]; + success(null); + return; + } + if (event.data.method === "walletConnect.connect") { + this.assertPermissions(iframe, "walletConnect", event); + try { + if (!this.connector.walletConnect) + throw new Error("WalletConnect is not configured"); + const client = await this.connector.walletConnect; + _lastWcApprovalError = null; + const result = await client.connect(event.data.params); + result.approval().catch((err) => { + _lastWcApprovalError = err; + }); + success({ uri: result.uri }); + } + catch (e) { + failed(e); + } + return; + } + if (event.data.method === "walletConnect.getApprovalError") { + this.assertPermissions(iframe, "walletConnect", event); + const err = _lastWcApprovalError; + success(err ? { message: err?.message ?? String(err), code: err?.code } : null); + return; + } + if (event.data.method === "walletConnect.getProjectId") { + if (!this.connector.walletConnect) + throw new Error("WalletConnect is not configured"); + this.assertPermissions(iframe, "walletConnect", event); + const client = await this.connector.walletConnect; + success(client.core.projectId); + return; + } + if (event.data.method === "walletConnect.disconnect") { + this.assertPermissions(iframe, "walletConnect", event); + try { + if (!this.connector.walletConnect) + throw new Error("WalletConnect is not configured"); + const client = await this.connector.walletConnect; + const result = await client.disconnect(event.data.params); + success(result); + } + catch (e) { + failed(e); + } + return; + } + if (event.data.method === "walletConnect.getSession") { + this.assertPermissions(iframe, "walletConnect", event); + try { + if (!this.connector.walletConnect) + throw new Error("WalletConnect is not configured"); + const client = await this.connector.walletConnect; + const key = client.session.keys[client.session.keys.length - 1]; + const session = key ? client.session.get(key) : null; + success(session ? { topic: session.topic, namespaces: session.namespaces } : null); + } + catch (e) { + failed(e); + } + return; + } + if (event.data.method === "walletConnect.request") { + this.assertPermissions(iframe, "walletConnect", event); + try { + if (!this.connector.walletConnect) + throw new Error("WalletConnect is not configured"); + const client = await this.connector.walletConnect; + const result = await client.request(event.data.params); + success(result); + } + catch (e) { + failed(e); + } + return; + } + if (event.data.method === "external") { + this.assertPermissions(iframe, "external", event); + try { + const { entity, key, args } = event.data.params; + const obj = entity.split(".").reduce((acc, key) => acc[key], window); + // TODO: remove hack after Nightly fixes. + // Their method wait near.Transaction and call encode() to get bytes. + // External API should not require non-serializable data, this is unsafe from an isolation point of view. + if (entity === "nightly.near" && key === "signTransaction") { + args[0].encode = () => args[0]; + } + const result = typeof obj[key] === "function" ? await obj[key](...(args || [])) : obj[key]; + success(result); + } + catch (e) { + failed(e); + } + return; + } + if (event.data.method === "open") { + this.assertPermissions(iframe, "allowsOpen", event); + // Open in Telegram Mini App + const tgapp = typeof window !== "undefined" ? window?.Telegram?.WebApp : null; + if (tgapp && event.data.params.url.startsWith("https://t.me")) { + tgapp.openTelegramLink(event.data.params.url); + return; + } + const panel = window.open(event.data.params.url, "_blank", event.data.params.features); + const panelId = panel ? (0, uuid_1.uuid4)() : null; + success(panelId); + // Only register the cross-window message forwarder when `window.open` + // actually returned a real popup. Deeplinks (`ledgerlive://`, + // `metamask://`, …) return `null` from `window.open` and have + // `new URL(deeplink).origin === "null"` — which would otherwise + // match the sandboxed iframe's own `ev.origin === "null"`, echoing + // every outgoing iframe message back to itself and corrupting the + // selector.call response routing. + if (panel && panelId) { + const url = (0, url_1.parseUrl)(event.data.params.url); + const panelOrigin = url?.origin; + const handler = (ev) => { + if (ev.source === iframe.contentWindow) + return; + if (!panelOrigin || panelOrigin === "null") + return; + if (panelOrigin !== ev.origin) + return; + iframe.postMessage(ev.data); + }; + window.addEventListener("message", handler); + this.activePanels[panelId] = panel; + const interval = setInterval(() => { + if (!panel?.closed) + return; + window.removeEventListener("message", handler); + const args = { method: "proxy-window:closed", windowId: panelId }; + delete this.activePanels[panelId]; + clearInterval(interval); + try { + iframe.postMessage(args); + } + catch { } + }, 500); + } + return; + } + if (event.data.method === "webauthn.create") { + this.assertPermissions(iframe, "webauthn", event); + try { + const options = event.data.params; + // Reconstruct ArrayBuffer fields from serialized arrays + if (options.challenge) + options.challenge = new Uint8Array(options.challenge).buffer; + if (options.user?.id) + options.user.id = new Uint8Array(options.user.id).buffer; + if (options.excludeCredentials) { + options.excludeCredentials = options.excludeCredentials.map((c) => ({ + ...c, + id: new Uint8Array(c.id).buffer, + })); + } + const credential = await navigator.credentials.create({ publicKey: options }); + if (!(credential instanceof PublicKeyCredential)) + throw new Error("Invalid credential"); + const response = credential.response; + const result = { + rawId: Array.from(new Uint8Array(credential.rawId)), + clientDataJSON: Array.from(new Uint8Array(response.clientDataJSON)), + attestationObject: Array.from(new Uint8Array(response.attestationObject)), + }; + if (typeof response.getPublicKey === "function") { + const spki = response.getPublicKey(); + result.publicKey = spki ? Array.from(new Uint8Array(spki)) : null; + } + success(result); + } + catch (e) { + failed(e instanceof Error ? e.message : String(e)); + } + return; + } + if (event.data.method === "webauthn.get") { + this.assertPermissions(iframe, "webauthn", event); + try { + const options = event.data.params; + if (options.challenge) + options.challenge = new Uint8Array(options.challenge).buffer; + if (options.allowCredentials) { + options.allowCredentials = options.allowCredentials.map((c) => ({ + ...c, + id: new Uint8Array(c.id).buffer, + })); + } + const credential = await navigator.credentials.get({ publicKey: options }); + if (!(credential instanceof PublicKeyCredential)) + throw new Error("Invalid credential"); + const response = credential.response; + success({ + rawId: Array.from(new Uint8Array(credential.rawId)), + signature: Array.from(new Uint8Array(response.signature)), + authenticatorData: Array.from(new Uint8Array(response.authenticatorData)), + clientDataJSON: Array.from(new Uint8Array(response.clientDataJSON)), + }); + } + catch (e) { + failed(e instanceof Error ? e.message : String(e)); + } + return; + } + // Bridge to a browser-extension Ethereum provider (e.g. MetaMask). The + // provider injects `window.ethereum` into the top-level page only — the + // sandboxed iframe can't see it. Forwarding requests preserves the + // iframe isolation: the executor never gets direct access to the + // provider object, only the proxied JSON-RPC responses. + if (event.data.method === "ethereum.isAvailable") { + this.assertPermissions(iframe, "walletConnect", event); + if (_ethereumBridgeDisabled) { + success(false); + return; + } + const eth = await waitForEthereumProvider(); + success(!!eth && typeof eth.request === "function"); + return; + } + // Rotate to the next detected EIP-6963 provider. Triggered by the + // "Use a different wallet" button in sandboxed wallets so the user can + // switch between multiple installed extensions without reloading. + if (event.data.method === "ethereum.next") { + this.assertPermissions(iframe, "walletConnect", event); + if (_eip6963Providers.length > 1) { + _eip6963ProviderIndex = (_eip6963ProviderIndex + 1) % _eip6963Providers.length; + } + success(_eip6963Providers.length > 1); + return; + } + // Opt out of the injected-provider bridge entirely for the rest of the + // session, so the iframe falls back to WalletConnect (e.g. user wants + // Fireblocks instead of MetaMask, or revoked the extension's auth). + if (event.data.method === "ethereum.disable") { + this.assertPermissions(iframe, "walletConnect", event); + _ethereumBridgeDisabled = true; + success(null); + return; + } + // Re-enable the bridge after a previous `disable`. Used when the user + // wants to switch back from WalletConnect to the browser extension. + if (event.data.method === "ethereum.enable") { + this.assertPermissions(iframe, "walletConnect", event); + _ethereumBridgeDisabled = false; + success(null); + return; + } + // Reports whether any extension provider was ever detected on the + // page. Honest even when the bridge is currently disabled, so the + // iframe can offer the "Use browser extension" affordance. + if (event.data.method === "ethereum.detected") { + this.assertPermissions(iframe, "walletConnect", event); + const eth = await waitForEthereumProvider(); + success(!!eth && typeof eth.request === "function"); + return; + } + if (event.data.method === "ethereum.request") { + this.assertPermissions(iframe, "walletConnect", event); + const eth = await waitForEthereumProvider(); + if (!eth || typeof eth.request !== "function") { + failed("No injected Ethereum provider available"); + return; + } + try { + const result = await eth.request(event.data.params); + success(result); + } + catch (e) { + failed({ message: e?.message ?? String(e), code: e?.code }); + } + return; + } + if (event.data.method === "open.nativeApp") { + this.assertPermissions(iframe, "allowsOpen", event); + const url = (0, url_1.parseUrl)(event.data.params.url); + const invalid = ["https", "http", "javascript:", "file:", "data:", "blob:", "about:"]; + if (!url || invalid.includes(url.protocol)) { + failed("Invalid URL"); + throw new Error("[open.nativeApp] Invalid URL"); + } + const linkIframe = document.createElement("iframe"); + linkIframe.src = event.data.params.url; + linkIframe.style.display = "none"; + document.body.appendChild(linkIframe); + iframe.postMessage({ ...event.data, status: "success", result: null }); + return; + } + }; + actualCode = null; + async checkNewVersion(executor, currentVersion) { + if (this.actualCode) { + this.connector.logger?.log(`New version of code already checked`); + return this.actualCode; + } + let url = (0, url_1.parseUrl)(executor.manifest.executor); + if (!url) + url = (0, url_1.parseUrl)(location.origin + executor.manifest.executor); // relative url + if (!url) + throw new Error("Invalid executor URL"); + url.searchParams.set("nonce", cacheId); + const newVersion = await fetch(url.toString()).then((res) => res.text()); + this.connector.logger?.log(`New version of code fetched`); + this.actualCode = newVersion; + if (newVersion === currentVersion) { + this.connector.logger?.log(`New version of code is the same as the current version`); + return this.actualCode; + } + await this.connector.db.setItem(`${this.manifest.id}:${this.manifest.version}`, newVersion); + this.connector.logger?.log(`New version of code saved to cache`); + return newVersion; + } + async loadCode() { + const cachedCode = await this.connector.db.getItem(`${this.manifest.id}:${this.manifest.version}`).catch(() => null); + this.connector.logger?.log(`Code loaded from cache`, cachedCode !== null); + const task = this.checkNewVersion(this, cachedCode); + if (cachedCode) + return cachedCode; + return await task; + } + async call(method, params) { + this.connector.logger?.log(`Add to queue`, method, params); + // return this.queue.enqueue(async () => { + this.connector.logger?.log(`Calling method`, method, params); + const code = await this.loadCode(); + this.connector.logger?.log(`Code loaded, preparing`); + const iframe = new iframe_1.default(this, code, this._onMessage, this.connector.cspNonce); + this.connector.logger?.log(`Code loaded, iframe initialized`); + await iframe.readyPromise; + this.connector.logger?.log(`Iframe ready`); + const id = (0, uuid_1.uuid4)(); + return new Promise((resolve, reject) => { + try { + const handler = (event) => { + if (event.data.id !== id || event.data.origin !== iframe.origin) + return; + iframe.dispose(); + window.removeEventListener("message", handler); + this.connector.logger?.log("postMessage", { result: event.data, request: { method, params } }); + if (event.data.status === "failed") + reject(event.data.result); + else + resolve(event.data.result); + }; + window.addEventListener("message", handler); + iframe.postMessage({ method, params, id }); + iframe.on("close", () => reject(new Error("Wallet closed"))); + } + catch (e) { + this.connector.logger?.log(`Iframe error`, e); + reject(e); + } + }); + // }); + } + async getAllStorage() { + const keys = Object.keys(localStorage).filter((key) => key.startsWith(`${this.storageSpace}:`)); + const storage = {}; + for (const key of keys) { + storage[key.replace(`${this.storageSpace}:`, "")] = localStorage.getItem(key); + } + return storage; + } + async clearStorage() { + const keys = Object.keys(localStorage).filter((key) => key.startsWith(`${this.storageSpace}:`)); + for (const key of keys) { + localStorage.removeItem(key); + } + } +} +exports.default = SandboxExecutor; +//# sourceMappingURL=executor.js.map \ No newline at end of file diff --git a/build/SandboxedWallet/executor.js.map b/build/SandboxedWallet/executor.js.map new file mode 100644 index 0000000..7eddac7 --- /dev/null +++ b/build/SandboxedWallet/executor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/SandboxedWallet/executor.ts"],"names":[],"mappings":";;;;;AAEA,wCAA0C;AAC1C,0CAAwC;AAExC,sDAAsC;AAEtC,MAAM,OAAO,GAAG,IAAA,YAAK,GAAE,CAAC;AAExB,gFAAgF;AAChF,4EAA4E;AAC5E,4EAA4E;AAC5E,kEAAkE;AAClE,EAAE;AACF,0BAA0B;AAC1B,kDAAkD;AAClD,2EAA2E;AAC3E,0EAA0E;AAC1E,wEAAwE;AACxE,MAAM,iBAAiB,GAAU,EAAE,CAAC;AACpC,IAAI,yBAAyB,GAAG,KAAK,CAAC;AACtC,wEAAwE;AACxE,uEAAuE;AACvE,gDAAgD;AAChD,IAAI,qBAAqB,GAAG,CAAC,CAAC;AAC9B,0EAA0E;AAC1E,uEAAuE;AACvE,yEAAyE;AACzE,mDAAmD;AACnD,IAAI,uBAAuB,GAAG,KAAK,CAAC;AAEpC,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,6DAA6D;AAC7D,IAAI,oBAAoB,GAAQ,IAAI,CAAC;AAErC,SAAS,sBAAsB;IAC7B,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,yBAAyB;QA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C,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YAC/D,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;gBAC9C,MAAM,CAAC,CAAC,CAAC,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,MAAM;IACR,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QAChG,MAAM,OAAO,GAAwB,EAAE,CAAC;QAExC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAChF,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QAChG,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF;AAED,kBAAe,eAAe,CAAC"} \ No newline at end of file diff --git a/build/SandboxedWallet/iframe.d.ts b/build/SandboxedWallet/iframe.d.ts new file mode 100644 index 0000000..5043636 --- /dev/null +++ b/build/SandboxedWallet/iframe.d.ts @@ -0,0 +1,19 @@ +import SandboxExecutor from "./executor"; +declare class IframeExecutor { + readonly executor: SandboxExecutor; + readonly origin: string; + private iframe; + private events; + private popup; + private handler; + private readyPromiseResolve; + readonly readyPromise: Promise; + constructor(executor: SandboxExecutor, code: string, onMessage: (iframe: IframeExecutor, event: MessageEvent) => void, cspNonce?: string); + on(event: "close", callback: () => void): void; + show(): void; + hide(): void; + postMessage(data: any): void; + get contentWindow(): Window | null; + dispose(): void; +} +export default IframeExecutor; diff --git a/build/SandboxedWallet/iframe.js b/build/SandboxedWallet/iframe.js new file mode 100644 index 0000000..0adae13 --- /dev/null +++ b/build/SandboxedWallet/iframe.js @@ -0,0 +1,88 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const events_1 = require("../helpers/events"); +const uuid_1 = require("../helpers/uuid"); +const IframeWalletPopup_1 = require("../popups/IframeWalletPopup"); +const code_1 = __importDefault(require("./code")); +class IframeExecutor { + executor; + origin; + iframe = document.createElement("iframe"); + events = new events_1.EventEmitter(); + popup; + handler; + readyPromiseResolve; + readyPromise = new Promise((resolve) => { + this.readyPromiseResolve = resolve; + }); + constructor(executor, code, onMessage, cspNonce) { + this.executor = executor; + this.origin = (0, uuid_1.uuid4)(); + this.handler = (event) => { + if (event.data.origin !== this.origin) + return; + if (event.data.method === "wallet-ready") + this.readyPromiseResolve(); + onMessage(this, event); + }; + window.addEventListener("message", this.handler); + const iframeAllowedPermissions = []; + if (this.executor.checkPermissions("usb")) + iframeAllowedPermissions.push("usb *;"); + if (this.executor.checkPermissions("hid")) + iframeAllowedPermissions.push("hid *;"); + if (this.executor.checkPermissions("clipboardRead")) + iframeAllowedPermissions.push("clipboard-read;"); + if (this.executor.checkPermissions("clipboardWrite")) + iframeAllowedPermissions.push("clipboard-write;"); + if (this.executor.checkPermissions("bluetooth")) + iframeAllowedPermissions.push("bluetooth *;"); + if (this.executor.checkPermissions("webauthn")) { + iframeAllowedPermissions.push("publickey-credentials-create *;"); + iframeAllowedPermissions.push("publickey-credentials-get *;"); + } + this.iframe.allow = iframeAllowedPermissions.join(" "); + this.iframe.setAttribute("sandbox", "allow-scripts"); + (0, code_1.default)({ id: this.origin, executor: this.executor, code, cspNonce }).then((code) => { + this.executor.connector.logger?.log(`Iframe code injected`); + this.iframe.srcdoc = code; + }); + this.popup = new IframeWalletPopup_1.IframeWalletPopup({ + footer: this.executor.connector.footerBranding, + iframe: this.iframe, + onApprove: () => { }, + onReject: () => { + window.removeEventListener("message", this.handler); + this.events.emit("close", {}); + this.popup.destroy(); + }, + }); + this.popup.create(); + } + on(event, callback) { + this.events.on(event, callback); + } + show() { + this.popup.show(); + } + hide() { + this.popup.hide(); + } + postMessage(data) { + if (!this.iframe.contentWindow) + throw new Error("Iframe not loaded"); + this.iframe.contentWindow.postMessage({ ...data, origin: this.origin }, "*"); + } + get contentWindow() { + return this.iframe.contentWindow; + } + dispose() { + window.removeEventListener("message", this.handler); + this.popup.destroy(); + } +} +exports.default = IframeExecutor; +//# sourceMappingURL=iframe.js.map \ No newline at end of file diff --git a/build/SandboxedWallet/iframe.js.map b/build/SandboxedWallet/iframe.js.map new file mode 100644 index 0000000..5e482b8 --- /dev/null +++ b/build/SandboxedWallet/iframe.js.map @@ -0,0 +1 @@ +{"version":3,"file":"iframe.js","sourceRoot":"","sources":["../../src/SandboxedWallet/iframe.ts"],"names":[],"mappings":";;;;;AAAA,8CAAiD;AACjD,0CAAwC;AACxC,mEAAgE;AAEhE,kDAAmC;AAGnC,MAAM,cAAc;IAaG;IAZZ,MAAM,CAAS;IAEhB,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,GAAG,IAAI,qBAAY,EAAiB,CAAC;IAC3C,KAAK,CAAoB;IAEzB,OAAO,CAAqC;IAC5C,mBAAmB,CAAyB;IAC3C,YAAY,GAAG,IAAI,OAAO,CAA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KAAc,EAAE,QAAoB;QACrC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED,IAAI;QACF,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,IAAI;QACF,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,IAAS;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,CAAC,CAAC;IAC/E,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;IACnC,CAAC;IAED,OAAO;QACL,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC;CACF;AAED,kBAAe,cAAc,CAAC"} \ No newline at end of file diff --git a/build/SandboxedWallet/index.d.ts b/build/SandboxedWallet/index.d.ts new file mode 100644 index 0000000..cbb7e33 --- /dev/null +++ b/build/SandboxedWallet/index.d.ts @@ -0,0 +1,23 @@ +import { Account, FinalExecutionOutcome, Network, SignAndSendTransactionParams, SignAndSendTransactionsParams, SignDelegateActionsParams, SignedMessage, SignMessageParams, WalletManifest, SignDelegateActionsResponse, type AccountWithSignedMessage, type SignInAndSignMessageParams, type SignInParams, type ResolveAuthParams, type ResolveAuthResponse } from "../types"; +import { NearConnector } from "../NearConnector"; +import SandboxExecutor from "./executor"; +export declare class SandboxWallet { + readonly connector: NearConnector; + readonly manifest: WalletManifest; + executor: SandboxExecutor; + constructor(connector: NearConnector, manifest: WalletManifest); + signIn(data?: SignInParams): Promise>; + signInAndSignMessage(data: SignInAndSignMessageParams): Promise>; + signOut(data?: { + network?: Network; + }): Promise; + getAccounts(data?: { + network?: Network; + }): Promise>; + signAndSendTransaction(params: SignAndSendTransactionParams): Promise; + signAndSendTransactions(params: SignAndSendTransactionsParams): Promise>; + signMessage(params: SignMessageParams): Promise; + signDelegateActions(params: SignDelegateActionsParams): Promise; + resolveAuth(params: ResolveAuthParams): Promise; +} +export default SandboxWallet; diff --git a/build/SandboxedWallet/index.js b/build/SandboxedWallet/index.js new file mode 100644 index 0000000..c4cce45 --- /dev/null +++ b/build/SandboxedWallet/index.js @@ -0,0 +1,93 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SandboxWallet = void 0; +const actions_1 = require("../actions"); +const resolveAuth_1 = require("../helpers/resolveAuth"); +const executor_1 = __importDefault(require("./executor")); +class SandboxWallet { + connector; + manifest; + executor; + constructor(connector, manifest) { + this.connector = connector; + this.manifest = manifest; + this.executor = new executor_1.default(connector, manifest); + } + async signIn(data) { + return this.executor.call("wallet:signIn", { + network: data?.network ?? this.connector.network, + addFunctionCallKey: data?.addFunctionCallKey, + }); + } + async signInAndSignMessage(data) { + const network = data?.network ?? this.connector.network; + if (this.manifest.features?.signInAndSignMessage === true) { + return this.executor.call("wallet:signInAndSignMessage", { + network, + addFunctionCallKey: data?.addFunctionCallKey, + messageParams: data.messageParams, + }); + } + return (0, resolveAuth_1.polyfillSignInAndSignMessage)(this, { ...data, network }); + } + async signOut(data) { + const args = { ...data, network: data?.network ?? this.connector.network }; + await this.executor.call("wallet:signOut", args); + await this.executor.clearStorage(); + } + async getAccounts(data) { + const args = { ...data, network: data?.network ?? this.connector.network }; + return this.executor.call("wallet:getAccounts", args); + } + async signAndSendTransaction(params) { + const actions = (0, actions_1.nearActionsToConnectorActions)(params.actions); + const args = { ...params, actions, network: params.network ?? this.connector.network }; + return this.executor.call("wallet:signAndSendTransaction", args); + } + async signAndSendTransactions(params) { + const transactions = params.transactions.map((transaction) => ({ + actions: (0, actions_1.nearActionsToConnectorActions)(transaction.actions), + receiverId: transaction.receiverId, + })); + const args = { ...params, transactions, network: params.network ?? this.connector.network }; + return this.executor.call("wallet:signAndSendTransactions", args); + } + async signMessage(params) { + const args = { ...params, network: params.network ?? this.connector.network }; + return this.executor.call("wallet:signMessage", args); + } + async signDelegateActions(params) { + const args = { + ...params, + delegateActions: params.delegateActions.map((delegateAction) => ({ + ...delegateAction, + actions: (0, actions_1.nearActionsToConnectorActions)(delegateAction.actions), + })), + network: params.network ?? this.connector.network, + }; + return this.executor.call("wallet:signDelegateActions", args); + } + async resolveAuth(params) { + const args = { ...params, network: params.network ?? this.connector.network }; + if (this.manifest.features?.resolveAuth === true) { + try { + return await this.executor.call("wallet:resolveAuth", args); + } + catch (e) { + // Manifest may advertise `resolveAuth: true` for a wallet that hasn't + // implemented it natively — that's the signal that the default + // signMessage-based fallback is acceptable. Only swallow the specific + // "method not found" signal; any other error is a real failure. + if (!(0, resolveAuth_1.isResolveAuthMethodNotFound)(e)) + throw e; + } + } + return (0, resolveAuth_1.defaultResolveAuthViaSignMessage)(this, args); + } +} +exports.SandboxWallet = SandboxWallet; +exports.default = SandboxWallet; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/SandboxedWallet/index.js.map b/build/SandboxedWallet/index.js.map new file mode 100644 index 0000000..c8c9c85 --- /dev/null +++ b/build/SandboxedWallet/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/SandboxedWallet/index.ts"],"names":[],"mappings":";;;;;;AAkBA,wCAA2D;AAC3D,wDAIgC;AAChC,0DAAyC;AAEzC,MAAa,aAAa;IAIb;IACA;IAJX,QAAQ,CAAkB;IAE1B,YACW,SAAwB,EACxB,QAAwB;QADxB,cAAS,GAAT,SAAS,CAAe;QACxB,aAAQ,G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file mode 100644 index 0000000..b4d5bc5 --- /dev/null +++ b/build/actions/index.d.ts @@ -0,0 +1,3 @@ +import type { Action } from "@near-js/transactions"; +import { ConnectorAction } from "./types"; +export declare const nearActionsToConnectorActions: (actions: (Action | ConnectorAction)[]) => ConnectorAction[]; diff --git a/build/actions/index.js b/build/actions/index.js new file mode 100644 index 0000000..99a2000 --- /dev/null +++ b/build/actions/index.js @@ -0,0 +1,105 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.nearActionsToConnectorActions = void 0; +const base58_1 = require("../helpers/base58"); +const deserializeArgs = (args) => { + try { + return JSON.parse(new TextDecoder().decode(args)); + } + catch { + return args; + } +}; +const nearActionsToConnectorActions = (actions) => { + return actions.map((action) => { + if ("type" in action) + return action; + if (action.functionCall) { + return { + type: "FunctionCall", + params: { + methodName: action.functionCall.methodName, + args: deserializeArgs(action.functionCall.args), + gas: action.functionCall.gas.toString(), + deposit: action.functionCall.deposit.toString(), + }, + }; + } + if (action.deployGlobalContract) { + return { + type: "DeployGlobalContract", + params: { + code: action.deployGlobalContract.code, + deployMode: action.deployGlobalContract.deployMode.AccountId ? "AccountId" : "CodeHash", + }, + }; + } + if (action.createAccount) { + return { type: "CreateAccount" }; + } + if (action.useGlobalContract) { + return { + type: "UseGlobalContract", + params: { + contractIdentifier: action.useGlobalContract.contractIdentifier.AccountId + ? { accountId: action.useGlobalContract.contractIdentifier.AccountId } + : { codeHash: (0, base58_1.encodeBase58)(action.useGlobalContract.contractIdentifier.CodeHash) }, + }, + }; + } + if (action.deployContract) { + return { + type: "DeployContract", + params: { code: action.deployContract.code }, + }; + } + if (action.deleteAccount) { + return { + type: "DeleteAccount", + params: { beneficiaryId: action.deleteAccount.beneficiaryId }, + }; + } + if (action.deleteKey) { + return { + type: "DeleteKey", + params: { publicKey: action.deleteKey.publicKey.toString() }, + }; + } + if (action.transfer) { + return { + type: "Transfer", + params: { deposit: action.transfer.deposit.toString() }, + }; + } + if (action.stake) { + return { + type: "Stake", + params: { + stake: action.stake.stake.toString(), + publicKey: action.stake.publicKey.toString(), + }, + }; + } + if (action.addKey) { + return { + type: "AddKey", + params: { + publicKey: action.addKey.publicKey.toString(), + accessKey: { + nonce: Number(action.addKey.accessKey.nonce), + permission: action.addKey.accessKey.permission.functionCall + ? { + receiverId: action.addKey.accessKey.permission.functionCall.receiverId, + allowance: action.addKey.accessKey.permission.functionCall.allowance?.toString(), + methodNames: action.addKey.accessKey.permission.functionCall.methodNames, + } + : "FullAccess", + }, + }, + }; + } + throw new Error("Unsupported action type"); + }); +}; +exports.nearActionsToConnectorActions = nearActionsToConnectorActions; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/actions/index.js.map b/build/actions/index.js.map new file mode 100644 index 0000000..d611914 --- /dev/null +++ b/build/actions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":";;;AAEA,8CAAiD;AAEjD,MAAM,eAAe,GAAG,CAAC,IAAgB,EAAE,EAAE;IAC3C,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAEK,MAAM,6BAA6B,GAAG,CAAC,OAAqC,EAAqB,EAAE;IACxG,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC5B,IAAI,MAAM,IAAI,MAAM;YAAE,OAAO,MAAyB,CAAC;QAEvD,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,OAAO;gBACL,IAAI,EAAE,cAAc;gBACpB,MAAM,EAAE;oBACN,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,UAAU;oBAC1C,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC;oBAC/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AAC,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,QAAQ,EAAE;gCAChF,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,WAAW;6BACzE;4BACH,CAAC,CAAC,YAAY;qBACjB;iBACF;aACF,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AApGW,QAAA,6BAA6B,iCAoGxC"} \ No newline at end of file diff --git a/build/actions/types.d.ts b/build/actions/types.d.ts new file mode 100644 index 0000000..ac75e90 --- /dev/null +++ b/build/actions/types.d.ts @@ -0,0 +1,76 @@ +export interface CreateAccountAction { + type: "CreateAccount"; +} +export interface DeployContractAction { + type: "DeployContract"; + params: { + code: Uint8Array; + }; +} +export interface FunctionCallAction { + type: "FunctionCall"; + params: { + methodName: string; + args: object; + gas: string; + deposit: string; + }; +} +export interface TransferAction { + type: "Transfer"; + params: { + deposit: string; + }; +} +export interface StakeAction { + type: "Stake"; + params: { + stake: string; + publicKey: string; + }; +} +export interface AddKeyAction { + type: "AddKey"; + params: { + publicKey: string; + accessKey: { + nonce?: number; + permission: "FullAccess" | { + receiverId: string; + allowance?: string; + methodNames?: Array; + }; + }; + }; +} +export interface DeleteKeyAction { + type: "DeleteKey"; + params: { + publicKey: string; + }; +} +export interface DeleteAccountAction { + type: "DeleteAccount"; + params: { + beneficiaryId: string; + }; +} +export interface UseGlobalContractAction { + type: "UseGlobalContract"; + params: { + contractIdentifier: { + accountId: string; + } | { + /** Base58 encoded code hash */ + codeHash: string; + }; + }; +} +export interface DeployGlobalContractAction { + type: "DeployGlobalContract"; + params: { + code: Uint8Array; + deployMode: "CodeHash" | "AccountId"; + }; +} +export type ConnectorAction = CreateAccountAction | DeployContractAction | FunctionCallAction | TransferAction | StakeAction | AddKeyAction | DeleteKeyAction | DeleteAccountAction | UseGlobalContractAction | DeployGlobalContractAction; diff --git a/build/actions/types.js b/build/actions/types.js new file mode 100644 index 0000000..11e638d --- /dev/null +++ b/build/actions/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/build/actions/types.js.map b/build/actions/types.js.map new file mode 100644 index 0000000..5721164 --- /dev/null +++ b/build/actions/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/actions/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/build/helpers/base58.d.ts b/build/helpers/base58.d.ts new file mode 100644 index 0000000..3342567 --- /dev/null +++ b/build/helpers/base58.d.ts @@ -0,0 +1,6 @@ +/** + * Encodes a Uint8Array into a base58 string. + * @param {Uint8Array} bytes + * @returns {string} + */ +export declare function encodeBase58(bytes: Uint8Array): string; diff --git a/build/helpers/base58.js b/build/helpers/base58.js new file mode 100644 index 0000000..16d2675 --- /dev/null +++ b/build/helpers/base58.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.encodeBase58 = encodeBase58; +// Base58 alphabet (Bitcoin) +const BASE58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; +/** + * Encodes a Uint8Array into a base58 string. + * @param {Uint8Array} bytes + * @returns {string} + */ +function encodeBase58(bytes) { + if (bytes.length === 0) + return ""; + // Count leading zeros. + let zeros = 0; + let i = 0; + while (i < bytes.length && bytes[i] === 0) { + zeros++; + i++; + } + // Convert byte array to base58 digits (big-endian). + let digits = [0]; + for (; i < bytes.length; i++) { + let carry = bytes[i]; + for (let j = 0; j < digits.length; ++j) { + carry += digits[j] << 8; + digits[j] = carry % 58; + carry = (carry / 58) | 0; + } + while (carry > 0) { + digits.push(carry % 58); + carry = (carry / 58) | 0; + } + } + // Add leading zeros in base58. + while (digits.length > 0 && digits[digits.length - 1] === 0) + digits.pop(); + let result = ""; + for (let k = 0; k < zeros; k++) { + result += BASE58_ALPHABET[0]; + } + for (let q = digits.length - 1; q >= 0; --q) { + result += BASE58_ALPHABET[digits[q]]; + } + return result; +} +//# sourceMappingURL=base58.js.map \ No newline at end of file diff --git a/build/helpers/base58.js.map b/build/helpers/base58.js.map new file mode 100644 index 0000000..97c7e36 --- /dev/null +++ b/build/helpers/base58.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base58.js","sourceRoot":"","sources":["../../src/helpers/base58.ts"],"names":[],"mappings":";;AAQA,oCAqCC;AA7CD,4BAA4B;AAC5B,MAAM,eAAe,GAAG,4DAA4D,CAAC;AAErF;;;;GAIG;AACH,SAAgB,YAAY,CAAC,KAAiB;IAC5C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElC,uBAAuB;IACvB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1C,KAAK,EAAE,CAAC;QACR,CAAC,EAAE,CAAC;IACN,CAAC;IAED,oDAAoD;IACpD,IAAI,MAAM,GAAa,CAAC,CAAC,CAAC,CAAC;IAC3B,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,IAAI,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACvC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACxB,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YACvB,KAAK,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QACD,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;YACxB,KAAK,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,+BAA+B;IAC/B,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC;QAAE,MAAM,CAAC,GAAG,EAAE,CAAC;IAE1E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,MAAM,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/build/helpers/events.d.ts b/build/helpers/events.d.ts new file mode 100644 index 0000000..98f938b --- /dev/null +++ b/build/helpers/events.d.ts @@ -0,0 +1,42 @@ +/** + * Generic event emitter class for handling typed events and their callbacks + * @template T Record type containing event names as keys and their payload types as values + */ +export declare class EventEmitter> { + /** Internal storage for event callbacks */ + private events; + /** + * Subscribe to an event + * @template K Event name type + * @param event Name of the event to subscribe to + * @param callback Function to be called when event is emitted + */ + on(event: K, callback: (payload: T[K]) => void): void; + /** + * Emit an event with payload + * @template K Event name type + * @param event Name of the event to emit + * @param payload Data to pass to event handlers + */ + emit(event: K, payload: T[K]): void; + /** + * Unsubscribe from an event + * @template K Event name type + * @param event Name of the event to unsubscribe from + * @param callback Function to remove from event handlers + */ + off(event: K, callback: (payload: T[K]) => void): void; + /** + * Subscribe to an event for a single emission + * @template K Event name type + * @param event Name of the event to subscribe to + * @param callback Function to be called when event is emitted + */ + once(event: K, callback: (payload: T[K]) => void): void; + /** + * Remove all event listeners + * @template K Event name type + * @param event Optional event name to remove listeners for. If not provided, removes all listeners for all events + */ + removeAllListeners(event?: K): void; +} diff --git a/build/helpers/events.js b/build/helpers/events.js new file mode 100644 index 0000000..11bf42f --- /dev/null +++ b/build/helpers/events.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EventEmitter = void 0; +/** + * Generic event emitter class for handling typed events and their callbacks + * @template T Record type containing event names as keys and their payload types as values + */ +class EventEmitter { + /** Internal storage for event callbacks */ + events = {}; + /** + * Subscribe to an event + * @template K Event name type + * @param event Name of the event to subscribe to + * @param callback Function to be called when event is emitted + */ + on(event, callback) { + if (!this.events[event]) + this.events[event] = []; + this.events[event].push(callback); + } + /** + * Emit an event with payload + * @template K Event name type + * @param event Name of the event to emit + * @param payload Data to pass to event handlers + */ + emit(event, payload) { + this.events[event]?.forEach((cb) => cb(payload)); + } + /** + * Unsubscribe from an event + * @template K Event name type + * @param event Name of the event to unsubscribe from + * @param callback Function to remove from event handlers + */ + off(event, callback) { + this.events[event] = this.events[event]?.filter((cb) => cb !== callback); + } + /** + * Subscribe to an event for a single emission + * @template K Event name type + * @param event Name of the event to subscribe to + * @param callback Function to be called when event is emitted + */ + once(event, callback) { + const onceWrapper = (payload) => { + callback(payload); + this.off(event, onceWrapper); + }; + this.on(event, onceWrapper); + } + /** + * Remove all event listeners + * @template K Event name type + * @param event Optional event name to remove listeners for. If not provided, removes all listeners for all events + */ + removeAllListeners(event) { + if (event) { + delete this.events[event]; + } + else { + this.events = {}; + } + } +} +exports.EventEmitter = EventEmitter; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/build/helpers/events.js.map b/build/helpers/events.js.map new file mode 100644 index 0000000..2cfb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E,CAAC;YACV,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AA7DD,oCA6DC"} \ No newline at end of file diff --git a/build/helpers/html.d.ts b/build/helpers/html.d.ts new file mode 100644 index 0000000..32997b2 --- /dev/null +++ b/build/helpers/html.d.ts @@ -0,0 +1,8 @@ +export declare function escapeHtml(unsafe: string): string; +declare const htmlTag: unique symbol; +export interface HtmlString { + [htmlTag]: string; + html: string; +} +export declare function html(strings: TemplateStringsArray, ...values: any[]): HtmlString; +export {}; diff --git a/build/helpers/html.js b/build/helpers/html.js new file mode 100644 index 0000000..f8e07f0 --- /dev/null +++ b/build/helpers/html.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeHtml = escapeHtml; +exports.html = html; +function escapeHtml(unsafe) { + return unsafe + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} +const htmlTag = Symbol("htmlTag"); +function html(strings, ...values) { + let result = strings[0]; + for (let i = 0; i < values.length; i++) { + for (const value of Array.isArray(values[i]) ? values[i] : [values[i]]) { + const escaped = value?.[htmlTag] ? value[htmlTag] : escapeHtml(String(value ?? "")); + result += escaped; + } + result += strings[i + 1]; + } + return Object.freeze({ + [htmlTag]: result, + get html() { + return result; + }, + }); +} +//# sourceMappingURL=html.js.map \ No newline at end of file diff --git a/build/helpers/html.js.map b/build/helpers/html.js.map new file mode 100644 index 0000000..7879bbe --- /dev/null +++ b/build/helpers/html.js.map @@ -0,0 +1 @@ +{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/helpers/html.ts"],"names":[],"mappings":";;AAAA,gCAOC;AASD,oBAkBC;AAlCD,SAAgB,UAAU,CAAC,MAAc;IACvC,OAAO,MAAM;SACV,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAOlC,SAAgB,IAAI,CAAC,OAA6B,EAAE,GAAG,MAAa;IAClE,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;YACpF,MAAM,IAAI,OAAO,CAAC;QACpB,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,CAAC,OAAO,CAAC,EAAE,MAAM;QACjB,IAAI,IAAI;YACN,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/build/helpers/indexdb.d.ts b/build/helpers/indexdb.d.ts new file mode 100644 index 0000000..29ae1e4 --- /dev/null +++ b/build/helpers/indexdb.d.ts @@ -0,0 +1,14 @@ +export default class IndexedDB { + dbName: string; + storeName: string; + version: number; + constructor(dbName: string, storeName: string); + getDb(): Promise; + getItem(key: string | number): Promise; + setItem(key: string | number, value: any): Promise; + removeItem(key: string | number): Promise; + keys(): Promise; + count(): Promise; + length(): Promise; + clear(): Promise; +} diff --git a/build/helpers/indexdb.js b/build/helpers/indexdb.js new file mode 100644 index 0000000..718180b --- /dev/null +++ b/build/helpers/indexdb.js @@ -0,0 +1,166 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class IndexedDB { + dbName; + storeName; + version; + constructor(dbName, storeName) { + this.dbName = dbName; + this.storeName = storeName; + this.version = 1; + } + getDb() { + return new Promise((resolve, reject) => { + if (typeof window === "undefined" || typeof indexedDB === "undefined") { + reject(new Error("IndexedDB is not available (SSR environment)")); + return; + } + const request = indexedDB.open(this.dbName, this.version); + request.onerror = (event) => { + console.error("Error opening database:", event.target.error); + reject(new Error("Error opening database")); + }; + request.onsuccess = (event) => { + resolve(request.result); + }; + request.onupgradeneeded = (event) => { + const db = request.result; + const existingStores = db.objectStoreNames; + if (!existingStores.contains(this.storeName)) { + db.createObjectStore(this.storeName); + } + }; + }); + } + async getItem(key) { + const db = await this.getDb(); + if (typeof key === "number") { + key = key.toString(); + } + if (typeof key !== "string") { + throw new Error("Key must be a string"); + } + return new Promise((resolve, reject) => { + if (!this.storeName) { + reject(new Error("Store name not set")); + return; + } + const transaction = db.transaction(this.storeName, "readonly"); + transaction.onerror = (event) => reject(transaction.error); + const store = transaction.objectStore(this.storeName); + const request = store.get(key); + request.onerror = (event) => reject(request.error); + request.onsuccess = () => { + resolve(request.result); + db.close(); + }; + }); + } + async setItem(key, value) { + const db = await this.getDb(); + if (typeof key === "number") { + key = key.toString(); + } + if (typeof key !== "string") { + throw new Error("Key must be a string"); + } + return new Promise((resolve, reject) => { + if (!this.storeName) { + reject(new Error("Store name not set")); + return; + } + const transaction = db.transaction(this.storeName, "readwrite"); + transaction.onerror = (event) => reject(transaction.error); + const store = transaction.objectStore(this.storeName); + const request = store.put(value, key); + request.onerror = (event) => reject(request.error); + request.onsuccess = () => { + db.close(); + resolve(); + }; + }); + } + async removeItem(key) { + const db = await this.getDb(); + if (typeof key === "number") { + key = key.toString(); + } + if (typeof key !== "string") { + throw new Error("Key must be a string"); + } + return new Promise((resolve, reject) => { + if (!this.storeName) { + reject(new Error("Store name not set")); + return; + } + const transaction = db.transaction(this.storeName, "readwrite"); + transaction.onerror = (event) => reject(transaction.error); + const store = transaction.objectStore(this.storeName); + const request = store.delete(key); + request.onerror = (event) => reject(request.error); + request.onsuccess = () => { + db.close(); + resolve(); + }; + }); + } + async keys() { + const db = await this.getDb(); + return new Promise((resolve, reject) => { + if (!this.storeName) { + reject(new Error("Store name not set")); + return; + } + const transaction = db.transaction(this.storeName, "readonly"); + transaction.onerror = (event) => reject(transaction.error); + const store = transaction.objectStore(this.storeName); + const request = store.getAllKeys(); + request.onerror = (event) => reject(request.error); + request.onsuccess = () => { + resolve(request.result); + db.close(); + }; + }); + } + async count() { + const db = await this.getDb(); + return new Promise((resolve, reject) => { + if (!this.storeName) { + reject(new Error("Store name not set")); + return; + } + const transaction = db.transaction(this.storeName, "readonly"); + transaction.onerror = (event) => reject(transaction.error); + const store = transaction.objectStore(this.storeName); + const request = store.count(); + request.onerror = (event) => reject(request.error); + request.onsuccess = () => { + resolve(request.result); + db.close(); + }; + }); + } + async length() { + return this.count(); + } + async clear() { + const db = await this.getDb(); + return new Promise((resolve, reject) => { + if (!this.storeName) { + reject(new Error("Store name not set")); + return; + } + const transaction = db.transaction(this.storeName, "readwrite"); + transaction.onerror = (event) => reject(transaction.error); + const store = transaction.objectStore(this.storeName); + const request = store.clear(); + request.onerror = (event) => reject(request.error); + request.onsuccess = () => { + db.close(); + resolve(); + }; + }); + } +} +exports.default = IndexedDB; +//# sourceMappingURL=indexdb.js.map \ No newline at end of file diff --git a/build/helpers/indexdb.js.map b/build/helpers/indexdb.js.map new file mode 100644 index 0000000..20b76b4 --- /dev/null +++ b/build/helpers/ind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C,CAAC;YACnD,OAAO,CAAC,SAAS,GAAG,GAAG,EAAE;gBACvB,EAAE,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzMD,4BAyMC"} \ No newline at end of file diff --git a/build/helpers/queue.d.ts b/build/helpers/queue.d.ts new file mode 100644 index 0000000..dbac252 --- /dev/null +++ b/build/helpers/queue.d.ts @@ -0,0 +1,11 @@ +export declare class Queue { + _items: any[]; + enqueue(item: any): void; + dequeue(): any; + get size(): number; +} +export declare class AutoQueue extends Queue { + _pendingPromise: boolean; + enqueue(action: () => Promise): Promise; + dequeue(): Promise; +} diff --git a/build/helpers/queue.js b/build/helpers/queue.js new file mode 100644 index 0000000..8ec71a8 --- /dev/null +++ b/build/helpers/queue.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AutoQueue = exports.Queue = void 0; +class Queue { + _items = []; + enqueue(item) { + this._items.push(item); + } + dequeue() { + return this._items.shift(); + } + get size() { + return this._items.length; + } +} +exports.Queue = Queue; +class AutoQueue extends Queue { + _pendingPromise = false; + enqueue(action) { + return new Promise((resolve, reject) => { + super.enqueue({ action, resolve, reject }); + this.dequeue(); + }); + } + async dequeue() { + if (this._pendingPromise) + return false; + const item = super.dequeue(); + if (!item) + return false; + try { + this._pendingPromise = true; + const payload = await item.action(this); + this._pendingPromise = false; + item.resolve(payload); + } + catch (e) { + this._pendingPromise = false; + item.reject(e); + } + finally { + void this.dequeue(); + } + return true; + } +} +exports.AutoQueue = AutoQueue; +//# sourceMappingURL=queue.js.map \ No newline at end of file diff --git a/build/helpers/queue.js.map b/build/helpers/queue.js.map new file mode 100644 index 0000000..18bf9db --- /dev/null +++ b/build/helpers/queue.js.map @@ -0,0 +1 @@ +{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/helpers/queue.ts"],"names":[],"mappings":";;;AAAA,MAAa,KAA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IAAI,CAAC;IACd,CAAC;CACF;AA5BD,8BA4BC"} \ No newline at end of file diff --git a/build/helpers/resolveAuth.d.ts b/build/helpers/resolveAuth.d.ts new file mode 100644 index 0000000..68666b9 --- /dev/null +++ b/build/helpers/resolveAuth.d.ts @@ -0,0 +1,38 @@ +import type { AccountWithSignedMessage, NearWalletBase, ResolveAuthParams, ResolveAuthResponse, SignInAndSignMessageParams } from "../types"; +/** + * NEP-641 default `resolveAuth` implementation, built on top of NEP-413 + * `signMessage`. Per NEP-641 §"NEP-413 fallback", the `purpose` is bound + * into the signed material by prefixing the `recipient` field with + * `"@"`. The dApp backend reconstructs the same prefix when it + * cannot find `w_resolve_auth` on the account and falls back to NEP-413 + * verification. + * + * If the user is not yet signed in to the wallet, the helper uses + * `signInAndSignMessage` to combine sign-in and authorization into a single + * user gesture; otherwise it uses the standalone `signMessage` against the + * already-connected account. + * + * The returned `authorization` is a JSON-stringified NEP-413 `SignedMessage` + * extended with the original `purpose`, `recipient`, and `payload` so the + * dApp can fully reconstruct the verification input without out-of-band + * context. The bound `recipient` used inside the NEP-413 signature is + * `"@"`. + */ +export declare function defaultResolveAuthViaSignMessage(wallet: Pick, params: ResolveAuthParams): Promise; +/** + * Polyfill `signInAndSignMessage` for wallets that don't support the combined + * flow natively but expose `signIn` (without addKey) + `signMessage`. The + * polyfill runs sign-in followed by a separate signMessage on the + * newly-connected account. Two user gestures instead of one. + */ +export declare function polyfillSignInAndSignMessage(wallet: Pick, data: SignInAndSignMessageParams): Promise; +/** + * Detects the "method not found" signal from a wallet's native `resolveAuth` + * attempt. The sandbox executor rejects with the literal string + * `"Method not found"` when the wallet code doesn't implement the method; + * injected/parent-frame wallets surface the same condition via an `Error` + * with a similar message. Used by the wrappers to fall through to the + * default signMessage-based implementation even when the manifest claims + * `resolveAuth: true`. + */ +export declare function isResolveAuthMethodNotFound(e: unknown): boolean; diff --git a/build/helpers/resolveAuth.js b/build/helpers/resolveAuth.js new file mode 100644 index 0000000..7075c7f --- /dev/null +++ b/build/helpers/resolveAuth.js @@ -0,0 +1,102 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultResolveAuthViaSignMessage = defaultResolveAuthViaSignMessage; +exports.polyfillSignInAndSignMessage = polyfillSignInAndSignMessage; +exports.isResolveAuthMethodNotFound = isResolveAuthMethodNotFound; +/** + * NEP-641 default `resolveAuth` implementation, built on top of NEP-413 + * `signMessage`. Per NEP-641 §"NEP-413 fallback", the `purpose` is bound + * into the signed material by prefixing the `recipient` field with + * `"@"`. The dApp backend reconstructs the same prefix when it + * cannot find `w_resolve_auth` on the account and falls back to NEP-413 + * verification. + * + * If the user is not yet signed in to the wallet, the helper uses + * `signInAndSignMessage` to combine sign-in and authorization into a single + * user gesture; otherwise it uses the standalone `signMessage` against the + * already-connected account. + * + * The returned `authorization` is a JSON-stringified NEP-413 `SignedMessage` + * extended with the original `purpose`, `recipient`, and `payload` so the + * dApp can fully reconstruct the verification input without out-of-band + * context. The bound `recipient` used inside the NEP-413 signature is + * `"@"`. + */ +async function defaultResolveAuthViaSignMessage(wallet, params) { + const nonce = crypto.getRandomValues(new Uint8Array(32)); + const boundRecipient = `${params.purpose}@${params.recipient}`; + const messageParams = { message: params.payload, recipient: boundRecipient, nonce }; + const accounts = await wallet.getAccounts({ network: params.network }).catch(() => []); + const isConnected = !!(accounts?.length && accounts[0]?.accountId); + let signed; + if (!isConnected) { + const result = await wallet.signInAndSignMessage({ + network: params.network, + messageParams, + }); + if (!result?.length || !result[0]?.signedMessage) { + throw new Error("Wallet returned no signed message during sign-in"); + } + signed = result[0].signedMessage; + } + else { + signed = await wallet.signMessage({ ...messageParams, network: params.network }); + } + // NEP-641 §"NEP-413 fallback": the authorization blob is a NEP-413 + // `SignedMessage` so a generic resolver can verify it without out-of-band + // context. Includes the SignedMessagePayload fields (message, recipient, + // nonce, callbackUrl) needed to recompute the borsh hash. + const authorization = JSON.stringify({ + accountId: signed.accountId, + publicKey: signed.publicKey, + signature: signed.signature, + message: params.payload, + recipient: boundRecipient, + nonce: bytesToBase64(nonce), + callbackUrl: null, + state: null, + }); + return { accountId: signed.accountId, authorization }; +} +/** + * Polyfill `signInAndSignMessage` for wallets that don't support the combined + * flow natively but expose `signIn` (without addKey) + `signMessage`. The + * polyfill runs sign-in followed by a separate signMessage on the + * newly-connected account. Two user gestures instead of one. + */ +async function polyfillSignInAndSignMessage(wallet, data) { + const accounts = await wallet.signIn({ + network: data.network, + addFunctionCallKey: data.addFunctionCallKey, + }); + const signedMessage = await wallet.signMessage({ + ...data.messageParams, + network: data.network, + }); + return accounts.map((account) => ({ ...account, signedMessage })); +} +function bytesToBase64(bytes) { + let s = ""; + for (const b of bytes) + s += String.fromCharCode(b); + return btoa(s); +} +/** + * Detects the "method not found" signal from a wallet's native `resolveAuth` + * attempt. The sandbox executor rejects with the literal string + * `"Method not found"` when the wallet code doesn't implement the method; + * injected/parent-frame wallets surface the same condition via an `Error` + * with a similar message. Used by the wrappers to fall through to the + * default signMessage-based implementation even when the manifest claims + * `resolveAuth: true`. + */ +function isResolveAuthMethodNotFound(e) { + const probe = typeof e === "string" + ? e + : typeof e?.message === "string" + ? e.message + : ""; + const lower = probe.toLowerCase(); + return lower.includes("method not found") || lower.includes("methodnotfound"); +} +//# sourceMappingURL=resolveAuth.js.map \ No newline at end of file diff --git a/build/helpers/resolveAuth.js.map b/build/helpers/resolveAuth.js.map new file mode 100644 index 0000000..1079bc4 --- /dev/null +++ b/build/helpers/resolveAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolveAuth.js","sourceRoot":"","sources":["../../src/helpers/resolveAuth.ts"],"names":[],"mappings":";;AA4BA,4EAyCC;AAQD,oEAaC;AAiBD,kEASC;AA3GD;;;;;;;;;;;;;;;;;;GAkBG;AACI,KAAK,UAAU,gCAAgC,CACpD,MAAoF,EACpF,MAAyB;IAEzB,MAAM,KAAK,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAA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ACX,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,KAAK,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAChF,CAAC"} \ No newline at end of file diff --git a/build/helpers/storage.d.ts b/build/helpers/storage.d.ts new file mode 100644 index 0000000..278f972 --- /dev/null +++ b/build/helpers/storage.d.ts @@ -0,0 +1,10 @@ +export interface DataStorage { + get(key: string): Promise; + set(key: string, value: string): Promise; + remove(key: string): Promise; +} +export declare class LocalStorage implements DataStorage { + get(key: string): Promise; + set(key: string, value: string): Promise; + remove(key: string): Promise; +} diff --git a/build/helpers/storage.js b/build/helpers/storage.js new file mode 100644 index 0000000..6acd3f8 --- /dev/null +++ b/build/helpers/storage.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LocalStorage = void 0; +class LocalStorage { + async get(key) { + if (typeof window === "undefined") + return null; + return localStorage.getItem(key); + } + async set(key, value) { + if (typeof window === "undefined") + return; + localStorage.setItem(key, value); + } + async remove(key) { + if (typeof window === "undefined") + return; + localStorage.removeItem(key); + } +} +exports.LocalStorage = LocalStorage; +//# sourceMappingURL=storage.js.map \ No newline at end of file diff --git a/build/helpers/storage.js.map b/build/helpers/storage.js.map new file mode 100644 index 0000000..02dd9eb --- /dev/null +++ b/build/helpers/storage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/helpers/storage.ts"],"names":[],"mappings":";;;AAMA,MAAa,YAAY;IACvB,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC;QAC/C,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAa;QAClC,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAC1C,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO;QAC1C,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACF;AAfD,oCAeC"} \ No newline at end of file diff --git a/build/helpers/url.d.ts b/build/helpers/url.d.ts new file mode 100644 index 0000000..4adab81 --- /dev/null +++ b/build/helpers/url.d.ts @@ -0,0 +1 @@ +export declare const parseUrl: (url: string) => URL | null; diff --git a/build/helpers/url.js b/build/helpers/url.js new file mode 100644 index 0000000..2a0f573 --- /dev/null +++ b/build/helpers/url.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseUrl = void 0; +const parseUrl = (url) => { + try { + return new URL(url); + } + catch { + return null; + } +}; +exports.parseUrl = parseUrl; +//# sourceMappingURL=url.js.map \ No newline at end of file diff --git a/build/helpers/url.js.map b/build/helpers/url.js.map new file mode 100644 index 0000000..f9e9abd --- /dev/null +++ b/build/helpers/url.js.map @@ -0,0 +1 @@ +{"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/helpers/url.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE;IACtC,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB"} \ No newline at end of file diff --git a/build/helpers/uuid.d.ts b/build/helpers/uuid.d.ts new file mode 100644 index 0000000..51af9ed --- /dev/null +++ b/build/helpers/uuid.d.ts @@ -0,0 +1 @@ +export declare const uuid4: () => string; diff --git a/build/helpers/uuid.js b/build/helpers/uuid.js new file mode 100644 index 0000000..72579ce --- /dev/null +++ b/build/helpers/uuid.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uuid4 = void 0; +const uuid4 = () => { + if (typeof window !== "undefined" && typeof window.crypto !== "undefined" && typeof window.crypto.randomUUID === "function") + return window.crypto.randomUUID(); + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + const r = (Math.random() * 16) | 0; + const v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); +}; +exports.uuid4 = uuid4; +//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/build/helpers/uuid.js.map b/build/helpers/uuid.js.map new file mode 100644 index 0000000..dc85ea1 --- /dev/null +++ b/build/helpers/uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src/helpers/uuid.ts"],"names":[],"mappings":";;;AAAO,MAAM,KAAK,GAAG,GAAG,EAAE;IACxB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,KAAK,UAAU;QACzH,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,OAAO,sCAAsC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC;QACxE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;QACnC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC1C,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AATW,QAAA,KAAK,SAShB"} \ No newline at end of file diff --git a/build/helpers/verifyResolveAuth.d.ts b/build/helpers/verifyResolveAuth.d.ts new file mode 100644 index 0000000..3f0f9fc --- /dev/null +++ b/build/helpers/verifyResolveAuth.d.ts @@ -0,0 +1,21 @@ +export type ResolveAuthPurpose = "PROVE_OWNERSHIP" | "APPROVE_OFFCHAIN_ACTION"; +export type VerifyResolveAuthResult = { + status: "RESOLVED"; + payload: string; +} | { + status: "INVALID"; + errorKind?: string; + errorMessage: string; +}; +export interface VerifyResolveAuthArgs { + rpcUrl: string; + accountId: string; + purpose: ResolveAuthPurpose; + recipient: string; + authorization: string; + /** If omitted, the finalized block at call time is used. */ + blockId?: number; + /** Defaults to 8. */ + maxDepth?: number; +} +export declare function verifyResolveAuth(args: VerifyResolveAuthArgs): Promise; diff --git a/build/helpers/verifyResolveAuth.js b/build/helpers/verifyResolveAuth.js new file mode 100644 index 0000000..2759c44 --- /dev/null +++ b/build/helpers/verifyResolveAuth.js @@ -0,0 +1,299 @@ +"use strict"; +// NEP-641 client-side resolver. Implements the canonical caller-side +// algorithm from nep-0641.md §"Caller-side resolution algorithm", including +// the NEP-413 fallback (§"NEP-413 fallback"). +Object.defineProperty(exports, "__esModule", { value: true }); +exports.verifyResolveAuth = verifyResolveAuth; +const ed25519_1 = require("@noble/curves/ed25519"); +const sha2_1 = require("@noble/hashes/sha2"); +const base_1 = require("@scure/base"); +const NEP413_TAG = 2147484061; // 2^31 + 413 +// ─── RPC ───────────────────────────────────────────────────────────────────── +async function rpc(rpcUrl, method, params) { + const resp = await fetch(rpcUrl, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }), + }); + const json = await resp.json(); + if (json.error) { + // Generic JSON-RPC `message` (e.g. "Server error") hides the actual + // failure, which lives in `error.data` and `error.cause`. Concatenate + // them so downstream probes (account-not-found, method-not-found) see + // the full signal. + const err = new Error(formatRpcError(json.error)); + err.data = json.error.data; + err.cause = json.error.cause; + throw err; + } + if (json.result?.error) { + const data = json.result.error; + const err = new Error(typeof data === "string" ? data : JSON.stringify(data)); + err.data = data; + throw err; + } + return json.result; +} +function formatRpcError(error) { + const parts = []; + if (error.message) + parts.push(error.message); + if (error.data != null) { + parts.push(typeof error.data === "string" ? error.data : JSON.stringify(error.data)); + } + if (error.cause != null) { + parts.push(typeof error.cause === "string" ? error.cause : JSON.stringify(error.cause)); + } + return parts.join(" — ") || "RPC error"; +} +async function getFinalBlockId(rpcUrl) { + const r = await rpc(rpcUrl, "block", { finality: "final" }); + return r.header.height; +} +async function viewCall(rpcUrl, accountId, methodName, args, blockId) { + const argsBase64 = btoa(JSON.stringify(args)); + const result = await rpc(rpcUrl, "query", { + request_type: "call_function", + block_id: blockId, + account_id: accountId, + method_name: methodName, + args_base64: argsBase64, + }); + return new Uint8Array(result.result); +} +async function fetchAccessKeyList(rpcUrl, accountId, blockId) { + const result = await rpc(rpcUrl, "query", { + request_type: "view_access_key_list", + block_id: blockId, + account_id: accountId, + }); + return result.keys ?? []; +} +// Per NEP-641 §"NEP-413 fallback", fall back ONLY when the contract method +// genuinely does not exist (or no contract is deployed at all). We must NOT +// fall back on other compilation/runtime errors — that could mask real bugs +// in a deployed wallet contract. +function isMethodNotFound(e) { + const err = e; + const probe = `${err.message ?? ""} ${typeof err.data === "string" ? err.data : JSON.stringify(err.data ?? "")}`.toLowerCase(); + return ( + // contract has no such method + probe.includes("methodresolveerror") || + probe.includes("method not found") || + probe.includes("methodnotfound") || + probe.includes("methodnamemismatch") || + probe.includes("methodutf8error") || + // no contract code is deployed on the account + probe.includes("codedoesnotexist") || + probe.includes("contractcodenotfound") || + probe.includes("no contract code")); +} +// ─── Borsh / hashing for NEP-413 ───────────────────────────────────────────── +class BorshWriter { + buf = []; + writeU8(v) { this.buf.push(v & 0xff); } + writeU32(v) { + this.buf.push(v & 0xff, (v >>> 8) & 0xff, (v >>> 16) & 0xff, (v >>> 24) & 0xff); + } + writeString(s) { + const b = new TextEncoder().encode(s); + this.writeU32(b.length); + for (const c of b) + this.buf.push(c); + } + writeBytes(b) { for (const c of b) + this.buf.push(c); } + writeOptionString(s) { + if (s == null) + this.writeU8(0); + else { + this.writeU8(1); + this.writeString(s); + } + } + toBytes() { return new Uint8Array(this.buf); } +} +function nep413Hash(msg) { + const w = new BorshWriter(); + w.writeU32(NEP413_TAG); + w.writeString(msg.message); + const nonce = base_1.base64.decode(msg.nonce); + if (nonce.length !== 32) + throw new Error("nep-413 nonce must be 32 bytes"); + w.writeBytes(nonce); + w.writeString(msg.recipient); + w.writeOptionString(msg.callbackUrl ?? null); + return (0, sha2_1.sha256)(w.toBytes()); +} +// ─── ed25519 key/signature decoding ────────────────────────────────────────── +function decodeEd25519PublicKey(s) { + // Accepts "ed25519:" (NEAR canonical form). + if (!s.startsWith("ed25519:")) + throw new Error("publicKey must start with 'ed25519:'"); + const raw = base_1.base58.decode(s.slice("ed25519:".length)); + if (raw.length !== 32) + throw new Error(`ed25519 public key must be 32 bytes, got ${raw.length}`); + return raw; +} +function decodeEd25519Signature(s) { + // Accept either raw base64 (NEP-413 canonical form for signMessage output) + // or "ed25519:" for callers that pre-encoded. + let raw; + if (s.startsWith("ed25519:")) { + raw = base_1.base58.decode(s.slice("ed25519:".length)); + } + else { + raw = base_1.base64.decode(s); + } + if (raw.length !== 64) + throw new Error(`ed25519 signature must be 64 bytes, got ${raw.length}`); + return raw; +} +// ─── NEP-413 fallback ──────────────────────────────────────────────────────── +async function nep413Fallback(rpcUrl, accountId, purpose, recipient, authorization, blockId) { + let msg; + try { + msg = JSON.parse(authorization); + } + catch { + return { status: "INVALID", errorMessage: "authorization is not valid NEP-413 JSON" }; + } + if (!msg.publicKey || !msg.signature || msg.message == null || !msg.recipient || !msg.nonce) { + return { status: "INVALID", errorMessage: "authorization missing NEP-413 fields" }; + } + const expectedRecipient = `${purpose}@${recipient}`; + if (msg.recipient !== expectedRecipient) { + return { status: "INVALID", errorMessage: `recipient mismatch: expected "${expectedRecipient}"` }; + } + // Verify the public key is registered on `accountId` at the pinned block. + const keys = await fetchAccessKeyList(rpcUrl, accountId, blockId); + if (!keys.some((k) => k.public_key === msg.publicKey)) { + return { status: "INVALID", errorMessage: "public key not registered on account at pinned block" }; + } + // Verify ed25519 signature against the precomputed NEP-413 hash. + let hash; + try { + hash = nep413Hash(msg); + } + catch (e) { + return { status: "INVALID", errorMessage: e.message }; + } + let signature; + let publicKey; + try { + signature = decodeEd25519Signature(msg.signature); + publicKey = decodeEd25519PublicKey(msg.publicKey); + } + catch (e) { + return { status: "INVALID", errorMessage: e.message }; + } + if (!ed25519_1.ed25519.verify(signature, hash, publicKey)) { + return { status: "INVALID", errorMessage: "bad signature" }; + } + return { status: "RESOLVED", payload: msg.message }; +} +// ─── Recursive resolver ────────────────────────────────────────────────────── +async function resolve(rpcUrl, accountId, purpose, recipient, authorization, blockId, depth, maxDepth) { + if (depth > maxDepth) { + return { status: "INVALID", errorMessage: "recursion limit exceeded" }; + } + let viewBytes; + try { + viewBytes = await viewCall(rpcUrl, accountId, "w_resolve_auth", { purpose, recipient, authorization }, blockId); + } + catch (e) { + if (isMethodNotFound(e)) { + try { + return await nep413Fallback(rpcUrl, accountId, purpose, recipient, authorization, blockId); + } + catch (fe) { + return { + status: "INVALID", + errorKind: isUnknownAccountError(fe) ? ERROR_KIND_UNKNOWN_ACCOUNT : undefined, + errorMessage: fe.message ?? String(fe), + }; + } + } + return { + status: "INVALID", + errorKind: isUnknownAccountError(e) ? ERROR_KIND_UNKNOWN_ACCOUNT : undefined, + errorMessage: e.message ?? String(e), + }; + } + let parsed; + try { + parsed = JSON.parse(new TextDecoder().decode(viewBytes)); + } + catch { + return { status: "INVALID", errorMessage: "w_resolve_auth returned non-JSON" }; + } + if (parsed.status === "RESOLVED") { + if (parsed.payload == null) + return { status: "INVALID", errorMessage: "RESOLVED missing payload" }; + return { status: "RESOLVED", payload: parsed.payload }; + } + if (parsed.status === "INVALID") { + // NEP-641 §"Authoritative contract method (no downgrade)": once + // w_resolve_auth returns INVALID, we MUST NOT fall back to NEP-413. + return { + status: "INVALID", + errorKind: parsed.error_kind, + errorMessage: parsed.error_message ?? "INVALID", + }; + } + if (parsed.status === "PENDING") { + const pendings = parsed.pending_authorizations ?? []; + if (pendings.length === 0) { + return { status: "INVALID", errorMessage: "contract returned PENDING with no dependencies" }; + } + if (parsed.payload == null) { + return { status: "INVALID", errorMessage: "PENDING missing payload" }; + } + for (const sub of pendings) { + const subResult = await resolve(rpcUrl, sub.account_id, sub.purpose, recipient, sub.authorization, blockId, depth + 1, maxDepth); + if (subResult.status !== "RESOLVED") + return subResult; + if (subResult.payload !== parsed.payload) { + return { status: "INVALID", errorMessage: "payload mismatch in sub-resolution" }; + } + } + return { status: "RESOLVED", payload: parsed.payload }; + } + return { status: "INVALID", errorMessage: `unknown status: ${parsed.status}` }; +} +// Account-not-found can transiently appear after a relayer creates the +// wallet-contract account: the dApp's view call may race ahead of the chain +// indexing the new account. Retry the resolution with exponential backoff so +// the caller doesn't see a false negative. +const ACCOUNT_NOT_FOUND_RETRY_DELAYS_MS = [1000, 2000, 4000, 8000, 16000]; +// Internal marker set on the result when the underlying RPC error has the +// typed cause name "UNKNOWN_ACCOUNT". Used to drive the retry loop without +// resorting to free-text error-message parsing. +const ERROR_KIND_UNKNOWN_ACCOUNT = "UNKNOWN_ACCOUNT"; +function isUnknownAccountError(e) { + const err = e; + return err?.cause?.name === "UNKNOWN_ACCOUNT"; +} +function sleep(ms) { + return new Promise((r) => setTimeout(r, ms)); +} +async function verifyResolveAuth(args) { + const maxDepth = args.maxDepth ?? 8; + let lastResult = null; + // Initial attempt + 5 retries with delays 1s, 2s, 4s, 8s, 16s when the + // resolver reports the account doesn't exist yet. + for (let attempt = 0; attempt <= ACCOUNT_NOT_FOUND_RETRY_DELAYS_MS.length; attempt++) { + if (attempt > 0) + await sleep(ACCOUNT_NOT_FOUND_RETRY_DELAYS_MS[attempt - 1]); + // Re-pin the block each attempt so access-key lookups in the NEP-413 + // fallback see the latest chain state once the account materialises. + const blockId = args.blockId ?? (await getFinalBlockId(args.rpcUrl)); + lastResult = await resolve(args.rpcUrl, args.accountId, args.purpose, args.recipient, args.authorization, blockId, 0, maxDepth); + if (lastResult.status === "RESOLVED") + return lastResult; + if (lastResult.errorKind !== ERROR_KIND_UNKNOWN_ACCOUNT) + return lastResult; + } + return lastResult; +} +//# sourceMappingURL=verifyResolveAuth.js.map \ No newline at end of file diff --git a/build/helpers/verifyResolveAuth.js.map b/build/helpers/verifyResolveAuth.js.map new file mode 100644 index 0000000..74b858d --- /dev/null +++ b/build/helpers/verifyResolveAuth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"verifyResolveAuth.js","sourceRoot":"","sources":["../../src/helpers/verifyResolveAuth.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,4EAA4E;AAC5E,8CAA8C;;AAyW9C,8CA4BC;AAnYD,mDAAgD;AAChD,6CAA4C;AAC5C,sCAA6C;AAE7C,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,aAAa;AAmB5C,gFAAgF;AAEhF,KAAK,UAAU,GAAG,CAAC,MAAc,EAAE,MAAc,EAAE,MAAe;IAChE,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE;QAC/B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;KAChE,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/B,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,oEAAoE;QACpE,sEAAsE;QACtE,sEAAsE;QACtE,mBAAmB;QACnB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAgD,CAAC;QACjG,GAAG,CAAC,IAAI,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AAC;AAChD,CAAC;AAED,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC;AAEM,KAAK,UAAU,iBAAiB,CAAC,IAA2B;IACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;IACpC,IAAI,UAAU,GAAmC,IAAI,CAAC;IAEtD,uEAAuE;IACvE,kDAAkD;IAClD,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,iCAAiC,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QACrF,IAAI,OAAO,GAAG,CAAC;YAAE,MAAM,KAAK,CAAC,iCAAiC,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC;QAE7E,qEAAqE;QACrE,qEAAqE;QACrE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACrE,UAAU,GAAG,MAAM,OAAO,CACxB,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,aAAa,EAClB,OAAO,EACP,CAAC,EACD,QAAQ,CACT,CAAC;QAEF,IAAI,UAAU,CAAC,MAAM,KAAK,UAAU;YAAE,OAAO,UAAU,CAAC;QACxD,IAAI,UAAU,CAAC,SAAS,KAAK,0BAA0B;YAAE,OAAO,UAAU,CAAC;IAC7E,CAAC;IAED,OAAO,UAAW,CAAC;AACrB,CAAC"} \ No newline at end of file diff --git a/build/index.d.ts b/build/index.d.ts new file mode 100644 index 0000000..40e54a4 --- /dev/null +++ b/build/index.d.ts @@ -0,0 +1,11 @@ +export { type DataStorage, LocalStorage } from "./helpers/storage"; +export { ParentFrameWallet } from "./ParentFrameWallet"; +export { SandboxWallet } from "./SandboxedWallet"; +export { InjectedWallet } from "./InjectedWallet"; +export { NearConnector } from "./NearConnector"; +export type { NearConnectorOptions } from "./NearConnector"; +export { nearActionsToConnectorActions } from "./actions"; +export type { ConnectorAction } from "./actions/types"; +export type { WalletPlugin } from "./types/plugin"; +export { verifyResolveAuth, type VerifyResolveAuthArgs, type VerifyResolveAuthResult, type ResolveAuthPurpose, } from "./helpers/verifyResolveAuth"; +export type { FooterBranding, NearWalletBase, WalletManifest, EventNearWalletInjected, SignMessageParams, SignedMessage, SignAndSendTransactionParams, SignAndSendTransactionsParams, SignDelegateActionsParams, NearConnector_ConnectOptions, SignInAndSignMessageParams, Account, AccountWithSignedMessage, EventMap, EventType, AddFunctionCallKeyParams, AddFunctionCallKey_AllowMethods, AddFunctionCallKey_GasAllowance, } from "./types"; diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..030cddd --- /dev/null +++ b/build/index.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.verifyResolveAuth = exports.nearActionsToConnectorActions = exports.NearConnector = exports.InjectedWallet = exports.SandboxWallet = exports.ParentFrameWallet = exports.LocalStorage = void 0; +var storage_1 = require("./helpers/storage"); +Object.defineProperty(exports, "LocalStorage", { enumerable: true, get: function () { return storage_1.LocalStorage; } }); +var ParentFrameWallet_1 = require("./ParentFrameWallet"); +Object.defineProperty(exports, "ParentFrameWallet", { enumerable: true, get: function () { return ParentFrameWallet_1.ParentFrameWallet; } }); +var SandboxedWallet_1 = require("./SandboxedWallet"); +Object.defineProperty(exports, "SandboxWallet", { enumerable: true, get: function () { return SandboxedWallet_1.SandboxWallet; } }); +var InjectedWallet_1 = require("./InjectedWallet"); +Object.defineProperty(exports, "InjectedWallet", { enumerable: true, get: function () { return InjectedWallet_1.InjectedWallet; } }); +var NearConnector_1 = require("./NearConnector"); +Object.defineProperty(exports, "NearConnector", { enumerable: true, get: function () { return NearConnector_1.NearConnector; } }); +var actions_1 = require("./actions"); +Object.defineProperty(exports, "nearActionsToConnectorActions", { enumerable: true, get: function () { return actions_1.nearActionsToConnectorActions; } }); +var verifyResolveAuth_1 = require("./helpers/verifyResolveAuth"); +Object.defineProperty(exports, "verifyResolveAuth", { enumerable: true, get: function () { return verifyResolveAuth_1.verifyResolveAuth; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map new file mode 100644 index 0000000..bf6f230 --- /dev/null +++ b/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6CAAmE;AAAxC,uGAAA,YAAY,OAAA;AACvC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AAGtB,qCAA0D;AAAjD,wHAAA,6BAA6B,OAAA;AAItC,iEAKqC;AAJnC,sHAAA,iBAAiB,OAAA"} \ No newline at end of file diff --git a/build/nearConnectStatic.d.ts b/build/nearConnectStatic.d.ts new file mode 100644 index 0000000..cea4182 --- /dev/null +++ b/build/nearConnectStatic.d.ts @@ -0,0 +1 @@ +export declare const NEAR_CONNECT_VERSION = "0.11.4"; diff --git a/build/nearConnectStatic.js b/build/nearConnectStatic.js new file mode 100644 index 0000000..20355f5 --- /dev/null +++ b/build/nearConnectStatic.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NEAR_CONNECT_VERSION = void 0; +exports.NEAR_CONNECT_VERSION = "0.11.4"; +//# sourceMappingURL=nearConnectStatic.js.map \ No newline at end of file diff --git a/build/nearConnectStatic.js.map b/build/nearConnectStatic.js.map new file mode 100644 index 0000000..d9406eb --- /dev/null +++ b/build/nearConnectStatic.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nearConnectStatic.js","sourceRoot":"","sources":["../src/nearConnectStatic.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,QAAQ,CAAC"} \ No newline at end of file diff --git a/build/popups/IframeWalletPopup.d.ts b/build/popups/IframeWalletPopup.d.ts new file mode 100644 index 0000000..e3f23c4 --- /dev/null +++ b/build/popups/IframeWalletPopup.d.ts @@ -0,0 +1,20 @@ +import { FooterBranding } from "../types"; +import { Popup } from "./Popup"; +export declare class IframeWalletPopup extends Popup<{}> { + readonly delegate: { + iframe: HTMLIFrameElement; + footer: FooterBranding | null; + onApprove: () => void; + onReject: () => void; + }; + constructor(delegate: { + iframe: HTMLIFrameElement; + footer: FooterBranding | null; + onApprove: () => void; + onReject: () => void; + }); + handlers(): void; + create(): void; + get footer(): import("../helpers/html").HtmlString | ""; + get dom(): import("../helpers/html").HtmlString; +} diff --git a/build/popups/IframeWalletPopup.js b/build/popups/IframeWalletPopup.js new file mode 100644 index 0000000..e21e4b7 --- /dev/null +++ b/build/popups/IframeWalletPopup.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IframeWalletPopup = void 0; +const html_1 = require("../helpers/html"); +const Popup_1 = require("./Popup"); +class IframeWalletPopup extends Popup_1.Popup { + delegate; + constructor(delegate) { + super(delegate); + this.delegate = delegate; + } + handlers() { + super.handlers(); + this.addListener("button", "click", () => this.delegate.onApprove()); + } + create() { + super.create({ show: false }); + const modalBody = this.root.querySelector(".modal-body"); + modalBody.appendChild(this.delegate.iframe); + this.delegate.iframe.style.width = "100%"; + this.delegate.iframe.style.height = "720px"; + this.delegate.iframe.style.border = "none"; + } + get footer() { + if (!this.delegate.footer) + return ""; + const { icon, heading } = this.delegate.footer; + return (0, html_1.html) ` + + `; + } + get dom() { + return (0, html_1.html) ``; + } +} +exports.IframeWalletPopup = IframeWalletPopup; +//# sourceMappingURL=IframeWalletPopup.js.map \ No newline at end of file diff --git a/build/popups/IframeWalletPopup.js.map b/build/popups/IframeWalletPopup.js.map new file mode 100644 index 0000000..9952d29 --- /dev/null +++ b/build/popups/IframeWalletPopup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"IframeWalletPopup.js","sourceRoot":"","sources":["../../src/popups/IframeWalletPopup.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAEvC,mCAAgC;AAEhC,MAAa,iBAAkB,SAAQ,aAAS;IAEnC;IADX,YACW,QAKR;QAED,KAAK,CAAC,QAAQ,CAAC,CAAC;QAPP,aAAQ,GAAR,QAAQ,CAKhB;IAGH,CAAC;IAED,QAAQ;QACN,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,MAAM;QACJ,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAiB,CAAC;QACzE,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC;QAC1C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAC7C,CAAC;IAED,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QACrC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAE/C,OAAO,IAAA,WAAI,EAAA;;UAEL,IAAI,CAAC,CAAC,CAAC,IAAA,WAAI,EAAA,aAAa,IAAI,UAAU,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE;aACrD,OAAO;;KAEf,CAAC;IACJ,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAA,WAAI,EAAA;;;UAGL,IAAI,CAAC,MAAM;;WAEV,CAAC;IACV,CAAC;CACF;AA9CD,8CA8CC"} \ No newline at end of file diff --git a/build/popups/NearWalletsPopup.d.ts b/build/popups/NearWalletsPopup.d.ts new file mode 100644 index 0000000..59fa7b9 --- /dev/null +++ b/build/popups/NearWalletsPopup.d.ts @@ -0,0 +1,28 @@ +import { FooterBranding, WalletManifest } from "../types"; +import { Popup } from "./Popup"; +export declare class NearWalletsPopup extends Popup<{ + wallets: WalletManifest[]; + showSettings: boolean; +}> { + readonly delegate: { + wallets: WalletManifest[]; + footer: FooterBranding | null; + onAddDebugManifest: (wallet: string) => Promise; + onRemoveDebugManifest: (id: string) => Promise; + onSelect: (id: string) => void; + onReject: () => void; + }; + constructor(delegate: { + wallets: WalletManifest[]; + footer: FooterBranding | null; + onAddDebugManifest: (wallet: string) => Promise; + onRemoveDebugManifest: (id: string) => Promise; + onSelect: (id: string) => void; + onReject: () => void; + }); + handlers(): void; + create(): void; + walletDom(wallet: WalletManifest): import("../helpers/html").HtmlString; + get footer(): import("../helpers/html").HtmlString | ""; + get dom(): import("../helpers/html").HtmlString; +} diff --git a/build/popups/NearWalletsPopup.js b/build/popups/NearWalletsPopup.js new file mode 100644 index 0000000..8418db1 --- /dev/null +++ b/build/popups/NearWalletsPopup.js @@ -0,0 +1,159 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NearWalletsPopup = void 0; +const html_1 = require("../helpers/html"); +const url_1 = require("../helpers/url"); +const Popup_1 = require("./Popup"); +const debugManifest = { + id: "custom-wallet", + name: "Custom Wallet", + icon: "https://www.mynearwallet.com/images/webclip.png", + description: "Custom wallet for NEAR.", + website: "", + version: "1.0.0", + executor: "your-executor-url.js", + type: "sandbox", + platform: {}, + features: { + signMessage: true, + signInWithoutAddKey: true, + signInAndSignMessage: true, + signAndSendTransaction: true, + signAndSendTransactions: true, + signDelegateActions: true, + }, + permissions: { + storage: true, + allowsOpen: [], + }, +}; +class NearWalletsPopup extends Popup_1.Popup { + delegate; + constructor(delegate) { + super(delegate); + this.delegate = delegate; + this.update({ wallets: delegate.wallets, showSettings: false }); + } + handlers() { + super.handlers(); + this.addListener(".settings-button", "click", () => this.update({ showSettings: true })); + this.addListener(".back-button", "click", () => this.update({ showSettings: false })); + this.root.querySelectorAll(".connect-item").forEach((item) => { + if (!(item instanceof HTMLDivElement)) + return; + this.addListener(item, "click", () => this.delegate.onSelect(item.dataset.type)); + }); + this.root.querySelectorAll(".remove-wallet-button").forEach((item) => { + if (!(item instanceof SVGSVGElement)) + return; + this.addListener(item, "click", async (e) => { + e.stopPropagation(); + await this.delegate.onRemoveDebugManifest(item.dataset.type); + const wallets = this.state.wallets.filter((wallet) => wallet.id !== item.dataset.type); + this.update({ wallets }); + }); + }); + this.addListener(".add-debug-manifest-button", "click", async () => { + try { + const wallet = this.root.querySelector("#debug-manifest-input")?.value ?? ""; + const manifest = await this.delegate.onAddDebugManifest(wallet); + this.update({ showSettings: false, wallets: [manifest, ...this.state.wallets] }); + } + catch (error) { + alert(`Something went wrong: ${error}`); + } + }); + } + create() { + super.create({ show: true }); + } + walletDom(wallet) { + const removeButton = (0, html_1.html) ` + + + + + `; + return (0, html_1.html) ` +
+ ${wallet.name} +
+ ${wallet.name} + ${(0, url_1.parseUrl)(wallet.website)?.hostname} +
+ ${wallet.debug ? removeButton : ""} +
+ `; + } + get footer() { + if (!this.delegate.footer) + return ""; + const { icon, heading, link, linkText } = this.delegate.footer; + return (0, html_1.html) ` + + `; + } + get dom() { + if (this.state.showSettings) { + return (0, html_1.html) ` + + `; + } + return (0, html_1.html) ``; + } +} +exports.NearWalletsPopup = NearWalletsPopup; +//# sourceMappingURL=NearWalletsPopup.js.map \ No newline at end of file diff --git a/build/popups/NearWalletsPopup.js.map b/build/popups/NearWalletsPopup.js.map new file mode 100644 index 0000000..1713026 --- /dev/null +++ b/build/popups/NearWalletsPopup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NearWalletsPopup.js","sourceRoot":"","sources":["../../src/popups/NearWalletsPopup.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AACvC,wCAA0C;AAE1C,mCAAgC;AAEhC,MAAM,aAAa,GAAG;IACpB,EAAE,EAAE,eAAe;IACnB,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,iDAAiD;IACvD,WAAW,EAAE,yBAAyB;IACtC,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,sBAAsB;IAChC,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE;QACR,WAAW,EAAE,IAAI;QACjB,mBAAmB,EAAE,IAAI;QACzB,oBAAoB,EAAE,IAAI;QAC1B,sBAAsB,EAAE,IAAI;QAC5B,uBAAuB,EAAE,IAAI;QAC7B,mBAAmB,EAAE,IAAI;KAC1B;IACD,WAAW,EAAE;QACX,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,EAAE;KACf;CACF,CAAC;AAEF,MAAa,gBAAiB,SAAQ,aAA2D;IAEpF;IADX,YACW,QAOR;QAED,KAAK,CAAC,QAAQ,CAAC,CAAC;QATP,aAAQ,GAAR,QAAQ,CAOhB;QAGD,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,QAAQ;QACN,KAAK,CAAC,QAAQ,EAAE,CAAC;QAEjB,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC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AAI,EAAA;;UAEL,IAAI,CAAC,CAAC,CAAC,IAAA,WAAI,EAAA,aAAa,IAAI,UAAU,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE;aACrD,OAAO;2CACuB,IAAI,qBAAqB,QAAQ;;KAEvE,CAAC;IACJ,CAAC;IAED,IAAI,GAAG;QACL,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;YAC5B,OAAO,IAAA,WAAI,EAAA;;;;;;;;;;;;;;;;;;mFAkBkE,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;;;;cAI3G,IAAI,CAAC,MAAM;;;OAGlB,CAAC;QACJ,CAAC;QAED,OAAO,IAAA,WAAI,EAAA;;;;;;;;;;;;;kCAamB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAsB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;;UAElG,IAAI,CAAC,MAAM;;WAEV,CAAC;IACV,CAAC;CACF;AA7ID,4CA6IC"} \ No newline at end of file diff --git a/build/popups/Popup.d.ts b/build/popups/Popup.d.ts new file mode 100644 index 0000000..383b900 --- /dev/null +++ b/build/popups/Popup.d.ts @@ -0,0 +1,22 @@ +export declare class Popup> { + readonly delegate: { + onReject: () => void; + }; + isClosed: boolean; + root: HTMLDivElement; + state: T; + constructor(delegate: { + onReject: () => void; + }); + get dom(): import("../helpers/html").HtmlString; + disposables: (() => void)[]; + addListener(querySelector: string | Element, event: string, callback: (e: Event) => void): void; + handlers(): void; + update(state: Partial): void; + create({ show }: { + show?: boolean; + }): void; + show(): void; + hide(): void; + destroy(): void; +} diff --git a/build/popups/Popup.js b/build/popups/Popup.js new file mode 100644 index 0000000..0785621 --- /dev/null +++ b/build/popups/Popup.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Popup = void 0; +const styles_1 = require("./styles"); +const html_1 = require("../helpers/html"); +const ID = `n${Math.random().toString(36).substring(2, 15)}`; +if (typeof document !== "undefined") { + const style = document.createElement("style"); + style.textContent = (0, styles_1.css)(`.${ID}`); + document.head.append(style); +} +class Popup { + delegate; + isClosed = false; + root = document.createElement("div"); + state = {}; + constructor(delegate) { + this.delegate = delegate; + } + get dom() { + return (0, html_1.html) ``; + } + disposables = []; + addListener(querySelector, event, callback) { + const element = typeof querySelector === "string" ? this.root.querySelector(querySelector) : querySelector; + if (!element) + return; + element.addEventListener(event, callback); + this.disposables.push(() => element.removeEventListener(event, callback)); + } + handlers() { + this.disposables.forEach((dispose) => dispose()); + this.disposables = []; + const modalContainer = this.root.querySelector(".modal-container"); + const modalContent = this.root.querySelector(".modal-content"); + modalContent.onclick = (e) => e.stopPropagation(); + modalContainer.onclick = () => { + this.delegate.onReject(); + this.destroy(); + }; + } + update(state) { + this.state = { ...this.state, ...state }; + this.root.innerHTML = this.dom.html; + this.handlers(); + } + create({ show = true }) { + this.root.className = `${ID} hot-connector-popup`; + this.root.innerHTML = this.dom.html; + document.body.append(this.root); + this.handlers(); + const modalContainer = this.root.querySelector(".modal-container"); + const modalContent = this.root.querySelector(".modal-content"); + modalContent.style.transform = "translateY(50px)"; + modalContainer.style.opacity = "0"; + this.root.style.display = "none"; + if (show) { + setTimeout(() => this.show(), 10); + } + } + show() { + const modalContainer = this.root.querySelector(".modal-container"); + const modalContent = this.root.querySelector(".modal-content"); + modalContent.style.transform = "translateY(50px)"; + modalContainer.style.opacity = "0"; + this.root.style.display = "block"; + setTimeout(() => { + modalContent.style.transform = "translateY(0)"; + modalContainer.style.opacity = "1"; + }, 100); + } + hide() { + const modalContainer = this.root.querySelector(".modal-container"); + const modalContent = this.root.querySelector(".modal-content"); + modalContent.style.transform = "translateY(50px)"; + modalContainer.style.opacity = "0"; + setTimeout(() => { + this.root.style.display = "none"; + }, 200); + } + destroy() { + if (this.isClosed) + return; + this.isClosed = true; + this.hide(); + setTimeout(() => { + this.root.remove(); + }, 200); + } +} +exports.Popup = Popup; +//# sourceMappingURL=Popup.js.map \ No newline at end of file diff --git a/build/popups/Popup.js.map b/build/popups/Popup.js.map new file mode 100644 index 0000000..3bdf6a0 --- /dev/null +++ b/build/popups/Popup.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Popup.js","sourceRoot":"","sources":["../../src/popups/Popup.ts"],"names":[],"mappings":";;;AAAA,qCAA+B;AAC/B,0CAAuC;AAEvC,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AAE7D,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC9C,KAAK,CAAC,WAAW,GAAG,IAAA,YAAG,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,MAAa,KAAK;IAKK;IAJrB,QAAQ,GAAG,KAAK,CAAC;IACjB,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,KAAK,GAAM,EAAO,CAAC;IAEnB,YAAqB,QAAkC;QAAlC,aAAQ,GAAR,QAAQ,CAA0B;IAAG,CAAC;IAE3D,IAAI,GAAG;QACL,OAAO,IAAA,WAAI,EAAA,EAAE,CAAC;IAChB,CAAC;IAED,WAAW,GAAmB,EAAE,CAAC;IACjC,WAAW,CAAC,aAA+B,EAAE,KAAa,EAAE,QAA4B;QACtF,MAAM,OAAO,GAAG,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAE,CAAC,CAAC,CAAC,aAAa,CAAC;QAC5G,IAAI,CAAC,OAAO;YAAE,OAAO;QACrB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AC,aAAa,CAAC,gBAAgB,CAAiB,CAAC;QAC/E,YAAY,CAAC,KAAK,CAAC,SAAS,GAAG,kBAAkB,CAAC;QAClD,cAAc,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;QAEnC,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QACnC,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;CACF;AAxFD,sBAwFC"} \ No newline at end of file diff --git a/build/popups/styles.d.ts b/build/popups/styles.d.ts new file mode 100644 index 0000000..8b9c39f --- /dev/null +++ b/build/popups/styles.d.ts @@ -0,0 +1 @@ +export declare const css: (id: string) => string; diff --git a/build/popups/styles.js b/build/popups/styles.js new file mode 100644 index 0000000..ee981a1 --- /dev/null +++ b/build/popups/styles.js @@ -0,0 +1,263 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.css = void 0; +const css = (id) => /*css*/ ` +${id} * { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + -ms-overflow-style: none; + scrollbar-width: none; + color: #fff; +} + +${id} *::-webkit-scrollbar { + display: none; +} + +${id} p, +${id} h1, +${id} h2, +${id} h3, +${id} h4, +${id} h5, +${id} h6 { + margin: 0; +} + +${id} .modal-container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 100000000; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + transition: opacity 0.2s ease-in-out; +} + +@media (max-width: 600px) { + ${id} .modal-container { + justify-content: flex-end; + } +} + +${id} .modal-content { + display: flex; + flex-direction: column; + align-items: center; + + max-width: 420px; + max-height: 615px; + width: 100%; + border-radius: 24px; + background: #0d0d0d; + border: 1.5px solid rgba(255, 255, 255, 0.1); + transition: transform 0.2s ease-in-out; +} + +@media (max-width: 600px) { + ${id} .modal-content { + max-width: 100%; + width: 100%; + max-height: 80%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border: none; + border-top: 1.5px solid rgba(255, 255, 255, 0.1); + } +} + + +${id} .modal-header { + display: flex; + padding: 16px; + gap: 16px; + align-self: stretch; + align-items: center; + justify-content: center; + position: relative; +} + +${id} .modal-header button { + position: absolute; + right: 16px; + top: 16px; + width: 32px; + height: 32px; + border-radius: 12px; + cursor: pointer; + transition: background 0.2s ease-in-out; + border: none; + background: none; + display: flex; + align-items: center; + justify-content: center; +} + +${id} .modal-header button:hover { + background: rgba(255, 255, 255, 0.04); +} + +${id} .modal-header p { + color: #fff; + text-align: center; + font-size: 24px; + font-style: normal; + font-weight: 600; + line-height: normal; + margin: 0; +} + + +${id} .modal-body { + display: flex; + padding: 16px; + flex-direction: column; + align-items: flex-start; + text-align: center; + gap: 8px; + overflow: auto; + + border-radius: 24px; + background: rgba(255, 255, 255, 0.08); + width: 100%; + flex: 1; +} + +${id} .modal-body textarea { + width: 100%; + padding: 12px; + border-radius: 12px; + background: #0d0d0d; + color: #fff; + border: 1px solid rgba(255, 255, 255, 0.1); + outline: none; + font-size: 16px; + transition: background 0.2s ease-in-out; + font-family: monospace; + font-size: 12px; +} + +${id} .modal-body button { + width: 100%; + padding: 12px; + border-radius: 12px; + background: #fff; + color: #000; + border: none; + cursor: pointer; + font-size: 16px; + transition: background 0.2s ease-in-out; + margin-top: 16px; +} + +${id} .footer { + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + padding: 16px 24px; + color: #fff; + gap: 12px; +} + +${id} .modal-body p { + color: rgba(255, 255, 255, 0.9); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: normal; + letter-spacing: -0.8px; +} + +${id} .footer img { + width: 24px; + height: 24px; + border-radius: 50%; + object-fit: cover; +} + +${id} .get-wallet-link { + color: rgba(255, 255, 255, 0.5); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + margin-left: auto; + text-decoration: none; + transition: color 0.2s ease-in-out; + cursor: pointer; +} + +${id} .get-wallet-link:hover { + color: rgba(255, 255, 255, 1); +} + + +${id} .connect-item { + display: flex; + padding: 8px; + align-items: center; + gap: 12px; + align-self: stretch; + cursor: pointer; + + transition: background 0.2s ease-in-out; + border-radius: 24px; +} + +${id} .connect-item img { + width: 48px; + height: 48px; + border-radius: 16px; + object-fit: cover; + flex-shrink: 0; +} + +${id} .connect-item-info { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + text-align: left; + flex: 1; + margin-top: -2px; +} + +${id} .connect-item-info .wallet-address { + color: rgba(255, 255, 255, 0.5); + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; +} + +${id} .connect-item:hover { + background: rgba(255, 255, 255, 0.04); +} + +${id} .connect-item img { + width: 48px; + height: 48px; + border-radius: 16px; + object-fit: cover; +} + +${id} .connect-item p { + color: rgba(255, 255, 255, 0.9); + text-align: center; + font-size: 18px; + font-style: normal; + font-weight: 600; + line-height: normal; + letter-spacing: -0.36px; + margin: 0; +} +`; +exports.css = css; +//# sourceMappingURL=styles.js.map \ No newline at end of file diff --git a/build/popups/styles.js.map b/build/popups/styles.js.map new file mode 100644 index 0000000..aec2080 --- /dev/null +++ b/build/popups/styles.js.map @@ -0,0 +1 @@ +{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/popups/styles.ts"],"names":[],"mappings":";;;AAAO,MAAM,GAAG,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,OAAO,CAAC;EACzC,EAAE;;;;;;;;EAQF,EAAE;;;;EAIF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;EACF,EAAE;;;;EAIF,EAAE;;;;;;;;;;;;;;;;IAgBA,EAAE;;;;;EAKJ,EAAE;;;;;;;;;;;;;;;IAeA,EAAE;;;;;;;;;;;;EAYJ,EAAE;;;;;;;;;;EAUF,EAAE;;;;;;;;;;;;;;;;EAgBF,EAAE;;;;EAIF,EAAE;;;;;;;;;;;EAWF,EAAE;;;;;;;;;;;;;;;EAeF,EAAE;;;;;;;;;;;;;;EAcF,EAAE;;;;;;;;;;;;;EAaF,EAAE;;;;;;;;;;EAUF,EAAE;;;;;;;;;;EAUF,EAAE;;;;;;;EAOF,EAAE;;;;;;;;;;;;EAYF,EAAE;;;;;EAKF,EAAE;;;;;;;;;;;;EAYF,EAAE;;;;;;;;EAQF,EAAE;;;;;;;;;;EAUF,EAAE;;;;;;;;EAQF,EAAE;;;;EAIF,EAAE;;;;;;;EAOF,EAAE;;;;;;;;;;CAUH,CAAC;AAjQW,QAAA,GAAG,OAiQd"} \ No newline at end of file diff --git a/build/types/index.d.ts b/build/types/index.d.ts new file mode 100644 index 0000000..0aa20d4 --- /dev/null +++ b/build/types/index.d.ts @@ -0,0 +1,260 @@ +import type { FinalExecutionOutcome } from "@near-js/types"; +import type { Action } from "@near-js/transactions"; +import type { ConnectorAction } from "../actions/types"; +export type { FinalExecutionOutcome, Action }; +export type Logger = { + log: (...logs: any[]) => void; +}; +export type Optional = Omit & Partial>; +export type Network = "mainnet" | "testnet"; +export interface FunctionCallAccessKey_AllowMethods_AnyMethod { + anyMethod: true; +} +export interface FunctionCallAccessKey_AllowMethods_SelectMethods { + anyMethod: false; + methodNames: string[]; +} +export type AddFunctionCallKey_AllowMethods = FunctionCallAccessKey_AllowMethods_AnyMethod | FunctionCallAccessKey_AllowMethods_SelectMethods; +export interface FunctionCallAccessKey_GasAllowance_Unlimited { + kind: "unlimited"; +} +export interface FunctionCallAccessKey_GasAllowance_Limited { + kind: "limited"; + /** The amount of gas allowed over the lifetime of the key in yoctoNEAR. */ + amount: string; +} +export type AddFunctionCallKey_GasAllowance = FunctionCallAccessKey_GasAllowance_Unlimited | FunctionCallAccessKey_GasAllowance_Limited; +export interface AddFunctionCallKeyParams { + contractId: string; + /** Using format ":" e.g. "ed25519:3N5QmbhVqLh9ZtZs1zj8X9v1u1Z1Z1Z1Z1Z1Z1Z1Z1Z" */ + publicKey: string; + /** Define which methods can be called by this Function Call Key on the "contractId" account */ + allowMethods: AddFunctionCallKey_AllowMethods; + /** Optional: The gas allowance for the Function Call Key over its lifetime of executing transactions. + * Default to "limited" with 0.25 NEAR (non-Yocto). */ + gasAllowance?: AddFunctionCallKey_GasAllowance; +} +export interface NearConnector_ConnectOptions { + walletId?: string; + /** + * If this is provided, the connector will filter for wallets that support the "signInAndSignMessage" feature and use these params for the message to be signed along with sign in. + * + * The account and the signed message can be listened for using the "wallet:signInAndSignMessage" event, which will be emitted along + * with the "wallet:signIn" event. This allows you to get the signed message right after sign in. + * + * This is useful for cases where you want to verify ownership of the account during sign in without any additional steps. + */ + signMessageParams?: SignMessageDuringSignInParams; + /** + * If this is provided, the connector will filter for wallets that support the "signInWithFunctionCallAccessKey" feature and use these + * params to add a function call access key during sign in. + * + * These params indicate to the wallet that a Function Call Key with these parameters should be added during the sign in process with the specified parameters. + * + * See: https://docs.near.org/protocol/access-keys#function-call-keys + */ + addFunctionCallKey?: AddFunctionCallKeyParams; +} +export interface Account { + accountId: string; + publicKey?: string; +} +export interface AccountWithSignedMessage extends Account { + signedMessage: SignedMessage; +} +export interface SignMessageParams { + message: string; + recipient: string; + nonce: Uint8Array; + network?: Network; + signerId?: string; +} +export type SignMessageDuringSignInParams = Omit; +export interface SignedMessage { + accountId: string; + publicKey: string; + signature: string; +} +export type EventNearWalletInjected = CustomEvent; +export interface WalletPermissions { + storage?: boolean; + external?: string[]; + walletConnect?: boolean; + allowsOpen?: string[]; + clipboardRead?: boolean; + clipboardWrite?: boolean; + usb?: boolean; + hid?: boolean; + bluetooth?: boolean; + webauthn?: boolean; +} +export interface SignAndSendTransactionParams { + network?: Network; + signerId?: string; + receiverId: string; + actions: Array; +} +export interface SignAndSendTransactionsParams { + network?: Network; + signerId?: string; + transactions: Array<{ + receiverId: string; + actions: Array; + }>; +} +export interface SignDelegateActionsParams { + network?: Network; + signerId?: string; + delegateActions: Array<{ + actions: Array; + receiverId: string; + }>; +} +export interface SignDelegateActionsResponse { + signedDelegateActions: string[]; +} +export type ResolveAuthPurpose = "PROVE_OWNERSHIP" | "APPROVE_OFFCHAIN_ACTION"; +export interface ResolveAuthParams { + network?: Network; + purpose: ResolveAuthPurpose; + recipient: string; + payload: string; +} +export interface ResolveAuthResponse { + accountId: string; + /** JSON-stringified authorization to pass to w_resolve_auth */ + authorization: string; +} +export interface WalletManifest { + id: string; + platform: string[]; + name: string; + icon: string; + description: string; + website: string; + version: string; + executor: string; + type: "sandbox" | "injected"; + permissions: WalletPermissions; + features: WalletFeatures; + debug?: boolean; +} +export interface WalletFeatures { + signMessage: boolean; + signTransaction: boolean; + signAndSendTransaction: boolean; + signAndSendTransactions: boolean; + signInWithoutAddKey: boolean; + signInAndSignMessage: boolean; + signInWithFunctionCallKey: boolean; + signDelegateActions: boolean; + resolveAuth: boolean; + mainnet: boolean; + testnet: boolean; +} +export interface SignInParams { + network?: Network; + addFunctionCallKey?: AddFunctionCallKeyParams; +} +export interface SignInAndSignMessageParams extends SignInParams { + messageParams: SignMessageDuringSignInParams; +} +export interface NearWalletBase { + manifest: WalletManifest; + /** + * Programmatically sign in. Hardware wallets (e.g. Ledger) require `derivationPaths` to validate access key permissions. + */ + signIn(data?: SignInParams): Promise>; + /** + * Programmatically sign in. Hardware wallets (e.g. Ledger) require `derivationPaths` to validate access key permissions. + */ + signInAndSignMessage(data: SignInAndSignMessageParams): Promise>; + /** + * Sign out from the wallet. + */ + signOut(data?: { + network?: Network; + }): Promise; + /** + * Returns one or more accounts when signed in. + * This method can be useful for wallets that support accounts at once such as WalletConnect. + * In this case, you can use an `accountId` returned as the `signerId` for `signAndSendTransaction`. + */ + getAccounts(data?: { + network?: Network; + }): Promise>; + /** + * Signs one or more NEAR Actions before sending to the network. + * The user must be signed in to call this method as there's at least charges for gas spent. + */ + signAndSendTransaction(params: SignAndSendTransactionParams): Promise; + /** + * Signs one or more transactions before sending to the network. + * The user must be signed in to call this method as there's at least charges for gas spent. + */ + signAndSendTransactions(params: SignAndSendTransactionsParams): Promise>; + signMessage(params: SignMessageParams): Promise; + signDelegateActions(params: SignDelegateActionsParams): Promise; + /** + * NEP-641: Produce an authorization blob for off-chain verification. + * The blob can be verified on-chain via `w_resolve_auth` view call. + * Only available when the wallet's `resolveAuth` feature is `true`. + */ + resolveAuth?(params: ResolveAuthParams): Promise; +} +export interface EventMap { + "wallet:signIn": { + wallet: NearWalletBase; + accounts: Account[]; + success: boolean; + source: "signIn" | "signInAndSignMessage"; + }; + "wallet:signInAndSignMessage": { + wallet: NearWalletBase; + accounts: AccountWithSignedMessage[]; + success: boolean; + }; + "wallet:signOut": any; + "selector:manifestUpdated": any; + "selector:walletsChanged": any; +} +export type EventType = keyof EventMap; +export type EventCallback = (payload: EventMap[K]) => void; +export type WalletEvents = { + signedIn: { + contractId: string; + methodNames: Array; + accounts: Array; + }; + accountsChanged: { + accounts: Array; + }; + networkChanged: { + networkId: string; + }; + signedOut: null; +}; +export interface AbstractWalletConnect { + connect: (params: any) => Promise<{ + uri?: string; + approval: () => Promise; + }>; + disconnect: (params: any) => Promise; + request: (params: any) => Promise; + session: { + keys: string[]; + get: (key: string) => { + topic: string; + namespaces: any; + }; + }; + core: { + projectId?: string; + }; +} +export interface FooterBranding { + icon?: string; + heading: string; + link: string; + linkText: string; +} diff --git a/build/types/index.js b/build/types/index.js new file mode 100644 index 0000000..aa219d8 --- /dev/null +++ b/build/types/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/types/index.js.map b/build/types/index.js.map new file mode 100644 index 0000000..37b1eea --- /dev/null +++ b/build/types/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/build/types/plugin.d.ts b/build/types/plugin.d.ts new file mode 100644 index 0000000..ef3cba7 --- /dev/null +++ b/build/types/plugin.d.ts @@ -0,0 +1,6 @@ +import { NearWalletBase } from "../types"; +export type WalletPlugin = Partial<{ + [K in keyof NearWalletBase]: NearWalletBase[K] extends (...args: infer Args) => infer Return ? (...args: [...Args, () => Return]) => Return : never; +}> & { + [key: string]: (...args: any[]) => any; +}; diff --git a/build/types/plugin.js b/build/types/plugin.js new file mode 100644 index 0000000..518604c --- /dev/null +++ b/build/types/plugin.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=plugin.js.map \ No newline at end of file diff --git a/build/types/plugin.js.map b/build/types/plugin.js.map new file mode 100644 index 0000000..92ba463 --- /dev/null +++ b/build/types/plugin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/cdn/hot-connect.cjs.js b/cdn/hot-connect.cjs.js new file mode 100644 index 0000000..d23ba92 --- /dev/null +++ b/cdn/hot-connect.cjs.js @@ -0,0 +1,650 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class y{async get(e){return typeof window>"u"?null:localStorage.getItem(e)}async set(e,t){typeof window>"u"||localStorage.setItem(e,t)}async remove(e){typeof window>"u"||localStorage.removeItem(e)}}const p="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function A(r){if(r.length===0)return"";let e=0,t=0;for(;t0;)n.push(o%58),o=o/58|0}for(;n.length>0&&n[n.length-1]===0;)n.pop();let s="";for(let o=0;o=0;--o)s+=p[n[o]];return s}const I=r=>{try{return JSON.parse(new TextDecoder().decode(r))}catch{return r}},h=r=>r.map(e=>{if("type"in e)return e;if(e.functionCall)return{type:"FunctionCall",params:{methodName:e.functionCall.methodName,args:I(e.functionCall.args),gas:e.functionCall.gas.toString(),deposit:e.functionCall.deposit.toString()}};if(e.deployGlobalContract)return{type:"DeployGlobalContract",params:{code:e.deployGlobalContract.code,deployMode:e.deployGlobalContract.deployMode.AccountId?"AccountId":"CodeHash"}};if(e.createAccount)return{type:"CreateAccount"};if(e.useGlobalContract)return{type:"UseGlobalContract",params:{contractIdentifier:e.useGlobalContract.contractIdentifier.AccountId?{accountId:e.useGlobalContract.contractIdentifier.AccountId}:{codeHash:A(e.useGlobalContract.contractIdentifier.CodeHash)}}};if(e.deployContract)return{type:"DeployContract",params:{code:e.deployContract.code}};if(e.deleteAccount)return{type:"DeleteAccount",params:{beneficiaryId:e.deleteAccount.beneficiaryId}};if(e.deleteKey)return{type:"DeleteKey",params:{publicKey:e.deleteKey.publicKey.toString()}};if(e.transfer)return{type:"Transfer",params:{deposit:e.transfer.deposit.toString()}};if(e.stake)return{type:"Stake",params:{stake:e.stake.stake.toString(),publicKey:e.stake.publicKey.toString()}};if(e.addKey)return{type:"AddKey",params:{publicKey:e.addKey.publicKey.toString(),accessKey:{nonce:Number(e.addKey.accessKey.nonce),permission:e.addKey.accessKey.permission.functionCall?{receiverId:e.addKey.accessKey.permission.functionCall.receiverId,allowance:e.addKey.accessKey.permission.functionCall.allowance?.toString(),methodNames:e.addKey.accessKey.permission.functionCall.methodNames}:"FullAccess"}}};throw new Error("Unsupported action type")}),g=()=>typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.randomUUID=="function"?window.crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)});class x{constructor(e,t){this.connector=e,this.manifest=t}callParentFrame(e,t){const n=g();return window.parent.postMessage({type:"near-wallet-injected-request",id:n,method:e,params:t},"*"),new Promise((s,o)=>{const a=i=>{i.data.type==="near-wallet-injected-response"&&i.data.id===n&&(window.removeEventListener("message",a),i.data.success?s(i.data.result):o(i.data.error))};window.addEventListener("message",a)})}async signIn(e){const t=await this.callParentFrame("near:signIn",{network:e?.network??this.connector.network,addFunctionCallKey:e?.addFunctionCallKey});return Array.isArray(t)?t:[t]}async signInAndSignMessage(e){const t=await this.callParentFrame("near:signInAndSignMessage",{network:e?.network??this.connector.network,addFunctionCallKey:e?.addFunctionCallKey,messageParams:e.messageParams});return Array.isArray(t)?t:[t]}async signOut(e){const t={...e,network:e?.network??this.connector.network};await this.callParentFrame("near:signOut",t)}async getAccounts(e){const t={...e,network:e?.network??this.connector.network};return this.callParentFrame("near:getAccounts",t)}async signAndSendTransaction(e){const t=h(e.actions),n={...e,actions:t,network:e.network??this.connector.network};return this.callParentFrame("near:signAndSendTransaction",n)}async signAndSendTransactions(e){const t={...e,network:e.network??this.connector.network};return t.transactions=t.transactions.map(n=>({actions:h(n.actions),receiverId:n.receiverId})),this.callParentFrame("near:signAndSendTransactions",t)}async signMessage(e){const t={...e,network:e.network??this.connector.network};return this.callParentFrame("near:signMessage",t)}async signDelegateActions(e){const t={...e,delegateActions:e.delegateActions.map(n=>({...n,actions:h(n.actions)})),network:e.network||this.connector.network};return this.callParentFrame("near:signDelegateActions",t)}}const u=r=>{try{return new URL(r)}catch{return null}};class b{events={};on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,t){this.events[e]?.forEach(n=>n(t))}off(e,t){this.events[e]=this.events[e]?.filter(n=>n!==t)}once(e,t){const n=s=>{t(s),this.off(e,n)};this.on(e,n)}removeAllListeners(e){e?delete this.events[e]:this.events={}}}function E(r){return r.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const f=Symbol("htmlTag");function d(r,...e){let t=r[0];for(let n=0;n` +${r} * { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + -ms-overflow-style: none; + scrollbar-width: none; + color: #fff; +} + +${r} *::-webkit-scrollbar { + display: none; +} + +${r} p, +${r} h1, +${r} h2, +${r} h3, +${r} h4, +${r} h5, +${r} h6 { + margin: 0; +} + +${r} .modal-container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 100000000; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + transition: opacity 0.2s ease-in-out; +} + +@media (max-width: 600px) { + ${r} .modal-container { + justify-content: flex-end; + } +} + +${r} .modal-content { + display: flex; + flex-direction: column; + align-items: center; + + max-width: 420px; + max-height: 615px; + width: 100%; + border-radius: 24px; + background: #0d0d0d; + border: 1.5px solid rgba(255, 255, 255, 0.1); + transition: transform 0.2s ease-in-out; +} + +@media (max-width: 600px) { + ${r} .modal-content { + max-width: 100%; + width: 100%; + max-height: 80%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border: none; + border-top: 1.5px solid rgba(255, 255, 255, 0.1); + } +} + + +${r} .modal-header { + display: flex; + padding: 16px; + gap: 16px; + align-self: stretch; + align-items: center; + justify-content: center; + position: relative; +} + +${r} .modal-header button { + position: absolute; + right: 16px; + top: 16px; + width: 32px; + height: 32px; + border-radius: 12px; + cursor: pointer; + transition: background 0.2s ease-in-out; + border: none; + background: none; + display: flex; + align-items: center; + justify-content: center; +} + +${r} .modal-header button:hover { + background: rgba(255, 255, 255, 0.04); +} + +${r} .modal-header p { + color: #fff; + text-align: center; + font-size: 24px; + font-style: normal; + font-weight: 600; + line-height: normal; + margin: 0; +} + + +${r} .modal-body { + display: flex; + padding: 16px; + flex-direction: column; + align-items: flex-start; + text-align: center; + gap: 8px; + overflow: auto; + + border-radius: 24px; + background: rgba(255, 255, 255, 0.08); + width: 100%; + flex: 1; +} + +${r} .modal-body textarea { + width: 100%; + padding: 12px; + border-radius: 12px; + background: #0d0d0d; + color: #fff; + border: 1px solid rgba(255, 255, 255, 0.1); + outline: none; + font-size: 16px; + transition: background 0.2s ease-in-out; + font-family: monospace; + font-size: 12px; +} + +${r} .modal-body button { + width: 100%; + padding: 12px; + border-radius: 12px; + background: #fff; + color: #000; + border: none; + cursor: pointer; + font-size: 16px; + transition: background 0.2s ease-in-out; + margin-top: 16px; +} + +${r} .footer { + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + padding: 16px 24px; + color: #fff; + gap: 12px; +} + +${r} .modal-body p { + color: rgba(255, 255, 255, 0.9); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: normal; + letter-spacing: -0.8px; +} + +${r} .footer img { + width: 24px; + height: 24px; + border-radius: 50%; + object-fit: cover; +} + +${r} .get-wallet-link { + color: rgba(255, 255, 255, 0.5); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + margin-left: auto; + text-decoration: none; + transition: color 0.2s ease-in-out; + cursor: pointer; +} + +${r} .get-wallet-link:hover { + color: rgba(255, 255, 255, 1); +} + + +${r} .connect-item { + display: flex; + padding: 8px; + align-items: center; + gap: 12px; + align-self: stretch; + cursor: pointer; + + transition: background 0.2s ease-in-out; + border-radius: 24px; +} + +${r} .connect-item img { + width: 48px; + height: 48px; + border-radius: 16px; + object-fit: cover; + flex-shrink: 0; +} + +${r} .connect-item-info { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + text-align: left; + flex: 1; + margin-top: -2px; +} + +${r} .connect-item-info .wallet-address { + color: rgba(255, 255, 255, 0.5); + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; +} + +${r} .connect-item:hover { + background: rgba(255, 255, 255, 0.04); +} + +${r} .connect-item img { + width: 48px; + height: 48px; + border-radius: 16px; + object-fit: cover; +} + +${r} .connect-item p { + color: rgba(255, 255, 255, 0.9); + text-align: center; + font-size: 18px; + font-style: normal; + font-weight: 600; + line-height: normal; + letter-spacing: -0.36px; + margin: 0; +} +`,v=`n${Math.random().toString(36).substring(2,15)}`;if(typeof document<"u"){const r=document.createElement("style");r.textContent=$(`.${v}`),document.head.append(r)}class k{constructor(e){this.delegate=e}isClosed=!1;root=document.createElement("div");state={};get dom(){return d``}disposables=[];addListener(e,t,n){const s=typeof e=="string"?this.root.querySelector(e):e;s&&(s.addEventListener(t,n),this.disposables.push(()=>s.removeEventListener(t,n)))}handlers(){this.disposables.forEach(n=>n()),this.disposables=[];const e=this.root.querySelector(".modal-container"),t=this.root.querySelector(".modal-content");t.onclick=n=>n.stopPropagation(),e.onclick=()=>{this.delegate.onReject(),this.destroy()}}update(e){this.state={...this.state,...e},this.root.innerHTML=this.dom.html,this.handlers()}create({show:e=!0}){this.root.className=`${v} hot-connector-popup`,this.root.innerHTML=this.dom.html,document.body.append(this.root),this.handlers();const t=this.root.querySelector(".modal-container"),n=this.root.querySelector(".modal-content");n.style.transform="translateY(50px)",t.style.opacity="0",this.root.style.display="none",e&&setTimeout(()=>this.show(),10)}show(){const e=this.root.querySelector(".modal-container"),t=this.root.querySelector(".modal-content");t.style.transform="translateY(50px)",e.style.opacity="0",this.root.style.display="block",setTimeout(()=>{t.style.transform="translateY(0)",e.style.opacity="1"},100)}hide(){const e=this.root.querySelector(".modal-container"),t=this.root.querySelector(".modal-content");t.style.transform="translateY(50px)",e.style.opacity="0",setTimeout(()=>{this.root.style.display="none"},200)}destroy(){this.isClosed||(this.isClosed=!0,this.hide(),setTimeout(()=>{this.root.remove()},200))}}class P extends k{constructor(e){super(e),this.delegate=e}handlers(){super.handlers(),this.addListener("button","click",()=>this.delegate.onApprove())}create(){super.create({show:!1}),this.root.querySelector(".modal-body").appendChild(this.delegate.iframe),this.delegate.iframe.style.width="100%",this.delegate.iframe.style.height="720px",this.delegate.iframe.style.border="none"}get footer(){if(!this.delegate.footer)return"";const{icon:e,heading:t}=this.delegate.footer;return d` + + `}get dom(){return d``}}const M="0.11.4";async function N(r){const e=await r.executor.getAllStorage(),t=r.executor.connector.providers,n=r.executor.manifest,s=r.id,o=r.code.replaceAll(".localStorage",".sandboxedLocalStorage").replaceAll("window.top","window.selector").replaceAll("window.open","window.selector.open"),a=r.cspNonce?` nonce="${r.cspNonce.replace(/[^A-Za-z0-9+/=]/g,"")}"`:"";return` + + + + + + + +
+ + + + + + window.sandboxedLocalStorage = (() => { + let storage = ${JSON.stringify(e)} + + return { + setItem: function(key, value) { + window.selector.storage.set(key, value) + storage[key] = value || ''; + }, + getItem: function(key) { + return key in storage ? storage[key] : null; + }, + removeItem: function(key) { + window.selector.storage.remove(key) + delete storage[key]; + }, + get length() { + return Object.keys(storage).length; + }, + key: function(i) { + const keys = Object.keys(storage); + return keys[i] || null; + }, + }; + })(); + + const showPrompt = async (args) => { + const root = document.getElementById("root"); + root.style.display = "flex"; + root.innerHTML = \` +
+ +

${n.name}

+

\${args.title}

+ +
+ \`; + + return new Promise((resolve) => { + root.querySelector("button")?.addEventListener("click", () => { + root.innerHTML = ""; + resolve(true); + }); + }); + } + + class ProxyWindow { + constructor(url, features) { + this.closed = false; + this.windowIdPromise = window.selector.call("open", { url, features }); + + window.addEventListener("message", async (event) => { + if (event.data.origin !== "${s}") return; + if (!event.data.method?.startsWith("proxy-window:")) return; + const method = event.data.method.replace("proxy-window:", ""); + if (method === "closed" && event.data.windowId === await this.id()) this.closed = true; + }); + } + + async id() { + return await this.windowIdPromise; + } + + async focus() { + await window.selector.call("panel.focus", { windowId: await this.id() }); + } + + async postMessage(data) { + window.selector.call("panel.postMessage", { windowId: await this.id(), data }); + } + + async close() { + await window.selector.call("panel.close", { windowId: await this.id() }); + } + } + + window.selector = { + wallet: null, + location: "${window.location.href}", + nearConnectVersion: "${M}", + + outerHeight: ${window.outerHeight}, + screenY: ${window.screenY}, + outerWidth: ${window.outerWidth}, + screenX: ${window.screenX}, + + providers: { + mainnet: ${JSON.stringify(t.mainnet)}, + testnet: ${JSON.stringify(t.testnet)}, + }, + + uuid() { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + const r = (Math.random() * 16) | 0; + const v = c === "x" ? r : (r & 0x3) | 0x8; + return v.toString(16); + }); + }, + + walletConnect: { + connect(params) { + return window.selector.call("walletConnect.connect", params); + }, + disconnect(params) { + return window.selector.call("walletConnect.disconnect", params); + }, + request(params) { + return window.selector.call("walletConnect.request", params); + }, + getProjectId() { + return window.selector.call("walletConnect.getProjectId", {}); + }, + getSession() { + return window.selector.call("walletConnect.getSession", {}); + }, + }, + + async ready(wallet) { + wallet.manifest = ${JSON.stringify(n)}; + window.parent.postMessage({ method: "wallet-ready", origin: "${s}" }, "*"); + window.selector.wallet = wallet; + }, + + async call(method, params) { + const id = window.selector.uuid(); + window.parent.postMessage({ method, params, id, origin: "${s}" }, "*"); + + return new Promise((resolve, reject) => { + const handler = (event) => { + if (event.data.id !== id || event.data.origin !== "${s}") return; + window.removeEventListener("message", handler); + + if (event.data.status === "failed") reject(event.data.result); + else resolve(event.data.result); + }; + + window.addEventListener("message", handler); + }); + }, + + panelClosed(windowId) { + window.parent.postMessage({ + method: "panel.closed", + origin: "${s}", + result: { windowId } + }, "*"); + }, + + open(url, _, params) { + return new ProxyWindow(url, params) + }, + + external(entity, key, ...args) { + return window.selector.call("external", { entity, key, args: args || [] }); + }, + + openNativeApp(url) { + return window.selector.call("open.nativeApp", { url }); + }, + + ui: { + async whenApprove(options) { + window.selector.ui.showIframe(); + await showPrompt(options); + window.selector.ui.hideIframe(); + }, + + async showIframe() { + return await window.selector.call("ui.showIframe"); + }, + + async hideIframe() { + return await window.selector.call("ui.hideIframe"); + }, + }, + + storage: { + async set(key, value) { + await window.selector.call("storage.set", { key, value }); + }, + + async get(key) { + return await window.selector.call("storage.get", { key }); + }, + + async remove(key) { + await window.selector.call("storage.remove", { key }); + }, + + async keys() { + return await window.selector.call("storage.keys", {}); + }, + }, + }; + + window.addEventListener("message", async (event) => { + if (event.data.origin !== "${s}") return; + if (!event.data.method?.startsWith("wallet:")) return; + + const wallet = window.selector.wallet; + const method = event.data.method.replace("wallet:", ""); + const payload = { id: event.data.id, origin: "${s}", method }; + + if (wallet == null || typeof wallet[method] !== "function") { + const data = { ...payload, status: "failed", result: "Method not found" }; + window.parent.postMessage(data, "*"); + return; + } + + try { + const result = await wallet[method](event.data.params); + window.parent.postMessage({ ...payload, status: "success", result }, "*"); + } catch (error) { + const data = { ...payload, status: "failed", result: error }; + window.parent.postMessage(data, "*"); + } + }); + <\/script> + + + diff --git a/example/package.json b/example/package.json index 836c204..355e416 100644 --- a/example/package.json +++ b/example/package.json @@ -4,45 +4,40 @@ "version": "0.1.0", "type": "module", "scripts": { - "start": "vite", - "build:wallets": "yarn build:hotwallet && yarn build:ledger && yarn build:mnw", - "build:hotwallet": "PACKAGE=hotwallet vite build --config ./adapters/vite.config.ts", - "build:ledger": "PACKAGE=ledger vite build --config ./adapters/vite.config.ts", - "build:mnw": "PACKAGE=mnw vite build --config ./adapters/vite.config.ts", - "build": "vite build && echo '*' > dist/CORS", - "deploy": "surge ./dist" + "start": "cd ../near-wallets && yarn && EXAMPLE=true yarn build:wallets && cd ../example && yarn copy-manifest && vite", + "copy-manifest": "node scripts/copy-manifest.js", + "build": "cd ../near-wallets && EXAMPLE=true yarn build:wallets && cd ../example && yarn copy-manifest && vite build && echo '*' > dist/CORS", + "deploy": "surge ./dist", + "type-check": "tsc --noEmit" }, "dependencies": { - "@creit.tech/stellar-wallets-kit": "^1.4.1", - "@hot-wallet/sdk": "^1.0.11", - "@near-wallet-selector/core": "^8.9.12", - "@near-wallet-selector/ledger": "^8.10.1", - "@near-wallet-selector/modal-ui-js": "^8.9.12", - "@solana/wallet-adapter-base": "^0.9.23", - "@solana/wallet-adapter-react": "^0.15.35", - "@solana/wallet-adapter-react-ui": "^0.9.35", - "@solana/web3.js": "^1.95.0", - "@tanstack/react-query": "^5.51.11", - "@tonconnect/sdk": "^3.0.5", - "@tonconnect/ui-react": "^2.0.6", + "@hot-labs/near-connect": "^0.11.0", + "@near-js/utils": "^2.2.4", + "@near-js/crypto": "^2.2.4", + "@walletconnect/sign-client": "^2.23.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "viem": "^2.18.1", - "wagmi": "^2.12.1" + "usehooks-ts": "^3.1.1" }, "devDependencies": { + "@tailwindcss/vite": "^4.1.11", + "@types/node": "^25.0.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/uuid4": "^2.0.3", "@typescript-eslint/eslint-plugin": "^7.15.0", "@typescript-eslint/parser": "^7.15.0", "@vitejs/plugin-react": "^4.3.1", + "copy-file": "^11.1.0", "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", + "sass-embedded": "^1.89.0", "surge": "^0.24.5", + "tailwindcss": "^4.1.11", "typescript": "^5.2.2", + "viem": "^2.33.2", "vite": "^5.3.4", - "vite-plugin-node-polyfills": "^0.22.0" + "vite-plugin-node-polyfills": "^0.24.0" } } diff --git a/example/scripts/copy-manifest.js b/example/scripts/copy-manifest.js new file mode 100644 index 0000000..bf1bc13 --- /dev/null +++ b/example/scripts/copy-manifest.js @@ -0,0 +1,5 @@ +import { copyFileSync } from "copy-file"; +import path from "path"; + +copyFileSync(path.join(import.meta.dirname, "../../repository/manifest.json"), path.join(import.meta.dirname, "../public/repository/manifest.json")); +console.log("Wallets manifest.json file copied"); \ No newline at end of file diff --git a/example/src/App.tsx b/example/src/App.tsx index 0b9beb4..bc960fd 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,65 +1,238 @@ -import { FC, useEffect, useState } from "react"; -import { WalletSelector, WalletSelectorUI, NearWallet } from "../../src"; -import "../../src/styles.css"; +import { NearConnector, NearWalletBase, verifyResolveAuth } from "@hot-labs/near-connect"; +import SignClient from "@walletconnect/sign-client"; +import { FC, useMemo, useState } from "react"; -const selector = new WalletSelector(); -const modal = new WalletSelectorUI(selector); +import { KeyPairEd25519 } from "@near-js/crypto"; +import { useLocalStorage } from "usehooks-ts"; +import type { NearConnector_ConnectOptions } from "../../src/types/index.ts"; +import { NetworkSelector } from "./form-component/NetworkSelector.tsx"; +import { WalletActions } from "./WalletActions.tsx"; +import { parseNearAmount } from "@near-js/utils"; -export const ExampleNEAR: FC = () => { - const [wallet, setWallet] = useState(); - const [walletId, setWalletId] = useState(); - - useEffect(() => { - selector.wallet().then((wallet) => { - wallet.getAccounts().then((t) => { - setWalletId(t[0].accountId); - setWallet(wallet); +const RPC_URL = "https://relmn.aurora.dev"; + +// SignClient.init MUST run exactly once per page load. React StrictMode +// double-invokes the `useState(() => ...)` initializer in dev, which would +// otherwise create two SignClient instances. They share underlying storage +// but track pending sessions/proposals separately, causing +// "Pending session not found for topic" errors when wallet responses +// land on the discarded instance. +let _walletConnectClient: ReturnType | null = null; +function getWalletConnectClient() { + if (_walletConnectClient) return _walletConnectClient; + _walletConnectClient = SignClient.init({ + projectId: "16ebac7c9fbe9e612bb78ea9f012ce80", + metadata: { + name: "Example App", + description: "Example App", + url: "https://example.com", + icons: ["/favicon.ico"], + }, + }); + return _walletConnectClient; +} + +const ProveOwnershipDemo: FC<{ + connector: NearConnector; + onAuthenticated: (wallet: NearWalletBase, accountId: string) => void; +}> = ({ connector, onAuthenticated }) => { + const [status, setStatus] = useState(""); + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); + + const handleProveOwnership = async () => { + setStatus(""); + setError(""); + setLoading(true); + try { + // 1. Pick a wallet that supports resolveAuth — no signIn + setStatus("Select wallet..."); + const walletId = await connector.selectWallet({ + features: { resolveAuth: true } as any, }); - }); + const wallet = await connector.wallet(walletId); + if (!wallet?.resolveAuth) { + setError("Selected wallet does not support resolveAuth (NEP-641). Try Ethereum Wallet."); + return; + } - selector.on("signedIn", async (t) => { - setWallet(await selector.wallet()); - setWalletId(t.accounts[0].accountId); - }); + // 2. Generate challenge and request authorization (single signature) + setStatus("Sign authorization..."); + const challenge = `Login to Example App at ${new Date().toISOString()}`; + const res = await wallet.resolveAuth({ + purpose: "PROVE_OWNERSHIP", + recipient: "example.app", + payload: challenge, + }); - selector.on("signedOut", async () => { - setWallet(undefined); - setWalletId(undefined); - }); - }, []); + // 3. Verify per NEP-641 — w_resolve_auth pinned to a single block, + // with NEP-413 fallback for regular accounts that don't implement it. + setStatus(`Verifying for ${res.accountId}...`); + const verification = await verifyResolveAuth({ + rpcUrl: RPC_URL, + accountId: res.accountId, + purpose: "PROVE_OWNERSHIP", + recipient: "example.app", + authorization: res.authorization, + }); + + if (verification.status !== "RESOLVED") { + setError(`Verification failed: ${verification.errorMessage}`); + return; + } + + // 4. Verify payload matches the challenge we issued + if (verification.payload !== challenge) { + setError(`Payload mismatch: expected "${challenge}", got "${verification.payload}"`); + return; + } - const connect = async () => { - if (wallet) return selector.disconnect(); - modal.open(); + // 5. Authenticated — set the wallet and account + setStatus(`Verified! Account: ${res.accountId}`); + onAuthenticated(wallet, res.accountId); + } catch (e) { + setError(e instanceof Error ? e.message : String(e)); + } finally { + setLoading(false); + } }; return ( -
-

NEAR Example

- - {walletId != null && } +
+ + {error &&

{error}

}
); }; -const SignMessage = ({ wallet }: { wallet: NearWallet }) => { - const singMessage = async () => { - const nonce = Buffer.from(window.crypto.getRandomValues(new Uint8Array(32))); - const result = await wallet.signMessage?.({ message: "Hello", recipient: "Demo app", nonce }); - alert(`Is verfiied: ${result?.signature}`); +export const ExampleNEAR: FC = () => { + const [network, setNetwork] = useState<"testnet" | "mainnet">("mainnet"); + const [account, _setAccount] = useState<{ id: string; network: "testnet" | "mainnet" }>(); + const [wallet, setWallet] = useState(); + const [extendedSecretKey, setExtendedSecretKey] = useLocalStorage(`example-extended-secret-key-${network}`, undefined); + + const logger = { + log: (...args: any[]) => console.log(args), }; - const sendTx = async () => { - wallet.signAndSendTransaction({ - receiverId: "demo.near", - actions: [{ type: "Transfer", params: { deposit: "0" } }], + function setAccount(account: { accountId: string } | undefined) { + if (account == null) return _setAccount(undefined); + _setAccount({ id: account.accountId, network: account.accountId.endsWith("testnet") ? "testnet" : "mainnet" }); + } + + const [connector] = useState(() => { + const walletConnect = getWalletConnectClient(); + + const connector = new NearConnector({ + manifest: process.env.NODE_ENV === "production" ? undefined : "/near-connect/repository/manifest.json", + providers: { mainnet: ["https://relmn.aurora.dev"] }, + walletConnect, + network, + logger, }); + + connector.on("wallet:signIn", async (t) => { + setWallet(await connector.wallet()); + setAccount(t.accounts[0]); + }); + + connector.on("wallet:signInAndSignMessage", async (t) => { + logger.log(`[wallet:signInAndSignMessage] Signed in to wallet accounts (with signed messages)`, t.accounts); + }); + + connector.on("wallet:signOut", async () => { + setWallet(undefined); + setAccount(undefined); + }); + + // commented out this code as it will cause race-condition with autoConnect + // and setting the account/wallet incorrectly + // connector.wallet().then(async (wallet) => { + // wallet.getAccounts().then((t) => { + // setAccount(t[0]); + // setWallet(wallet); + // }); + // }); + + return connector; + }); + + const networkAccount = useMemo(() => (account != null && account.network === network ? account : undefined), [account, network]); + + const connect = async (options: NearConnector_ConnectOptions = {}) => { + if (networkAccount != null) return connector.disconnect(); + await connector.connect(options); }; return ( - <> - - - +
+

NEAR Example

+ { + setNetwork(network); + connector.switchNetwork(network); + }} + /> + + {networkAccount == null && ( + <> + + + { + setWallet(w); + setAccount({ accountId: acctId }); + }} + /> + + )} + + {networkAccount != null && } +
); }; diff --git a/example/src/WalletActions.tsx b/example/src/WalletActions.tsx new file mode 100644 index 0000000..c8f3f94 --- /dev/null +++ b/example/src/WalletActions.tsx @@ -0,0 +1,18 @@ +import { SignMessage } from "./wallet-action/SignMessage.tsx"; +import { SendTx } from "./wallet-action/SendTx.tsx"; +import { ResolveAuth } from "./wallet-action/ResolveAuth.tsx"; +import { smallGreyText } from "./ui/tailwind-vars.ts"; +import { IPropsWalletAction } from "./wallet-action/wallet-action.types.ts"; + +export const WalletActions = (actionProps: IPropsWalletAction) => { + return ( +
+

Wallet Actions

+
+ + + +
+
+ ); +}; diff --git a/example/src/form-component/NetworkSelector.tsx b/example/src/form-component/NetworkSelector.tsx new file mode 100644 index 0000000..11f2470 --- /dev/null +++ b/example/src/form-component/NetworkSelector.tsx @@ -0,0 +1,22 @@ +import { smallGreyText } from "../ui/tailwind-vars.ts"; + +interface IPropsNetworkSelector { + network: "testnet" | "mainnet"; + onSelectNetwork: (network: "testnet" | "mainnet") => void; +} + +export const NetworkSelector = ({ onSelectNetwork, network }: IPropsNetworkSelector) => { + return ( +
+ Select Network + +
+ ); +}; diff --git a/example/src/index.css b/example/src/index.css index 4dc5fa7..7ea6348 100644 --- a/example/src/index.css +++ b/example/src/index.css @@ -1,116 +1,151 @@ +@import "tailwindcss"; + body { - font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; - line-height: 1.5; - font-weight: 400; + box-sizing: border-box; + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgb(255, 255, 255); + background-color: rgb(22, 22, 22); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} - color-scheme: light dark; - color: rgba(255, 255, 255, 0.87); - background-color: #242424; +#root { + max-width: 1280px; + min-height: 100vh; + margin: 0 auto; + padding: 1rem; + text-align: center; + width: 100%; - font-synthesis: none; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + display: flex; + flex-direction: column; + flex-wrap: wrap; + align-items: center; + gap: 24px; } -* { - box-sizing: border-box; +.view { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + padding: 15px; + gap: 12px; + border: 1px solid rgb(42, 42, 42); + background-color: rgb(22, 22, 22); + border-radius: 24px; } -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; +.view p { + margin: 0; + font-weight: bold; } -a:hover { - color: #535bf2; +.input-form { + display: flex; + flex-direction: column; + gap: 16px; + width: 100%; + border: 1px solid rgb(42, 42, 42); + padding: 10px; + border-radius: 10px; + background-color: rgb(25, 25, 26); } -body { - margin: 0; - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; - width: 100%; +.input-form-label { + font-size: 0.8rem; + color: rgb(255, 255, 255); + font-weight: 600; + text-transform: uppercase; + text-align: left; + letter-spacing: 0.03rem; } -h1 { - font-size: 3.2em; - line-height: 1.1; +.input-group { + display: flex; + flex-direction: column; + gap: 5px; + width: 100%; } -button { - border-radius: 8px; - border: 1px solid transparent; - padding: 0.6em 1.2em; - font-size: 1em; - font-weight: 500; - font-family: inherit; - background-color: #282828; - cursor: pointer; - transition: border-color 0.25s; - outline: none; +.input-label { + font-size: 0.65rem; + color: rgb(126, 130, 144); + font-weight: 500; + text-transform: uppercase; + text-align: left; } -button:hover { - border-color: #646464; +.input-row { + /*display: flex;*/ + /*flex-direction: row;*/ + width: 100%; + justify-items: center; + align-items: end; + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: calc(var(--spacing) * 4); } -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; +.input-row.no-grid { + grid-template-columns: repeat(1, minmax(0, 1fr)); } -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #ffffff; - } +.input-button { + display: flex; + justify-content: center; + align-items: center; + padding: 8px 16px; + border-radius: 8px; + background-color: rgb(42, 42, 42); + color: rgb(255, 255, 255); + cursor: pointer; + transition: background-color 0.3s ease; + width: 100%; - a:hover { - color: #747bff; - } + &:hover { + background-color: rgb(60, 60, 60); + } +} - button { - background-color: #f9f9f9; - } +.input-button.compact { + width: auto; + max-width: none; + padding: 6px 10px; + font-size: 0.75rem; } -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; - width: 100%; +.input-button.danger { + background-color: rgb(70, 30, 30); +} - display: flex; - flex-wrap: wrap; - gap: 24px; +.input-button.danger:hover { + background-color: rgb(95, 35, 35); } -.view { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; - padding: 16px; - gap: 12px; - border: 1px solid rgb(42, 42, 42); - background-color: rgb(22, 22, 22); - border-radius: 24px; - padding-bottom: 24px; - width: calc(50% - 24px); +.input-text.mono { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-size: 0.75rem; } -.view p { - margin: 0; - font-weight: bold; +.input-text { + width: 100%; + padding: 8px; + border-radius: 8px; + border: 1px solid rgb(42, 42, 42); + background-color: rgb(22, 22, 22); + color: rgb(255, 255, 255); + font-size: 0.8rem; } @media screen and (max-width: 800px) { - .view { - width: 100%; - } + .view { + width: 100%; + } } diff --git a/example/src/ui/tailwind-vars.ts b/example/src/ui/tailwind-vars.ts new file mode 100644 index 0000000..f9a6d67 --- /dev/null +++ b/example/src/ui/tailwind-vars.ts @@ -0,0 +1 @@ +export const smallGreyText = "text-sm text-gray-500"; diff --git a/example/src/wallet-action/FinalOutcome.tsx b/example/src/wallet-action/FinalOutcome.tsx new file mode 100644 index 0000000..16443e6 --- /dev/null +++ b/example/src/wallet-action/FinalOutcome.tsx @@ -0,0 +1,26 @@ +import { FinalExecutionOutcome } from "@near-js/types"; + +interface IPropsFinalOutcome { + outcome: FinalExecutionOutcome; + network: "testnet" | "mainnet"; +} + +export const FinalOutcome = ({ outcome, network }: IPropsFinalOutcome) => { + return ( +
+

Last Outcome

+ {outcome != null && ( +
+ {outcome.final_execution_status} + + {outcome.transaction_outcome.id} + +
+ )} +
+ ); +}; diff --git a/example/src/wallet-action/ResolveAuth.tsx b/example/src/wallet-action/ResolveAuth.tsx new file mode 100644 index 0000000..514be93 --- /dev/null +++ b/example/src/wallet-action/ResolveAuth.tsx @@ -0,0 +1,82 @@ +import { useState } from "react"; +import { IPropsWalletAction } from "./wallet-action.types.ts"; + +export const ResolveAuth = ({ wallet, network }: IPropsWalletAction) => { + const [payload, setPayload] = useState("Approve withdrawal of 100 USDC to bob.near"); + const [recipient, setRecipient] = useState("example.app"); + const [result, setResult] = useState(""); + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); + + const handleResolveAuth = async (purpose: "PROVE_OWNERSHIP" | "APPROVE_OFFCHAIN_ACTION") => { + if (!wallet.resolveAuth) { + setError("This wallet does not support resolveAuth (NEP-641)"); + return; + } + setResult(""); + setError(""); + setLoading(true); + try { + const res = await wallet.resolveAuth({ + purpose, + recipient, + payload, + network, + }); + setResult(JSON.stringify(res, null, 2)); + } catch (e) { + setError(e instanceof Error ? e.message : String(e)); + } finally { + setLoading(false); + } + }; + + return ( +
+

NEP-641 Auth Resolve

+
+
+

Recipient (dApp domain)

+ setRecipient(e.target.value)} + /> +
+
+

Payload

+ setPayload(e.target.value)} + /> +
+
+ +
+ {result && ( +
+ + Authorization result + +
+              {result}
+            
+
+ )} + {error &&

{error}

} +
+
+ ); +}; diff --git a/example/src/wallet-action/SendTx.tsx b/example/src/wallet-action/SendTx.tsx new file mode 100644 index 0000000..939b26e --- /dev/null +++ b/example/src/wallet-action/SendTx.tsx @@ -0,0 +1,164 @@ +import { useLocalStorage } from "usehooks-ts"; +import { FinalExecutionOutcome } from "@near-js/types"; + +import { IPropsWalletAction } from "./wallet-action.types.ts"; +import { FinalOutcome } from "./FinalOutcome.tsx"; + +import type { ActionForm, ActionType } from "./action-builder/types.ts"; +import { ACTION_TYPES } from "./action-builder/types.ts"; +import { ActionCard } from "./action-builder/ActionCard.tsx"; +import { ActionFields } from "./action-builder/ActionFields.tsx"; +import { buildConnectorAction, coerceActionForms, defaultActionForm, makeId, previewConnectorActions } from "./action-builder/helpers.ts"; + +export const SendTx = ({ wallet, network }: IPropsWalletAction) => { + const [receiverId, setReceiverId] = useLocalStorage(`send-tx-${network}-receiver-id`, `demo.${network}`); + const [newActionType, setNewActionType] = useLocalStorage(`send-tx-${network}-new-action-type`, "Transfer"); + const [lastResult, setLastResult] = useLocalStorage(`send-tx-${network}-last-result`, undefined); + const [actionsStored, setActionsStored] = useLocalStorage(`send-tx-${network}-actions`, []); + const [lastError, setLastError] = useLocalStorage(`send-tx-${network}-last-error`, ""); + + const actions = coerceActionForms(actionsStored, network); + const setActions = (updater: (prev: ActionForm[]) => ActionForm[]) => { + setActionsStored((prev: unknown) => updater(coerceActionForms(prev, network))); + }; + + const sendTx = async () => { + setLastResult(undefined); + setLastError(""); + try { + const connectorActions = actions.map((a) => buildConnectorAction(a)); + const result = await wallet.signAndSendTransaction({ actions: connectorActions, receiverId }); + setLastResult(result); + } catch (e) { + setLastError(e instanceof Error ? e.message : String(e)); + throw e; + } + }; + + const signDelegateAction = async () => { + setLastResult(undefined); + setLastError(""); + try { + const accounts = await wallet.getAccounts() + const senderId = accounts[0]?.accountId; + if (!senderId) throw new Error("No account available to sign delegate action"); + + const { signedDelegateActions } = await wallet.signDelegateActions({ + delegateActions: [{ + actions: actions.map((a) => buildConnectorAction(a)), + receiverId: receiverId, + }] + }); + alert( + "Successfully signed delegate action. SignedDelegate:\n" + + signedDelegateActions + ); + console.log("signedDelegate", signedDelegateActions); + } catch (e) { + setLastError(e instanceof Error ? e.message : String(e)); + throw e; + } + } + + let payloadPreview: unknown = null; + let previewError: string | null = null; + try { + const connectorActions = actions.map((a) => buildConnectorAction(a)); + payloadPreview = { receiverId, actions: previewConnectorActions(connectorActions) }; + } catch (e) { + previewError = e instanceof Error ? e.message : String(e); + payloadPreview = { receiverId, actions: [] }; + } + + return ( +
+

Send Transaction (Action Builder)

+ +
+
+
+

Receiver Account

+ setReceiverId(e.target.value)} /> +
+
+ + {actions.length > 0 && ( +
+

Actions

+
+ {actions.map((a, idx) => { + const move = (dir: -1 | 1) => { + setActions((prev) => { + const i = prev.findIndex((x) => x.id === a.id); + const j = i + dir; + if (i < 0 || j < 0 || j >= prev.length) return prev; + const out = [...prev]; + const tmp = out[i]; + out[i] = out[j]; + out[j] = tmp; + return out; + }); + }; + + const remove = () => setActions((prev) => prev.filter((x) => x.id !== a.id)); + const setA = (next: ActionForm) => setActions((prev) => prev.map((x) => (x.id === a.id ? next : x))); + const setType = (type: ActionType) => setActions((prev) => prev.map((x) => (x.id === a.id ? defaultActionForm(type, a.id, network) : x))); + + return ( + + + + ); + })} +
+
+ )} + +
+

New action

+ +
+ + +
+
+ +
+ Payload preview +
+            {JSON.stringify(payloadPreview, null, 2)}
+          
+
+ +
+ +
+ +
+ +
+ + {previewError ?

Preview error: {previewError}

: null} + {lastError ?

{lastError}

: null} + {lastResult != null && } +
+
+ ); +}; diff --git a/example/src/wallet-action/SignMessage.tsx b/example/src/wallet-action/SignMessage.tsx new file mode 100644 index 0000000..4e29e5d --- /dev/null +++ b/example/src/wallet-action/SignMessage.tsx @@ -0,0 +1,23 @@ +import { IPropsWalletAction } from "./wallet-action.types.ts"; + +export const SignMessage = ({ wallet }: IPropsWalletAction) => { + const signMessage = async () => { + try { + const nonce = new Uint8Array(window.crypto.getRandomValues(new Uint8Array(32))); + const result = await wallet.signMessage?.({ message: "Hello", recipient: "Demo app", nonce }); + console.log(`Is verfiied: ${result?.signature}`); + } catch (error) { + console.error(error); + } + }; + + return ( +
+
+ +
+
+ ); +}; diff --git a/example/src/wallet-action/action-builder/ActionCard.tsx b/example/src/wallet-action/action-builder/ActionCard.tsx new file mode 100644 index 0000000..adcd38c --- /dev/null +++ b/example/src/wallet-action/action-builder/ActionCard.tsx @@ -0,0 +1,48 @@ +import type { ReactNode } from "react"; +import type { ActionForm, ActionType } from "./types.ts"; +import { ACTION_TYPES } from "./types.ts"; + +export function ActionCard(props: { + index: number; + total: number; + value: ActionForm; + onChange: (next: ActionForm) => void; + onTypeChange: (type: ActionType) => void; + onMove: (dir: -1 | 1) => void; + onRemove: () => void; + children: ReactNode; +}) { + const { index, total, value, onChange, onTypeChange, onMove, onRemove, children } = props; + + return ( +
+
+
+

Type

+ +
+ + + + + +
+ + {value.collapsed ? null : children} +
+ ); +} diff --git a/example/src/wallet-action/action-builder/ActionFields.tsx b/example/src/wallet-action/action-builder/ActionFields.tsx new file mode 100644 index 0000000..2238783 --- /dev/null +++ b/example/src/wallet-action/action-builder/ActionFields.tsx @@ -0,0 +1,37 @@ +import type { ActionForm } from "./types.ts"; +import { AddKeyFields } from "./fields/AddKeyFields.tsx"; +import { CreateAccountFields } from "./fields/CreateAccountFields.tsx"; +import { DeleteAccountFields } from "./fields/DeleteAccountFields.tsx"; +import { DeleteKeyFields } from "./fields/DeleteKeyFields.tsx"; +import { DeployContractFields } from "./fields/DeployContractFields.tsx"; +import { DeployGlobalContractFields } from "./fields/DeployGlobalContractFields.tsx"; +import { FunctionCallFields } from "./fields/FunctionCallFields.tsx"; +import { StakeFields } from "./fields/StakeFields.tsx"; +import { TransferFields } from "./fields/TransferFields.tsx"; +import { UseGlobalContractFields } from "./fields/UseGlobalContractFields.tsx"; + +export function ActionFields(props: { value: ActionForm; onChange: (next: ActionForm) => void }) { + const { value, onChange } = props; + switch (value.type) { + case "CreateAccount": + return ; + case "DeployContract": + return ; + case "FunctionCall": + return ; + case "Transfer": + return ; + case "Stake": + return ; + case "AddKey": + return ; + case "DeleteKey": + return ; + case "DeleteAccount": + return ; + case "UseGlobalContract": + return ; + case "DeployGlobalContract": + return ; + } +} diff --git a/example/src/wallet-action/action-builder/fields/AddKeyFields.tsx b/example/src/wallet-action/action-builder/fields/AddKeyFields.tsx new file mode 100644 index 0000000..0cd0642 --- /dev/null +++ b/example/src/wallet-action/action-builder/fields/AddKeyFields.tsx @@ -0,0 +1,54 @@ +import type { AddKeyForm } from "../types.ts"; + +export function AddKeyFields(props: { value: AddKeyForm; onChange: (next: AddKeyForm) => void }) { + const { value, onChange } = props; + + return ( +
+
+
+

Public key

+ onChange({ ...value, publicKey: e.target.value })} /> +
+
+

Nonce (optional)

+ onChange({ ...value, nonce: e.target.value })} /> +
+
+

Permission

+ +
+
+ + {value.permissionType === "FunctionCall" && ( +
+
+

ReceiverId

+ onChange({ ...value, receiverId: e.target.value })} /> +
+
+
+

Allowance (NEAR)

+ onChange({ ...value, allowanceNear: e.target.value })} /> +
+
+

Allowance (yocto, overrides NEAR)

+ onChange({ ...value, allowanceYocto: e.target.value })} /> +
+
+
+

Method names (comma separated, optional)

+ onChange({ ...value, methodNamesCsv: e.target.value })} /> +
+
+ )} +
+ ); +} diff --git a/example/src/wallet-action/action-builder/fields/CreateAccountFields.tsx b/example/src/wallet-action/action-builder/fields/CreateAccountFields.tsx new file mode 100644 index 0000000..9fc09df --- /dev/null +++ b/example/src/wallet-action/action-builder/fields/CreateAccountFields.tsx @@ -0,0 +1,5 @@ +import type { CreateAccountForm } from "../types.ts"; + +export function CreateAccountFields(_props: { value: CreateAccountForm; onChange: (next: CreateAccountForm) => void }) { + return
No params
; +} diff --git a/example/src/wallet-action/action-builder/fields/DeleteAccountFields.tsx b/example/src/wallet-action/action-builder/fields/DeleteAccountFields.tsx new file mode 100644 index 0000000..b8f69a1 --- /dev/null +++ b/example/src/wallet-action/action-builder/fields/DeleteAccountFields.tsx @@ -0,0 +1,12 @@ +import type { DeleteAccountForm } from "../types.ts"; + +export function DeleteAccountFields(props: { value: DeleteAccountForm; onChange: (next: DeleteAccountForm) => void }) { + const { value, onChange } = props; + + return ( +
+

BeneficiaryId

+ onChange({ ...value, beneficiaryId: e.target.value })} /> +
+ ); +} diff --git a/example/src/wallet-action/action-builder/fields/DeleteKeyFields.tsx b/example/src/wallet-action/action-builder/fields/DeleteKeyFields.tsx new file mode 100644 index 0000000..b80d9d1 --- /dev/null +++ b/example/src/wallet-action/action-builder/fields/DeleteKeyFields.tsx @@ -0,0 +1,12 @@ +import type { DeleteKeyForm } from "../types.ts"; + +export function DeleteKeyFields(props: { value: DeleteKeyForm; onChange: (next: DeleteKeyForm) => void }) { + const { value, onChange } = props; + + return ( +
+

Public key

+ onChange({ ...value, publicKey: e.target.value })} /> +
+ ); +} diff --git a/example/src/wallet-action/action-builder/fields/DeployContractFields.tsx b/example/src/wallet-action/action-builder/fields/DeployContractFields.tsx new file mode 100644 index 0000000..4d29b93 --- /dev/null +++ b/example/src/wallet-action/action-builder/fields/DeployContractFields.tsx @@ -0,0 +1,29 @@ +import type { DeployContractForm } from "../types.ts"; +import { base64FromBytes } from "../helpers.ts"; + +export function DeployContractFields(props: { value: DeployContractForm; onChange: (next: DeployContractForm) => void }) { + const { value, onChange } = props; + + return ( +
+
+

WASM code (base64)

+ + +
+ + ${this.footer} +
+
+ `; + } + + return html``; + } +} diff --git a/src/popups/Popup.ts b/src/popups/Popup.ts new file mode 100644 index 0000000..b0e3ab2 --- /dev/null +++ b/src/popups/Popup.ts @@ -0,0 +1,100 @@ +import { css } from "./styles"; +import { html } from "../helpers/html"; + +const ID = `n${Math.random().toString(36).substring(2, 15)}`; + +if (typeof document !== "undefined") { + const style = document.createElement("style"); + style.textContent = css(`.${ID}`); + document.head.append(style); +} + +export class Popup> { + isClosed = false; + root = document.createElement("div"); + state: T = {} as T; + + constructor(readonly delegate: { onReject: () => void }) {} + + get dom() { + return html``; + } + + disposables: (() => void)[] = []; + addListener(querySelector: string | Element, event: string, callback: (e: Event) => void) { + const element = typeof querySelector === "string" ? this.root.querySelector(querySelector)! : querySelector; + if (!element) return; + element.addEventListener(event, callback); + this.disposables.push(() => element.removeEventListener(event, callback)); + } + + handlers() { + this.disposables.forEach((dispose) => dispose()); + this.disposables = []; + + const modalContainer = this.root.querySelector(".modal-container")! as HTMLElement; + const modalContent = this.root.querySelector(".modal-content")! as HTMLElement; + modalContent.onclick = (e) => e.stopPropagation(); + modalContainer.onclick = () => { + this.delegate.onReject(); + this.destroy(); + }; + } + + update(state: Partial) { + this.state = { ...this.state, ...state } as T; + this.root.innerHTML = this.dom.html; + this.handlers(); + } + + create({ show = true }: { show?: boolean }) { + this.root.className = `${ID} hot-connector-popup`; + this.root.innerHTML = this.dom.html; + document.body.append(this.root); + this.handlers(); + + const modalContainer = this.root.querySelector(".modal-container")! as HTMLElement; + const modalContent = this.root.querySelector(".modal-content")! as HTMLElement; + modalContent.style.transform = "translateY(50px)"; + modalContainer.style.opacity = "0"; + this.root.style.display = "none"; + + if (show) { + setTimeout(() => this.show(), 10); + } + } + + show() { + const modalContainer = this.root.querySelector(".modal-container")! as HTMLElement; + const modalContent = this.root.querySelector(".modal-content")! as HTMLElement; + + modalContent.style.transform = "translateY(50px)"; + modalContainer.style.opacity = "0"; + this.root.style.display = "block"; + + setTimeout(() => { + modalContent.style.transform = "translateY(0)"; + modalContainer.style.opacity = "1"; + }, 100); + } + + hide() { + const modalContainer = this.root.querySelector(".modal-container")! as HTMLElement; + const modalContent = this.root.querySelector(".modal-content")! as HTMLElement; + modalContent.style.transform = "translateY(50px)"; + modalContainer.style.opacity = "0"; + + setTimeout(() => { + this.root.style.display = "none"; + }, 200); + } + + destroy() { + if (this.isClosed) return; + this.isClosed = true; + this.hide(); + setTimeout(() => { + this.root.remove(); + }, 200); + } +} diff --git a/src/popups/styles.ts b/src/popups/styles.ts new file mode 100644 index 0000000..b6440e0 --- /dev/null +++ b/src/popups/styles.ts @@ -0,0 +1,258 @@ +export const css = (id: string) => /*css*/ ` +${id} * { + box-sizing: border-box; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + -ms-overflow-style: none; + scrollbar-width: none; + color: #fff; +} + +${id} *::-webkit-scrollbar { + display: none; +} + +${id} p, +${id} h1, +${id} h2, +${id} h3, +${id} h4, +${id} h5, +${id} h6 { + margin: 0; +} + +${id} .modal-container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 100000000; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + transition: opacity 0.2s ease-in-out; +} + +@media (max-width: 600px) { + ${id} .modal-container { + justify-content: flex-end; + } +} + +${id} .modal-content { + display: flex; + flex-direction: column; + align-items: center; + + max-width: 420px; + max-height: 615px; + width: 100%; + border-radius: 24px; + background: #0d0d0d; + border: 1.5px solid rgba(255, 255, 255, 0.1); + transition: transform 0.2s ease-in-out; +} + +@media (max-width: 600px) { + ${id} .modal-content { + max-width: 100%; + width: 100%; + max-height: 80%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border: none; + border-top: 1.5px solid rgba(255, 255, 255, 0.1); + } +} + + +${id} .modal-header { + display: flex; + padding: 16px; + gap: 16px; + align-self: stretch; + align-items: center; + justify-content: center; + position: relative; +} + +${id} .modal-header button { + position: absolute; + right: 16px; + top: 16px; + width: 32px; + height: 32px; + border-radius: 12px; + cursor: pointer; + transition: background 0.2s ease-in-out; + border: none; + background: none; + display: flex; + align-items: center; + justify-content: center; +} + +${id} .modal-header button:hover { + background: rgba(255, 255, 255, 0.04); +} + +${id} .modal-header p { + color: #fff; + text-align: center; + font-size: 24px; + font-style: normal; + font-weight: 600; + line-height: normal; + margin: 0; +} + + +${id} .modal-body { + display: flex; + padding: 16px; + flex-direction: column; + align-items: flex-start; + text-align: center; + gap: 8px; + overflow: auto; + + border-radius: 24px; + background: rgba(255, 255, 255, 0.08); + width: 100%; + flex: 1; +} + +${id} .modal-body textarea { + width: 100%; + padding: 12px; + border-radius: 12px; + background: #0d0d0d; + color: #fff; + border: 1px solid rgba(255, 255, 255, 0.1); + outline: none; + font-size: 16px; + transition: background 0.2s ease-in-out; + font-family: monospace; + font-size: 12px; +} + +${id} .modal-body button { + width: 100%; + padding: 12px; + border-radius: 12px; + background: #fff; + color: #000; + border: none; + cursor: pointer; + font-size: 16px; + transition: background 0.2s ease-in-out; + margin-top: 16px; +} + +${id} .footer { + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + padding: 16px 24px; + color: #fff; + gap: 12px; +} + +${id} .modal-body p { + color: rgba(255, 255, 255, 0.9); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: normal; + letter-spacing: -0.8px; +} + +${id} .footer img { + width: 24px; + height: 24px; + border-radius: 50%; + object-fit: cover; +} + +${id} .get-wallet-link { + color: rgba(255, 255, 255, 0.5); + text-align: center; + font-size: 16px; + font-style: normal; + font-weight: 500; + margin-left: auto; + text-decoration: none; + transition: color 0.2s ease-in-out; + cursor: pointer; +} + +${id} .get-wallet-link:hover { + color: rgba(255, 255, 255, 1); +} + + +${id} .connect-item { + display: flex; + padding: 8px; + align-items: center; + gap: 12px; + align-self: stretch; + cursor: pointer; + + transition: background 0.2s ease-in-out; + border-radius: 24px; +} + +${id} .connect-item img { + width: 48px; + height: 48px; + border-radius: 16px; + object-fit: cover; + flex-shrink: 0; +} + +${id} .connect-item-info { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + text-align: left; + flex: 1; + margin-top: -2px; +} + +${id} .connect-item-info .wallet-address { + color: rgba(255, 255, 255, 0.5); + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; +} + +${id} .connect-item:hover { + background: rgba(255, 255, 255, 0.04); +} + +${id} .connect-item img { + width: 48px; + height: 48px; + border-radius: 16px; + object-fit: cover; +} + +${id} .connect-item p { + color: rgba(255, 255, 255, 0.9); + text-align: center; + font-size: 18px; + font-style: normal; + font-weight: 600; + line-height: normal; + letter-spacing: -0.36px; + margin: 0; +} +`; diff --git a/src/selector.ts b/src/selector.ts deleted file mode 100644 index 76984df..0000000 --- a/src/selector.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { NearWallet, EventNearWalletInjected, WalletManifest } from "./types/wallet"; -import { LocalStorage, DataStorage } from "./storage"; -import { SandboxWallet } from "./wallet"; -import { manifest } from "./manifest"; -import { EventEmitter } from "./events"; - -export class WalletSelector { - private storage: DataStorage; - private events: EventEmitter; - - manifest: { wallets: WalletManifest[] }; - wallets: NearWallet[] = []; - - constructor(options?: { storage?: DataStorage; events?: EventEmitter; manifest?: { wallets: WalletManifest[] } }) { - this.storage = options?.storage ?? new LocalStorage(); - this.events = options?.events ?? new EventEmitter(); - this.manifest = options?.manifest ?? manifest; - - this.manifest.wallets.forEach((wallet) => this.registerWallet(wallet)); - window.addEventListener("near-wallet-injected", (event: EventNearWalletInjected) => { - console.log("near-wallet-injected", event); - this.wallets.push(event.detail.wallet); - }); - } - - async registerWallet(wallet: WalletManifest) { - if (wallet.type !== "sandbox") throw new Error("Only sandbox wallets are supported"); - this.wallets.push(new SandboxWallet(wallet)); - } - - async connect(id: string) { - const wallet = await this.wallet(id); - await this.storage.set("selected-wallet", id); - - const accounts = await wallet?.signIn({ contractId: "" }); - if (!accounts?.length) throw new Error("Failed to sign in"); - this.events.emit("signedIn", { wallet, accounts }); - return wallet; - } - - async disconnect(wallet?: NearWallet) { - if (!wallet) wallet = await this.wallet(); - await wallet.signOut(); - - await this.storage.remove("selected-wallet"); - this.events.emit("signedOut"); - } - - async wallet(id?: string | null) { - if (!id) { - const id = await this.storage.get("selected-wallet"); - const wallet = this.wallets.find((wallet) => wallet.manifest.id === id); - if (!wallet) throw new Error("No wallet selected"); - - const accounts = await wallet.getAccounts().catch(() => null); - if (!accounts?.length) { - await this.disconnect(wallet); - throw new Error("No accounts found"); - } - - return wallet; - } - - const wallet = this.wallets.find((wallet) => wallet.manifest.id === id); - if (!wallet) throw new Error("Wallet not found"); - return wallet; - } - - on(event: string, callback: (...args: any[]) => void) { - this.events.on(event, callback); - } - - once(event: string, callback: (...args: any[]) => void) { - this.events.once(event, callback); - } - - off(event: string, callback: (...args: any[]) => void) { - this.events.off(event, callback); - } - - removeAllListeners(event?: string) { - this.events.removeAllListeners(event); - } -} diff --git a/src/styles.css b/src/styles.css deleted file mode 100644 index 1338578..0000000 --- a/src/styles.css +++ /dev/null @@ -1,175 +0,0 @@ -:root { - --background-color: rgb(40, 40, 40); - --text-color: rgb(255, 255, 255); - --border-color: rgb(209, 209, 209); -} - -.wallet-selector__container { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; -} - -.wallet-selector__modal { - height: 600px; - position: relative; - background-color: var(--background-color); - box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5); - border-radius: 16px; - overflow: hidden; - display: flex; -} - -.wallet-selector__options { - display: flex; - flex-direction: column; - gap: 8px; -} - -.wallet-selector__modal-sidebar { - border-right: 1px solid #414141; - width: 300px; - padding: 16px; -} - -.wallet-selector__modal-content { - width: 400px; -} - -.wallet-selector__modal-content iframe { - width: 100%; - height: 100%; - border: none; -} - -.wallet-selector__option { - display: flex; - align-items: center; - justify-content: flex-start; - gap: 16px; - padding: 12px; - border-radius: 16px; - background-color: #1b1b1b; - cursor: pointer; - color: #fff; - width: 100%; - outline: none !important; - border: none; - font-size: 16px; - font-weight: 600; - transition: background-color 0.2s, transform 0.2s; -} - -.wallet-selector__option div { - display: flex; - flex-direction: column; - text-align: left; - gap: 4px; -} - -.wallet-selector__option h2 { - margin: 0; - font-size: 16px; - font-weight: 600; -} - -.wallet-selector__option p { - margin: 0; - font-size: 14px; - font-weight: 400; - color: #888; -} - -.wallet-selector__option:hover { - background-color: #131313; - transform: scale(1.01); -} - -.wallet-selector__option:active, -.wallet-selector__option:focus { - outline: none !important; -} - -.wallet-selector__option * { - pointer-events: none; -} - -.wallet-selector__option img { - width: 48px; - height: 48px; - border-radius: 12px; - background-color: #1a1a1a; - border: none; -} - -.wallet-selector__header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 16px; -} - -.wallet-selector__header p { - margin: 0; - font-size: 24px; - font-weight: 600; -} - -.wallet-selector__close { - background-color: transparent; - border: none; - cursor: pointer; - padding: 0; - margin: 0; - outline: none !important; - border-radius: 50%; - width: 32px; - height: 32px; - display: flex; - align-items: center; - justify-content: center; - transition: background-color 0.2s, transform 0.2s; - position: absolute; - top: 16px; - right: 16px; -} - -.wallet-selector__close:hover { - background-color: #131313; -} - -.wallet-selector__close svg { - pointer-events: none; -} - -.wallet-selector__modal-introduction { - display: flex; - flex-direction: column; - padding: 16px; - gap: 16px; -} - -.wallet-selector__modal-introduction p { - margin: 0; - font-size: 16px; - font-weight: 600; -} - -.wallet-selector__modal-introduction h2 { - margin: 0; - font-size: 24px; - font-weight: 600; -} - -.wallet-selector__modal-introduction p:nth-child(2) { - margin: 0; - font-size: 14px; - font-weight: 500; - color: rgb(209, 209, 209); -} diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 0000000..c0cd953 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,275 @@ +import type { FinalExecutionOutcome } from "@near-js/types"; +import type { Action } from "@near-js/transactions"; +import type { ConnectorAction } from "../actions/types"; + +export type { FinalExecutionOutcome, Action }; + +export type Logger = { + log: (...logs: any[]) => void; +}; + +export type Optional = Omit & Partial>; + +export type Network = "mainnet" | "testnet"; + +export interface FunctionCallAccessKey_AllowMethods_AnyMethod { + anyMethod: true; +} + +export interface FunctionCallAccessKey_AllowMethods_SelectMethods { + anyMethod: false; + methodNames: string[]; +} + +export type AddFunctionCallKey_AllowMethods = FunctionCallAccessKey_AllowMethods_AnyMethod | FunctionCallAccessKey_AllowMethods_SelectMethods; + +export interface FunctionCallAccessKey_GasAllowance_Unlimited { + kind: "unlimited"; +} + +export interface FunctionCallAccessKey_GasAllowance_Limited { + kind: "limited"; + /** The amount of gas allowed over the lifetime of the key in yoctoNEAR. */ + amount: string; +} + +export type AddFunctionCallKey_GasAllowance = FunctionCallAccessKey_GasAllowance_Unlimited | FunctionCallAccessKey_GasAllowance_Limited; + +export interface AddFunctionCallKeyParams { + // The contract account ID which the Function Call Key will have access to call methods on. + contractId: string; + /** Using format ":" e.g. "ed25519:3N5QmbhVqLh9ZtZs1zj8X9v1u1Z1Z1Z1Z1Z1Z1Z1Z1Z" */ + publicKey: string; + /** Define which methods can be called by this Function Call Key on the "contractId" account */ + allowMethods: AddFunctionCallKey_AllowMethods; + /** Optional: The gas allowance for the Function Call Key over its lifetime of executing transactions. + * Default to "limited" with 0.25 NEAR (non-Yocto). */ + gasAllowance?: AddFunctionCallKey_GasAllowance; +} + +export interface NearConnector_ConnectOptions { + walletId?: string; + /** + * If this is provided, the connector will filter for wallets that support the "signInAndSignMessage" feature and use these params for the message to be signed along with sign in. + * + * The account and the signed message can be listened for using the "wallet:signInAndSignMessage" event, which will be emitted along + * with the "wallet:signIn" event. This allows you to get the signed message right after sign in. + * + * This is useful for cases where you want to verify ownership of the account during sign in without any additional steps. + */ + signMessageParams?: SignMessageDuringSignInParams; + /** + * If this is provided, the connector will filter for wallets that support the "signInWithFunctionCallAccessKey" feature and use these + * params to add a function call access key during sign in. + * + * These params indicate to the wallet that a Function Call Key with these parameters should be added during the sign in process with the specified parameters. + * + * See: https://docs.near.org/protocol/access-keys#function-call-keys + */ + addFunctionCallKey?: AddFunctionCallKeyParams; +} + +export interface Account { + accountId: string; + publicKey?: string; +} + +export interface AccountWithSignedMessage extends Account { + signedMessage: SignedMessage; +} + +export interface SignMessageParams { + message: string; + recipient: string; + nonce: Uint8Array; + network?: Network; + signerId?: string; +} + +export type SignMessageDuringSignInParams = Omit; + +export interface SignedMessage { + accountId: string; + publicKey: string; + signature: string; +} + +export type EventNearWalletInjected = CustomEvent; + +export interface WalletPermissions { + storage?: boolean; + external?: string[]; + walletConnect?: boolean; + allowsOpen?: string[]; + clipboardRead?: boolean; + clipboardWrite?: boolean; + usb?: boolean; + hid?: boolean; + bluetooth?: boolean; + webauthn?: boolean; +} + +export interface SignAndSendTransactionParams { + network?: Network; + signerId?: string; + receiverId: string; + actions: Array; +} + +export interface SignAndSendTransactionsParams { + network?: Network; + signerId?: string; + transactions: Array<{ receiverId: string; actions: Array }>; +} + +export interface SignDelegateActionsParams { + network?: Network; + signerId?: string; + delegateActions: Array<{ + actions: Array; + receiverId: string; + }>; +} + +export interface SignDelegateActionsResponse { + // Borsh-serialized base64 strings of "SignedDelegate" + signedDelegateActions: string[]; +} + +export type ResolveAuthPurpose = "PROVE_OWNERSHIP" | "APPROVE_OFFCHAIN_ACTION"; + +export interface ResolveAuthParams { + network?: Network; + purpose: ResolveAuthPurpose; + recipient: string; + payload: string; +} + +export interface ResolveAuthResponse { + accountId: string; + /** JSON-stringified authorization to pass to w_resolve_auth */ + authorization: string; +} + +export interface WalletManifest { + id: string; + platform: string[]; + name: string; + icon: string; + description: string; + website: string; + version: string; + executor: string; + type: "sandbox" | "injected"; + permissions: WalletPermissions; + features: WalletFeatures; + debug?: boolean; +} + +export interface WalletFeatures { + signMessage: boolean; + signTransaction: boolean; + signAndSendTransaction: boolean; + signAndSendTransactions: boolean; + signInWithoutAddKey: boolean; + signInAndSignMessage: boolean; + signInWithFunctionCallKey: boolean; + signDelegateActions: boolean; + resolveAuth: boolean; + mainnet: boolean; + testnet: boolean; +} + +export interface SignInParams { + network?: Network; + addFunctionCallKey?: AddFunctionCallKeyParams; +} + +export interface SignInAndSignMessageParams extends SignInParams { + messageParams: SignMessageDuringSignInParams; +} + +export interface NearWalletBase { + manifest: WalletManifest; + + /** + * Programmatically sign in. Hardware wallets (e.g. Ledger) require `derivationPaths` to validate access key permissions. + */ + signIn(data?: SignInParams): Promise>; + /** + * Programmatically sign in. Hardware wallets (e.g. Ledger) require `derivationPaths` to validate access key permissions. + */ + signInAndSignMessage(data: SignInAndSignMessageParams): Promise>; + /** + * Sign out from the wallet. + */ + signOut(data?: { network?: Network }): Promise; + /** + * Returns one or more accounts when signed in. + * This method can be useful for wallets that support accounts at once such as WalletConnect. + * In this case, you can use an `accountId` returned as the `signerId` for `signAndSendTransaction`. + */ + getAccounts(data?: { network?: Network }): Promise>; + /** + * Signs one or more NEAR Actions before sending to the network. + * The user must be signed in to call this method as there's at least charges for gas spent. + */ + signAndSendTransaction(params: SignAndSendTransactionParams): Promise; + /** + * Signs one or more transactions before sending to the network. + * The user must be signed in to call this method as there's at least charges for gas spent. + */ + signAndSendTransactions(params: SignAndSendTransactionsParams): Promise>; + + signMessage(params: SignMessageParams): Promise; + + signDelegateActions(params: SignDelegateActionsParams): Promise; + + /** + * NEP-641: Produce an authorization blob for off-chain verification. + * The blob can be verified on-chain via `w_resolve_auth` view call. + * Only available when the wallet's `resolveAuth` feature is `true`. + */ + resolveAuth?(params: ResolveAuthParams): Promise; +} + +export interface EventMap { + "wallet:signIn": { wallet: NearWalletBase; accounts: Account[]; success: boolean; source: "signIn" | "signInAndSignMessage" }; + "wallet:signInAndSignMessage": { wallet: NearWalletBase; accounts: AccountWithSignedMessage[]; success: boolean }; + "wallet:signOut": any; + "selector:manifestUpdated": any; + "selector:walletsChanged": any; +} + +export type EventType = keyof EventMap; + +export type EventCallback = (payload: EventMap[K]) => void; + +export type WalletEvents = { + signedIn: { contractId: string; methodNames: Array; accounts: Array }; + accountsChanged: { accounts: Array }; + networkChanged: { networkId: string }; + signedOut: null; +}; + +export interface AbstractWalletConnect { + connect: (params: any) => Promise<{ uri?: string; approval: () => Promise }>; + disconnect: (params: any) => Promise; + request: (params: any) => Promise; + + session: { + keys: string[]; + get: (key: string) => { topic: string; namespaces: any }; + }; + + core: { + projectId?: string; + }; +} + +export interface FooterBranding { + icon?: string; + heading: string; + link: string; + linkText: string; +} diff --git a/src/types/plugin.ts b/src/types/plugin.ts new file mode 100644 index 0000000..95cc964 --- /dev/null +++ b/src/types/plugin.ts @@ -0,0 +1,9 @@ +import { NearWalletBase } from "../types"; + +export type WalletPlugin = Partial<{ + [K in keyof NearWalletBase]: NearWalletBase[K] extends (...args: infer Args) => infer Return + ? (...args: [...Args, () => Return]) => Return + : never; +}> & { + [key: string]: (...args: any[]) => any; +}; diff --git a/src/types/wallet.ts b/src/types/wallet.ts deleted file mode 100644 index dec75b0..0000000 --- a/src/types/wallet.ts +++ /dev/null @@ -1,151 +0,0 @@ -import type { providers, utils } from "near-api-js"; -import type { Transaction, Action } from "./transactions"; - -export type Optional = Omit & Partial>; - -export interface Account { - /** - * NEAR account identifier. - */ - accountId: string; - /** - * Account public key. - */ - publicKey?: string; -} - -export interface SignInParams { - /** - * Account ID of the Smart Contract. - */ - contractId: string; - /** - * Specify limited access to particular methods on the Smart Contract. - */ - methodNames?: Array; -} - -export interface VerifyOwnerParams { - /** - * The message requested sign. Defaults to `verify owner` string. - */ - message: string; - /** - * Applicable to browser wallets (e.g. MyNearWallet). This is the callback url once the signing is approved. Defaults to `window.location.href`. - */ - callbackUrl?: string; - /** - * Applicable to browser wallets (e.g. MyNearWallet) extra data that will be passed to the callback url once the signing is approved. - */ - meta?: string; -} - -export interface VerifiedOwner { - accountId: string; - message: string; - blockId: string; - publicKey: string; - signature: string; - keyType: utils.key_pair.KeyType; -} - -export interface SignMessageParams { - message: string; - recipient: string; - nonce: Buffer; - callbackUrl?: string; - state?: string; -} - -export interface SignedMessage { - accountId: string; - publicKey: string; - signature: string; - state?: string; -} - -export type SignMessageMethod = { - signMessage(params: SignMessageParams): Promise; -}; - -export interface SignAndSendTransactionParams { - /** - * Account ID used to sign the transaction. Defaults to the first account. - */ - signerId?: string; - /** - * Account ID to receive the transaction. Defaults to `contractId` defined in `init`. - */ - receiverId?: string; - /** - * NEAR Action(s) to sign and send to the network (e.g. `FunctionCall`). You can find more information on `Action` {@link https://github.com/near/wallet-selector/blob/main/packages/core/docs/api/transactions.md | here}. - */ - actions: Array; -} - -export interface SignAndSendTransactionsParams { - /** - * NEAR Transactions(s) to sign and send to the network. You can find more information on `Transaction` {@link https://github.com/near/wallet-selector/blob/main/packages/core/docs/api/transactions.md | here}. - */ - transactions: Array>; -} - -export type EventNearWalletInjected = CustomEvent<{ wallet: NearWallet }>; - -export interface WalletManifest { - id: string; - platform: string[]; - name: string; - icon: string; - description: string; - website: string; - version: string; - executor: string; - type: "sandbox" | "injected"; -} - -export interface NearWallet { - manifest: WalletManifest; - - /** - * Programmatically sign in. Hardware wallets (e.g. Ledger) require `derivationPaths` to validate access key permissions. - */ - signIn(params: SignInParams): Promise>; - /** - * Sign out from the wallet. - */ - signOut(): Promise; - /** - * Returns one or more accounts when signed in. - * This method can be useful for wallets that support accounts at once such as WalletConnect. - * In this case, you can use an `accountId` returned as the `signerId` for `signAndSendTransaction`. - */ - getAccounts(): Promise>; - /** - * Signs the message and verifies the owner. Message is not sent to blockchain. - */ - verifyOwner(params: VerifyOwnerParams): Promise; - /** - * Signs one or more NEAR Actions before sending to the network. - * The user must be signed in to call this method as there's at least charges for gas spent. - */ - signAndSendTransaction(params: SignAndSendTransactionParams): Promise; - /** - * Signs one or more transactions before sending to the network. - * The user must be signed in to call this method as there's at least charges for gas spent. - */ - signAndSendTransactions(params: SignAndSendTransactionsParams): Promise>; - signMessage?(params: SignMessageParams): Promise; -} - -export type WalletEvents = { - signedIn: { - contractId: string; - methodNames: Array; - accounts: Array; - }; - signedOut: null; - accountsChanged: { accounts: Array }; - networkChanged: { networkId: string }; - uriChanged: { uri: string }; -}; diff --git a/src/ui.ts b/src/ui.ts deleted file mode 100644 index eafc341..0000000 --- a/src/ui.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { WalletSelector } from "./selector"; - -export class WalletSelectorUI { - private container: HTMLElement; - private state: Record = {}; - - constructor(readonly selector: WalletSelector) { - this.container = document.createElement("div"); - this.container.innerHTML = ` -
-
- - -
-
-

Select a wallet

-
-
-
- -
-
-

What is a Wallet?

- -
-

Secure & Manage Your Digital Assets

-

Safely store and transfer your crypto and NFTs.

-
- -
-

Log In to Any NEAR App

-

No need to create new accounts or credentials. Connect your wallet and you are good to go!

-
-
-
-
-
- `; - - document.body.appendChild(this.container); - this.container.style.display = "none"; - this.render(); - - window.addEventListener("click", async (e) => { - if (e.target instanceof HTMLElement) { - if (e.target.classList.contains("wallet-selector__close")) return this.close(); - if (e.target.classList.contains("wallet-selector__container")) return this.close(); - - const id = e.target.dataset.id; - if (!id) return; - - try { - this.state[id] = { status: "connecting" }; - this.render(); - - await this.selector.connect(id); - - this.state[id] = { status: "connected" }; - this.render(); - this.close(); - } catch (error) { - console.error("Error connecting to wallet", error); - this.state[id] = { status: "error", error }; - this.render(); - } - } - }); - - this.selector.on("signedIn", ({ wallet }) => { - this.state[wallet.manifest.id] = { status: "connected" }; - this.render(); - }); - - this.selector.on("signedOut", () => { - this.state = {}; - this.render(); - }); - } - - open() { - this.render(); - this.container.style.display = "block"; - } - - close() { - this.container.style.display = "none"; - } - - render() { - const options = this.selector.wallets.map((wallet) => { - return ``; - }); - - const el = this.container.querySelector(".wallet-selector__options"); - if (el) el.innerHTML = options.join(""); - } -} diff --git a/src/wallet.ts b/src/wallet.ts deleted file mode 100644 index 052c2ab..0000000 --- a/src/wallet.ts +++ /dev/null @@ -1,257 +0,0 @@ -import uuid4 from "uuid4"; -import { FinalExecutionOutcome } from "@near-js/types"; - -import { - Account, - NearWallet, - SignAndSendTransactionParams, - SignAndSendTransactionsParams, - SignedMessage, - SignInParams, - SignMessageParams, - VerifiedOwner, - VerifyOwnerParams, - WalletManifest, -} from "./types/wallet"; - -export class SandboxExecutor { - iframe?: HTMLIFrameElement; - _initializeTask: Promise | null = null; - origin = uuid4(); - - constructor(readonly id: string, readonly endpoint: string) { - this.id = id; - } - - async _initialize() { - this.iframe = document.createElement("iframe"); - this.iframe.setAttribute("sandbox", "allow-scripts"); - this.iframe.allow = "usb *; hid *;"; - this.iframe.srcdoc = this.code; - - const content = document.querySelector(".wallet-selector__modal-content"); - - if (content) { - content.innerHTML = ``; - content.appendChild(this.iframe); - } - - let readyPromiseResolve: (value: void) => void; - const readyPromise = new Promise((resolve, reject) => { - readyPromiseResolve = resolve; - }); - - window.addEventListener("message", (event) => { - if (event.data.origin !== this.origin) return; - - if (event.data.method === "setStorage") { - localStorage.setItem(`${this.id}:${event.data.params.key}`, event.data.params.value); - this.iframe?.contentWindow?.postMessage({ ...event.data, status: "success", result: null }, "*"); - return; - } - - if (event.data.method === "getStorage") { - const value = localStorage.getItem(`${this.id}:${event.data.params.key}`); - this.iframe?.contentWindow?.postMessage({ ...event.data, status: "success", result: value }, "*"); - return; - } - - if (event.data.method === "getStorageKeys") { - const keys = Object.keys(localStorage).filter((key) => key.startsWith(`${this.id}:`)); - this.iframe?.contentWindow?.postMessage({ ...event.data, status: "success", result: keys }, "*"); - return; - } - - if (event.data.method === "removeStorage") { - localStorage.removeItem(`${this.id}:${event.data.params.key}`); - this.iframe?.contentWindow?.postMessage({ ...event.data, status: "success", result: null }, "*"); - return; - } - - if (event.data.method === "redirect") { - window.location.href = event.data.params.url; - this.iframe?.contentWindow?.postMessage({ ...event.data, status: "success", result: null }, "*"); - return; - } - - if (event.data.method === "wallet-ready") { - readyPromiseResolve(); - } - }); - - await readyPromise; - return this.iframe; - } - - get code() { - return ` - - - - - - `; - } - - async call(method: string, params: any): Promise { - if (!this._initializeTask) this._initializeTask = this._initialize(); - const iframe = await this._initializeTask; - - const id = uuid4(); - iframe.contentWindow?.postMessage({ method, params, id, origin: this.origin }, "*"); - - return new Promise((resolve, reject) => { - const handler = (event: MessageEvent) => { - if (event.data.id !== id || event.data.origin !== this.origin) return; - - window.removeEventListener("message", handler); - if (event.data.status === "failed") reject(event.data.result); - else resolve(event.data.result); - }; - - window.addEventListener("message", handler); - }); - } - - async clearStorage() { - const keys = Object.keys(localStorage).filter((key) => key.startsWith(`${this.id}:`)); - for (const key of keys) { - localStorage.removeItem(key); - } - } -} - -export class SandboxWallet implements NearWallet { - private executor: SandboxExecutor; - - constructor(readonly manifest: WalletManifest) { - this.executor = new SandboxExecutor(manifest.id, manifest.executor); - } - - async signIn(params: SignInParams): Promise> { - return this.executor.call("wallet:signIn", params); - } - - async signOut(): Promise { - await this.executor.call("wallet:signOut", {}); - await this.executor.clearStorage(); - } - - async getAccounts(): Promise> { - return this.executor.call("wallet:getAccounts", {}); - } - - async verifyOwner(params: VerifyOwnerParams): Promise { - return this.executor.call("wallet:verifyOwner", params); - } - - async signAndSendTransaction(params: SignAndSendTransactionParams): Promise { - return this.executor.call("wallet:signAndSendTransaction", params); - } - - async signAndSendTransactions(params: SignAndSendTransactionsParams): Promise> { - return this.executor.call("wallet:signAndSendTransactions", params); - } - - async signMessage?(params: SignMessageParams): Promise { - return this.executor.call("wallet:signMessage", params); - } -} diff --git a/tsconfig.json b/tsconfig.json index a2ca400..c2d2d32 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,15 +5,23 @@ "alwaysStrict": true, "allowJs": true, "strict": true, - "rootDir": "./src", "outDir": "./build", "declaration": true, "sourceMap": true, "allowSyntheticDefaultImports": true, + "noUnusedParameters": false, "target": "ESNext", "skipLibCheck": true, "module": "CommonJS", - "lib": ["ESNext", "dom"] + "lib": [ + "ESNext", + "dom" + ], + "jsx": "react-jsx", + "jsxImportSource": "preact", + "resolveJsonModule": true }, - "include": ["./src"] -} + "include": [ + "./src/**/*" + ] +} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..27efd42 --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + build: { + outDir: "cdn", + minify: true, + lib: { + entry: "src/index.ts", + name: "HOTConnect", + formats: ["es", "cjs", "iife"], + fileName: (format) => `hot-connect.${format}.js`, + }, + }, +}); diff --git a/yarn.lock b/yarn.lock index 1544030..cd06914 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,325 +2,179 @@ # yarn lockfile v1 -"@babel/runtime@^7.24.8": - version "7.24.8" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e" - integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA== - dependencies: - regenerator-runtime "^0.14.0" - -"@here-wallet/core@3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@here-wallet/core/-/core-3.4.0.tgz#7930c739bafd001375df2489cd14567cb373c805" - integrity sha512-DMBvKMjePmscqaqsVRYMG574STurCBzS3jh+nJ/0rjrFeP6V5h+ObIDmlFMfzE5E0Dz7NlowOdSfhpJQnPB4wg== - dependencies: - "@near-js/accounts" "^1.2.1" - "@near-js/crypto" "^1.2.4" - "@near-js/types" "^0.2.1" - "@near-js/utils" "^0.2.2" - js-sha256 "^0.11.0" - sha1 "^1.1.1" - uuid4 "2.0.3" - -"@near-js/accounts@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-1.2.1.tgz#6e5c0315a07997bbaacbe7b9021ac23974a80ea0" - integrity sha512-j6+9n/p0vVLAahmN3YRFve+j0ammOALC9ZUfFhdE3kqtJESbSWMviC5qF/s2m0JQjpJGDtEv/dTADosIJoanWw== - dependencies: - "@near-js/crypto" "1.2.4" - "@near-js/providers" "0.2.2" - "@near-js/signers" "0.1.4" - "@near-js/transactions" "1.2.2" - "@near-js/types" "0.2.1" - "@near-js/utils" "0.2.2" - borsh "1.0.0" - depd "2.0.0" - is-my-json-valid "^2.20.6" - lru_map "0.4.1" - near-abi "0.1.1" - -"@near-js/accounts@^1.2.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@near-js/accounts/-/accounts-1.4.1.tgz#729692916862c21a2bcd36cb0c312b46540ac33c" - integrity sha512-ni3QT9H3NdrbVVKyx56yvz93r89Dvpc/vgVtiIK2OdXjkK6jcj+UKMDRQ6F7rd9qJOInLkHZbVBtcR6j1CXLjw== - dependencies: - "@near-js/crypto" "1.4.2" - "@near-js/providers" "1.0.3" - "@near-js/signers" "0.2.2" - "@near-js/transactions" "1.3.3" - "@near-js/types" "0.3.1" - "@near-js/utils" "1.1.0" - "@noble/hashes" "1.7.1" - borsh "1.0.0" - depd "2.0.0" - is-my-json-valid "^2.20.6" - lru_map "0.4.1" - near-abi "0.2.0" - -"@near-js/crypto@1.2.4": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-1.2.4.tgz#fad977d6a6d2c0c836ef42db8c8d355c1f433ec0" - integrity sha512-hcSj0ygvTcXlW9ftwEd9dbvQUWBCHNWNDLou9NLfmZERW9dr0gH8kUJPZUWfpJFlUPicb+jTiMpNwDTvP7VW4A== - dependencies: - "@near-js/types" "0.2.1" - "@near-js/utils" "0.2.2" - "@noble/curves" "1.2.0" - borsh "1.0.0" - randombytes "2.1.0" - -"@near-js/crypto@1.4.2", "@near-js/crypto@^1.2.4": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-1.4.2.tgz#b903b1de954a06d6e34457f78184c43086df1917" - integrity sha512-GRfchsyfWvSAPA1gI9hYhw5FH94Ac1BUo+Cmp5rSJt/V0K3xVzCWgOQxvv4R3kDnWjaXJEuAmpEEnr4Bp3FWrA== - dependencies: - "@near-js/types" "0.3.1" - "@near-js/utils" "1.1.0" +"@esbuild/aix-ppc64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz#80fcbe36130e58b7670511e888b8e88a259ed76c" + integrity sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA== + +"@esbuild/android-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz#8aa4965f8d0a7982dc21734bf6601323a66da752" + integrity sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg== + +"@esbuild/android-arm@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.25.12.tgz#300712101f7f50f1d2627a162e6e09b109b6767a" + integrity sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg== + +"@esbuild/android-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.25.12.tgz#87dfb27161202bdc958ef48bb61b09c758faee16" + integrity sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg== + +"@esbuild/darwin-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz#79197898ec1ff745d21c071e1c7cc3c802f0c1fd" + integrity sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg== + +"@esbuild/darwin-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz#146400a8562133f45c4d2eadcf37ddd09718079e" + integrity sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA== + +"@esbuild/freebsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz#1c5f9ba7206e158fd2b24c59fa2d2c8bb47ca0fe" + integrity sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg== + +"@esbuild/freebsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz#ea631f4a36beaac4b9279fa0fcc6ca29eaeeb2b3" + integrity sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ== + +"@esbuild/linux-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz#e1066bce58394f1b1141deec8557a5f0a22f5977" + integrity sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ== + +"@esbuild/linux-arm@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz#452cd66b20932d08bdc53a8b61c0e30baf4348b9" + integrity sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw== + +"@esbuild/linux-ia32@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz#b24f8acc45bcf54192c7f2f3be1b53e6551eafe0" + integrity sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA== + +"@esbuild/linux-loong64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz#f9cfffa7fc8322571fbc4c8b3268caf15bd81ad0" + integrity sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng== + +"@esbuild/linux-mips64el@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz#575a14bd74644ffab891adc7d7e60d275296f2cd" + integrity sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw== + +"@esbuild/linux-ppc64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz#75b99c70a95fbd5f7739d7692befe60601591869" + integrity sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA== + +"@esbuild/linux-riscv64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz#2e3259440321a44e79ddf7535c325057da875cd6" + integrity sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w== + +"@esbuild/linux-s390x@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz#17676cabbfe5928da5b2a0d6df5d58cd08db2663" + integrity sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg== + +"@esbuild/linux-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz#0583775685ca82066d04c3507f09524d3cd7a306" + integrity sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw== + +"@esbuild/netbsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz#f04c4049cb2e252fe96b16fed90f70746b13f4a4" + integrity sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg== + +"@esbuild/netbsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz#77da0d0a0d826d7c921eea3d40292548b258a076" + integrity sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ== + +"@esbuild/openbsd-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz#6296f5867aedef28a81b22ab2009c786a952dccd" + integrity sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A== + +"@esbuild/openbsd-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz#f8d23303360e27b16cf065b23bbff43c14142679" + integrity sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw== + +"@esbuild/openharmony-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz#49e0b768744a3924be0d7fd97dd6ce9b2923d88d" + integrity sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg== + +"@esbuild/sunos-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz#a6ed7d6778d67e528c81fb165b23f4911b9b13d6" + integrity sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w== + +"@esbuild/win32-arm64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz#9ac14c378e1b653af17d08e7d3ce34caef587323" + integrity sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg== + +"@esbuild/win32-ia32@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz#918942dcbbb35cc14fca39afb91b5e6a3d127267" + integrity sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ== + +"@esbuild/win32-x64@0.25.12": + version "0.25.12" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz#9bdad8176be7811ad148d1f8772359041f46c6c5" + integrity sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA== + +"@jridgewell/sourcemap-codec@^1.5.5": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + +"@near-js/crypto@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-2.5.1.tgz#fdd182578e7bd486fd712b10be601412289f6246" + integrity sha512-Kb+bbnUrfvuzzed9hpLRpcIlCMOaQlw/7BxlZPCq8DggVaK1m0nKR1DHQs2cV0Q0WSKSk2UrFJho1dxeKL5alg== + dependencies: + "@near-js/types" "2.5.1" + "@near-js/utils" "2.5.1" "@noble/curves" "1.8.1" + "@noble/hashes" "^1.7.1" borsh "1.0.0" - randombytes "2.1.0" secp256k1 "5.0.1" -"@near-js/crypto@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@near-js/crypto/-/crypto-1.4.0.tgz#52717d7aa0baf5429b0d5a1971a3c9a6e0aeedd9" - integrity sha512-2SYS7LyFz2/y8idqAyyS4jf3pn6zFg4tLbOq9OlB+MTZhvsnUcWW+HLznyBytp6dW8lAQ03E+Ew0bYfJSCIJJw== - dependencies: - "@near-js/types" "0.3.0" - "@near-js/utils" "1.0.0" - "@noble/curves" "1.2.0" - borsh "1.0.0" - randombytes "2.1.0" - secp256k1 "5.0.0" - -"@near-js/keystores-browser@0.0.12": - version "0.0.12" - resolved "https://registry.yarnpkg.com/@near-js/keystores-browser/-/keystores-browser-0.0.12.tgz#2a9794a27d1e55ccb549125b29e183eb967fe52c" - integrity sha512-ptoVfJhMsktYcvY02wD2a8kDDH/E4d+kBfhwKF0H/Qt/w4JVJqEVgCLDBYUespuISTSqLSznNBjTSse+E7pJDQ== - dependencies: - "@near-js/crypto" "1.2.4" - "@near-js/keystores" "0.0.12" - -"@near-js/keystores-node@0.0.12": - version "0.0.12" - resolved "https://registry.yarnpkg.com/@near-js/keystores-node/-/keystores-node-0.0.12.tgz#81efaa707faf0cdfc91075920a66be008fbfed8a" - integrity sha512-LUz1HPXBYoZUaLyS/bEj4yZ4pqD9Hb7XURikh22VYL8mbLcR5VmWYwS7Tmi9aO1vW8M9bPnQs5SROAyA79qQgQ== - dependencies: - "@near-js/crypto" "1.2.4" - "@near-js/keystores" "0.0.12" - -"@near-js/keystores@0.0.12": - version "0.0.12" - resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.0.12.tgz#747101d9df8fe55870edd317ab3300a5bd33119d" - integrity sha512-7dqq7XLUSlo26QbaGrS6bmqVL4IfhxJgfIhgKUDfv8FuswrpErBVCAUY6wIbW+mLw0NBoddzPrb5LuLIMfud5Q== - dependencies: - "@near-js/crypto" "1.2.4" - "@near-js/types" "0.2.1" - -"@near-js/keystores@0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@near-js/keystores/-/keystores-0.2.2.tgz#c1ec215c39e8d279f226333364bc424b57842527" - integrity sha512-DLhi/3a4qJUY+wgphw2Jl4S+L0AKsUYm1mtU0WxKYV5OBwjOXvbGrXNfdkheYkfh3nHwrQgtjvtszX6LrRXLLw== - dependencies: - "@near-js/crypto" "1.4.2" - "@near-js/types" "0.3.1" - -"@near-js/providers@0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-0.2.2.tgz#672f914e97b2de94905e46efe724470ae9ea31a2" - integrity sha512-1V3NhqxfkBvdvq8zhKqbKxsySpIr6PpmlDzkHjDr8uSu6MMvqBgy+1dBvWflEFlN7OlDGx35mVsq/4Xy0wu+KA== - dependencies: - "@near-js/transactions" "1.2.2" - "@near-js/types" "0.2.1" - "@near-js/utils" "0.2.2" - borsh "1.0.0" - http-errors "1.7.2" - optionalDependencies: - node-fetch "2.6.7" - -"@near-js/providers@1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@near-js/providers/-/providers-1.0.3.tgz#918c5ffb8f9bb92f0d28198e9396a08c61b3754a" - integrity sha512-VJMboL14R/+MGKnlhhE3UPXCGYvMd1PpvF9OqZ9yBbulV7QVSIdTMfY4U1NnDfmUC2S3/rhAEr+3rMrIcNS7Fg== +"@near-js/transactions@^2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-2.5.1.tgz#2a9be7c714ffd06f7425c555e4c015089bf92108" + integrity sha512-0svK5K6VqOciSIn9mxreyS0uQf8T1UZc71JBA6yrstpHJhltz/dvNUMY0FV+xHx3H/KAdvCMjX0VLEpyi08yWQ== dependencies: - "@near-js/transactions" "1.3.3" - "@near-js/types" "0.3.1" - "@near-js/utils" "1.1.0" - borsh "1.0.0" - exponential-backoff "^3.1.2" - optionalDependencies: - node-fetch "2.6.7" - -"@near-js/signers@0.1.4": - version "0.1.4" - resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.1.4.tgz#76b8d29fd9577171f546323cc95502bcf80d00ec" - integrity sha512-YgH5X5fDOT/GsEAcyNM3heQWjIIL1MW3P8NtqilMa69HnsvtES9RCwjAXP8d8DZq/dBlI9od+pQ5XhxSFuXKCg== - dependencies: - "@near-js/crypto" "1.2.4" - "@near-js/keystores" "0.0.12" - "@noble/hashes" "1.3.3" - -"@near-js/signers@0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@near-js/signers/-/signers-0.2.2.tgz#ae521e1ea72c9b49ad1dfc63f2d90d847207fea7" - integrity sha512-M6ib+af9zXAPRCjH2RyIS0+RhCmd9gxzCeIkQ+I2A3zjgGiEDkBZbYso9aKj8Zh2lPKKSH7h+u8JGymMOSwgyw== - dependencies: - "@near-js/crypto" "1.4.2" - "@near-js/keystores" "0.2.2" - "@noble/hashes" "1.3.3" - -"@near-js/transactions@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-1.2.2.tgz#7302f8dd7dc3ea87cd2ebafa0b86bed12232a034" - integrity sha512-WZ/Mk0hFvBIYcD6VBwYw4S2mmiKBKz6PT0YEwNzMzbgPZSs2wRVk4r9Tf+ueCJCPUXo5XINkjThCcRqMHQvPtg== - dependencies: - "@near-js/crypto" "1.2.4" - "@near-js/signers" "0.1.4" - "@near-js/types" "0.2.1" - "@near-js/utils" "0.2.2" - "@noble/hashes" "1.3.3" - borsh "1.0.0" - -"@near-js/transactions@1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@near-js/transactions/-/transactions-1.3.3.tgz#3b0c03861fc4b29322cedb03875cf80f52871dd2" - integrity sha512-1AXD+HuxlxYQmRTLQlkVmH+RAmV3HwkAT8dyZDu+I2fK/Ec9BQHXakOJUnOBws3ihF+akQhamIBS5T0EXX/Ylw== - dependencies: - "@near-js/crypto" "1.4.2" - "@near-js/signers" "0.2.2" - "@near-js/types" "0.3.1" - "@near-js/utils" "1.1.0" + "@near-js/crypto" "2.5.1" + "@near-js/types" "2.5.1" + "@near-js/utils" "2.5.1" "@noble/hashes" "1.7.1" borsh "1.0.0" -"@near-js/types@0.2.1", "@near-js/types@^0.2.1": - version "0.2.1" - resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.2.1.tgz#a298f0e70dbe059ee8c762dfac05c2eae3e0ae0e" - integrity sha512-YygQEGMdFe6d2e/6dtNZer9paH396XeAdIKEhY/RPXDUnjDdfiDQ5DK4mM130sEeID2bAH9X1LQ+7vXGRjvyWw== - -"@near-js/types@0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.3.0.tgz#aa5fa1097c338166c5401bfb16de26385c3ddc74" - integrity sha512-IwayA5Wa4+hryo22AuAYIu5a/nOAheF/Bmz9kpuouX9L4he+Tc8xAt5NfE60zXG7tsukAw1QAaHE1kBzhmwtKw== - -"@near-js/types@0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@near-js/types/-/types-0.3.1.tgz#35f2649f85881d72fc231a16142e1f0e3b0e8377" - integrity sha512-8qIA7ynAEAuVFNAQc0cqz2xRbfyJH3PaAG5J2MgPPhD18lu/tCGd6pzYg45hjhtiJJRFDRjh/FUWKS+ZiIIxUw== +"@near-js/types@2.5.1", "@near-js/types@^2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@near-js/types/-/types-2.5.1.tgz#2fbae08edd9296255f08e2693d3ef4142dbc33a7" + integrity sha512-lUJJmbV6qcilIwswldeP7FIjkjTWvmtgI+yQHVmiBNRVjYvPMiQ/e9vs3SXE/cYtRluAdq0JHJwYoqhFb69mwA== -"@near-js/utils@0.2.2", "@near-js/utils@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-0.2.2.tgz#a42c29db9ccd5a02ad583319028fdb7231821ab2" - integrity sha512-ZAJo/cN6AHY7/gckf8DLHwjAn0z4UwG6rhLxs+QDyNYMMSx9SBg2pOQtBBv7ORWJaPhWD2q7wFhUz4SdTZi43A== +"@near-js/utils@2.5.1": + version "2.5.1" + resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-2.5.1.tgz#4fa7f6d3e13a5d33f86f5628fee7b2c1760b56b3" + integrity sha512-bXsw7Qkm689tV0sg6nwplAFoL6PrQ5tY72YIoiZezZ8ZGBea+2+ILmUIHWKLum7b7qJHKq1iH7uycE+m+Z4QHA== dependencies: - "@near-js/types" "0.2.1" - bs58 "4.0.0" + "@near-js/types" "2.5.1" + "@scure/base" "^1.2.4" depd "2.0.0" mustache "4.0.0" -"@near-js/utils@1.0.0", "@near-js/utils@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-1.0.0.tgz#10d94a2b4c307ee7e44775a723a0005eb293735a" - integrity sha512-4dd6fDgWZnG+0VSKPBA3czEQdi9UotepdwcEKLTbXepIL1FX2ZlQV6HVi7KYmrAVwv1ims11vGnWzJWKy46ULw== - dependencies: - "@near-js/types" "0.3.0" - bs58 "4.0.0" - depd "2.0.0" - mustache "4.0.0" - -"@near-js/utils@1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@near-js/utils/-/utils-1.1.0.tgz#fcdd0b7d9badb11d61f399755bead804b2a47d47" - integrity sha512-5XWRq7xpu8Wud9pRXe2U347KXyi0mXofedUY2DQ9TaqiZUcMIaN9xj7DbCs2v6dws3pJyYrT1KWxeNp5fSaY3w== - dependencies: - "@near-js/types" "0.3.1" - "@scure/base" "^1.2.0" - depd "2.0.0" - mustache "4.0.0" - -"@near-js/wallet-account@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@near-js/wallet-account/-/wallet-account-1.2.2.tgz#c04e3e515bd3ca93bafbb761c9770d2fdc078837" - integrity sha512-LaWzqaz2tP1hcToDlmiQnFMGZ1W9dM9i4nFSILe5PLIFLBQmYXdLWc80skGDiTUeihVu6wwtQr6Z2CcG231rWw== - dependencies: - "@near-js/accounts" "1.2.1" - "@near-js/crypto" "1.2.4" - "@near-js/keystores" "0.0.12" - "@near-js/providers" "0.2.2" - "@near-js/signers" "0.1.4" - "@near-js/transactions" "1.2.2" - "@near-js/types" "0.2.1" - "@near-js/utils" "0.2.2" - borsh "1.0.0" - -"@near-wallet-selector/bitget-wallet@^8.10.1": - version "8.10.1" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/bitget-wallet/-/bitget-wallet-8.10.1.tgz#4e104824385b10fe0083a8ade190d717cd2c4690" - integrity sha512-c60cXoOagwPDCZoBGJKuujfd3+eNeShIpwyyhR+d/FdN8aNm9tHILIt4F5E8JgBcuYJW6MTj7UxzBIYxeojxGw== - dependencies: - "@near-wallet-selector/core" "8.10.1" - is-mobile "4.0.0" - near-api-js "4.0.3" - -"@near-wallet-selector/core@8.10.1": - version "8.10.1" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.10.1.tgz#fc0e5414117796c5e2e72d036b19290eaf290b1c" - integrity sha512-FHZNLIPF3Qvj2M8cwyeHFH0Gwq58q7ibw02r+TkekyzZgXESvd/kU/OcF11T4r3WG1OrHPiZay7XXeAwDc9Txw== - dependencies: - borsh "1.0.0" - events "3.3.0" - js-sha256 "0.9.0" - rxjs "7.8.1" - -"@near-wallet-selector/core@^8.9.13": - version "8.9.13" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/core/-/core-8.9.13.tgz#d7190d7914e6c2cceac5af107d1f7366266f923a" - integrity sha512-ufI2yctF2N7+D6s5QaSs9Bqorh8xPH48wuBEvTbArJ6z9qvSCNsK9ZO5Mt5BFfO64ovmcflOOUBtZ4/BcNO6aQ== - dependencies: - borsh "0.7.0" - events "3.3.0" - js-sha256 "0.9.0" - rxjs "7.8.1" - -"@near-wallet-selector/here-wallet@^8.10.1": - version "8.10.1" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/here-wallet/-/here-wallet-8.10.1.tgz#8d603c091e8b263c5e1eb501edb33f28502f580c" - integrity sha512-iEgF50daRcumog/OGTiSrOxOmrlATnIqz4oRMBRyZDI3XQVvY+aFQAsmTQgatMygvNGmloCc8D+ZVyQ4WRb0Dg== - dependencies: - "@here-wallet/core" "3.4.0" - "@near-wallet-selector/core" "8.10.1" - -"@near-wallet-selector/my-near-wallet@^8.10.1": - version "8.10.1" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/my-near-wallet/-/my-near-wallet-8.10.1.tgz#a3249caa70c8d1dab5bc6d7c1f7c2e7123b63e6b" - integrity sha512-f0iWqeZnVl7XPEBpRrgLiKNF84yIUvCk8cvLAY/n87sRqbnOYDE8gemqU8uwwNc9wuog2ZgyX4TYA/VrvUqPlQ== - dependencies: - "@near-wallet-selector/core" "8.10.1" - "@near-wallet-selector/wallet-utils" "8.10.1" - near-api-js "4.0.3" - -"@near-wallet-selector/sender@^8.10.1": - version "8.10.1" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/sender/-/sender-8.10.1.tgz#ea247027998cbac325166ba757f1ad522b27168c" - integrity sha512-ziC39tJuMv2lNwLLwFzkY9oMnA3GAG1O+ameWFIyldjQmV+aW87DvnwKS9GZAn9Arqgeb5DfSFk+uIwQwsv6Ow== - dependencies: - "@near-wallet-selector/core" "8.10.1" - is-mobile "4.0.0" - near-api-js "4.0.3" - -"@near-wallet-selector/wallet-utils@8.10.1": - version "8.10.1" - resolved "https://registry.yarnpkg.com/@near-wallet-selector/wallet-utils/-/wallet-utils-8.10.1.tgz#e19bb7fc47e600564356a2ac338bf5bd82e40d41" - integrity sha512-1NxFCGo7bo+CiKOOS4yjSAwAfnjhYYXo3i1UCuu4MhHrQS+EvwMCxCadUKSNGXn1IC1TpKmWMVaENkv7gWKlZQ== - dependencies: - "@near-wallet-selector/core" "8.10.1" - -"@noble/curves@1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" - integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== - dependencies: - "@noble/hashes" "1.3.2" - "@noble/curves@1.8.1": version "1.8.1" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.8.1.tgz#19bc3970e205c99e4bdb1c64a4785706bce497ff" @@ -328,313 +182,467 @@ dependencies: "@noble/hashes" "1.7.1" -"@noble/curves@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.2.tgz#40309198c76ed71bc6dbf7ba24e81ceb4d0d1fe9" - integrity sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw== - dependencies: - "@noble/hashes" "1.4.0" - -"@noble/hashes@1.3.2": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" - integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== - -"@noble/hashes@1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" - integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== - -"@noble/hashes@1.4.0", "@noble/hashes@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" - integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== - "@noble/hashes@1.7.1": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.7.1.tgz#5738f6d765710921e7a751e00c20ae091ed8db0f" integrity sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ== -"@scure/base@^1.2.0": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.4.tgz#002eb571a35d69bdb4c214d0995dff76a8dcd2a9" - integrity sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ== +"@noble/hashes@^1.7.1": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.8.0.tgz#cee43d801fcef9644b11b8194857695acd5f815a" + integrity sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A== + +"@rollup/plugin-inject@^5.0.5": + version "5.0.5" + resolved "https://registry.yarnpkg.com/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz#616f3a73fe075765f91c5bec90176608bed277a3" + integrity sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg== + dependencies: + "@rollup/pluginutils" "^5.0.1" + estree-walker "^2.0.2" + magic-string "^0.30.3" + +"@rollup/pluginutils@^5.0.1": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.3.0.tgz#57ba1b0cbda8e7a3c597a4853c807b156e21a7b4" + integrity sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^4.0.2" + +"@rollup/rollup-android-arm-eabi@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.53.2.tgz#7131f3d364805067fd5596302aad9ebef1434b32" + integrity sha512-yDPzwsgiFO26RJA4nZo8I+xqzh7sJTZIWQOxn+/XOdPE31lAvLIYCKqjV+lNH/vxE2L2iH3plKxDCRK6i+CwhA== + +"@rollup/rollup-android-arm64@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.53.2.tgz#7ede14d7fcf7c57821a2731c04b29ccc03145d82" + integrity sha512-k8FontTxIE7b0/OGKeSN5B6j25EuppBcWM33Z19JoVT7UTXFSo3D9CdU39wGTeb29NO3XxpMNauh09B+Ibw+9g== + +"@rollup/rollup-darwin-arm64@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.53.2.tgz#d59bf9ed582b38838e86a17f91720c17db6575b9" + integrity sha512-A6s4gJpomNBtJ2yioj8bflM2oogDwzUiMl2yNJ2v9E7++sHrSrsQ29fOfn5DM/iCzpWcebNYEdXpaK4tr2RhfQ== + +"@rollup/rollup-darwin-x64@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.53.2.tgz#a76278d9b9da9f84ea7909a14d93b915d5bbe01e" + integrity sha512-e6XqVmXlHrBlG56obu9gDRPW3O3hLxpwHpLsBJvuI8qqnsrtSZ9ERoWUXtPOkY8c78WghyPHZdmPhHLWNdAGEw== + +"@rollup/rollup-freebsd-arm64@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.53.2.tgz#1a94821a1f565b9eaa74187632d482e4c59a1707" + integrity sha512-v0E9lJW8VsrwPux5Qe5CwmH/CF/2mQs6xU1MF3nmUxmZUCHazCjLgYvToOk+YuuUqLQBio1qkkREhxhc656ViA== + +"@rollup/rollup-freebsd-x64@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.53.2.tgz#aad2274680106b2b6549b1e35e5d3a7a9f1f16af" + integrity sha512-ClAmAPx3ZCHtp6ysl4XEhWU69GUB1D+s7G9YjHGhIGCSrsg00nEGRRZHmINYxkdoJehde8VIsDC5t9C0gb6yqA== + +"@rollup/rollup-linux-arm-gnueabihf@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.53.2.tgz#100fe4306399ffeec47318a3c9b8c0e5e8b07ddb" + integrity sha512-EPlb95nUsz6Dd9Qy13fI5kUPXNSljaG9FiJ4YUGU1O/Q77i5DYFW5KR8g1OzTcdZUqQQ1KdDqsTohdFVwCwjqg== + +"@rollup/rollup-linux-arm-musleabihf@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.53.2.tgz#b84634952604b950e18fa11fddebde898c5928d8" + integrity sha512-BOmnVW+khAUX+YZvNfa0tGTEMVVEerOxN0pDk2E6N6DsEIa2Ctj48FOMfNDdrwinocKaC7YXUZ1pHlKpnkja/Q== + +"@rollup/rollup-linux-arm64-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.53.2.tgz#dad6f2fb41c2485f29a98e40e9bd78253255dbf3" + integrity sha512-Xt2byDZ+6OVNuREgBXr4+CZDJtrVso5woFtpKdGPhpTPHcNG7D8YXeQzpNbFRxzTVqJf7kvPMCub/pcGUWgBjA== + +"@rollup/rollup-linux-arm64-musl@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.53.2.tgz#0f3f77c8ce9fbf982f8a8378b70a73dc6704a706" + integrity sha512-+LdZSldy/I9N8+klim/Y1HsKbJ3BbInHav5qE9Iy77dtHC/pibw1SR/fXlWyAk0ThnpRKoODwnAuSjqxFRDHUQ== + +"@rollup/rollup-linux-loong64-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.53.2.tgz#870bb94e9dad28bb3124ba49bd733deaa6aa2635" + integrity sha512-8ms8sjmyc1jWJS6WdNSA23rEfdjWB30LH8Wqj0Cqvv7qSHnvw6kgMMXRdop6hkmGPlyYBdRPkjJnj3KCUHV/uQ== + +"@rollup/rollup-linux-ppc64-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.53.2.tgz#188427d11abefc6c9926e3870b3e032170f5577c" + integrity sha512-3HRQLUQbpBDMmzoxPJYd3W6vrVHOo2cVW8RUo87Xz0JPJcBLBr5kZ1pGcQAhdZgX9VV7NbGNipah1omKKe23/g== + +"@rollup/rollup-linux-riscv64-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.53.2.tgz#9dec6eadbbb5abd3b76fe624dc4f006913ff4a7f" + integrity sha512-fMjKi+ojnmIvhk34gZP94vjogXNNUKMEYs+EDaB/5TG/wUkoeua7p7VCHnE6T2Tx+iaghAqQX8teQzcvrYpaQA== + +"@rollup/rollup-linux-riscv64-musl@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.53.2.tgz#b26ba1c80b6f104dc5bd83ed83181fc0411a0c38" + integrity sha512-XuGFGU+VwUUV5kLvoAdi0Wz5Xbh2SrjIxCtZj6Wq8MDp4bflb/+ThZsVxokM7n0pcbkEr2h5/pzqzDYI7cCgLQ== + +"@rollup/rollup-linux-s390x-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.53.2.tgz#dc83647189b68ad8d56a956a6fcaa4ee9c728190" + integrity sha512-w6yjZF0P+NGzWR3AXWX9zc0DNEGdtvykB03uhonSHMRa+oWA6novflo2WaJr6JZakG2ucsyb+rvhrKac6NIy+w== + +"@rollup/rollup-linux-x64-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.53.2.tgz#42c3b8c94e9de37bd103cb2e26fb715118ef6459" + integrity sha512-yo8d6tdfdeBArzC7T/PnHd7OypfI9cbuZzPnzLJIyKYFhAQ8SvlkKtKBMbXDxe1h03Rcr7u++nFS7tqXz87Gtw== + +"@rollup/rollup-linux-x64-musl@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.53.2.tgz#d0e216ee1ea16bfafe35681b899b6a05258988e5" + integrity sha512-ah59c1YkCxKExPP8O9PwOvs+XRLKwh/mV+3YdKqQ5AMQ0r4M4ZDuOrpWkUaqO7fzAHdINzV9tEVu8vNw48z0lA== + +"@rollup/rollup-openharmony-arm64@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.53.2.tgz#3acd0157cb8976f659442bfd8a99aca46f8a2931" + integrity sha512-4VEd19Wmhr+Zy7hbUsFZ6YXEiP48hE//KPLCSVNY5RMGX2/7HZ+QkN55a3atM1C/BZCGIgqN+xrVgtdak2S9+A== + +"@rollup/rollup-win32-arm64-msvc@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.53.2.tgz#3eb9e7d4d0e1d2e0850c4ee9aa2d0ddf89a8effa" + integrity sha512-IlbHFYc/pQCgew/d5fslcy1KEaYVCJ44G8pajugd8VoOEI8ODhtb/j8XMhLpwHCMB3yk2J07ctup10gpw2nyMA== + +"@rollup/rollup-win32-ia32-msvc@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.53.2.tgz#d69280bc6680fe19e0956e965811946d542f6365" + integrity sha512-lNlPEGgdUfSzdCWU176ku/dQRnA7W+Gp8d+cWv73jYrb8uT7HTVVxq62DUYxjbaByuf1Yk0RIIAbDzp+CnOTFg== + +"@rollup/rollup-win32-x64-gnu@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.53.2.tgz#d182ce91e342bad9cbb8b284cf33ac542b126ead" + integrity sha512-S6YojNVrHybQis2lYov1sd+uj7K0Q05NxHcGktuMMdIQ2VixGwAfbJ23NnlvvVV1bdpR2m5MsNBViHJKcA4ADw== + +"@rollup/rollup-win32-x64-msvc@4.53.2": + version "4.53.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.53.2.tgz#d9ab606437fd072b2cb7df7e54bcdc7f1ccbe8b4" + integrity sha512-k+/Rkcyx//P6fetPoLMb8pBeqJBNGx81uuf7iljX9++yNBVRDQgD04L+SVXmXmh5ZP4/WOp4mWF0kmi06PW2tA== + +"@scure/base@^1.2.4": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.2.6.tgz#ca917184b8231394dd8847509c67a0be522e59f6" + integrity sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg== + +"@tanstack/intent@^0.0.40": + version "0.0.40" + resolved "https://registry.yarnpkg.com/@tanstack/intent/-/intent-0.0.40.tgz#324529b325b5cc21dfe3ca9fdf8011320242cd55" + integrity sha512-ZuUTzr4QrjNuWdv+DfTv0///uONz5+Sw3mR+2xOXHpob6vWsUXnSk3Ht7X9Rpu6zZdQYZlZnJCwN50CAZ21GCw== + dependencies: + cac "^6.7.14" + jsonc-parser "^3.3.1" + semver "^7.7.4" + yaml "2.8.3" + +"@types/estree@1.0.8", "@types/estree@^1.0.0": + version "1.0.8" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" + integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + +asn1.js@^4.10.1: + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" -"@solana/buffer-layout@^4.0.1": - version "4.0.1" - resolved "https://registry.yarnpkg.com/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz#b996235eaec15b1e0b5092a8ed6028df77fa6c15" - integrity sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA== +assert@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-2.1.0.tgz#6d92a238d05dc02e7427c881fb8be81c8448b2dd" + integrity sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw== dependencies: - buffer "~6.0.3" + call-bind "^1.0.2" + is-nan "^1.3.2" + object-is "^1.1.5" + object.assign "^4.1.4" + util "^0.12.5" -"@solana/wallet-adapter-base@^0.9.23": - version "0.9.23" - resolved "https://registry.yarnpkg.com/@solana/wallet-adapter-base/-/wallet-adapter-base-0.9.23.tgz#3b17c28afd44e173f44f658bf9700fd637e12a11" - integrity sha512-apqMuYwFp1jFi55NxDfvXUX2x1T0Zh07MxhZ/nCCTGys5raSfYUh82zen2BLv8BSDj/JxZ2P/s7jrQZGrX8uAw== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== dependencies: - "@solana/wallet-standard-features" "^1.1.0" - "@wallet-standard/base" "^1.0.1" - "@wallet-standard/features" "^1.0.3" - eventemitter3 "^4.0.7" + possible-typed-array-names "^1.0.0" -"@solana/wallet-standard-features@^1.1.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@solana/wallet-standard-features/-/wallet-standard-features-1.2.0.tgz#be8b3824abf5ebcfeaa7298445bf53f76a27c935" - integrity sha512-tUd9srDLkRpe1BYg7we+c4UhRQkq+XQWswsr/L1xfGmoRDF47BPSXf4zE7ZU2GRBGvxtGt7lwJVAufQyQYhxTQ== - dependencies: - "@wallet-standard/base" "^1.0.1" - "@wallet-standard/features" "^1.0.3" - -"@solana/web3.js@^1.95.0": - version "1.95.1" - resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.95.1.tgz#fcbbaf845309ff7ceb8d3726702799e8c27530e8" - integrity sha512-mRX/AjV6QbiOXpWcy5Rz1ZWEH2lVkwO7T0pcv9t97ACpv3/i3tPiqXwk0JIZgSR3wOSTiT26JfygnJH2ulS6dQ== - dependencies: - "@babel/runtime" "^7.24.8" - "@noble/curves" "^1.4.2" - "@noble/hashes" "^1.4.0" - "@solana/buffer-layout" "^4.0.1" - agentkeepalive "^4.5.0" - bigint-buffer "^1.1.5" - bn.js "^5.2.1" - borsh "^0.7.0" - bs58 "^4.0.1" - buffer "6.0.3" - fast-stable-stringify "^1.0.0" - jayson "^4.1.1" - node-fetch "^2.7.0" - rpc-websockets "^9.0.2" - superstruct "^2.0.2" - -"@swc/helpers@^0.5.11": - version "0.5.12" - resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.12.tgz#37aaca95284019eb5d2207101249435659709f4b" - integrity sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g== - dependencies: - tslib "^2.4.0" - -"@types/connect@^3.4.33": - version "3.4.38" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.38.tgz#5ba7f3bc4fbbdeaff8dded952e5ff2cc53f8d858" - integrity sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug== - dependencies: - "@types/node" "*" - -"@types/json-schema@^7.0.11": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - -"@types/node@*": - version "20.14.12" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.12.tgz#129d7c3a822cb49fc7ff661235f19cfefd422b49" - integrity sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ== - dependencies: - undici-types "~5.26.4" - -"@types/node@^12.12.54": - version "12.20.55" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240" - integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ== - -"@types/sha1@^1.1.5": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@types/sha1/-/sha1-1.1.5.tgz#e9f78a187e5035c608b32567980443e16fcee2c6" - integrity sha512-eE1PzjW7u2VfxI+bTsvjzjBfpwqvxSpgfUmnRNVY+PJU1NBsdGZlaO/qnVnPKHzzpgIl9YyBIxvrgBvt1mzt2A== - dependencies: - "@types/node" "*" - -"@types/uuid4@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/uuid4/-/uuid4-2.0.3.tgz#0dd3e35f4ee1d379d3f29c09f5d94fa405ad36b4" - integrity sha512-/fyn8jzKzeL/wci7GOaz8TPjKapD+WJUBUCr/ED2xcUcx5fA9rZH2fDZiV2Z/a+040mp5Zi3dgIi/Vey/uQBxw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -"@types/uuid@^8.3.4": - version "8.3.4" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" - integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: + version "4.12.2" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.2.tgz#3d8fed6796c24e177737f7cc5172ee04ef39ec99" + integrity sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw== -"@types/ws@^7.4.4": - version "7.4.7" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" - integrity sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww== - dependencies: - "@types/node" "*" +bn.js@^5.2.1, bn.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.2.tgz#82c09f9ebbb17107cd72cb7fd39bd1f9d0aaa566" + integrity sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw== -"@types/ws@^8.2.2": - version "8.5.11" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.11.tgz#90ad17b3df7719ce3e6bc32f83ff954d38656508" - integrity sha512-4+q7P5h3SpJxaBft0Dzpbr6lmMaqh0Jr2tbhJZ/luAwvD7ohSCniYkwz/pLxuT2h0EOa6QADgJj1Ko+TzRfZ+w== - dependencies: - "@types/node" "*" +borsh@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/borsh/-/borsh-1.0.0.tgz#b564c8cc8f7a91e3772b9aef9e07f62b84213c1f" + integrity sha512-fSVWzzemnyfF89EPwlUNsrS5swF5CrtiN4e+h0/lLf4dz2he4L3ndM20PS9wj7ICSkXJe/TQUHdaPTq15b1mNQ== -"@wallet-standard/base@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@wallet-standard/base/-/base-1.0.1.tgz#860dd94d47c9e3c5c43b79d91c6afdbd7a36264e" - integrity sha512-1To3ekMfzhYxe0Yhkpri+Fedq0SYcfrOfJi3vbLjMwF2qiKPjTGLwZkf2C9ftdQmxES+hmxhBzTwF4KgcOwf8w== +brorand@^1.0.1, brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -"@wallet-standard/features@^1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@wallet-standard/features/-/features-1.0.3.tgz#c992876c5e4f7a0672f8869c4146c87e0dfe48c8" - integrity sha512-m8475I6W5LTatTZuUz5JJNK42wFRgkJTB0I9tkruMwfqBF2UN2eomkYNVf9RbrsROelCRzSFmugqjKZBFaubsA== +browser-resolve@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-2.0.0.tgz#99b7304cb392f8d73dba741bb2d7da28c6d7842b" + integrity sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ== dependencies: - "@wallet-standard/base" "^1.0.1" + resolve "^1.17.0" -JSONStream@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== +browserify-aes@^1.0.4, browserify-aes@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== + dependencies: + buffer-xor "^1.0.3" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.3" + inherits "^2.0.1" + safe-buffer "^5.0.1" + +browserify-cipher@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" -agentkeepalive@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.5.0.tgz#2673ad1389b3c418c5a20c5d7364f93ca04be923" - integrity sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew== +browserify-des@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== dependencies: - humanize-ms "^1.2.1" + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" -base-x@^2.0.1: - version "2.0.6" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-2.0.6.tgz#4582a91ebcec99ee06f4e4032030b0cf1c2941d8" - integrity sha512-UAmjxz9KbK+YIi66xej+pZVo/vxUOh49ubEvZW5egCbxhur05pBb+hwuireQwKO4nDpsNm64/jEei17LEpsr5g== +browserify-rsa@^4.0.0, browserify-rsa@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.1.1.tgz#06e530907fe2949dc21fc3c2e2302e10b1437238" + integrity sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ== dependencies: - safe-buffer "^5.0.1" + bn.js "^5.2.1" + randombytes "^2.1.0" + safe-buffer "^5.2.1" + +browserify-sign@^4.2.3: + version "4.2.5" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.2.5.tgz#3979269fa8af55ba18aac35deef11b45515cd27d" + integrity sha512-C2AUdAJg6rlM2W5QMp2Q4KGQMVBwR1lIimTsUnutJ8bMpW5B52pGpR2gEnNBNwijumDo5FojQ0L9JrXA8m4YEw== + dependencies: + bn.js "^5.2.2" + browserify-rsa "^4.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + elliptic "^6.6.1" + inherits "^2.0.4" + parse-asn1 "^5.1.9" + readable-stream "^2.3.8" + safe-buffer "^5.2.1" -base-x@^3.0.2: - version "3.0.10" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.10.tgz#62de58653f8762b5d6f8d9fe30fa75f7b2585a75" - integrity sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ== +browserify-zlib@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== dependencies: - safe-buffer "^5.0.1" + pako "~1.0.5" -base64-js@^1.3.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" - integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== +buffer-xor@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== -bigint-buffer@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/bigint-buffer/-/bigint-buffer-1.1.5.tgz#d038f31c8e4534c1f8d0015209bf34b4fa6dd442" - integrity sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA== +buffer@^5.7.1: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== dependencies: - bindings "^1.3.0" + base64-js "^1.3.1" + ieee754 "^1.1.13" -bindings@^1.3.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" +builtin-status-codes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ== -bn.js@^4.11.9: - version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" - integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== +cac@^6.7.14: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== -bn.js@^5.2.0, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" -borsh@0.7.0, borsh@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/borsh/-/borsh-0.7.0.tgz#6e9560d719d86d90dc589bca60ffc8a6c51fec2a" - integrity sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA== +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.7, call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== dependencies: - bn.js "^5.2.0" - bs58 "^4.0.0" - text-encoding-utf-8 "^1.0.2" + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" -borsh@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/borsh/-/borsh-1.0.0.tgz#b564c8cc8f7a91e3772b9aef9e07f62b84213c1f" - integrity sha512-fSVWzzemnyfF89EPwlUNsrS5swF5CrtiN4e+h0/lLf4dz2he4L3ndM20PS9wj7ICSkXJe/TQUHdaPTq15b1mNQ== +call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== + dependencies: + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" -borsh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/borsh/-/borsh-2.0.0.tgz#042a9f109565caac3c6a21297cd8c0ae8db3149d" - integrity sha512-kc9+BgR3zz9+cjbwM8ODoUB4fs3X3I5A/HtX7LZKxCLaMrEeDFoBpnhZY//DTS1VZBSs6S5v46RZRbZjRFspEg== +cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: + version "1.0.7" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.7.tgz#bd094bfef42634ccfd9e13b9fc73274997111e39" + integrity sha512-Mz9QMT5fJe7bKI7MH31UilT5cEK5EHHRCccw/YRFsRY47AuNgaV6HY3rscp0/I4Q+tTW/5zoqpSeRRI54TkDWA== + dependencies: + inherits "^2.0.4" + safe-buffer "^5.2.1" + to-buffer "^1.2.2" -brorand@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" - integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== +console-browserify@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" + integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== -bs58@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.0.tgz#65f5deaf6d74e6135a99f763ca6209ab424b9172" - integrity sha512-/jcGuUuSebyxwLLfKrbKnCJttxRf9PM51EnHTwmFKBxl4z1SGkoAhrfd6uZKE0dcjQTfm6XzTP8DPr1tzE4KIw== - dependencies: - base-x "^2.0.1" +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ== -bs58@^4.0.0, bs58@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" - integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== - dependencies: - base-x "^3.0.2" +core-util-is@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" + integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== -buffer@6.0.3, buffer@^6.0.3, buffer@~6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" - integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== +create-ecdh@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.4.tgz#d6e7f4bffa66736085a0762fd3a632684dabcc4e" + integrity sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A== dependencies: - base64-js "^1.3.1" - ieee754 "^1.2.1" + bn.js "^4.1.0" + elliptic "^6.5.3" -bufferutil@^4.0.1: - version "4.0.8" - resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.8.tgz#1de6a71092d65d7766c4d8a522b261a6e787e8ea" - integrity sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw== +create-hash@^1.1.0, create-hash@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: - node-gyp-build "^4.3.0" + cipher-base "^1.0.1" + inherits "^2.0.1" + md5.js "^1.3.4" + ripemd160 "^2.0.1" + sha.js "^2.4.0" -"charenc@>= 0.0.1": - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== +create-hmac@^1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== + dependencies: + cipher-base "^1.0.3" + create-hash "^1.1.0" + inherits "^2.0.1" + ripemd160 "^2.0.0" + safe-buffer "^5.0.1" + sha.js "^2.4.8" -commander@^2.20.3: - version "2.20.3" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +create-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== + +crypto-browserify@^3.12.1: + version "3.12.1" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.1.tgz#bb8921bec9acc81633379aa8f52d69b0b69e0dac" + integrity sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ== + dependencies: + browserify-cipher "^1.0.1" + browserify-sign "^4.2.3" + create-ecdh "^4.0.4" + create-hash "^1.2.0" + create-hmac "^1.1.7" + diffie-hellman "^5.0.3" + hash-base "~3.0.4" + inherits "^2.0.4" + pbkdf2 "^3.1.2" + public-encrypt "^4.0.3" + randombytes "^2.1.0" + randomfill "^1.0.4" -"crypt@>= 0.0.1": - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== +define-data-property@^1.0.1, define-data-property@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" + integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== + dependencies: + es-define-property "^1.0.0" + es-errors "^1.3.0" + gopd "^1.0.1" -delay@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/delay/-/delay-5.0.0.tgz#137045ef1b96e5071060dd5be60bf9334436bd1d" - integrity sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw== +define-properties@^1.1.3, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" depd@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +des.js@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.1.0.tgz#1d37f5766f3bbff4ee9638e871a8768c173b81da" + integrity sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg== + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" -elliptic@^6.5.4: - version "6.5.7" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" - integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== +diffie-hellman@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" + +domain-browser@4.22.0: + version "4.22.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-4.22.0.tgz#6ddd34220ec281f9a65d3386d267ddd35c491f9f" + integrity sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw== + +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" -elliptic@^6.5.7: +elliptic@^6.5.3, elliptic@^6.5.7, elliptic@^6.6.1: version "6.6.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== @@ -647,66 +655,173 @@ elliptic@^6.5.7: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== +es-define-property@^1.0.0, es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ== - dependencies: - es6-promise "^4.0.3" +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -eventemitter3@^4.0.7: - version "4.0.7" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" -eventemitter3@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" - integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== +esbuild@^0.25.0: + version "0.25.12" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.12.tgz#97a1d041f4ab00c2fce2f838d2b9969a2d2a97a5" + integrity sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg== + optionalDependencies: + "@esbuild/aix-ppc64" "0.25.12" + "@esbuild/android-arm" "0.25.12" + "@esbuild/android-arm64" "0.25.12" + "@esbuild/android-x64" "0.25.12" + "@esbuild/darwin-arm64" "0.25.12" + "@esbuild/darwin-x64" "0.25.12" + "@esbuild/freebsd-arm64" "0.25.12" + "@esbuild/freebsd-x64" "0.25.12" + "@esbuild/linux-arm" "0.25.12" + "@esbuild/linux-arm64" "0.25.12" + "@esbuild/linux-ia32" "0.25.12" + "@esbuild/linux-loong64" "0.25.12" + "@esbuild/linux-mips64el" "0.25.12" + "@esbuild/linux-ppc64" "0.25.12" + "@esbuild/linux-riscv64" "0.25.12" + "@esbuild/linux-s390x" "0.25.12" + "@esbuild/linux-x64" "0.25.12" + "@esbuild/netbsd-arm64" "0.25.12" + "@esbuild/netbsd-x64" "0.25.12" + "@esbuild/openbsd-arm64" "0.25.12" + "@esbuild/openbsd-x64" "0.25.12" + "@esbuild/openharmony-arm64" "0.25.12" + "@esbuild/sunos-x64" "0.25.12" + "@esbuild/win32-arm64" "0.25.12" + "@esbuild/win32-ia32" "0.25.12" + "@esbuild/win32-x64" "0.25.12" + +estree-walker@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== -events@3.3.0: +events@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -exponential-backoff@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.2.tgz#a8f26adb96bf78e8cd8ad1037928d5e5c0679d91" - integrity sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA== +evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== + dependencies: + md5.js "^1.3.4" + safe-buffer "^5.1.1" -eyes@^0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" - integrity sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ== +fdir@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350" + integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg== -fast-stable-stringify@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz#5c5543462b22aeeefd36d05b34e51c78cb86d313" - integrity sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag== +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== +for-each@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.5.tgz#d650688027826920feeb0af747ee7b9421a41d47" + integrity sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg== + dependencies: + is-callable "^1.2.7" -generate-function@^2.0.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f" - integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ== +fsevents@~2.3.2, fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +generator-function@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/generator-function/-/generator-function-2.0.1.tgz#0e75dd410d1243687a0ba2e951b94eedb8f737a2" + integrity sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g== + +get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== dependencies: - is-property "^1.0.2" + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" -generate-object-property@^1.1.0: +gopd@^1.0.1, gopd@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - integrity sha512-TuOwZWgJ2VAMEGJvAyPWvpqxSANF0LDpmyHauMjFYzaACvn+QTT/AZomvPCzVBV7yDN3OmwHQ5OvHaeLKre3JQ== + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + +has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" + integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== + dependencies: + es-define-property "^1.0.0" + +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + +hash-base@^3.0.0, hash-base@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.2.tgz#79d72def7611c3f6e3c3b5730652638001b10a74" + integrity sha512-Bb33KbowVTIj5s7Ked1OsqHUeCpz//tPwR+E2zJgJKo9Z5XolZ9b6bdUgjmYlwnWhoOQKoTd1TYToZGn5mAYOg== + dependencies: + inherits "^2.0.4" + readable-stream "^2.3.8" + safe-buffer "^5.2.1" + to-buffer "^1.2.1" + +hash-base@~3.0.4: + version "3.0.5" + resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.5.tgz#52480e285395cf7fba17dc4c9e47acdc7f248a8a" + integrity sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg== dependencies: - is-property "^1.0.0" + inherits "^2.0.4" + safe-buffer "^5.2.1" hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" @@ -716,6 +831,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -725,117 +847,132 @@ hmac-drbg@^1.0.1: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -humanize-ms@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" - integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== - dependencies: - ms "^2.0.0" +https-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg== -ieee754@^1.2.1: +ieee754@^1.1.13: version "1.2.1" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== - -inherits@^2.0.3, inherits@^2.0.4: +inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@~2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -is-mobile@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-mobile/-/is-mobile-4.0.0.tgz#bba396eb9656e2739afde3053d7191da310fc758" - integrity sha512-mlcHZA84t1qLSuWkt2v0I2l61PYdyQDt4aG1mLIXF5FDMm4+haBCxCPYSr/uwqQNRk1MiTizn0ypEuRAOLRAew== +is-arguments@^1.0.4: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.2.0.tgz#ad58c6aecf563b78ef2bf04df540da8f5d7d8e1b" + integrity sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA== + dependencies: + call-bound "^1.0.2" + has-tostringtag "^1.0.2" -is-my-ip-valid@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.1.tgz#f7220d1146257c98672e6fba097a9f3f2d348442" - integrity sha512-jxc8cBcOWbNK2i2aTkCZP6i7wkHF1bqKFrwEHuN5Jtg5BSaZHUZQ/JTOJwoV41YvHnOaRyWWh72T/KvfNz9DJg== +is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-my-json-valid@^2.20.6: - version "2.20.6" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz#a9d89e56a36493c77bda1440d69ae0dc46a08387" - integrity sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw== +is-core-module@^2.16.0: + version "2.16.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" + integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^5.0.0" - xtend "^4.0.0" + hasown "^2.0.2" -is-property@^1.0.0, is-property@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - integrity sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g== +is-generator-function@^1.0.7: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.1.2.tgz#ae3b61e3d5ea4e4839b90bad22b02335051a17d5" + integrity sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA== + dependencies: + call-bound "^1.0.4" + generator-function "^2.0.0" + get-proto "^1.0.1" + has-tostringtag "^1.0.2" + safe-regex-test "^1.1.0" -isomorphic-ws@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" - integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== +is-nan@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/is-nan/-/is-nan-1.3.2.tgz#043a54adea31748b55b6cd4e09aadafa69bd9e1d" + integrity sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w== + dependencies: + call-bind "^1.0.0" + define-properties "^1.1.3" -jayson@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/jayson/-/jayson-4.1.1.tgz#282ff13d3cea09776db684b7eeca98c47b2fa99a" - integrity sha512-5ZWm4Q/0DHPyeMfAsrwViwUS2DMVsQgWh8bEEIVTkfb3DzHZ2L3G5WUnF+AKmGjjM9r1uAv73SaqC1/U4RL45w== - dependencies: - "@types/connect" "^3.4.33" - "@types/node" "^12.12.54" - "@types/ws" "^7.4.4" - JSONStream "^1.3.5" - commander "^2.20.3" - delay "^5.0.0" - es6-promisify "^5.0.0" - eyes "^0.1.8" - isomorphic-ws "^4.0.1" - json-stringify-safe "^5.0.1" - uuid "^8.3.2" - ws "^7.5.10" - -js-sha256@0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== - -js-sha256@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.11.0.tgz#256a921d9292f7fe98905face82e367abaca9576" - integrity sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q== - -json-stringify-safe@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== +is-regex@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.1.tgz#76d70a3ed10ef9be48eb577887d74205bf0cad22" + integrity sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== + dependencies: + call-bound "^1.0.2" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + hasown "^2.0.2" -jsonparse@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" - integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== +is-typed-array@^1.1.14, is-typed-array@^1.1.3: + version "1.1.15" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" + integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== + dependencies: + which-typed-array "^1.1.16" -jsonpointer@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" - integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== -lru_map@0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.4.1.tgz#f7b4046283c79fb7370c36f8fca6aee4324b0a98" - integrity sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg== +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== + +isomorphic-timers-promises@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-timers-promises/-/isomorphic-timers-promises-1.0.1.tgz#e4137c24dbc54892de8abae3a4b5c1ffff381598" + integrity sha512-u4sej9B1LPSxTGKB/HiuzvEQnXH0ECYkSVQU39koSwmFAxhlEAFl9RdTvLv4TOTQUgBS5O3O5fwUxk6byBZ+IQ== + +jsonc-parser@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4" + integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +magic-string@^0.30.3: + version "0.30.19" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.19.tgz#cebe9f104e565602e5d2098c5f2e79a77cc86da9" + integrity sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.5" + +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + +md5.js@^1.3.4: + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== + dependencies: + hash-base "^3.0.0" + inherits "^2.0.1" + safe-buffer "^5.1.2" + +miller-rabin@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" @@ -847,130 +984,324 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -ms@^2.0.0: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - mustache@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/mustache/-/mustache-4.0.0.tgz#7f02465dbb5b435859d154831c032acdfbbefb31" integrity sha512-FJgjyX/IVkbXBXYUwH+OYwQKqWpFPLaLVESd70yHjSDunwzV2hZOoTBvPf4KLoxesUzzyfTH6F784Uqd7Wm5yA== -near-abi@0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/near-abi/-/near-abi-0.1.1.tgz#b7ead408ca4ad11de4fe3e595d30a7a8bc5307e0" - integrity sha512-RVDI8O+KVxRpC3KycJ1bpfVj9Zv+xvq9PlW1yIFl46GhrnLw83/72HqHGjGDjQ8DtltkcpSjY9X3YIGZ+1QyzQ== +nanoid@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" + integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== + +node-addon-api@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" + integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== + +node-gyp-build@^4.2.0: + version "4.8.4" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.4.tgz#8a70ee85464ae52327772a90d66c6077a900cfc8" + integrity sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ== + +node-stdlib-browser@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/node-stdlib-browser/-/node-stdlib-browser-1.3.1.tgz#f41fa554f720a3df951e40339f4d92ac512222ac" + integrity sha512-X75ZN8DCLftGM5iKwoYLA3rjnrAEs97MkzvSd4q2746Tgpg8b8XWiBGiBG4ZpgcAqBgtgPHTiAc8ZMCvZuikDw== + dependencies: + assert "^2.0.0" + browser-resolve "^2.0.0" + browserify-zlib "^0.2.0" + buffer "^5.7.1" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + create-require "^1.1.1" + crypto-browserify "^3.12.1" + domain-browser "4.22.0" + events "^3.0.0" + https-browserify "^1.0.0" + isomorphic-timers-promises "^1.0.1" + os-browserify "^0.3.0" + path-browserify "^1.0.1" + pkg-dir "^5.0.0" + process "^0.11.10" + punycode "^1.4.1" + querystring-es3 "^0.2.1" + readable-stream "^3.6.0" + stream-browserify "^3.0.0" + stream-http "^3.2.0" + string_decoder "^1.0.0" + timers-browserify "^2.0.4" + tty-browserify "0.0.1" + url "^0.11.4" + util "^0.12.4" + vm-browserify "^1.0.1" + +object-inspect@^1.13.3: + version "1.13.4" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" + integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== + +object-is@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" + integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.4: + version "4.1.7" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.7.tgz#8c14ca1a424c6a561b0bb2a22f66f5049a945d3d" + integrity sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw== + dependencies: + call-bind "^1.0.8" + call-bound "^1.0.3" + define-properties "^1.2.1" + es-object-atoms "^1.0.0" + has-symbols "^1.1.0" + object-keys "^1.1.1" + +os-browserify@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A== + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: - "@types/json-schema" "^7.0.11" + yocto-queue "^0.1.0" -near-abi@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/near-abi/-/near-abi-0.2.0.tgz#745b569d69d172f46cd2ecc06271974a6cd2fa48" - integrity sha512-kCwSf/3fraPU2zENK18sh+kKG4uKbEUEQdyWQkmW8ZofmLarObIz2+zAYjA1teDZLeMvEQew3UysnPDXgjneaA== +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +pako@~1.0.5: + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + +parse-asn1@^5.0.0, parse-asn1@^5.1.9: + version "5.1.9" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.9.tgz#8dd24c3ea8da77dffbc708d94eaf232fd6156e95" + integrity sha512-fIYNuZ/HastSb80baGOuPRo1O9cf4baWw5WsAp7dBuUzeTD/BoaG8sVTdlPFksBE2lF21dN+A1AnrpIjSWqHHg== dependencies: - "@types/json-schema" "^7.0.11" + asn1.js "^4.10.1" + browserify-aes "^1.2.0" + evp_bytestokey "^1.0.3" + pbkdf2 "^3.1.5" + safe-buffer "^5.2.1" + +path-browserify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" + integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +pbkdf2@^3.1.2, pbkdf2@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.5.tgz#444a59d7a259a95536c56e80c89de31cc01ed366" + integrity sha512-Q3CG/cYvCO1ye4QKkuH7EXxs3VC/rI1/trd+qX2+PolbaKG0H+bgcZzrTt96mMyRtejk+JMCiLUn3y29W8qmFQ== + dependencies: + create-hash "^1.2.0" + create-hmac "^1.1.7" + ripemd160 "^2.0.3" + safe-buffer "^5.2.1" + sha.js "^2.4.12" + to-buffer "^1.2.1" + +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== -near-api-js@4.0.3: +picomatch@^4.0.2, picomatch@^4.0.3: version "4.0.3" - resolved "https://registry.yarnpkg.com/near-api-js/-/near-api-js-4.0.3.tgz#7b31e8d86224acf526cda7c4e5e57f44b23c4719" - integrity sha512-NNxIUOGjTafDp65WKRmRqjOTdn4gukse5zFzo2YS/1YJMac++WR05mEsiAB2Aj54rDb/PL8TObQZgHtSs/Pjvg== - dependencies: - "@near-js/accounts" "1.2.1" - "@near-js/crypto" "1.2.4" - "@near-js/keystores" "0.0.12" - "@near-js/keystores-browser" "0.0.12" - "@near-js/keystores-node" "0.0.12" - "@near-js/providers" "0.2.2" - "@near-js/signers" "0.1.4" - "@near-js/transactions" "1.2.2" - "@near-js/types" "0.2.1" - "@near-js/utils" "0.2.2" - "@near-js/wallet-account" "1.2.2" - "@noble/curves" "1.2.0" - borsh "1.0.0" - depd "2.0.0" - http-errors "1.7.2" - near-abi "0.1.1" - node-fetch "2.6.7" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== -node-addon-api@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-5.1.0.tgz#49da1ca055e109a23d537e9de43c09cca21eb762" - integrity sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA== +pkg-dir@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760" + integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA== + dependencies: + find-up "^5.0.0" + +possible-typed-array-names@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae" + integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg== -node-fetch@2.6.7: - version "2.6.7" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" - integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== +postcss@^8.5.6: + version "8.5.6" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" + integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg== dependencies: - whatwg-url "^5.0.0" + nanoid "^3.3.11" + picocolors "^1.1.1" + source-map-js "^1.2.1" -node-fetch@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +process@^0.11.10: + version "0.11.10" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== + +public-encrypt@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== dependencies: - whatwg-url "^5.0.0" + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" + safe-buffer "^5.1.2" -node-gyp-build@^4.2.0: - version "4.8.2" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.2.tgz#4f802b71c1ab2ca16af830e6c1ea7dd1ad9496fa" - integrity sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw== +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ== -node-gyp-build@^4.3.0: - version "4.8.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" - integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== +qs@^6.12.3: + version "6.14.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.0.tgz#c63fa40680d2c5c941412a0e899c89af60c0a930" + integrity sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w== + dependencies: + side-channel "^1.1.0" + +querystring-es3@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA== -randombytes@2.1.0: +randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - -rpc-websockets@^9.0.2: - version "9.0.2" - resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.0.2.tgz#4c1568d00b8100f997379a363478f41f8f4b242c" - integrity sha512-YzggvfItxMY3Lwuax5rC18inhbjJv9Py7JXRHxTIi94JOLrqBsSsUUc5bbl5W6c11tXhdfpDPK0KzBhoGe8jjw== - dependencies: - "@swc/helpers" "^0.5.11" - "@types/uuid" "^8.3.4" - "@types/ws" "^8.2.2" - buffer "^6.0.3" - eventemitter3 "^5.0.1" - uuid "^8.3.2" - ws "^8.5.0" - optionalDependencies: - bufferutil "^4.0.1" - utf-8-validate "^5.0.2" +randomfill@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== + dependencies: + randombytes "^2.0.5" + safe-buffer "^5.1.0" -rxjs@7.8.1: - version "7.8.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" - integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== +readable-stream@^2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" + integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.5.0, readable-stream@^3.6.0: + version "3.6.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: - tslib "^2.1.0" + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" -safe-buffer@^5.0.1, safe-buffer@^5.1.0: +resolve@^1.17.0: + version "1.22.10" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" + integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== + dependencies: + is-core-module "^2.16.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.3.tgz#9be54e4ba5e3559c8eee06a25cd7648bbccdf5a8" + integrity sha512-5Di9UC0+8h1L6ZD2d7awM7E/T4uA1fJRlx6zk/NvdCCVEoAnFqvHmCuNeIKoCeIixBX/q8uM+6ycDvF8woqosA== + dependencies: + hash-base "^3.1.2" + inherits "^2.0.4" + +rollup@^4.43.0: + version "4.53.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.53.2.tgz#98e73ee51e119cb9d88b07d026c959522416420a" + integrity sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g== + dependencies: + "@types/estree" "1.0.8" + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.53.2" + "@rollup/rollup-android-arm64" "4.53.2" + "@rollup/rollup-darwin-arm64" "4.53.2" + "@rollup/rollup-darwin-x64" "4.53.2" + "@rollup/rollup-freebsd-arm64" "4.53.2" + "@rollup/rollup-freebsd-x64" "4.53.2" + "@rollup/rollup-linux-arm-gnueabihf" "4.53.2" + "@rollup/rollup-linux-arm-musleabihf" "4.53.2" + "@rollup/rollup-linux-arm64-gnu" "4.53.2" + "@rollup/rollup-linux-arm64-musl" "4.53.2" + "@rollup/rollup-linux-loong64-gnu" "4.53.2" + "@rollup/rollup-linux-ppc64-gnu" "4.53.2" + "@rollup/rollup-linux-riscv64-gnu" "4.53.2" + "@rollup/rollup-linux-riscv64-musl" "4.53.2" + "@rollup/rollup-linux-s390x-gnu" "4.53.2" + "@rollup/rollup-linux-x64-gnu" "4.53.2" + "@rollup/rollup-linux-x64-musl" "4.53.2" + "@rollup/rollup-openharmony-arm64" "4.53.2" + "@rollup/rollup-win32-arm64-msvc" "4.53.2" + "@rollup/rollup-win32-ia32-msvc" "4.53.2" + "@rollup/rollup-win32-x64-gnu" "4.53.2" + "@rollup/rollup-win32-x64-msvc" "4.53.2" + fsevents "~2.3.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -secp256k1@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-5.0.0.tgz#be6f0c8c7722e2481e9773336d351de8cddd12f7" - integrity sha512-TKWX8xvoGHrxVdqbYeZM9w+izTF4b9z3NhSaDkdn81btvuh+ivbIMGT/zQvDtTFWhRlThpoz6LEYTr7n8A5GcA== +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex-test@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.1.0.tgz#7f87dfb67a3150782eaaf18583ff5d1711ac10c1" + integrity sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw== dependencies: - elliptic "^6.5.4" - node-addon-api "^5.0.0" - node-gyp-build "^4.2.0" + call-bound "^1.0.2" + es-errors "^1.3.0" + is-regex "^1.2.1" secp256k1@5.0.1: version "5.0.1" @@ -981,105 +1312,237 @@ secp256k1@5.0.1: node-addon-api "^5.0.0" node-gyp-build "^4.2.0" -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +semver@^7.7.4: + version "7.7.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" + integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== -sha1@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/sha1/-/sha1-1.1.1.tgz#addaa7a93168f393f19eb2b15091618e2700f848" - integrity sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA== +set-function-length@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +setimmediate@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== + +sha.js@^2.4.0, sha.js@^2.4.12, sha.js@^2.4.8: + version "2.4.12" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.12.tgz#eb8b568bf383dfd1867a32c3f2b74eb52bdbf23f" + integrity sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w== dependencies: - charenc ">= 0.0.1" - crypt ">= 0.0.1" + inherits "^2.0.4" + safe-buffer "^5.2.1" + to-buffer "^1.2.0" -"statuses@>= 1.5.0 < 2": - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== +side-channel-list@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" + integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" -superstruct@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-2.0.2.tgz#3f6d32fbdc11c357deff127d591a39b996300c54" - integrity sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A== +side-channel-map@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" + integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" -text-encoding-utf-8@^1.0.2: +side-channel-weakmap@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" - integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== + resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" + integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + side-channel-map "^1.0.1" -"through@>=2.2.7 <3": - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== +side-channel@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" + integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + side-channel-list "^1.0.0" + side-channel-map "^1.0.1" + side-channel-weakmap "^1.0.2" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +source-map-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" + integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +stream-browserify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-3.0.0.tgz#22b0a2850cdf6503e73085da1fc7b7d0c2122f2f" + integrity sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA== + dependencies: + inherits "~2.0.4" + readable-stream "^3.5.0" -tslib@^2.1.0, tslib@^2.4.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" - integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== +stream-http@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.2.0.tgz#1872dfcf24cb15752677e40e5c3f9cc1926028b5" + integrity sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A== + dependencies: + builtin-status-codes "^3.0.0" + inherits "^2.0.4" + readable-stream "^3.6.0" + xtend "^4.0.2" -typescript@^5.2.2: - version "5.5.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.4.tgz#d9852d6c82bad2d2eda4fd74a5762a8f5909e9ba" - integrity sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q== +string_decoder@^1.0.0, string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -utf-8-validate@^5.0.2: - version "5.0.10" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2" - integrity sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ== +timers-browserify@^2.0.4: + version "2.0.12" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.12.tgz#44a45c11fbf407f34f97bccd1577c652361b00ee" + integrity sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ== dependencies: - node-gyp-build "^4.3.0" + setimmediate "^1.0.4" -uuid4@2.0.3, uuid4@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/uuid4/-/uuid4-2.0.3.tgz#241e5dfe1704a79c52e2aa40e7e581a5e7b01ab4" - integrity sha512-CTpAkEVXMNJl2ojgtpLXHgz23dh8z81u6/HEPiQFOvBc/c2pde6TVHmH4uwY0d/GLF3tb7+VDAj4+2eJaQSdZQ== +tinyglobby@^0.2.15: + version "0.2.15" + resolved "https://registry.yarnpkg.com/tinyglobby/-/tinyglobby-0.2.15.tgz#e228dd1e638cea993d2fdb4fcd2d4602a79951c2" + integrity sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ== + dependencies: + fdir "^6.5.0" + picomatch "^4.0.3" -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +to-buffer@^1.2.0, to-buffer@^1.2.1, to-buffer@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.2.2.tgz#ffe59ef7522ada0a2d1cb5dfe03bb8abc3cdc133" + integrity sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw== + dependencies: + isarray "^2.0.5" + safe-buffer "^5.2.1" + typed-array-buffer "^1.0.3" -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +tty-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== +typed-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" + integrity sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-typed-array "^1.1.14" + +typescript@^5.2.2: + version "5.8.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" + integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== + +url@^0.11.4: + version "0.11.4" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.4.tgz#adca77b3562d56b72746e76b330b7f27b6721f3c" + integrity sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg== dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" + punycode "^1.4.1" + qs "^6.12.3" -ws@^7.5.10: - version "7.5.10" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" - integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -ws@^8.5.0: - version "8.18.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" - integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== +util@^0.12.4, util@^0.12.5: + version "0.12.5" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.5.tgz#5f17a6059b73db61a875668781a1c2b136bd6fbc" + integrity sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + which-typed-array "^1.1.2" + +vite-plugin-node-polyfills@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/vite-plugin-node-polyfills/-/vite-plugin-node-polyfills-0.24.0.tgz#4a2e984bba134017fc88cace0149cf8afdb50b54" + integrity sha512-GA9QKLH+vIM8NPaGA+o2t8PDfFUl32J8rUp1zQfMKVJQiNkOX4unE51tR6ppl6iKw5yOrDAdSH7r/UIFLCVhLw== + dependencies: + "@rollup/plugin-inject" "^5.0.5" + node-stdlib-browser "^1.2.0" + +vite@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/vite/-/vite-7.2.2.tgz#17dd62eac2d0ca0fa90131c5f56e4fefb8845362" + integrity sha512-BxAKBWmIbrDgrokdGZH1IgkIk/5mMHDreLDmCJ0qpyJaAteP8NvMhkwr/ZCQNqNH97bw/dANTE9PDzqwJghfMQ== + dependencies: + esbuild "^0.25.0" + fdir "^6.5.0" + picomatch "^4.0.3" + postcss "^8.5.6" + rollup "^4.43.0" + tinyglobby "^0.2.15" + optionalDependencies: + fsevents "~2.3.3" -xtend@^4.0.0: +vm-browserify@^1.0.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" + integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== + +which-typed-array@^1.1.16, which-typed-array@^1.1.2: + version "1.1.19" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" + integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.4" + for-each "^0.3.5" + get-proto "^1.0.1" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + +xtend@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +yaml@2.8.3: + version "2.8.3" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.8.3.tgz#a0d6bd2efb3dd03c59370223701834e60409bd7d" + integrity sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==