0.1.67 • Published 5 months ago

consoles-ai v0.1.67

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

Consoles

Simple solutions for powerful features. Built for developers and AI agents.

Overview

Consoles is a comprehensive development platform that simplifies complex AI and blockchain operations into easy-to-use APIs. Our platform is designed to help developers and AI agents build powerful applications without getting bogged down by implementation details.

Why Consoles?

  • 🚀 Simplified Complexity - Complex operations reduced to simple API calls
  • 🔌 Plug-and-Play Integration - Start building in minutes with our SDK
  • 🛠️ Developer First - Built by developers, for developers
  • 🤖 AI-Ready - First-class support for AI agents and automation
  • High Performance - Optimized for speed and reliability
  • 🔒 Enterprise Grade - Production-ready with built-in security features

Core Products

  • Extract - AI-powered data extraction from any content type
  • Web3 - Simplified blockchain operations for Solana
  • Browsers (Coming Soon) - Cloud browser automation
  • Compute (Coming Soon) - Serverless code execution
  • Storage (Coming Soon) - Distributed file storage
  • Tools (Coming Soon) - Scalable function deployment

Getting Started

Prerequisites

Installation

npm install consoles-ai

Quick Start

import { Consoles } from 'consoles-ai';
import dotenv from 'dotenv';
dotenv.config();

// Initialize SDK with your API key
const consoles = new Consoles(process.env.CONSOLES_API_KEY);

Available Products

Extract

Transform any content into structured data with AI. Supports text, PDFs, audio, video, and more.

Features

  • 🤖 AI-powered extraction (text, PDFs, audio, video)
  • 📝 Schema validation with Zod
  • 🎯 Custom prompts and instructions
  • 🔄 Multiple input formats
  • 📊 Structured data output

Basic Example

import { Consoles } from 'consoles-ai';
import { z } from 'zod';

// Initialize SDK with your API key
const consoles = new Consoles('your-api-key');

// Example 1: Simple text extraction with Zod schema
const productSchema = z.object({
  name: z.string(),
  price: z.number(),
  description: z.string(),
  inStock: z.boolean().optional(),
});

const textResult = await consoles.extract({
  type: 'text',
  content: `
    New iPhone 15 Pro
    Price: $999
    Experience the most powerful iPhone ever with revolutionary A17 Pro chip.
    Currently available in all stores.
  `,
  schema: productSchema
});

// Example 2: Process PDF from file
const fileSchema = z.object({
  title: z.string(),
  sections: z.array(z.object({
    heading: z.string(),
    content: z.string()
  })),
  totalPages: z.number()
});

const fileResult = await consoles.extract({
  type: 'file',
  content: {
    data: 'base64EncodedFileContent',
    mimeType: 'application/pdf'
  },
  schema: fileSchema,
  prompt: 'Extract the main sections and content'
});

// Example 3: Simple string extraction (shorthand)
const summary = await consoles.extract(
  'Extract key points from this text...'
);

Web3

Blockchain integration for Solana with wallet management, price feeds, and DEX interactions.

Features

  • 🔍 Read-only operations (prices, portfolios, trust scores)
  • 💳 Wallet management (create, connect, save/load)
  • 💸 Token operations (send, swap)
  • 📊 Portfolio tracking
  • 🔒 Trust score analysis

Basic Example

import { Consoles } from 'consoles-ai';
import dotenv from 'dotenv';
dotenv.config();

// Initialize SDK with your API key 
// API key is optional and only required for paid features
const consoles = new Consoles(process.env.CONSOLES_API_KEY);

// Initialize Solana
// to use custom RPC, pass in a custom RPC:
// consoles.web3.solana({ rpc: 'https://rpc.example.com'} )
const solana = consoles.web3.solana()

// Get token info
const USDC = '7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU';
const prices = await solana.getPrice(USDC);
console.log('USDC Price:', prices);

const trustScore = await solana.getTrustScore(USDC);
console.log('Trust Score:', trustScore.score.toFixed(2));

