@nosana/kit 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nosana/kit",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Nosana KIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -51,5 +51,10 @@
51
51
  },
52
52
  "engines": {
53
53
  "node": ">=20.18.0"
54
- }
54
+ },
55
+ "files": [
56
+ "dist",
57
+ "package.json",
58
+ "README.md"
59
+ ]
55
60
  }
package/.gitlab-ci.yml DELETED
@@ -1,54 +0,0 @@
1
- # _ __ ___ ___ __ _ _ __ __ _
2
- # | '_ \ / _ \/ __|/ _` | '_ \ / _` |
3
- # | | | | (_) \__ \ (_| | | | | (_| |
4
- # |_| |_|\___/|___/\__,_|_| |_|\__,_|
5
-
6
- image: node:22.8.0
7
-
8
- include:
9
- - project: nosana-ci/tools/cicd/gitlab-ci
10
- file: templates/semver.yml
11
-
12
- npm format:
13
- stage: test
14
- script:
15
- - npm ci
16
- - npm run format
17
- rules:
18
- - if: $CI_MERGE_REQUEST_ID
19
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
20
-
21
- npm lint:
22
- stage: test
23
- script:
24
- - npm ci
25
- - npm run lint
26
- rules:
27
- - if: $CI_MERGE_REQUEST_ID
28
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
29
-
30
- npm test:
31
- stage: test
32
- script:
33
- - npm ci
34
- - npm test
35
- rules:
36
- - if: $CI_MERGE_REQUEST_ID
37
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
38
-
39
- release:
40
- stage: deploy
41
- extends: .release
42
- rules:
43
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
44
-
45
- npm publish prod:
46
- stage: deploy
47
- script:
48
- - sed -i "s/0.0.0/${CI_COMMIT_TAG:1}/" package.json
49
- - npm ci
50
- - npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
51
- - npm run publish:public
52
- when: manual
53
- rules:
54
- - if: $CI_COMMIT_TAG && $CI_COMMIT_TAG != "latest"
package/.prettierignore DELETED
@@ -1,17 +0,0 @@
1
- # Generated code
2
- src/generated_clients/
3
-
4
- # Examples
5
- examples/
6
-
7
- # Build output
8
- dist/
9
- build/
10
-
11
- # Dependencies
12
- node_modules/
13
-
14
- # Coverage
15
- coverage/
16
- .nyc_output/
17
-
package/eslint.config.js DELETED
@@ -1,47 +0,0 @@
1
- import tseslint from '@typescript-eslint/eslint-plugin';
2
- import tsparser from '@typescript-eslint/parser';
3
-
4
- export default [
5
- {
6
- ignores: [
7
- 'dist/',
8
- 'node_modules/',
9
- 'coverage/',
10
- 'src/generated_clients/',
11
- 'examples/',
12
- '**/*.config.js',
13
- '**/*.config.ts',
14
- ],
15
- },
16
- {
17
- files: ['**/*.ts'],
18
- languageOptions: {
19
- parser: tsparser,
20
- parserOptions: {
21
- ecmaVersion: 2020,
22
- sourceType: 'module',
23
- },
24
- },
25
- plugins: {
26
- '@typescript-eslint': tseslint,
27
- },
28
- rules: {
29
- ...tseslint.configs.recommended.rules,
30
- '@typescript-eslint/explicit-function-return-type': 'off',
31
- '@typescript-eslint/no-explicit-any': 'warn',
32
- '@typescript-eslint/no-unused-vars': [
33
- 'error',
34
- { argsIgnorePattern: '^_' },
35
- ],
36
- 'no-console': ['warn', { allow: ['warn', 'error', 'debug', 'info'] }],
37
- },
38
- },
39
- {
40
- // More lenient rules for test files
41
- files: ['tests/**/*.ts', '**/*.test.ts', '**/*.spec.ts'],
42
- rules: {
43
- '@typescript-eslint/no-explicit-any': 'off'
44
- },
45
- },
46
- ];
47
-
@@ -1,78 +0,0 @@
1
- include:
2
- - project: nosana-ci/tools/cicd/gitlab-ci
3
- file: templates/semver.yml
4
- - project: nosana-ci/tools/cicd/gitlab-ci
5
- file: templates/cacheflush.yml
6
-
7
- variables:
8
- NODE_VERSION: 22
9
- OUTPUT_DIR: .output/public
10
- PURGE_FILE: purge.json
11
-
12
- .npm:
13
- image: node:$NODE_VERSION
14
- cache:
15
- key:
16
- files:
17
- - examples/browser/package-lock.json
18
- paths:
19
- - examples/browser/node_modules
20
- - examples/browser/.npm
21
-
22
- build:
23
- extends: .npm
24
- stage: build
25
- before_script:
26
- - cd examples/browser
27
- script: npm ci --cache .npm --prefer-offline
28
- rules:
29
- - if: $CI_MERGE_REQUEST_ID # merge requests
30
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # main
31
- - if: $DEPLOYMENT_BRANCH && $CI_COMMIT_BRANCH == $DEPLOYMENT_BRANCH # optional deployment branch
32
-
33
- pages:
34
- extends: .npm
35
- stage: deploy
36
- before_script:
37
- - cd examples/browser
38
- script:
39
- - NODE_OPTIONS=--max_old_space_size=25384 npm run generate
40
- - |
41
- if [ -z ${SKIP_CACHEFLUSH} ] && [ -n ${FQDN} ]
42
- then
43
- apt update
44
- apt install -y jq
45
- find $OUTPUT_DIR -type f | sed "s/${OUTPUT_DIR//\//\\/}/https:\/\/$FQDN/g" | jq -R -s -c 'split("\n")[:-1]' > ../../$PURGE_FILE
46
- fi
47
- - mv $OUTPUT_DIR ../../public
48
- artifacts:
49
- paths:
50
- - public
51
- - $PURGE_FILE
52
- rules:
53
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $AUTO_DEPLOY != null # main
54
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $AUTO_DEPLOY == null # main
55
- when: manual
56
- - if: $DEPLOYMENT_BRANCH && $CI_COMMIT_BRANCH == $DEPLOYMENT_BRANCH && $AUTO_DEPLOY != null # deployment branch
57
- - if: $DEPLOYMENT_BRANCH && $CI_COMMIT_BRANCH == $DEPLOYMENT_BRANCH && $AUTO_DEPLOY == null # deployment branch
58
- when: manual
59
-
60
- release:
61
- extends: .release
62
- stage: .post
63
- rules:
64
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # main
65
- - if: $DEPLOYMENT_BRANCH && $CI_COMMIT_BRANCH == $DEPLOYMENT_BRANCH # optional deployment branch
66
-
67
- gitlab-release:
68
- extends: .gitlab-release
69
- stage: .post
70
-
71
- cacheflush:
72
- extends: .cacheflush
73
- stage: .post
74
- rules:
75
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # main
76
- - if: $DEPLOYMENT_BRANCH && $CI_COMMIT_BRANCH == $DEPLOYMENT_BRANCH # optional deployment branch
77
-
78
-
@@ -1,141 +0,0 @@
1
- # Nosana SDK Browser Playground - Features
2
-
3
- This interactive documentation site provides a comprehensive testing environment for the Nosana SDK with the following features:
4
-
5
- ## 🎯 Core Features
6
-
7
- ### 1. **Interactive SDK Testing**
8
- - Test all major SDK functions through a user-friendly web interface
9
- - No need to write code - just click buttons and see results
10
- - Perfect for developers learning the SDK or testing specific functionality
11
-
12
- ### 2. **Network Management**
13
- - **Mainnet/Devnet Switching**: Easily switch between networks with a dropdown
14
- - **Connection Status**: Real-time connection indicator
15
- - **Automatic Reinitialization**: SDK automatically reinitializes when switching networks
16
-
17
- ### 3. **Job Operations**
18
- - **Individual Job Retrieval**: Get detailed information about specific jobs by address
19
- - **Bulk Job Fetching**: Retrieve multiple jobs with optional filtering
20
- - **State Filtering**: Filter jobs by state (Queued, Running, Stopped, Done)
21
- - **Limit Control**: Control how many jobs to fetch (1-100)
22
-
23
- ### 4. **Market Operations**
24
- - **Market Discovery**: Retrieve all available markets
25
- - **Market Details**: View pricing, timeouts, and configuration
26
- - **Market Monitoring**: Real-time updates for market changes
27
-
28
- ### 5. **Real-time Monitoring**
29
- - **WebSocket Subscriptions**: Live updates for account changes
30
- - **Multi-Account Types**: Monitor jobs, runs, and markets simultaneously
31
- - **Automatic Reconnection**: Handles connection failures gracefully
32
- - **Error Reporting**: Clear error messages and recovery
33
-
34
- ## 🖥️ User Interface Features
35
-
36
- ### 1. **Terminal-style Output**
37
- - **Color-coded Logs**: Different colors for info, success, error, and warning messages
38
- - **Timestamps**: Every log entry includes a timestamp
39
- - **Auto-scroll**: Optional automatic scrolling to latest entries
40
- - **Log Management**: Clear logs button for fresh starts
41
-
42
- ### 2. **Responsive Design**
43
- - **Mobile-friendly**: Works on phones, tablets, and desktops
44
- - **Grid Layout**: Adaptive layout that works on all screen sizes
45
- - **Modern UI**: Clean, professional interface using Tailwind CSS
46
-
47
- ### 3. **Interactive Controls**
48
- - **Form Validation**: Input validation and error handling
49
- - **Loading States**: Visual feedback during operations
50
- - **Disabled States**: Buttons disabled during loading to prevent conflicts
51
- - **Status Indicators**: Visual indicators for connection and monitoring status
52
-
53
- ## 🔧 Technical Features
54
-
55
- ### 1. **Modern Web Technologies**
56
- - **Nuxt 3**: Latest Vue.js framework for optimal performance
57
- - **Vue 3 Composition API**: Modern reactive programming
58
- - **TypeScript Support**: Full type safety and IntelliSense
59
- - **Hot Module Replacement**: Instant updates during development
60
-
61
- ### 2. **Blockchain Integration**
62
- - **Solana SDK Integration**: Full compatibility with Solana blockchain
63
- - **WASM Support**: WebAssembly support for cryptographic operations
64
- - **Address Validation**: Proper Solana address handling
65
- - **Error Handling**: Comprehensive blockchain error handling
66
-
67
- ### 3. **Development Experience**
68
- - **Fast Builds**: Optimized build process with Vite
69
- - **Development Server**: Hot reload for rapid development
70
- - **Dependency Optimization**: Pre-bundled dependencies for faster loading
71
- - **SSR Disabled**: Client-side rendering for better SDK compatibility
72
-
73
- ## 📊 Monitoring Capabilities
74
-
75
- ### 1. **Account Monitoring**
76
- - **Job Accounts**: Monitor job state changes, node assignments, and completion
77
- - **Run Accounts**: Track job execution and node performance
78
- - **Market Accounts**: Watch for pricing and configuration changes
79
-
80
- ### 2. **Real-time Updates**
81
- - **Live Data**: Updates appear immediately as they happen on-chain
82
- - **Detailed Information**: Full account data with formatted display
83
- - **Historical View**: All updates are logged and preserved during session
84
-
85
- ### 3. **Error Handling**
86
- - **Connection Recovery**: Automatic reconnection on WebSocket failures
87
- - **Error Classification**: Different error types with appropriate handling
88
- - **User Feedback**: Clear error messages and recovery suggestions
89
-
90
- ## 🎨 User Experience Features
91
-
92
- ### 1. **Intuitive Interface**
93
- - **Logical Grouping**: Related functions grouped in clear sections
94
- - **Progressive Disclosure**: Advanced options available but not overwhelming
95
- - **Visual Hierarchy**: Clear information hierarchy with proper typography
96
-
97
- ### 2. **Helpful Defaults**
98
- - **Example Data**: Pre-filled example job addresses for testing
99
- - **Sensible Limits**: Default limits that work well for most use cases
100
- - **Network Selection**: Starts with devnet for safer testing
101
-
102
- ### 3. **Documentation Integration**
103
- - **Inline Help**: Helpful descriptions and tooltips
104
- - **Example Usage**: Clear examples of how to use each feature
105
- - **Troubleshooting**: Built-in error handling and user guidance
106
-
107
- ## 🚀 Performance Features
108
-
109
- ### 1. **Optimized Loading**
110
- - **Dynamic Imports**: SDK loaded only when needed
111
- - **Code Splitting**: Efficient bundle splitting for faster initial load
112
- - **Dependency Optimization**: Pre-bundled common dependencies
113
-
114
- ### 2. **Efficient Updates**
115
- - **Reactive State**: Efficient state management with Vue 3 reactivity
116
- - **Minimal Re-renders**: Optimized component updates
117
- - **Memory Management**: Proper cleanup of WebSocket connections
118
-
119
- ### 3. **Browser Compatibility**
120
- - **Modern Browsers**: Optimized for Chrome, Firefox, Safari, Edge
121
- - **WebSocket Support**: Fallback handling for connection issues
122
- - **WASM Support**: WebAssembly for cryptographic operations
123
-
124
- ## 📱 Accessibility Features
125
-
126
- ### 1. **Keyboard Navigation**
127
- - **Tab Order**: Logical tab order through interface elements
128
- - **Keyboard Shortcuts**: Standard keyboard interactions
129
- - **Focus Management**: Clear focus indicators
130
-
131
- ### 2. **Screen Reader Support**
132
- - **Semantic HTML**: Proper HTML structure for screen readers
133
- - **ARIA Labels**: Appropriate ARIA labels for interactive elements
134
- - **Status Updates**: Screen reader announcements for status changes
135
-
136
- ### 3. **Visual Accessibility**
137
- - **Color Contrast**: High contrast colors for readability
138
- - **Font Sizes**: Readable font sizes across all devices
139
- - **Visual Indicators**: Multiple ways to convey information (not just color)
140
-
141
- This playground serves as both a learning tool for developers new to the Nosana SDK and a testing environment for experienced developers working with the platform.
@@ -1,76 +0,0 @@
1
- # Quick Start Guide
2
-
3
- Get the Nosana SDK Browser Playground running in under 2 minutes!
4
-
5
- ## 🚀 One-Command Start
6
-
7
- ```bash
8
- cd examples/browser && ./start.sh
9
- ```
10
-
11
- That's it! The script will:
12
- - ✅ Check your Node.js version
13
- - 📦 Install dependencies if needed
14
- - 🌐 Start the development server
15
- - 🎯 Open at http://localhost:3000
16
-
17
- ## 📋 What You'll See
18
-
19
- When you open the playground, you'll find:
20
-
21
- ### Left Panel - Controls
22
- 1. **SDK Initialization** - Network selection and connection testing
23
- 2. **Job Operations** - Get individual jobs or browse all jobs with filters
24
- 3. **Market Operations** - Explore available markets
25
- 4. **Real-time Monitoring** - Watch live blockchain updates
26
- 5. **Clear Logs** - Reset the terminal output
27
-
28
- ### Right Panel - Terminal Output
29
- - 🖥️ Terminal-style logging with timestamps
30
- - 🎨 Color-coded messages (info, success, error, warning)
31
- - 📜 Auto-scroll toggle
32
- - 📊 Line counter
33
-
34
- ## 🎯 Try These First
35
-
36
- 1. **Test Connection**: Click "Test Connection" to verify everything works
37
- 2. **Get a Job**: Use the pre-filled job address and click "Get Job"
38
- 3. **Browse Markets**: Click "Get All Markets" to see available markets
39
- 4. **Start Monitoring**: Click "Start Monitoring" to see live updates
40
-
41
- ## 🔧 Troubleshooting
42
-
43
- ### Port Already in Use?
44
- ```bash
45
- # Kill any process using port 3000
46
- npx kill-port 3000
47
- # Then restart
48
- npm run dev
49
- ```
50
-
51
- ### Dependencies Issues?
52
- ```bash
53
- # Clean install
54
- rm -rf node_modules package-lock.json
55
- npm install
56
- ```
57
-
58
- ### SDK Errors?
59
- - Check your internet connection
60
- - Try switching networks (Mainnet ↔ Devnet)
61
- - Look at browser console for detailed errors
62
-
63
- ## 📚 Next Steps
64
-
65
- - Read the full [README.md](./README.md) for detailed usage
66
- - Check [FEATURES.md](./FEATURES.md) for complete feature list
67
- - Explore the [source code](./app.vue) to understand implementation
68
-
69
- ## 🆘 Need Help?
70
-
71
- - Check browser console for errors
72
- - Verify Node.js version (20.18.0+)
73
- - Ensure stable internet connection
74
- - Try different networks if one fails
75
-
76
- Happy testing! 🎉
@@ -1,182 +0,0 @@
1
- # Nosana SDK Browser Playground
2
-
3
- An interactive documentation and testing environment for the Nosana SDK built with Nuxt 3. This playground allows you to test SDK functionality directly in your browser with a beautiful, modern interface.
4
-
5
- ## Features
6
-
7
- - 🚀 **Interactive SDK Testing**: Test all major SDK functions with a user-friendly interface
8
- - 🌐 **Network Switching**: Easily switch between Mainnet and Devnet
9
- - 📊 **Real-time Monitoring**: Monitor job, run, and market account updates in real-time
10
- - 🖥️ **Terminal-style Logging**: Beautiful terminal-like output for all operations
11
- - 📱 **Responsive Design**: Works on desktop and mobile devices
12
- - ⚡ **Fast Development**: Hot reload and modern development experience
13
-
14
- ## Available Operations
15
-
16
- ### SDK Initialization
17
- - Initialize the Nosana SDK for different networks
18
- - Test connection to Solana RPC endpoints
19
- - View configuration details
20
-
21
- ### Job Operations
22
- - **Get Job by Address**: Retrieve detailed information about a specific job
23
- - **Get All Jobs with Filters**: Fetch multiple jobs with optional state filtering
24
- - **Real-time Job Monitoring**: Watch for job account updates
25
-
26
- ### Market Operations
27
- - **Get All Markets**: Retrieve all available markets
28
- - **Market Monitoring**: Watch for market account updates
29
-
30
- ### Real-time Monitoring
31
- - **WebSocket Subscriptions**: Real-time updates for job, run, and market accounts
32
- - **Error Handling**: Automatic reconnection and error reporting
33
- - **Live Logging**: See updates as they happen
34
-
35
- ## Getting Started
36
-
37
- ### Prerequisites
38
-
39
- - Node.js 20.18.0 or higher
40
- - npm or yarn
41
-
42
- ### Installation
43
-
44
- 1. Navigate to the browser example directory:
45
- ```bash
46
- cd examples/browser
47
- ```
48
-
49
- 2. Install dependencies:
50
- ```bash
51
- npm install
52
- ```
53
-
54
- 3. Start the development server:
55
- ```bash
56
- npm run dev
57
- ```
58
-
59
- 4. Open your browser and navigate to `http://localhost:3000`
60
-
61
- ## Usage Guide
62
-
63
- ### 1. Network Selection
64
- - Use the network dropdown in the header to switch between Mainnet and Devnet
65
- - The SDK will automatically reinitialize when you change networks
66
- - Connection status is displayed with a colored indicator
67
-
68
- ### 2. Testing SDK Functions
69
-
70
- #### Get Job by Address
71
- 1. Enter a valid job address in the input field (default example provided)
72
- 2. Click "Get Job" to retrieve job details
73
- 3. View the results in the terminal output
74
-
75
- #### Get All Jobs with Filters
76
- 1. Optionally select a job state filter (Queued, Running, Stopped, Done)
77
- 2. Set a limit for the number of jobs to retrieve (default: 10)
78
- 3. Click "Get Jobs" to fetch filtered results
79
-
80
- #### Get All Markets
81
- 1. Click "Get All Markets" to retrieve all available markets
82
- 2. View market details including pricing and configuration
83
-
84
- ### 3. Real-time Monitoring
85
- 1. Click "Start Monitoring" to begin real-time account monitoring
86
- 2. The system will watch for updates to job, run, and market accounts
87
- 3. Updates will appear in the terminal as they happen
88
- 4. Click "Stop Monitoring" to end the monitoring session
89
-
90
- ### 4. Terminal Output
91
- - All operations log their results to the terminal-style output panel
92
- - Different log types are color-coded:
93
- - 🔵 **Info**: General information (blue)
94
- - ✅ **Success**: Successful operations (green)
95
- - ❌ **Error**: Errors and failures (red)
96
- - ⚠️ **Warning**: Warnings and notices (yellow)
97
- - Use "Auto-scroll: ON/OFF" to control automatic scrolling
98
- - Click "Clear Logs" to reset the terminal
99
-
100
- ## Example Job Addresses
101
-
102
- For testing purposes, you can use these example job addresses:
103
-
104
- **Mainnet:**
105
- - `BwBURHTRMM3Ckzo2Dzmw99hv6gV8Ve12b6iw4sm9qeyR`
106
-
107
- **Devnet:**
108
- - Check the latest jobs using the "Get All Jobs" function
109
-
110
- ## Development
111
-
112
- ### Project Structure
113
-
114
- ```
115
- examples/browser/
116
- ├── app.vue # Main application component
117
- ├── nuxt.config.ts # Nuxt configuration
118
- ├── assets/css/main.css # Custom styles and Tailwind
119
- ├── package.json # Dependencies and scripts
120
- └── README.md # This file
121
- ```
122
-
123
- ### Key Technologies
124
-
125
- - **Nuxt 3**: Vue.js framework for the frontend
126
- - **Tailwind CSS**: Utility-first CSS framework for styling
127
- - **@nosana/kit**: The Nosana SDK for blockchain interactions
128
- - **Vue 3 Composition API**: Modern Vue.js reactive programming
129
-
130
- ### Configuration
131
-
132
- The application is configured to:
133
- - Disable SSR for better Solana SDK compatibility
134
- - Enable WASM support for blockchain operations
135
- - Optimize dependencies for faster loading
136
- - Use Tailwind CSS for styling
137
-
138
- ## Troubleshooting
139
-
140
- ### Common Issues
141
-
142
- 1. **SDK Initialization Fails**
143
- - Check your internet connection
144
- - Verify the selected network is accessible
145
- - Check browser console for detailed error messages
146
-
147
- 2. **Job Not Found**
148
- - Ensure the job address is valid and exists on the selected network
149
- - Try switching networks if the job exists on a different network
150
-
151
- 3. **Monitoring Connection Issues**
152
- - WebSocket connections may fail due to network issues
153
- - The system will automatically attempt to reconnect
154
- - Check the terminal output for connection status
155
-
156
- ### Browser Compatibility
157
-
158
- This playground works best with modern browsers that support:
159
- - WebSockets
160
- - ES2020+ JavaScript features
161
- - WebAssembly (WASM)
162
-
163
- ## Contributing
164
-
165
- To contribute to this example:
166
-
167
- 1. Fork the repository
168
- 2. Create a feature branch
169
- 3. Make your changes
170
- 4. Test thoroughly
171
- 5. Submit a pull request
172
-
173
- ## License
174
-
175
- This example is part of the Nosana SDK and follows the same MIT license.
176
-
177
- ## Support
178
-
179
- For support and questions:
180
- - Check the main Nosana SDK documentation
181
- - Open an issue in the repository
182
- - Join the Nosana community channels