@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,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Loader
|
|
3
|
+
*
|
|
4
|
+
* Utility for loading and registering built-in templates
|
|
5
|
+
*/
|
|
6
|
+
import { templateRegistry } from './template';
|
|
7
|
+
// Import template JSON files (will be bundled by build tool)
|
|
8
|
+
// Note: In actual implementation, these would be imported as:
|
|
9
|
+
// import isoTemplate from '../../templates/iso.template.json'
|
|
10
|
+
// For now, we'll use a dynamic loading approach
|
|
11
|
+
/**
|
|
12
|
+
* Load built-in ISO template
|
|
13
|
+
*/
|
|
14
|
+
export function loadISOTemplate() {
|
|
15
|
+
const template = {
|
|
16
|
+
type: 'iso',
|
|
17
|
+
name: 'ISO Merchant Services Dashboard',
|
|
18
|
+
version: '1.0.0',
|
|
19
|
+
description: 'Payment processing and merchant management platform for Independent Sales Organizations',
|
|
20
|
+
contracts: [
|
|
21
|
+
{
|
|
22
|
+
name: 'MerchantRegistry',
|
|
23
|
+
description: 'Merchant registration and management',
|
|
24
|
+
abi: '../../contracts/abis/iso/MerchantRegistry.json',
|
|
25
|
+
addresses: {
|
|
26
|
+
'arbitrum-sepolia': '',
|
|
27
|
+
'arbitrum-l3-testnet': '',
|
|
28
|
+
'arbitrum-l3-mainnet': ''
|
|
29
|
+
},
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'TransactionVault',
|
|
34
|
+
description: 'Transaction recording and storage',
|
|
35
|
+
abi: '../../contracts/abis/iso/TransactionVault.json',
|
|
36
|
+
addresses: {
|
|
37
|
+
'arbitrum-sepolia': '',
|
|
38
|
+
'arbitrum-l3-testnet': '',
|
|
39
|
+
'arbitrum-l3-mainnet': ''
|
|
40
|
+
},
|
|
41
|
+
required: true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'RepPerformance',
|
|
45
|
+
description: 'Sales representative performance tracking',
|
|
46
|
+
abi: '../../contracts/abis/iso/RepPerformance.json',
|
|
47
|
+
addresses: {
|
|
48
|
+
'arbitrum-sepolia': '',
|
|
49
|
+
'arbitrum-l3-testnet': '',
|
|
50
|
+
'arbitrum-l3-mainnet': ''
|
|
51
|
+
},
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'ResidualCalculator',
|
|
56
|
+
description: 'Residual income calculation and distribution',
|
|
57
|
+
abi: '../../contracts/abis/iso/ResidualCalculator.json',
|
|
58
|
+
addresses: {
|
|
59
|
+
'arbitrum-sepolia': '',
|
|
60
|
+
'arbitrum-l3-testnet': '',
|
|
61
|
+
'arbitrum-l3-mainnet': ''
|
|
62
|
+
},
|
|
63
|
+
required: true
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'AccessControlRegistry',
|
|
67
|
+
description: 'Role-based access control',
|
|
68
|
+
abi: '../../contracts/abis/iso/AccessControlRegistry.json',
|
|
69
|
+
addresses: {
|
|
70
|
+
'arbitrum-sepolia': '',
|
|
71
|
+
'arbitrum-l3-testnet': '',
|
|
72
|
+
'arbitrum-l3-mainnet': ''
|
|
73
|
+
},
|
|
74
|
+
required: true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'DataProofRegistry',
|
|
78
|
+
description: 'Data integrity and ownership proofs',
|
|
79
|
+
abi: '../../contracts/abis/iso/DataProofRegistry.json',
|
|
80
|
+
addresses: {
|
|
81
|
+
'arbitrum-sepolia': '',
|
|
82
|
+
'arbitrum-l3-testnet': '',
|
|
83
|
+
'arbitrum-l3-mainnet': ''
|
|
84
|
+
},
|
|
85
|
+
required: true
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
entities: [
|
|
89
|
+
{
|
|
90
|
+
name: 'merchant',
|
|
91
|
+
displayName: 'Merchant',
|
|
92
|
+
description: 'Business registered for payment processing',
|
|
93
|
+
idField: 'merchantId',
|
|
94
|
+
displayField: 'businessName',
|
|
95
|
+
fields: [
|
|
96
|
+
{
|
|
97
|
+
name: 'merchantId',
|
|
98
|
+
label: 'Merchant ID',
|
|
99
|
+
type: 'string',
|
|
100
|
+
required: true
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'businessName',
|
|
104
|
+
label: 'Business Name',
|
|
105
|
+
type: 'string',
|
|
106
|
+
required: true
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'walletAddress',
|
|
110
|
+
label: 'Wallet Address',
|
|
111
|
+
type: 'address',
|
|
112
|
+
required: true
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'status',
|
|
116
|
+
label: 'Status',
|
|
117
|
+
type: 'enum',
|
|
118
|
+
required: true,
|
|
119
|
+
enumValues: ['PENDING', 'ACTIVE', 'SUSPENDED', 'TERMINATED']
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'monthlyVolume',
|
|
123
|
+
label: 'Monthly Volume',
|
|
124
|
+
type: 'number'
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'onboardedBy',
|
|
128
|
+
label: 'Onboarded By',
|
|
129
|
+
type: 'address'
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
endpoints: {
|
|
133
|
+
list: '/api/v1/merchants',
|
|
134
|
+
get: '/api/v1/merchants/:id',
|
|
135
|
+
create: '/api/v1/merchants',
|
|
136
|
+
update: '/api/v1/merchants/:id'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'transaction',
|
|
141
|
+
displayName: 'Transaction',
|
|
142
|
+
description: 'Payment transaction record',
|
|
143
|
+
idField: 'transactionId',
|
|
144
|
+
displayField: 'transactionId',
|
|
145
|
+
fields: [
|
|
146
|
+
{
|
|
147
|
+
name: 'transactionId',
|
|
148
|
+
label: 'Transaction ID',
|
|
149
|
+
type: 'string',
|
|
150
|
+
required: true
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: 'merchantId',
|
|
154
|
+
label: 'Merchant ID',
|
|
155
|
+
type: 'string',
|
|
156
|
+
required: true
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'amount',
|
|
160
|
+
label: 'Amount',
|
|
161
|
+
type: 'number',
|
|
162
|
+
required: true
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'type',
|
|
166
|
+
label: 'Type',
|
|
167
|
+
type: 'enum',
|
|
168
|
+
required: true,
|
|
169
|
+
enumValues: ['SALE', 'REFUND', 'CHARGEBACK', 'ADJUSTMENT']
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'timestamp',
|
|
173
|
+
label: 'Timestamp',
|
|
174
|
+
type: 'date',
|
|
175
|
+
required: true
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
endpoints: {
|
|
179
|
+
list: '/api/v1/transactions',
|
|
180
|
+
get: '/api/v1/transactions/:id',
|
|
181
|
+
create: '/api/v1/transactions'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'rep',
|
|
186
|
+
displayName: 'Sales Representative',
|
|
187
|
+
description: 'Sales representative managing merchants',
|
|
188
|
+
idField: 'repAddress',
|
|
189
|
+
displayField: 'repAddress',
|
|
190
|
+
fields: [
|
|
191
|
+
{
|
|
192
|
+
name: 'repAddress',
|
|
193
|
+
label: 'Rep Address',
|
|
194
|
+
type: 'address',
|
|
195
|
+
required: true
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'status',
|
|
199
|
+
label: 'Status',
|
|
200
|
+
type: 'enum',
|
|
201
|
+
required: true,
|
|
202
|
+
enumValues: ['ACTIVE', 'INACTIVE', 'SUSPENDED']
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'totalMerchants',
|
|
206
|
+
label: 'Total Merchants',
|
|
207
|
+
type: 'number'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'totalResiduals',
|
|
211
|
+
label: 'Total Residuals',
|
|
212
|
+
type: 'number'
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
endpoints: {
|
|
216
|
+
list: '/api/v1/reps',
|
|
217
|
+
get: '/api/v1/reps/:address',
|
|
218
|
+
create: '/api/v1/reps'
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
events: [
|
|
223
|
+
{
|
|
224
|
+
name: 'merchant.registered',
|
|
225
|
+
displayName: 'Merchant Registered',
|
|
226
|
+
description: 'New merchant registered for processing',
|
|
227
|
+
category: 'merchant'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'merchant.updated',
|
|
231
|
+
displayName: 'Merchant Updated',
|
|
232
|
+
description: 'Merchant information updated',
|
|
233
|
+
category: 'merchant'
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'merchant.status_changed',
|
|
237
|
+
displayName: 'Merchant Status Changed',
|
|
238
|
+
description: 'Merchant status changed (activated, suspended, etc.)',
|
|
239
|
+
category: 'merchant'
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: 'transaction.created',
|
|
243
|
+
displayName: 'Transaction Created',
|
|
244
|
+
description: 'New transaction recorded',
|
|
245
|
+
category: 'transaction'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: 'transaction.voided',
|
|
249
|
+
displayName: 'Transaction Voided',
|
|
250
|
+
description: 'Transaction voided or refunded',
|
|
251
|
+
category: 'transaction'
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
name: 'rep.registered',
|
|
255
|
+
displayName: 'Rep Registered',
|
|
256
|
+
description: 'New sales representative registered',
|
|
257
|
+
category: 'rep'
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'residual.calculated',
|
|
261
|
+
displayName: 'Residual Calculated',
|
|
262
|
+
description: 'Monthly residual income calculated',
|
|
263
|
+
category: 'residual'
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: 'residual.paid',
|
|
267
|
+
displayName: 'Residual Paid',
|
|
268
|
+
description: 'Residual income paid to representative',
|
|
269
|
+
category: 'residual'
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
metrics: [
|
|
273
|
+
{
|
|
274
|
+
name: 'total_merchants',
|
|
275
|
+
displayName: 'Total Merchants',
|
|
276
|
+
description: 'Total number of active merchants',
|
|
277
|
+
type: 'count',
|
|
278
|
+
source: '/api/v1/analytics/metrics/merchants/count',
|
|
279
|
+
unit: 'merchants'
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'total_volume',
|
|
283
|
+
displayName: 'Total Processing Volume',
|
|
284
|
+
description: 'Total payment processing volume',
|
|
285
|
+
type: 'sum',
|
|
286
|
+
source: '/api/v1/analytics/metrics/transactions/volume',
|
|
287
|
+
unit: 'USD',
|
|
288
|
+
format: 'currency'
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: 'avg_transaction_size',
|
|
292
|
+
displayName: 'Average Transaction Size',
|
|
293
|
+
description: 'Average transaction amount',
|
|
294
|
+
type: 'average',
|
|
295
|
+
source: '/api/v1/analytics/metrics/transactions/avg_size',
|
|
296
|
+
unit: 'USD',
|
|
297
|
+
format: 'currency'
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'chargeback_rate',
|
|
301
|
+
displayName: 'Chargeback Rate',
|
|
302
|
+
description: 'Percentage of transactions resulting in chargebacks',
|
|
303
|
+
type: 'percentage',
|
|
304
|
+
source: '/api/v1/analytics/metrics/transactions/chargeback_rate',
|
|
305
|
+
unit: '%',
|
|
306
|
+
format: 'percentage'
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
name: 'active_reps',
|
|
310
|
+
displayName: 'Active Representatives',
|
|
311
|
+
description: 'Number of active sales representatives',
|
|
312
|
+
type: 'count',
|
|
313
|
+
source: '/api/v1/analytics/metrics/reps/active_count',
|
|
314
|
+
unit: 'reps'
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
dashboards: [
|
|
318
|
+
{
|
|
319
|
+
name: 'overview',
|
|
320
|
+
displayName: 'Overview Dashboard',
|
|
321
|
+
description: 'High-level metrics and KPIs',
|
|
322
|
+
defaultTimeRange: 'last_30_days',
|
|
323
|
+
widgets: [
|
|
324
|
+
{
|
|
325
|
+
type: 'kpi',
|
|
326
|
+
title: 'Total Merchants',
|
|
327
|
+
source: 'total_merchants',
|
|
328
|
+
size: { width: 3, height: 2 },
|
|
329
|
+
position: { x: 0, y: 0 }
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
type: 'kpi',
|
|
333
|
+
title: 'Processing Volume',
|
|
334
|
+
source: 'total_volume',
|
|
335
|
+
size: { width: 3, height: 2 },
|
|
336
|
+
position: { x: 3, y: 0 }
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
type: 'chart',
|
|
340
|
+
title: 'Volume Trend',
|
|
341
|
+
source: '/api/v1/analytics/trends/volume',
|
|
342
|
+
size: { width: 6, height: 4 },
|
|
343
|
+
position: { x: 0, y: 2 },
|
|
344
|
+
config: { chartType: 'line' }
|
|
345
|
+
}
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
storage: {
|
|
350
|
+
customerNamespacePattern: 'customer-iso-{company-id}',
|
|
351
|
+
encryptionEnabled: true,
|
|
352
|
+
litProtocolEnabled: true,
|
|
353
|
+
celestiaDAEnabled: true,
|
|
354
|
+
zkProofsEnabled: true
|
|
355
|
+
},
|
|
356
|
+
api: {
|
|
357
|
+
basePath: '/api/v1/iso'
|
|
358
|
+
},
|
|
359
|
+
features: {
|
|
360
|
+
analytics: true,
|
|
361
|
+
forecasting: true,
|
|
362
|
+
webhooks: true,
|
|
363
|
+
notifications: true,
|
|
364
|
+
export: true,
|
|
365
|
+
cache: true,
|
|
366
|
+
monitoring: true
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
templateRegistry.register(template);
|
|
370
|
+
return template;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Load all built-in templates
|
|
374
|
+
*/
|
|
375
|
+
export function loadAllTemplates() {
|
|
376
|
+
loadISOTemplate();
|
|
377
|
+
// Future: loadHealthcareTemplate(), loadFinanceTemplate(), loadRetailTemplate()
|
|
378
|
+
}
|
|
379
|
+
// Auto-load templates when module is imported
|
|
380
|
+
loadAllTemplates();
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Template Configuration System
|
|
3
|
+
*
|
|
4
|
+
* Defines the schema and types for Varity templates (ISO, Healthcare, Finance, Retail, etc.)
|
|
5
|
+
* Enables dynamic SDK configuration based on template selection
|
|
6
|
+
*/
|
|
7
|
+
import type { Network } from './types';
|
|
8
|
+
/**
|
|
9
|
+
* Available template types
|
|
10
|
+
*/
|
|
11
|
+
export type TemplateType = 'iso' | 'healthcare' | 'finance' | 'retail' | 'custom';
|
|
12
|
+
/**
|
|
13
|
+
* Contract configuration for a template
|
|
14
|
+
*/
|
|
15
|
+
export interface TemplateContract {
|
|
16
|
+
/** Contract name */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Contract description */
|
|
19
|
+
description?: string;
|
|
20
|
+
/** ABI file path or inline ABI */
|
|
21
|
+
abi: string | any[];
|
|
22
|
+
/** Contract address (per network) */
|
|
23
|
+
addresses: Partial<Record<Network, string>>;
|
|
24
|
+
/** Whether contract is required for template */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Entity configuration (e.g., Merchant, Patient, Customer)
|
|
29
|
+
*/
|
|
30
|
+
export interface TemplateEntity {
|
|
31
|
+
/** Entity name */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Display name */
|
|
34
|
+
displayName: string;
|
|
35
|
+
/** Entity description */
|
|
36
|
+
description?: string;
|
|
37
|
+
/** Primary identifier field */
|
|
38
|
+
idField: string;
|
|
39
|
+
/** Display field for entity */
|
|
40
|
+
displayField: string;
|
|
41
|
+
/** Available fields */
|
|
42
|
+
fields: EntityField[];
|
|
43
|
+
/** API endpoints for entity CRUD */
|
|
44
|
+
endpoints?: {
|
|
45
|
+
list?: string;
|
|
46
|
+
get?: string;
|
|
47
|
+
create?: string;
|
|
48
|
+
update?: string;
|
|
49
|
+
delete?: string;
|
|
50
|
+
};
|
|
51
|
+
/** Contract mapping configuration (optional - defaults to standard patterns) */
|
|
52
|
+
contractMapping?: {
|
|
53
|
+
/** Contract name (defaults to '{Entity}Registry') */
|
|
54
|
+
contractName?: string;
|
|
55
|
+
/** Function names for CRUD operations */
|
|
56
|
+
functions?: {
|
|
57
|
+
/** Create function (defaults to 'create{Entity}') */
|
|
58
|
+
create?: string;
|
|
59
|
+
/** Get/Read function (defaults to 'get{Entity}') */
|
|
60
|
+
get?: string;
|
|
61
|
+
/** Get all/List function (defaults to 'getAll{Entity}s') */
|
|
62
|
+
getAll?: string;
|
|
63
|
+
/** Update function (defaults to 'update{Entity}') */
|
|
64
|
+
update?: string;
|
|
65
|
+
/** Delete function (defaults to 'delete{Entity}') */
|
|
66
|
+
delete?: string;
|
|
67
|
+
/** Count function (defaults to 'get{Entity}Count') */
|
|
68
|
+
count?: string;
|
|
69
|
+
};
|
|
70
|
+
/** Field mappings (if contract field names differ from entity field names) */
|
|
71
|
+
fieldMappings?: Record<string, string>;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Entity field types - Universal support for all industries
|
|
76
|
+
*/
|
|
77
|
+
export type EntityFieldType = 'string' | 'number' | 'boolean' | 'enum' | 'array' | 'object' | 'currency' | 'decimal' | 'percentage' | 'date' | 'time' | 'datetime' | 'duration' | 'email' | 'phone' | 'url' | 'address' | 'ssn' | 'tax-id' | 'medical-code' | 'sku' | 'barcode' | 'rich-text' | 'markdown' | 'json' | 'file' | 'image' | 'document' | 'lookup' | 'multi-select' | 'coordinates' | 'color' | 'ip-address';
|
|
78
|
+
/**
|
|
79
|
+
* Entity field definition
|
|
80
|
+
*/
|
|
81
|
+
export interface EntityField {
|
|
82
|
+
/** Field name */
|
|
83
|
+
name: string;
|
|
84
|
+
/** Display label */
|
|
85
|
+
label: string;
|
|
86
|
+
/** Field type */
|
|
87
|
+
type: EntityFieldType;
|
|
88
|
+
/** Whether field is required */
|
|
89
|
+
required?: boolean;
|
|
90
|
+
/** Field description */
|
|
91
|
+
description?: string;
|
|
92
|
+
/** Enum values (if type is enum or multi-select) */
|
|
93
|
+
enumValues?: string[];
|
|
94
|
+
/** Lookup configuration (if type is lookup) */
|
|
95
|
+
lookupConfig?: {
|
|
96
|
+
entity: string;
|
|
97
|
+
displayField: string;
|
|
98
|
+
valueField: string;
|
|
99
|
+
};
|
|
100
|
+
/** Validation rules */
|
|
101
|
+
validation?: {
|
|
102
|
+
min?: number;
|
|
103
|
+
max?: number;
|
|
104
|
+
minLength?: number;
|
|
105
|
+
maxLength?: number;
|
|
106
|
+
pattern?: string;
|
|
107
|
+
precision?: number;
|
|
108
|
+
fileTypes?: string[];
|
|
109
|
+
maxFileSize?: number;
|
|
110
|
+
custom?: string;
|
|
111
|
+
};
|
|
112
|
+
/** Default value */
|
|
113
|
+
defaultValue?: any;
|
|
114
|
+
/** Placeholder text */
|
|
115
|
+
placeholder?: string;
|
|
116
|
+
/** Help text */
|
|
117
|
+
helperText?: string;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Event configuration for webhooks and notifications
|
|
121
|
+
*/
|
|
122
|
+
export interface TemplateEvent {
|
|
123
|
+
/** Event name */
|
|
124
|
+
name: string;
|
|
125
|
+
/** Display name */
|
|
126
|
+
displayName: string;
|
|
127
|
+
/** Event description */
|
|
128
|
+
description?: string;
|
|
129
|
+
/** Event category */
|
|
130
|
+
category: string;
|
|
131
|
+
/** Payload schema */
|
|
132
|
+
payloadSchema?: Record<string, any>;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Metric configuration for analytics
|
|
136
|
+
*/
|
|
137
|
+
export interface TemplateMetric {
|
|
138
|
+
/** Metric name */
|
|
139
|
+
name: string;
|
|
140
|
+
/** Display name */
|
|
141
|
+
displayName: string;
|
|
142
|
+
/** Metric description */
|
|
143
|
+
description?: string;
|
|
144
|
+
/** Metric type */
|
|
145
|
+
type: 'count' | 'sum' | 'average' | 'percentage' | 'rate';
|
|
146
|
+
/** Data source (API endpoint or query) */
|
|
147
|
+
source: string;
|
|
148
|
+
/** Aggregation function */
|
|
149
|
+
aggregation?: string;
|
|
150
|
+
/** Unit of measurement */
|
|
151
|
+
unit?: string;
|
|
152
|
+
/** Format for display */
|
|
153
|
+
format?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Dashboard configuration
|
|
157
|
+
*/
|
|
158
|
+
export interface TemplateDashboard {
|
|
159
|
+
/** Dashboard name */
|
|
160
|
+
name: string;
|
|
161
|
+
/** Display name */
|
|
162
|
+
displayName: string;
|
|
163
|
+
/** Dashboard description */
|
|
164
|
+
description?: string;
|
|
165
|
+
/** Widgets to display */
|
|
166
|
+
widgets: DashboardWidget[];
|
|
167
|
+
/** Default time range */
|
|
168
|
+
defaultTimeRange?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Dashboard widget configuration
|
|
172
|
+
*/
|
|
173
|
+
export interface DashboardWidget {
|
|
174
|
+
/** Widget type */
|
|
175
|
+
type: 'kpi' | 'chart' | 'table' | 'map' | 'list' | 'custom';
|
|
176
|
+
/** Widget title */
|
|
177
|
+
title: string;
|
|
178
|
+
/** Data source (metric name or API endpoint) */
|
|
179
|
+
source: string;
|
|
180
|
+
/** Widget size (grid units) */
|
|
181
|
+
size?: {
|
|
182
|
+
width: number;
|
|
183
|
+
height: number;
|
|
184
|
+
};
|
|
185
|
+
/** Widget position */
|
|
186
|
+
position?: {
|
|
187
|
+
x: number;
|
|
188
|
+
y: number;
|
|
189
|
+
};
|
|
190
|
+
/** Widget configuration */
|
|
191
|
+
config?: Record<string, any>;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Storage layer configuration for template
|
|
195
|
+
*/
|
|
196
|
+
export interface TemplateStorageConfig {
|
|
197
|
+
/** Varity internal namespace */
|
|
198
|
+
varityNamespace?: string;
|
|
199
|
+
/** Industry RAG namespace */
|
|
200
|
+
industryNamespace?: string;
|
|
201
|
+
/** Customer data namespace pattern */
|
|
202
|
+
customerNamespacePattern: string;
|
|
203
|
+
/** Encryption enabled */
|
|
204
|
+
encryptionEnabled: boolean;
|
|
205
|
+
/** Lit Protocol access conditions */
|
|
206
|
+
litProtocolEnabled: boolean;
|
|
207
|
+
/** Celestia DA enabled */
|
|
208
|
+
celestiaDAEnabled: boolean;
|
|
209
|
+
/** ZK proofs enabled */
|
|
210
|
+
zkProofsEnabled: boolean;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Complete template configuration
|
|
214
|
+
*/
|
|
215
|
+
export interface TemplateConfig {
|
|
216
|
+
/** Template type identifier */
|
|
217
|
+
type: TemplateType;
|
|
218
|
+
/** Template name */
|
|
219
|
+
name: string;
|
|
220
|
+
/** Template version */
|
|
221
|
+
version: string;
|
|
222
|
+
/** Template description */
|
|
223
|
+
description?: string;
|
|
224
|
+
/** Smart contracts for this template */
|
|
225
|
+
contracts: TemplateContract[];
|
|
226
|
+
/** Entities (data models) */
|
|
227
|
+
entities: TemplateEntity[];
|
|
228
|
+
/** Available events */
|
|
229
|
+
events: TemplateEvent[];
|
|
230
|
+
/** Available metrics */
|
|
231
|
+
metrics: TemplateMetric[];
|
|
232
|
+
/** Dashboard configurations */
|
|
233
|
+
dashboards?: TemplateDashboard[];
|
|
234
|
+
/** Storage configuration */
|
|
235
|
+
storage: TemplateStorageConfig;
|
|
236
|
+
/** API configuration */
|
|
237
|
+
api?: {
|
|
238
|
+
/** Base path for template APIs */
|
|
239
|
+
basePath: string;
|
|
240
|
+
/** Custom endpoints */
|
|
241
|
+
customEndpoints?: Record<string, string>;
|
|
242
|
+
};
|
|
243
|
+
/** Feature flags */
|
|
244
|
+
features?: {
|
|
245
|
+
analytics?: boolean;
|
|
246
|
+
forecasting?: boolean;
|
|
247
|
+
webhooks?: boolean;
|
|
248
|
+
notifications?: boolean;
|
|
249
|
+
export?: boolean;
|
|
250
|
+
cache?: boolean;
|
|
251
|
+
monitoring?: boolean;
|
|
252
|
+
};
|
|
253
|
+
/** Custom configuration */
|
|
254
|
+
custom?: Record<string, any>;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Template registry for loading and managing templates
|
|
258
|
+
*/
|
|
259
|
+
export declare class TemplateRegistry {
|
|
260
|
+
private templates;
|
|
261
|
+
/**
|
|
262
|
+
* Register a template configuration
|
|
263
|
+
*/
|
|
264
|
+
register(config: TemplateConfig): void;
|
|
265
|
+
/**
|
|
266
|
+
* Get template configuration by type
|
|
267
|
+
*/
|
|
268
|
+
get(type: TemplateType): TemplateConfig | undefined;
|
|
269
|
+
/**
|
|
270
|
+
* Check if template is registered
|
|
271
|
+
*/
|
|
272
|
+
has(type: TemplateType): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* List all registered templates
|
|
275
|
+
*/
|
|
276
|
+
list(): TemplateConfig[];
|
|
277
|
+
/**
|
|
278
|
+
* Load template from JSON
|
|
279
|
+
*/
|
|
280
|
+
loadFromJSON(json: string): TemplateConfig;
|
|
281
|
+
/**
|
|
282
|
+
* Load template from URL
|
|
283
|
+
*/
|
|
284
|
+
loadFromURL(url: string): Promise<TemplateConfig>;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Global template registry instance
|
|
288
|
+
*/
|
|
289
|
+
export declare const templateRegistry: TemplateRegistry;
|
|
290
|
+
/**
|
|
291
|
+
* Validate template configuration
|
|
292
|
+
*/
|
|
293
|
+
export declare function validateTemplate(config: TemplateConfig): {
|
|
294
|
+
valid: boolean;
|
|
295
|
+
errors: string[];
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Get contract ABI by name from template
|
|
299
|
+
*/
|
|
300
|
+
export declare function getContractABI(template: TemplateConfig, contractName: string): any[] | null;
|
|
301
|
+
/**
|
|
302
|
+
* Get contract address for network
|
|
303
|
+
*/
|
|
304
|
+
export declare function getContractAddress(template: TemplateConfig, contractName: string, network: Network): string | null;
|
|
305
|
+
/**
|
|
306
|
+
* Get entity configuration by name
|
|
307
|
+
*/
|
|
308
|
+
export declare function getEntity(template: TemplateConfig, entityName: string): TemplateEntity | null;
|
|
309
|
+
/**
|
|
310
|
+
* Get metric configuration by name
|
|
311
|
+
*/
|
|
312
|
+
export declare function getMetric(template: TemplateConfig, metricName: string): TemplateMetric | null;
|
|
313
|
+
/**
|
|
314
|
+
* Get event configuration by name
|
|
315
|
+
*/
|
|
316
|
+
export declare function getEvent(template: TemplateConfig, eventName: string): TemplateEvent | null;
|
|
317
|
+
/**
|
|
318
|
+
* Merge template configuration with overrides
|
|
319
|
+
*/
|
|
320
|
+
export declare function mergeTemplateConfig(base: TemplateConfig, overrides: Partial<TemplateConfig>): TemplateConfig;
|
|
321
|
+
//# sourceMappingURL=template.d.ts.map
|