@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,262 @@
1
+ /**
2
+ * Varity SDK - ZK Module
3
+ *
4
+ * Universal zero-knowledge proof generation and verification.
5
+ * Works across all templates (ISO, Healthcare, Retail, etc.)
6
+ */
7
+ /**
8
+ * ZKModule - Universal zero-knowledge proof operations
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Generate proof
13
+ * const proof = await sdk.zk.generateProof('login-circuit', {
14
+ * public: [address],
15
+ * private: [password]
16
+ * })
17
+ *
18
+ * // Verify proof on-chain
19
+ * const result = await sdk.zk.verifyProofOnChain(proof, [address])
20
+ * ```
21
+ */
22
+ export class ZKModule {
23
+ constructor(sdk) {
24
+ this.sdk = sdk;
25
+ }
26
+ /**
27
+ * Generate zero-knowledge proof
28
+ *
29
+ * @param circuitId - Circuit identifier
30
+ * @param inputs - Proof inputs
31
+ * @returns ZK proof
32
+ */
33
+ async generateProof(circuitId, inputs) {
34
+ const apiEndpoint = this.sdk.getAPIEndpoint();
35
+ const apiKey = this.sdk.getAPIKey();
36
+ const response = await fetch(`${apiEndpoint}/api/v1/zk/generate`, {
37
+ method: 'POST',
38
+ headers: {
39
+ 'Content-Type': 'application/json',
40
+ ...(apiKey && { 'Authorization': `Bearer ${apiKey}` })
41
+ },
42
+ body: JSON.stringify({ circuitId, inputs })
43
+ });
44
+ if (!response.ok) {
45
+ throw new Error(`Proof generation failed: ${response.statusText}`);
46
+ }
47
+ return await response.json();
48
+ }
49
+ /**
50
+ * Generate login proof (simplified)
51
+ *
52
+ * @param credentials - Login credentials
53
+ * @returns ZK proof
54
+ */
55
+ async generateLoginProof(credentials) {
56
+ // Simplified login proof for v1
57
+ return await this.generateProof('login', {
58
+ public: [credentials.address],
59
+ private: [credentials.signature]
60
+ });
61
+ }
62
+ /**
63
+ * Generate data ownership proof
64
+ *
65
+ * @param dataCID - Data CID
66
+ * @returns ZK proof
67
+ */
68
+ async generateDataOwnershipProof(dataCID) {
69
+ const address = await this.sdk.getAddress();
70
+ return await this.generateProof('data-ownership', {
71
+ public: [dataCID, address],
72
+ private: []
73
+ });
74
+ }
75
+ /**
76
+ * Verify proof on-chain
77
+ *
78
+ * @param proof - ZK proof
79
+ * @param publicInputs - Public inputs
80
+ * @returns Verification result
81
+ */
82
+ async verifyProofOnChain(proof, publicInputs) {
83
+ // Call AccessControlRegistry.proveDataOwnership or similar verifier
84
+ const receipt = await this.sdk.contracts.send('AccessControlRegistry', 'proveDataOwnership', [publicInputs[0], proof] // dataCID, proof
85
+ );
86
+ return {
87
+ valid: true,
88
+ transactionHash: receipt.hash,
89
+ gasUsed: receipt.gasUsed
90
+ };
91
+ }
92
+ /**
93
+ * Verify proof off-chain (local verification)
94
+ *
95
+ * @param proof - ZK proof
96
+ * @param publicInputs - Public inputs
97
+ * @returns True if valid
98
+ */
99
+ async verifyProofOffChain(proof, publicInputs) {
100
+ const apiEndpoint = this.sdk.getAPIEndpoint();
101
+ const apiKey = this.sdk.getAPIKey();
102
+ const response = await fetch(`${apiEndpoint}/api/v1/zk/verify`, {
103
+ method: 'POST',
104
+ headers: {
105
+ 'Content-Type': 'application/json',
106
+ ...(apiKey && { 'Authorization': `Bearer ${apiKey}` })
107
+ },
108
+ body: JSON.stringify({ proof, publicInputs })
109
+ });
110
+ if (!response.ok) {
111
+ throw new Error(`Proof verification failed: ${response.statusText}`);
112
+ }
113
+ const result = await response.json();
114
+ return result.valid;
115
+ }
116
+ /**
117
+ * Prove ML inference with ZKML
118
+ *
119
+ * Generates a zero-knowledge proof that an ML inference was performed correctly
120
+ * without revealing the model weights or full input/output data.
121
+ *
122
+ * @param modelId - Model identifier
123
+ * @param input - Input data to the model
124
+ * @param output - Output from the model
125
+ * @param options - Additional proof generation options
126
+ * @returns ZKML proof with verification data
127
+ *
128
+ * @example
129
+ * ```typescript
130
+ * const proof = await sdk.zk.proveMLInference(
131
+ * 'merchant-risk-model',
132
+ * { merchantData: {...} },
133
+ * { riskScore: 0.85 },
134
+ * { submitOnChain: true }
135
+ * )
136
+ * console.log('Proof ID:', proof.proofId)
137
+ * console.log('Verified:', proof.verified)
138
+ * ```
139
+ */
140
+ async proveMLInference(modelId, input, output, options) {
141
+ const apiEndpoint = this.sdk.getAPIEndpoint();
142
+ const apiKey = this.sdk.getAPIKey();
143
+ const proofInput = {
144
+ modelId,
145
+ input,
146
+ output,
147
+ context: options?.context,
148
+ circuitId: options?.circuitId,
149
+ submitOnChain: options?.submitOnChain ?? false
150
+ };
151
+ const response = await fetch(`${apiEndpoint}/api/v1/zkml/prove`, {
152
+ method: 'POST',
153
+ headers: {
154
+ 'Content-Type': 'application/json',
155
+ ...(apiKey && { 'Authorization': `Bearer ${apiKey}` })
156
+ },
157
+ body: JSON.stringify(proofInput)
158
+ });
159
+ if (!response.ok) {
160
+ const error = await response.json().catch(() => ({ message: response.statusText }));
161
+ throw new Error(`ZKML proof generation failed: ${error.message || response.statusText}`);
162
+ }
163
+ return await response.json();
164
+ }
165
+ /**
166
+ * Verify ZKML proof
167
+ *
168
+ * Verifies a ZKML proof either on-chain or off-chain.
169
+ *
170
+ * @param proof - ZKML proof to verify
171
+ * @param onChain - Whether to verify on-chain (default: false)
172
+ * @returns Verification result
173
+ *
174
+ * @example
175
+ * ```typescript
176
+ * // Off-chain verification (faster, no gas)
177
+ * const result = await sdk.zk.verifyMLProof(proof)
178
+ * console.log('Valid:', result.valid)
179
+ *
180
+ * // On-chain verification (slower, requires gas)
181
+ * const result = await sdk.zk.verifyMLProof(proof, true)
182
+ * console.log('Transaction:', result.txHash)
183
+ * ```
184
+ */
185
+ async verifyMLProof(proof, onChain = false) {
186
+ const apiEndpoint = this.sdk.getAPIEndpoint();
187
+ const apiKey = this.sdk.getAPIKey();
188
+ const response = await fetch(`${apiEndpoint}/api/v1/zkml/verify`, {
189
+ method: 'POST',
190
+ headers: {
191
+ 'Content-Type': 'application/json',
192
+ ...(apiKey && { 'Authorization': `Bearer ${apiKey}` })
193
+ },
194
+ body: JSON.stringify({ proof, onChain })
195
+ });
196
+ if (!response.ok) {
197
+ const error = await response.json().catch(() => ({ message: response.statusText }));
198
+ throw new Error(`ZKML proof verification failed: ${error.message || response.statusText}`);
199
+ }
200
+ return await response.json();
201
+ }
202
+ /**
203
+ * Get ZKML proof statistics
204
+ *
205
+ * Returns statistics about ZKML proof generation and verification.
206
+ *
207
+ * @returns Proof statistics
208
+ *
209
+ * @example
210
+ * ```typescript
211
+ * const stats = await sdk.zk.getProofStats()
212
+ * console.log('Total proofs:', stats.totalProofsGenerated)
213
+ * console.log('Success rate:', stats.successRate)
214
+ * console.log('Avg generation time:', stats.avgGenerationTimeMs, 'ms')
215
+ * ```
216
+ */
217
+ async getProofStats() {
218
+ const apiEndpoint = this.sdk.getAPIEndpoint();
219
+ const apiKey = this.sdk.getAPIKey();
220
+ const response = await fetch(`${apiEndpoint}/api/v1/zkml/stats`, {
221
+ method: 'GET',
222
+ headers: {
223
+ 'Content-Type': 'application/json',
224
+ ...(apiKey && { 'Authorization': `Bearer ${apiKey}` })
225
+ }
226
+ });
227
+ if (!response.ok) {
228
+ throw new Error(`Failed to get proof stats: ${response.statusText}`);
229
+ }
230
+ return await response.json();
231
+ }
232
+ /**
233
+ * List available ZKML circuits
234
+ *
235
+ * Returns a list of compiled ZKML circuits available for proof generation.
236
+ *
237
+ * @returns Array of circuit configurations
238
+ *
239
+ * @example
240
+ * ```typescript
241
+ * const circuits = await sdk.zk.listCircuits()
242
+ * circuits.forEach(circuit => {
243
+ * console.log(`${circuit.circuitId}: ${circuit.provingSystem}`)
244
+ * })
245
+ * ```
246
+ */
247
+ async listCircuits() {
248
+ const apiEndpoint = this.sdk.getAPIEndpoint();
249
+ const apiKey = this.sdk.getAPIKey();
250
+ const response = await fetch(`${apiEndpoint}/api/v1/zkml/circuits`, {
251
+ method: 'GET',
252
+ headers: {
253
+ 'Content-Type': 'application/json',
254
+ ...(apiKey && { 'Authorization': `Bearer ${apiKey}` })
255
+ }
256
+ });
257
+ if (!response.ok) {
258
+ throw new Error(`Failed to list circuits: ${response.statusText}`);
259
+ }
260
+ return await response.json();
261
+ }
262
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * ZK Module - Exports
3
+ */
4
+ export { ZKModule } from './ZKModule';
5
+ export type { ProofInputs, VerificationResult } from './ZKModule';
6
+ export type { ZKMLProof } from '../../core/types';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/zk/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACjE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ZK Module - Exports
3
+ */
4
+ export { ZKModule } from './ZKModule';
@@ -0,0 +1,228 @@
1
+ /**
2
+ * thirdweb Bridge Client
3
+ *
4
+ * Cross-chain asset bridging powered by thirdweb
5
+ * Seamlessly transfer tokens and NFTs between chains
6
+ *
7
+ * Features:
8
+ * - Cross-chain token transfers
9
+ * - NFT bridging
10
+ * - Automatic route optimization
11
+ * - Gas estimation
12
+ * - Bridge status tracking
13
+ * - Multi-hop bridging support
14
+ */
15
+ import type { ThirdwebClient, Chain } from 'thirdweb';
16
+ /**
17
+ * Bridge configuration
18
+ */
19
+ export interface BridgeConfig {
20
+ /**
21
+ * thirdweb client instance
22
+ */
23
+ client: ThirdwebClient;
24
+ }
25
+ /**
26
+ * Asset type for bridging
27
+ */
28
+ export type AssetType = 'erc20' | 'erc721' | 'erc1155' | 'native';
29
+ /**
30
+ * Bridge route
31
+ */
32
+ export interface BridgeRoute {
33
+ /**
34
+ * Source chain
35
+ */
36
+ from: Chain;
37
+ /**
38
+ * Destination chain
39
+ */
40
+ to: Chain;
41
+ /**
42
+ * Bridge protocol used
43
+ */
44
+ protocol: string;
45
+ /**
46
+ * Estimated time in seconds
47
+ */
48
+ estimatedTime: number;
49
+ /**
50
+ * Estimated gas cost (in source chain's native token)
51
+ */
52
+ estimatedGas: string;
53
+ /**
54
+ * Bridge fee (in basis points, e.g., 30 = 0.3%)
55
+ */
56
+ feeBps: number;
57
+ /**
58
+ * Whether this is a direct bridge or requires hops
59
+ */
60
+ isDirectBridge: boolean;
61
+ /**
62
+ * Intermediate hops (if not direct)
63
+ */
64
+ hops?: Chain[];
65
+ }
66
+ /**
67
+ * Bridge asset parameters
68
+ */
69
+ export interface BridgeAssetParams {
70
+ /**
71
+ * Source chain
72
+ */
73
+ fromChain: Chain;
74
+ /**
75
+ * Destination chain
76
+ */
77
+ toChain: Chain;
78
+ /**
79
+ * Asset type
80
+ */
81
+ assetType: AssetType;
82
+ /**
83
+ * Token contract address (for ERC20/ERC721/ERC1155)
84
+ */
85
+ tokenAddress?: string;
86
+ /**
87
+ * Token ID (for ERC721/ERC1155)
88
+ */
89
+ tokenId?: string;
90
+ /**
91
+ * Amount to bridge (for ERC20/native)
92
+ */
93
+ amount?: string;
94
+ /**
95
+ * Recipient address on destination chain
96
+ */
97
+ recipient: string;
98
+ /**
99
+ * Optional slippage tolerance (in basis points)
100
+ */
101
+ slippageBps?: number;
102
+ }
103
+ /**
104
+ * Bridge transaction status
105
+ */
106
+ export type BridgeStatus = 'pending' | 'initiated' | 'in_progress' | 'completed' | 'failed' | 'refunded';
107
+ /**
108
+ * Bridge transaction result
109
+ */
110
+ export interface BridgeTransactionResult {
111
+ /**
112
+ * Bridge transaction ID
113
+ */
114
+ bridgeId: string;
115
+ /**
116
+ * Source chain transaction hash
117
+ */
118
+ sourceTxHash: string;
119
+ /**
120
+ * Destination chain transaction hash (available after completion)
121
+ */
122
+ destinationTxHash?: string;
123
+ /**
124
+ * Current status
125
+ */
126
+ status: BridgeStatus;
127
+ /**
128
+ * Estimated completion time
129
+ */
130
+ estimatedCompletion: Date;
131
+ /**
132
+ * Route used
133
+ */
134
+ route: BridgeRoute;
135
+ }
136
+ /**
137
+ * Bridge quote (estimate before executing)
138
+ */
139
+ export interface BridgeQuote {
140
+ /**
141
+ * Available routes
142
+ */
143
+ routes: BridgeRoute[];
144
+ /**
145
+ * Recommended route (lowest cost + fastest)
146
+ */
147
+ recommendedRoute: BridgeRoute;
148
+ /**
149
+ * Amount that will be received (after fees)
150
+ */
151
+ receivingAmount: string;
152
+ /**
153
+ * Total fees
154
+ */
155
+ totalFees: {
156
+ bridgeFee: string;
157
+ gasFee: string;
158
+ total: string;
159
+ };
160
+ }
161
+ /**
162
+ * Bridge history entry
163
+ */
164
+ export interface BridgeHistoryEntry {
165
+ bridgeId: string;
166
+ timestamp: Date;
167
+ fromChain: Chain;
168
+ toChain: Chain;
169
+ assetType: AssetType;
170
+ amount: string;
171
+ status: BridgeStatus;
172
+ sourceTxHash: string;
173
+ destinationTxHash?: string;
174
+ }
175
+ /**
176
+ * thirdweb Bridge Client
177
+ *
178
+ * Cross-chain asset bridging made simple
179
+ */
180
+ export declare class BridgeClient {
181
+ private client;
182
+ private baseUrl;
183
+ constructor(config: BridgeConfig);
184
+ /**
185
+ * Get available bridge routes
186
+ */
187
+ getRoutes(fromChain: Chain, toChain: Chain): Promise<BridgeRoute[]>;
188
+ /**
189
+ * Get a quote for bridging
190
+ */
191
+ getQuote(params: BridgeAssetParams): Promise<BridgeQuote>;
192
+ /**
193
+ * Bridge an asset from one chain to another
194
+ */
195
+ bridgeAsset(params: BridgeAssetParams): Promise<BridgeTransactionResult>;
196
+ /**
197
+ * Get bridge transaction status
198
+ */
199
+ getStatus(bridgeId: string): Promise<BridgeTransactionResult>;
200
+ /**
201
+ * Wait for bridge to complete
202
+ */
203
+ waitForCompletion(bridgeId: string, options?: {
204
+ pollInterval?: number;
205
+ timeout?: number;
206
+ }): Promise<BridgeTransactionResult>;
207
+ /**
208
+ * Get bridge history for an address
209
+ */
210
+ getHistory(address: string): Promise<BridgeHistoryEntry[]>;
211
+ /**
212
+ * Check if a bridge route is available
213
+ */
214
+ isRouteAvailable(fromChain: Chain, toChain: Chain): Promise<boolean>;
215
+ /**
216
+ * Get supported chains for bridging
217
+ */
218
+ getSupportedChains(): Promise<Chain[]>;
219
+ /**
220
+ * Estimate gas for a bridge operation
221
+ */
222
+ estimateGas(params: BridgeAssetParams): Promise<string>;
223
+ }
224
+ /**
225
+ * Create Bridge client instance
226
+ */
227
+ export declare function createBridgeClient(config: BridgeConfig): BridgeClient;
228
+ //# sourceMappingURL=BridgeClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BridgeClient.d.ts","sourceRoot":"","sources":["../../src/thirdweb/BridgeClient.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,160 @@
1
+ /**
2
+ * thirdweb Bridge Client
3
+ *
4
+ * Cross-chain asset bridging powered by thirdweb
5
+ * Seamlessly transfer tokens and NFTs between chains
6
+ *
7
+ * Features:
8
+ * - Cross-chain token transfers
9
+ * - NFT bridging
10
+ * - Automatic route optimization
11
+ * - Gas estimation
12
+ * - Bridge status tracking
13
+ * - Multi-hop bridging support
14
+ */
15
+ /**
16
+ * thirdweb Bridge Client
17
+ *
18
+ * Cross-chain asset bridging made simple
19
+ */
20
+ export class BridgeClient {
21
+ constructor(config) {
22
+ this.baseUrl = 'https://bridge.thirdweb.com/api';
23
+ this.client = config.client;
24
+ }
25
+ /**
26
+ * Get available bridge routes
27
+ */
28
+ async getRoutes(fromChain, toChain) {
29
+ console.warn('thirdweb Bridge API is placeholder - actual implementation pending');
30
+ // Mock implementation
31
+ return [
32
+ {
33
+ from: fromChain,
34
+ to: toChain,
35
+ protocol: 'Wormhole',
36
+ estimatedTime: 300, // 5 minutes
37
+ estimatedGas: '0.01',
38
+ feeBps: 30, // 0.3%
39
+ isDirectBridge: true,
40
+ },
41
+ ];
42
+ }
43
+ /**
44
+ * Get a quote for bridging
45
+ */
46
+ async getQuote(params) {
47
+ const routes = await this.getRoutes(params.fromChain, params.toChain);
48
+ // Calculate receiving amount (amount - fees)
49
+ const amount = parseFloat(params.amount || '0');
50
+ const feeBps = routes[0].feeBps;
51
+ const feeAmount = (amount * feeBps) / 10000;
52
+ const receivingAmount = (amount - feeAmount).toString();
53
+ return {
54
+ routes,
55
+ recommendedRoute: routes[0],
56
+ receivingAmount,
57
+ totalFees: {
58
+ bridgeFee: feeAmount.toString(),
59
+ gasFee: routes[0].estimatedGas,
60
+ total: (feeAmount + parseFloat(routes[0].estimatedGas)).toString(),
61
+ },
62
+ };
63
+ }
64
+ /**
65
+ * Bridge an asset from one chain to another
66
+ */
67
+ async bridgeAsset(params) {
68
+ console.warn('thirdweb Bridge API is placeholder - actual implementation pending');
69
+ // Get quote first
70
+ const quote = await this.getQuote(params);
71
+ // Mock bridge execution
72
+ const bridgeId = `bridge_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
73
+ const sourceTxHash = `0x${Math.random().toString(16).substr(2)}`;
74
+ return {
75
+ bridgeId,
76
+ sourceTxHash,
77
+ status: 'initiated',
78
+ estimatedCompletion: new Date(Date.now() + quote.recommendedRoute.estimatedTime * 1000),
79
+ route: quote.recommendedRoute,
80
+ };
81
+ }
82
+ /**
83
+ * Get bridge transaction status
84
+ */
85
+ async getStatus(bridgeId) {
86
+ console.warn('thirdweb Bridge API is placeholder - actual implementation pending');
87
+ // Mock status check
88
+ return {
89
+ bridgeId,
90
+ sourceTxHash: `0x${Math.random().toString(16).substr(2)}`,
91
+ destinationTxHash: `0x${Math.random().toString(16).substr(2)}`,
92
+ status: 'completed',
93
+ estimatedCompletion: new Date(),
94
+ route: {
95
+ from: {},
96
+ to: {},
97
+ protocol: 'Wormhole',
98
+ estimatedTime: 300,
99
+ estimatedGas: '0.01',
100
+ feeBps: 30,
101
+ isDirectBridge: true,
102
+ },
103
+ };
104
+ }
105
+ /**
106
+ * Wait for bridge to complete
107
+ */
108
+ async waitForCompletion(bridgeId, options) {
109
+ const pollInterval = options?.pollInterval || 5000;
110
+ const timeout = options?.timeout || 600000; // 10 minutes default
111
+ const startTime = Date.now();
112
+ while (Date.now() - startTime < timeout) {
113
+ const status = await this.getStatus(bridgeId);
114
+ if (status.status === 'completed') {
115
+ return status;
116
+ }
117
+ if (status.status === 'failed' || status.status === 'refunded') {
118
+ throw new Error(`Bridge ${bridgeId} ${status.status}`);
119
+ }
120
+ await new Promise(resolve => setTimeout(resolve, pollInterval));
121
+ }
122
+ throw new Error(`Bridge ${bridgeId} timed out after ${timeout}ms`);
123
+ }
124
+ /**
125
+ * Get bridge history for an address
126
+ */
127
+ async getHistory(address) {
128
+ console.warn('thirdweb Bridge API is placeholder - actual implementation pending');
129
+ // Mock history
130
+ return [];
131
+ }
132
+ /**
133
+ * Check if a bridge route is available
134
+ */
135
+ async isRouteAvailable(fromChain, toChain) {
136
+ const routes = await this.getRoutes(fromChain, toChain);
137
+ return routes.length > 0;
138
+ }
139
+ /**
140
+ * Get supported chains for bridging
141
+ */
142
+ async getSupportedChains() {
143
+ console.warn('thirdweb Bridge API is placeholder - actual implementation pending');
144
+ // Mock supported chains
145
+ return [];
146
+ }
147
+ /**
148
+ * Estimate gas for a bridge operation
149
+ */
150
+ async estimateGas(params) {
151
+ const quote = await this.getQuote(params);
152
+ return quote.totalFees.gasFee;
153
+ }
154
+ }
155
+ /**
156
+ * Create Bridge client instance
157
+ */
158
+ export function createBridgeClient(config) {
159
+ return new BridgeClient(config);
160
+ }