@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,396 @@
1
+ /**
2
+ * thirdweb Engine Client
3
+ *
4
+ * Production-grade transaction management infrastructure
5
+ * Replaces custom transaction queues with thirdweb's managed service
6
+ *
7
+ * Features:
8
+ * - Automatic transaction queueing and execution
9
+ * - Gas price optimization
10
+ * - Automatic retry with exponential backoff
11
+ * - Webhook notifications for transaction events
12
+ * - Multi-chain support
13
+ * - Production-ready scalability
14
+ */
15
+ import type { Chain } from 'thirdweb';
16
+ /**
17
+ * Engine configuration
18
+ */
19
+ export interface EngineConfig {
20
+ /**
21
+ * Engine URL (e.g., https://engine.thirdweb.com or self-hosted)
22
+ */
23
+ url: string;
24
+ /**
25
+ * Access token for authentication
26
+ */
27
+ accessToken: string;
28
+ /**
29
+ * Backend wallet address to use for transactions
30
+ */
31
+ backendWalletAddress?: string;
32
+ }
33
+ /**
34
+ * Transaction parameters for Engine
35
+ */
36
+ export interface EngineTransactionParams {
37
+ /**
38
+ * Chain to execute on
39
+ */
40
+ chain: Chain;
41
+ /**
42
+ * Contract address
43
+ */
44
+ to: string;
45
+ /**
46
+ * Encoded transaction data
47
+ */
48
+ data: string;
49
+ /**
50
+ * Value to send (in wei)
51
+ */
52
+ value?: string;
53
+ /**
54
+ * Gas limit
55
+ */
56
+ gasLimit?: string;
57
+ /**
58
+ * Webhook URL for transaction status updates
59
+ */
60
+ webhookUrl?: string;
61
+ }
62
+ /**
63
+ * Engine transaction status
64
+ */
65
+ export type EngineTransactionStatus = 'queued' | 'sent' | 'mined' | 'errored' | 'cancelled';
66
+ /**
67
+ * Engine transaction result
68
+ */
69
+ export interface EngineTransactionResult {
70
+ /**
71
+ * Queue ID (unique identifier for this transaction)
72
+ */
73
+ queueId: string;
74
+ /**
75
+ * Transaction hash (available after sent)
76
+ */
77
+ transactionHash?: string;
78
+ /**
79
+ * Status
80
+ */
81
+ status: EngineTransactionStatus;
82
+ /**
83
+ * Block number (available after mined)
84
+ */
85
+ blockNumber?: number;
86
+ /**
87
+ * Error message (if errored)
88
+ */
89
+ errorMessage?: string;
90
+ /**
91
+ * Timestamp
92
+ */
93
+ timestamp: Date;
94
+ }
95
+ /**
96
+ * Contract deployment parameters for Engine
97
+ */
98
+ export interface EngineDeployParams {
99
+ /**
100
+ * Chain to deploy on
101
+ */
102
+ chain: Chain;
103
+ /**
104
+ * Contract ABI
105
+ */
106
+ abi: any[];
107
+ /**
108
+ * Contract bytecode
109
+ */
110
+ bytecode: string;
111
+ /**
112
+ * Constructor arguments
113
+ */
114
+ constructorArgs?: any[];
115
+ /**
116
+ * Webhook URL for deployment status updates
117
+ */
118
+ webhookUrl?: string;
119
+ }
120
+ /**
121
+ * Engine webhook payload
122
+ */
123
+ export interface EngineWebhookPayload {
124
+ queueId: string;
125
+ status: EngineTransactionStatus;
126
+ transactionHash?: string;
127
+ blockNumber?: number;
128
+ errorMessage?: string;
129
+ timestamp: string;
130
+ }
131
+ /**
132
+ * thirdweb Engine Client
133
+ *
134
+ * Manages blockchain transactions through thirdweb's production infrastructure
135
+ */
136
+ export declare class EngineClient {
137
+ private url;
138
+ private accessToken;
139
+ private backendWalletAddress?;
140
+ constructor(config: EngineConfig);
141
+ /**
142
+ * Send a transaction through Engine
143
+ *
144
+ * Automatically queues, optimizes gas, and retries failed transactions.
145
+ *
146
+ * @param params - Transaction parameters
147
+ * @returns Transaction result with queue ID
148
+ *
149
+ * @example Basic transaction
150
+ * ```typescript
151
+ * import { EngineClient, varityL3Testnet } from '@varity-labs/sdk';
152
+ * import { prepareContractCall } from 'thirdweb';
153
+ *
154
+ * const engine = new EngineClient({
155
+ * url: 'https://engine.varity.so',
156
+ * accessToken: process.env.ENGINE_ACCESS_TOKEN,
157
+ * backendWalletAddress: '0x...'
158
+ * });
159
+ *
160
+ * // Prepare transaction
161
+ * const tx = prepareContractCall({
162
+ * contract,
163
+ * method: 'function transfer(address to, uint256 amount)',
164
+ * params: [recipientAddress, amount]
165
+ * });
166
+ *
167
+ * // Send through Engine
168
+ * const result = await engine.sendTransaction({
169
+ * chain: varityL3Testnet,
170
+ * to: contract.address,
171
+ * data: tx.data,
172
+ * value: '0'
173
+ * });
174
+ *
175
+ * console.log('Queue ID:', result.queueId);
176
+ * ```
177
+ *
178
+ * @example With webhook notifications
179
+ * ```typescript
180
+ * const result = await engine.sendTransaction({
181
+ * chain: varityL3Testnet,
182
+ * to: contractAddress,
183
+ * data: encodedData,
184
+ * webhookUrl: 'https://myapp.com/api/webhook/engine'
185
+ * });
186
+ *
187
+ * // Your webhook will receive status updates:
188
+ * // { queueId, status: 'mined', transactionHash, blockNumber }
189
+ * ```
190
+ *
191
+ * @example With gas limit
192
+ * ```typescript
193
+ * const result = await engine.sendTransaction({
194
+ * chain: varityL3Testnet,
195
+ * to: contractAddress,
196
+ * data: encodedData,
197
+ * gasLimit: '500000' // Override estimated gas
198
+ * });
199
+ * ```
200
+ */
201
+ sendTransaction(params: EngineTransactionParams): Promise<EngineTransactionResult>;
202
+ /**
203
+ * Deploy a contract through Engine
204
+ *
205
+ * Deploys smart contracts with automatic gas optimization and retry logic.
206
+ *
207
+ * @param params - Deployment parameters
208
+ * @returns Deployment result with queue ID
209
+ *
210
+ * @example Deploy ERC-721 NFT contract
211
+ * ```typescript
212
+ * import { EngineClient, varityL3Testnet } from '@varity-labs/sdk';
213
+ * import NFTContractABI from './abis/NFTContract.json';
214
+ * import NFTContractBytecode from './bytecode/NFTContract.json';
215
+ *
216
+ * const engine = new EngineClient({
217
+ * url: 'https://engine.varity.so',
218
+ * accessToken: process.env.ENGINE_ACCESS_TOKEN
219
+ * });
220
+ *
221
+ * const result = await engine.deployContract({
222
+ * chain: varityL3Testnet,
223
+ * abi: NFTContractABI,
224
+ * bytecode: NFTContractBytecode.bytecode,
225
+ * constructorArgs: [
226
+ * 'My NFT Collection', // name
227
+ * 'MNFT', // symbol
228
+ * '0x...' // owner address
229
+ * ]
230
+ * });
231
+ *
232
+ * console.log('Deploying contract, Queue ID:', result.queueId);
233
+ * ```
234
+ *
235
+ * @example Deploy ERC-20 token
236
+ * ```typescript
237
+ * const result = await engine.deployContract({
238
+ * chain: varityL3Testnet,
239
+ * abi: ERC20ABI,
240
+ * bytecode: ERC20Bytecode.bytecode,
241
+ * constructorArgs: [
242
+ * 'My Token', // name
243
+ * 'MTK', // symbol
244
+ * ethers.utils.parseEther('1000000') // initial supply
245
+ * ],
246
+ * webhookUrl: 'https://myapp.com/api/webhook/deployment'
247
+ * });
248
+ * ```
249
+ *
250
+ * @example Deploy and wait for completion
251
+ * ```typescript
252
+ * const deployment = await engine.deployContract({
253
+ * chain: varityL3Testnet,
254
+ * abi: ContractABI,
255
+ * bytecode: ContractBytecode.bytecode,
256
+ * constructorArgs: []
257
+ * });
258
+ *
259
+ * // Wait for deployment to complete
260
+ * const completed = await engine.waitForTransaction(deployment.queueId);
261
+ * console.log('Contract deployed at:', completed.transactionHash);
262
+ * ```
263
+ */
264
+ deployContract(params: EngineDeployParams): Promise<EngineTransactionResult>;
265
+ /**
266
+ * Get transaction status
267
+ */
268
+ getTransactionStatus(queueId: string): Promise<EngineTransactionResult>;
269
+ /**
270
+ * Wait for transaction to be mined
271
+ *
272
+ * Polls Engine API until transaction is confirmed or fails.
273
+ *
274
+ * @param queueId - Engine queue ID from sendTransaction or deployContract
275
+ * @param options - Optional polling configuration
276
+ * @returns Completed transaction result
277
+ *
278
+ * @example Basic usage
279
+ * ```typescript
280
+ * import { EngineClient } from '@varity-labs/sdk';
281
+ *
282
+ * const engine = new EngineClient({ url, accessToken });
283
+ *
284
+ * // Send transaction
285
+ * const tx = await engine.sendTransaction({ ... });
286
+ *
287
+ * // Wait for confirmation (default: poll every 2s, timeout 5min)
288
+ * const result = await engine.waitForTransaction(tx.queueId);
289
+ * console.log('Transaction mined:', result.transactionHash);
290
+ * console.log('Block number:', result.blockNumber);
291
+ * ```
292
+ *
293
+ * @example With custom polling interval
294
+ * ```typescript
295
+ * // Poll every 5 seconds instead of default 2 seconds
296
+ * const result = await engine.waitForTransaction(queueId, {
297
+ * pollInterval: 5000, // 5 seconds
298
+ * timeout: 600000 // 10 minutes
299
+ * });
300
+ * ```
301
+ *
302
+ * @example With error handling
303
+ * ```typescript
304
+ * try {
305
+ * const result = await engine.waitForTransaction(queueId);
306
+ * console.log('Success:', result.transactionHash);
307
+ * } catch (error) {
308
+ * if (error.message.includes('timed out')) {
309
+ * console.error('Transaction took too long');
310
+ * } else if (error.message.includes('errored')) {
311
+ * console.error('Transaction failed:', error.message);
312
+ * }
313
+ * }
314
+ * ```
315
+ */
316
+ waitForTransaction(queueId: string, options?: {
317
+ /**
318
+ * Polling interval in milliseconds (default: 2000)
319
+ */
320
+ pollInterval?: number;
321
+ /**
322
+ * Maximum time to wait in milliseconds (default: 300000 = 5 minutes)
323
+ */
324
+ timeout?: number;
325
+ }): Promise<EngineTransactionResult>;
326
+ /**
327
+ * Cancel a queued transaction
328
+ */
329
+ cancelTransaction(queueId: string): Promise<void>;
330
+ /**
331
+ * Get backend wallet balance
332
+ */
333
+ getWalletBalance(chainId: number, walletAddress?: string): Promise<string>;
334
+ /**
335
+ * Get all backend wallets
336
+ */
337
+ getBackendWallets(): Promise<string[]>;
338
+ /**
339
+ * Get transaction nonce for a wallet
340
+ */
341
+ getNonce(chainId: number, walletAddress?: string): Promise<number>;
342
+ /**
343
+ * Make HTTP request to Engine API
344
+ */
345
+ private request;
346
+ }
347
+ /**
348
+ * Create Engine client instance
349
+ *
350
+ * Factory function for creating EngineClient instances.
351
+ *
352
+ * @param config - Engine configuration
353
+ * @returns Configured Engine client
354
+ *
355
+ * @example Basic setup
356
+ * ```typescript
357
+ * import { createEngineClient } from '@varity-labs/sdk';
358
+ *
359
+ * const engine = createEngineClient({
360
+ * url: 'https://engine.varity.so',
361
+ * accessToken: process.env.ENGINE_ACCESS_TOKEN
362
+ * });
363
+ *
364
+ * // Now use engine client
365
+ * const result = await engine.sendTransaction({ ... });
366
+ * ```
367
+ *
368
+ * @example With backend wallet
369
+ * ```typescript
370
+ * const engine = createEngineClient({
371
+ * url: 'https://engine.varity.so',
372
+ * accessToken: process.env.ENGINE_ACCESS_TOKEN,
373
+ * backendWalletAddress: '0x...' // Default wallet for all transactions
374
+ * });
375
+ * ```
376
+ *
377
+ * @example Self-hosted Engine
378
+ * ```typescript
379
+ * const engine = createEngineClient({
380
+ * url: 'https://my-engine.example.com',
381
+ * accessToken: process.env.MY_ENGINE_TOKEN
382
+ * });
383
+ * ```
384
+ */
385
+ export declare function createEngineClient(config: EngineConfig): EngineClient;
386
+ /**
387
+ * Webhook handler helper
388
+ *
389
+ * Use this to handle Engine webhook notifications in your backend
390
+ */
391
+ export declare function parseEngineWebhook(payload: any): EngineWebhookPayload;
392
+ /**
393
+ * Verify Engine webhook signature (if configured)
394
+ */
395
+ export declare function verifyEngineWebhook(payload: string, signature: string, secret: string): boolean;
396
+ //# sourceMappingURL=EngineClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EngineClient.d.ts","sourceRoot":"","sources":["../../src/thirdweb/EngineClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,KAA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