@agirails/sdk 2.0.1-beta → 2.0.2
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 +190 -0
- package/README.md +116 -108
- package/bin/actp +10 -0
- package/dist/ACTPClient.d.ts +456 -33
- package/dist/ACTPClient.d.ts.map +1 -1
- package/dist/ACTPClient.js +477 -93
- package/dist/ACTPClient.js.map +1 -1
- package/dist/abi/AgentRegistry.json +782 -0
- package/dist/abi/EscrowVault.json +106 -38
- package/dist/abi/IdentityRegistry.json +316 -0
- package/dist/adapters/BaseAdapter.d.ts +231 -0
- package/dist/adapters/BaseAdapter.d.ts.map +1 -0
- package/dist/adapters/BaseAdapter.js +393 -0
- package/dist/adapters/BaseAdapter.js.map +1 -0
- package/dist/adapters/BeginnerAdapter.d.ts +152 -0
- package/dist/adapters/BeginnerAdapter.d.ts.map +1 -0
- package/dist/adapters/BeginnerAdapter.js +168 -0
- package/dist/adapters/BeginnerAdapter.js.map +1 -0
- package/dist/adapters/IntermediateAdapter.d.ts +211 -0
- package/dist/adapters/IntermediateAdapter.d.ts.map +1 -0
- package/dist/adapters/IntermediateAdapter.js +260 -0
- package/dist/adapters/IntermediateAdapter.js.map +1 -0
- package/dist/adapters/index.d.ts +15 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +26 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/builders/DeliveryProofBuilder.d.ts +60 -1
- package/dist/builders/DeliveryProofBuilder.d.ts.map +1 -1
- package/dist/builders/DeliveryProofBuilder.js +81 -5
- package/dist/builders/DeliveryProofBuilder.js.map +1 -1
- package/dist/builders/QuoteBuilder.d.ts +101 -0
- package/dist/builders/QuoteBuilder.d.ts.map +1 -1
- package/dist/builders/QuoteBuilder.js +120 -3
- package/dist/builders/QuoteBuilder.js.map +1 -1
- package/dist/builders/index.d.ts +4 -0
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +4 -0
- package/dist/builders/index.js.map +1 -1
- package/dist/cli/commands/balance.d.ts +13 -0
- package/dist/cli/commands/balance.d.ts.map +1 -0
- package/dist/cli/commands/balance.js +89 -0
- package/dist/cli/commands/balance.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +24 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +424 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/config.d.ts +13 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +192 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/init.d.ts +19 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +143 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/mint.d.ts +13 -0
- package/dist/cli/commands/mint.d.ts.map +1 -0
- package/dist/cli/commands/mint.js +91 -0
- package/dist/cli/commands/mint.js.map +1 -0
- package/dist/cli/commands/pay.d.ts +18 -0
- package/dist/cli/commands/pay.d.ts.map +1 -0
- package/dist/cli/commands/pay.js +87 -0
- package/dist/cli/commands/pay.js.map +1 -0
- package/dist/cli/commands/simulate.d.ts +32 -0
- package/dist/cli/commands/simulate.d.ts.map +1 -0
- package/dist/cli/commands/simulate.js +290 -0
- package/dist/cli/commands/simulate.js.map +1 -0
- package/dist/cli/commands/time.d.ts +29 -0
- package/dist/cli/commands/time.d.ts.map +1 -0
- package/dist/cli/commands/time.js +252 -0
- package/dist/cli/commands/time.js.map +1 -0
- package/dist/cli/commands/tx.d.ts +16 -0
- package/dist/cli/commands/tx.d.ts.map +1 -0
- package/dist/cli/commands/tx.js +379 -0
- package/dist/cli/commands/tx.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +20 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +160 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +104 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/utils/client.d.ts +70 -0
- package/dist/cli/utils/client.d.ts.map +1 -0
- package/dist/cli/utils/client.js +240 -0
- package/dist/cli/utils/client.js.map +1 -0
- package/dist/cli/utils/config.d.ts +91 -0
- package/dist/cli/utils/config.d.ts.map +1 -0
- package/dist/cli/utils/config.js +240 -0
- package/dist/cli/utils/config.js.map +1 -0
- package/dist/cli/utils/output.d.ts +174 -0
- package/dist/cli/utils/output.d.ts.map +1 -0
- package/dist/cli/utils/output.js +380 -0
- package/dist/cli/utils/output.js.map +1 -0
- package/dist/config/networks.d.ts +28 -0
- package/dist/config/networks.d.ts.map +1 -1
- package/dist/config/networks.js +60 -12
- package/dist/config/networks.js.map +1 -1
- package/dist/errors/index.d.ts +165 -2
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +260 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/index.d.ts +61 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +141 -36
- package/dist/index.js.map +1 -1
- package/dist/level0/Provider.d.ts +106 -0
- package/dist/level0/Provider.d.ts.map +1 -0
- package/dist/level0/Provider.js +10 -0
- package/dist/level0/Provider.js.map +1 -0
- package/dist/level0/ServiceDirectory.d.ts +74 -0
- package/dist/level0/ServiceDirectory.d.ts.map +1 -0
- package/dist/level0/ServiceDirectory.js +122 -0
- package/dist/level0/ServiceDirectory.js.map +1 -0
- package/dist/level0/index.d.ts +10 -0
- package/dist/level0/index.d.ts.map +1 -0
- package/dist/level0/index.js +15 -0
- package/dist/level0/index.js.map +1 -0
- package/dist/level0/provide.d.ts +51 -0
- package/dist/level0/provide.d.ts.map +1 -0
- package/dist/level0/provide.js +113 -0
- package/dist/level0/provide.js.map +1 -0
- package/dist/level0/request.d.ts +53 -0
- package/dist/level0/request.d.ts.map +1 -0
- package/dist/level0/request.js +462 -0
- package/dist/level0/request.js.map +1 -0
- package/dist/level1/Agent.d.ts +472 -0
- package/dist/level1/Agent.d.ts.map +1 -0
- package/dist/level1/Agent.js +1091 -0
- package/dist/level1/Agent.js.map +1 -0
- package/dist/level1/index.d.ts +10 -0
- package/dist/level1/index.d.ts.map +1 -0
- package/dist/level1/index.js +30 -0
- package/dist/level1/index.js.map +1 -0
- package/dist/level1/pricing/PriceCalculator.d.ts +62 -0
- package/dist/level1/pricing/PriceCalculator.d.ts.map +1 -0
- package/dist/level1/pricing/PriceCalculator.js +237 -0
- package/dist/level1/pricing/PriceCalculator.js.map +1 -0
- package/dist/level1/pricing/PricingStrategy.d.ts +179 -0
- package/dist/level1/pricing/PricingStrategy.d.ts.map +1 -0
- package/dist/level1/pricing/PricingStrategy.js +11 -0
- package/dist/level1/pricing/PricingStrategy.js.map +1 -0
- package/dist/level1/types/Job.d.ts +166 -0
- package/dist/level1/types/Job.d.ts.map +1 -0
- package/dist/level1/types/Job.js +11 -0
- package/dist/level1/types/Job.js.map +1 -0
- package/dist/level1/types/Options.d.ts +258 -0
- package/dist/level1/types/Options.d.ts.map +1 -0
- package/dist/level1/types/Options.js +8 -0
- package/dist/level1/types/Options.js.map +1 -0
- package/dist/level1/types/index.d.ts +8 -0
- package/dist/level1/types/index.d.ts.map +1 -0
- package/dist/level1/types/index.js +8 -0
- package/dist/level1/types/index.js.map +1 -0
- package/dist/protocol/ACTPKernel.d.ts +229 -2
- package/dist/protocol/ACTPKernel.d.ts.map +1 -1
- package/dist/protocol/ACTPKernel.js +367 -33
- package/dist/protocol/ACTPKernel.js.map +1 -1
- package/dist/protocol/AgentRegistry.d.ts +177 -0
- package/dist/protocol/AgentRegistry.d.ts.map +1 -0
- package/dist/protocol/AgentRegistry.js +449 -0
- package/dist/protocol/AgentRegistry.js.map +1 -0
- package/dist/protocol/DIDManager.d.ts +289 -0
- package/dist/protocol/DIDManager.d.ts.map +1 -0
- package/dist/protocol/DIDManager.js +481 -0
- package/dist/protocol/DIDManager.js.map +1 -0
- package/dist/protocol/DIDResolver.d.ts +236 -0
- package/dist/protocol/DIDResolver.d.ts.map +1 -0
- package/dist/protocol/DIDResolver.js +495 -0
- package/dist/protocol/DIDResolver.js.map +1 -0
- package/dist/protocol/EASHelper.d.ts +57 -2
- package/dist/protocol/EASHelper.d.ts.map +1 -1
- package/dist/protocol/EASHelper.js +230 -37
- package/dist/protocol/EASHelper.js.map +1 -1
- package/dist/protocol/EscrowVault.d.ts +93 -2
- package/dist/protocol/EscrowVault.d.ts.map +1 -1
- package/dist/protocol/EscrowVault.js +122 -33
- package/dist/protocol/EscrowVault.js.map +1 -1
- package/dist/protocol/EventMonitor.d.ts +45 -1
- package/dist/protocol/EventMonitor.d.ts.map +1 -1
- package/dist/protocol/EventMonitor.js +64 -8
- package/dist/protocol/EventMonitor.js.map +1 -1
- package/dist/protocol/MessageSigner.d.ts +116 -2
- package/dist/protocol/MessageSigner.d.ts.map +1 -1
- package/dist/protocol/MessageSigner.js +215 -9
- package/dist/protocol/MessageSigner.js.map +1 -1
- package/dist/protocol/ProofGenerator.d.ts +93 -0
- package/dist/protocol/ProofGenerator.d.ts.map +1 -1
- package/dist/protocol/ProofGenerator.js +194 -9
- package/dist/protocol/ProofGenerator.js.map +1 -1
- package/dist/protocol/QuoteBuilder.d.ts +8 -0
- package/dist/protocol/QuoteBuilder.d.ts.map +1 -1
- package/dist/protocol/QuoteBuilder.js +8 -0
- package/dist/protocol/QuoteBuilder.js.map +1 -1
- package/dist/runtime/BlockchainRuntime.d.ts +360 -0
- package/dist/runtime/BlockchainRuntime.d.ts.map +1 -0
- package/dist/runtime/BlockchainRuntime.js +767 -0
- package/dist/runtime/BlockchainRuntime.js.map +1 -0
- package/dist/runtime/IACTPRuntime.d.ts +271 -0
- package/dist/runtime/IACTPRuntime.d.ts.map +1 -0
- package/dist/runtime/IACTPRuntime.js +15 -0
- package/dist/runtime/IACTPRuntime.js.map +1 -0
- package/dist/runtime/MockRuntime.d.ts +445 -0
- package/dist/runtime/MockRuntime.d.ts.map +1 -0
- package/dist/runtime/MockRuntime.js +1065 -0
- package/dist/runtime/MockRuntime.js.map +1 -0
- package/dist/runtime/MockStateManager.d.ts +233 -0
- package/dist/runtime/MockStateManager.d.ts.map +1 -0
- package/dist/runtime/MockStateManager.js +533 -0
- package/dist/runtime/MockStateManager.js.map +1 -0
- package/dist/runtime/index.d.ts +14 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +42 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/types/MockState.d.ts +167 -0
- package/dist/runtime/types/MockState.d.ts.map +1 -0
- package/dist/runtime/types/MockState.js +43 -0
- package/dist/runtime/types/MockState.js.map +1 -0
- package/dist/types/agent.d.ts +76 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +8 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/did.d.ts +192 -0
- package/dist/types/did.d.ts.map +1 -0
- package/dist/types/did.js +38 -0
- package/dist/types/did.js.map +1 -0
- package/dist/types/eip712.d.ts +34 -0
- package/dist/types/eip712.d.ts.map +1 -1
- package/dist/types/eip712.js +31 -5
- package/dist/types/eip712.js.map +1 -1
- package/dist/types/escrow.d.ts +17 -10
- package/dist/types/escrow.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/message.d.ts +32 -0
- package/dist/types/message.d.ts.map +1 -1
- package/dist/types/message.js +4 -0
- package/dist/types/message.js.map +1 -1
- package/dist/types/state.d.ts +28 -0
- package/dist/types/state.d.ts.map +1 -1
- package/dist/types/state.js +37 -6
- package/dist/types/state.js.map +1 -1
- package/dist/types/transaction.d.ts +17 -0
- package/dist/types/transaction.d.ts.map +1 -1
- package/dist/utils/ErrorRecoveryGuide.d.ts +125 -0
- package/dist/utils/ErrorRecoveryGuide.d.ts.map +1 -0
- package/dist/utils/ErrorRecoveryGuide.js +579 -0
- package/dist/utils/ErrorRecoveryGuide.js.map +1 -0
- package/dist/utils/Helpers.d.ts +453 -0
- package/dist/utils/Helpers.d.ts.map +1 -0
- package/dist/utils/Helpers.js +623 -0
- package/dist/utils/Helpers.js.map +1 -0
- package/dist/utils/IPFSClient.d.ts +113 -0
- package/dist/utils/IPFSClient.d.ts.map +1 -1
- package/dist/utils/IPFSClient.js +128 -7
- package/dist/utils/IPFSClient.js.map +1 -1
- package/dist/utils/Logger.d.ts +195 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/Logger.js +382 -0
- package/dist/utils/Logger.js.map +1 -0
- package/dist/utils/NonceManager.d.ts +234 -1
- package/dist/utils/NonceManager.d.ts.map +1 -1
- package/dist/utils/NonceManager.js +372 -7
- package/dist/utils/NonceManager.js.map +1 -1
- package/dist/utils/RateLimiter.d.ts +253 -0
- package/dist/utils/RateLimiter.d.ts.map +1 -0
- package/dist/utils/RateLimiter.js +424 -0
- package/dist/utils/RateLimiter.js.map +1 -0
- package/dist/utils/ReceivedNonceTracker.d.ts +175 -0
- package/dist/utils/ReceivedNonceTracker.d.ts.map +1 -1
- package/dist/utils/ReceivedNonceTracker.js +261 -5
- package/dist/utils/ReceivedNonceTracker.js.map +1 -1
- package/dist/utils/SDKLifecycle.d.ts +156 -0
- package/dist/utils/SDKLifecycle.d.ts.map +1 -0
- package/dist/utils/SDKLifecycle.js +347 -0
- package/dist/utils/SDKLifecycle.js.map +1 -0
- package/dist/utils/SecureNonce.d.ts +57 -0
- package/dist/utils/SecureNonce.d.ts.map +1 -0
- package/dist/utils/SecureNonce.js +80 -0
- package/dist/utils/SecureNonce.js.map +1 -0
- package/dist/utils/Semaphore.d.ts +123 -0
- package/dist/utils/Semaphore.d.ts.map +1 -0
- package/dist/utils/Semaphore.js +247 -0
- package/dist/utils/Semaphore.js.map +1 -0
- package/dist/utils/UsedAttestationTracker.d.ts +167 -0
- package/dist/utils/UsedAttestationTracker.d.ts.map +1 -0
- package/dist/utils/UsedAttestationTracker.js +309 -0
- package/dist/utils/UsedAttestationTracker.js.map +1 -0
- package/dist/utils/canonicalJson.d.ts +22 -0
- package/dist/utils/canonicalJson.d.ts.map +1 -1
- package/dist/utils/canonicalJson.js +26 -3
- package/dist/utils/canonicalJson.js.map +1 -1
- package/dist/utils/computeTypeHash.d.ts +14 -0
- package/dist/utils/computeTypeHash.d.ts.map +1 -1
- package/dist/utils/computeTypeHash.js +19 -2
- package/dist/utils/computeTypeHash.js.map +1 -1
- package/dist/utils/fsSafe.d.ts +14 -0
- package/dist/utils/fsSafe.d.ts.map +1 -0
- package/dist/utils/fsSafe.js +89 -0
- package/dist/utils/fsSafe.js.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +51 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/security.d.ts +147 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +391 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/validation.d.ts +40 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +184 -7
- package/dist/utils/validation.js.map +1 -1
- package/package.json +54 -37
- package/src/ACTPClient.ts +692 -178
- package/src/abi/AgentRegistry.json +782 -0
- package/src/abi/EscrowVault.json +106 -38
- package/src/abi/IdentityRegistry.json +316 -0
- package/src/adapters/BaseAdapter.ts +473 -0
- package/src/adapters/BeginnerAdapter.ts +232 -0
- package/src/adapters/IntermediateAdapter.ts +316 -0
- package/src/adapters/index.ts +25 -0
- package/src/builders/DeliveryProofBuilder.ts +3 -2
- package/src/cli/commands/balance.ts +110 -0
- package/src/cli/commands/batch.ts +487 -0
- package/src/cli/commands/config.ts +231 -0
- package/src/cli/commands/init.ts +161 -0
- package/src/cli/commands/mint.ts +116 -0
- package/src/cli/commands/pay.ts +113 -0
- package/src/cli/commands/simulate.ts +345 -0
- package/src/cli/commands/time.ts +303 -0
- package/src/cli/commands/tx.ts +448 -0
- package/src/cli/commands/watch.ts +211 -0
- package/src/cli/index.ts +116 -0
- package/src/cli/utils/client.ts +249 -0
- package/src/cli/utils/config.ts +282 -0
- package/src/cli/utils/output.ts +465 -0
- package/src/config/networks.ts +32 -9
- package/src/errors/index.ts +298 -1
- package/src/index.ts +207 -71
- package/src/level0/Provider.ts +117 -0
- package/src/level0/ServiceDirectory.ts +131 -0
- package/src/level0/index.ts +10 -0
- package/src/level0/provide.ts +131 -0
- package/src/level0/request.ts +494 -0
- package/src/level1/Agent.ts +1432 -0
- package/src/level1/index.ts +10 -0
- package/src/level1/pricing/PriceCalculator.ts +255 -0
- package/src/level1/pricing/PricingStrategy.ts +198 -0
- package/src/level1/types/Job.ts +179 -0
- package/src/level1/types/Options.ts +291 -0
- package/src/level1/types/index.ts +8 -0
- package/src/protocol/ACTPKernel.ts +175 -23
- package/src/protocol/AgentRegistry.ts +559 -0
- package/src/protocol/DIDManager.ts +629 -0
- package/src/protocol/DIDResolver.ts +554 -0
- package/src/protocol/EASHelper.ts +230 -46
- package/src/protocol/EscrowVault.ts +68 -50
- package/src/protocol/EventMonitor.ts +44 -15
- package/src/protocol/MessageSigner.ts +193 -13
- package/src/protocol/ProofGenerator.ts +223 -4
- package/src/runtime/BlockchainRuntime.ts +993 -0
- package/src/runtime/IACTPRuntime.ts +284 -0
- package/src/runtime/MockRuntime.ts +1244 -0
- package/src/runtime/MockStateManager.ts +576 -0
- package/src/runtime/index.ts +25 -0
- package/src/runtime/types/MockState.ts +227 -0
- package/src/types/agent.ts +79 -0
- package/src/types/did.ts +223 -0
- package/src/types/escrow.ts +12 -11
- package/src/types/index.ts +5 -1
- package/src/types/state.ts +12 -3
- package/src/types/transaction.ts +4 -1
- package/src/utils/ErrorRecoveryGuide.ts +675 -0
- package/src/utils/Helpers.ts +688 -0
- package/src/utils/IPFSClient.ts +122 -5
- package/src/utils/Logger.ts +484 -0
- package/src/utils/NonceManager.ts +305 -8
- package/src/utils/RateLimiter.ts +534 -0
- package/src/utils/ReceivedNonceTracker.ts +170 -0
- package/src/utils/SDKLifecycle.ts +416 -0
- package/src/utils/SecureNonce.ts +78 -0
- package/src/utils/Semaphore.ts +276 -0
- package/src/utils/UsedAttestationTracker.ts +387 -0
- package/src/utils/fsSafe.ts +75 -0
- package/src/utils/index.ts +80 -0
- package/src/utils/security.ts +418 -0
- package/src/utils/validation.ts +164 -0
- package/src/__tests__/ProofGenerator.test.ts +0 -124
- package/src/__tests__/QuoteBuilder.test.ts +0 -516
- package/src/__tests__/StateMachine.test.ts +0 -82
- package/src/__tests__/builders/DeliveryProofBuilder.test.ts +0 -581
- package/src/__tests__/integration/ACTPClient.test.ts +0 -263
- package/src/__tests__/integration.test.ts +0 -289
- package/src/__tests__/protocol/EASHelper.test.ts +0 -472
- package/src/__tests__/protocol/EventMonitor.test.ts +0 -382
- package/src/__tests__/security/ACTPKernel.security.test.ts +0 -1167
- package/src/__tests__/security/EscrowVault.security.test.ts +0 -570
- package/src/__tests__/security/MessageSigner.security.test.ts +0 -286
- package/src/__tests__/security/NonceReplay.security.test.ts +0 -501
- package/src/__tests__/security/validation.security.test.ts +0 -376
- package/src/__tests__/utils/IPFSClient.test.ts +0 -262
- package/src/__tests__/utils/NonceManager.test.ts +0 -205
- package/src/__tests__/utils/canonicalJson.test.ts +0 -153
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Output Formatting Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles multi-mode output for human and machine consumption.
|
|
5
|
+
* Supports three output modes:
|
|
6
|
+
* - human: Colorful, formatted output for terminal users
|
|
7
|
+
* - json: Machine-readable JSON for scripting
|
|
8
|
+
* - quiet: Minimal output (just the essential value)
|
|
9
|
+
*
|
|
10
|
+
* @module cli/utils/output
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// Types
|
|
15
|
+
// ============================================================================
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Output mode for CLI commands
|
|
19
|
+
*/
|
|
20
|
+
export type OutputMode = 'human' | 'json' | 'quiet';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Structured error for JSON output
|
|
24
|
+
*/
|
|
25
|
+
export interface CLIError {
|
|
26
|
+
code: string;
|
|
27
|
+
message: string;
|
|
28
|
+
details?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Transaction display format
|
|
33
|
+
*/
|
|
34
|
+
export interface TransactionDisplay {
|
|
35
|
+
txId: string;
|
|
36
|
+
state: string;
|
|
37
|
+
requester: string;
|
|
38
|
+
provider: string;
|
|
39
|
+
amount: string;
|
|
40
|
+
deadline: string;
|
|
41
|
+
escrowId?: string | null;
|
|
42
|
+
createdAt?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ============================================================================
|
|
46
|
+
// Color Support Detection
|
|
47
|
+
// ============================================================================
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Check if terminal supports colors
|
|
51
|
+
*/
|
|
52
|
+
function supportsColor(): boolean {
|
|
53
|
+
// Force no color in tests or CI when FORCE_COLOR not set
|
|
54
|
+
if (process.env.NO_COLOR !== undefined) return false;
|
|
55
|
+
if (process.env.FORCE_COLOR !== undefined) return true;
|
|
56
|
+
|
|
57
|
+
// Check if stdout is TTY
|
|
58
|
+
if (!process.stdout.isTTY) return false;
|
|
59
|
+
|
|
60
|
+
// Check TERM
|
|
61
|
+
const term = process.env.TERM || '';
|
|
62
|
+
if (term === 'dumb') return false;
|
|
63
|
+
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// ANSI Color Codes (inline, no dependencies)
|
|
69
|
+
// ============================================================================
|
|
70
|
+
|
|
71
|
+
const COLORS_ENABLED = supportsColor();
|
|
72
|
+
|
|
73
|
+
const colors = {
|
|
74
|
+
reset: COLORS_ENABLED ? '\x1b[0m' : '',
|
|
75
|
+
bold: COLORS_ENABLED ? '\x1b[1m' : '',
|
|
76
|
+
dim: COLORS_ENABLED ? '\x1b[2m' : '',
|
|
77
|
+
underline: COLORS_ENABLED ? '\x1b[4m' : '',
|
|
78
|
+
|
|
79
|
+
// Foreground
|
|
80
|
+
red: COLORS_ENABLED ? '\x1b[31m' : '',
|
|
81
|
+
green: COLORS_ENABLED ? '\x1b[32m' : '',
|
|
82
|
+
yellow: COLORS_ENABLED ? '\x1b[33m' : '',
|
|
83
|
+
blue: COLORS_ENABLED ? '\x1b[34m' : '',
|
|
84
|
+
magenta: COLORS_ENABLED ? '\x1b[35m' : '',
|
|
85
|
+
cyan: COLORS_ENABLED ? '\x1b[36m' : '',
|
|
86
|
+
white: COLORS_ENABLED ? '\x1b[37m' : '',
|
|
87
|
+
gray: COLORS_ENABLED ? '\x1b[90m' : '',
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// ============================================================================
|
|
91
|
+
// Text Formatting Helpers
|
|
92
|
+
// ============================================================================
|
|
93
|
+
|
|
94
|
+
export const fmt = {
|
|
95
|
+
bold: (s: string) => `${colors.bold}${s}${colors.reset}`,
|
|
96
|
+
dim: (s: string) => `${colors.dim}${s}${colors.reset}`,
|
|
97
|
+
underline: (s: string) => `${colors.underline}${s}${colors.reset}`,
|
|
98
|
+
|
|
99
|
+
red: (s: string) => `${colors.red}${s}${colors.reset}`,
|
|
100
|
+
green: (s: string) => `${colors.green}${s}${colors.reset}`,
|
|
101
|
+
yellow: (s: string) => `${colors.yellow}${s}${colors.reset}`,
|
|
102
|
+
blue: (s: string) => `${colors.blue}${s}${colors.reset}`,
|
|
103
|
+
magenta: (s: string) => `${colors.magenta}${s}${colors.reset}`,
|
|
104
|
+
cyan: (s: string) => `${colors.cyan}${s}${colors.reset}`,
|
|
105
|
+
white: (s: string) => `${colors.white}${s}${colors.reset}`,
|
|
106
|
+
gray: (s: string) => `${colors.gray}${s}${colors.reset}`,
|
|
107
|
+
|
|
108
|
+
// Semantic formatting
|
|
109
|
+
success: (s: string) => `${colors.green}${s}${colors.reset}`,
|
|
110
|
+
error: (s: string) => `${colors.red}${s}${colors.reset}`,
|
|
111
|
+
warning: (s: string) => `${colors.yellow}${s}${colors.reset}`,
|
|
112
|
+
info: (s: string) => `${colors.cyan}${s}${colors.reset}`,
|
|
113
|
+
label: (s: string) => `${colors.gray}${s}${colors.reset}`,
|
|
114
|
+
value: (s: string) => `${colors.white}${colors.bold}${s}${colors.reset}`,
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// ============================================================================
|
|
118
|
+
// State Formatting
|
|
119
|
+
// ============================================================================
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Format transaction state with appropriate color
|
|
123
|
+
*/
|
|
124
|
+
export function formatState(state: string): string {
|
|
125
|
+
switch (state) {
|
|
126
|
+
case 'INITIATED':
|
|
127
|
+
return fmt.yellow(state);
|
|
128
|
+
case 'QUOTED':
|
|
129
|
+
return fmt.cyan(state);
|
|
130
|
+
case 'COMMITTED':
|
|
131
|
+
return fmt.blue(state);
|
|
132
|
+
case 'IN_PROGRESS':
|
|
133
|
+
return fmt.magenta(state);
|
|
134
|
+
case 'DELIVERED':
|
|
135
|
+
return fmt.green(state);
|
|
136
|
+
case 'SETTLED':
|
|
137
|
+
return fmt.green(fmt.bold(state));
|
|
138
|
+
case 'DISPUTED':
|
|
139
|
+
return fmt.red(state);
|
|
140
|
+
case 'CANCELLED':
|
|
141
|
+
return fmt.dim(state);
|
|
142
|
+
default:
|
|
143
|
+
return state;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// Output Class
|
|
149
|
+
// ============================================================================
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Output formatter for CLI commands
|
|
153
|
+
*
|
|
154
|
+
* Provides consistent output across all commands with support for
|
|
155
|
+
* human-readable, JSON, and quiet modes.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const output = new Output('human');
|
|
160
|
+
*
|
|
161
|
+
* // Success message
|
|
162
|
+
* output.success('Transaction created!');
|
|
163
|
+
*
|
|
164
|
+
* // Key-value output
|
|
165
|
+
* output.keyValue('Transaction ID', txId);
|
|
166
|
+
*
|
|
167
|
+
* // JSON output (in json mode, prints JSON)
|
|
168
|
+
* output.result({ txId, state: 'INITIATED' });
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
export class Output {
|
|
172
|
+
public readonly mode: OutputMode;
|
|
173
|
+
|
|
174
|
+
constructor(mode: OutputMode = 'human') {
|
|
175
|
+
this.mode = mode;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ==========================================================================
|
|
179
|
+
// Basic Output Methods
|
|
180
|
+
// ==========================================================================
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Print a line (human mode only)
|
|
184
|
+
*/
|
|
185
|
+
print(message: string): void {
|
|
186
|
+
if (this.mode === 'human') {
|
|
187
|
+
console.log(message);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Print success message
|
|
193
|
+
*/
|
|
194
|
+
success(message: string): void {
|
|
195
|
+
if (this.mode === 'human') {
|
|
196
|
+
console.log(fmt.success('[+] ' + message));
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Print error message
|
|
202
|
+
*/
|
|
203
|
+
error(message: string): void {
|
|
204
|
+
if (this.mode === 'human') {
|
|
205
|
+
console.error(fmt.error('[!] ' + message));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Print warning message
|
|
211
|
+
*/
|
|
212
|
+
warning(message: string): void {
|
|
213
|
+
if (this.mode === 'human') {
|
|
214
|
+
console.warn(fmt.warning('[*] ' + message));
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Print info message
|
|
220
|
+
*/
|
|
221
|
+
info(message: string): void {
|
|
222
|
+
if (this.mode === 'human') {
|
|
223
|
+
console.log(fmt.info('[i] ' + message));
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Print a blank line (human mode only)
|
|
229
|
+
*/
|
|
230
|
+
blank(): void {
|
|
231
|
+
if (this.mode === 'human') {
|
|
232
|
+
console.log('');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// ==========================================================================
|
|
237
|
+
// Structured Output
|
|
238
|
+
// ==========================================================================
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Print a key-value pair
|
|
242
|
+
*/
|
|
243
|
+
keyValue(key: string, value: string | number | boolean): void {
|
|
244
|
+
if (this.mode === 'human') {
|
|
245
|
+
console.log(` ${fmt.label(key + ':')} ${fmt.value(String(value))}`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Print a section header
|
|
251
|
+
*/
|
|
252
|
+
section(title: string): void {
|
|
253
|
+
if (this.mode === 'human') {
|
|
254
|
+
console.log('');
|
|
255
|
+
console.log(fmt.bold(title));
|
|
256
|
+
console.log(fmt.dim('-'.repeat(40)));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Print a transaction in human-readable format
|
|
262
|
+
*/
|
|
263
|
+
transaction(tx: TransactionDisplay): void {
|
|
264
|
+
if (this.mode === 'human') {
|
|
265
|
+
console.log('');
|
|
266
|
+
console.log(fmt.bold('Transaction Details'));
|
|
267
|
+
console.log(fmt.dim('-'.repeat(40)));
|
|
268
|
+
console.log(` ${fmt.label('ID:')} ${fmt.value(tx.txId)}`);
|
|
269
|
+
console.log(` ${fmt.label('State:')} ${formatState(tx.state)}`);
|
|
270
|
+
console.log(` ${fmt.label('Requester:')} ${tx.requester}`);
|
|
271
|
+
console.log(` ${fmt.label('Provider:')} ${tx.provider}`);
|
|
272
|
+
console.log(` ${fmt.label('Amount:')} ${fmt.value(tx.amount)}`);
|
|
273
|
+
console.log(` ${fmt.label('Deadline:')} ${tx.deadline}`);
|
|
274
|
+
if (tx.escrowId) {
|
|
275
|
+
console.log(` ${fmt.label('Escrow ID:')} ${tx.escrowId}`);
|
|
276
|
+
}
|
|
277
|
+
if (tx.createdAt) {
|
|
278
|
+
console.log(` ${fmt.label('Created:')} ${tx.createdAt}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Print a table of transactions
|
|
285
|
+
*/
|
|
286
|
+
transactionTable(transactions: TransactionDisplay[]): void {
|
|
287
|
+
if (this.mode === 'human') {
|
|
288
|
+
if (transactions.length === 0) {
|
|
289
|
+
console.log(fmt.dim(' No transactions found.'));
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Header
|
|
294
|
+
console.log('');
|
|
295
|
+
console.log(
|
|
296
|
+
fmt.bold(
|
|
297
|
+
' ID (short) State Amount Provider'
|
|
298
|
+
)
|
|
299
|
+
);
|
|
300
|
+
console.log(fmt.dim(' ' + '-'.repeat(70)));
|
|
301
|
+
|
|
302
|
+
// Rows
|
|
303
|
+
for (const tx of transactions) {
|
|
304
|
+
const shortId = tx.txId.slice(0, 10) + '...';
|
|
305
|
+
const stateFormatted = formatState(tx.state).padEnd(20);
|
|
306
|
+
const amountPadded = tx.amount.padEnd(16);
|
|
307
|
+
const providerShort = tx.provider.slice(0, 10) + '...';
|
|
308
|
+
|
|
309
|
+
console.log(` ${shortId} ${stateFormatted} ${amountPadded} ${providerShort}`);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
console.log(fmt.dim(' ' + '-'.repeat(70)));
|
|
313
|
+
console.log(fmt.dim(` ${transactions.length} transaction(s)`));
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// ==========================================================================
|
|
318
|
+
// Result Output (Mode-Aware)
|
|
319
|
+
// ==========================================================================
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Output a result object
|
|
323
|
+
*
|
|
324
|
+
* - human mode: Pretty prints with colors
|
|
325
|
+
* - json mode: Outputs JSON
|
|
326
|
+
* - quiet mode: Outputs just the primary value (first key or specified)
|
|
327
|
+
*/
|
|
328
|
+
result(
|
|
329
|
+
data: Record<string, unknown>,
|
|
330
|
+
options: { quietKey?: string } = {}
|
|
331
|
+
): void {
|
|
332
|
+
switch (this.mode) {
|
|
333
|
+
case 'json':
|
|
334
|
+
console.log(JSON.stringify(data, null, 2));
|
|
335
|
+
break;
|
|
336
|
+
|
|
337
|
+
case 'quiet': {
|
|
338
|
+
const key = options.quietKey || Object.keys(data)[0];
|
|
339
|
+
const value = data[key];
|
|
340
|
+
if (value !== undefined && value !== null) {
|
|
341
|
+
console.log(String(value));
|
|
342
|
+
}
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
case 'human':
|
|
347
|
+
default:
|
|
348
|
+
for (const [key, value] of Object.entries(data)) {
|
|
349
|
+
this.keyValue(key, value as string | number | boolean);
|
|
350
|
+
}
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Output raw value (for quiet mode piping)
|
|
357
|
+
*/
|
|
358
|
+
raw(value: string): void {
|
|
359
|
+
console.log(value);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
// ==========================================================================
|
|
363
|
+
// Error Output
|
|
364
|
+
// ==========================================================================
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Output a structured error
|
|
368
|
+
*/
|
|
369
|
+
errorResult(error: CLIError): void {
|
|
370
|
+
switch (this.mode) {
|
|
371
|
+
case 'json':
|
|
372
|
+
console.error(JSON.stringify({ error }, null, 2));
|
|
373
|
+
break;
|
|
374
|
+
|
|
375
|
+
case 'quiet':
|
|
376
|
+
console.error(error.message);
|
|
377
|
+
break;
|
|
378
|
+
|
|
379
|
+
case 'human':
|
|
380
|
+
default:
|
|
381
|
+
console.error('');
|
|
382
|
+
console.error(fmt.error(`Error: ${error.message}`));
|
|
383
|
+
if (error.details) {
|
|
384
|
+
console.error(fmt.dim(JSON.stringify(error.details, null, 2)));
|
|
385
|
+
}
|
|
386
|
+
console.error(fmt.dim(`(code: ${error.code})`));
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// ==========================================================================
|
|
392
|
+
// Progress Indicators
|
|
393
|
+
// ==========================================================================
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Start a spinner (human mode only)
|
|
397
|
+
*
|
|
398
|
+
* Returns a stop function to call when done.
|
|
399
|
+
* No-op in json/quiet modes.
|
|
400
|
+
*/
|
|
401
|
+
spinner(message: string): { stop: (success?: boolean) => void } {
|
|
402
|
+
if (this.mode !== 'human') {
|
|
403
|
+
return { stop: () => {} };
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
const frames = ['|', '/', '-', '\\'];
|
|
407
|
+
let i = 0;
|
|
408
|
+
|
|
409
|
+
process.stdout.write(fmt.cyan(`[${frames[0]}] ${message}`));
|
|
410
|
+
|
|
411
|
+
const interval = setInterval(() => {
|
|
412
|
+
i = (i + 1) % frames.length;
|
|
413
|
+
process.stdout.write(`\r${fmt.cyan(`[${frames[i]}] ${message}`)}`);
|
|
414
|
+
}, 100);
|
|
415
|
+
|
|
416
|
+
return {
|
|
417
|
+
stop: (success = true) => {
|
|
418
|
+
clearInterval(interval);
|
|
419
|
+
const symbol = success ? fmt.green('[+]') : fmt.red('[!]');
|
|
420
|
+
process.stdout.write(`\r${symbol} ${message}\n`);
|
|
421
|
+
},
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// ============================================================================
|
|
427
|
+
// Global Output Instance
|
|
428
|
+
// ============================================================================
|
|
429
|
+
|
|
430
|
+
let globalOutput: Output = new Output('human');
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Set the global output mode
|
|
434
|
+
*/
|
|
435
|
+
export function setOutputMode(mode: OutputMode): void {
|
|
436
|
+
globalOutput = new Output(mode);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Get the global output instance
|
|
441
|
+
*/
|
|
442
|
+
export function getOutput(): Output {
|
|
443
|
+
return globalOutput;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
// ============================================================================
|
|
447
|
+
// Exit Codes
|
|
448
|
+
// ============================================================================
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Standard exit codes for CLI commands
|
|
452
|
+
*
|
|
453
|
+
* Following Unix conventions and extending for ACTP-specific states.
|
|
454
|
+
*/
|
|
455
|
+
export const ExitCode = {
|
|
456
|
+
SUCCESS: 0,
|
|
457
|
+
ERROR: 1,
|
|
458
|
+
PENDING: 2, // Transaction in pending state
|
|
459
|
+
INVALID_INPUT: 3,
|
|
460
|
+
NOT_INITIALIZED: 4,
|
|
461
|
+
NETWORK_ERROR: 5,
|
|
462
|
+
TIMEOUT: 6,
|
|
463
|
+
} as const;
|
|
464
|
+
|
|
465
|
+
export type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode];
|
package/src/config/networks.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { ethers } from 'ethers';
|
|
2
2
|
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// SECURITY FIX (C-7): RPC URL Configuration
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Environment variables take priority over hardcoded defaults.
|
|
7
|
+
// This prevents accidental API key leakage if developers modify this file.
|
|
8
|
+
// Public RPC endpoints are used as fallbacks for ease of use.
|
|
9
|
+
//
|
|
10
|
+
// Set these environment variables to use your own RPC provider:
|
|
11
|
+
// BASE_SEPOLIA_RPC - Custom RPC for Base Sepolia testnet
|
|
12
|
+
// BASE_MAINNET_RPC - Custom RPC for Base Mainnet
|
|
13
|
+
// ============================================================================
|
|
14
|
+
|
|
15
|
+
const BASE_SEPOLIA_RPC_URL = process.env.BASE_SEPOLIA_RPC || 'https://sepolia.base.org';
|
|
16
|
+
const BASE_MAINNET_RPC_URL = process.env.BASE_MAINNET_RPC || 'https://mainnet.base.org';
|
|
17
|
+
|
|
3
18
|
/**
|
|
4
19
|
* Network configuration
|
|
5
20
|
*/
|
|
@@ -14,6 +29,7 @@ export interface NetworkConfig {
|
|
|
14
29
|
usdc: string;
|
|
15
30
|
eas: string; // EAS contract address
|
|
16
31
|
easSchemaRegistry: string; // EAS SchemaRegistry contract
|
|
32
|
+
agentRegistry?: string; // AIP-7 Agent Registry (optional until deployed)
|
|
17
33
|
};
|
|
18
34
|
eas: {
|
|
19
35
|
deliverySchemaUID: string; // AIP-4 delivery proof schema
|
|
@@ -30,16 +46,18 @@ export interface NetworkConfig {
|
|
|
30
46
|
export const BASE_SEPOLIA: NetworkConfig = {
|
|
31
47
|
name: 'Base Sepolia',
|
|
32
48
|
chainId: 84532,
|
|
33
|
-
rpcUrl:
|
|
49
|
+
rpcUrl: BASE_SEPOLIA_RPC_URL,
|
|
34
50
|
blockExplorer: 'https://sepolia.basescan.org',
|
|
35
51
|
contracts: {
|
|
36
|
-
// Redeployed 2025-
|
|
37
|
-
actpKernel: '
|
|
38
|
-
escrowVault: '
|
|
52
|
+
// Redeployed 2025-12-10 by Arha (new deployer wallet 0x42a2f11555b9363fb7ebdcdc76d7cb26e01dcb00)
|
|
53
|
+
actpKernel: '0xD199070F8e9FB9a127F6Fe730Bc13300B4b3d962',
|
|
54
|
+
escrowVault: '0x948b9Ea081C4Cec1E112Af2e539224c531d4d585',
|
|
39
55
|
usdc: '0x444b4e1A65949AB2ac75979D5d0166Eb7A248Ccb', // MockUSDC
|
|
40
56
|
// EAS contracts (Base native deployment)
|
|
41
57
|
eas: '0x4200000000000000000000000000000000000021',
|
|
42
|
-
easSchemaRegistry: '0x4200000000000000000000000000000000000020'
|
|
58
|
+
easSchemaRegistry: '0x4200000000000000000000000000000000000020',
|
|
59
|
+
// AIP-7 Agent Registry (deployed 2025-12-11)
|
|
60
|
+
agentRegistry: '0xFed6914Aa70c0a53E9c7Cc4d2Ae159e4748fb09D'
|
|
43
61
|
},
|
|
44
62
|
eas: {
|
|
45
63
|
// Deployed 2025-11-23 - AIP-4 delivery proof schema
|
|
@@ -53,14 +71,18 @@ export const BASE_SEPOLIA: NetworkConfig = {
|
|
|
53
71
|
|
|
54
72
|
/**
|
|
55
73
|
* Base Mainnet Configuration
|
|
74
|
+
*
|
|
75
|
+
* WARNING: Mainnet contracts are NOT YET DEPLOYED.
|
|
76
|
+
* Using 'base-mainnet' will throw an error until contracts are deployed.
|
|
77
|
+
* Use 'base-sepolia' for testnet development.
|
|
56
78
|
*/
|
|
57
79
|
export const BASE_MAINNET: NetworkConfig = {
|
|
58
80
|
name: 'Base Mainnet',
|
|
59
81
|
chainId: 8453,
|
|
60
|
-
rpcUrl:
|
|
82
|
+
rpcUrl: BASE_MAINNET_RPC_URL,
|
|
61
83
|
blockExplorer: 'https://basescan.org',
|
|
62
84
|
contracts: {
|
|
63
|
-
//
|
|
85
|
+
// NOT DEPLOYED: Will throw error via validateNetworkConfig()
|
|
64
86
|
actpKernel: '0x0000000000000000000000000000000000000000',
|
|
65
87
|
escrowVault: '0x0000000000000000000000000000000000000000',
|
|
66
88
|
usdc: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // Official USDC on Base
|
|
@@ -69,7 +91,7 @@ export const BASE_MAINNET: NetworkConfig = {
|
|
|
69
91
|
easSchemaRegistry: '0x4200000000000000000000000000000000000020'
|
|
70
92
|
},
|
|
71
93
|
eas: {
|
|
72
|
-
//
|
|
94
|
+
// NOT DEPLOYED: Requires mainnet schema registration
|
|
73
95
|
deliverySchemaUID: '0x0000000000000000000000000000000000000000000000000000000000000000'
|
|
74
96
|
},
|
|
75
97
|
gasSettings: {
|
|
@@ -111,7 +133,8 @@ export function getNetwork(network: string): NetworkConfig {
|
|
|
111
133
|
escrowVault: config.contracts.escrowVault,
|
|
112
134
|
usdc: config.contracts.usdc,
|
|
113
135
|
eas: config.contracts.eas,
|
|
114
|
-
easSchemaRegistry: config.contracts.easSchemaRegistry
|
|
136
|
+
easSchemaRegistry: config.contracts.easSchemaRegistry,
|
|
137
|
+
agentRegistry: config.contracts.agentRegistry
|
|
115
138
|
},
|
|
116
139
|
eas: {
|
|
117
140
|
deliverySchemaUID: config.eas.deliverySchemaUID
|