uvd-x402-sdk 2.32.2 → 2.34.0
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/dist/backend/index.d.mts +39 -7
- package/dist/backend/index.d.ts +39 -7
- package/dist/backend/index.js +51 -5
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/index.mjs +51 -5
- package/dist/backend/index.mjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/backend/index.ts +77 -9
package/dist/backend/index.d.mts
CHANGED
|
@@ -1249,7 +1249,7 @@ declare const ERC8004_EXTENSION_ID = "8004-reputation";
|
|
|
1249
1249
|
*/
|
|
1250
1250
|
type AgentId = number | string;
|
|
1251
1251
|
/**
|
|
1252
|
-
* ERC-8004 contract addresses per network (
|
|
1252
|
+
* ERC-8004 contract addresses per network (20 networks: 18 EVM + 2 Solana)
|
|
1253
1253
|
*/
|
|
1254
1254
|
declare const ERC8004_CONTRACTS: Record<string, {
|
|
1255
1255
|
identityRegistry?: string;
|
|
@@ -1259,9 +1259,9 @@ declare const ERC8004_CONTRACTS: Record<string, {
|
|
|
1259
1259
|
atomEngineProgram?: string;
|
|
1260
1260
|
}>;
|
|
1261
1261
|
/**
|
|
1262
|
-
* Network type for ERC-8004 operations (
|
|
1262
|
+
* Network type for ERC-8004 operations (20 networks: 18 EVM + 2 Solana)
|
|
1263
1263
|
*/
|
|
1264
|
-
type Erc8004Network = 'ethereum' | 'base-mainnet' | 'polygon' | 'arbitrum' | 'optimism' | 'celo' | 'bsc' | 'monad' | 'avalanche' | 'ethereum-sepolia' | 'base-sepolia' | 'polygon-amoy' | 'arbitrum-sepolia' | 'optimism-sepolia' | 'celo-sepolia' | 'avalanche-fuji' | 'solana' | 'solana-devnet';
|
|
1264
|
+
type Erc8004Network = 'ethereum' | 'base-mainnet' | 'polygon' | 'arbitrum' | 'optimism' | 'celo' | 'bsc' | 'monad' | 'avalanche' | 'skale-base' | 'ethereum-sepolia' | 'base-sepolia' | 'polygon-amoy' | 'arbitrum-sepolia' | 'optimism-sepolia' | 'celo-sepolia' | 'avalanche-fuji' | 'skale-base-sepolia' | 'solana' | 'solana-devnet';
|
|
1265
1265
|
/**
|
|
1266
1266
|
* Proof of payment returned when settling with ERC-8004 extension
|
|
1267
1267
|
*/
|
|
@@ -1480,6 +1480,21 @@ interface RegisterAgentResponse {
|
|
|
1480
1480
|
/** Network where agent was registered */
|
|
1481
1481
|
network: string;
|
|
1482
1482
|
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Response from GET /identity/{network}/owner/{address}
|
|
1485
|
+
*/
|
|
1486
|
+
interface IdentityByOwnerResponse {
|
|
1487
|
+
/** First (lowest) token ID owned by this address */
|
|
1488
|
+
agentId: AgentId;
|
|
1489
|
+
/** The queried address (checksummed) */
|
|
1490
|
+
owner: string;
|
|
1491
|
+
/** Agent's registration URI (may be empty) */
|
|
1492
|
+
agentUri: string;
|
|
1493
|
+
/** Network name */
|
|
1494
|
+
network: string;
|
|
1495
|
+
/** Total number of agent NFTs owned (as string) */
|
|
1496
|
+
balance: string;
|
|
1497
|
+
}
|
|
1483
1498
|
/**
|
|
1484
1499
|
* Response from GET /identity/{network}/{agent_id}/metadata/{key}
|
|
1485
1500
|
*/
|
|
@@ -1562,6 +1577,22 @@ declare class Erc8004Client {
|
|
|
1562
1577
|
* @returns Agent identity information
|
|
1563
1578
|
*/
|
|
1564
1579
|
getIdentity(network: Erc8004Network, agentId: AgentId): Promise<AgentIdentity>;
|
|
1580
|
+
/**
|
|
1581
|
+
* Get agent identity by owner address
|
|
1582
|
+
*
|
|
1583
|
+
* Resolves the first ERC-8004 agent ID owned by a wallet address on a given network.
|
|
1584
|
+
*
|
|
1585
|
+
* @param network - Network to query
|
|
1586
|
+
* @param address - Owner wallet address
|
|
1587
|
+
* @returns Agent identity information including balance
|
|
1588
|
+
*
|
|
1589
|
+
* @example
|
|
1590
|
+
* ```ts
|
|
1591
|
+
* const identity = await client.getIdentityByOwner('base-mainnet', '0x52E0...');
|
|
1592
|
+
* console.log(`Agent #${identity.agentId}, balance: ${identity.balance}`);
|
|
1593
|
+
* ```
|
|
1594
|
+
*/
|
|
1595
|
+
getIdentityByOwner(network: Erc8004Network, address: string): Promise<IdentityByOwnerResponse>;
|
|
1565
1596
|
/**
|
|
1566
1597
|
* Resolve agent registration file from agentURI
|
|
1567
1598
|
*
|
|
@@ -1683,10 +1714,11 @@ declare class Erc8004Client {
|
|
|
1683
1714
|
sealHash?: string;
|
|
1684
1715
|
}): Promise<FeedbackResponse>;
|
|
1685
1716
|
/**
|
|
1686
|
-
* Register
|
|
1717
|
+
* Register an agent on the Identity Registry (idempotent)
|
|
1687
1718
|
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1719
|
+
* If the recipient already owns an agent on the target network, returns the
|
|
1720
|
+
* existing one instead of minting a duplicate. The facilitator pays gas fees.
|
|
1721
|
+
* Optionally transfer the NFT to a recipient address (gasless delegation).
|
|
1690
1722
|
*
|
|
1691
1723
|
* @param request - Registration request
|
|
1692
1724
|
* @returns Registration response with agent ID and transaction hash
|
|
@@ -2138,4 +2170,4 @@ declare class AdvancedEscrowClient {
|
|
|
2138
2170
|
refundPostEscrow(paymentInfo: AdvancedPaymentInfo, amount?: string, tokenCollector?: string, collectorData?: string): Promise<AdvancedTransactionResult>;
|
|
2139
2171
|
}
|
|
2140
2172
|
|
|
2141
|
-
export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type HonoMiddlewareOptions, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isEscrowExpired, isEscrowSupportedOnChain, parsePaymentHeader };
|
|
2173
|
+
export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isEscrowExpired, isEscrowSupportedOnChain, parsePaymentHeader };
|
package/dist/backend/index.d.ts
CHANGED
|
@@ -1249,7 +1249,7 @@ declare const ERC8004_EXTENSION_ID = "8004-reputation";
|
|
|
1249
1249
|
*/
|
|
1250
1250
|
type AgentId = number | string;
|
|
1251
1251
|
/**
|
|
1252
|
-
* ERC-8004 contract addresses per network (
|
|
1252
|
+
* ERC-8004 contract addresses per network (20 networks: 18 EVM + 2 Solana)
|
|
1253
1253
|
*/
|
|
1254
1254
|
declare const ERC8004_CONTRACTS: Record<string, {
|
|
1255
1255
|
identityRegistry?: string;
|
|
@@ -1259,9 +1259,9 @@ declare const ERC8004_CONTRACTS: Record<string, {
|
|
|
1259
1259
|
atomEngineProgram?: string;
|
|
1260
1260
|
}>;
|
|
1261
1261
|
/**
|
|
1262
|
-
* Network type for ERC-8004 operations (
|
|
1262
|
+
* Network type for ERC-8004 operations (20 networks: 18 EVM + 2 Solana)
|
|
1263
1263
|
*/
|
|
1264
|
-
type Erc8004Network = 'ethereum' | 'base-mainnet' | 'polygon' | 'arbitrum' | 'optimism' | 'celo' | 'bsc' | 'monad' | 'avalanche' | 'ethereum-sepolia' | 'base-sepolia' | 'polygon-amoy' | 'arbitrum-sepolia' | 'optimism-sepolia' | 'celo-sepolia' | 'avalanche-fuji' | 'solana' | 'solana-devnet';
|
|
1264
|
+
type Erc8004Network = 'ethereum' | 'base-mainnet' | 'polygon' | 'arbitrum' | 'optimism' | 'celo' | 'bsc' | 'monad' | 'avalanche' | 'skale-base' | 'ethereum-sepolia' | 'base-sepolia' | 'polygon-amoy' | 'arbitrum-sepolia' | 'optimism-sepolia' | 'celo-sepolia' | 'avalanche-fuji' | 'skale-base-sepolia' | 'solana' | 'solana-devnet';
|
|
1265
1265
|
/**
|
|
1266
1266
|
* Proof of payment returned when settling with ERC-8004 extension
|
|
1267
1267
|
*/
|
|
@@ -1480,6 +1480,21 @@ interface RegisterAgentResponse {
|
|
|
1480
1480
|
/** Network where agent was registered */
|
|
1481
1481
|
network: string;
|
|
1482
1482
|
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Response from GET /identity/{network}/owner/{address}
|
|
1485
|
+
*/
|
|
1486
|
+
interface IdentityByOwnerResponse {
|
|
1487
|
+
/** First (lowest) token ID owned by this address */
|
|
1488
|
+
agentId: AgentId;
|
|
1489
|
+
/** The queried address (checksummed) */
|
|
1490
|
+
owner: string;
|
|
1491
|
+
/** Agent's registration URI (may be empty) */
|
|
1492
|
+
agentUri: string;
|
|
1493
|
+
/** Network name */
|
|
1494
|
+
network: string;
|
|
1495
|
+
/** Total number of agent NFTs owned (as string) */
|
|
1496
|
+
balance: string;
|
|
1497
|
+
}
|
|
1483
1498
|
/**
|
|
1484
1499
|
* Response from GET /identity/{network}/{agent_id}/metadata/{key}
|
|
1485
1500
|
*/
|
|
@@ -1562,6 +1577,22 @@ declare class Erc8004Client {
|
|
|
1562
1577
|
* @returns Agent identity information
|
|
1563
1578
|
*/
|
|
1564
1579
|
getIdentity(network: Erc8004Network, agentId: AgentId): Promise<AgentIdentity>;
|
|
1580
|
+
/**
|
|
1581
|
+
* Get agent identity by owner address
|
|
1582
|
+
*
|
|
1583
|
+
* Resolves the first ERC-8004 agent ID owned by a wallet address on a given network.
|
|
1584
|
+
*
|
|
1585
|
+
* @param network - Network to query
|
|
1586
|
+
* @param address - Owner wallet address
|
|
1587
|
+
* @returns Agent identity information including balance
|
|
1588
|
+
*
|
|
1589
|
+
* @example
|
|
1590
|
+
* ```ts
|
|
1591
|
+
* const identity = await client.getIdentityByOwner('base-mainnet', '0x52E0...');
|
|
1592
|
+
* console.log(`Agent #${identity.agentId}, balance: ${identity.balance}`);
|
|
1593
|
+
* ```
|
|
1594
|
+
*/
|
|
1595
|
+
getIdentityByOwner(network: Erc8004Network, address: string): Promise<IdentityByOwnerResponse>;
|
|
1565
1596
|
/**
|
|
1566
1597
|
* Resolve agent registration file from agentURI
|
|
1567
1598
|
*
|
|
@@ -1683,10 +1714,11 @@ declare class Erc8004Client {
|
|
|
1683
1714
|
sealHash?: string;
|
|
1684
1715
|
}): Promise<FeedbackResponse>;
|
|
1685
1716
|
/**
|
|
1686
|
-
* Register
|
|
1717
|
+
* Register an agent on the Identity Registry (idempotent)
|
|
1687
1718
|
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1719
|
+
* If the recipient already owns an agent on the target network, returns the
|
|
1720
|
+
* existing one instead of minting a duplicate. The facilitator pays gas fees.
|
|
1721
|
+
* Optionally transfer the NFT to a recipient address (gasless delegation).
|
|
1690
1722
|
*
|
|
1691
1723
|
* @param request - Registration request
|
|
1692
1724
|
* @returns Registration response with agent ID and transaction hash
|
|
@@ -2138,4 +2170,4 @@ declare class AdvancedEscrowClient {
|
|
|
2138
2170
|
refundPostEscrow(paymentInfo: AdvancedPaymentInfo, amount?: string, tokenCollector?: string, collectorData?: string): Promise<AdvancedTransactionResult>;
|
|
2139
2171
|
}
|
|
2140
2172
|
|
|
2141
|
-
export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type HonoMiddlewareOptions, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isEscrowExpired, isEscrowSupportedOnChain, parsePaymentHeader };
|
|
2173
|
+
export { type AdvancedAuthorizationResult, AdvancedEscrowClient, type AdvancedEscrowClientOptions, type AdvancedEscrowContracts, type AdvancedEscrowTaskTier, type AdvancedPaymentInfo, type AdvancedTransactionResult, type AgentId, type AgentIdentity, type AgentRegistration, type AgentRegistrationFile, type AgentService, BASE_MAINNET_CONTRACTS, type BazaarCategory, BazaarClient, type BazaarClientOptions, type BazaarDiscoverOptions, type BazaarDiscoverResponse, type BazaarNetwork, type BazaarRegisterOptions, type BazaarResource, type BazaarToken, type CreateEscrowOptions, DEPOSIT_LIMIT_USDC, type Dispute, type DisputeOutcome, ERC8004_CONTRACTS, ERC8004_EXTENSION_ID, ESCROW_CONTRACTS, ESCROW_TIMEOUT_MS, Erc8004Client, type Erc8004ClientOptions, type Erc8004Network, EscrowClient, type EscrowClientOptions, type EscrowPayment, type EscrowStateResponse, type EscrowStatus, FacilitatorClient, type FacilitatorClientOptions, type FeedbackEntry, type FeedbackParams, type FeedbackRequest, type FeedbackResponse, type HonoMiddlewareOptions, type IdentityByOwnerResponse, type IdentityMetadataResponse, type IdentityTotalSupplyResponse, type MetadataEntryParam, OPERATOR_ABI, OPERATOR_ABI_CREATE3, PAYMENT_INFO_TYPEHASH, type PaymentAcceptance, type PaymentMiddlewareOptions, type PaymentRequirementResolver, type PaymentRequirements, type PaymentRequirementsOptions, type ProofOfPayment, type RefundRequest, type RefundStatus, type RegisterAgentRequest, type RegisterAgentResponse, type ReputationResponse, type ReputationSummary, type RequestRefundOptions, type SettleRequest, type SettleResponse, type SettleResponseWithProof, TIER_TIMINGS, USDC_DOMAIN_NAME, type VerifiedPaymentState, type VerifyRequest, type VerifyResponse, X402_CORS_HEADERS, X402_HEADER_NAMES, ZERO_ADDRESS, buildErc8004PaymentRequirements, buildPaymentRequirements, buildSettleRequest, buildVerifyRequest, canRefundEscrow, canReleaseEscrow, create402Response, createHonoMiddleware, createPaymentMiddleware, escrowTimeRemaining, extractPaymentFromHeaders, getCorsHeaders, getEscrowContractsByChainId, getEscrowSupportedChainIds, isEscrowExpired, isEscrowSupportedOnChain, parsePaymentHeader };
|
package/dist/backend/index.js
CHANGED
|
@@ -2394,7 +2394,7 @@ var TESTNET_VALIDATION = "0x8004Cb1BF31DAf7788923b405b754f57acEB4272";
|
|
|
2394
2394
|
var SOLANA_AGENT_REGISTRY = "8oo4dC4JvBLwy5tGgiH3WwK4B9PWxL9Z4XjA2jzkQMbQ";
|
|
2395
2395
|
var SOLANA_ATOM_ENGINE = "AToMw53aiPQ8j7iHVb4fGt6nzUNxUhcPc3tbPBZuzVVb";
|
|
2396
2396
|
var ERC8004_CONTRACTS = {
|
|
2397
|
-
// Mainnets (
|
|
2397
|
+
// Mainnets (10)
|
|
2398
2398
|
ethereum: {
|
|
2399
2399
|
identityRegistry: MAINNET_IDENTITY,
|
|
2400
2400
|
reputationRegistry: MAINNET_REPUTATION
|
|
@@ -2431,7 +2431,11 @@ var ERC8004_CONTRACTS = {
|
|
|
2431
2431
|
identityRegistry: MAINNET_IDENTITY,
|
|
2432
2432
|
reputationRegistry: MAINNET_REPUTATION
|
|
2433
2433
|
},
|
|
2434
|
-
|
|
2434
|
+
"skale-base": {
|
|
2435
|
+
identityRegistry: MAINNET_IDENTITY,
|
|
2436
|
+
reputationRegistry: MAINNET_REPUTATION
|
|
2437
|
+
},
|
|
2438
|
+
// Testnets (8)
|
|
2435
2439
|
"ethereum-sepolia": {
|
|
2436
2440
|
identityRegistry: TESTNET_IDENTITY,
|
|
2437
2441
|
reputationRegistry: TESTNET_REPUTATION,
|
|
@@ -2467,6 +2471,11 @@ var ERC8004_CONTRACTS = {
|
|
|
2467
2471
|
reputationRegistry: TESTNET_REPUTATION,
|
|
2468
2472
|
validationRegistry: TESTNET_VALIDATION
|
|
2469
2473
|
},
|
|
2474
|
+
"skale-base-sepolia": {
|
|
2475
|
+
identityRegistry: TESTNET_IDENTITY,
|
|
2476
|
+
reputationRegistry: TESTNET_REPUTATION,
|
|
2477
|
+
validationRegistry: TESTNET_VALIDATION
|
|
2478
|
+
},
|
|
2470
2479
|
// Solana (2) - uses QuantuLabs 8004-solana Anchor program + ATOM Engine
|
|
2471
2480
|
solana: {
|
|
2472
2481
|
agentRegistryProgram: SOLANA_AGENT_REGISTRY,
|
|
@@ -2512,6 +2521,42 @@ var Erc8004Client = class {
|
|
|
2512
2521
|
throw error;
|
|
2513
2522
|
}
|
|
2514
2523
|
}
|
|
2524
|
+
/**
|
|
2525
|
+
* Get agent identity by owner address
|
|
2526
|
+
*
|
|
2527
|
+
* Resolves the first ERC-8004 agent ID owned by a wallet address on a given network.
|
|
2528
|
+
*
|
|
2529
|
+
* @param network - Network to query
|
|
2530
|
+
* @param address - Owner wallet address
|
|
2531
|
+
* @returns Agent identity information including balance
|
|
2532
|
+
*
|
|
2533
|
+
* @example
|
|
2534
|
+
* ```ts
|
|
2535
|
+
* const identity = await client.getIdentityByOwner('base-mainnet', '0x52E0...');
|
|
2536
|
+
* console.log(`Agent #${identity.agentId}, balance: ${identity.balance}`);
|
|
2537
|
+
* ```
|
|
2538
|
+
*/
|
|
2539
|
+
async getIdentityByOwner(network, address) {
|
|
2540
|
+
const url = `${this.baseUrl}/identity/${network}/owner/${address}`;
|
|
2541
|
+
const controller = new AbortController();
|
|
2542
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
2543
|
+
try {
|
|
2544
|
+
const response = await fetch(url, {
|
|
2545
|
+
method: "GET",
|
|
2546
|
+
headers: { "Accept": "application/json" },
|
|
2547
|
+
signal: controller.signal
|
|
2548
|
+
});
|
|
2549
|
+
clearTimeout(timeoutId);
|
|
2550
|
+
if (!response.ok) {
|
|
2551
|
+
const errorText = await response.text();
|
|
2552
|
+
throw new Error(`ERC-8004 API error: ${response.status} - ${errorText}`);
|
|
2553
|
+
}
|
|
2554
|
+
return await response.json();
|
|
2555
|
+
} catch (error) {
|
|
2556
|
+
clearTimeout(timeoutId);
|
|
2557
|
+
throw error;
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2515
2560
|
/**
|
|
2516
2561
|
* Resolve agent registration file from agentURI
|
|
2517
2562
|
*
|
|
@@ -2808,10 +2853,11 @@ var Erc8004Client = class {
|
|
|
2808
2853
|
}
|
|
2809
2854
|
}
|
|
2810
2855
|
/**
|
|
2811
|
-
* Register
|
|
2856
|
+
* Register an agent on the Identity Registry (idempotent)
|
|
2812
2857
|
*
|
|
2813
|
-
*
|
|
2814
|
-
*
|
|
2858
|
+
* If the recipient already owns an agent on the target network, returns the
|
|
2859
|
+
* existing one instead of minting a duplicate. The facilitator pays gas fees.
|
|
2860
|
+
* Optionally transfer the NFT to a recipient address (gasless delegation).
|
|
2815
2861
|
*
|
|
2816
2862
|
* @param request - Registration request
|
|
2817
2863
|
* @returns Registration response with agent ID and transaction hash
|