// Check any wallet's portfolio
const whaleAddress = "DYtKhdXCSxX8SfdmhPSGmZwTLC9Ld1jxvPHNuRoTL6Vr";
const portfolio = await solana.portfolio(whaleAddress);
const totals = await portfolio.total();
console.log(`Portfolio Value: $${totals.usd}`);
console.log('Holdings:', portfolio.tokens.map(t => 
  `${t.symbol}: ${t.amount} ($${t.value})`
));

// Create and connect wallet
const { wallet } = await solana.createWallet();
await solana.connect(wallet);
console.log('Wallet:', wallet.publicKey);

// Send tokens with custom priority fee and compute units
const tx = await solana.send({
  to: whaleAddress,
  amount: '0.0000001', 
  token: 'SOL',
  config: {
    priorityFee: 100_000, // Priority fee in microlamports (0.0001 SOL)
    computeUnits: 200_000 // Maximum compute units for transaction
  }
});

console.log('Transaction:', tx.id);

// Swap tokens
const swap = await solana.swap({
  from: { token: 'SOL', amount: '0.1' },
  to: { token: 'USDC' },
  config: { slippage: '1' }
});
console.log('Swap:', swap.id);

// Wait for confirmation
let status = await solana.status(tx.id);
while (status !== 'confirmed') {
  await new Promise(r => setTimeout(r, 1000));
  status = await solana.status(tx.id);
}
console.log('Confirmed!');

Portfolio Examples

// Check portfolio with different price sources
const portfolio = await solana.portfolio(address);

// Get basic USD value
const totals = await portfolio.total();
console.log(`Portfolio Value: $${totals.usd}`);
console.log(`Value in SOL: ${totals.sol} SOL`);

// Get value in USDC from Jupiter
const jupiterValue = await portfolio.total(COMMON_TOKENS.USDC, 'jupiter');
console.log(`Value in USDC (Jupiter): ${jupiterValue.token} USDC`);

// Get value in BONK from Raydium
const raydiumValue = await portfolio.total('DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263', 'raydium');
console.log(`Value in BONK (Raydium): ${raydiumValue.token} BONK`);

// Get best price across all DEXs
const bestPrice = await portfolio.total('YOUR_TOKEN_ADDRESS', 'all');
console.log(`Best value in Token: ${bestPrice.token}`);

// List all holdings with their values
console.log('Holdings:', portfolio.tokens.map(token => 
  `${token.amount} ${token.symbol} ($${token.value})`
));

Transaction Examples

// Send exact amounts
const tx = await solana.send({
  to: friendAddress,
  amount: '1.5',        // Send exactly 1.5 USDC
  token: 'USDC'
});

// Send with USD value
const tx2 = await solana.send({
  to: friendAddress,
  amount: '$100',       // Send $100 worth of SOL
  token: 'SOL'
});

// Swap tokens
const swap = await solana.swap({
  from: { token: 'SOL', amount: '0.1' },   // Swap from 0.1 SOL
  to: { token: 'USDC' },                   // Get USDC
  config: { slippage: '1' }                // 1% slippage allowed
});

// Wait for confirmation
await tx.confirm();

Coming Soon

Browsers

Launch and control Browsers in the cloud.

Compute

Execute code and run containers programmatically

Storage

Fast, affordable storage distributed across the globe

Tools Platform

Deploy tools/functions that scale automatically

Documentation & Support

Comprehensive Guides

Support Channels

Additional Resources

License

Part of this project is licensed under the MIT License - see the LICENSE file for details.

Links

DocumentationDiscordSupport

0.1.52

5 months ago

0.1.53

5 months ago

0.1.54

5 months ago

0.1.55

5 months ago

0.1.56

5 months ago

0.1.57

5 months ago

0.1.58

5 months ago

0.1.59

5 months ago

0.1.50

5 months ago

0.1.51

5 months ago

0.1.63

5 months ago

0.1.64

5 months ago

0.1.65

5 months ago

0.1.66

5 months ago

0.1.67

5 months ago

0.1.60

5 months ago

0.1.61

5 months ago

0.1.62

5 months ago

0.1.49

7 months ago

0.1.41

7 months ago

0.1.42

7 months ago

0.1.43

7 months ago

0.1.44

7 months ago

0.1.45

7 months ago

