qvtx-developer-kit 1.0.0 → 1.1.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/.env.example +108 -0
- package/README.md +0 -0
- package/abis/QVTXBridge.json +273 -0
- package/abis/QVTXGovernance.json +267 -0
- package/abis/QVTXNFT.json +370 -0
- package/abis/QVTXRewards.json +155 -0
- package/abis/QVTXToken.json +311 -0
- package/abis/QVTXVesting.json +216 -0
- package/abis/index.js +15 -0
- package/bin/qvtx-developer-cli.js +99 -0
- package/config/index.js +108 -0
- package/config/networks.js +247 -0
- package/examples/basic-usage.js +39 -0
- package/examples/bridge-example.js +123 -0
- package/examples/governance-example.js +140 -0
- package/examples/nft-example.js +141 -0
- package/examples/staking-example.js +96 -0
- package/index.js +145 -0
- package/languages/blockchain_ai_sdk.js +0 -0
- package/languages/node_sdk.js +0 -0
- package/languages/solana_sdk.js +383 -0
- package/package.json +28 -3
- package/rewards/index.js +71 -0
- package/smart-contracts/QVTXBridge.sol +305 -0
- package/smart-contracts/QVTXGovernance.sol +325 -0
- package/smart-contracts/QVTXNFT.sol +338 -0
- package/smart-contracts/QVTXRewards.sol +102 -0
- package/smart-contracts/QVTXToken.sol +227 -0
- package/smart-contracts/QVTXVesting.sol +411 -0
- package/smart-contracts/interfaces/IERC20.sol +14 -0
- package/smart-contracts/interfaces/IERC20Metadata.sol +8 -0
- package/smart-contracts/interfaces/IERC721.sol +18 -0
- package/smart-contracts/interfaces/IERC721Metadata.sol +8 -0
- package/smart-contracts/interfaces/IERC721Receiver.sol +11 -0
- package/storage/index.js +112 -0
- package/templates/contract/ERC20Token.sol +116 -0
- package/templates/dapp/index.html +93 -0
- package/test/index.js +182 -0
- package/tools/build-tool.js +63 -0
- package/tools/create-template.js +116 -0
- package/tools/deploy-tool.js +55 -0
- package/tools/generate-docs.js +149 -0
- package/tools/init-project.js +138 -0
- package/tools/run-tests.js +64 -0
- package/types/index.d.ts +264 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
async function run() {
|
|
7
|
+
console.log('\nQVTX Documentation Generator\n');
|
|
8
|
+
|
|
9
|
+
const docsDir = path.join(process.cwd(), 'docs');
|
|
10
|
+
await fs.ensureDir(docsDir);
|
|
11
|
+
|
|
12
|
+
// Generate main README
|
|
13
|
+
const readme = `# QVTX Project Documentation
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
This project was built with QVTX Developer Kit.
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
\`\`\`bash
|
|
22
|
+
npm install
|
|
23
|
+
npm start
|
|
24
|
+
\`\`\`
|
|
25
|
+
|
|
26
|
+
## Smart Contracts
|
|
27
|
+
|
|
28
|
+
See the \`contracts/\` directory for Solidity smart contracts.
|
|
29
|
+
|
|
30
|
+
### Compiling
|
|
31
|
+
|
|
32
|
+
\`\`\`bash
|
|
33
|
+
qvtx build
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
### Deploying
|
|
37
|
+
|
|
38
|
+
\`\`\`bash
|
|
39
|
+
qvtx deploy --network ethereum --env testnet
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
### Testing
|
|
43
|
+
|
|
44
|
+
\`\`\`bash
|
|
45
|
+
qvtx test
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
## Networks
|
|
49
|
+
|
|
50
|
+
QVTX supports the following networks:
|
|
51
|
+
|
|
52
|
+
- Ethereum (mainnet, goerli, sepolia)
|
|
53
|
+
- BSC (mainnet, testnet)
|
|
54
|
+
- Polygon (mainnet, mumbai)
|
|
55
|
+
- Arbitrum (mainnet, goerli)
|
|
56
|
+
- Avalanche (mainnet, fuji)
|
|
57
|
+
|
|
58
|
+
## Resources
|
|
59
|
+
|
|
60
|
+
- [QVTX Documentation](https://quantvestrix.com/developer)
|
|
61
|
+
- [GitHub](https://github.com/lawhite524mecom/quantvestrix-blockchain-system)
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|
|
66
|
+
`;
|
|
67
|
+
await fs.writeFile(path.join(docsDir, 'README.md'), readme);
|
|
68
|
+
|
|
69
|
+
// Generate API reference
|
|
70
|
+
const apiDocs = `# QVTX API Reference
|
|
71
|
+
|
|
72
|
+
## QVTXDeveloperKit
|
|
73
|
+
|
|
74
|
+
Main class for interacting with the QVTX ecosystem.
|
|
75
|
+
|
|
76
|
+
### Constructor
|
|
77
|
+
|
|
78
|
+
\`\`\`javascript
|
|
79
|
+
const QVTX = require('qvtx-developer-kit');
|
|
80
|
+
const kit = new QVTX({
|
|
81
|
+
network: 'ethereum',
|
|
82
|
+
environment: 'mainnet',
|
|
83
|
+
apiKey: 'your-api-key'
|
|
84
|
+
});
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
### Methods
|
|
88
|
+
|
|
89
|
+
#### getRpcUrl(network, environment)
|
|
90
|
+
|
|
91
|
+
Get the RPC URL for a network.
|
|
92
|
+
|
|
93
|
+
#### initWeb3(providerUrl)
|
|
94
|
+
|
|
95
|
+
Initialize Web3 connection.
|
|
96
|
+
|
|
97
|
+
#### initEthers(providerUrl)
|
|
98
|
+
|
|
99
|
+
Initialize Ethers.js connection.
|
|
100
|
+
|
|
101
|
+
#### deployContract(abi, bytecode, constructorArgs, privateKey)
|
|
102
|
+
|
|
103
|
+
Deploy a smart contract.
|
|
104
|
+
|
|
105
|
+
#### getTokenInfo()
|
|
106
|
+
|
|
107
|
+
Get QVTX token information.
|
|
108
|
+
|
|
109
|
+
#### getNetworks()
|
|
110
|
+
|
|
111
|
+
Get list of supported networks.
|
|
112
|
+
|
|
113
|
+
#### getVersion()
|
|
114
|
+
|
|
115
|
+
Get SDK version.
|
|
116
|
+
`;
|
|
117
|
+
await fs.writeFile(path.join(docsDir, 'API.md'), apiDocs);
|
|
118
|
+
|
|
119
|
+
// Scan contracts and generate docs
|
|
120
|
+
const contractsDir = path.join(process.cwd(), 'contracts');
|
|
121
|
+
if (await fs.pathExists(contractsDir)) {
|
|
122
|
+
const contracts = await fs.readdir(contractsDir);
|
|
123
|
+
const solFiles = contracts.filter(f => f.endsWith('.sol'));
|
|
124
|
+
|
|
125
|
+
if (solFiles.length > 0) {
|
|
126
|
+
let contractDocs = '# Smart Contract Reference\n\n';
|
|
127
|
+
|
|
128
|
+
for (const file of solFiles) {
|
|
129
|
+
const content = await fs.readFile(path.join(contractsDir, file), 'utf8');
|
|
130
|
+
contractDocs += `## ${file}\n\n`;
|
|
131
|
+
contractDocs += '```solidity\n' + content + '\n```\n\n';
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
await fs.writeFile(path.join(docsDir, 'CONTRACTS.md'), contractDocs);
|
|
135
|
+
console.log(`Generated contract docs for ${solFiles.length} contracts`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
console.log('\nDocumentation generated in docs/\n');
|
|
140
|
+
console.log('Files:');
|
|
141
|
+
console.log(' - docs/README.md');
|
|
142
|
+
console.log(' - docs/API.md');
|
|
143
|
+
if (await fs.pathExists(path.join(docsDir, 'CONTRACTS.md'))) {
|
|
144
|
+
console.log(' - docs/CONTRACTS.md');
|
|
145
|
+
}
|
|
146
|
+
console.log('');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
module.exports = { run };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs-extra');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
async function run(projectName, options) {
|
|
7
|
+
const name = projectName || 'qvtx-project';
|
|
8
|
+
const template = options.template || 'dapp';
|
|
9
|
+
const targetDir = path.join(process.cwd(), name);
|
|
10
|
+
|
|
11
|
+
console.log(`\nInitializing QVTX project: ${name}`);
|
|
12
|
+
console.log(`Template: ${template}\n`);
|
|
13
|
+
|
|
14
|
+
// Create project directory
|
|
15
|
+
await fs.ensureDir(targetDir);
|
|
16
|
+
|
|
17
|
+
// Create package.json
|
|
18
|
+
const packageJson = {
|
|
19
|
+
name: name,
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
description: `QVTX ${template} project`,
|
|
22
|
+
main: 'src/index.js',
|
|
23
|
+
scripts: {
|
|
24
|
+
start: 'node src/index.js',
|
|
25
|
+
test: 'jest',
|
|
26
|
+
build: 'node build.js',
|
|
27
|
+
deploy: 'qvtx deploy'
|
|
28
|
+
},
|
|
29
|
+
dependencies: {
|
|
30
|
+
'qvtx-developer-kit': '^1.0.0',
|
|
31
|
+
'web3': '^1.8.2',
|
|
32
|
+
'ethers': '^5.7.0'
|
|
33
|
+
},
|
|
34
|
+
devDependencies: {
|
|
35
|
+
'jest': '^29.6.0',
|
|
36
|
+
'hardhat': '^2.14.4'
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
await fs.writeJson(path.join(targetDir, 'package.json'), packageJson, { spaces: 2 });
|
|
41
|
+
|
|
42
|
+
// Create directories
|
|
43
|
+
await fs.ensureDir(path.join(targetDir, 'src'));
|
|
44
|
+
await fs.ensureDir(path.join(targetDir, 'contracts'));
|
|
45
|
+
await fs.ensureDir(path.join(targetDir, 'tests'));
|
|
46
|
+
await fs.ensureDir(path.join(targetDir, 'scripts'));
|
|
47
|
+
|
|
48
|
+
// Create main entry file
|
|
49
|
+
const mainFile = `'use strict';
|
|
50
|
+
|
|
51
|
+
const QVTX = require('qvtx-developer-kit');
|
|
52
|
+
|
|
53
|
+
async function main() {
|
|
54
|
+
const kit = new QVTX({
|
|
55
|
+
network: 'ethereum',
|
|
56
|
+
environment: 'mainnet'
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
console.log('QVTX Developer Kit v' + kit.getVersion());
|
|
60
|
+
console.log('Networks:', Object.keys(kit.getNetworks()));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
main().catch(console.error);
|
|
64
|
+
`;
|
|
65
|
+
await fs.writeFile(path.join(targetDir, 'src/index.js'), mainFile);
|
|
66
|
+
|
|
67
|
+
// Create sample contract
|
|
68
|
+
const sampleContract = `// SPDX-License-Identifier: MIT
|
|
69
|
+
pragma solidity ^0.8.19;
|
|
70
|
+
|
|
71
|
+
contract QVTXToken {
|
|
72
|
+
string public name = "QuantVestrix";
|
|
73
|
+
string public symbol = "QVTX";
|
|
74
|
+
uint8 public decimals = 18;
|
|
75
|
+
uint256 public totalSupply;
|
|
76
|
+
|
|
77
|
+
mapping(address => uint256) public balanceOf;
|
|
78
|
+
mapping(address => mapping(address => uint256)) public allowance;
|
|
79
|
+
|
|
80
|
+
event Transfer(address indexed from, address indexed to, uint256 value);
|
|
81
|
+
event Approval(address indexed owner, address indexed spender, uint256 value);
|
|
82
|
+
|
|
83
|
+
constructor(uint256 _initialSupply) {
|
|
84
|
+
totalSupply = _initialSupply * 10 ** uint256(decimals);
|
|
85
|
+
balanceOf[msg.sender] = totalSupply;
|
|
86
|
+
emit Transfer(address(0), msg.sender, totalSupply);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function transfer(address _to, uint256 _value) public returns (bool success) {
|
|
90
|
+
require(balanceOf[msg.sender] >= _value, "Insufficient balance");
|
|
91
|
+
balanceOf[msg.sender] -= _value;
|
|
92
|
+
balanceOf[_to] += _value;
|
|
93
|
+
emit Transfer(msg.sender, _to, _value);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function approve(address _spender, uint256 _value) public returns (bool success) {
|
|
98
|
+
allowance[msg.sender][_spender] = _value;
|
|
99
|
+
emit Approval(msg.sender, _spender, _value);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
|
|
104
|
+
require(balanceOf[_from] >= _value, "Insufficient balance");
|
|
105
|
+
require(allowance[_from][msg.sender] >= _value, "Allowance exceeded");
|
|
106
|
+
balanceOf[_from] -= _value;
|
|
107
|
+
balanceOf[_to] += _value;
|
|
108
|
+
allowance[_from][msg.sender] -= _value;
|
|
109
|
+
emit Transfer(_from, _to, _value);
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
await fs.writeFile(path.join(targetDir, 'contracts/QVTXToken.sol'), sampleContract);
|
|
115
|
+
|
|
116
|
+
// Create hardhat config
|
|
117
|
+
const hardhatConfig = `require("@nomicfoundation/hardhat-toolbox");
|
|
118
|
+
|
|
119
|
+
module.exports = {
|
|
120
|
+
solidity: "0.8.19",
|
|
121
|
+
networks: {
|
|
122
|
+
hardhat: {},
|
|
123
|
+
localhost: {
|
|
124
|
+
url: "http://127.0.0.1:8545"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
`;
|
|
129
|
+
await fs.writeFile(path.join(targetDir, 'hardhat.config.js'), hardhatConfig);
|
|
130
|
+
|
|
131
|
+
console.log('Project created successfully!');
|
|
132
|
+
console.log(`\nNext steps:`);
|
|
133
|
+
console.log(` cd ${name}`);
|
|
134
|
+
console.log(` npm install`);
|
|
135
|
+
console.log(` npm start\n`);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
module.exports = { run };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs-extra');
|
|
6
|
+
|
|
7
|
+
async function run(pattern, options) {
|
|
8
|
+
console.log('\nQVTX Test Runner\n');
|
|
9
|
+
|
|
10
|
+
const testsDir = path.join(process.cwd(), 'tests');
|
|
11
|
+
const testDir = path.join(process.cwd(), 'test');
|
|
12
|
+
|
|
13
|
+
// Check for test directory
|
|
14
|
+
const hasTests = await fs.pathExists(testsDir);
|
|
15
|
+
const hasTest = await fs.pathExists(testDir);
|
|
16
|
+
|
|
17
|
+
if (!hasTests && !hasTest) {
|
|
18
|
+
console.log('No tests/ or test/ directory found');
|
|
19
|
+
console.log('Create tests in tests/ or test/ directory\n');
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Run hardhat tests if available
|
|
24
|
+
const hardhatConfig = path.join(process.cwd(), 'hardhat.config.js');
|
|
25
|
+
if (await fs.pathExists(hardhatConfig)) {
|
|
26
|
+
console.log('Running Hardhat tests...\n');
|
|
27
|
+
const args = ['hardhat', 'test'];
|
|
28
|
+
if (pattern) args.push(pattern);
|
|
29
|
+
if (options.verbose) args.push('--verbose');
|
|
30
|
+
|
|
31
|
+
const child = spawn('npx', args, {
|
|
32
|
+
stdio: 'inherit',
|
|
33
|
+
cwd: process.cwd(),
|
|
34
|
+
shell: true
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
child.on('close', (code) => {
|
|
38
|
+
if (code !== 0) {
|
|
39
|
+
console.log(`\nTests exited with code ${code}\n`);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Run jest tests
|
|
46
|
+
console.log('Running Jest tests...\n');
|
|
47
|
+
const jestArgs = ['jest'];
|
|
48
|
+
if (pattern) jestArgs.push(pattern);
|
|
49
|
+
if (options.verbose) jestArgs.push('--verbose');
|
|
50
|
+
|
|
51
|
+
const child = spawn('npx', jestArgs, {
|
|
52
|
+
stdio: 'inherit',
|
|
53
|
+
cwd: process.cwd(),
|
|
54
|
+
shell: true
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
child.on('close', (code) => {
|
|
58
|
+
if (code !== 0) {
|
|
59
|
+
console.log(`\nTests exited with code ${code}\n`);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
module.exports = { run };
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QVTX Developer Kit - TypeScript Definitions
|
|
3
|
+
* @author QuantVestrix Tech Team (07-Tech)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Contract, providers, Signer, BigNumber } from 'ethers';
|
|
7
|
+
import Web3 from 'web3';
|
|
8
|
+
|
|
9
|
+
// Network Types
|
|
10
|
+
export type NetworkName = 'ethereum' | 'bsc' | 'polygon' | 'arbitrum' | 'avalanche' | 'optimism' | 'solana';
|
|
11
|
+
export type Environment = 'mainnet' | 'testnet' | 'goerli' | 'sepolia' | 'mumbai' | 'fuji';
|
|
12
|
+
|
|
13
|
+
export interface NetworkConfig {
|
|
14
|
+
chainId: number;
|
|
15
|
+
rpc: string;
|
|
16
|
+
name: string;
|
|
17
|
+
nativeCurrency: {
|
|
18
|
+
name: string;
|
|
19
|
+
symbol: string;
|
|
20
|
+
decimals: number;
|
|
21
|
+
};
|
|
22
|
+
blockExplorer?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface QVTXConfig {
|
|
26
|
+
network?: NetworkName;
|
|
27
|
+
environment?: Environment;
|
|
28
|
+
apiKey?: string;
|
|
29
|
+
privateKey?: string;
|
|
30
|
+
rpcUrl?: string;
|
|
31
|
+
chainId?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Token Types
|
|
35
|
+
export interface TokenInfo {
|
|
36
|
+
name: string;
|
|
37
|
+
symbol: string;
|
|
38
|
+
decimals: number;
|
|
39
|
+
totalSupply: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Main SDK Class
|
|
43
|
+
export class QVTXDeveloperKit {
|
|
44
|
+
constructor(config?: QVTXConfig);
|
|
45
|
+
|
|
46
|
+
version: string;
|
|
47
|
+
validatorId: string;
|
|
48
|
+
config: QVTXConfig;
|
|
49
|
+
web3?: Web3;
|
|
50
|
+
provider?: providers.JsonRpcProvider;
|
|
51
|
+
|
|
52
|
+
getRpcUrl(network?: NetworkName, env?: Environment): string | null;
|
|
53
|
+
initWeb3(providerUrl?: string): Promise<Web3>;
|
|
54
|
+
initEthers(providerUrl?: string): Promise<providers.JsonRpcProvider>;
|
|
55
|
+
deployContract(abi: any[], bytecode: string, constructorArgs?: any[], privateKey?: string): Promise<Contract>;
|
|
56
|
+
getTokenInfo(): TokenInfo;
|
|
57
|
+
getNetworks(): Record<NetworkName, Record<Environment, string>>;
|
|
58
|
+
getVersion(): string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Blockchain AI SDK Types
|
|
62
|
+
export interface NeuralNetworkConfig {
|
|
63
|
+
layers?: number[];
|
|
64
|
+
activation?: string;
|
|
65
|
+
optimizer?: string;
|
|
66
|
+
loss?: string;
|
|
67
|
+
epochs?: number;
|
|
68
|
+
batchSize?: number;
|
|
69
|
+
useQuantumAcceleration?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface InferenceOptions {
|
|
73
|
+
useQuantum?: boolean;
|
|
74
|
+
crossChainValidation?: boolean;
|
|
75
|
+
dnaEnhancement?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface AIStatus {
|
|
79
|
+
qvtx_chain: {
|
|
80
|
+
chain_id: number;
|
|
81
|
+
connected: boolean;
|
|
82
|
+
ai_capable: boolean;
|
|
83
|
+
};
|
|
84
|
+
neural_engine: { active: boolean; models: number };
|
|
85
|
+
dna_computer: { active: boolean; algorithms: number };
|
|
86
|
+
quantum_processor: { active: boolean; qubits: number };
|
|
87
|
+
consensus_validator: { active: boolean; validations: number };
|
|
88
|
+
cross_chain_capabilities: {
|
|
89
|
+
enabled: boolean;
|
|
90
|
+
supported_chains: string[];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export class BlockchainAISDK {
|
|
95
|
+
constructor(config?: {
|
|
96
|
+
chainId?: number;
|
|
97
|
+
rpcUrl?: string;
|
|
98
|
+
apiKey?: string;
|
|
99
|
+
neuralCapacity?: number;
|
|
100
|
+
dnaConsensus?: boolean;
|
|
101
|
+
quantumComputing?: boolean;
|
|
102
|
+
crossChainAI?: boolean;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
trainNeuralNetwork(networkConfig: NeuralNetworkConfig, trainingData: any): Promise<any>;
|
|
106
|
+
runInference(modelHash: string, inputData: any, options?: InferenceOptions): Promise<any>;
|
|
107
|
+
runDNAAlgorithm(algorithmType: string, parameters: any, geneticCode: string): Promise<any>;
|
|
108
|
+
transcribeNeuralPatterns(patterns: any, targetFormat?: string): Promise<any>;
|
|
109
|
+
initializeQuantumNetwork(qubits?: number): Promise<any>;
|
|
110
|
+
runQuantumAlgorithm(algorithm: string, data: any): Promise<any>;
|
|
111
|
+
orchestrateCrossChainAI(selectedChains?: string[]): Promise<any>;
|
|
112
|
+
deployAISmartContract(aiConfig: any, targetChains: string[]): Promise<any>;
|
|
113
|
+
validateQVTXConsensus(aiValidationData: any): Promise<any>;
|
|
114
|
+
generateAIConsensusProof(data: any, participants?: number): Promise<any>;
|
|
115
|
+
analyzeAIConfidenceScore(aiOutput: any, validationData: any): Promise<any>;
|
|
116
|
+
getAIStatus(): Promise<AIStatus>;
|
|
117
|
+
optimizeAISystem(optimizationType?: string): Promise<any>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Node SDK Types
|
|
121
|
+
export interface DeployOptions {
|
|
122
|
+
template?: string;
|
|
123
|
+
networks?: NetworkName[];
|
|
124
|
+
parameters?: Record<string, any>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface RewardConfig {
|
|
128
|
+
yieldStrategies?: string[];
|
|
129
|
+
rewardToken?: string;
|
|
130
|
+
autoCompound?: boolean;
|
|
131
|
+
minReward?: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface StoreDataResult {
|
|
135
|
+
networksCount: number;
|
|
136
|
+
distribution: Record<string, any>;
|
|
137
|
+
neuralHash: string;
|
|
138
|
+
retrievalKey: string;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface TransactionOptions {
|
|
142
|
+
type?: string;
|
|
143
|
+
amount?: number;
|
|
144
|
+
recipient?: string;
|
|
145
|
+
networks?: NetworkName[];
|
|
146
|
+
metadata?: Record<string, any>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface ThroughputStats {
|
|
150
|
+
current: number;
|
|
151
|
+
maximum: number;
|
|
152
|
+
efficiency: string;
|
|
153
|
+
quantum_consensus: boolean;
|
|
154
|
+
neural_validation: boolean;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export class NodeSDK {
|
|
158
|
+
constructor(config?: {
|
|
159
|
+
chainId?: number;
|
|
160
|
+
rpcUrl?: string;
|
|
161
|
+
apiKey?: string;
|
|
162
|
+
networks?: NetworkName[];
|
|
163
|
+
infiniteThroughput?: boolean;
|
|
164
|
+
crossChainRewards?: boolean;
|
|
165
|
+
neuralStorage?: string;
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
deploySmartContract(options?: DeployOptions): Promise<Record<string, string>>;
|
|
169
|
+
initializeRewards(options?: RewardConfig): Promise<void>;
|
|
170
|
+
harvestRewards(networks?: NetworkName[] | 'all'): Promise<any>;
|
|
171
|
+
storeData(data: any, schema?: string): Promise<StoreDataResult>;
|
|
172
|
+
retrieveData(hash: string, schema?: string): Promise<any>;
|
|
173
|
+
queryData(query: string, networks?: NetworkName[] | 'all'): Promise<any>;
|
|
174
|
+
executeQVTXTransaction(options?: TransactionOptions): Promise<any>;
|
|
175
|
+
enableInfiniteThroughput(options?: any): Promise<boolean>;
|
|
176
|
+
getThroughputStats(): Promise<ThroughputStats>;
|
|
177
|
+
getStatus(): Promise<Record<string, any>>;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Storage Types
|
|
181
|
+
export interface EncryptedData {
|
|
182
|
+
encrypted: string;
|
|
183
|
+
iv: string;
|
|
184
|
+
authTag: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface IPFSUploadResult {
|
|
188
|
+
hash: string;
|
|
189
|
+
url: string;
|
|
190
|
+
size: number;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface NFTMetadata {
|
|
194
|
+
name: string;
|
|
195
|
+
description: string;
|
|
196
|
+
image: string;
|
|
197
|
+
attributes: Array<{
|
|
198
|
+
trait_type: string;
|
|
199
|
+
value: string | number;
|
|
200
|
+
}>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export class QVTXStorage {
|
|
204
|
+
constructor(config?: {
|
|
205
|
+
provider?: string;
|
|
206
|
+
gateway?: string;
|
|
207
|
+
apiKey?: string;
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
hash(content: string): string;
|
|
211
|
+
uploadToIPFS(content: string | Buffer, options?: { filename?: string }): Promise<IPFSUploadResult>;
|
|
212
|
+
fetchFromIPFS(hash: string): Promise<any>;
|
|
213
|
+
createNFTMetadata(name: string, description: string, image: string, attributes?: Array<{ trait: string; value: string | number }>): NFTMetadata;
|
|
214
|
+
storeEncrypted(data: any, password: string): Promise<EncryptedData>;
|
|
215
|
+
retrieveEncrypted(encryptedData: EncryptedData, password: string): Promise<any>;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Rewards Types
|
|
219
|
+
export class QVTXRewards {
|
|
220
|
+
constructor(web3: Web3, contractAddress: string, abi?: any[]);
|
|
221
|
+
|
|
222
|
+
init(): Promise<this>;
|
|
223
|
+
getStake(address: string): Promise<BigNumber>;
|
|
224
|
+
getEarned(address: string): Promise<BigNumber>;
|
|
225
|
+
getTotalStaked(): Promise<BigNumber>;
|
|
226
|
+
getRewardRate(): Promise<BigNumber>;
|
|
227
|
+
stake(amount: string | BigNumber, fromAddress: string, privateKey: string): Promise<any>;
|
|
228
|
+
withdraw(amount: string | BigNumber, fromAddress: string, privateKey: string): Promise<any>;
|
|
229
|
+
claimReward(fromAddress: string, privateKey: string): Promise<any>;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Solana Types
|
|
233
|
+
export interface SolanaConfig {
|
|
234
|
+
network?: 'mainnet-beta' | 'devnet' | 'testnet';
|
|
235
|
+
rpcUrl?: string;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export class QVTXSolana {
|
|
239
|
+
constructor(config?: SolanaConfig);
|
|
240
|
+
|
|
241
|
+
connect(): Promise<void>;
|
|
242
|
+
getBalance(publicKey: string): Promise<number>;
|
|
243
|
+
transfer(fromKeypair: any, toPublicKey: string, amount: number): Promise<string>;
|
|
244
|
+
createToken(authority: any, decimals?: number): Promise<string>;
|
|
245
|
+
mintTokens(mint: string, destination: string, authority: any, amount: number): Promise<string>;
|
|
246
|
+
getTokenBalance(tokenAccount: string): Promise<number>;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Contract ABIs
|
|
250
|
+
export const QVTXTokenABI: any[];
|
|
251
|
+
export const QVTXGovernanceABI: any[];
|
|
252
|
+
export const QVTXBridgeABI: any[];
|
|
253
|
+
export const QVTXNFTABI: any[];
|
|
254
|
+
export const QVTXVestingABI: any[];
|
|
255
|
+
export const QVTXRewardsABI: any[];
|
|
256
|
+
|
|
257
|
+
// Default export
|
|
258
|
+
export default QVTXDeveloperKit;
|
|
259
|
+
export { QVTXDeveloperKit };
|
|
260
|
+
export { BlockchainAISDK };
|
|
261
|
+
export { NodeSDK };
|
|
262
|
+
export { QVTXStorage };
|
|
263
|
+
export { QVTXRewards };
|
|
264
|
+
export { QVTXSolana };
|