n8n-nodes-bittensor 1.0.0
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/LICENSE +46 -0
- package/README.md +329 -0
- package/dist/credentials/BittensorApi.credentials.d.ts +8 -0
- package/dist/credentials/BittensorApi.credentials.js +75 -0
- package/dist/credentials/BittensorApi.credentials.js.map +1 -0
- package/dist/credentials/BittensorNetwork.credentials.d.ts +8 -0
- package/dist/credentials/BittensorNetwork.credentials.js +117 -0
- package/dist/credentials/BittensorNetwork.credentials.js.map +1 -0
- package/dist/credentials/SubnetCredentials.credentials.d.ts +8 -0
- package/dist/credentials/SubnetCredentials.credentials.js +81 -0
- package/dist/credentials/SubnetCredentials.credentials.js.map +1 -0
- package/dist/nodes/Bittensor/Bittensor.node.d.ts +5 -0
- package/dist/nodes/Bittensor/Bittensor.node.js +938 -0
- package/dist/nodes/Bittensor/Bittensor.node.js.map +1 -0
- package/dist/nodes/Bittensor/bittensor.svg +4 -0
- package/dist/nodes/Bittensor/constants/hyperparameters.d.ts +23 -0
- package/dist/nodes/Bittensor/constants/hyperparameters.js +127 -0
- package/dist/nodes/Bittensor/constants/hyperparameters.js.map +1 -0
- package/dist/nodes/Bittensor/constants/networks.d.ts +31 -0
- package/dist/nodes/Bittensor/constants/networks.js +54 -0
- package/dist/nodes/Bittensor/constants/networks.js.map +1 -0
- package/dist/nodes/Bittensor/constants/pallets.d.ts +73 -0
- package/dist/nodes/Bittensor/constants/pallets.js +99 -0
- package/dist/nodes/Bittensor/constants/pallets.js.map +1 -0
- package/dist/nodes/Bittensor/constants/subnets.d.ts +25 -0
- package/dist/nodes/Bittensor/constants/subnets.js +55 -0
- package/dist/nodes/Bittensor/constants/subnets.js.map +1 -0
- package/dist/nodes/Bittensor/transport/metagraphSync.d.ts +63 -0
- package/dist/nodes/Bittensor/transport/metagraphSync.js +153 -0
- package/dist/nodes/Bittensor/transport/metagraphSync.js.map +1 -0
- package/dist/nodes/Bittensor/transport/queryClient.d.ts +93 -0
- package/dist/nodes/Bittensor/transport/queryClient.js +144 -0
- package/dist/nodes/Bittensor/transport/queryClient.js.map +1 -0
- package/dist/nodes/Bittensor/transport/subtensorClient.d.ts +138 -0
- package/dist/nodes/Bittensor/transport/subtensorClient.js +414 -0
- package/dist/nodes/Bittensor/transport/subtensorClient.js.map +1 -0
- package/dist/nodes/Bittensor/transport/taostatsApi.d.ts +133 -0
- package/dist/nodes/Bittensor/transport/taostatsApi.js +139 -0
- package/dist/nodes/Bittensor/transport/taostatsApi.js.map +1 -0
- package/dist/nodes/Bittensor/utils/addressUtils.d.ts +25 -0
- package/dist/nodes/Bittensor/utils/addressUtils.js +70 -0
- package/dist/nodes/Bittensor/utils/addressUtils.js.map +1 -0
- package/dist/nodes/Bittensor/utils/metagraphUtils.d.ts +103 -0
- package/dist/nodes/Bittensor/utils/metagraphUtils.js +113 -0
- package/dist/nodes/Bittensor/utils/metagraphUtils.js.map +1 -0
- package/dist/nodes/Bittensor/utils/unitConverter.d.ts +48 -0
- package/dist/nodes/Bittensor/utils/unitConverter.js +109 -0
- package/dist/nodes/Bittensor/utils/unitConverter.js.map +1 -0
- package/dist/nodes/Bittensor/utils/weightUtils.d.ts +49 -0
- package/dist/nodes/Bittensor/utils/weightUtils.js +90 -0
- package/dist/nodes/Bittensor/utils/weightUtils.js.map +1 -0
- package/package.json +87 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
License text copyright (c) 2017 MariaDB Corporation Ab.
|
|
4
|
+
|
|
5
|
+
Licensor:
|
|
6
|
+
Velocity BPA, LLC
|
|
7
|
+
https://velobpa.com
|
|
8
|
+
|
|
9
|
+
Licensed Work:
|
|
10
|
+
This repository and all source code, documentation, and associated artifacts
|
|
11
|
+
contained herein, including all n8n community nodes published by Velocity BPA.
|
|
12
|
+
|
|
13
|
+
Additional Use Grant:
|
|
14
|
+
You may use, modify, and run the Licensed Work free of charge for:
|
|
15
|
+
- Personal use
|
|
16
|
+
- Educational use
|
|
17
|
+
- Research use
|
|
18
|
+
- Internal business use, provided such use does not involve resale,
|
|
19
|
+
redistribution, or offering the Licensed Work as part of a commercial
|
|
20
|
+
product or service.
|
|
21
|
+
|
|
22
|
+
Commercial Use Restriction:
|
|
23
|
+
Commercial Use of the Licensed Work is prohibited without a valid
|
|
24
|
+
Commercial License issued by the Licensor.
|
|
25
|
+
|
|
26
|
+
Commercial Use includes, but is not limited to:
|
|
27
|
+
- Use of the Licensed Work within any Software-as-a-Service (SaaS),
|
|
28
|
+
Platform-as-a-Service (PaaS), or hosted application that is sold,
|
|
29
|
+
licensed, or monetized in any form
|
|
30
|
+
- Offering the Licensed Work as part of a managed services engagement
|
|
31
|
+
- Bundling or redistributing the Licensed Work with a paid product
|
|
32
|
+
- Reselling, sublicensing, or white-labeling the Licensed Work
|
|
33
|
+
- Embedding the Licensed Work into any commercial automation platform,
|
|
34
|
+
integration product, or solution offering
|
|
35
|
+
|
|
36
|
+
Change Date:
|
|
37
|
+
January 1, 2030
|
|
38
|
+
|
|
39
|
+
Change License:
|
|
40
|
+
Apache License, Version 2.0
|
|
41
|
+
|
|
42
|
+
For commercial licensing inquiries:
|
|
43
|
+
licensing@velobpa.com
|
|
44
|
+
|
|
45
|
+
Business Source License 1.1 full text:
|
|
46
|
+
https://mariadb.com/bsl11/
|
package/README.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# n8n-nodes-bittensor
|
|
2
|
+
|
|
3
|
+
> [!IMPORTANT]
|
|
4
|
+
> **[Velocity BPA Licensing Notice]**
|
|
5
|
+
>
|
|
6
|
+
> This n8n node is licensed under the Business Source License 1.1 (BSL 1.1).
|
|
7
|
+
>
|
|
8
|
+
> Use of this node by for-profit organizations in production environments requires a commercial license from Velocity BPA.
|
|
9
|
+
>
|
|
10
|
+
> For licensing information, visit https://velobpa.com/licensing or contact licensing@velobpa.com.
|
|
11
|
+
|
|
12
|
+
A comprehensive n8n community node package for the **Bittensor** blockchain network. This marketplace-ready toolkit enables seamless integration with the Bittensor decentralized AI network, supporting TAO staking, delegation, subnet queries, validator operations, and AI network interactions.
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+

