@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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity Blockchain Module
|
|
3
|
+
*
|
|
4
|
+
* Production-grade blockchain integration for Varity L3 and other EVM chains.
|
|
5
|
+
* Extracted from generic-template-dashboard production deployment.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - thirdweb v5 function-based API
|
|
9
|
+
* - Contract reading and writing
|
|
10
|
+
* - NFT licensing (ERC-1155)
|
|
11
|
+
* - Revenue split distribution (70/30)
|
|
12
|
+
* - Multi-chain support
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import {
|
|
17
|
+
* BlockchainService,
|
|
18
|
+
* NFTLicensingService,
|
|
19
|
+
* RevenueSplitService
|
|
20
|
+
* } from '@varity-labs/sdk/blockchain';
|
|
21
|
+
*
|
|
22
|
+
* // Initialize blockchain service
|
|
23
|
+
* const blockchain = new BlockchainService({
|
|
24
|
+
* rpcUrl: "https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz",
|
|
25
|
+
* chainId: 33529
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Load contract ABIs
|
|
29
|
+
* blockchain.loadContractABI('ToolLicenseNFT', nftABI);
|
|
30
|
+
* blockchain.initializeContract('ToolLicenseNFT', '0x...');
|
|
31
|
+
*
|
|
32
|
+
* // Use NFT licensing
|
|
33
|
+
* const licensing = new NFTLicensingService(blockchain);
|
|
34
|
+
* const hasLicense = await licensing.hasLicense('0x...', 1);
|
|
35
|
+
*
|
|
36
|
+
* // Use revenue splits
|
|
37
|
+
* const revenue = new RevenueSplitService(blockchain);
|
|
38
|
+
* const [creator, platform] = revenue.calculateSplit(100_000_000n);
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @module blockchain
|
|
42
|
+
* @packageDocumentation
|
|
43
|
+
*/
|
|
44
|
+
export { BlockchainService } from './BlockchainService';
|
|
45
|
+
export { NFTLicensingService } from './NFTLicensingService';
|
|
46
|
+
export { RevenueSplitService } from './RevenueSplitService';
|
|
47
|
+
export type { ContractConfig, NFTLicenseMetadata, LicenseInfo, RevenueSplit, TransactionResult, BlockchainServiceOptions, } from './types';
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blockchain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity Blockchain Module
|
|
3
|
+
*
|
|
4
|
+
* Production-grade blockchain integration for Varity L3 and other EVM chains.
|
|
5
|
+
* Extracted from generic-template-dashboard production deployment.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - thirdweb v5 function-based API
|
|
9
|
+
* - Contract reading and writing
|
|
10
|
+
* - NFT licensing (ERC-1155)
|
|
11
|
+
* - Revenue split distribution (70/30)
|
|
12
|
+
* - Multi-chain support
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import {
|
|
17
|
+
* BlockchainService,
|
|
18
|
+
* NFTLicensingService,
|
|
19
|
+
* RevenueSplitService
|
|
20
|
+
* } from '@varity-labs/sdk/blockchain';
|
|
21
|
+
*
|
|
22
|
+
* // Initialize blockchain service
|
|
23
|
+
* const blockchain = new BlockchainService({
|
|
24
|
+
* rpcUrl: "https://rpc-varity-testnet-rroe52pwjp.t.conduit.xyz",
|
|
25
|
+
* chainId: 33529
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Load contract ABIs
|
|
29
|
+
* blockchain.loadContractABI('ToolLicenseNFT', nftABI);
|
|
30
|
+
* blockchain.initializeContract('ToolLicenseNFT', '0x...');
|
|
31
|
+
*
|
|
32
|
+
* // Use NFT licensing
|
|
33
|
+
* const licensing = new NFTLicensingService(blockchain);
|
|
34
|
+
* const hasLicense = await licensing.hasLicense('0x...', 1);
|
|
35
|
+
*
|
|
36
|
+
* // Use revenue splits
|
|
37
|
+
* const revenue = new RevenueSplitService(blockchain);
|
|
38
|
+
* const [creator, platform] = revenue.calculateSplit(100_000_000n);
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @module blockchain
|
|
42
|
+
* @packageDocumentation
|
|
43
|
+
*/
|
|
44
|
+
export { BlockchainService } from './BlockchainService';
|
|
45
|
+
export { NFTLicensingService } from './NFTLicensingService';
|
|
46
|
+
export { RevenueSplitService } from './RevenueSplitService';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Varity blockchain module
|
|
3
|
+
*
|
|
4
|
+
* Production patterns extracted from generic-template-dashboard
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for a smart contract
|
|
8
|
+
*/
|
|
9
|
+
export interface ContractConfig {
|
|
10
|
+
name: string;
|
|
11
|
+
address: string;
|
|
12
|
+
abi: any[];
|
|
13
|
+
chainId: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Metadata for an NFT License (ERC-1155)
|
|
17
|
+
*/
|
|
18
|
+
export interface NFTLicenseMetadata {
|
|
19
|
+
toolId: number;
|
|
20
|
+
name: string;
|
|
21
|
+
description: string;
|
|
22
|
+
price: bigint;
|
|
23
|
+
creator: string;
|
|
24
|
+
isActive: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Information about a user's NFT license
|
|
28
|
+
*/
|
|
29
|
+
export interface LicenseInfo {
|
|
30
|
+
toolId: number;
|
|
31
|
+
balance: bigint;
|
|
32
|
+
expiresAt?: number;
|
|
33
|
+
isValid: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Revenue split configuration
|
|
37
|
+
*/
|
|
38
|
+
export interface RevenueSplit {
|
|
39
|
+
creatorPercentage: number;
|
|
40
|
+
platformPercentage: number;
|
|
41
|
+
creatorAddress: string;
|
|
42
|
+
platformAddress: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Result of a blockchain transaction
|
|
46
|
+
*/
|
|
47
|
+
export interface TransactionResult {
|
|
48
|
+
txHash: string;
|
|
49
|
+
blockNumber?: number;
|
|
50
|
+
gasUsed?: bigint;
|
|
51
|
+
status: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options for blockchain service initialization
|
|
55
|
+
*/
|
|
56
|
+
export interface BlockchainServiceOptions {
|
|
57
|
+
rpcUrl: string;
|
|
58
|
+
chainId: number;
|
|
59
|
+
engineUrl?: string;
|
|
60
|
+
engineAccessToken?: string;
|
|
61
|
+
backendWallet?: string;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/blockchain/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,GAAG,EAAE,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arbitrum Chain Configuration
|
|
3
|
+
*
|
|
4
|
+
* Arbitrum is an Optimistic Rollup on Ethereum providing fast, low-cost transactions
|
|
5
|
+
* Supports both testnet (Sepolia) and mainnet (Arbitrum One)
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Arbitrum Sepolia Testnet Configuration
|
|
9
|
+
* Chain ID: 421614
|
|
10
|
+
* Native Token: ETH (18 decimals)
|
|
11
|
+
*/
|
|
12
|
+
export declare const arbitrumSepolia: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
13
|
+
rpc: string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Arbitrum One Mainnet Configuration
|
|
17
|
+
* Chain ID: 42161
|
|
18
|
+
* Native Token: ETH (18 decimals)
|
|
19
|
+
*/
|
|
20
|
+
export declare const arbitrum: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
21
|
+
rpc: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Alias for arbitrum (mainnet)
|
|
25
|
+
*/
|
|
26
|
+
export declare const arbitrumOne: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
27
|
+
rpc: string;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Get explorer URL for Arbitrum chains
|
|
31
|
+
*/
|
|
32
|
+
export declare function getArbitrumExplorerUrl(chainId: number, type: 'tx' | 'address' | 'block', hash: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Wagmi-compatible configuration for Arbitrum Sepolia
|
|
35
|
+
*/
|
|
36
|
+
export declare const arbitrumSepoliaWagmi: {
|
|
37
|
+
readonly id: 421614;
|
|
38
|
+
readonly name: "Arbitrum Sepolia";
|
|
39
|
+
readonly network: "arbitrum-sepolia";
|
|
40
|
+
readonly nativeCurrency: {
|
|
41
|
+
readonly name: "Ether";
|
|
42
|
+
readonly symbol: "ETH";
|
|
43
|
+
readonly decimals: 18;
|
|
44
|
+
};
|
|
45
|
+
readonly rpcUrls: {
|
|
46
|
+
readonly default: {
|
|
47
|
+
readonly http: readonly ["https://sepolia-rollup.arbitrum.io/rpc"];
|
|
48
|
+
};
|
|
49
|
+
readonly public: {
|
|
50
|
+
readonly http: readonly ["https://sepolia-rollup.arbitrum.io/rpc"];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly blockExplorers: {
|
|
54
|
+
readonly default: {
|
|
55
|
+
readonly name: "Arbiscan";
|
|
56
|
+
readonly url: "https://sepolia.arbiscan.io";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly testnet: true;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Wagmi-compatible configuration for Arbitrum One
|
|
63
|
+
*/
|
|
64
|
+
export declare const arbitrumOneWagmi: {
|
|
65
|
+
readonly id: 42161;
|
|
66
|
+
readonly name: "Arbitrum One";
|
|
67
|
+
readonly network: "arbitrum";
|
|
68
|
+
readonly nativeCurrency: {
|
|
69
|
+
readonly name: "Ether";
|
|
70
|
+
readonly symbol: "ETH";
|
|
71
|
+
readonly decimals: 18;
|
|
72
|
+
};
|
|
73
|
+
readonly rpcUrls: {
|
|
74
|
+
readonly default: {
|
|
75
|
+
readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
|
|
76
|
+
};
|
|
77
|
+
readonly public: {
|
|
78
|
+
readonly http: readonly ["https://arb1.arbitrum.io/rpc"];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
readonly blockExplorers: {
|
|
82
|
+
readonly default: {
|
|
83
|
+
readonly name: "Arbiscan";
|
|
84
|
+
readonly url: "https://arbiscan.io";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
readonly testnet: false;
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=arbitrum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arbitrum.d.ts","sourceRoot":"","sources":["../../src/chains/arbitrum.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;GAIG;AACH,eAAO,MAAM,eAAe;;EAgB1B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,QAAQ;;EAoBnB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;EAAW,CAAC;AAEpC;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,CAeR;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;CAwBvB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAwBnB,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arbitrum Chain Configuration
|
|
3
|
+
*
|
|
4
|
+
* Arbitrum is an Optimistic Rollup on Ethereum providing fast, low-cost transactions
|
|
5
|
+
* Supports both testnet (Sepolia) and mainnet (Arbitrum One)
|
|
6
|
+
*/
|
|
7
|
+
import { defineChain } from 'thirdweb/chains';
|
|
8
|
+
/**
|
|
9
|
+
* Arbitrum Sepolia Testnet Configuration
|
|
10
|
+
* Chain ID: 421614
|
|
11
|
+
* Native Token: ETH (18 decimals)
|
|
12
|
+
*/
|
|
13
|
+
export const arbitrumSepolia = defineChain({
|
|
14
|
+
id: 421614,
|
|
15
|
+
name: 'Arbitrum Sepolia',
|
|
16
|
+
nativeCurrency: {
|
|
17
|
+
name: 'Ether',
|
|
18
|
+
symbol: 'ETH',
|
|
19
|
+
decimals: 18,
|
|
20
|
+
},
|
|
21
|
+
rpc: 'https://sepolia-rollup.arbitrum.io/rpc',
|
|
22
|
+
blockExplorers: [
|
|
23
|
+
{
|
|
24
|
+
name: 'Arbiscan',
|
|
25
|
+
url: 'https://sepolia.arbiscan.io',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
testnet: true,
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Arbitrum One Mainnet Configuration
|
|
32
|
+
* Chain ID: 42161
|
|
33
|
+
* Native Token: ETH (18 decimals)
|
|
34
|
+
*/
|
|
35
|
+
export const arbitrum = defineChain({
|
|
36
|
+
id: 42161,
|
|
37
|
+
name: 'Arbitrum One',
|
|
38
|
+
nativeCurrency: {
|
|
39
|
+
name: 'Ether',
|
|
40
|
+
symbol: 'ETH',
|
|
41
|
+
decimals: 18,
|
|
42
|
+
},
|
|
43
|
+
rpcUrls: {
|
|
44
|
+
default: {
|
|
45
|
+
http: ['https://arb1.arbitrum.io/rpc'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
blockExplorers: {
|
|
49
|
+
default: {
|
|
50
|
+
name: 'Arbiscan',
|
|
51
|
+
url: 'https://arbiscan.io',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
testnet: false,
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Alias for arbitrum (mainnet)
|
|
58
|
+
*/
|
|
59
|
+
export const arbitrumOne = arbitrum;
|
|
60
|
+
/**
|
|
61
|
+
* Get explorer URL for Arbitrum chains
|
|
62
|
+
*/
|
|
63
|
+
export function getArbitrumExplorerUrl(chainId, type, hash) {
|
|
64
|
+
const chain = chainId === 421614 ? arbitrumSepolia : arbitrum;
|
|
65
|
+
const baseUrl = chain.blockExplorers?.[0]?.url;
|
|
66
|
+
if (!baseUrl)
|
|
67
|
+
return '';
|
|
68
|
+
switch (type) {
|
|
69
|
+
case 'tx':
|
|
70
|
+
return `${baseUrl}/tx/${hash}`;
|
|
71
|
+
case 'address':
|
|
72
|
+
return `${baseUrl}/address/${hash}`;
|
|
73
|
+
case 'block':
|
|
74
|
+
return `${baseUrl}/block/${hash}`;
|
|
75
|
+
default:
|
|
76
|
+
return baseUrl;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Wagmi-compatible configuration for Arbitrum Sepolia
|
|
81
|
+
*/
|
|
82
|
+
export const arbitrumSepoliaWagmi = {
|
|
83
|
+
id: 421614,
|
|
84
|
+
name: 'Arbitrum Sepolia',
|
|
85
|
+
network: 'arbitrum-sepolia',
|
|
86
|
+
nativeCurrency: {
|
|
87
|
+
name: 'Ether',
|
|
88
|
+
symbol: 'ETH',
|
|
89
|
+
decimals: 18,
|
|
90
|
+
},
|
|
91
|
+
rpcUrls: {
|
|
92
|
+
default: {
|
|
93
|
+
http: ['https://sepolia-rollup.arbitrum.io/rpc'],
|
|
94
|
+
},
|
|
95
|
+
public: {
|
|
96
|
+
http: ['https://sepolia-rollup.arbitrum.io/rpc'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
blockExplorers: {
|
|
100
|
+
default: {
|
|
101
|
+
name: 'Arbiscan',
|
|
102
|
+
url: 'https://sepolia.arbiscan.io',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
testnet: true,
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Wagmi-compatible configuration for Arbitrum One
|
|
109
|
+
*/
|
|
110
|
+
export const arbitrumOneWagmi = {
|
|
111
|
+
id: 42161,
|
|
112
|
+
name: 'Arbitrum One',
|
|
113
|
+
network: 'arbitrum',
|
|
114
|
+
nativeCurrency: {
|
|
115
|
+
name: 'Ether',
|
|
116
|
+
symbol: 'ETH',
|
|
117
|
+
decimals: 18,
|
|
118
|
+
},
|
|
119
|
+
rpcUrls: {
|
|
120
|
+
default: {
|
|
121
|
+
http: ['https://arb1.arbitrum.io/rpc'],
|
|
122
|
+
},
|
|
123
|
+
public: {
|
|
124
|
+
http: ['https://arb1.arbitrum.io/rpc'],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
blockExplorers: {
|
|
128
|
+
default: {
|
|
129
|
+
name: 'Arbiscan',
|
|
130
|
+
url: 'https://arbiscan.io',
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
testnet: false,
|
|
134
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Chain Configuration
|
|
3
|
+
*
|
|
4
|
+
* Base is a secure, low-cost, builder-friendly Ethereum L2 built on the OP Stack
|
|
5
|
+
* Built by Coinbase, designed to onboard 1 billion users to crypto
|
|
6
|
+
* Supports both testnet (Sepolia) and mainnet
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Base Sepolia Testnet Configuration
|
|
10
|
+
* Chain ID: 84532
|
|
11
|
+
* Native Token: ETH (18 decimals)
|
|
12
|
+
*/
|
|
13
|
+
export declare const baseSepolia: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
14
|
+
rpc: string;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Base Mainnet Configuration
|
|
18
|
+
* Chain ID: 8453
|
|
19
|
+
* Native Token: ETH (18 decimals)
|
|
20
|
+
*/
|
|
21
|
+
export declare const base: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
22
|
+
rpc: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Get explorer URL for Base chains
|
|
26
|
+
*/
|
|
27
|
+
export declare function getBaseExplorerUrl(chainId: number, type: 'tx' | 'address' | 'block', hash: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Wagmi-compatible configuration for Base Sepolia
|
|
30
|
+
*/
|
|
31
|
+
export declare const baseSepoliaWagmi: {
|
|
32
|
+
readonly id: 84532;
|
|
33
|
+
readonly name: "Base Sepolia";
|
|
34
|
+
readonly network: "base-sepolia";
|
|
35
|
+
readonly nativeCurrency: {
|
|
36
|
+
readonly name: "Ether";
|
|
37
|
+
readonly symbol: "ETH";
|
|
38
|
+
readonly decimals: 18;
|
|
39
|
+
};
|
|
40
|
+
readonly rpcUrls: {
|
|
41
|
+
readonly default: {
|
|
42
|
+
readonly http: readonly ["https://sepolia.base.org"];
|
|
43
|
+
};
|
|
44
|
+
readonly public: {
|
|
45
|
+
readonly http: readonly ["https://sepolia.base.org"];
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly blockExplorers: {
|
|
49
|
+
readonly default: {
|
|
50
|
+
readonly name: "Basescan";
|
|
51
|
+
readonly url: "https://sepolia.basescan.org";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
readonly testnet: true;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Wagmi-compatible configuration for Base mainnet
|
|
58
|
+
*/
|
|
59
|
+
export declare const baseWagmi: {
|
|
60
|
+
readonly id: 8453;
|
|
61
|
+
readonly name: "Base";
|
|
62
|
+
readonly network: "base";
|
|
63
|
+
readonly nativeCurrency: {
|
|
64
|
+
readonly name: "Ether";
|
|
65
|
+
readonly symbol: "ETH";
|
|
66
|
+
readonly decimals: 18;
|
|
67
|
+
};
|
|
68
|
+
readonly rpcUrls: {
|
|
69
|
+
readonly default: {
|
|
70
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
71
|
+
};
|
|
72
|
+
readonly public: {
|
|
73
|
+
readonly http: readonly ["https://mainnet.base.org"];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly blockExplorers: {
|
|
77
|
+
readonly default: {
|
|
78
|
+
readonly name: "Basescan";
|
|
79
|
+
readonly url: "https://basescan.org";
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
readonly testnet: false;
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/chains/base.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,eAAO,MAAM,WAAW;;EAgBtB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,IAAI;;EAoBf,CAAC;AAEH;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,EAChC,IAAI,EAAE,MAAM,GACX,MAAM,CAeR;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAwBnB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;CAwBZ,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Chain Configuration
|
|
3
|
+
*
|
|
4
|
+
* Base is a secure, low-cost, builder-friendly Ethereum L2 built on the OP Stack
|
|
5
|
+
* Built by Coinbase, designed to onboard 1 billion users to crypto
|
|
6
|
+
* Supports both testnet (Sepolia) and mainnet
|
|
7
|
+
*/
|
|
8
|
+
import { defineChain } from 'thirdweb/chains';
|
|
9
|
+
/**
|
|
10
|
+
* Base Sepolia Testnet Configuration
|
|
11
|
+
* Chain ID: 84532
|
|
12
|
+
* Native Token: ETH (18 decimals)
|
|
13
|
+
*/
|
|
14
|
+
export const baseSepolia = defineChain({
|
|
15
|
+
id: 84532,
|
|
16
|
+
name: 'Base Sepolia',
|
|
17
|
+
nativeCurrency: {
|
|
18
|
+
name: 'Ether',
|
|
19
|
+
symbol: 'ETH',
|
|
20
|
+
decimals: 18,
|
|
21
|
+
},
|
|
22
|
+
rpc: 'https://sepolia.base.org',
|
|
23
|
+
blockExplorers: [
|
|
24
|
+
{
|
|
25
|
+
name: 'Basescan',
|
|
26
|
+
url: 'https://sepolia.basescan.org',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
testnet: true,
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Base Mainnet Configuration
|
|
33
|
+
* Chain ID: 8453
|
|
34
|
+
* Native Token: ETH (18 decimals)
|
|
35
|
+
*/
|
|
36
|
+
export const base = defineChain({
|
|
37
|
+
id: 8453,
|
|
38
|
+
name: 'Base',
|
|
39
|
+
nativeCurrency: {
|
|
40
|
+
name: 'Ether',
|
|
41
|
+
symbol: 'ETH',
|
|
42
|
+
decimals: 18,
|
|
43
|
+
},
|
|
44
|
+
rpcUrls: {
|
|
45
|
+
default: {
|
|
46
|
+
http: ['https://mainnet.base.org'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
blockExplorers: {
|
|
50
|
+
default: {
|
|
51
|
+
name: 'Basescan',
|
|
52
|
+
url: 'https://basescan.org',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
testnet: false,
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Get explorer URL for Base chains
|
|
59
|
+
*/
|
|
60
|
+
export function getBaseExplorerUrl(chainId, type, hash) {
|
|
61
|
+
const chain = chainId === 84532 ? baseSepolia : base;
|
|
62
|
+
const baseUrl = chain.blockExplorers?.[0]?.url;
|
|
63
|
+
if (!baseUrl)
|
|
64
|
+
return '';
|
|
65
|
+
switch (type) {
|
|
66
|
+
case 'tx':
|
|
67
|
+
return `${baseUrl}/tx/${hash}`;
|
|
68
|
+
case 'address':
|
|
69
|
+
return `${baseUrl}/address/${hash}`;
|
|
70
|
+
case 'block':
|
|
71
|
+
return `${baseUrl}/block/${hash}`;
|
|
72
|
+
default:
|
|
73
|
+
return baseUrl;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Wagmi-compatible configuration for Base Sepolia
|
|
78
|
+
*/
|
|
79
|
+
export const baseSepoliaWagmi = {
|
|
80
|
+
id: 84532,
|
|
81
|
+
name: 'Base Sepolia',
|
|
82
|
+
network: 'base-sepolia',
|
|
83
|
+
nativeCurrency: {
|
|
84
|
+
name: 'Ether',
|
|
85
|
+
symbol: 'ETH',
|
|
86
|
+
decimals: 18,
|
|
87
|
+
},
|
|
88
|
+
rpcUrls: {
|
|
89
|
+
default: {
|
|
90
|
+
http: ['https://sepolia.base.org'],
|
|
91
|
+
},
|
|
92
|
+
public: {
|
|
93
|
+
http: ['https://sepolia.base.org'],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
blockExplorers: {
|
|
97
|
+
default: {
|
|
98
|
+
name: 'Basescan',
|
|
99
|
+
url: 'https://sepolia.basescan.org',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
testnet: true,
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Wagmi-compatible configuration for Base mainnet
|
|
106
|
+
*/
|
|
107
|
+
export const baseWagmi = {
|
|
108
|
+
id: 8453,
|
|
109
|
+
name: 'Base',
|
|
110
|
+
network: 'base',
|
|
111
|
+
nativeCurrency: {
|
|
112
|
+
name: 'Ether',
|
|
113
|
+
symbol: 'ETH',
|
|
114
|
+
decimals: 18,
|
|
115
|
+
},
|
|
116
|
+
rpcUrls: {
|
|
117
|
+
default: {
|
|
118
|
+
http: ['https://mainnet.base.org'],
|
|
119
|
+
},
|
|
120
|
+
public: {
|
|
121
|
+
http: ['https://mainnet.base.org'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
blockExplorers: {
|
|
125
|
+
default: {
|
|
126
|
+
name: 'Basescan',
|
|
127
|
+
url: 'https://basescan.org',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
testnet: false,
|
|
131
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK - Chains Module
|
|
3
|
+
*
|
|
4
|
+
* Multi-chain configuration system supporting Varity L3, Arbitrum, Base, and more
|
|
5
|
+
*/
|
|
6
|
+
export { ChainRegistry, SUPPORTED_CHAINS, TESTNET_CHAINS, MAINNET_CHAINS, DEFAULT_CHAIN, type ChainSelection, type ChainMetadata, } from './registry';
|
|
7
|
+
export { varityL3, varityL3Testnet, varityL3Wagmi, USDC_DECIMALS, VARITY_USDC_ADDRESS, formatUSDC, parseUSDC, formatAddress, getExplorerUrl as getVarityExplorerUrl, } from './varityL3';
|
|
8
|
+
export { arbitrum, arbitrumOne, arbitrumSepolia, arbitrumOneWagmi, arbitrumSepoliaWagmi, getArbitrumExplorerUrl, } from './arbitrum';
|
|
9
|
+
export { base, baseSepolia, baseWagmi, baseSepoliaWagmi, getBaseExplorerUrl, } from './base';
|
|
10
|
+
/**
|
|
11
|
+
* Quick access to common chains
|
|
12
|
+
*/
|
|
13
|
+
export declare const chains: {
|
|
14
|
+
varityL3Testnet: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
15
|
+
rpc: string;
|
|
16
|
+
}>;
|
|
17
|
+
varityL3: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
18
|
+
rpc: string;
|
|
19
|
+
}>;
|
|
20
|
+
arbitrumSepolia: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
21
|
+
rpc: string;
|
|
22
|
+
}>;
|
|
23
|
+
arbitrum: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
24
|
+
rpc: string;
|
|
25
|
+
}>;
|
|
26
|
+
arbitrumOne: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
27
|
+
rpc: string;
|
|
28
|
+
}>;
|
|
29
|
+
baseSepolia: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
30
|
+
rpc: string;
|
|
31
|
+
}>;
|
|
32
|
+
base: Readonly<import("thirdweb/chains").ChainOptions & {
|
|
33
|
+
rpc: string;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chains/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,aAAa,EACb,cAAc,IAAI,oBAAoB,GACvC,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,IAAI,EACJ,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAOhB;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;CAalB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Varity SDK - Chains Module
|
|
3
|
+
*
|
|
4
|
+
* Multi-chain configuration system supporting Varity L3, Arbitrum, Base, and more
|
|
5
|
+
*/
|
|
6
|
+
// Chain Registry
|
|
7
|
+
export { ChainRegistry, SUPPORTED_CHAINS, TESTNET_CHAINS, MAINNET_CHAINS, DEFAULT_CHAIN, } from './registry';
|
|
8
|
+
// Varity L3
|
|
9
|
+
export { varityL3, varityL3Testnet, varityL3Wagmi, USDC_DECIMALS, VARITY_USDC_ADDRESS, formatUSDC, parseUSDC, formatAddress, getExplorerUrl as getVarityExplorerUrl, } from './varityL3';
|
|
10
|
+
// Arbitrum
|
|
11
|
+
export { arbitrum, arbitrumOne, arbitrumSepolia, arbitrumOneWagmi, arbitrumSepoliaWagmi, getArbitrumExplorerUrl, } from './arbitrum';
|
|
12
|
+
// Base
|
|
13
|
+
export { base, baseSepolia, baseWagmi, baseSepoliaWagmi, getBaseExplorerUrl, } from './base';
|
|
14
|
+
// Import for re-export
|
|
15
|
+
import { varityL3, varityL3Testnet } from './varityL3';
|
|
16
|
+
import { arbitrum, arbitrumOne, arbitrumSepolia } from './arbitrum';
|
|
17
|
+
import { base, baseSepolia } from './base';
|
|
18
|
+
/**
|
|
19
|
+
* Quick access to common chains
|
|
20
|
+
*/
|
|
21
|
+
export const chains = {
|
|
22
|
+
// Varity L3
|
|
23
|
+
varityL3Testnet,
|
|
24
|
+
varityL3,
|
|
25
|
+
// Arbitrum
|
|
26
|
+
arbitrumSepolia,
|
|
27
|
+
arbitrum,
|
|
28
|
+
arbitrumOne,
|
|
29
|
+
// Base
|
|
30
|
+
baseSepolia,
|
|
31
|
+
base,
|
|
32
|
+
};
|