@sherrylinks/slinks-core v0.2.22-beta
@sherrylinks/slinks-core
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
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago