@123456btc/123456btc-cli 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/README.md +93 -0
- package/bin/123456btc-cli +2 -0
- package/dist/api/auth.d.ts +27 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +29 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/client.d.ts +13 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +106 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/client.test.d.ts +2 -0
- package/dist/api/client.test.d.ts.map +1 -0
- package/dist/api/client.test.js +27 -0
- package/dist/api/client.test.js.map +1 -0
- package/dist/api/gas.d.ts +29 -0
- package/dist/api/gas.d.ts.map +1 -0
- package/dist/api/gas.js +35 -0
- package/dist/api/gas.js.map +1 -0
- package/dist/api/strategy.d.ts +40 -0
- package/dist/api/strategy.d.ts.map +1 -0
- package/dist/api/strategy.js +47 -0
- package/dist/api/strategy.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +36 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +115 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/gas.d.ts +3 -0
- package/dist/commands/gas.d.ts.map +1 -0
- package/dist/commands/gas.js +104 -0
- package/dist/commands/gas.js.map +1 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +151 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/strategy.d.ts +3 -0
- package/dist/commands/strategy.d.ts.map +1 -0
- package/dist/commands/strategy.js +124 -0
- package/dist/commands/strategy.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +68 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/executor.d.ts +36 -0
- package/dist/providers/executor.d.ts.map +1 -0
- package/dist/providers/executor.js +90 -0
- package/dist/providers/executor.js.map +1 -0
- package/dist/providers/solana.d.ts +34 -0
- package/dist/providers/solana.d.ts.map +1 -0
- package/dist/providers/solana.js +69 -0
- package/dist/providers/solana.js.map +1 -0
- package/dist/providers/verification.d.ts +22 -0
- package/dist/providers/verification.d.ts.map +1 -0
- package/dist/providers/verification.js +54 -0
- package/dist/providers/verification.js.map +1 -0
- package/dist/types/api.d.ts +94 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +6 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/gas.d.ts +27 -0
- package/dist/types/gas.d.ts.map +1 -0
- package/dist/types/gas.js +6 -0
- package/dist/types/gas.js.map +1 -0
- package/dist/types/strategy.d.ts +30 -0
- package/dist/types/strategy.d.ts.map +1 -0
- package/dist/types/strategy.js +6 -0
- package/dist/types/strategy.js.map +1 -0
- package/package.json +74 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 123456btc-cli Module Entry
|
|
3
|
+
* Export main classes for programmatic usage
|
|
4
|
+
*/
|
|
5
|
+
export { ApiClient } from './api/client';
|
|
6
|
+
export { AuthApi } from './api/auth';
|
|
7
|
+
export { StrategyApi } from './api/strategy';
|
|
8
|
+
export { GasApi } from './api/gas';
|
|
9
|
+
export { StrategyExecutor, ExecutionManager } from './providers/executor';
|
|
10
|
+
export { SolanaProvider } from './providers/solana';
|
|
11
|
+
export { IdentityVerifier } from './providers/verification';
|
|
12
|
+
export { loadCredentials, getSolanaRpcUrl } from './config';
|
|
13
|
+
export type { ApiKey, ApiResponse, ApiError, Strategy, StrategyDispatchRequest, StrategyDispatchResponse, StrategyStatus, GasBalance, GasSettlement, IdentityTier, PackageInfo, } from './types/api';
|
|
14
|
+
export type { StrategyConfig, StrategyResult, ExecutorContext, StrategyState, StrategyStateInfo, } from './types/strategy';
|
|
15
|
+
export type { GasRate, GasTransaction, GasSettlementConfig, } from './types/gas';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE5D,YAAY,EACV,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,OAAO,EACP,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 123456btc-cli Module Entry
|
|
4
|
+
* Export main classes for programmatic usage
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.getSolanaRpcUrl = exports.loadCredentials = exports.IdentityVerifier = exports.SolanaProvider = exports.ExecutionManager = exports.StrategyExecutor = exports.GasApi = exports.StrategyApi = exports.AuthApi = exports.ApiClient = void 0;
|
|
8
|
+
var client_1 = require("./api/client");
|
|
9
|
+
Object.defineProperty(exports, "ApiClient", { enumerable: true, get: function () { return client_1.ApiClient; } });
|
|
10
|
+
var auth_1 = require("./api/auth");
|
|
11
|
+
Object.defineProperty(exports, "AuthApi", { enumerable: true, get: function () { return auth_1.AuthApi; } });
|
|
12
|
+
var strategy_1 = require("./api/strategy");
|
|
13
|
+
Object.defineProperty(exports, "StrategyApi", { enumerable: true, get: function () { return strategy_1.StrategyApi; } });
|
|
14
|
+
var gas_1 = require("./api/gas");
|
|
15
|
+
Object.defineProperty(exports, "GasApi", { enumerable: true, get: function () { return gas_1.GasApi; } });
|
|
16
|
+
var executor_1 = require("./providers/executor");
|
|
17
|
+
Object.defineProperty(exports, "StrategyExecutor", { enumerable: true, get: function () { return executor_1.StrategyExecutor; } });
|
|
18
|
+
Object.defineProperty(exports, "ExecutionManager", { enumerable: true, get: function () { return executor_1.ExecutionManager; } });
|
|
19
|
+
var solana_1 = require("./providers/solana");
|
|
20
|
+
Object.defineProperty(exports, "SolanaProvider", { enumerable: true, get: function () { return solana_1.SolanaProvider; } });
|
|
21
|
+
var verification_1 = require("./providers/verification");
|
|
22
|
+
Object.defineProperty(exports, "IdentityVerifier", { enumerable: true, get: function () { return verification_1.IdentityVerifier; } });
|
|
23
|
+
var config_1 = require("./config");
|
|
24
|
+
Object.defineProperty(exports, "loadCredentials", { enumerable: true, get: function () { return config_1.loadCredentials; } });
|
|
25
|
+
Object.defineProperty(exports, "getSolanaRpcUrl", { enumerable: true, get: function () { return config_1.getSolanaRpcUrl; } });
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAAyC;AAAhC,mGAAA,SAAS,OAAA;AAClB,mCAAqC;AAA5B,+FAAA,OAAO,OAAA;AAChB,2CAA6C;AAApC,uGAAA,WAAW,OAAA;AACpB,iCAAmC;AAA1B,6FAAA,MAAM,OAAA;AAEf,iDAA0E;AAAjE,4GAAA,gBAAgB,OAAA;AAAE,4GAAA,gBAAgB,OAAA;AAC3C,6CAAoD;AAA3C,wGAAA,cAAc,OAAA;AACvB,yDAA4D;AAAnD,gHAAA,gBAAgB,OAAA;AAEzB,mCAA4D;AAAnD,yGAAA,eAAe,OAAA;AAAE,yGAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { StrategyResult, ExecutorContext } from '../types/strategy';
|
|
2
|
+
/**
|
|
3
|
+
* Local strategy executor
|
|
4
|
+
* Executes strategies in isolated environment
|
|
5
|
+
*/
|
|
6
|
+
export declare class StrategyExecutor {
|
|
7
|
+
private context;
|
|
8
|
+
constructor(context: ExecutorContext);
|
|
9
|
+
/**
|
|
10
|
+
* Execute strategy
|
|
11
|
+
*/
|
|
12
|
+
execute(): Promise<StrategyResult>;
|
|
13
|
+
/**
|
|
14
|
+
* Update context
|
|
15
|
+
*/
|
|
16
|
+
updateContext(context: Partial<ExecutorContext>): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Strategy execution manager
|
|
20
|
+
*/
|
|
21
|
+
export declare class ExecutionManager {
|
|
22
|
+
private executing;
|
|
23
|
+
/**
|
|
24
|
+
* Start execution
|
|
25
|
+
*/
|
|
26
|
+
execute(context: ExecutorContext): Promise<StrategyResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Check if executing
|
|
29
|
+
*/
|
|
30
|
+
isExecuting(dispatchId: string): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* List executing strategies
|
|
33
|
+
*/
|
|
34
|
+
listExecuting(): string[];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/providers/executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpF;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAkB;gBAErB,OAAO,EAAE,eAAe;IAIpC;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC;IAqCxC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;CAGvD;AAED;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAA4C;IAE7D;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAYhE;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO;IAIxC;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE;CAG1B"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionManager = exports.StrategyExecutor = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Local strategy executor
|
|
6
|
+
* Executes strategies in isolated environment
|
|
7
|
+
*/
|
|
8
|
+
class StrategyExecutor {
|
|
9
|
+
context;
|
|
10
|
+
constructor(context) {
|
|
11
|
+
this.context = context;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Execute strategy
|
|
15
|
+
*/
|
|
16
|
+
async execute() {
|
|
17
|
+
const startTime = Date.now();
|
|
18
|
+
try {
|
|
19
|
+
// In real implementation, this would:
|
|
20
|
+
// 1. Load the strategy package
|
|
21
|
+
// 2. Execute the strategy with given config
|
|
22
|
+
// 3. Track gas usage
|
|
23
|
+
// 4. Return result
|
|
24
|
+
console.log(`Executing strategy: ${this.context.strategyId}`);
|
|
25
|
+
console.log(`Dispatch ID: ${this.context.dispatchId}`);
|
|
26
|
+
console.log(`Config: ${JSON.stringify(this.context.config)}`);
|
|
27
|
+
// Simulated result
|
|
28
|
+
const result = {
|
|
29
|
+
success: true,
|
|
30
|
+
data: {
|
|
31
|
+
message: 'Strategy executed successfully',
|
|
32
|
+
strategyId: this.context.strategyId,
|
|
33
|
+
dispatchId: this.context.dispatchId,
|
|
34
|
+
},
|
|
35
|
+
gasUsed: Math.floor(Math.random() * 1000),
|
|
36
|
+
executionTime: Date.now() - startTime,
|
|
37
|
+
};
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
return {
|
|
42
|
+
success: false,
|
|
43
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
44
|
+
gasUsed: 0,
|
|
45
|
+
executionTime: Date.now() - startTime,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Update context
|
|
51
|
+
*/
|
|
52
|
+
updateContext(context) {
|
|
53
|
+
this.context = { ...this.context, ...context };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.StrategyExecutor = StrategyExecutor;
|
|
57
|
+
/**
|
|
58
|
+
* Strategy execution manager
|
|
59
|
+
*/
|
|
60
|
+
class ExecutionManager {
|
|
61
|
+
executing = new Map();
|
|
62
|
+
/**
|
|
63
|
+
* Start execution
|
|
64
|
+
*/
|
|
65
|
+
async execute(context) {
|
|
66
|
+
const executor = new StrategyExecutor(context);
|
|
67
|
+
this.executing.set(context.dispatchId, executor);
|
|
68
|
+
try {
|
|
69
|
+
const result = await executor.execute();
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
this.executing.delete(context.dispatchId);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check if executing
|
|
78
|
+
*/
|
|
79
|
+
isExecuting(dispatchId) {
|
|
80
|
+
return this.executing.has(dispatchId);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* List executing strategies
|
|
84
|
+
*/
|
|
85
|
+
listExecuting() {
|
|
86
|
+
return Array.from(this.executing.keys());
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.ExecutionManager = ExecutionManager;
|
|
90
|
+
//# sourceMappingURL=executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/providers/executor.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAa,gBAAgB;IACnB,OAAO,CAAkB;IAEjC,YAAY,OAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE7B,IAAI,CAAC;YACH,sCAAsC;YACtC,+BAA+B;YAC/B,4CAA4C;YAC5C,qBAAqB;YACrB,mBAAmB;YAEnB,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YAC9D,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;YACvD,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAE9D,mBAAmB;YACnB,MAAM,MAAM,GAAmB;gBAC7B,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE;oBACJ,OAAO,EAAE,gCAAgC;oBACzC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;oBACnC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;iBACpC;gBACD,OA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ED;;OAEG;IACH,aAAa;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF;AA/BD,4CA+BC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Connection, VersionedTransaction } from '@solana/web3.js';
|
|
2
|
+
/**
|
|
3
|
+
* Solana provider for blockchain interactions
|
|
4
|
+
*/
|
|
5
|
+
export declare class SolanaProvider {
|
|
6
|
+
private connection;
|
|
7
|
+
private rpcUrl;
|
|
8
|
+
constructor(rpcUrl?: string);
|
|
9
|
+
/**
|
|
10
|
+
* Get connection
|
|
11
|
+
*/
|
|
12
|
+
getConnection(): Connection;
|
|
13
|
+
/**
|
|
14
|
+
* Get balance
|
|
15
|
+
*/
|
|
16
|
+
getBalance(address: string): Promise<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Send transaction
|
|
19
|
+
*/
|
|
20
|
+
sendTransaction(transaction: VersionedTransaction, signTransaction: (tx: VersionedTransaction) => Promise<VersionedTransaction>): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Get current slot
|
|
23
|
+
*/
|
|
24
|
+
getSlot(): Promise<number>;
|
|
25
|
+
/**
|
|
26
|
+
* Get recent blockhash
|
|
27
|
+
*/
|
|
28
|
+
getLatestBlockhash(): Promise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Health check
|
|
31
|
+
*/
|
|
32
|
+
healthCheck(): Promise<boolean>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=solana.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../src/providers/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG3F;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,CAAC,EAAE,MAAM;IAO3B;;OAEG;IACH,aAAa,IAAI,UAAU;IAI3B;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMlD;;OAEG;IACG,eAAe,CACnB,WAAW,EAAE,oBAAoB,EACjC,eAAe,EAAE,CAAC,EAAE,EAAE,oBAAoB,KAAK,OAAO,CAAC,oBAAoB,CAAC,GAC3E,OAAO,CAAC,MAAM,CAAC;IAQlB;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAIhC;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAK3C;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAQtC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SolanaProvider = void 0;
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
+
const config_1 = require("../config");
|
|
6
|
+
/**
|
|
7
|
+
* Solana provider for blockchain interactions
|
|
8
|
+
*/
|
|
9
|
+
class SolanaProvider {
|
|
10
|
+
connection;
|
|
11
|
+
rpcUrl;
|
|
12
|
+
constructor(rpcUrl) {
|
|
13
|
+
this.rpcUrl = rpcUrl || (0, config_1.getSolanaRpcUrl)();
|
|
14
|
+
this.connection = new web3_js_1.Connection(this.rpcUrl, {
|
|
15
|
+
commitment: 'confirmed',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get connection
|
|
20
|
+
*/
|
|
21
|
+
getConnection() {
|
|
22
|
+
return this.connection;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get balance
|
|
26
|
+
*/
|
|
27
|
+
async getBalance(address) {
|
|
28
|
+
const pubKey = new web3_js_1.PublicKey(address);
|
|
29
|
+
const balance = await this.connection.getBalance(pubKey);
|
|
30
|
+
return balance / 1e9; // Convert lamports to SOL
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Send transaction
|
|
34
|
+
*/
|
|
35
|
+
async sendTransaction(transaction, signTransaction) {
|
|
36
|
+
const signed = await signTransaction(transaction);
|
|
37
|
+
const serialized = signed.serialize();
|
|
38
|
+
const signature = await this.connection.sendRawTransaction(serialized);
|
|
39
|
+
await this.connection.confirmTransaction(signature);
|
|
40
|
+
return signature;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get current slot
|
|
44
|
+
*/
|
|
45
|
+
async getSlot() {
|
|
46
|
+
return this.connection.getSlot();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get recent blockhash
|
|
50
|
+
*/
|
|
51
|
+
async getLatestBlockhash() {
|
|
52
|
+
const { blockhash } = await this.connection.getLatestBlockhash();
|
|
53
|
+
return blockhash;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Health check
|
|
57
|
+
*/
|
|
58
|
+
async healthCheck() {
|
|
59
|
+
try {
|
|
60
|
+
await this.connection.getSlot();
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.SolanaProvider = SolanaProvider;
|
|
69
|
+
//# sourceMappingURL=solana.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../src/providers/solana.ts"],"names":[],"mappings":";;;AAAA,6CAA2F;AAC3F,sCAA4C;AAE5C;;GAEG;AACH,MAAa,cAAc;IACjB,UAAU,CAAa;IACvB,MAAM,CAAS;IAEvB,YAAY,MAAe;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAA,wBAAe,GAAE,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAU,CAAC,IAAI,CAAC,MAAM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mEC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ApiClient } from '../api/client';
|
|
2
|
+
import { IdentityTier } from '../types/api';
|
|
3
|
+
/**
|
|
4
|
+
* Identity tier verification provider
|
|
5
|
+
*/
|
|
6
|
+
export declare class IdentityVerifier {
|
|
7
|
+
private client;
|
|
8
|
+
constructor(client: ApiClient);
|
|
9
|
+
/**
|
|
10
|
+
* Verify identity tier
|
|
11
|
+
*/
|
|
12
|
+
verifyTier(): Promise<IdentityTier>;
|
|
13
|
+
/**
|
|
14
|
+
* Check if user has required tier
|
|
15
|
+
*/
|
|
16
|
+
hasTier(requiredTier: string): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Get remaining daily strategies
|
|
19
|
+
*/
|
|
20
|
+
getRemainingDailyStrategies(): Promise<number>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/providers/verification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAY;gBAEd,MAAM,EAAE,SAAS;IAI7B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;IAQzC;;OAEG;IACG,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAerD;;OAEG;IACG,2BAA2B,IAAI,OAAO,CAAC,MAAM,CAAC;CAQrD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IdentityVerifier = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Identity tier verification provider
|
|
6
|
+
*/
|
|
7
|
+
class IdentityVerifier {
|
|
8
|
+
client;
|
|
9
|
+
constructor(client) {
|
|
10
|
+
this.client = client;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Verify identity tier
|
|
14
|
+
*/
|
|
15
|
+
async verifyTier() {
|
|
16
|
+
const response = await this.client.get('/v1/identity/tier');
|
|
17
|
+
if (response.success && response.data) {
|
|
18
|
+
return response.data;
|
|
19
|
+
}
|
|
20
|
+
throw new Error(`Tier verification failed: ${response.error?.message}`);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Check if user has required tier
|
|
24
|
+
*/
|
|
25
|
+
async hasTier(requiredTier) {
|
|
26
|
+
try {
|
|
27
|
+
const tier = await this.verifyTier();
|
|
28
|
+
const tierLevels = {
|
|
29
|
+
basic: 1,
|
|
30
|
+
standard: 2,
|
|
31
|
+
premium: 3,
|
|
32
|
+
enterprise: 4,
|
|
33
|
+
};
|
|
34
|
+
return (tierLevels[tier.tier] || 0) >= (tierLevels[requiredTier] || 0);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get remaining daily strategies
|
|
42
|
+
*/
|
|
43
|
+
async getRemainingDailyStrategies() {
|
|
44
|
+
try {
|
|
45
|
+
const tier = await this.verifyTier();
|
|
46
|
+
return tier.dailyStrategyLimit - tier.usedToday;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.IdentityVerifier = IdentityVerifier;
|
|
54
|
+
//# sourceMappingURL=verification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.js","sourceRoot":"","sources":["../../src/providers/verification.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,gBAAgB;IACnB,MAAM,CAAY;IAE1B,YAAY,MAAiB;QAC3B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ey {
|
|
5
|
+
key: string;
|
|
6
|
+
environment: 'live' | 'test';
|
|
7
|
+
}
|
|
8
|
+
export interface ApiResponse<T> {
|
|
9
|
+
success: boolean;
|
|
10
|
+
data?: T;
|
|
11
|
+
error?: ApiError;
|
|
12
|
+
meta?: {
|
|
13
|
+
requestId?: string;
|
|
14
|
+
timestamp?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface ApiError {
|
|
18
|
+
code: string;
|
|
19
|
+
message: string;
|
|
20
|
+
details?: unknown;
|
|
21
|
+
}
|
|
22
|
+
export interface Strategy {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
version: string;
|
|
26
|
+
description: string;
|
|
27
|
+
packageUrl: string;
|
|
28
|
+
configSchema?: unknown;
|
|
29
|
+
requiredTier?: string;
|
|
30
|
+
gasEstimate?: number;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
}
|
|
34
|
+
export interface StrategyDispatchRequest {
|
|
35
|
+
strategyId: string;
|
|
36
|
+
params?: Record<string, unknown>;
|
|
37
|
+
sessionId?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface StrategyDispatchResponse {
|
|
40
|
+
dispatchId: string;
|
|
41
|
+
status: 'queued' | 'running' | 'completed' | 'failed';
|
|
42
|
+
estimatedDuration?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface StrategyStatus {
|
|
45
|
+
dispatchId: string;
|
|
46
|
+
status: 'queued' | 'running' | 'completed' | 'failed';
|
|
47
|
+
progress?: number;
|
|
48
|
+
result?: unknown;
|
|
49
|
+
error?: string;
|
|
50
|
+
gasUsed?: number;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
}
|
|
53
|
+
export interface GasBalance {
|
|
54
|
+
available: number;
|
|
55
|
+
currency: 'SOL' | 'USDC';
|
|
56
|
+
tier: string;
|
|
57
|
+
tierLimit: number;
|
|
58
|
+
}
|
|
59
|
+
export interface GasSettlement {
|
|
60
|
+
dispatchId: string;
|
|
61
|
+
gasUsed: number;
|
|
62
|
+
fee: number;
|
|
63
|
+
currency: 'SOL' | 'USDC';
|
|
64
|
+
transactionId?: string;
|
|
65
|
+
status: 'pending' | 'completed' | 'failed';
|
|
66
|
+
}
|
|
67
|
+
export interface IdentityTier {
|
|
68
|
+
tier: string;
|
|
69
|
+
level: number;
|
|
70
|
+
permissions: string[];
|
|
71
|
+
dailyStrategyLimit: number;
|
|
72
|
+
usedToday: number;
|
|
73
|
+
expiresAt?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface PackageInfo {
|
|
76
|
+
name: string;
|
|
77
|
+
version: string;
|
|
78
|
+
dependencies?: string[];
|
|
79
|
+
peerDependencies?: string[];
|
|
80
|
+
entryPoint: string;
|
|
81
|
+
aiCompatible: boolean;
|
|
82
|
+
llmCompatible: boolean;
|
|
83
|
+
}
|
|
84
|
+
export interface GasTransaction {
|
|
85
|
+
id: string;
|
|
86
|
+
dispatchId: string;
|
|
87
|
+
amount: number;
|
|
88
|
+
currency: 'SOL' | 'USDC';
|
|
89
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
90
|
+
signature?: string;
|
|
91
|
+
createdAt: string;
|
|
92
|
+
confirmedAt?: string;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;CAC9B;AAGD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,IAAI,CAAC,EAAE;QACL,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,S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["../../src/types/api.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gas Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
export interface GasRate {
|
|
5
|
+
slow: number;
|
|
6
|
+
standard: number;
|
|
7
|
+
fast: number;
|
|
8
|
+
unit: 'gwei' | 'lamports';
|
|
9
|
+
timestamp: number;
|
|
10
|
+
}
|
|
11
|
+
export interface GasTransaction {
|
|
12
|
+
id: string;
|
|
13
|
+
dispatchId: string;
|
|
14
|
+
amount: number;
|
|
15
|
+
currency: 'SOL' | 'USDC';
|
|
16
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
17
|
+
signature?: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
confirmedAt?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GasSettlementConfig {
|
|
22
|
+
autoSettle: boolean;
|
|
23
|
+
threshold?: number;
|
|
24
|
+
currency: 'SOL' | 'USDC';
|
|
25
|
+
walletAddress?: string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=gas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas.d.ts","sourceRoot":"","sources":["../../src/types/gas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAGD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,GAAG,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../src/types/gas.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
export interface StrategyConfig {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
params?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface StrategyResult {
|
|
10
|
+
success: boolean;
|
|
11
|
+
data?: unknown;
|
|
12
|
+
error?: string;
|
|
13
|
+
gasUsed?: number;
|
|
14
|
+
executionTime?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ExecutorContext {
|
|
17
|
+
strategyId: string;
|
|
18
|
+
dispatchId: string;
|
|
19
|
+
config: StrategyConfig;
|
|
20
|
+
apiKey: string;
|
|
21
|
+
gasBudget?: number;
|
|
22
|
+
}
|
|
23
|
+
export type StrategyState = 'idle' | 'fetching' | 'installing' | 'validating' | 'running' | 'completed' | 'failed';
|
|
24
|
+
export interface StrategyStateInfo {
|
|
25
|
+
state: StrategyState;
|
|
26
|
+
progress?: number;
|
|
27
|
+
message?: string;
|
|
28
|
+
timestamp: number;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../../src/types/strategy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAGD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../../src/types/strategy.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|