0.1.46

7 months ago

0.1.47

7 months ago

0.1.48

7 months ago

0.1.40

7 months ago

0.1.38

7 months ago

0.1.39

7 months ago

0.1.30

7 months ago

0.1.31

7 months ago

0.1.32

7 months ago

0.1.33

7 months ago

0.1.34

7 months ago

0.1.35

7 months ago

0.1.36

7 months ago

0.1.37

7 months ago

0.1.28

7 months ago

0.1.29

7 months ago

0.1.27

7 months ago

0.1.21

7 months ago

0.1.22

7 months ago

0.1.23

7 months ago

0.1.24

7 months ago

0.1.25

7 months ago

0.1.26

7 months ago

0.1.16

8 months ago

0.1.17

8 months ago

0.1.18

8 months ago

0.1.19

8 months ago

0.1.10

8 months ago

0.1.11

8 months ago

0.1.12

8 months ago

0.1.13

8 months ago

0.1.14

8 months ago

0.1.15

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.9

8 months ago

0.1.4

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.0.135

12 months ago

0.0.134

12 months ago

0.0.133

1 year ago

0.0.128

1 year ago

0.0.127

1 year ago

0.0.129

1 year ago

0.0.131

1 year ago

0.0.130

1 year ago

0.0.132

1 year ago

0.0.126

1 year ago

0.0.125

1 year ago

0.0.124

1 year ago

0.0.123

1 year ago

0.0.122

1 year ago

0.0.121

1 year ago

0.0.120

1 year ago

0.0.119

1 year ago

0.0.118

1 year ago

0.0.117

1 year ago

0.0.116

1 year ago

0.0.115

1 year ago

0.0.114

1 year ago

0.0.113

1 year ago

0.0.112

1 year ago

0.0.111

1 year ago

0.0.110

1 year ago

0.0.109

1 year ago

0.0.108

1 year ago

0.0.107

1 year ago

0.0.106

1 year ago

0.0.105

1 year ago

0.0.104

1 year ago

0.0.103

1 year ago

0.0.102

1 year ago

0.0.101

1 year ago

0.0.100

1 year ago

0.0.99

1 year ago

0.0.98

1 year ago

0.0.97

1 year ago

0.0.96

1 year ago

0.0.95

1 year ago

0.0.94

1 year ago

0.0.93

1 year ago

0.0.92

1 year ago

0.0.91

1 year ago

0.0.90

1 year ago

0.0.89

1 year ago

0.0.88

1 year ago

0.0.87

1 year ago

0.0.86

1 year ago

0.0.85

1 year ago

0.0.84

1 year ago

0.0.83

1 year ago

0.0.82

1 year ago

0.0.81

1 year ago

0.0.80

1 year ago

0.0.79

1 year ago

0.0.78

1 year ago

0.0.77

1 year ago

0.0.76

1 year ago

0.0.75

1 year ago

0.0.74

1 year ago

0.0.73

1 year ago

0.0.72

1 year ago

0.0.71

1 year ago

0.0.70

1 year ago

0.0.69

1 year ago

0.0.63

1 year ago

0.0.67

1 year ago

0.0.66

1 year ago

0.0.65

1 year ago

0.0.62

1 year ago

0.0.61

1 year ago

0.0.60

1 year ago

0.0.59

1 year ago

0.0.58

1 year ago

0.0.55

1 year ago

0.0.54

1 year ago

0.0.53

1 year ago

0.0.52

1 year ago

0.0.51

1 year ago

0.0.50

1 year ago

0.0.49

1 year ago

0.0.48

1 year ago

0.0.46

1 year ago

0.0.45

1 year ago

0.0.44

1 year ago

0.0.43

1 year ago

0.0.42

1 year ago

0.0.41

1 year ago

0.0.40

1 year ago

0.0.39

1 year ago

0.0.38

1 year ago

0.0.37

1 year ago

0.0.36

1 year ago

0.0.35

1 year ago

0.0.34

1 year ago

0.0.33

1 year ago

0.0.32

1 year ago

0.0.30

1 year ago

0.0.28

1 year ago

0.0.27

1 year ago

0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago