@varity-labs/sdk 2.0.0-alpha.1
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 +31 -0
- package/README.md +253 -0
- package/dist/analytics/index.d.ts +7 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +6 -0
- package/dist/analytics/tracker.d.ts +128 -0
- package/dist/analytics/tracker.d.ts.map +1 -0
- package/dist/analytics/tracker.js +203 -0
- package/dist/blockchain/BlockchainService.d.ts +100 -0
- package/dist/blockchain/BlockchainService.d.ts.map +1 -0
- package/dist/blockchain/BlockchainService.js +188 -0
- package/dist/blockchain/NFTLicensingService.d.ts +69 -0
- package/dist/blockchain/NFTLicensingService.d.ts.map +1 -0
- package/dist/blockchain/NFTLicensingService.js +136 -0
- package/dist/blockchain/RevenueSplitService.d.ts +71 -0
- package/dist/blockchain/RevenueSplitService.d.ts.map +1 -0
- package/dist/blockchain/RevenueSplitService.js +111 -0
- package/dist/blockchain/index.d.ts +48 -0
- package/dist/blockchain/index.d.ts.map +1 -0
- package/dist/blockchain/index.js +46 -0
- package/dist/blockchain/types.d.ts +63 -0
- package/dist/blockchain/types.d.ts.map +1 -0
- package/dist/blockchain/types.js +6 -0
- package/dist/chains/arbitrum.d.ts +89 -0
- package/dist/chains/arbitrum.d.ts.map +1 -0
- package/dist/chains/arbitrum.js +134 -0
- package/dist/chains/base.d.ts +84 -0
- package/dist/chains/base.d.ts.map +1 -0
- package/dist/chains/base.js +131 -0
- package/dist/chains/index.d.ts +36 -0
- package/dist/chains/index.d.ts.map +1 -0
- package/dist/chains/index.js +32 -0
- package/dist/chains/registry.d.ts +113 -0
- package/dist/chains/registry.d.ts.map +1 -0
- package/dist/chains/registry.js +201 -0
- package/dist/chains/varityL3.d.ts +81 -0
- package/dist/chains/varityL3.d.ts.map +1 -0
- package/dist/chains/varityL3.js +125 -0
- package/dist/cli/commands/clone.d.ts +8 -0
- package/dist/cli/commands/clone.d.ts.map +1 -0
- package/dist/cli/commands/clone.js +391 -0
- package/dist/cli/commands/dev.d.ts +8 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +40 -0
- package/dist/cli/commands/generate.d.ts +8 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +303 -0
- package/dist/cli/commands/init.d.ts +8 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +317 -0
- package/dist/cli/commands/validate.d.ts +8 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +69 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +33 -0
- package/dist/cli/utils/logger.d.ts +17 -0
- package/dist/cli/utils/logger.d.ts.map +1 -0
- package/dist/cli/utils/logger.js +35 -0
- package/dist/cli/utils/prompts.d.ts +21 -0
- package/dist/cli/utils/prompts.d.ts.map +1 -0
- package/dist/cli/utils/prompts.js +103 -0
- package/dist/contracts/abis/iso/AccessControlRegistry.json +1468 -0
- package/dist/contracts/abis/iso/DataProofRegistry.json +797 -0
- package/dist/contracts/abis/iso/MerchantRegistry.json +1237 -0
- package/dist/contracts/abis/iso/RepPerformance.json +1351 -0
- package/dist/contracts/abis/iso/ResidualCalculator.json +1118 -0
- package/dist/contracts/abis/iso/TransactionVault.json +1588 -0
- package/dist/contracts/abis/iso/VarityWalletFactory.json +475 -0
- package/dist/contracts/addresses.d.ts +88 -0
- package/dist/contracts/addresses.d.ts.map +1 -0
- package/dist/contracts/addresses.js +94 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +6 -0
- package/dist/core/VaritySDK.d.ts +177 -0
- package/dist/core/VaritySDK.d.ts.map +1 -0
- package/dist/core/VaritySDK.js +325 -0
- package/dist/core/config.d.ts +120 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +187 -0
- package/dist/core/credentials-proxy.d.ts +157 -0
- package/dist/core/credentials-proxy.d.ts.map +1 -0
- package/dist/core/credentials-proxy.js +345 -0
- package/dist/core/credentials.d.ts +219 -0
- package/dist/core/credentials.d.ts.map +1 -0
- package/dist/core/credentials.js +345 -0
- package/dist/core/template-loader.d.ts +15 -0
- package/dist/core/template-loader.d.ts.map +1 -0
- package/dist/core/template-loader.js +380 -0
- package/dist/core/template.d.ts +321 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +189 -0
- package/dist/core/types.d.ts +572 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +52 -0
- package/dist/dev/dev-server.d.ts +16 -0
- package/dist/dev/dev-server.d.ts.map +1 -0
- package/dist/dev/dev-server.js +119 -0
- package/dist/generators/contracts/generator.d.ts +21 -0
- package/dist/generators/contracts/generator.d.ts.map +1 -0
- package/dist/generators/contracts/generator.js +252 -0
- package/dist/generators/tests/generator.d.ts +20 -0
- package/dist/generators/tests/generator.d.ts.map +1 -0
- package/dist/generators/tests/generator.js +375 -0
- package/dist/generators/types/generator.d.ts +19 -0
- package/dist/generators/types/generator.d.ts.map +1 -0
- package/dist/generators/types/generator.js +165 -0
- package/dist/generators/ui/component-generator.d.ts +20 -0
- package/dist/generators/ui/component-generator.d.ts.map +1 -0
- package/dist/generators/ui/component-generator.js +749 -0
- package/dist/generators/ui/dashboard-generator.d.ts +20 -0
- package/dist/generators/ui/dashboard-generator.d.ts.map +1 -0
- package/dist/generators/ui/dashboard-generator.js +349 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/modules/analytics/AnalyticsModule.d.ts +349 -0
- package/dist/modules/analytics/AnalyticsModule.d.ts.map +1 -0
- package/dist/modules/analytics/AnalyticsModule.js +274 -0
- package/dist/modules/analytics/index.d.ts +3 -0
- package/dist/modules/analytics/index.d.ts.map +1 -0
- package/dist/modules/analytics/index.js +1 -0
- package/dist/modules/auth/AccessKeyModule.d.ts +189 -0
- package/dist/modules/auth/AccessKeyModule.d.ts.map +1 -0
- package/dist/modules/auth/AccessKeyModule.js +322 -0
- package/dist/modules/auth/AuthModule.d.ts +133 -0
- package/dist/modules/auth/AuthModule.d.ts.map +1 -0
- package/dist/modules/auth/AuthModule.js +214 -0
- package/dist/modules/auth/index.d.ts +8 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +6 -0
- package/dist/modules/cache/CacheModule.d.ts +279 -0
- package/dist/modules/cache/CacheModule.d.ts.map +1 -0
- package/dist/modules/cache/CacheModule.js +493 -0
- package/dist/modules/cache/index.d.ts +3 -0
- package/dist/modules/cache/index.d.ts.map +1 -0
- package/dist/modules/cache/index.js +1 -0
- package/dist/modules/compute/ComputeModule.d.ts +226 -0
- package/dist/modules/compute/ComputeModule.d.ts.map +1 -0
- package/dist/modules/compute/ComputeModule.js +379 -0
- package/dist/modules/compute/index.d.ts +6 -0
- package/dist/modules/compute/index.d.ts.map +1 -0
- package/dist/modules/compute/index.js +4 -0
- package/dist/modules/contracts/ContractsModule.d.ts +164 -0
- package/dist/modules/contracts/ContractsModule.d.ts.map +1 -0
- package/dist/modules/contracts/ContractsModule.js +242 -0
- package/dist/modules/contracts/index.d.ts +6 -0
- package/dist/modules/contracts/index.d.ts.map +1 -0
- package/dist/modules/contracts/index.js +4 -0
- package/dist/modules/export/ExportModule.d.ts +346 -0
- package/dist/modules/export/ExportModule.d.ts.map +1 -0
- package/dist/modules/export/ExportModule.js +432 -0
- package/dist/modules/export/index.d.ts +3 -0
- package/dist/modules/export/index.d.ts.map +1 -0
- package/dist/modules/export/index.js +1 -0
- package/dist/modules/forecasting/ForecastingModule.d.ts +579 -0
- package/dist/modules/forecasting/ForecastingModule.d.ts.map +1 -0
- package/dist/modules/forecasting/ForecastingModule.js +310 -0
- package/dist/modules/forecasting/index.d.ts +3 -0
- package/dist/modules/forecasting/index.d.ts.map +1 -0
- package/dist/modules/forecasting/index.js +1 -0
- package/dist/modules/monitoring/MonitoringModule.d.ts +359 -0
- package/dist/modules/monitoring/MonitoringModule.d.ts.map +1 -0
- package/dist/modules/monitoring/MonitoringModule.js +483 -0
- package/dist/modules/monitoring/index.d.ts +3 -0
- package/dist/modules/monitoring/index.d.ts.map +1 -0
- package/dist/modules/monitoring/index.js +1 -0
- package/dist/modules/notifications/NotificationsModule.d.ts +336 -0
- package/dist/modules/notifications/NotificationsModule.d.ts.map +1 -0
- package/dist/modules/notifications/NotificationsModule.js +418 -0
- package/dist/modules/notifications/index.d.ts +3 -0
- package/dist/modules/notifications/index.d.ts.map +1 -0
- package/dist/modules/notifications/index.js +1 -0
- package/dist/modules/oracle/OracleModule.d.ts +110 -0
- package/dist/modules/oracle/OracleModule.d.ts.map +1 -0
- package/dist/modules/oracle/OracleModule.js +151 -0
- package/dist/modules/oracle/index.d.ts +6 -0
- package/dist/modules/oracle/index.d.ts.map +1 -0
- package/dist/modules/oracle/index.js +4 -0
- package/dist/modules/storage/S3Module.d.ts +377 -0
- package/dist/modules/storage/S3Module.d.ts.map +1 -0
- package/dist/modules/storage/S3Module.js +680 -0
- package/dist/modules/storage/StorageModule.d.ts +157 -0
- package/dist/modules/storage/StorageModule.d.ts.map +1 -0
- package/dist/modules/storage/StorageModule.js +302 -0
- package/dist/modules/storage/adapters/AdapterFactory.d.ts +100 -0
- package/dist/modules/storage/adapters/AdapterFactory.d.ts.map +1 -0
- package/dist/modules/storage/adapters/AdapterFactory.js +209 -0
- package/dist/modules/storage/adapters/FilecoinAdapter.d.ts +94 -0
- package/dist/modules/storage/adapters/FilecoinAdapter.d.ts.map +1 -0
- package/dist/modules/storage/adapters/FilecoinAdapter.js +263 -0
- package/dist/modules/storage/adapters/IStorageAdapter.d.ts +287 -0
- package/dist/modules/storage/adapters/IStorageAdapter.d.ts.map +1 -0
- package/dist/modules/storage/adapters/IStorageAdapter.js +81 -0
- package/dist/modules/storage/adapters/MultiTierAdapter.d.ts +187 -0
- package/dist/modules/storage/adapters/MultiTierAdapter.d.ts.map +1 -0
- package/dist/modules/storage/adapters/MultiTierAdapter.js +430 -0
- package/dist/modules/storage/adapters/index.d.ts +12 -0
- package/dist/modules/storage/adapters/index.d.ts.map +1 -0
- package/dist/modules/storage/adapters/index.js +12 -0
- package/dist/modules/storage/index.d.ts +16 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +15 -0
- package/dist/modules/storage/tiering/AccessAnalyzer.d.ts +227 -0
- package/dist/modules/storage/tiering/AccessAnalyzer.d.ts.map +1 -0
- package/dist/modules/storage/tiering/AccessAnalyzer.js +367 -0
- package/dist/modules/storage/tiering/CostOptimizer.d.ts +248 -0
- package/dist/modules/storage/tiering/CostOptimizer.d.ts.map +1 -0
- package/dist/modules/storage/tiering/CostOptimizer.js +356 -0
- package/dist/modules/storage/tiering/MetadataStore.d.ts +287 -0
- package/dist/modules/storage/tiering/MetadataStore.d.ts.map +1 -0
- package/dist/modules/storage/tiering/MetadataStore.js +535 -0
- package/dist/modules/storage/tiering/TieringEngine.d.ts +237 -0
- package/dist/modules/storage/tiering/TieringEngine.d.ts.map +1 -0
- package/dist/modules/storage/tiering/TieringEngine.js +419 -0
- package/dist/modules/storage/tiering/example.d.ts +8 -0
- package/dist/modules/storage/tiering/example.d.ts.map +1 -0
- package/dist/modules/storage/tiering/example.js +250 -0
- package/dist/modules/storage/tiering/index.d.ts +17 -0
- package/dist/modules/storage/tiering/index.d.ts.map +1 -0
- package/dist/modules/storage/tiering/index.js +13 -0
- package/dist/modules/webhooks/WebhooksModule.d.ts +476 -0
- package/dist/modules/webhooks/WebhooksModule.d.ts.map +1 -0
- package/dist/modules/webhooks/WebhooksModule.js +359 -0
- package/dist/modules/webhooks/index.d.ts +3 -0
- package/dist/modules/webhooks/index.d.ts.map +1 -0
- package/dist/modules/webhooks/index.js +1 -0
- package/dist/modules/zk/ZKModule.d.ts +153 -0
- package/dist/modules/zk/ZKModule.d.ts.map +1 -0
- package/dist/modules/zk/ZKModule.js +262 -0
- package/dist/modules/zk/index.d.ts +7 -0
- package/dist/modules/zk/index.d.ts.map +1 -0
- package/dist/modules/zk/index.js +4 -0
- package/dist/thirdweb/BridgeClient.d.ts +228 -0
- package/dist/thirdweb/BridgeClient.d.ts.map +1 -0
- package/dist/thirdweb/BridgeClient.js +160 -0
- package/dist/thirdweb/EngineClient.d.ts +396 -0
- package/dist/thirdweb/EngineClient.d.ts.map +1 -0
- package/dist/thirdweb/EngineClient.js +386 -0
- package/dist/thirdweb/GatewayClient.d.ts +190 -0
- package/dist/thirdweb/GatewayClient.d.ts.map +1 -0
- package/dist/thirdweb/GatewayClient.js +257 -0
- package/dist/thirdweb/NebulaClient.d.ts +292 -0
- package/dist/thirdweb/NebulaClient.d.ts.map +1 -0
- package/dist/thirdweb/NebulaClient.js +180 -0
- package/dist/thirdweb/StorageClient.d.ts +445 -0
- package/dist/thirdweb/StorageClient.d.ts.map +1 -0
- package/dist/thirdweb/StorageClient.js +405 -0
- package/dist/thirdweb/ThirdwebWrapper.d.ts +236 -0
- package/dist/thirdweb/ThirdwebWrapper.d.ts.map +1 -0
- package/dist/thirdweb/ThirdwebWrapper.js +332 -0
- package/dist/thirdweb/index.d.ts +21 -0
- package/dist/thirdweb/index.d.ts.map +1 -0
- package/dist/thirdweb/index.js +28 -0
- package/dist/thirdweb/varity-chain.d.ts +48 -0
- package/dist/thirdweb/varity-chain.d.ts.map +1 -0
- package/dist/thirdweb/varity-chain.js +64 -0
- package/dist/thirdweb/x402Client.d.ts +319 -0
- package/dist/thirdweb/x402Client.d.ts.map +1 -0
- package/dist/thirdweb/x402Client.js +223 -0
- package/dist/tracking/gasTracker.d.ts +158 -0
- package/dist/tracking/gasTracker.d.ts.map +1 -0
- package/dist/tracking/gasTracker.js +227 -0
- package/dist/tracking/index.d.ts +10 -0
- package/dist/tracking/index.d.ts.map +1 -0
- package/dist/tracking/index.js +8 -0
- package/dist/tracking/types.d.ts +327 -0
- package/dist/tracking/types.d.ts.map +1 -0
- package/dist/tracking/types.js +8 -0
- package/dist/ui/components/ChartWidget.d.ts +36 -0
- package/dist/ui/components/ChartWidget.d.ts.map +1 -0
- package/dist/ui/components/ChartWidget.js +82 -0
- package/dist/ui/components/DashboardLayout.d.ts +41 -0
- package/dist/ui/components/DashboardLayout.d.ts.map +1 -0
- package/dist/ui/components/DashboardLayout.js +102 -0
- package/dist/ui/components/DataTable.d.ts +49 -0
- package/dist/ui/components/DataTable.d.ts.map +1 -0
- package/dist/ui/components/DataTable.js +96 -0
- package/dist/ui/components/EntityForm.d.ts +60 -0
- package/dist/ui/components/EntityForm.d.ts.map +1 -0
- package/dist/ui/components/EntityForm.js +182 -0
- package/dist/ui/components/KPICard.d.ts +29 -0
- package/dist/ui/components/KPICard.d.ts.map +1 -0
- package/dist/ui/components/KPICard.js +61 -0
- package/dist/ui/components/Modal.d.ts +34 -0
- package/dist/ui/components/Modal.d.ts.map +1 -0
- package/dist/ui/components/Modal.js +30 -0
- package/dist/ui/components/index.d.ts +18 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +11 -0
- package/dist/validation/template-validator.d.ts +25 -0
- package/dist/validation/template-validator.d.ts.map +1 -0
- package/dist/validation/template-validator.js +305 -0
- package/package.json +102 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK v1 - Network Configuration
|
|
3
|
+
*
|
|
4
|
+
* Manages network settings and contract addresses for different networks.
|
|
5
|
+
*/
|
|
6
|
+
import { NetworkConfig, Network } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* Network configurations for Varity SDK
|
|
9
|
+
* Contract addresses will be populated after deployment
|
|
10
|
+
*/
|
|
11
|
+
export declare const NETWORK_CONFIGS: Record<Network, NetworkConfig>;
|
|
12
|
+
/**
|
|
13
|
+
* Default SDK configuration
|
|
14
|
+
*/
|
|
15
|
+
export declare const DEFAULT_CONFIG: {
|
|
16
|
+
network: Network;
|
|
17
|
+
apiEndpoint: string;
|
|
18
|
+
timeout: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get network configuration
|
|
22
|
+
*/
|
|
23
|
+
export declare function getNetworkConfig(network: Network): NetworkConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Validate contract addresses are configured
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateContractAddresses(network: Network): void;
|
|
28
|
+
/**
|
|
29
|
+
* Backend API endpoints
|
|
30
|
+
*/
|
|
31
|
+
export declare const API_ENDPOINTS: {
|
|
32
|
+
storage: {
|
|
33
|
+
pin: string;
|
|
34
|
+
retrieve: string;
|
|
35
|
+
unpin: string;
|
|
36
|
+
};
|
|
37
|
+
celestia: {
|
|
38
|
+
submit: string;
|
|
39
|
+
retrieve: string;
|
|
40
|
+
submitBatch: string;
|
|
41
|
+
};
|
|
42
|
+
llm: {
|
|
43
|
+
query: string;
|
|
44
|
+
queryWithRAG: string;
|
|
45
|
+
};
|
|
46
|
+
config: {
|
|
47
|
+
contracts: string;
|
|
48
|
+
networks: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Storage layer configuration
|
|
53
|
+
*/
|
|
54
|
+
export declare const STORAGE_CONFIG: {
|
|
55
|
+
defaultBackend: "filecoin-ipfs";
|
|
56
|
+
pinata: {
|
|
57
|
+
gateway: string;
|
|
58
|
+
api: string;
|
|
59
|
+
};
|
|
60
|
+
celestia: {
|
|
61
|
+
namespacePrefix: string;
|
|
62
|
+
testnetRPC: string;
|
|
63
|
+
};
|
|
64
|
+
encryption: {
|
|
65
|
+
algorithm: string;
|
|
66
|
+
keyDerivation: string;
|
|
67
|
+
iterations: number;
|
|
68
|
+
};
|
|
69
|
+
multiTier: {
|
|
70
|
+
hotTier: {
|
|
71
|
+
backend: "filecoin-ipfs";
|
|
72
|
+
replication: number;
|
|
73
|
+
costPerGB: number;
|
|
74
|
+
accessLatency: number;
|
|
75
|
+
};
|
|
76
|
+
coldTier: {
|
|
77
|
+
backend: "filecoin-ipfs";
|
|
78
|
+
replication: number;
|
|
79
|
+
costPerGB: number;
|
|
80
|
+
accessLatency: number;
|
|
81
|
+
};
|
|
82
|
+
autoTiering: {
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
policy: "access-based";
|
|
85
|
+
checkInterval: number;
|
|
86
|
+
rules: ({
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
condition: {
|
|
90
|
+
type: "last_accessed";
|
|
91
|
+
operator: "gt";
|
|
92
|
+
value: number;
|
|
93
|
+
unit: "days";
|
|
94
|
+
};
|
|
95
|
+
action: {
|
|
96
|
+
moveTo: "cold";
|
|
97
|
+
notify: boolean;
|
|
98
|
+
};
|
|
99
|
+
priority: number;
|
|
100
|
+
enabled: boolean;
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
description: string;
|
|
104
|
+
condition: {
|
|
105
|
+
type: "access_count";
|
|
106
|
+
operator: "gte";
|
|
107
|
+
value: number;
|
|
108
|
+
unit: "accesses";
|
|
109
|
+
};
|
|
110
|
+
action: {
|
|
111
|
+
moveTo: "hot";
|
|
112
|
+
notify: boolean;
|
|
113
|
+
};
|
|
114
|
+
priority: number;
|
|
115
|
+
enabled: boolean;
|
|
116
|
+
})[];
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,OAAO,EAAE,aAAa,CA2C1D,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;aACM,OAAO;;;CAGvC,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,CAMhE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgBhE;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;CAmBzB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6E1B,CAAA"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK v1 - Network Configuration
|
|
3
|
+
*
|
|
4
|
+
* Manages network settings and contract addresses for different networks.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Network configurations for Varity SDK
|
|
8
|
+
* Contract addresses will be populated after deployment
|
|
9
|
+
*/
|
|
10
|
+
export const NETWORK_CONFIGS = {
|
|
11
|
+
'arbitrum-sepolia': {
|
|
12
|
+
chainId: 421614, // Arbitrum Sepolia testnet chain ID
|
|
13
|
+
rpcUrl: process.env.ARBITRUM_SEPOLIA_RPC || 'https://sepolia-rollup.arbitrum.io/rpc',
|
|
14
|
+
explorerUrl: 'https://sepolia.arbiscan.io',
|
|
15
|
+
contracts: {
|
|
16
|
+
MerchantRegistry: process.env.MERCHANT_REGISTRY_ARBITRUM_SEPOLIA || '',
|
|
17
|
+
TransactionVault: process.env.TRANSACTION_VAULT_ARBITRUM_SEPOLIA || '',
|
|
18
|
+
RepPerformance: process.env.REP_PERFORMANCE_ARBITRUM_SEPOLIA || '',
|
|
19
|
+
ResidualCalculator: process.env.RESIDUAL_CALCULATOR_ARBITRUM_SEPOLIA || '',
|
|
20
|
+
AccessControlRegistry: process.env.ACCESS_CONTROL_ARBITRUM_SEPOLIA || '',
|
|
21
|
+
DataProofRegistry: process.env.DATA_PROOF_REGISTRY_ARBITRUM_SEPOLIA || '',
|
|
22
|
+
VarityWalletFactory: process.env.WALLET_FACTORY_ARBITRUM_SEPOLIA || ''
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
'arbitrum-l3-testnet': {
|
|
26
|
+
chainId: 33529, // Varity L3 Testnet (Arbitrum Orbit on Conduit)
|
|
27
|
+
rpcUrl: process.env.ARBITRUM_L3_TESTNET_RPC || 'https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz',
|
|
28
|
+
explorerUrl: 'https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz',
|
|
29
|
+
contracts: {
|
|
30
|
+
MerchantRegistry: process.env.MERCHANT_REGISTRY_L3_TESTNET || '',
|
|
31
|
+
TransactionVault: process.env.TRANSACTION_VAULT_L3_TESTNET || '',
|
|
32
|
+
RepPerformance: process.env.REP_PERFORMANCE_L3_TESTNET || '',
|
|
33
|
+
ResidualCalculator: process.env.RESIDUAL_CALCULATOR_L3_TESTNET || '',
|
|
34
|
+
AccessControlRegistry: process.env.ACCESS_CONTROL_L3_TESTNET || '',
|
|
35
|
+
DataProofRegistry: process.env.DATA_PROOF_REGISTRY_L3_TESTNET || '',
|
|
36
|
+
VarityWalletFactory: process.env.WALLET_FACTORY_L3_TESTNET || ''
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
'arbitrum-l3-mainnet': {
|
|
40
|
+
chainId: 1000000, // Placeholder - will be updated with actual L3 mainnet
|
|
41
|
+
rpcUrl: process.env.ARBITRUM_L3_MAINNET_RPC || '',
|
|
42
|
+
explorerUrl: 'https://explorer.varity.io',
|
|
43
|
+
contracts: {
|
|
44
|
+
MerchantRegistry: process.env.MERCHANT_REGISTRY_L3_MAINNET || '',
|
|
45
|
+
TransactionVault: process.env.TRANSACTION_VAULT_L3_MAINNET || '',
|
|
46
|
+
RepPerformance: process.env.REP_PERFORMANCE_L3_MAINNET || '',
|
|
47
|
+
ResidualCalculator: process.env.RESIDUAL_CALCULATOR_L3_MAINNET || '',
|
|
48
|
+
AccessControlRegistry: process.env.ACCESS_CONTROL_L3_MAINNET || '',
|
|
49
|
+
DataProofRegistry: process.env.DATA_PROOF_REGISTRY_L3_MAINNET || '',
|
|
50
|
+
VarityWalletFactory: process.env.WALLET_FACTORY_L3_MAINNET || ''
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Default SDK configuration
|
|
56
|
+
*/
|
|
57
|
+
export const DEFAULT_CONFIG = {
|
|
58
|
+
network: 'arbitrum-sepolia',
|
|
59
|
+
apiEndpoint: process.env.VARITY_API_ENDPOINT || 'https://api.varity.io',
|
|
60
|
+
timeout: 30000 // 30 seconds
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Get network configuration
|
|
64
|
+
*/
|
|
65
|
+
export function getNetworkConfig(network) {
|
|
66
|
+
const config = NETWORK_CONFIGS[network];
|
|
67
|
+
if (!config) {
|
|
68
|
+
throw new Error(`Unsupported network: ${network}`);
|
|
69
|
+
}
|
|
70
|
+
return config;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Validate contract addresses are configured
|
|
74
|
+
*/
|
|
75
|
+
export function validateContractAddresses(network) {
|
|
76
|
+
const config = getNetworkConfig(network);
|
|
77
|
+
const missingContracts = [];
|
|
78
|
+
Object.entries(config.contracts).forEach(([name, address]) => {
|
|
79
|
+
if (!address || address === '') {
|
|
80
|
+
missingContracts.push(name);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
if (missingContracts.length > 0) {
|
|
84
|
+
throw new Error(`Missing contract addresses for ${network}: ${missingContracts.join(', ')}\n` +
|
|
85
|
+
`Please set environment variables or deploy contracts to this network.`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Backend API endpoints
|
|
90
|
+
*/
|
|
91
|
+
export const API_ENDPOINTS = {
|
|
92
|
+
storage: {
|
|
93
|
+
pin: '/api/v1/storage/pin',
|
|
94
|
+
retrieve: '/api/v1/storage/retrieve',
|
|
95
|
+
unpin: '/api/v1/storage/unpin'
|
|
96
|
+
},
|
|
97
|
+
celestia: {
|
|
98
|
+
submit: '/api/v1/celestia/submit',
|
|
99
|
+
retrieve: '/api/v1/celestia/retrieve',
|
|
100
|
+
submitBatch: '/api/v1/celestia/submit-batch'
|
|
101
|
+
},
|
|
102
|
+
llm: {
|
|
103
|
+
query: '/api/v1/llm/query',
|
|
104
|
+
queryWithRAG: '/api/v1/llm/query-rag'
|
|
105
|
+
},
|
|
106
|
+
config: {
|
|
107
|
+
contracts: '/api/v1/config/contracts',
|
|
108
|
+
networks: '/api/v1/config/networks'
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Storage layer configuration
|
|
113
|
+
*/
|
|
114
|
+
export const STORAGE_CONFIG = {
|
|
115
|
+
// Default storage backend
|
|
116
|
+
defaultBackend: 'filecoin-ipfs',
|
|
117
|
+
// Filecoin/IPFS configuration
|
|
118
|
+
pinata: {
|
|
119
|
+
gateway: 'https://gateway.pinata.cloud/ipfs/',
|
|
120
|
+
api: 'https://api.pinata.cloud'
|
|
121
|
+
},
|
|
122
|
+
// Celestia Data Availability
|
|
123
|
+
celestia: {
|
|
124
|
+
namespacePrefix: 'varity-',
|
|
125
|
+
testnetRPC: process.env.CELESTIA_TESTNET_RPC || 'https://rpc-mocha.pops.one'
|
|
126
|
+
},
|
|
127
|
+
// Encryption settings
|
|
128
|
+
encryption: {
|
|
129
|
+
algorithm: 'aes-256-gcm',
|
|
130
|
+
keyDerivation: 'pbkdf2',
|
|
131
|
+
iterations: 100000
|
|
132
|
+
},
|
|
133
|
+
// Multi-tier storage default configuration
|
|
134
|
+
multiTier: {
|
|
135
|
+
hotTier: {
|
|
136
|
+
backend: 'filecoin-ipfs',
|
|
137
|
+
replication: 3,
|
|
138
|
+
costPerGB: 0.001, // $0.001 per GB per month
|
|
139
|
+
accessLatency: 50 // 50ms average
|
|
140
|
+
},
|
|
141
|
+
coldTier: {
|
|
142
|
+
backend: 'filecoin-ipfs',
|
|
143
|
+
replication: 2,
|
|
144
|
+
costPerGB: 0.0005, // $0.0005 per GB per month
|
|
145
|
+
accessLatency: 200 // 200ms average
|
|
146
|
+
},
|
|
147
|
+
autoTiering: {
|
|
148
|
+
enabled: true,
|
|
149
|
+
policy: 'access-based',
|
|
150
|
+
checkInterval: 24, // Check every 24 hours
|
|
151
|
+
rules: [
|
|
152
|
+
{
|
|
153
|
+
name: 'Demote to cold after 30 days',
|
|
154
|
+
description: 'Move hot tier objects to cold tier if not accessed for 30 days',
|
|
155
|
+
condition: {
|
|
156
|
+
type: 'last_accessed',
|
|
157
|
+
operator: 'gt',
|
|
158
|
+
value: 30,
|
|
159
|
+
unit: 'days'
|
|
160
|
+
},
|
|
161
|
+
action: {
|
|
162
|
+
moveTo: 'cold',
|
|
163
|
+
notify: false
|
|
164
|
+
},
|
|
165
|
+
priority: 1,
|
|
166
|
+
enabled: true
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'Promote frequently accessed',
|
|
170
|
+
description: 'Move cold tier objects to hot tier if accessed more than 5 times',
|
|
171
|
+
condition: {
|
|
172
|
+
type: 'access_count',
|
|
173
|
+
operator: 'gte',
|
|
174
|
+
value: 5,
|
|
175
|
+
unit: 'accesses'
|
|
176
|
+
},
|
|
177
|
+
action: {
|
|
178
|
+
moveTo: 'hot',
|
|
179
|
+
notify: false
|
|
180
|
+
},
|
|
181
|
+
priority: 2,
|
|
182
|
+
enabled: true
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
};
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK - Credential Proxy Client
|
|
3
|
+
*
|
|
4
|
+
* Client-side integration with Varity Credential Proxy service.
|
|
5
|
+
* Fetches credentials from server-side proxy instead of bundling them in client code.
|
|
6
|
+
*
|
|
7
|
+
* **Security Model**:
|
|
8
|
+
* - Real credentials stored server-side ONLY
|
|
9
|
+
* - Client receives session-based tokens
|
|
10
|
+
* - No credentials in client bundles
|
|
11
|
+
* - Automatic session management
|
|
12
|
+
*
|
|
13
|
+
* @example Usage in SDK
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { ProxyCredentialClient } from '@varity-labs/sdk';
|
|
16
|
+
*
|
|
17
|
+
* const client = new ProxyCredentialClient();
|
|
18
|
+
* const credentials = await client.getCredentials();
|
|
19
|
+
*
|
|
20
|
+
* // Use credentials with Privy/thirdweb
|
|
21
|
+
* const privyAppId = credentials.privy.appId;
|
|
22
|
+
* const thirdwebClientId = credentials.thirdweb.clientId;
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
import type { CredentialConfig } from './credentials';
|
|
26
|
+
/**
|
|
27
|
+
* Configuration for ProxyCredentialClient
|
|
28
|
+
*/
|
|
29
|
+
export interface ProxyClientConfig {
|
|
30
|
+
/**
|
|
31
|
+
* URL of the credential proxy service
|
|
32
|
+
* @default "https://api.varity.so/credentials"
|
|
33
|
+
*/
|
|
34
|
+
proxyUrl?: string;
|
|
35
|
+
/**
|
|
36
|
+
* App domain (auto-detected from window.location.hostname)
|
|
37
|
+
*/
|
|
38
|
+
appDomain?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional Varity App Store ID
|
|
41
|
+
*/
|
|
42
|
+
appId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Enable debug logging
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
debug?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Credential Proxy Client
|
|
51
|
+
*
|
|
52
|
+
* Fetches Privy and thirdweb credentials from server-side proxy.
|
|
53
|
+
* Handles session management, caching, and automatic refresh.
|
|
54
|
+
*/
|
|
55
|
+
export declare class ProxyCredentialClient {
|
|
56
|
+
private proxyUrl;
|
|
57
|
+
private appDomain;
|
|
58
|
+
private appId?;
|
|
59
|
+
private debug;
|
|
60
|
+
private sessionToken;
|
|
61
|
+
private sessionExpiresAt;
|
|
62
|
+
private cachedCredentials;
|
|
63
|
+
constructor(config?: ProxyClientConfig);
|
|
64
|
+
/**
|
|
65
|
+
* Get credentials from proxy
|
|
66
|
+
*
|
|
67
|
+
* Automatically handles session creation and refresh.
|
|
68
|
+
*
|
|
69
|
+
* @returns Credential configuration
|
|
70
|
+
*/
|
|
71
|
+
getCredentials(): Promise<CredentialConfig>;
|
|
72
|
+
/**
|
|
73
|
+
* Create a new session with the credential proxy
|
|
74
|
+
*/
|
|
75
|
+
private createSession;
|
|
76
|
+
/**
|
|
77
|
+
* Get Privy configuration from proxy
|
|
78
|
+
*/
|
|
79
|
+
private getPrivyConfig;
|
|
80
|
+
/**
|
|
81
|
+
* Get thirdweb configuration from proxy
|
|
82
|
+
*/
|
|
83
|
+
private getThirdwebConfig;
|
|
84
|
+
/**
|
|
85
|
+
* Check if current session is still valid
|
|
86
|
+
*/
|
|
87
|
+
private isSessionValid;
|
|
88
|
+
/**
|
|
89
|
+
* Detect app domain from browser environment
|
|
90
|
+
*/
|
|
91
|
+
private detectAppDomain;
|
|
92
|
+
/**
|
|
93
|
+
* Clear cached credentials and session
|
|
94
|
+
*/
|
|
95
|
+
clearCache(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Debug logging
|
|
98
|
+
*/
|
|
99
|
+
private log;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get or create global ProxyCredentialClient instance
|
|
103
|
+
*
|
|
104
|
+
* @param config - Optional configuration (only used on first call)
|
|
105
|
+
* @returns Global ProxyCredentialClient instance
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* import { getProxyCredentials } from '@varity-labs/sdk';
|
|
110
|
+
*
|
|
111
|
+
* const credentials = await getProxyCredentials();
|
|
112
|
+
* // Use credentials.privy.appId and credentials.thirdweb.clientId
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function getProxyCredentials(config?: ProxyClientConfig): Promise<CredentialConfig>;
|
|
116
|
+
/**
|
|
117
|
+
* Check if credential proxy is available
|
|
118
|
+
*
|
|
119
|
+
* Tests connectivity to the credential proxy service.
|
|
120
|
+
*
|
|
121
|
+
* @param proxyUrl - Optional proxy URL (defaults to production URL)
|
|
122
|
+
* @returns true if proxy is available, false otherwise
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import { isProxyAvailable } from '@varity-labs/sdk';
|
|
127
|
+
*
|
|
128
|
+
* if (await isProxyAvailable()) {
|
|
129
|
+
* // Use proxy credentials
|
|
130
|
+
* } else {
|
|
131
|
+
* // Fallback to manual credentials
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
export declare function isProxyAvailable(proxyUrl?: string): Promise<boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Resolve credentials with automatic proxy fallback
|
|
138
|
+
*
|
|
139
|
+
* Attempts to use credential proxy first, falls back to manual credentials if proxy unavailable.
|
|
140
|
+
*
|
|
141
|
+
* @param manualAppId - Manual Privy app ID (fallback)
|
|
142
|
+
* @param manualClientId - Manual thirdweb client ID (fallback)
|
|
143
|
+
* @param config - Proxy client configuration
|
|
144
|
+
* @returns Resolved credentials
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```typescript
|
|
148
|
+
* import { resolveCredentialsWithProxy } from '@varity-labs/sdk';
|
|
149
|
+
*
|
|
150
|
+
* const credentials = await resolveCredentialsWithProxy(
|
|
151
|
+
* process.env.PRIVY_APP_ID,
|
|
152
|
+
* process.env.THIRDWEB_CLIENT_ID
|
|
153
|
+
* );
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export declare function resolveCredentialsWithProxy(manualAppId?: string, manualClientId?: string, config?: ProxyClientConfig): Promise<CredentialConfig>;
|
|
157
|
+
//# sourceMappingURL=credentials-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials-proxy.d.ts","sourceRoot":"","sources":["../../src/core/credentials-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA2BD;;;;;GAKG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,KAAK,CAAC,CAAS;IACvB,OAAO,CAAC,KAAK,CAAU;IAGvB,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,gBAAgB,CAAqB;IAG7C,OAAO,CAAC,iBAAiB,CAAiC;gBAE9C,MAAM,GAAE,iBAAsB;IAgB1C;;;;;;OAMG;IACG,cAAc,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAiCjD;;OAEG;YACW,aAAa;IAsC3B;;OAEG;YACW,cAAc;IA+B5B;;OAEG;YACW,iBAAiB;IA+B/B;;OAEG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;OAEG;IACH,UAAU,IAAI,IAAI;IAOlB;;OAEG;IACH,OAAO,CAAC,GAAG;CAKZ;AAOD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,GAAE,MAAuF,GAChG,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,CAAC,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,gBAAgB,CAAC,CAwE3B"}
|