0.0.25 • Published 2 months ago

@tarobase/core v0.0.25

Weekly downloads
-
License
MIT
Repository
-
Last release
2 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

2 months ago

0.0.24

2 months ago

0.0.23

2 months ago

0.0.22

2 months ago

0.0.21

2 months ago

0.0.20

2 months ago

0.0.19

2 months ago

0.0.18

2 months ago

0.0.17

2 months ago

0.0.16

2 months ago

0.0.15

2 months ago

0.0.14

2 months ago

0.0.13

2 months ago

0.0.12

2 months ago

0.0.11

2 months ago

0.0.10

2 months ago

0.0.9

2 months ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

2 months ago

0.0.5

2 months ago

0.0.4

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago

0.0.1

2 months ago