@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,94 @@
1
+ /**
2
+ * Varity L3 Contract Addresses
3
+ *
4
+ * All deployed contract addresses on Varity L3 Testnet (Chain ID 33529)
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { VARITY_CONTRACTS } from '@varity-labs/sdk';
9
+ *
10
+ * const marketplaceAddress = VARITY_CONTRACTS.TemplateMarketplace;
11
+ * ```
12
+ */
13
+ /**
14
+ * Varity L3 Chain ID
15
+ */
16
+ export const VARITY_L3_CHAIN_ID = 33529;
17
+ /**
18
+ * All deployed contract addresses on Varity L3
19
+ */
20
+ export const VARITY_CONTRACTS = {
21
+ // ============================================================
22
+ // Revenue & Marketplace Contracts
23
+ // ============================================================
24
+ /**
25
+ * TemplateMarketplace - 90/10 revenue split
26
+ * - 90% goes to Developer (template/app creator)
27
+ * - 10% goes to Varity (platform fee)
28
+ *
29
+ * @deployed January 30, 2026 (Updated revenue split)
30
+ * @network Varity L3 (Chain ID 33529)
31
+ */
32
+ TemplateMarketplace: '0x769250dac29817081f38CfBa597Ef2485F3a94e8',
33
+ /**
34
+ * TemplateRegistry - Template metadata storage
35
+ *
36
+ * @deployed January 24, 2026
37
+ * @network Varity L3 (Chain ID 33529)
38
+ */
39
+ TemplateRegistry: '0xEbD8C516c05BD2b76b5CDd56530b3Dd9f8b3D748',
40
+ // ============================================================
41
+ // App Store Contracts
42
+ // ============================================================
43
+ /**
44
+ * VarityAppRegistry - App Store submissions
45
+ * - Developers submit apps here
46
+ * - Admin approval workflow
47
+ *
48
+ * @deployed January 24, 2026
49
+ * @network Varity L3 (Chain ID 33529)
50
+ * @technology Arbitrum Stylus (Rust)
51
+ */
52
+ VarityAppRegistry: '0x52d4f28ebe20fad743bbef9daa61bfe3ce91eb74',
53
+ // ============================================================
54
+ // Smart Wallet Contracts (ERC-4337 Account Abstraction)
55
+ // ============================================================
56
+ /**
57
+ * SimplifiedPaymaster - Sponsors gas for users
58
+ * - Users NEVER pay gas fees
59
+ * - Funded with USDC via Conduit
60
+ *
61
+ * @deployed January 13, 2026
62
+ * @network Varity L3 (Chain ID 33529)
63
+ */
64
+ SimplifiedPaymaster: '0xeF467aef91d4e626C7e56967779069bEF22c4453',
65
+ /**
66
+ * VarityWalletFactory - Creates smart wallets for users
67
+ * - Users login with email/social (never see wallet)
68
+ * - Creates smart wallet behind the scenes
69
+ *
70
+ * @deployed January 13, 2026
71
+ * @network Varity L3 (Chain ID 33529)
72
+ */
73
+ VarityWalletFactory: '0x85AB92708CB4d921f5c2BdCCd7f2D0813a380f71',
74
+ /**
75
+ * ERC-4337 EntryPoint (standard address)
76
+ * - v0.6: 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789
77
+ */
78
+ EntryPoint: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789',
79
+ };
80
+ /**
81
+ * Revenue split percentages (TemplateMarketplace)
82
+ */
83
+ export const REVENUE_SPLIT = {
84
+ /** Developer (creator) receives 90% */
85
+ DEVELOPER_PERCENT: 90,
86
+ /** Varity (platform) receives 10% */
87
+ PLATFORM_PERCENT: 10,
88
+ };
89
+ /**
90
+ * Get contract address by name
91
+ */
92
+ export function getContractAddress(name) {
93
+ return VARITY_CONTRACTS[name];
94
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Contract Addresses Module
3
+ *
4
+ * Exports all deployed Varity L3 contract addresses
5
+ */
6
+ export { VARITY_L3_CHAIN_ID, VARITY_CONTRACTS, REVENUE_SPLIT, getContractAddress, type VarityContractName, } from './addresses';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Contract Addresses Module
3
+ *
4
+ * Exports all deployed Varity L3 contract addresses
5
+ */
6
+ export { VARITY_L3_CHAIN_ID, VARITY_CONTRACTS, REVENUE_SPLIT, getContractAddress, } from './addresses';
@@ -0,0 +1,177 @@
1
+ /**
2
+ * Varity SDK v1 - Main SDK Class
3
+ *
4
+ * Entry point for all Varity SDK functionality.
5
+ * Provides access to ISO Dashboard modules and shared utilities.
6
+ */
7
+ import { ethers } from 'ethers';
8
+ import { VaritySDKConfig, NetworkConfig } from './types';
9
+ import { TemplateConfig } from './template';
10
+ import './template-loader';
11
+ import { AuthModule } from '../modules/auth';
12
+ import { StorageModule } from '../modules/storage';
13
+ import { S3Module } from '../modules/storage/S3Module';
14
+ import { ComputeModule } from '../modules/compute';
15
+ import { ZKModule } from '../modules/zk';
16
+ import { ContractsModule } from '../modules/contracts';
17
+ import { OracleModule } from '../modules/oracle';
18
+ import { AnalyticsModule } from '../modules/analytics';
19
+ import { NotificationsModule } from '../modules/notifications';
20
+ import { ExportModule } from '../modules/export';
21
+ import { CacheModule } from '../modules/cache';
22
+ import { MonitoringModule } from '../modules/monitoring';
23
+ import { ForecastingModule } from '../modules/forecasting';
24
+ import { WebhooksModule } from '../modules/webhooks';
25
+ /**
26
+ * Main Varity SDK class
27
+ *
28
+ * **Capability-based architecture** - Universal methods that work across all templates
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * import { VaritySDK } from '@varity-labs/sdk'
33
+ *
34
+ * const sdk = new VaritySDK({
35
+ * network: 'arbitrum-sepolia',
36
+ * apiKey: 'your-api-key'
37
+ * })
38
+ *
39
+ * await sdk.connect()
40
+ *
41
+ * // Universal capability modules (work for ALL templates)
42
+ * await sdk.auth.login({ address: '0x...' })
43
+ * const encrypted = await sdk.storage.uploadEncrypted(data)
44
+ * const insights = await sdk.compute.query("Analyze performance")
45
+ * await sdk.contracts.send('MerchantRegistry', 'registerMerchant', [...])
46
+ * const proof = await sdk.zk.generateProof('login', { public: [...], private: [...] })
47
+ * const price = await sdk.oracle.getPrice('ETH')
48
+ * const kpis = await sdk.analytics.getKPIs({ period: 'current_month' })
49
+ * const forecast = await sdk.forecasting.predict({ metric: 'revenue', periods: 12, interval: 'month' })
50
+ * await sdk.webhooks.register({ url: 'https://api.example.com/webhook', events: ['transaction.created'] })
51
+ * ```
52
+ */
53
+ export declare class VaritySDK {
54
+ private config;
55
+ private networkConfig;
56
+ private provider;
57
+ private signer;
58
+ private connected;
59
+ private templateConfig;
60
+ auth: AuthModule;
61
+ storage: StorageModule;
62
+ s3: S3Module | undefined;
63
+ compute: ComputeModule;
64
+ zk: ZKModule;
65
+ contracts: ContractsModule;
66
+ oracle: OracleModule;
67
+ analytics: AnalyticsModule;
68
+ notifications: NotificationsModule;
69
+ export: ExportModule;
70
+ cache: CacheModule;
71
+ monitoring: MonitoringModule;
72
+ forecasting: ForecastingModule;
73
+ webhooks: WebhooksModule;
74
+ /**
75
+ * Create a new Varity SDK instance
76
+ *
77
+ * @param config - SDK configuration
78
+ */
79
+ constructor(config?: Partial<VaritySDKConfig>);
80
+ /**
81
+ * Connect to the blockchain network
82
+ *
83
+ * @param walletProvider - Optional wallet provider (e.g., window.ethereum)
84
+ * @returns Promise that resolves when connected
85
+ */
86
+ connect(walletProvider?: any): Promise<void>;
87
+ /**
88
+ * Disconnect from the network
89
+ */
90
+ disconnect(): Promise<void>;
91
+ /**
92
+ * Check if SDK is connected
93
+ */
94
+ isConnected(): boolean;
95
+ /**
96
+ * Get the current provider
97
+ */
98
+ getProvider(): ethers.Provider;
99
+ /**
100
+ * Get the current signer (throws if read-only)
101
+ */
102
+ getSigner(): ethers.Signer;
103
+ /**
104
+ * Get SDK configuration
105
+ */
106
+ getConfig(): VaritySDKConfig;
107
+ /**
108
+ * Get network configuration
109
+ */
110
+ getNetworkConfig(): NetworkConfig;
111
+ /**
112
+ * Get contract address by name
113
+ */
114
+ getContractAddress(contractName: keyof NetworkConfig['contracts']): string;
115
+ /**
116
+ * Get block number
117
+ */
118
+ getBlockNumber(): Promise<number>;
119
+ /**
120
+ * Get wallet address (if signer available)
121
+ */
122
+ getAddress(): Promise<string>;
123
+ /**
124
+ * Get wallet balance (if signer available)
125
+ */
126
+ getBalance(): Promise<bigint>;
127
+ /**
128
+ * Format balance to ETH
129
+ */
130
+ formatBalance(balance: bigint): string;
131
+ /**
132
+ * Parse ETH to Wei
133
+ */
134
+ parseEther(value: string): bigint;
135
+ /**
136
+ * Get backend API base URL
137
+ */
138
+ getAPIEndpoint(): string;
139
+ /**
140
+ * Get API key for backend services
141
+ */
142
+ getAPIKey(): string | undefined;
143
+ /**
144
+ * Get current template configuration
145
+ *
146
+ * @returns Template configuration or null if no template loaded
147
+ */
148
+ getTemplate(): TemplateConfig | null;
149
+ /**
150
+ * Load template configuration
151
+ *
152
+ * @param template - Template type or custom configuration
153
+ * @returns Loaded template configuration
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * // Load built-in template
158
+ * await sdk.loadTemplate('iso')
159
+ *
160
+ * // Load custom template
161
+ * await sdk.loadTemplate(customTemplateConfig)
162
+ * ```
163
+ */
164
+ loadTemplate(template: string | TemplateConfig): TemplateConfig;
165
+ /**
166
+ * Check if template is loaded
167
+ */
168
+ hasTemplate(): boolean;
169
+ }
170
+ /**
171
+ * Create a new Varity SDK instance (convenience function)
172
+ *
173
+ * @param config - SDK configuration
174
+ * @returns Configured SDK instance
175
+ */
176
+ export declare function createVaritySDK(config?: Partial<VaritySDKConfig>): VaritySDK;
177
+ //# sourceMappingURL=VaritySDK.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VaritySDK.d.ts","sourceRoot":"","sources":["../../src/core/VaritySDK.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,325 @@
1
+ /**
2
+ * Varity SDK v1 - Main SDK Class
3
+ *
4
+ * Entry point for all Varity SDK functionality.
5
+ * Provides access to ISO Dashboard modules and shared utilities.
6
+ */
7
+ import { ethers } from 'ethers';
8
+ import { getNetworkConfig, validateContractAddresses, DEFAULT_CONFIG } from './config';
9
+ import { templateRegistry, validateTemplate } from './template';
10
+ import './template-loader'; // Auto-load built-in templates
11
+ import { AuthModule } from '../modules/auth';
12
+ import { StorageModule } from '../modules/storage';
13
+ import { S3Module } from '../modules/storage/S3Module';
14
+ import { ComputeModule } from '../modules/compute';
15
+ import { ZKModule } from '../modules/zk';
16
+ import { ContractsModule } from '../modules/contracts';
17
+ import { OracleModule } from '../modules/oracle';
18
+ import { AnalyticsModule } from '../modules/analytics';
19
+ import { NotificationsModule } from '../modules/notifications';
20
+ import { ExportModule } from '../modules/export';
21
+ import { CacheModule } from '../modules/cache';
22
+ import { MonitoringModule } from '../modules/monitoring';
23
+ import { ForecastingModule } from '../modules/forecasting';
24
+ import { WebhooksModule } from '../modules/webhooks';
25
+ /**
26
+ * Main Varity SDK class
27
+ *
28
+ * **Capability-based architecture** - Universal methods that work across all templates
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * import { VaritySDK } from '@varity-labs/sdk'
33
+ *
34
+ * const sdk = new VaritySDK({
35
+ * network: 'arbitrum-sepolia',
36
+ * apiKey: 'your-api-key'
37
+ * })
38
+ *
39
+ * await sdk.connect()
40
+ *
41
+ * // Universal capability modules (work for ALL templates)
42
+ * await sdk.auth.login({ address: '0x...' })
43
+ * const encrypted = await sdk.storage.uploadEncrypted(data)
44
+ * const insights = await sdk.compute.query("Analyze performance")
45
+ * await sdk.contracts.send('MerchantRegistry', 'registerMerchant', [...])
46
+ * const proof = await sdk.zk.generateProof('login', { public: [...], private: [...] })
47
+ * const price = await sdk.oracle.getPrice('ETH')
48
+ * const kpis = await sdk.analytics.getKPIs({ period: 'current_month' })
49
+ * const forecast = await sdk.forecasting.predict({ metric: 'revenue', periods: 12, interval: 'month' })
50
+ * await sdk.webhooks.register({ url: 'https://api.example.com/webhook', events: ['transaction.created'] })
51
+ * ```
52
+ */
53
+ export class VaritySDK {
54
+ /**
55
+ * Create a new Varity SDK instance
56
+ *
57
+ * @param config - SDK configuration
58
+ */
59
+ constructor(config = {}) {
60
+ this.provider = null;
61
+ this.signer = null;
62
+ this.connected = false;
63
+ this.templateConfig = null;
64
+ // Merge with defaults
65
+ this.config = {
66
+ ...DEFAULT_CONFIG,
67
+ ...config
68
+ };
69
+ // Get network configuration
70
+ this.networkConfig = getNetworkConfig(this.config.network);
71
+ // Load template configuration if specified
72
+ if (this.config.template) {
73
+ this.templateConfig = templateRegistry.get(this.config.template) || null;
74
+ if (!this.templateConfig) {
75
+ console.warn(`Warning: Template '${this.config.template}' not found in registry. ` +
76
+ `SDK will operate with default configuration.`);
77
+ }
78
+ }
79
+ // Apply custom template config overrides
80
+ if (this.config.templateConfig && this.templateConfig) {
81
+ this.templateConfig = { ...this.templateConfig, ...this.config.templateConfig };
82
+ }
83
+ else if (this.config.templateConfig) {
84
+ this.templateConfig = this.config.templateConfig;
85
+ }
86
+ // Validate template if loaded
87
+ if (this.templateConfig) {
88
+ const validation = validateTemplate(this.templateConfig);
89
+ if (!validation.valid) {
90
+ console.warn(`Warning: Template validation failed:\n` +
91
+ validation.errors.join('\n'));
92
+ }
93
+ }
94
+ // Validate contract addresses are configured (warning only, not blocking)
95
+ try {
96
+ validateContractAddresses(this.config.network);
97
+ }
98
+ catch (error) {
99
+ console.warn(`Warning: ${error instanceof Error ? error.message : 'Contract validation failed'}\n` +
100
+ `SDK will operate in read-only mode until contracts are deployed.`);
101
+ }
102
+ // Initialize capability modules (universal - work across ALL templates)
103
+ this.auth = new AuthModule(this);
104
+ this.storage = new StorageModule(this);
105
+ this.compute = new ComputeModule(this);
106
+ this.zk = new ZKModule(this);
107
+ this.contracts = new ContractsModule(this);
108
+ this.oracle = new OracleModule(this);
109
+ this.analytics = new AnalyticsModule(this);
110
+ this.notifications = new NotificationsModule(this);
111
+ this.export = new ExportModule(this);
112
+ this.cache = new CacheModule(this);
113
+ this.monitoring = new MonitoringModule(this);
114
+ this.forecasting = new ForecastingModule(this);
115
+ this.webhooks = new WebhooksModule(this);
116
+ // Initialize S3 module if S3 config provided
117
+ if (this.config.s3Config) {
118
+ this.s3 = new S3Module(this, this.config.s3Config);
119
+ console.log('✅ S3-compatible storage module initialized');
120
+ }
121
+ const moduleCount = 13 + (this.s3 ? 1 : 0);
122
+ console.log(`✅ Varity SDK initialized with comprehensive capability-based architecture (${moduleCount} universal modules)`);
123
+ }
124
+ /**
125
+ * Connect to the blockchain network
126
+ *
127
+ * @param walletProvider - Optional wallet provider (e.g., window.ethereum)
128
+ * @returns Promise that resolves when connected
129
+ */
130
+ async connect(walletProvider) {
131
+ try {
132
+ // Priority 1: Use provided wallet provider
133
+ if (walletProvider) {
134
+ const browserProvider = new ethers.BrowserProvider(walletProvider);
135
+ this.provider = browserProvider;
136
+ this.signer = await browserProvider.getSigner();
137
+ }
138
+ // Priority 2: Use configured wallet provider
139
+ else if (this.config.walletProvider) {
140
+ const browserProvider = new ethers.BrowserProvider(this.config.walletProvider);
141
+ this.provider = browserProvider;
142
+ this.signer = await browserProvider.getSigner();
143
+ }
144
+ // Priority 3: Use private key (server-side)
145
+ else if (this.config.privateKey) {
146
+ this.provider = new ethers.JsonRpcProvider(this.config.rpcUrl || this.networkConfig.rpcUrl);
147
+ this.signer = new ethers.Wallet(this.config.privateKey, this.provider);
148
+ }
149
+ // Priority 4: Read-only mode
150
+ else {
151
+ this.provider = new ethers.JsonRpcProvider(this.config.rpcUrl || this.networkConfig.rpcUrl);
152
+ console.warn('Connected in read-only mode. Provide a wallet or private key for write operations.');
153
+ }
154
+ // Verify network
155
+ const network = await this.provider.getNetwork();
156
+ if (Number(network.chainId) !== this.networkConfig.chainId) {
157
+ throw new Error(`Network mismatch: Expected chain ID ${this.networkConfig.chainId}, ` +
158
+ `but connected to ${network.chainId}`);
159
+ }
160
+ this.connected = true;
161
+ console.log(`✅ Connected to ${this.config.network} (Chain ID: ${network.chainId})`);
162
+ }
163
+ catch (error) {
164
+ throw new Error(`Failed to connect to network: ${error instanceof Error ? error.message : 'Unknown error'}`);
165
+ }
166
+ }
167
+ /**
168
+ * Disconnect from the network
169
+ */
170
+ async disconnect() {
171
+ this.provider = null;
172
+ this.signer = null;
173
+ this.connected = false;
174
+ console.log('Disconnected from network');
175
+ }
176
+ /**
177
+ * Check if SDK is connected
178
+ */
179
+ isConnected() {
180
+ return this.connected;
181
+ }
182
+ /**
183
+ * Get the current provider
184
+ */
185
+ getProvider() {
186
+ if (!this.provider) {
187
+ throw new Error('SDK not connected. Call connect() first.');
188
+ }
189
+ return this.provider;
190
+ }
191
+ /**
192
+ * Get the current signer (throws if read-only)
193
+ */
194
+ getSigner() {
195
+ if (!this.signer) {
196
+ throw new Error('No signer available. SDK is in read-only mode.');
197
+ }
198
+ return this.signer;
199
+ }
200
+ /**
201
+ * Get SDK configuration
202
+ */
203
+ getConfig() {
204
+ return { ...this.config };
205
+ }
206
+ /**
207
+ * Get network configuration
208
+ */
209
+ getNetworkConfig() {
210
+ return { ...this.networkConfig };
211
+ }
212
+ /**
213
+ * Get contract address by name
214
+ */
215
+ getContractAddress(contractName) {
216
+ const address = this.networkConfig.contracts[contractName];
217
+ if (!address || address === '') {
218
+ throw new Error(`Contract ${contractName} not deployed on ${this.config.network}. ` +
219
+ `Please deploy contracts or check configuration.`);
220
+ }
221
+ return address;
222
+ }
223
+ /**
224
+ * Get block number
225
+ */
226
+ async getBlockNumber() {
227
+ const provider = this.getProvider();
228
+ return await provider.getBlockNumber();
229
+ }
230
+ /**
231
+ * Get wallet address (if signer available)
232
+ */
233
+ async getAddress() {
234
+ const signer = this.getSigner();
235
+ return await signer.getAddress();
236
+ }
237
+ /**
238
+ * Get wallet balance (if signer available)
239
+ */
240
+ async getBalance() {
241
+ const signer = this.getSigner();
242
+ const address = await signer.getAddress();
243
+ const provider = this.getProvider();
244
+ return await provider.getBalance(address);
245
+ }
246
+ /**
247
+ * Format balance to ETH
248
+ */
249
+ formatBalance(balance) {
250
+ return ethers.formatEther(balance);
251
+ }
252
+ /**
253
+ * Parse ETH to Wei
254
+ */
255
+ parseEther(value) {
256
+ return ethers.parseEther(value);
257
+ }
258
+ /**
259
+ * Get backend API base URL
260
+ */
261
+ getAPIEndpoint() {
262
+ return this.config.apiEndpoint || DEFAULT_CONFIG.apiEndpoint;
263
+ }
264
+ /**
265
+ * Get API key for backend services
266
+ */
267
+ getAPIKey() {
268
+ return this.config.apiKey;
269
+ }
270
+ /**
271
+ * Get current template configuration
272
+ *
273
+ * @returns Template configuration or null if no template loaded
274
+ */
275
+ getTemplate() {
276
+ return this.templateConfig;
277
+ }
278
+ /**
279
+ * Load template configuration
280
+ *
281
+ * @param template - Template type or custom configuration
282
+ * @returns Loaded template configuration
283
+ *
284
+ * @example
285
+ * ```typescript
286
+ * // Load built-in template
287
+ * await sdk.loadTemplate('iso')
288
+ *
289
+ * // Load custom template
290
+ * await sdk.loadTemplate(customTemplateConfig)
291
+ * ```
292
+ */
293
+ loadTemplate(template) {
294
+ if (typeof template === 'string') {
295
+ const config = templateRegistry.get(template);
296
+ if (!config) {
297
+ throw new Error(`Template '${template}' not found in registry`);
298
+ }
299
+ this.templateConfig = config;
300
+ }
301
+ else {
302
+ const validation = validateTemplate(template);
303
+ if (!validation.valid) {
304
+ throw new Error(`Invalid template configuration:\n${validation.errors.join('\n')}`);
305
+ }
306
+ this.templateConfig = template;
307
+ }
308
+ return this.templateConfig;
309
+ }
310
+ /**
311
+ * Check if template is loaded
312
+ */
313
+ hasTemplate() {
314
+ return this.templateConfig !== null;
315
+ }
316
+ }
317
+ /**
318
+ * Create a new Varity SDK instance (convenience function)
319
+ *
320
+ * @param config - SDK configuration
321
+ * @returns Configured SDK instance
322
+ */
323
+ export function createVaritySDK(config = {}) {
324
+ return new VaritySDK(config);
325
+ }