|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
### 16 Resource Categories with 80+ Operations
|
|
22
|
+
|
|
23
|
+
| Resource | Description |
|
|
24
|
+
|----------|-------------|
|
|
25
|
+
| **Wallet** | Balance queries, TAO transfers, address validation, transaction history |
|
|
26
|
+
| **Staking** | Stake management, APY calculations, delegation tracking |
|
|
27
|
+
| **Delegation** | Delegate discovery, take rates, nominator management |
|
|
28
|
+
| **Subnet** | Subnet info, hyperparameters, neuron lists, registration costs |
|
|
29
|
+
| **Neuron** | UID/hotkey lookups, active neuron discovery, performance metrics |
|
|
30
|
+
| **Registration** | Burned registration, cost queries, status checks |
|
|
31
|
+
| **Validator** | Validator info, weights, bonds, performance metrics |
|
|
32
|
+
| **Miner** | Miner info, axon endpoints, incentives, trust scores |
|
|
33
|
+
| **Metagraph** | Full/lite metagraph sync, UIDs, hotkeys, stake matrices |
|
|
34
|
+
| **Weights** | Weight queries, setting, validation, commit/reveal |
|
|
35
|
+
| **Query** | AI subnet queries, text/image generation, custom inference |
|
|
36
|
+
| **Root** | Root network info, senate, emission schedules |
|
|
37
|
+
| **Governance** | Proposals, voting, senate management |
|
|
38
|
+
| **Block** | Block queries, chain info, event monitoring |
|
|
39
|
+
| **Emission** | Supply stats, emission distribution, halving schedules |
|
|
40
|
+
| **Utility** | RAO/TAO conversion, address encoding, mnemonic generation |
|
|
41
|
+
|
|
42
|
+
### Three Credential Types
|
|
43
|
+
|
|
44
|
+
1. **Bittensor Network** - Subtensor connection with coldkey/hotkey support
|
|
45
|
+
2. **Bittensor API** - Taostats and explorer API integration
|
|
46
|
+
3. **Subnet Credentials** - Subnet-specific endpoints and model access
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
### Community Nodes (Recommended)
|
|
51
|
+
|
|
52
|
+
1. Open your n8n instance
|
|
53
|
+
2. Go to **Settings** → **Community Nodes**
|
|
54
|
+
3. Click **Install a community node**
|
|
55
|
+
4. Enter `n8n-nodes-bittensor`
|
|
56
|
+
5. Click **Install**
|
|
57
|
+
|
|
58
|
+
### Manual Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Navigate to n8n custom nodes directory
|
|
62
|
+
cd ~/.n8n/custom
|
|
63
|
+
|
|
64
|
+
# Clone or extract the package
|
|
65
|
+
git clone https://github.com/Velocity-BPA/n8n-nodes-bittensor.git
|
|
66
|
+
cd n8n-nodes-bittensor
|
|
67
|
+
|
|
68
|
+
# Install dependencies and build
|
|
69
|
+
npm install
|
|
70
|
+
npm run build
|
|
71
|
+
|
|
72
|
+
# Restart n8n
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Development Installation
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Extract the zip file
|
|
79
|
+
unzip n8n-nodes-bittensor.zip
|
|
80
|
+
cd n8n-nodes-bittensor
|
|
81
|
+
|
|
82
|
+
# Install dependencies
|
|
83
|
+
npm install
|
|
84
|
+
|
|
85
|
+
# Build the project
|
|
86
|
+
npm run build
|
|
87
|
+
|
|
88
|
+
# Create symlink to n8n custom nodes directory
|
|
89
|
+
mkdir -p ~/.n8n/custom
|
|
90
|
+
ln -s $(pwd) ~/.n8n/custom/n8n-nodes-bittensor
|
|
91
|
+
|
|
92
|
+
# Restart n8n
|
|
93
|
+
n8n start
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Credentials Setup
|
|
97
|
+
|
|
98
|
+
### Bittensor Network Credentials
|
|
99
|
+
|
|
100
|
+
| Field | Description |
|
|
101
|
+
|-------|-------------|
|
|
102
|
+
| Network | Select network (Finney, Testnet, Local, Custom) |
|
|
103
|
+
| WebSocket Endpoint | Custom WebSocket URL (for custom network) |
|
|
104
|
+
| Authentication Type | Read Only, Coldkey, Hotkey, or Both |
|
|
105
|
+
| Coldkey Mnemonic | 12/24 word mnemonic for main wallet |
|
|
106
|
+
| Hotkey Mnemonic | 12/24 word mnemonic for operational key |
|
|
107
|
+
|
|
108
|
+
### Bittensor API Credentials
|
|
109
|
+
|
|
110
|
+
| Field | Description |
|
|
111
|
+
|-------|-------------|
|
|
112
|
+
| API Provider | Taostats, Bittensor Explorer, or Custom |
|
|
113
|
+
| API Key | API key for the provider |
|
|
114
|
+
| Rate Limit | Maximum requests per second |
|
|
115
|
+
|
|
116
|
+
### Subnet Credentials
|
|
117
|
+
|
|
118
|
+
| Field | Description |
|
|
119
|
+
|-------|-------------|
|
|
120
|
+
| Subnet | Select known subnet or custom |
|
|
121
|
+
| Custom Subnet UID | Netuid for custom subnet |
|
|
122
|
+
| Validator Endpoint | Optional validator endpoint |
|
|
123
|
+
| Miner Endpoint | Optional direct miner endpoint |
|
|
124
|
+
| Query Timeout | Timeout for subnet queries |
|
|
125
|
+
|
|
126
|
+
## Resources & Operations
|
|
127
|
+
|
|
128
|
+
### Wallet Operations
|
|
129
|
+
- **Get Balance** - Query TAO balance for any address
|
|
130
|
+
- **Get Stake** - Get stake amount for coldkey-hotkey pair
|
|
131
|
+
- **Get Overview** - Complete wallet overview with balance and stakes
|
|
132
|
+
- **Transfer** - Send TAO to another address
|
|
133
|
+
- **Validate Address** - Verify Bittensor address format
|
|
134
|
+
- **Get Transfer History** - Transaction history via Taostats API
|
|
135
|
+
|
|
136
|
+
### Staking Operations
|
|
137
|
+
- **Get Stake Info** - Detailed staking information
|
|
138
|
+
- **Add Stake** - Delegate TAO to a validator/hotkey
|
|
139
|
+
- **Remove Stake** - Undelegate TAO from a hotkey
|
|
140
|
+
- **Get Stakes by Coldkey** - All stakes for a coldkey
|
|
141
|
+
- **Calculate APY** - Estimated annual percentage yield
|
|
142
|
+
|
|
143
|
+
### Subnet Operations
|
|
144
|
+
- **Get All Subnets** - List all registered subnets
|
|
145
|
+
- **Get Subnet Info** - Detailed subnet information
|
|
146
|
+
- **Get Hyperparameters** - Subnet configuration parameters
|
|
147
|
+
- **Get Subnet Neurons** - List neurons in a subnet
|
|
148
|
+
- **Get Registration Cost** - Current burn cost to register
|
|
149
|
+
|
|
150
|
+
### Metagraph Operations
|
|
151
|
+
- **Get Full Metagraph** - Complete metagraph data
|
|
152
|
+
- **Get Metagraph Lite** - Lightweight version (UIDs and hotkeys)
|
|
153
|
+
- **Get UIDs** - All UIDs in a subnet
|
|
154
|
+
- **Get Hotkeys** - All hotkeys in a subnet
|
|
155
|
+
|
|
156
|
+
### Utility Operations
|
|
157
|
+
- **RAO to TAO** - Convert smallest unit to TAO
|
|
158
|
+
- **TAO to RAO** - Convert TAO to RAO
|
|
159
|
+
- **Validate Address** - Check address validity
|
|
160
|
+
- **Generate Mnemonic** - Create new wallet mnemonic
|
|
161
|
+
|
|
162
|
+
## Usage Examples
|
|
163
|
+
|
|
164
|
+
### Check Wallet Balance
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"resource": "wallet",
|
|
169
|
+
"operation": "getBalance",
|
|
170
|
+
"address": "5F3sa2TJAWMqDhXG6jhV4N8ko9SxwGy8TpaNS1repo5EYjQX"
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Get Subnet Info
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"resource": "subnet",
|
|
179
|
+
"operation": "getSubnetInfo",
|
|
180
|
+
"netuid": 1
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Convert RAO to TAO
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"resource": "utility",
|
|
189
|
+
"operation": "raoToTao",
|
|
190
|
+
"amountRao": "1000000000"
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Bittensor Concepts
|
|
195
|
+
|
|
196
|
+
| Term | Description |
|
|
197
|
+
|------|-------------|
|
|
198
|
+
| **TAO** | Native token of Bittensor network |
|
|
199
|
+
| **RAO** | Smallest unit (1 TAO = 10^9 RAO) |
|
|
200
|
+
| **Coldkey** | Main wallet key that holds TAO |
|
|
201
|
+
| **Hotkey** | Operational key for running neurons |
|
|
202
|
+
| **Subnet** | Specialized AI network (netuid) |
|
|
203
|
+
| **Neuron** | Miner or validator on a subnet |
|
|
204
|
+
| **Metagraph** | Network state snapshot |
|
|
205
|
+
| **Axon** | Miner's queryable endpoint |
|
|
206
|
+
| **Tempo** | Epoch length for subnet |
|
|
207
|
+
| **Emission** | TAO rewards distribution |
|
|
208
|
+
|
|
209
|
+
## Networks
|
|
210
|
+
|
|
211
|
+
| Network | WebSocket Endpoint |
|
|
212
|
+
|---------|-------------------|
|
|
213
|
+
| Finney (Mainnet) | wss://entrypoint-finney.opentensor.ai:443 |
|
|
214
|
+
| Testnet | wss://test.finney.opentensor.ai:443 |
|
|
215
|
+
| Local | ws://127.0.0.1:9944 |
|
|
216
|
+
|
|
217
|
+
## Error Handling
|
|
218
|
+
|
|
219
|
+
The node provides descriptive error messages for common issues:
|
|
220
|
+
|
|
221
|
+
- **Connection Errors** - Network unreachable or invalid endpoint
|
|
222
|
+
- **Authentication Errors** - Invalid mnemonic or missing keys
|
|
223
|
+
- **Validation Errors** - Invalid addresses or parameters
|
|
224
|
+
- **Transaction Errors** - Insufficient balance or failed transactions
|
|
225
|
+
|
|
226
|
+
## Security Best Practices
|
|
227
|
+
|
|
228
|
+
1. **Never share mnemonics** - Keep coldkey and hotkey mnemonics secure
|
|
229
|
+
2. **Use read-only mode** - For queries that don't require signing
|
|
230
|
+
3. **Test on testnet first** - Verify workflows before mainnet
|
|
231
|
+
4. **Validate addresses** - Always validate before transfers
|
|
232
|
+
5. **Check registration costs** - Verify burn amounts before registering
|
|
233
|
+
|
|
234
|
+
## Development
|
|
235
|
+
|
|
236
|
+
### Prerequisites
|
|
237
|
+
|
|
238
|
+
- Node.js 18+
|
|
239
|
+
- npm or pnpm
|
|
240
|
+
- n8n installed locally
|
|
241
|
+
|
|
242
|
+
### Setup
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Clone the repository
|
|
246
|
+
git clone https://github.com/Velocity-BPA/n8n-nodes-bittensor.git
|
|
247
|
+
cd n8n-nodes-bittensor
|
|
248
|
+
|
|
249
|
+
# Install dependencies
|
|
250
|
+
npm install
|
|
251
|
+
|
|
252
|
+
# Build the project
|
|
253
|
+
npm run build
|
|
254
|
+
|
|
255
|
+
# Watch for changes
|
|
256
|
+
npm run dev
|
|
257
|
+
|
|
258
|
+
# Lint code
|
|
259
|
+
npm run lint
|
|
260
|
+
|
|
261
|
+
# Run tests
|
|
262
|
+
npm test
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Project Structure
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
n8n-nodes-bittensor/
|
|
269
|
+
├── credentials/ # Credential types
|
|
270
|
+
├── nodes/Bittensor/ # Main node
|
|
271
|
+
│ ├── constants/ # Network configs, subnets
|
|
272
|
+
│ ├── transport/ # API clients
|
|
273
|
+
│ └── utils/ # Helpers
|
|
274
|
+
├── test/ # Test files
|
|
275
|
+
├── scripts/ # Build scripts
|
|
276
|
+
└── package.json
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Author
|
|
280
|
+
|
|
281
|
+
**Velocity BPA**
|
|
282
|
+
|
|
283
|
+
- Website: [velobpa.com](https://velobpa.com)
|
|
284
|
+
- GitHub: [Velocity-BPA](https://github.com/Velocity-BPA)
|
|
285
|
+
|
|
286
|
+
## Licensing
|
|
287
|
+
|
|
288
|
+
This n8n community node is licensed under the **Business Source License 1.1**.
|
|
289
|
+
|
|
290
|
+
### Free Use
|
|
291
|
+
Permitted for personal, educational, research, and internal business use.
|
|
292
|
+
|
|
293
|
+
### Commercial Use
|
|
294
|
+
Use of this node within any SaaS, PaaS, hosted platform, managed service,
|
|
295
|
+
or paid automation offering requires a commercial license.
|
|
296
|
+
|
|
297
|
+
For licensing inquiries:
|
|
298
|
+
**licensing@velobpa.com**
|
|
299
|
+
|
|
300
|
+
See [LICENSE](LICENSE), [COMMERCIAL_LICENSE.md](COMMERCIAL_LICENSE.md), and [LICENSING_FAQ.md](LICENSING_FAQ.md) for details.
|
|
301
|
+
|
|
302
|
+
## Contributing
|
|
303
|
+
|
|
304
|
+
Contributions are welcome! Please:
|
|
305
|
+
|
|
306
|
+
1. Fork the repository
|
|
307
|
+
2. Create a feature branch
|
|
308
|
+
3. Make your changes
|
|
309
|
+
4. Run tests (`npm test`)
|
|
310
|
+
5. Submit a pull request
|
|
311
|
+
|
|
312
|
+
## Support
|
|
313
|
+
|
|
314
|
+
- **Issues**: [GitHub Issues](https://github.com/Velocity-BPA/n8n-nodes-bittensor/issues)
|
|
315
|
+
- **Documentation**: [Bittensor Docs](https://docs.bittensor.com)
|
|
316
|
+
- **Community**: [Bittensor Discord](https://discord.gg/bittensor)
|
|
317
|
+
|
|
318
|
+
## Acknowledgments
|
|
319
|
+
|
|
320
|
+
- [Bittensor](https://bittensor.com) - Decentralized AI Network
|
|
321
|
+
- [n8n](https://n8n.io) - Workflow Automation Platform
|
|
322
|
+
- [Polkadot.js](https://polkadot.js.org) - Substrate/Polkadot API
|
|
323
|
+
- [Taostats](https://taostats.io) - Bittensor Analytics
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
<p align="center">
|
|
328
|
+
Made with ❤️ for the Bittensor Community
|
|
329
|
+
</p>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class BittensorApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BittensorApi = void 0;
|
|
10
|
+
class BittensorApi {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'bittensorApi';
|
|
13
|
+
this.displayName = 'Bittensor API';
|
|
14
|
+
this.documentationUrl = 'https://taostats.io/api';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'API Provider',
|
|
18
|
+
name: 'provider',
|
|
19
|
+
type: 'options',
|
|
20
|
+
options: [
|
|
21
|
+
{
|
|
22
|
+
name: 'Taostats',
|
|
23
|
+
value: 'taostats',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Bittensor Explorer',
|
|
27
|
+
value: 'explorer',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Custom',
|
|
31
|
+
value: 'custom',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
default: 'taostats',
|
|
35
|
+
description: 'The API provider to use',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
displayName: 'API Key',
|
|
39
|
+
name: 'apiKey',
|
|
40
|
+
type: 'string',
|
|
41
|
+
typeOptions: {
|
|
42
|
+
password: true,
|
|
43
|
+
},
|
|
44
|
+
default: '',
|
|
45
|
+
description: 'API key for the selected provider (if required)',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Custom API URL',
|
|
49
|
+
name: 'customUrl',
|
|
50
|
+
type: 'string',
|
|
51
|
+
default: '',
|
|
52
|
+
placeholder: 'https://api.example.com',
|
|
53
|
+
description: 'Custom API endpoint URL',
|
|
54
|
+
displayOptions: {
|
|
55
|
+
show: {
|
|
56
|
+
provider: ['custom'],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Rate Limit (Requests/Second)',
|
|
62
|
+
name: 'rateLimit',
|
|
63
|
+
type: 'number',
|
|
64
|
+
default: 5,
|
|
65
|
+
description: 'Maximum requests per second to avoid rate limiting',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
this.authenticate = {
|
|
69
|
+
type: 'generic',
|
|
70
|
+
properties: {},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.BittensorApi = BittensorApi;
|
|
75
|
+
//# sourceMappingURL=BittensorApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BittensorApi.credentials.js","sourceRoot":"","sources":["../../credentials/BittensorApi.credentials.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAQH,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,eAAe,CAAC;QAC9B,qBAAgB,GAAG,yBAAyB,CAAC;QAC7C,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,UAAU;wBAChB,KAAK,EAAE,UAAU;qBACjB;oBACD;wBACC,IAAI,EAAE,oBAAoB;wBAC1B,KAAK,EAAE,UAAU;qBACjB;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;qBACf;iBACD;gBACD,OAAO,EAAE,UAAU;gBACnB,WAAW,EAAE,yBAAyB;aACtC;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,iDAAiD;aAC9D;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,yBAAyB;gBACtC,WAAW,EAAE,yBAAyB;gBACtC,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,QAAQ,EAAE,CAAC,QAAQ,CAAC;qBACpB;iBACD;aACD;YACD;gBACC,WAAW,EAAE,8BAA8B;gBAC3C,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,oDAAoD;aACjE;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;IACH,CAAC;CAAA;AA9DD,oCA8DC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class BittensorNetwork implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BittensorNetwork = void 0;
|
|
10
|
+
class BittensorNetwork {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'bittensorNetwork';
|
|
13
|
+
this.displayName = 'Bittensor Network';
|
|
14
|
+
this.documentationUrl = 'https://docs.bittensor.com';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Network',
|
|
18
|
+
name: 'network',
|
|
19
|
+
type: 'options',
|
|
20
|
+
options: [
|
|
21
|
+
{
|
|
22
|
+
name: 'Finney (Mainnet)',
|
|
23
|
+
value: 'finney',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Testnet',
|
|
27
|
+
value: 'testnet',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Local',
|
|
31
|
+
value: 'local',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Custom',
|
|
35
|
+
value: 'custom',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
default: 'finney',
|
|
39
|
+
description: 'The Bittensor network to connect to',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
displayName: 'WebSocket Endpoint',
|
|
43
|
+
name: 'wsEndpoint',
|
|
44
|
+
type: 'string',
|
|
45
|
+
default: '',
|
|
46
|
+
placeholder: 'wss://entrypoint-finney.opentensor.ai:443',
|
|
47
|
+
description: 'Custom WebSocket endpoint (required for custom network)',
|
|
48
|
+
displayOptions: {
|
|
49
|
+
show: {
|
|
50
|
+
network: ['custom'],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Authentication Type',
|
|
56
|
+
name: 'authType',
|
|
57
|
+
type: 'options',
|
|
58
|
+
options: [
|
|
59
|
+
{
|
|
60
|
+
name: 'Read Only (No Keys)',
|
|
61
|
+
value: 'readOnly',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Coldkey Only',
|
|
65
|
+
value: 'coldkey',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'Hotkey Only',
|
|
69
|
+
value: 'hotkey',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Both Keys',
|
|
73
|
+
value: 'both',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
default: 'readOnly',
|
|
77
|
+
description: 'Authentication type for transactions',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Coldkey Mnemonic',
|
|
81
|
+
name: 'coldkeyMnemonic',
|
|
82
|
+
type: 'string',
|
|
83
|
+
typeOptions: {
|
|
84
|
+
password: true,
|
|
85
|
+
},
|
|
86
|
+
default: '',
|
|
87
|
+
description: 'The 12 or 24 word mnemonic for the coldkey (main wallet)',
|
|
88
|
+
displayOptions: {
|
|
89
|
+
show: {
|
|
90
|
+
authType: ['coldkey', 'both'],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Hotkey Mnemonic',
|
|
96
|
+
name: 'hotkeyMnemonic',
|
|
97
|
+
type: 'string',
|
|
98
|
+
typeOptions: {
|
|
99
|
+
password: true,
|
|
100
|
+
},
|
|
101
|
+
default: '',
|
|
102
|
+
description: 'The 12 or 24 word mnemonic for the hotkey (operational key)',
|
|
103
|
+
displayOptions: {
|
|
104
|
+
show: {
|
|
105
|
+
authType: ['hotkey', 'both'],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
this.authenticate = {
|
|
111
|
+
type: 'generic',
|
|
112
|
+
properties: {},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.BittensorNetwork = BittensorNetwork;
|
|
117
|
+
//# sourceMappingURL=BittensorNetwork.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BittensorNetwork.credentials.js","sourceRoot":"","sources":["../../credentials/BittensorNetwork.credentials.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAQH,MAAa,gBAAgB;IAA7B;QACC,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GAAG,mBAAmB,CAAC;QAClC,qBAAgB,GAAG,4BAA4B,CAAC;QAChD,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,kBAAkB;wBACxB,KAAK,EAAE,QAAQ;qBACf;oBACD;wBACC,IAAI,EAAE,SAAS;wBACf,KAAK,EAAE,SAAS;qBAChB;oBACD;wBACC,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,OAAO;qBACd;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;qBACf;iBACD;gBACD,OAAO,EAAE,QAAQ;gBACjB,WAAW,EAAE,qCAAqC;aAClD;YACD;gBACC,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,2CAA2C;gBACxD,WAAW,EAAE,yDAAyD;gBACtE,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,OAAO,EAAE,CAAC,QAAQ,CAAC;qBACnB;iBACD;aACD;YACD;gBACC,WAAW,EAAE,qBAAqB;gBAClC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,qBAAqB;wBAC3B,KAAK,EAAE,UAAU;qBACjB;oBACD;wBACC,IAAI,EAAE,cAAc;wBACpB,KAAK,EAAE,SAAS;qBAChB;oBACD;wBACC,IAAI,EAAE,aAAa;wBACnB,KAAK,EAAE,QAAQ;qBACf;oBACD;wBACC,IAAI,EAAE,WAAW;wBACjB,KAAK,EAAE,MAAM;qBACb;iBACD;gBACD,OAAO,EAAE,UAAU;gBACnB,WAAW,EAAE,sCAAsC;aACnD;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,0DAA0D;gBACvE,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;qBAC7B;iBACD;aACD;YACD;gBACC,WAAW,EAAE,iBAAiB;gBAC9B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,6DAA6D;gBAC1E,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;qBAC5B;iBACD;aACD;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE,EAAE;SACd,CAAC;IACH,CAAC;CAAA;AAxGD,4CAwGC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class SubnetCredentials implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.SubnetCredentials = void 0;
|
|
10
|
+
class SubnetCredentials {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.name = 'subnetCredentials';
|
|
13
|
+
this.displayName = 'Bittensor Subnet';
|
|
14
|
+
this.documentationUrl = 'https://docs.bittensor.com';
|
|
15
|
+
this.properties = [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Subnet',
|
|
18
|
+
name: 'subnet',
|
|
19
|
+
type: 'options',
|
|
20
|
+
options: [
|
|
21
|
+
{ name: 'SN1 - Text Prompting', value: '1' },
|
|
22
|
+
{ name: 'SN2 - Machine Translation', value: '2' },
|
|
23
|
+
{ name: 'SN3 - Data Scraping', value: '3' },
|
|
24
|
+
{ name: 'SN4 - Multi-Modality', value: '4' },
|
|
25
|
+
{ name: 'SN5 - Image Generation', value: '5' },
|
|
26
|
+
{ name: 'SN8 - Time Series Prediction', value: '8' },
|
|
27
|
+
{ name: 'SN9 - Pretraining', value: '9' },
|
|
28
|
+
{ name: 'SN11 - Text-to-Speech', value: '11' },
|
|
29
|
+
{ name: 'SN13 - Data Universe', value: '13' },
|
|
30
|
+
{ name: 'SN18 - Cortex.t', value: '18' },
|
|
31
|
+
{ name: 'SN19 - Vision', value: '19' },
|
|
32
|
+
{ name: 'SN21 - FileTAO', value: '21' },
|
|
33
|
+
{ name: 'Custom', value: 'custom' },
|
|
34
|
+
],
|
|
35
|
+
default: '1',
|
|
36
|
+
description: 'The subnet to interact with',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Custom Subnet UID',
|
|
40
|
+
name: 'customNetuid',
|
|
41
|
+
type: 'number',
|
|
42
|
+
default: 1,
|
|
43
|
+
description: 'Custom subnet UID (netuid)',
|
|
44
|
+
displayOptions: {
|
|
45
|
+
show: {
|
|
46
|
+
subnet: ['custom'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Validator Endpoint',
|
|
52
|
+
name: 'validatorEndpoint',
|
|
53
|
+
type: 'string',
|
|
54
|
+
default: '',
|
|
55
|
+
placeholder: 'http://validator.example.com:8080',
|
|
56
|
+
description: 'Optional validator endpoint for queries',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Miner Endpoint',
|
|
60
|
+
name: 'minerEndpoint',
|
|
61
|
+
type: 'string',
|
|
62
|
+
default: '',
|
|
63
|
+
placeholder: 'http://miner.example.com:8091',
|
|
64
|
+
description: 'Optional direct miner endpoint',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Query Timeout (Seconds)',
|
|
68
|
+
name: 'queryTimeout',
|
|
69
|
+
type: 'number',
|
|
70
|
+
default: 30,
|
|
71
|
+
description: 'Timeout for subnet queries',
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
this.authenticate = {
|
|
75
|
+
type: 'generic',
|
|
76
|
+
properties: {},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.SubnetCredentials = SubnetCredentials;
|
|
81
|
+
//# sourceMappingURL=SubnetCredentials.credentials.js.map
|