@varity-labs/sdk 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +31 -0
- package/README.md +253 -0
- package/dist/analytics/index.d.ts +7 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +6 -0
- package/dist/analytics/tracker.d.ts +128 -0
- package/dist/analytics/tracker.d.ts.map +1 -0
- package/dist/analytics/tracker.js +203 -0
- package/dist/blockchain/BlockchainService.d.ts +100 -0
- package/dist/blockchain/BlockchainService.d.ts.map +1 -0
- package/dist/blockchain/BlockchainService.js +188 -0
- package/dist/blockchain/NFTLicensingService.d.ts +69 -0
- package/dist/blockchain/NFTLicensingService.d.ts.map +1 -0
- package/dist/blockchain/NFTLicensingService.js +136 -0
- package/dist/blockchain/RevenueSplitService.d.ts +71 -0
- package/dist/blockchain/RevenueSplitService.d.ts.map +1 -0
- package/dist/blockchain/RevenueSplitService.js +111 -0
- package/dist/blockchain/index.d.ts +48 -0
- package/dist/blockchain/index.d.ts.map +1 -0
- package/dist/blockchain/index.js +46 -0
- package/dist/blockchain/types.d.ts +63 -0
- package/dist/blockchain/types.d.ts.map +1 -0
- package/dist/blockchain/types.js +6 -0
- package/dist/chains/arbitrum.d.ts +89 -0
- package/dist/chains/arbitrum.d.ts.map +1 -0
- package/dist/chains/arbitrum.js +134 -0
- package/dist/chains/base.d.ts +84 -0
- package/dist/chains/base.d.ts.map +1 -0
- package/dist/chains/base.js +131 -0
- package/dist/chains/index.d.ts +36 -0
- package/dist/chains/index.d.ts.map +1 -0
- package/dist/chains/index.js +32 -0
- package/dist/chains/registry.d.ts +113 -0
- package/dist/chains/registry.d.ts.map +1 -0
- package/dist/chains/registry.js +201 -0
- package/dist/chains/varityL3.d.ts +81 -0
- package/dist/chains/varityL3.d.ts.map +1 -0
- package/dist/chains/varityL3.js +125 -0
- package/dist/cli/commands/clone.d.ts +8 -0
- package/dist/cli/commands/clone.d.ts.map +1 -0
- package/dist/cli/commands/clone.js +391 -0
- package/dist/cli/commands/dev.d.ts +8 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +40 -0
- package/dist/cli/commands/generate.d.ts +8 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +303 -0
- package/dist/cli/commands/init.d.ts +8 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +317 -0
- package/dist/cli/commands/validate.d.ts +8 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +69 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +33 -0
- package/dist/cli/utils/logger.d.ts +17 -0
- package/dist/cli/utils/logger.d.ts.map +1 -0
- package/dist/cli/utils/logger.js +35 -0
- package/dist/cli/utils/prompts.d.ts +21 -0
- package/dist/cli/utils/prompts.d.ts.map +1 -0
- package/dist/cli/utils/prompts.js +103 -0
- package/dist/contracts/abis/iso/AccessControlRegistry.json +1468 -0
- package/dist/contracts/abis/iso/DataProofRegistry.json +797 -0
- package/dist/contracts/abis/iso/MerchantRegistry.json +1237 -0
- package/dist/contracts/abis/iso/RepPerformance.json +1351 -0
- package/dist/contracts/abis/iso/ResidualCalculator.json +1118 -0
- package/dist/contracts/abis/iso/TransactionVault.json +1588 -0
- package/dist/contracts/abis/iso/VarityWalletFactory.json +475 -0
- package/dist/contracts/addresses.d.ts +88 -0
- package/dist/contracts/addresses.d.ts.map +1 -0
- package/dist/contracts/addresses.js +94 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +6 -0
- package/dist/core/VaritySDK.d.ts +177 -0
- package/dist/core/VaritySDK.d.ts.map +1 -0
- package/dist/core/VaritySDK.js +325 -0
- package/dist/core/config.d.ts +120 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +187 -0
- package/dist/core/credentials-proxy.d.ts +157 -0
- package/dist/core/credentials-proxy.d.ts.map +1 -0
- package/dist/core/credentials-proxy.js +345 -0
- package/dist/core/credentials.d.ts +219 -0
- package/dist/core/credentials.d.ts.map +1 -0
- package/dist/core/credentials.js +345 -0
- package/dist/core/template-loader.d.ts +15 -0
- package/dist/core/template-loader.d.ts.map +1 -0
- package/dist/core/template-loader.js +380 -0
- package/dist/core/template.d.ts +321 -0
- package/dist/core/template.d.ts.map +1 -0
- package/dist/core/template.js +189 -0
- package/dist/core/types.d.ts +572 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +52 -0
- package/dist/dev/dev-server.d.ts +16 -0
- package/dist/dev/dev-server.d.ts.map +1 -0
- package/dist/dev/dev-server.js +119 -0
- package/dist/generators/contracts/generator.d.ts +21 -0
- package/dist/generators/contracts/generator.d.ts.map +1 -0
- package/dist/generators/contracts/generator.js +252 -0
- package/dist/generators/tests/generator.d.ts +20 -0
- package/dist/generators/tests/generator.d.ts.map +1 -0
- package/dist/generators/tests/generator.js +375 -0
- package/dist/generators/types/generator.d.ts +19 -0
- package/dist/generators/types/generator.d.ts.map +1 -0
- package/dist/generators/types/generator.js +165 -0
- package/dist/generators/ui/component-generator.d.ts +20 -0
- package/dist/generators/ui/component-generator.d.ts.map +1 -0
- package/dist/generators/ui/component-generator.js +749 -0
- package/dist/generators/ui/dashboard-generator.d.ts +20 -0
- package/dist/generators/ui/dashboard-generator.d.ts.map +1 -0
- package/dist/generators/ui/dashboard-generator.js +349 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/modules/analytics/AnalyticsModule.d.ts +349 -0
- package/dist/modules/analytics/AnalyticsModule.d.ts.map +1 -0
- package/dist/modules/analytics/AnalyticsModule.js +274 -0
- package/dist/modules/analytics/index.d.ts +3 -0
- package/dist/modules/analytics/index.d.ts.map +1 -0
- package/dist/modules/analytics/index.js +1 -0
- package/dist/modules/auth/AccessKeyModule.d.ts +189 -0
- package/dist/modules/auth/AccessKeyModule.d.ts.map +1 -0
- package/dist/modules/auth/AccessKeyModule.js +322 -0
- package/dist/modules/auth/AuthModule.d.ts +133 -0
- package/dist/modules/auth/AuthModule.d.ts.map +1 -0
- package/dist/modules/auth/AuthModule.js +214 -0
- package/dist/modules/auth/index.d.ts +8 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +6 -0
- package/dist/modules/cache/CacheModule.d.ts +279 -0
- package/dist/modules/cache/CacheModule.d.ts.map +1 -0
- package/dist/modules/cache/CacheModule.js +493 -0
- package/dist/modules/cache/index.d.ts +3 -0
- package/dist/modules/cache/index.d.ts.map +1 -0
- package/dist/modules/cache/index.js +1 -0
- package/dist/modules/compute/ComputeModule.d.ts +226 -0
- package/dist/modules/compute/ComputeModule.d.ts.map +1 -0
- package/dist/modules/compute/ComputeModule.js +379 -0
- package/dist/modules/compute/index.d.ts +6 -0
- package/dist/modules/compute/index.d.ts.map +1 -0
- package/dist/modules/compute/index.js +4 -0
- package/dist/modules/contracts/ContractsModule.d.ts +164 -0
- package/dist/modules/contracts/ContractsModule.d.ts.map +1 -0
- package/dist/modules/contracts/ContractsModule.js +242 -0
- package/dist/modules/contracts/index.d.ts +6 -0
- package/dist/modules/contracts/index.d.ts.map +1 -0
- package/dist/modules/contracts/index.js +4 -0
- package/dist/modules/export/ExportModule.d.ts +346 -0
- package/dist/modules/export/ExportModule.d.ts.map +1 -0
- package/dist/modules/export/ExportModule.js +432 -0
- package/dist/modules/export/index.d.ts +3 -0
- package/dist/modules/export/index.d.ts.map +1 -0
- package/dist/modules/export/index.js +1 -0
- package/dist/modules/forecasting/ForecastingModule.d.ts +579 -0
- package/dist/modules/forecasting/ForecastingModule.d.ts.map +1 -0
- package/dist/modules/forecasting/ForecastingModule.js +310 -0
- package/dist/modules/forecasting/index.d.ts +3 -0
- package/dist/modules/forecasting/index.d.ts.map +1 -0
- package/dist/modules/forecasting/index.js +1 -0
- package/dist/modules/monitoring/MonitoringModule.d.ts +359 -0
- package/dist/modules/monitoring/MonitoringModule.d.ts.map +1 -0
- package/dist/modules/monitoring/MonitoringModule.js +483 -0
- package/dist/modules/monitoring/index.d.ts +3 -0
- package/dist/modules/monitoring/index.d.ts.map +1 -0
- package/dist/modules/monitoring/index.js +1 -0
- package/dist/modules/notifications/NotificationsModule.d.ts +336 -0
- package/dist/modules/notifications/NotificationsModule.d.ts.map +1 -0
- package/dist/modules/notifications/NotificationsModule.js +418 -0
- package/dist/modules/notifications/index.d.ts +3 -0
- package/dist/modules/notifications/index.d.ts.map +1 -0
- package/dist/modules/notifications/index.js +1 -0
- package/dist/modules/oracle/OracleModule.d.ts +110 -0
- package/dist/modules/oracle/OracleModule.d.ts.map +1 -0
- package/dist/modules/oracle/OracleModule.js +151 -0
- package/dist/modules/oracle/index.d.ts +6 -0
- package/dist/modules/oracle/index.d.ts.map +1 -0
- package/dist/modules/oracle/index.js +4 -0
- package/dist/modules/storage/S3Module.d.ts +377 -0
- package/dist/modules/storage/S3Module.d.ts.map +1 -0
- package/dist/modules/storage/S3Module.js +680 -0
- package/dist/modules/storage/StorageModule.d.ts +157 -0
- package/dist/modules/storage/StorageModule.d.ts.map +1 -0
- package/dist/modules/storage/StorageModule.js +302 -0
- package/dist/modules/storage/adapters/AdapterFactory.d.ts +100 -0
- package/dist/modules/storage/adapters/AdapterFactory.d.ts.map +1 -0
- package/dist/modules/storage/adapters/AdapterFactory.js +209 -0
- package/dist/modules/storage/adapters/FilecoinAdapter.d.ts +94 -0
- package/dist/modules/storage/adapters/FilecoinAdapter.d.ts.map +1 -0
- package/dist/modules/storage/adapters/FilecoinAdapter.js +263 -0
- package/dist/modules/storage/adapters/IStorageAdapter.d.ts +287 -0
- package/dist/modules/storage/adapters/IStorageAdapter.d.ts.map +1 -0
- package/dist/modules/storage/adapters/IStorageAdapter.js +81 -0
- package/dist/modules/storage/adapters/MultiTierAdapter.d.ts +187 -0
- package/dist/modules/storage/adapters/MultiTierAdapter.d.ts.map +1 -0
- package/dist/modules/storage/adapters/MultiTierAdapter.js +430 -0
- package/dist/modules/storage/adapters/index.d.ts +12 -0
- package/dist/modules/storage/adapters/index.d.ts.map +1 -0
- package/dist/modules/storage/adapters/index.js +12 -0
- package/dist/modules/storage/index.d.ts +16 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +15 -0
- package/dist/modules/storage/tiering/AccessAnalyzer.d.ts +227 -0
- package/dist/modules/storage/tiering/AccessAnalyzer.d.ts.map +1 -0
- package/dist/modules/storage/tiering/AccessAnalyzer.js +367 -0
- package/dist/modules/storage/tiering/CostOptimizer.d.ts +248 -0
- package/dist/modules/storage/tiering/CostOptimizer.d.ts.map +1 -0
- package/dist/modules/storage/tiering/CostOptimizer.js +356 -0
- package/dist/modules/storage/tiering/MetadataStore.d.ts +287 -0
- package/dist/modules/storage/tiering/MetadataStore.d.ts.map +1 -0
- package/dist/modules/storage/tiering/MetadataStore.js +535 -0
- package/dist/modules/storage/tiering/TieringEngine.d.ts +237 -0
- package/dist/modules/storage/tiering/TieringEngine.d.ts.map +1 -0
- package/dist/modules/storage/tiering/TieringEngine.js +419 -0
- package/dist/modules/storage/tiering/example.d.ts +8 -0
- package/dist/modules/storage/tiering/example.d.ts.map +1 -0
- package/dist/modules/storage/tiering/example.js +250 -0
- package/dist/modules/storage/tiering/index.d.ts +17 -0
- package/dist/modules/storage/tiering/index.d.ts.map +1 -0
- package/dist/modules/storage/tiering/index.js +13 -0
- package/dist/modules/webhooks/WebhooksModule.d.ts +476 -0
- package/dist/modules/webhooks/WebhooksModule.d.ts.map +1 -0
- package/dist/modules/webhooks/WebhooksModule.js +359 -0
- package/dist/modules/webhooks/index.d.ts +3 -0
- package/dist/modules/webhooks/index.d.ts.map +1 -0
- package/dist/modules/webhooks/index.js +1 -0
- package/dist/modules/zk/ZKModule.d.ts +153 -0
- package/dist/modules/zk/ZKModule.d.ts.map +1 -0
- package/dist/modules/zk/ZKModule.js +262 -0
- package/dist/modules/zk/index.d.ts +7 -0
- package/dist/modules/zk/index.d.ts.map +1 -0
- package/dist/modules/zk/index.js +4 -0
- package/dist/thirdweb/BridgeClient.d.ts +228 -0
- package/dist/thirdweb/BridgeClient.d.ts.map +1 -0
- package/dist/thirdweb/BridgeClient.js +160 -0
- package/dist/thirdweb/EngineClient.d.ts +396 -0
- package/dist/thirdweb/EngineClient.d.ts.map +1 -0
- package/dist/thirdweb/EngineClient.js +386 -0
- package/dist/thirdweb/GatewayClient.d.ts +190 -0
- package/dist/thirdweb/GatewayClient.d.ts.map +1 -0
- package/dist/thirdweb/GatewayClient.js +257 -0
- package/dist/thirdweb/NebulaClient.d.ts +292 -0
- package/dist/thirdweb/NebulaClient.d.ts.map +1 -0
- package/dist/thirdweb/NebulaClient.js +180 -0
- package/dist/thirdweb/StorageClient.d.ts +445 -0
- package/dist/thirdweb/StorageClient.d.ts.map +1 -0
- package/dist/thirdweb/StorageClient.js +405 -0
- package/dist/thirdweb/ThirdwebWrapper.d.ts +236 -0
- package/dist/thirdweb/ThirdwebWrapper.d.ts.map +1 -0
- package/dist/thirdweb/ThirdwebWrapper.js +332 -0
- package/dist/thirdweb/index.d.ts +21 -0
- package/dist/thirdweb/index.d.ts.map +1 -0
- package/dist/thirdweb/index.js +28 -0
- package/dist/thirdweb/varity-chain.d.ts +48 -0
- package/dist/thirdweb/varity-chain.d.ts.map +1 -0
- package/dist/thirdweb/varity-chain.js +64 -0
- package/dist/thirdweb/x402Client.d.ts +319 -0
- package/dist/thirdweb/x402Client.d.ts.map +1 -0
- package/dist/thirdweb/x402Client.js +223 -0
- package/dist/tracking/gasTracker.d.ts +158 -0
- package/dist/tracking/gasTracker.d.ts.map +1 -0
- package/dist/tracking/gasTracker.js +227 -0
- package/dist/tracking/index.d.ts +10 -0
- package/dist/tracking/index.d.ts.map +1 -0
- package/dist/tracking/index.js +8 -0
- package/dist/tracking/types.d.ts +327 -0
- package/dist/tracking/types.d.ts.map +1 -0
- package/dist/tracking/types.js +8 -0
- package/dist/ui/components/ChartWidget.d.ts +36 -0
- package/dist/ui/components/ChartWidget.d.ts.map +1 -0
- package/dist/ui/components/ChartWidget.js +82 -0
- package/dist/ui/components/DashboardLayout.d.ts +41 -0
- package/dist/ui/components/DashboardLayout.d.ts.map +1 -0
- package/dist/ui/components/DashboardLayout.js +102 -0
- package/dist/ui/components/DataTable.d.ts +49 -0
- package/dist/ui/components/DataTable.d.ts.map +1 -0
- package/dist/ui/components/DataTable.js +96 -0
- package/dist/ui/components/EntityForm.d.ts +60 -0
- package/dist/ui/components/EntityForm.d.ts.map +1 -0
- package/dist/ui/components/EntityForm.js +182 -0
- package/dist/ui/components/KPICard.d.ts +29 -0
- package/dist/ui/components/KPICard.d.ts.map +1 -0
- package/dist/ui/components/KPICard.js +61 -0
- package/dist/ui/components/Modal.d.ts +34 -0
- package/dist/ui/components/Modal.d.ts.map +1 -0
- package/dist/ui/components/Modal.js +30 -0
- package/dist/ui/components/index.d.ts +18 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +11 -0
- package/dist/validation/template-validator.d.ts +25 -0
- package/dist/validation/template-validator.d.ts.map +1 -0
- package/dist/validation/template-validator.js +305 -0
- package/package.json +102 -0
|
@@ -0,0 +1,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,KAAK,EAAE,KAAK,CAAC;IAEb;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA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