@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,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thirdweb Wrapper for Varity SDK
|
|
3
|
+
*
|
|
4
|
+
* This wrapper provides Thirdweb SDK v5 functionality while maintaining
|
|
5
|
+
* 100% backwards compatibility with existing ethers.js v6 implementation.
|
|
6
|
+
*
|
|
7
|
+
* Pattern: Optional enhancement layer - does NOT break existing functionality
|
|
8
|
+
*/
|
|
9
|
+
import { createThirdwebClient, getContract as getThirdwebContract } from 'thirdweb';
|
|
10
|
+
import { deployContract as deployThirdwebContract } from 'thirdweb/deploys';
|
|
11
|
+
import { upload, download } from 'thirdweb/storage';
|
|
12
|
+
import { privateKeyToAccount } from 'thirdweb/wallets';
|
|
13
|
+
import { ethers } from 'ethers';
|
|
14
|
+
import { VARITY_TESTNET_RPC } from './varity-chain';
|
|
15
|
+
import { ChainRegistry, varityL3Testnet } from '../chains';
|
|
16
|
+
/**
|
|
17
|
+
* ThirdwebWrapper Class
|
|
18
|
+
*
|
|
19
|
+
* Provides Thirdweb SDK capabilities with ethers.js fallback.
|
|
20
|
+
* All existing ethers.js functionality is preserved.
|
|
21
|
+
*/
|
|
22
|
+
export class ThirdwebWrapper {
|
|
23
|
+
constructor(config) {
|
|
24
|
+
// Determine chain
|
|
25
|
+
if (config.chain) {
|
|
26
|
+
if (typeof config.chain === 'number') {
|
|
27
|
+
// Chain ID provided - look up in registry
|
|
28
|
+
this.chain = ChainRegistry.getChain(config.chain);
|
|
29
|
+
this.chainId = config.chain;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// Chain object provided directly
|
|
33
|
+
this.chain = config.chain;
|
|
34
|
+
this.chainId = config.chain.id;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if (config.chainId) {
|
|
38
|
+
// Legacy chainId parameter (deprecated but supported)
|
|
39
|
+
console.warn('ThirdwebWrapper: chainId parameter is deprecated. Use chain parameter instead.');
|
|
40
|
+
this.chain = ChainRegistry.getChain(config.chainId);
|
|
41
|
+
this.chainId = config.chainId;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Default to Varity L3 Testnet
|
|
45
|
+
this.chain = varityL3Testnet;
|
|
46
|
+
this.chainId = varityL3Testnet.id;
|
|
47
|
+
}
|
|
48
|
+
// Initialize Thirdweb Client
|
|
49
|
+
const clientId = config.clientId || process.env.VARITY_THIRDWEB_CLIENT_ID || process.env.THIRDWEB_CLIENT_ID;
|
|
50
|
+
if (!clientId) {
|
|
51
|
+
throw new Error('Thirdweb Client ID required. Set VARITY_THIRDWEB_CLIENT_ID environment variable or pass clientId in config.');
|
|
52
|
+
}
|
|
53
|
+
this.client = createThirdwebClient({
|
|
54
|
+
clientId,
|
|
55
|
+
});
|
|
56
|
+
// Initialize account if private key provided
|
|
57
|
+
if (config.privateKey) {
|
|
58
|
+
this.account = privateKeyToAccount({
|
|
59
|
+
client: this.client,
|
|
60
|
+
privateKey: config.privateKey,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// Preserve ethers.js fallback with RPC from config or chain default
|
|
64
|
+
const rpcUrl = config.rpcUrl || this.chain.rpc || VARITY_TESTNET_RPC;
|
|
65
|
+
this.ethersProvider = new ethers.JsonRpcProvider(rpcUrl);
|
|
66
|
+
}
|
|
67
|
+
// ===== NEW: Thirdweb Methods =====
|
|
68
|
+
/**
|
|
69
|
+
* Get a contract instance using Thirdweb
|
|
70
|
+
* @param address Contract address
|
|
71
|
+
* @returns Thirdweb contract instance
|
|
72
|
+
*/
|
|
73
|
+
async getContract(address) {
|
|
74
|
+
return getThirdwebContract({
|
|
75
|
+
client: this.client,
|
|
76
|
+
chain: this.chain,
|
|
77
|
+
address,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Deploy a contract using Thirdweb
|
|
82
|
+
* @param params Deployment parameters
|
|
83
|
+
* @returns Deployed contract address
|
|
84
|
+
*/
|
|
85
|
+
async deployContract(params) {
|
|
86
|
+
if (!this.account) {
|
|
87
|
+
throw new Error('Account required for contract deployment. Provide privateKey in config.');
|
|
88
|
+
}
|
|
89
|
+
const address = await deployThirdwebContract({
|
|
90
|
+
client: this.client,
|
|
91
|
+
chain: this.chain,
|
|
92
|
+
account: this.account,
|
|
93
|
+
abi: params.abi, // Type cast to satisfy Thirdweb's strict typing
|
|
94
|
+
bytecode: params.bytecode,
|
|
95
|
+
constructorParams: params.constructorArgs || [],
|
|
96
|
+
});
|
|
97
|
+
return {
|
|
98
|
+
address,
|
|
99
|
+
deployed: true,
|
|
100
|
+
method: 'thirdweb',
|
|
101
|
+
transactionHash: address, // Thirdweb v5 returns address directly
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Upload data to IPFS using Thirdweb Storage
|
|
106
|
+
* @param data Data to upload (can be JSON, File, or any supported type)
|
|
107
|
+
* @returns IPFS URI
|
|
108
|
+
*/
|
|
109
|
+
async uploadToIPFS(data) {
|
|
110
|
+
const uri = await upload({
|
|
111
|
+
client: this.client,
|
|
112
|
+
files: [data],
|
|
113
|
+
});
|
|
114
|
+
return uri;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Download data from IPFS using Thirdweb Storage
|
|
118
|
+
* @param uri IPFS URI
|
|
119
|
+
* @returns Downloaded data
|
|
120
|
+
*/
|
|
121
|
+
async downloadFromIPFS(uri) {
|
|
122
|
+
const data = await download({
|
|
123
|
+
client: this.client,
|
|
124
|
+
uri,
|
|
125
|
+
});
|
|
126
|
+
return data;
|
|
127
|
+
}
|
|
128
|
+
// ===== PRESERVED: Ethers.js Fallback Methods =====
|
|
129
|
+
/**
|
|
130
|
+
* Get the ethers.js provider (backwards compatibility)
|
|
131
|
+
* @returns Ethers JsonRpcProvider
|
|
132
|
+
*/
|
|
133
|
+
getEthersProvider() {
|
|
134
|
+
return this.ethersProvider;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get a contract instance using ethers.js (backwards compatibility)
|
|
138
|
+
* @param address Contract address
|
|
139
|
+
* @param abi Contract ABI
|
|
140
|
+
* @returns Ethers Contract instance
|
|
141
|
+
*/
|
|
142
|
+
async getContractWithEthers(address, abi) {
|
|
143
|
+
return new ethers.Contract(address, abi, this.ethersProvider);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Deploy a contract using ethers.js (backwards compatibility)
|
|
147
|
+
* @param params Deployment parameters
|
|
148
|
+
* @returns Deployment result
|
|
149
|
+
*/
|
|
150
|
+
async deployContractWithEthers(params) {
|
|
151
|
+
if (!this.account) {
|
|
152
|
+
throw new Error('Account required for contract deployment. Provide privateKey in config.');
|
|
153
|
+
}
|
|
154
|
+
const wallet = new ethers.Wallet(this.account.address, this.ethersProvider);
|
|
155
|
+
const factory = new ethers.ContractFactory(params.abi, params.bytecode, wallet);
|
|
156
|
+
const contract = await factory.deploy(...(params.constructorArgs || []));
|
|
157
|
+
await contract.waitForDeployment();
|
|
158
|
+
return {
|
|
159
|
+
address: await contract.getAddress(),
|
|
160
|
+
deployed: true,
|
|
161
|
+
method: 'ethers',
|
|
162
|
+
transactionHash: contract.deploymentTransaction()?.hash,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
// ===== UTILITY METHODS =====
|
|
166
|
+
/**
|
|
167
|
+
* Get the Thirdweb client instance
|
|
168
|
+
* @returns Thirdweb client
|
|
169
|
+
*/
|
|
170
|
+
getClient() {
|
|
171
|
+
return this.client;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get the Thirdweb account (if configured)
|
|
175
|
+
* @returns Thirdweb account or undefined
|
|
176
|
+
*/
|
|
177
|
+
getAccount() {
|
|
178
|
+
return this.account;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Get the chain configuration
|
|
182
|
+
* @returns Varity chain definition
|
|
183
|
+
*/
|
|
184
|
+
getChain() {
|
|
185
|
+
return this.chain;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Get the chain ID
|
|
189
|
+
* @returns Chain ID (33529)
|
|
190
|
+
*/
|
|
191
|
+
getChainId() {
|
|
192
|
+
return this.chainId;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Check if Thirdweb account is configured
|
|
196
|
+
* @returns True if account is available
|
|
197
|
+
*/
|
|
198
|
+
hasAccount() {
|
|
199
|
+
return !!this.account;
|
|
200
|
+
}
|
|
201
|
+
// ===== HYBRID METHODS: Try Thirdweb, fallback to Ethers =====
|
|
202
|
+
/**
|
|
203
|
+
* Deploy contract with automatic fallback
|
|
204
|
+
* Tries Thirdweb first, falls back to ethers.js on error
|
|
205
|
+
* @param params Deployment parameters
|
|
206
|
+
* @returns Deployment result
|
|
207
|
+
*/
|
|
208
|
+
async deployWithFallback(params) {
|
|
209
|
+
try {
|
|
210
|
+
return await this.deployContract(params);
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
console.warn('Thirdweb deployment failed, falling back to ethers.js:', error);
|
|
214
|
+
return await this.deployContractWithEthers(params);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// ===== BLOCKCHAIN QUERY METHODS (using ethers.js) =====
|
|
218
|
+
/**
|
|
219
|
+
* Get contract events
|
|
220
|
+
* @param params Event query parameters
|
|
221
|
+
* @returns Contract events
|
|
222
|
+
*/
|
|
223
|
+
async getContractEvents(params) {
|
|
224
|
+
// Use ethers.js to query events
|
|
225
|
+
const provider = this.ethersProvider;
|
|
226
|
+
const filter = {
|
|
227
|
+
address: params.contract.address,
|
|
228
|
+
fromBlock: params.fromBlock || 0,
|
|
229
|
+
toBlock: params.toBlock || 'latest',
|
|
230
|
+
};
|
|
231
|
+
const logs = await provider.getLogs(filter);
|
|
232
|
+
return logs;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Get block information
|
|
236
|
+
* @param blockNumber Block number or 'latest'
|
|
237
|
+
* @returns Block information
|
|
238
|
+
*/
|
|
239
|
+
async getBlock(blockNumber) {
|
|
240
|
+
return await this.ethersProvider.getBlock(blockNumber);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get transaction information
|
|
244
|
+
* @param hash Transaction hash
|
|
245
|
+
* @returns Transaction information
|
|
246
|
+
*/
|
|
247
|
+
async getTransaction(hash) {
|
|
248
|
+
return await this.ethersProvider.getTransaction(hash);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get current gas price
|
|
252
|
+
* @returns Gas price in wei
|
|
253
|
+
*/
|
|
254
|
+
async getGasPrice() {
|
|
255
|
+
const feeData = await this.ethersProvider.getFeeData();
|
|
256
|
+
return feeData.gasPrice;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Get wallet balance
|
|
260
|
+
* @param address Wallet address
|
|
261
|
+
* @returns Balance in wei
|
|
262
|
+
*/
|
|
263
|
+
async getBalance(address) {
|
|
264
|
+
return await this.ethersProvider.getBalance(address);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Get NFTs for a wallet
|
|
268
|
+
* @param address Wallet address
|
|
269
|
+
* @param options Query options
|
|
270
|
+
* @returns NFT list
|
|
271
|
+
*/
|
|
272
|
+
async getNFTs(address, options) {
|
|
273
|
+
// TODO: Implement NFT querying using Thirdweb SDK or external API
|
|
274
|
+
// For now, return empty array as placeholder
|
|
275
|
+
console.warn('getNFTs not yet implemented, returning empty array');
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get transaction history for a wallet
|
|
280
|
+
* @param address Wallet address
|
|
281
|
+
* @param options Query options
|
|
282
|
+
* @returns Transaction history
|
|
283
|
+
*/
|
|
284
|
+
async getTransactionHistory(address, options) {
|
|
285
|
+
// TODO: Implement transaction history using block explorer API
|
|
286
|
+
// For now, return empty array as placeholder
|
|
287
|
+
console.warn('getTransactionHistory not yet implemented, returning empty array');
|
|
288
|
+
return [];
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Get token balances for a wallet
|
|
292
|
+
* @param address Wallet address
|
|
293
|
+
* @returns Token balances
|
|
294
|
+
*/
|
|
295
|
+
async getTokenBalances(address) {
|
|
296
|
+
// TODO: Implement token balance querying using Thirdweb SDK or external API
|
|
297
|
+
// For now, return empty array as placeholder
|
|
298
|
+
console.warn('getTokenBalances not yet implemented, returning empty array');
|
|
299
|
+
return [];
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Send transaction
|
|
303
|
+
* @param params Transaction parameters
|
|
304
|
+
* @returns Transaction result
|
|
305
|
+
*/
|
|
306
|
+
async sendTransaction(params) {
|
|
307
|
+
if (!this.account) {
|
|
308
|
+
throw new Error('Account required for sending transactions. Provide privateKey in config.');
|
|
309
|
+
}
|
|
310
|
+
// Use ethers.js to send transaction
|
|
311
|
+
const wallet = new ethers.Wallet(this.account.address, this.ethersProvider);
|
|
312
|
+
const tx = await wallet.sendTransaction({
|
|
313
|
+
to: params.to,
|
|
314
|
+
value: ethers.parseEther(params.amount),
|
|
315
|
+
});
|
|
316
|
+
await tx.wait();
|
|
317
|
+
return {
|
|
318
|
+
transactionHash: tx.hash,
|
|
319
|
+
from: params.from,
|
|
320
|
+
to: params.to,
|
|
321
|
+
amount: params.amount,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Factory function to create ThirdwebWrapper instance
|
|
327
|
+
* @param config Configuration options
|
|
328
|
+
* @returns ThirdwebWrapper instance
|
|
329
|
+
*/
|
|
330
|
+
export function createThirdwebWrapper(config) {
|
|
331
|
+
return new ThirdwebWrapper(config);
|
|
332
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK - thirdweb Integration Module
|
|
3
|
+
*
|
|
4
|
+
* Complete thirdweb v5 integration including:
|
|
5
|
+
* - ThirdwebWrapper for contract operations
|
|
6
|
+
* - Engine for production transaction management
|
|
7
|
+
* - Nebula AI for natural language blockchain
|
|
8
|
+
* - Storage for IPFS/Arweave
|
|
9
|
+
* - Bridge for cross-chain transfers
|
|
10
|
+
* - Gateway for RPC infrastructure
|
|
11
|
+
* - x402 for API monetization
|
|
12
|
+
*/
|
|
13
|
+
export { ThirdwebWrapper, createThirdwebWrapper, type ThirdwebWrapperConfig, type DeployContractParams, } from './ThirdwebWrapper';
|
|
14
|
+
export { EngineClient, createEngineClient, parseEngineWebhook, verifyEngineWebhook, type EngineConfig, type EngineTransactionParams, type EngineTransactionStatus, type EngineTransactionResult, type EngineDeployParams, type EngineWebhookPayload, } from './EngineClient';
|
|
15
|
+
export { NebulaClient, createNebulaClient, type NebulaConfig, type GenerateContractOptions, type GeneratedContract, type QueryChainOptions, type QueryResult, type ExplainTransactionOptions, type TransactionExplanation, type GenerateCodeOptions, type GeneratedCode, type AnalyzeContractOptions, type ContractAnalysis, } from './NebulaClient';
|
|
16
|
+
export { StorageClient, createStorageClient, type StorageConfig, type ThirdwebUploadResult, type NFTMetadata, type BatchUploadItem, type BatchUploadResult, type ThirdwebDownloadOptions, type ImageOptimizationOptions, } from './StorageClient';
|
|
17
|
+
export { BridgeClient, createBridgeClient, type BridgeConfig, type AssetType, type BridgeRoute, type BridgeAssetParams, type BridgeStatus, type BridgeTransactionResult, type BridgeQuote, type BridgeHistoryEntry, } from './BridgeClient';
|
|
18
|
+
export { GatewayClient, createGatewayClient, type GatewayConfig, type RPCRequestOptions, type RPCResponse, type GatewayStats, type WebSocketOptions, } from './GatewayClient';
|
|
19
|
+
export { x402Client, createx402Client, x402Middleware, type x402Config, type PaymentEndpointConfig, type PaymentStats, type UsageRecord, type SubscriptionPlan, type Subscription, } from './x402Client';
|
|
20
|
+
export { varietyTestnet, getVarityChain, isVarityChain, VARITY_TESTNET_RPC, VARITY_CHAIN_METADATA, } from './varity-chain';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/thirdweb/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,cAAc,EACd,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK - thirdweb Integration Module
|
|
3
|
+
*
|
|
4
|
+
* Complete thirdweb v5 integration including:
|
|
5
|
+
* - ThirdwebWrapper for contract operations
|
|
6
|
+
* - Engine for production transaction management
|
|
7
|
+
* - Nebula AI for natural language blockchain
|
|
8
|
+
* - Storage for IPFS/Arweave
|
|
9
|
+
* - Bridge for cross-chain transfers
|
|
10
|
+
* - Gateway for RPC infrastructure
|
|
11
|
+
* - x402 for API monetization
|
|
12
|
+
*/
|
|
13
|
+
// ThirdwebWrapper
|
|
14
|
+
export { ThirdwebWrapper, createThirdwebWrapper, } from './ThirdwebWrapper';
|
|
15
|
+
// Engine Client
|
|
16
|
+
export { EngineClient, createEngineClient, parseEngineWebhook, verifyEngineWebhook, } from './EngineClient';
|
|
17
|
+
// Nebula AI Client
|
|
18
|
+
export { NebulaClient, createNebulaClient, } from './NebulaClient';
|
|
19
|
+
// Storage Client
|
|
20
|
+
export { StorageClient, createStorageClient, } from './StorageClient';
|
|
21
|
+
// Bridge Client
|
|
22
|
+
export { BridgeClient, createBridgeClient, } from './BridgeClient';
|
|
23
|
+
// Gateway Client
|
|
24
|
+
export { GatewayClient, createGatewayClient, } from './GatewayClient';
|
|
25
|
+
// x402 Payment Protocol Client
|
|
26
|
+
export { x402Client, createx402Client, x402Middleware, } from './x402Client';
|
|
27
|
+
// Legacy chain export (backwards compatibility)
|
|
28
|
+
export { varietyTestnet, getVarityChain, isVarityChain, VARITY_TESTNET_RPC, VARITY_CHAIN_METADATA, } from './varity-chain';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity L3 Chain Definition for Thirdweb SDK v5
|
|
3
|
+
*
|
|
4
|
+
* Chain ID: 33529
|
|
5
|
+
* RPC: https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz
|
|
6
|
+
* Explorer: https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz
|
|
7
|
+
*
|
|
8
|
+
* CRITICAL: Native token is USDC with 6 decimals (NOT 18!)
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Varity Testnet L3 Chain Configuration
|
|
12
|
+
* Built on Arbitrum Orbit framework
|
|
13
|
+
*/
|
|
14
|
+
export declare const varietyTestnet: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
15
|
+
rpc: string;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Varity Testnet RPC Configuration
|
|
19
|
+
*/
|
|
20
|
+
export declare const VARITY_TESTNET_RPC = "https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz";
|
|
21
|
+
/**
|
|
22
|
+
* Varity Chain Metadata
|
|
23
|
+
*/
|
|
24
|
+
export declare const VARITY_CHAIN_METADATA: {
|
|
25
|
+
chainId: number;
|
|
26
|
+
chainName: string;
|
|
27
|
+
rpcUrl: string;
|
|
28
|
+
explorerUrl: string;
|
|
29
|
+
nativeToken: {
|
|
30
|
+
name: string;
|
|
31
|
+
symbol: string;
|
|
32
|
+
decimals: number;
|
|
33
|
+
};
|
|
34
|
+
isTestnet: boolean;
|
|
35
|
+
l1Chain: string;
|
|
36
|
+
framework: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to get chain configuration
|
|
40
|
+
*/
|
|
41
|
+
export declare function getVarityChain(): Readonly<import("thirdweb/chains").ChainOptions & {
|
|
42
|
+
rpc: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Helper function to validate chain ID
|
|
46
|
+
*/
|
|
47
|
+
export declare function isVarityChain(chainId: number): boolean;
|
|
48
|
+
//# sourceMappingURL=varity-chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"varity-chain.d.ts","sourceRoot":"","sources":["../../src/thirdweb/varity-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;GAGG;AACH,eAAO,MAAM,cAAc;;EAgBzB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,wDAAwD,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;CAajC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc;;GAE7B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity L3 Chain Definition for Thirdweb SDK v5
|
|
3
|
+
*
|
|
4
|
+
* Chain ID: 33529
|
|
5
|
+
* RPC: https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz
|
|
6
|
+
* Explorer: https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz
|
|
7
|
+
*
|
|
8
|
+
* CRITICAL: Native token is USDC with 6 decimals (NOT 18!)
|
|
9
|
+
*/
|
|
10
|
+
import { defineChain } from 'thirdweb/chains';
|
|
11
|
+
/**
|
|
12
|
+
* Varity Testnet L3 Chain Configuration
|
|
13
|
+
* Built on Arbitrum Orbit framework
|
|
14
|
+
*/
|
|
15
|
+
export const varietyTestnet = defineChain({
|
|
16
|
+
id: 33529,
|
|
17
|
+
name: 'Varity Testnet',
|
|
18
|
+
nativeCurrency: {
|
|
19
|
+
name: 'USDC',
|
|
20
|
+
symbol: 'USDC',
|
|
21
|
+
decimals: 6, // CRITICAL: 6 decimals, not 18!
|
|
22
|
+
},
|
|
23
|
+
blockExplorers: [
|
|
24
|
+
{
|
|
25
|
+
name: 'Varity Explorer',
|
|
26
|
+
url: 'https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz',
|
|
27
|
+
apiUrl: 'https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz/api',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
testnet: true,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Varity Testnet RPC Configuration
|
|
34
|
+
*/
|
|
35
|
+
export const VARITY_TESTNET_RPC = 'https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz';
|
|
36
|
+
/**
|
|
37
|
+
* Varity Chain Metadata
|
|
38
|
+
*/
|
|
39
|
+
export const VARITY_CHAIN_METADATA = {
|
|
40
|
+
chainId: 33529,
|
|
41
|
+
chainName: 'Varity Testnet',
|
|
42
|
+
rpcUrl: VARITY_TESTNET_RPC,
|
|
43
|
+
explorerUrl: 'https://explorer-varity-testnet-rroe52pwjp.t.conduit.xyz',
|
|
44
|
+
nativeToken: {
|
|
45
|
+
name: 'USDC',
|
|
46
|
+
symbol: 'USDC',
|
|
47
|
+
decimals: 6,
|
|
48
|
+
},
|
|
49
|
+
isTestnet: true,
|
|
50
|
+
l1Chain: 'Arbitrum One',
|
|
51
|
+
framework: 'Arbitrum Orbit',
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Helper function to get chain configuration
|
|
55
|
+
*/
|
|
56
|
+
export function getVarityChain() {
|
|
57
|
+
return varietyTestnet;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Helper function to validate chain ID
|
|
61
|
+
*/
|
|
62
|
+
export function isVarityChain(chainId) {
|
|
63
|
+
return chainId === 33529;
|
|
64
|
+
}
|