0.0.25 • Published 5 months ago

@tarobase/core v0.0.25

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

@tarobase/core

Core functionality for Tarobase SDKs. This package provides the shared functionality used by both the web and server SDKs.

Installation

npm install @tarobase/core

Usage

This package is typically not used directly, but is instead used as a dependency by @tarobase/web and @tarobase/server. If you're building a browser application, use @tarobase/web. If you're building a server application, use @tarobase/server.

API Reference

Core Types

export interface ClientConfig {
  appId: string;
  apiUrl: string;
  authMethod: string;
  privyConfig?: any;
  chain?: string;
  useSessionStorage?: boolean;
}

export interface AuthProvider {
  login(): Promise<User | null>;
  runTransaction(evmTransactionData?: EVMTransaction, solTransactionData?: SolTransaction, options?: SetOptions): Promise<TransactionResult>;
  signMessage(message: string): Promise<string>;
  restoreSession(): Promise<User | null>;
  logout(): Promise<void>;
  getNativeMethods(): Promise<any>;
}

export interface User {
  address: string;
  provider: AuthProvider;
}

Core Operations

// Initialize the SDK
function configInit(newConfig: Partial<ClientConfig>, options?: SessionOptions): Promise<void>;

// Get the current configuration
function getConfig(): Promise<ClientConfig>;

// Data operations
function get(path: string): Promise<any>;
function set(path: string, data: any, options?: SetOptions): Promise<any>;
function setMany(paths: { [key: string]: any }, options?: SetOptions): Promise<any>;
function setFile(path: string, file: File, metadata?: any): Promise<any>;
function getFiles(path: string): Promise<any>;
function runQuery(queryString: string, variables?: any): Promise<any>;
function runQueryMany(queryString: string, variables?: any): Promise<any>;

// Subscription
function subscribe(path: string, options?: SubscriptionOptions): Promise<() => void>;

Contributing

Please see the main repository for contribution guidelines.

0.0.25

5 months ago

0.0.24

5 months ago

0.0.23

5 months ago

0.0.22

5 months ago

0.0.21

5 months ago

0.0.20

5 months ago

0.0.19

5 months ago

0.0.18

5 months ago

0.0.17

5 months ago

0.0.16

5 months ago

0.0.15

5 months ago

0.0.14

5 months ago

0.0.13

5 months ago

0.0.12

5 months ago

0.0.11

5 months ago

0.0.10

5 months ago

0.0.9

5 months ago

0.0.8

5 months ago

0.0.7

5 months ago

0.0.6

5 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago