0.2.22-beta • Published 1 month ago

@sherrylinks/slinks-core v0.2.22-beta

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

@sherrylinks/slinks-core

npm version

Core logic for SherryLinks adapters, context, observers, and wallet interactions.

Overview

This package provides the foundational building blocks for the SherryLinks ecosystem. It includes:

  • Core type definitions and interfaces (e.g., SherryAdapter).
  • MiniApp Directory logic for fetching and validating MiniApp endpoints.
  • Error handling classes (SherryError, MiniAppError, etc.).
  • Utility functions for formatting, proxifying URLs, and constants.
  • Base classes and logic potentially used by platform observers.

This package is primarily intended as an internal dependency for @sherrylinks/slinks and @sherrylinks/slinks-extension, but some utilities might be useful independently.

Installation

While typically installed as a dependency of @sherrylinks/slinks, you can install it directly if needed:

npm install @sherrylinks/slinks-core
# or
yarn add @sherrylinks/slinks-core
# or
pnpm add @sherrylinks/slinks-core

Usage

Direct usage is less common, as most functionality is exposed through the @sherrylinks/slinks package. However, you might import types or specific utilities:

import { MiniAppDirectory, API_REPOSITORY_URL, SherryError } from '@sherrylinks/slinks-core';

// Example: Using the directory
const directory = new MiniAppDirectory(API_REPOSITORY_URL);
await directory.refresh();
const securityState = directory.lookup('https://app.sherry.social');

// Example: Using error types
try {
  // ... some operation
} catch (error) {
  if (error instanceof SherryError) {
    console.error('SherryLinks Core Error:', error.message);
  }
}

Key Exports

  • MiniAppDirectory: Class for managing and querying MiniApp sources.
  • SherryError, MiniAppError, ValidationError, etc.: Custom error classes.
  • API_REPOSITORY_URL, PROXY_URL: Constant URLs.
  • Utility functions (e.g., proxifyUrl, formatAddress).
  • Core types and interfaces.

License

MIT

0.2.22-beta

1 month ago

0.2.21-beta

1 month ago

0.2.20-beta

1 month ago

0.2.19-beta

1 month ago

0.1.19-beta

2 months ago

0.1.18-beta

2 months ago

0.1.17-beta

2 months ago

0.1.16-beta

2 months ago

0.1.15-beta

2 months ago

0.1.14-beta

2 months ago

0.1.13-beta

2 months ago

0.1.12-beta

2 months ago

0.1.11-beta

2 months ago

0.1.10-beta

2 months ago

0.1.9-beta

2 months ago

0.1.8-beta

2 months ago

0.1.7-beta

2 months ago

0.1.5-beta

2 months ago

0.1.3-beta

3 months ago

0.1.2-beta

3 months ago

0.1.1-beta

3 months ago

0.1.0-beta

3 months ago

1.0.0

4 months ago