@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.
Files changed (295) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +253 -0
  3. package/dist/analytics/index.d.ts +7 -0
  4. package/dist/analytics/index.d.ts.map +1 -0
  5. package/dist/analytics/index.js +6 -0
  6. package/dist/analytics/tracker.d.ts +128 -0
  7. package/dist/analytics/tracker.d.ts.map +1 -0
  8. package/dist/analytics/tracker.js +203 -0
  9. package/dist/blockchain/BlockchainService.d.ts +100 -0
  10. package/dist/blockchain/BlockchainService.d.ts.map +1 -0
  11. package/dist/blockchain/BlockchainService.js +188 -0
  12. package/dist/blockchain/NFTLicensingService.d.ts +69 -0
  13. package/dist/blockchain/NFTLicensingService.d.ts.map +1 -0
  14. package/dist/blockchain/NFTLicensingService.js +136 -0
  15. package/dist/blockchain/RevenueSplitService.d.ts +71 -0
  16. package/dist/blockchain/RevenueSplitService.d.ts.map +1 -0
  17. package/dist/blockchain/RevenueSplitService.js +111 -0
  18. package/dist/blockchain/index.d.ts +48 -0
  19. package/dist/blockchain/index.d.ts.map +1 -0
  20. package/dist/blockchain/index.js +46 -0
  21. package/dist/blockchain/types.d.ts +63 -0
  22. package/dist/blockchain/types.d.ts.map +1 -0
  23. package/dist/blockchain/types.js +6 -0
  24. package/dist/chains/arbitrum.d.ts +89 -0
  25. package/dist/chains/arbitrum.d.ts.map +1 -0
  26. package/dist/chains/arbitrum.js +134 -0
  27. package/dist/chains/base.d.ts +84 -0
  28. package/dist/chains/base.d.ts.map +1 -0
  29. package/dist/chains/base.js +131 -0
  30. package/dist/chains/index.d.ts +36 -0
  31. package/dist/chains/index.d.ts.map +1 -0
  32. package/dist/chains/index.js +32 -0
  33. package/dist/chains/registry.d.ts +113 -0
  34. package/dist/chains/registry.d.ts.map +1 -0
  35. package/dist/chains/registry.js +201 -0
  36. package/dist/chains/varityL3.d.ts +81 -0
  37. package/dist/chains/varityL3.d.ts.map +1 -0
  38. package/dist/chains/varityL3.js +125 -0
  39. package/dist/cli/commands/clone.d.ts +8 -0
  40. package/dist/cli/commands/clone.d.ts.map +1 -0
  41. package/dist/cli/commands/clone.js +391 -0
  42. package/dist/cli/commands/dev.d.ts +8 -0
  43. package/dist/cli/commands/dev.d.ts.map +1 -0
  44. package/dist/cli/commands/dev.js +40 -0
  45. package/dist/cli/commands/generate.d.ts +8 -0
  46. package/dist/cli/commands/generate.d.ts.map +1 -0
  47. package/dist/cli/commands/generate.js +303 -0
  48. package/dist/cli/commands/init.d.ts +8 -0
  49. package/dist/cli/commands/init.d.ts.map +1 -0
  50. package/dist/cli/commands/init.js +317 -0
  51. package/dist/cli/commands/validate.d.ts +8 -0
  52. package/dist/cli/commands/validate.d.ts.map +1 -0
  53. package/dist/cli/commands/validate.js +69 -0
  54. package/dist/cli/index.d.ts +8 -0
  55. package/dist/cli/index.d.ts.map +1 -0
  56. package/dist/cli/index.js +33 -0
  57. package/dist/cli/utils/logger.d.ts +17 -0
  58. package/dist/cli/utils/logger.d.ts.map +1 -0
  59. package/dist/cli/utils/logger.js +35 -0
  60. package/dist/cli/utils/prompts.d.ts +21 -0
  61. package/dist/cli/utils/prompts.d.ts.map +1 -0
  62. package/dist/cli/utils/prompts.js +103 -0
  63. package/dist/contracts/abis/iso/AccessControlRegistry.json +1468 -0
  64. package/dist/contracts/abis/iso/DataProofRegistry.json +797 -0
  65. package/dist/contracts/abis/iso/MerchantRegistry.json +1237 -0
  66. package/dist/contracts/abis/iso/RepPerformance.json +1351 -0
  67. package/dist/contracts/abis/iso/ResidualCalculator.json +1118 -0
  68. package/dist/contracts/abis/iso/TransactionVault.json +1588 -0
  69. package/dist/contracts/abis/iso/VarityWalletFactory.json +475 -0
  70. package/dist/contracts/addresses.d.ts +88 -0
  71. package/dist/contracts/addresses.d.ts.map +1 -0
  72. package/dist/contracts/addresses.js +94 -0
  73. package/dist/contracts/index.d.ts +7 -0
  74. package/dist/contracts/index.d.ts.map +1 -0
  75. package/dist/contracts/index.js +6 -0
  76. package/dist/core/VaritySDK.d.ts +177 -0
  77. package/dist/core/VaritySDK.d.ts.map +1 -0
  78. package/dist/core/VaritySDK.js +325 -0
  79. package/dist/core/config.d.ts +120 -0
  80. package/dist/core/config.d.ts.map +1 -0
  81. package/dist/core/config.js +187 -0
  82. package/dist/core/credentials-proxy.d.ts +157 -0
  83. package/dist/core/credentials-proxy.d.ts.map +1 -0
  84. package/dist/core/credentials-proxy.js +345 -0
  85. package/dist/core/credentials.d.ts +219 -0
  86. package/dist/core/credentials.d.ts.map +1 -0
  87. package/dist/core/credentials.js +345 -0
  88. package/dist/core/template-loader.d.ts +15 -0
  89. package/dist/core/template-loader.d.ts.map +1 -0
  90. package/dist/core/template-loader.js +380 -0
  91. package/dist/core/template.d.ts +321 -0
  92. package/dist/core/template.d.ts.map +1 -0
  93. package/dist/core/template.js +189 -0
  94. package/dist/core/types.d.ts +572 -0
  95. package/dist/core/types.d.ts.map +1 -0
  96. package/dist/core/types.js +52 -0
  97. package/dist/dev/dev-server.d.ts +16 -0
  98. package/dist/dev/dev-server.d.ts.map +1 -0
  99. package/dist/dev/dev-server.js +119 -0
  100. package/dist/generators/contracts/generator.d.ts +21 -0
  101. package/dist/generators/contracts/generator.d.ts.map +1 -0
  102. package/dist/generators/contracts/generator.js +252 -0
  103. package/dist/generators/tests/generator.d.ts +20 -0
  104. package/dist/generators/tests/generator.d.ts.map +1 -0
  105. package/dist/generators/tests/generator.js +375 -0
  106. package/dist/generators/types/generator.d.ts +19 -0
  107. package/dist/generators/types/generator.d.ts.map +1 -0
  108. package/dist/generators/types/generator.js +165 -0
  109. package/dist/generators/ui/component-generator.d.ts +20 -0
  110. package/dist/generators/ui/component-generator.d.ts.map +1 -0
  111. package/dist/generators/ui/component-generator.js +749 -0
  112. package/dist/generators/ui/dashboard-generator.d.ts +20 -0
  113. package/dist/generators/ui/dashboard-generator.d.ts.map +1 -0
  114. package/dist/generators/ui/dashboard-generator.js +349 -0
  115. package/dist/index.d.ts +61 -0
  116. package/dist/index.d.ts.map +1 -0
  117. package/dist/index.js +74 -0
  118. package/dist/modules/analytics/AnalyticsModule.d.ts +349 -0
  119. package/dist/modules/analytics/AnalyticsModule.d.ts.map +1 -0
  120. package/dist/modules/analytics/AnalyticsModule.js +274 -0
  121. package/dist/modules/analytics/index.d.ts +3 -0
  122. package/dist/modules/analytics/index.d.ts.map +1 -0
  123. package/dist/modules/analytics/index.js +1 -0
  124. package/dist/modules/auth/AccessKeyModule.d.ts +189 -0
  125. package/dist/modules/auth/AccessKeyModule.d.ts.map +1 -0
  126. package/dist/modules/auth/AccessKeyModule.js +322 -0
  127. package/dist/modules/auth/AuthModule.d.ts +133 -0
  128. package/dist/modules/auth/AuthModule.d.ts.map +1 -0
  129. package/dist/modules/auth/AuthModule.js +214 -0
  130. package/dist/modules/auth/index.d.ts +8 -0
  131. package/dist/modules/auth/index.d.ts.map +1 -0
  132. package/dist/modules/auth/index.js +6 -0
  133. package/dist/modules/cache/CacheModule.d.ts +279 -0
  134. package/dist/modules/cache/CacheModule.d.ts.map +1 -0
  135. package/dist/modules/cache/CacheModule.js +493 -0
  136. package/dist/modules/cache/index.d.ts +3 -0
  137. package/dist/modules/cache/index.d.ts.map +1 -0
  138. package/dist/modules/cache/index.js +1 -0
  139. package/dist/modules/compute/ComputeModule.d.ts +226 -0
  140. package/dist/modules/compute/ComputeModule.d.ts.map +1 -0
  141. package/dist/modules/compute/ComputeModule.js +379 -0
  142. package/dist/modules/compute/index.d.ts +6 -0
  143. package/dist/modules/compute/index.d.ts.map +1 -0
  144. package/dist/modules/compute/index.js +4 -0
  145. package/dist/modules/contracts/ContractsModule.d.ts +164 -0
  146. package/dist/modules/contracts/ContractsModule.d.ts.map +1 -0
  147. package/dist/modules/contracts/ContractsModule.js +242 -0
  148. package/dist/modules/contracts/index.d.ts +6 -0
  149. package/dist/modules/contracts/index.d.ts.map +1 -0
  150. package/dist/modules/contracts/index.js +4 -0
  151. package/dist/modules/export/ExportModule.d.ts +346 -0
  152. package/dist/modules/export/ExportModule.d.ts.map +1 -0
  153. package/dist/modules/export/ExportModule.js +432 -0
  154. package/dist/modules/export/index.d.ts +3 -0
  155. package/dist/modules/export/index.d.ts.map +1 -0
  156. package/dist/modules/export/index.js +1 -0
  157. package/dist/modules/forecasting/ForecastingModule.d.ts +579 -0
  158. package/dist/modules/forecasting/ForecastingModule.d.ts.map +1 -0
  159. package/dist/modules/forecasting/ForecastingModule.js +310 -0
  160. package/dist/modules/forecasting/index.d.ts +3 -0
  161. package/dist/modules/forecasting/index.d.ts.map +1 -0
  162. package/dist/modules/forecasting/index.js +1 -0
  163. package/dist/modules/monitoring/MonitoringModule.d.ts +359 -0
  164. package/dist/modules/monitoring/MonitoringModule.d.ts.map +1 -0
  165. package/dist/modules/monitoring/MonitoringModule.js +483 -0
  166. package/dist/modules/monitoring/index.d.ts +3 -0
  167. package/dist/modules/monitoring/index.d.ts.map +1 -0
  168. package/dist/modules/monitoring/index.js +1 -0
  169. package/dist/modules/notifications/NotificationsModule.d.ts +336 -0
  170. package/dist/modules/notifications/NotificationsModule.d.ts.map +1 -0
  171. package/dist/modules/notifications/NotificationsModule.js +418 -0
  172. package/dist/modules/notifications/index.d.ts +3 -0
  173. package/dist/modules/notifications/index.d.ts.map +1 -0
  174. package/dist/modules/notifications/index.js +1 -0
  175. package/dist/modules/oracle/OracleModule.d.ts +110 -0
  176. package/dist/modules/oracle/OracleModule.d.ts.map +1 -0
  177. package/dist/modules/oracle/OracleModule.js +151 -0
  178. package/dist/modules/oracle/index.d.ts +6 -0
  179. package/dist/modules/oracle/index.d.ts.map +1 -0
  180. package/dist/modules/oracle/index.js +4 -0
  181. package/dist/modules/storage/S3Module.d.ts +377 -0
  182. package/dist/modules/storage/S3Module.d.ts.map +1 -0
  183. package/dist/modules/storage/S3Module.js +680 -0
  184. package/dist/modules/storage/StorageModule.d.ts +157 -0
  185. package/dist/modules/storage/StorageModule.d.ts.map +1 -0
  186. package/dist/modules/storage/StorageModule.js +302 -0
  187. package/dist/modules/storage/adapters/AdapterFactory.d.ts +100 -0
  188. package/dist/modules/storage/adapters/AdapterFactory.d.ts.map +1 -0
  189. package/dist/modules/storage/adapters/AdapterFactory.js +209 -0
  190. package/dist/modules/storage/adapters/FilecoinAdapter.d.ts +94 -0
  191. package/dist/modules/storage/adapters/FilecoinAdapter.d.ts.map +1 -0
  192. package/dist/modules/storage/adapters/FilecoinAdapter.js +263 -0
  193. package/dist/modules/storage/adapters/IStorageAdapter.d.ts +287 -0
  194. package/dist/modules/storage/adapters/IStorageAdapter.d.ts.map +1 -0
  195. package/dist/modules/storage/adapters/IStorageAdapter.js +81 -0
  196. package/dist/modules/storage/adapters/MultiTierAdapter.d.ts +187 -0
  197. package/dist/modules/storage/adapters/MultiTierAdapter.d.ts.map +1 -0
  198. package/dist/modules/storage/adapters/MultiTierAdapter.js +430 -0
  199. package/dist/modules/storage/adapters/index.d.ts +12 -0
  200. package/dist/modules/storage/adapters/index.d.ts.map +1 -0
  201. package/dist/modules/storage/adapters/index.js +12 -0
  202. package/dist/modules/storage/index.d.ts +16 -0
  203. package/dist/modules/storage/index.d.ts.map +1 -0
  204. package/dist/modules/storage/index.js +15 -0
  205. package/dist/modules/storage/tiering/AccessAnalyzer.d.ts +227 -0
  206. package/dist/modules/storage/tiering/AccessAnalyzer.d.ts.map +1 -0
  207. package/dist/modules/storage/tiering/AccessAnalyzer.js +367 -0
  208. package/dist/modules/storage/tiering/CostOptimizer.d.ts +248 -0
  209. package/dist/modules/storage/tiering/CostOptimizer.d.ts.map +1 -0
  210. package/dist/modules/storage/tiering/CostOptimizer.js +356 -0
  211. package/dist/modules/storage/tiering/MetadataStore.d.ts +287 -0
  212. package/dist/modules/storage/tiering/MetadataStore.d.ts.map +1 -0
  213. package/dist/modules/storage/tiering/MetadataStore.js +535 -0
  214. package/dist/modules/storage/tiering/TieringEngine.d.ts +237 -0
  215. package/dist/modules/storage/tiering/TieringEngine.d.ts.map +1 -0
  216. package/dist/modules/storage/tiering/TieringEngine.js +419 -0
  217. package/dist/modules/storage/tiering/example.d.ts +8 -0
  218. package/dist/modules/storage/tiering/example.d.ts.map +1 -0
  219. package/dist/modules/storage/tiering/example.js +250 -0
  220. package/dist/modules/storage/tiering/index.d.ts +17 -0
  221. package/dist/modules/storage/tiering/index.d.ts.map +1 -0
  222. package/dist/modules/storage/tiering/index.js +13 -0
  223. package/dist/modules/webhooks/WebhooksModule.d.ts +476 -0
  224. package/dist/modules/webhooks/WebhooksModule.d.ts.map +1 -0
  225. package/dist/modules/webhooks/WebhooksModule.js +359 -0
  226. package/dist/modules/webhooks/index.d.ts +3 -0
  227. package/dist/modules/webhooks/index.d.ts.map +1 -0
  228. package/dist/modules/webhooks/index.js +1 -0
  229. package/dist/modules/zk/ZKModule.d.ts +153 -0
  230. package/dist/modules/zk/ZKModule.d.ts.map +1 -0
  231. package/dist/modules/zk/ZKModule.js +262 -0
  232. package/dist/modules/zk/index.d.ts +7 -0
  233. package/dist/modules/zk/index.d.ts.map +1 -0
  234. package/dist/modules/zk/index.js +4 -0
  235. package/dist/thirdweb/BridgeClient.d.ts +228 -0
  236. package/dist/thirdweb/BridgeClient.d.ts.map +1 -0
  237. package/dist/thirdweb/BridgeClient.js +160 -0
  238. package/dist/thirdweb/EngineClient.d.ts +396 -0
  239. package/dist/thirdweb/EngineClient.d.ts.map +1 -0
  240. package/dist/thirdweb/EngineClient.js +386 -0
  241. package/dist/thirdweb/GatewayClient.d.ts +190 -0
  242. package/dist/thirdweb/GatewayClient.d.ts.map +1 -0
  243. package/dist/thirdweb/GatewayClient.js +257 -0
  244. package/dist/thirdweb/NebulaClient.d.ts +292 -0
  245. package/dist/thirdweb/NebulaClient.d.ts.map +1 -0
  246. package/dist/thirdweb/NebulaClient.js +180 -0
  247. package/dist/thirdweb/StorageClient.d.ts +445 -0
  248. package/dist/thirdweb/StorageClient.d.ts.map +1 -0
  249. package/dist/thirdweb/StorageClient.js +405 -0
  250. package/dist/thirdweb/ThirdwebWrapper.d.ts +236 -0
  251. package/dist/thirdweb/ThirdwebWrapper.d.ts.map +1 -0
  252. package/dist/thirdweb/ThirdwebWrapper.js +332 -0
  253. package/dist/thirdweb/index.d.ts +21 -0
  254. package/dist/thirdweb/index.d.ts.map +1 -0
  255. package/dist/thirdweb/index.js +28 -0
  256. package/dist/thirdweb/varity-chain.d.ts +48 -0
  257. package/dist/thirdweb/varity-chain.d.ts.map +1 -0
  258. package/dist/thirdweb/varity-chain.js +64 -0
  259. package/dist/thirdweb/x402Client.d.ts +319 -0
  260. package/dist/thirdweb/x402Client.d.ts.map +1 -0
  261. package/dist/thirdweb/x402Client.js +223 -0
  262. package/dist/tracking/gasTracker.d.ts +158 -0
  263. package/dist/tracking/gasTracker.d.ts.map +1 -0
  264. package/dist/tracking/gasTracker.js +227 -0
  265. package/dist/tracking/index.d.ts +10 -0
  266. package/dist/tracking/index.d.ts.map +1 -0
  267. package/dist/tracking/index.js +8 -0
  268. package/dist/tracking/types.d.ts +327 -0
  269. package/dist/tracking/types.d.ts.map +1 -0
  270. package/dist/tracking/types.js +8 -0
  271. package/dist/ui/components/ChartWidget.d.ts +36 -0
  272. package/dist/ui/components/ChartWidget.d.ts.map +1 -0
  273. package/dist/ui/components/ChartWidget.js +82 -0
  274. package/dist/ui/components/DashboardLayout.d.ts +41 -0
  275. package/dist/ui/components/DashboardLayout.d.ts.map +1 -0
  276. package/dist/ui/components/DashboardLayout.js +102 -0
  277. package/dist/ui/components/DataTable.d.ts +49 -0
  278. package/dist/ui/components/DataTable.d.ts.map +1 -0
  279. package/dist/ui/components/DataTable.js +96 -0
  280. package/dist/ui/components/EntityForm.d.ts +60 -0
  281. package/dist/ui/components/EntityForm.d.ts.map +1 -0
  282. package/dist/ui/components/EntityForm.js +182 -0
  283. package/dist/ui/components/KPICard.d.ts +29 -0
  284. package/dist/ui/components/KPICard.d.ts.map +1 -0
  285. package/dist/ui/components/KPICard.js +61 -0
  286. package/dist/ui/components/Modal.d.ts +34 -0
  287. package/dist/ui/components/Modal.d.ts.map +1 -0
  288. package/dist/ui/components/Modal.js +30 -0
  289. package/dist/ui/components/index.d.ts +18 -0
  290. package/dist/ui/components/index.d.ts.map +1 -0
  291. package/dist/ui/components/index.js +11 -0
  292. package/dist/validation/template-validator.d.ts +25 -0
  293. package/dist/validation/template-validator.d.ts.map +1 -0
  294. package/dist/validation/template-validator.js +305 -0
  295. package/package.json +102 -0
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Chain Registry - Multi-Chain Configuration System
3
+ *
4
+ * Central registry for all supported blockchain networks in Varity SDK
5
+ * Supports Varity L3, Arbitrum, Base, and other EVM chains
6
+ */
7
+ import { type Chain } from 'thirdweb/chains';
8
+ /**
9
+ * Chain Selection Configuration
10
+ */
11
+ export interface ChainSelection {
12
+ /**
13
+ * Optimization priority
14
+ */
15
+ optimize: 'cost' | 'speed' | 'security';
16
+ /**
17
+ * Optional requirements for chain selection
18
+ */
19
+ requirements?: {
20
+ /**
21
+ * Maximum acceptable gas price (in wei)
22
+ */
23
+ maxGasPrice?: bigint;
24
+ /**
25
+ * Minimum transactions per second
26
+ */
27
+ minTPS?: number;
28
+ /**
29
+ * Privacy level required
30
+ */
31
+ privacy?: 'none' | 'lit' | 'fhe' | 'tee';
32
+ /**
33
+ * Require testnet
34
+ */
35
+ testnet?: boolean;
36
+ };
37
+ }
38
+ /**
39
+ * Chain metadata for selection
40
+ */
41
+ export interface ChainMetadata {
42
+ chain: Chain;
43
+ averageGasPrice: bigint;
44
+ estimatedTPS: number;
45
+ privacyLevel: 'none' | 'lit' | 'fhe' | 'tee';
46
+ costRating: number;
47
+ speedRating: number;
48
+ securityRating: number;
49
+ }
50
+ /**
51
+ * Chain Registry Class
52
+ *
53
+ * Provides centralized access to all supported chains and intelligent
54
+ * chain selection based on application requirements
55
+ */
56
+ export declare class ChainRegistry {
57
+ private static chains;
58
+ /**
59
+ * Initialize the registry with chain metadata
60
+ */
61
+ static initialize(): void;
62
+ /**
63
+ * Get all supported chains
64
+ */
65
+ static getAllChains(): Chain[];
66
+ /**
67
+ * Get chain by ID
68
+ */
69
+ static getChain(chainId: number): Chain;
70
+ /**
71
+ * Get chain metadata
72
+ */
73
+ static getChainMetadata(chainId: number): ChainMetadata;
74
+ /**
75
+ * Select optimal chain based on requirements
76
+ */
77
+ static selectChain(config: ChainSelection): Chain;
78
+ /**
79
+ * Get testnet chains only
80
+ */
81
+ static getTestnetChains(): Chain[];
82
+ /**
83
+ * Get mainnet chains only
84
+ */
85
+ static getMainnetChains(): Chain[];
86
+ /**
87
+ * Check if chain is supported
88
+ */
89
+ static isSupported(chainId: number): boolean;
90
+ /**
91
+ * Add custom chain to registry
92
+ */
93
+ static addChain(chainId: number, metadata: ChainMetadata): void;
94
+ }
95
+ /**
96
+ * Convenience exports
97
+ */
98
+ export declare const SUPPORTED_CHAINS: Readonly<import("thirdweb/chains").ChainOptions & {
99
+ rpc: string;
100
+ }>[];
101
+ export declare const TESTNET_CHAINS: Readonly<import("thirdweb/chains").ChainOptions & {
102
+ rpc: string;
103
+ }>[];
104
+ export declare const MAINNET_CHAINS: Readonly<import("thirdweb/chains").ChainOptions & {
105
+ rpc: string;
106
+ }>[];
107
+ /**
108
+ * Default chain (Varity L3 Testnet)
109
+ */
110
+ export declare const DEFAULT_CHAIN: Readonly<import("thirdweb/chains").ChainOptions & {
111
+ rpc: string;
112
+ }>;
113
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/chains/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAK1D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAExC;;OAEG;IACH,YAAY,CAAC,EAAE;QACb;;WAEG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;QAErB;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;QAEzC;;WAEG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAyC;IAE9D;;OAEG;IACH,MAAM,CAAC,UAAU,IAAI,IAAI;IAyDzB;;OAEG;IACH,MAAM,CAAC,YAAY,IAAI,KAAK,EAAE;IAO9B;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK;IAavC;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa;IAavD;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,GAAG,KAAK;IAgDjD;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,KAAK,EAAE;IAUlC;;OAEG;IACH,MAAM,CAAC,gBAAgB,IAAI,KAAK,EAAE;IAUlC;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAO5C;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI;CAMhE;AAKD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;IAA+B,CAAC;AAC7D,eAAO,MAAM,cAAc;;IAAmC,CAAC;AAC/D,eAAO,MAAM,cAAc;;IAAmC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,aAAa;;EAAkB,CAAC"}
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Chain Registry - Multi-Chain Configuration System
3
+ *
4
+ * Central registry for all supported blockchain networks in Varity SDK
5
+ * Supports Varity L3, Arbitrum, Base, and other EVM chains
6
+ */
7
+ import { varityL3Testnet } from './varityL3';
8
+ import { arbitrumSepolia, arbitrum } from './arbitrum';
9
+ import { baseSepolia, base } from './base';
10
+ /**
11
+ * Chain Registry Class
12
+ *
13
+ * Provides centralized access to all supported chains and intelligent
14
+ * chain selection based on application requirements
15
+ */
16
+ export class ChainRegistry {
17
+ /**
18
+ * Initialize the registry with chain metadata
19
+ */
20
+ static initialize() {
21
+ // Varity L3 Testnet
22
+ this.chains.set(33529, {
23
+ chain: varityL3Testnet,
24
+ averageGasPrice: BigInt(100000000), // 0.1 gwei (very low)
25
+ estimatedTPS: 500,
26
+ privacyLevel: 'none',
27
+ costRating: 1, // Cheapest
28
+ speedRating: 8,
29
+ securityRating: 7,
30
+ });
31
+ // Arbitrum Sepolia (testnet)
32
+ this.chains.set(421614, {
33
+ chain: arbitrumSepolia,
34
+ averageGasPrice: BigInt(100000000), // 0.1 gwei
35
+ estimatedTPS: 4000,
36
+ privacyLevel: 'none',
37
+ costRating: 2,
38
+ speedRating: 9,
39
+ securityRating: 8,
40
+ });
41
+ // Arbitrum One (mainnet)
42
+ this.chains.set(42161, {
43
+ chain: arbitrum,
44
+ averageGasPrice: BigInt(100000000), // 0.1 gwei
45
+ estimatedTPS: 4000,
46
+ privacyLevel: 'none',
47
+ costRating: 3,
48
+ speedRating: 9,
49
+ securityRating: 9,
50
+ });
51
+ // Base Sepolia (testnet)
52
+ this.chains.set(84532, {
53
+ chain: baseSepolia,
54
+ averageGasPrice: BigInt(100000000), // 0.1 gwei
55
+ estimatedTPS: 2000,
56
+ privacyLevel: 'none',
57
+ costRating: 2,
58
+ speedRating: 8,
59
+ securityRating: 8,
60
+ });
61
+ // Base (mainnet)
62
+ this.chains.set(8453, {
63
+ chain: base,
64
+ averageGasPrice: BigInt(100000000), // 0.1 gwei
65
+ estimatedTPS: 2000,
66
+ privacyLevel: 'none',
67
+ costRating: 3,
68
+ speedRating: 8,
69
+ securityRating: 9,
70
+ });
71
+ }
72
+ /**
73
+ * Get all supported chains
74
+ */
75
+ static getAllChains() {
76
+ if (this.chains.size === 0) {
77
+ this.initialize();
78
+ }
79
+ return Array.from(this.chains.values()).map(meta => meta.chain);
80
+ }
81
+ /**
82
+ * Get chain by ID
83
+ */
84
+ static getChain(chainId) {
85
+ if (this.chains.size === 0) {
86
+ this.initialize();
87
+ }
88
+ const metadata = this.chains.get(chainId);
89
+ if (!metadata) {
90
+ throw new Error(`Chain ${chainId} not found in registry`);
91
+ }
92
+ return metadata.chain;
93
+ }
94
+ /**
95
+ * Get chain metadata
96
+ */
97
+ static getChainMetadata(chainId) {
98
+ if (this.chains.size === 0) {
99
+ this.initialize();
100
+ }
101
+ const metadata = this.chains.get(chainId);
102
+ if (!metadata) {
103
+ throw new Error(`Chain ${chainId} not found in registry`);
104
+ }
105
+ return metadata;
106
+ }
107
+ /**
108
+ * Select optimal chain based on requirements
109
+ */
110
+ static selectChain(config) {
111
+ if (this.chains.size === 0) {
112
+ this.initialize();
113
+ }
114
+ let candidates = Array.from(this.chains.values());
115
+ // Filter by requirements
116
+ if (config.requirements) {
117
+ const { maxGasPrice, minTPS, privacy, testnet } = config.requirements;
118
+ if (maxGasPrice) {
119
+ candidates = candidates.filter(c => c.averageGasPrice <= maxGasPrice);
120
+ }
121
+ if (minTPS) {
122
+ candidates = candidates.filter(c => c.estimatedTPS >= minTPS);
123
+ }
124
+ if (privacy && privacy !== 'none') {
125
+ candidates = candidates.filter(c => c.privacyLevel === privacy);
126
+ }
127
+ if (testnet !== undefined) {
128
+ candidates = candidates.filter(c => c.chain.testnet === testnet);
129
+ }
130
+ }
131
+ if (candidates.length === 0) {
132
+ throw new Error('No chains match the specified requirements');
133
+ }
134
+ // Sort by optimization priority
135
+ switch (config.optimize) {
136
+ case 'cost':
137
+ candidates.sort((a, b) => a.costRating - b.costRating);
138
+ break;
139
+ case 'speed':
140
+ candidates.sort((a, b) => b.speedRating - a.speedRating);
141
+ break;
142
+ case 'security':
143
+ candidates.sort((a, b) => b.securityRating - a.securityRating);
144
+ break;
145
+ }
146
+ return candidates[0].chain;
147
+ }
148
+ /**
149
+ * Get testnet chains only
150
+ */
151
+ static getTestnetChains() {
152
+ if (this.chains.size === 0) {
153
+ this.initialize();
154
+ }
155
+ return Array.from(this.chains.values())
156
+ .filter(meta => meta.chain.testnet === true)
157
+ .map(meta => meta.chain);
158
+ }
159
+ /**
160
+ * Get mainnet chains only
161
+ */
162
+ static getMainnetChains() {
163
+ if (this.chains.size === 0) {
164
+ this.initialize();
165
+ }
166
+ return Array.from(this.chains.values())
167
+ .filter(meta => meta.chain.testnet !== true)
168
+ .map(meta => meta.chain);
169
+ }
170
+ /**
171
+ * Check if chain is supported
172
+ */
173
+ static isSupported(chainId) {
174
+ if (this.chains.size === 0) {
175
+ this.initialize();
176
+ }
177
+ return this.chains.has(chainId);
178
+ }
179
+ /**
180
+ * Add custom chain to registry
181
+ */
182
+ static addChain(chainId, metadata) {
183
+ if (this.chains.size === 0) {
184
+ this.initialize();
185
+ }
186
+ this.chains.set(chainId, metadata);
187
+ }
188
+ }
189
+ ChainRegistry.chains = new Map();
190
+ // Initialize on import
191
+ ChainRegistry.initialize();
192
+ /**
193
+ * Convenience exports
194
+ */
195
+ export const SUPPORTED_CHAINS = ChainRegistry.getAllChains();
196
+ export const TESTNET_CHAINS = ChainRegistry.getTestnetChains();
197
+ export const MAINNET_CHAINS = ChainRegistry.getMainnetChains();
198
+ /**
199
+ * Default chain (Varity L3 Testnet)
200
+ */
201
+ export const DEFAULT_CHAIN = varityL3Testnet;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Varity L3 Chain Configuration
3
+ *
4
+ * Varity L3 is an Arbitrum Orbit rollup deployed on Conduit
5
+ * Chain ID: 33529
6
+ * Native Token: Bridged USDC (6 decimals - NOT 18!)
7
+ */
8
+ /**
9
+ * Varity L3 Testnet Configuration
10
+ *
11
+ * CRITICAL NOTES:
12
+ * - Native token is USDC with 6 decimals (not 18 like ETH)
13
+ * - All token amounts must account for 6 decimals: 1 USDC = 1_000_000 (not 10^18)
14
+ * - Chain ID 33529 is unique to Varity L3 testnet
15
+ * - RPC URL is Conduit-hosted (managed Arbitrum Orbit)
16
+ */
17
+ export declare const varityL3Testnet: Readonly<import("thirdweb/chains").ChainOptions & {
18
+ rpc: string;
19
+ }>;
20
+ /**
21
+ * Alias for varityL3Testnet (for backwards compatibility)
22
+ */
23
+ export declare const varityL3: Readonly<import("thirdweb/chains").ChainOptions & {
24
+ rpc: string;
25
+ }>;
26
+ /**
27
+ * USDC decimals constant
28
+ */
29
+ export declare const USDC_DECIMALS = 6;
30
+ /**
31
+ * USDC Contract Address on Varity L3
32
+ * CRITICAL: This is bridged USDC with 6 decimals
33
+ */
34
+ export declare const VARITY_USDC_ADDRESS = "0x6Fd8ee6B4C2193e9E2e0E2EC5D295689B607c0cE";
35
+ /**
36
+ * Format USDC amount (6 decimals)
37
+ */
38
+ export declare function formatUSDC(amount: bigint | string | number, decimals?: number): string;
39
+ /**
40
+ * Parse USDC amount to bigint (6 decimals)
41
+ */
42
+ export declare function parseUSDC(amount: string | number): bigint;
43
+ /**
44
+ * Block explorer URL builder
45
+ */
46
+ export declare function getExplorerUrl(type: 'tx' | 'address' | 'block', hash: string): string;
47
+ /**
48
+ * Format address for display (0x1234...5678)
49
+ */
50
+ export declare function formatAddress(address: string, startChars?: number, endChars?: number): string;
51
+ /**
52
+ * Wagmi-compatible chain configuration for Privy integration
53
+ * NOTE: nativeCurrency should NOT have an address field - that's non-standard
54
+ * and can cause issues with wallet_switchEthereumChain
55
+ */
56
+ export declare const varityL3Wagmi: {
57
+ readonly id: 33529;
58
+ readonly name: "Varity L3 Testnet";
59
+ readonly network: "varity-testnet";
60
+ readonly nativeCurrency: {
61
+ readonly name: "USDC";
62
+ readonly symbol: "USDC";
63
+ readonly decimals: 6;
64
+ };
65
+ readonly rpcUrls: {
66
+ readonly default: {
67
+ readonly http: readonly ["https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz"];
68
+ };
69
+ readonly public: {
70
+ readonly http: readonly ["https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz"];
71
+ };
72
+ };
73
+ readonly blockExplorers: {
74
+ readonly default: {
75
+ readonly name: "Varity Explorer";
76
+ readonly url: "https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz";
77
+ };
78
+ };
79
+ readonly testnet: true;
80
+ };
81
+ //# sourceMappingURL=varityL3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"varityL3.d.ts","sourceRoot":"","sources":["../../src/chains/varityL3.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe;;EAgB1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,QAAQ;;EAAkB,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,+CAA+C,CAAC;AAEhF;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAUjF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAKzD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAcrF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,SAAI,EAAE,QAAQ,SAAI,GAAG,MAAM,CAKnF;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;CAwBhB,CAAC"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Varity L3 Chain Configuration
3
+ *
4
+ * Varity L3 is an Arbitrum Orbit rollup deployed on Conduit
5
+ * Chain ID: 33529
6
+ * Native Token: Bridged USDC (6 decimals - NOT 18!)
7
+ */
8
+ import { defineChain } from 'thirdweb/chains';
9
+ /**
10
+ * Varity L3 Testnet Configuration
11
+ *
12
+ * CRITICAL NOTES:
13
+ * - Native token is USDC with 6 decimals (not 18 like ETH)
14
+ * - All token amounts must account for 6 decimals: 1 USDC = 1_000_000 (not 10^18)
15
+ * - Chain ID 33529 is unique to Varity L3 testnet
16
+ * - RPC URL is Conduit-hosted (managed Arbitrum Orbit)
17
+ */
18
+ export const varityL3Testnet = defineChain({
19
+ id: 33529,
20
+ name: 'Varity L3 Testnet',
21
+ nativeCurrency: {
22
+ name: 'USDC',
23
+ symbol: 'USDC',
24
+ decimals: 6, // CRITICAL: 6 decimals, NOT 18!
25
+ },
26
+ rpc: 'https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz',
27
+ blockExplorers: [
28
+ {
29
+ name: 'Varity Explorer',
30
+ url: 'https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz',
31
+ },
32
+ ],
33
+ testnet: true,
34
+ });
35
+ /**
36
+ * Alias for varityL3Testnet (for backwards compatibility)
37
+ */
38
+ export const varityL3 = varityL3Testnet;
39
+ /**
40
+ * USDC decimals constant
41
+ */
42
+ export const USDC_DECIMALS = 6;
43
+ /**
44
+ * USDC Contract Address on Varity L3
45
+ * CRITICAL: This is bridged USDC with 6 decimals
46
+ */
47
+ export const VARITY_USDC_ADDRESS = '0x6Fd8ee6B4C2193e9E2e0E2EC5D295689B607c0cE';
48
+ /**
49
+ * Format USDC amount (6 decimals)
50
+ */
51
+ export function formatUSDC(amount, decimals = 2) {
52
+ const amountBigInt = typeof amount === 'bigint' ? amount : BigInt(amount);
53
+ const divisor = BigInt(10 ** USDC_DECIMALS);
54
+ const wholePart = amountBigInt / divisor;
55
+ const fractionalPart = amountBigInt % divisor;
56
+ const fractionalStr = fractionalPart.toString().padStart(USDC_DECIMALS, '0');
57
+ const truncatedFractional = fractionalStr.slice(0, decimals);
58
+ return `${wholePart}.${truncatedFractional}`;
59
+ }
60
+ /**
61
+ * Parse USDC amount to bigint (6 decimals)
62
+ */
63
+ export function parseUSDC(amount) {
64
+ const amountStr = typeof amount === 'number' ? amount.toString() : amount;
65
+ const [whole, fractional = ''] = amountStr.split('.');
66
+ const paddedFractional = fractional.padEnd(USDC_DECIMALS, '0').slice(0, USDC_DECIMALS);
67
+ return BigInt(whole + paddedFractional);
68
+ }
69
+ /**
70
+ * Block explorer URL builder
71
+ */
72
+ export function getExplorerUrl(type, hash) {
73
+ const baseUrl = varityL3Testnet.blockExplorers?.[0]?.url;
74
+ if (!baseUrl)
75
+ return '';
76
+ switch (type) {
77
+ case 'tx':
78
+ return `${baseUrl}/tx/${hash}`;
79
+ case 'address':
80
+ return `${baseUrl}/address/${hash}`;
81
+ case 'block':
82
+ return `${baseUrl}/block/${hash}`;
83
+ default:
84
+ return baseUrl;
85
+ }
86
+ }
87
+ /**
88
+ * Format address for display (0x1234...5678)
89
+ */
90
+ export function formatAddress(address, startChars = 6, endChars = 4) {
91
+ if (!address || address.length < startChars + endChars) {
92
+ return address;
93
+ }
94
+ return `${address.slice(0, startChars)}...${address.slice(-endChars)}`;
95
+ }
96
+ /**
97
+ * Wagmi-compatible chain configuration for Privy integration
98
+ * NOTE: nativeCurrency should NOT have an address field - that's non-standard
99
+ * and can cause issues with wallet_switchEthereumChain
100
+ */
101
+ export const varityL3Wagmi = {
102
+ id: 33529,
103
+ name: 'Varity L3 Testnet',
104
+ network: 'varity-testnet',
105
+ nativeCurrency: {
106
+ name: 'USDC',
107
+ symbol: 'USDC',
108
+ decimals: 6,
109
+ },
110
+ rpcUrls: {
111
+ default: {
112
+ http: ['https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz'],
113
+ },
114
+ public: {
115
+ http: ['https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz'],
116
+ },
117
+ },
118
+ blockExplorers: {
119
+ default: {
120
+ name: 'Varity Explorer',
121
+ url: 'https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz',
122
+ },
123
+ },
124
+ testnet: true,
125
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * varity clone - Clone existing template
3
+ *
4
+ * Quickly create new template from existing one
5
+ */
6
+ import { Command } from 'commander';
7
+ export declare const cloneCommand: Command;
8
+ //# sourceMappingURL=clone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/clone.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,eAAO,MAAM,YAAY,SAqHrB,CAAA"}