@veridex/sdk 1.0.0-beta.16 → 1.0.0-beta.18
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/README.md +163 -111
- package/dist/chains/aptos/index.d.mts +1 -1
- package/dist/chains/aptos/index.d.ts +1 -1
- package/dist/chains/evm/index.d.mts +3 -3
- package/dist/chains/evm/index.d.ts +3 -3
- package/dist/chains/solana/index.d.mts +1 -1
- package/dist/chains/solana/index.d.ts +1 -1
- package/dist/chains/stacks/index.d.mts +559 -0
- package/dist/chains/stacks/index.d.ts +559 -0
- package/dist/chains/stacks/index.js +1207 -0
- package/dist/chains/stacks/index.js.map +1 -0
- package/dist/chains/stacks/index.mjs +1149 -0
- package/dist/chains/stacks/index.mjs.map +1 -0
- package/dist/chains/starknet/index.d.mts +2 -2
- package/dist/chains/starknet/index.d.ts +2 -2
- package/dist/chains/sui/index.d.mts +2 -2
- package/dist/chains/sui/index.d.ts +2 -2
- package/dist/{index-eadz7SCP.d.mts → index-Dy29mvBf.d.mts} +28 -10
- package/dist/{index-ruSjoF2m.d.ts → index-eXXqodd0.d.ts} +28 -10
- package/dist/index.d.mts +165 -11
- package/dist/index.d.ts +165 -11
- package/dist/index.js +1582 -134
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1536 -134
- package/dist/index.mjs.map +1 -1
- package/dist/queries/index.js +36 -1
- package/dist/queries/index.js.map +1 -1
- package/dist/queries/index.mjs +36 -1
- package/dist/queries/index.mjs.map +1 -1
- package/dist/{types-ChIsqCiw.d.mts → types-DakHNZIP.d.mts} +7 -1
- package/dist/{types-ChIsqCiw.d.ts → types-DakHNZIP.d.ts} +7 -1
- package/dist/{types-FJL7j6gQ.d.mts → types-DvFRnIBd.d.mts} +1 -1
- package/dist/{types-FJL7j6gQ.d.ts → types-DvFRnIBd.d.ts} +1 -1
- package/dist/types.d.mts +6 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js.map +1 -1
- package/package.json +7 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { P as PasskeyManager, a as PasskeyCredential$1, W as WebAuthnSignature } from './index-
|
|
4
|
-
export { E as EVMHubClientAdapter, H as HubClient, b as PasskeyManagerConfig, S as SessionManager, d as detectRpId } from './index-
|
|
1
|
+
import { W as WalletManagerConfig, P as PasskeyCredential, U as UnifiedIdentity, C as ChainAddress, B as BridgeParams, a as ChainConfig, V as VAA, b as VeridexPayload, c as PreparedTransfer, d as PreparedBridge, e as VeridexConfig, f as ChainClient, T as TransferParams, E as ExecuteParams, D as DispatchResult, g as BridgeResult, h as TransferResult, R as ReceiveAddress, i as VaultInfo, j as VaultCreationResult, I as IdentityState, A as AuthorizedKey, k as AddBackupKeyResult, l as RemoveKeyResult } from './types-DakHNZIP.mjs';
|
|
2
|
+
export { r as ActionPayload, o as BridgeAction, q as ConfigAction, m as ConfigParams, v as CrossChainFees, p as ExecuteAction, t as TestResult, u as TransactionHistoryEntry, n as TransferAction, s as VAASignature } from './types-DakHNZIP.mjs';
|
|
3
|
+
import { P as PasskeyManager, a as PasskeyCredential$1, W as WebAuthnSignature } from './index-Dy29mvBf.mjs';
|
|
4
|
+
export { E as EVMClient, e as EVMClientConfig, c as EVMHubClientAdapter, H as HubClient, b as PasskeyManagerConfig, S as SessionManager, V as VERIDEX_RP_ID, d as detectRpId, s as supportsRelatedOrigins } from './index-Dy29mvBf.mjs';
|
|
5
5
|
import { ethers } from 'ethers';
|
|
6
6
|
import { BridgeParams as BridgeParams$1, ChainConfig as ChainConfig$1 } from './types.mjs';
|
|
7
7
|
export { AddGuardianResult, ApproveRecoveryResult, CancelRecoveryResult, ExecuteRecoveryResult, ExecutionPath, GuardianConfig, InitiateRecoveryResult, QueryProof, QuerySubmissionResult, RecoveryStatus, RegisterSessionParams, RemoveGuardianResult, RevokeSessionParams, SessionKey, SessionValidationResult, SetupGuardiansResult } from './types.mjs';
|
|
8
|
-
|
|
9
|
-
export {
|
|
8
|
+
export { SolanaClient, SolanaClientConfig } from './chains/solana/index.mjs';
|
|
9
|
+
export { AptosClient, AptosClientConfig } from './chains/aptos/index.mjs';
|
|
10
|
+
export { SuiClient, SuiClientConfig } from './chains/sui/index.mjs';
|
|
11
|
+
export { StarknetClient, StarknetClientConfig } from './chains/starknet/index.mjs';
|
|
12
|
+
export { FtPostCondition, NftPostCondition, PostConditionComparison, STACKS_ACTION_TYPES, StacksClient, StacksClientConfig, PostCondition as StacksPostCondition, StxPostCondition, buildSbtcWithdrawalPostConditions, buildExecutePostConditions as buildStacksExecutePostConditions, buildStxDepositPostConditions, buildStxWithdrawalPostConditions, getContractPrincipal as getStacksContractPrincipal, getStacksExplorerAddressUrl, getStacksExplorerTxUrl, getNetworkFromAddress as getStacksNetworkFromAddress, isContractPrincipal as isStacksContractPrincipal, isValidContractName as isValidStacksContractName, isValidStacksPrincipal, isValidStandardPrincipal as isValidStacksStandardPrincipal, parseContractPrincipal as parseStacksContractPrincipal, buildExecuteHash as stacksBuildExecuteHash, buildRegistrationHash as stacksBuildRegistrationHash, buildRevocationHash as stacksBuildRevocationHash, buildSessionRegistrationHash as stacksBuildSessionRegistrationHash, buildWithdrawalHash as stacksBuildWithdrawalHash, compressPublicKey as stacksCompressPublicKey, computeKeyHash as stacksComputeKeyHash, computeKeyHashFromCoords as stacksComputeKeyHashFromCoords, derToCompactSignature as stacksDerToCompactSignature, rsToCompactSignature as stacksRsToCompactSignature, validatePostConditions as validateStacksPostConditions } from './chains/stacks/index.mjs';
|
|
13
|
+
import { S as SessionStorage, a as SessionKey } from './types-DvFRnIBd.mjs';
|
|
14
|
+
export { A as ActionParams, b as SessionConfig, i as SessionError, h as SessionErrorCode, e as SessionEvent, f as SessionEventCallback, d as SessionManagerConfig, c as SessionSignature, g as SessionSignedAction } from './types-DvFRnIBd.mjs';
|
|
10
15
|
export { ACTION_BRIDGE, ACTION_CONFIG, ACTION_EXECUTE, ACTION_TRANSFER, ACTION_TYPES, HUB_ABI, MAINNET_CHAINS, PROTOCOL_VERSION, TESTNET_CHAINS, VAULT_ABI, VAULT_FACTORY_ABI, WORMHOLE_API, WORMHOLE_CHAIN_IDS, WORMHOLE_CHAIN_IDS_FLAT } from './constants.mjs';
|
|
11
16
|
export { base64URLDecode, base64URLEncode, computeKeyHash, encodeSignatureForSolidity, getAddressExplorerUrl, getChainByEvmId, getChainByWormholeId, getTxExplorerUrl, isEvmChain, isValidBytes32, isValidEvmAddress, isValidWormholeChainId, parseDERSignature, retryWithBackoff } from './utils.mjs';
|
|
12
17
|
export { buildChallenge, buildGaslessChallenge, createGaslessMessageHash, createMessageHash, decodeActionPayload, decodeBridgeAction, decodeExecuteAction, decodeTransferAction, encodeAptosTransferAction, encodeBridgeAction, encodeConfigAction, encodeExecuteAction, encodeSolanaTransferAction, encodeSuiTransferAction, encodeTransferAction, encodeVeridexPayload, formatAmount, generateNonce, padTo32Bytes, parseAmount, solanaAddressToBytes32, trimTo20Bytes } from './payload.mjs';
|
|
13
18
|
export { HubStateQuery, HubStateResult, PortfolioChainErrorCode, PortfolioChainResult, PortfolioQuery, PortfolioResult, QueryConfig, QueryHubStateError, QueryHubStateErrorCode, QueryHubStateNetwork, QueryHubStateOptions, QueryNetwork, QueryOperation, QueryOperationType, QueryPortfolioError, QueryPortfolioErrorCode, QueryPortfolioNetwork, QueryPortfolioOptions, QueryRequest, QueryResponse, WORMHOLE_QUERY_CHAIN_IDS, WORMHOLE_QUERY_PROXY_URLS, WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND, queryHubState, queryPortfolio } from './queries/index.mjs';
|
|
14
19
|
export { CONSISTENCY_LEVELS, FetchVAAOptions, GUARDIAN_CONFIG, WaitForSignaturesOptions, emitterToEvmAddress, encodeVAAForSolana, encodeVAAToBytes, evmAddressToBytes32, fetchVAA, fetchVAAByTxHash, fetchVAAByTxHashFallback, getSequenceFromTxReceipt, getWormholeCoreBridge, getWormholeRelayer, getWormholeTokenBridge, hasQuorum, normalizeEmitterAddress, parseVAA, parseVAABytes, parseVeridexPayload, supportsRelayer, validateEmitter, waitForGuardianSignatures } from './wormhole.mjs';
|
|
20
|
+
import '@solana/web3.js';
|
|
21
|
+
import '@aptos-labs/ts-sdk';
|
|
22
|
+
import '@mysten/sui/client';
|
|
23
|
+
import 'starknet';
|
|
15
24
|
import '@wormhole-foundation/wormhole-query-sdk';
|
|
16
25
|
|
|
17
26
|
/**
|
|
@@ -175,6 +184,7 @@ declare const BASE_SEPOLIA_TOKENS: ChainTokenList;
|
|
|
175
184
|
declare const OPTIMISM_SEPOLIA_TOKENS: ChainTokenList;
|
|
176
185
|
declare const ARBITRUM_SEPOLIA_TOKENS: ChainTokenList;
|
|
177
186
|
declare const ETHEREUM_SEPOLIA_TOKENS: ChainTokenList;
|
|
187
|
+
declare const MONAD_TESTNET_TOKENS: ChainTokenList;
|
|
178
188
|
/**
|
|
179
189
|
* All token lists indexed by Wormhole chain ID
|
|
180
190
|
*/
|
|
@@ -2107,10 +2117,12 @@ declare const CHAIN_NAMES: {
|
|
|
2107
2117
|
readonly FANTOM: "fantom";
|
|
2108
2118
|
readonly CELO: "celo";
|
|
2109
2119
|
readonly MOONBEAM: "moonbeam";
|
|
2120
|
+
readonly MONAD: "monad";
|
|
2110
2121
|
readonly SOLANA: "solana";
|
|
2111
2122
|
readonly APTOS: "aptos";
|
|
2112
2123
|
readonly SUI: "sui";
|
|
2113
2124
|
readonly STARKNET: "starknet";
|
|
2125
|
+
readonly STACKS: "stacks";
|
|
2114
2126
|
readonly NEAR: "near";
|
|
2115
2127
|
readonly SEI: "sei";
|
|
2116
2128
|
};
|
|
@@ -2120,7 +2132,7 @@ interface ChainPreset {
|
|
|
2120
2132
|
/** Human-readable chain name */
|
|
2121
2133
|
displayName: string;
|
|
2122
2134
|
/** Chain type for client selection */
|
|
2123
|
-
type: 'evm' | 'solana' | 'aptos' | 'sui' | 'starknet' | 'near' | 'cosmos';
|
|
2135
|
+
type: 'evm' | 'solana' | 'aptos' | 'sui' | 'starknet' | 'stacks' | 'near' | 'cosmos';
|
|
2124
2136
|
/** Whether this chain can be a hub */
|
|
2125
2137
|
canBeHub: boolean;
|
|
2126
2138
|
/** Testnet configuration */
|
|
@@ -2261,7 +2273,7 @@ interface SessionConfig {
|
|
|
2261
2273
|
*
|
|
2262
2274
|
* // With relayer for gasless transactions
|
|
2263
2275
|
* const gaslessSdk = await createSDK('base', {
|
|
2264
|
-
* relayerUrl: 'https://relayer.veridex.
|
|
2276
|
+
* relayerUrl: 'https://relayer.veridex.network',
|
|
2265
2277
|
* relayerApiKey: 'your-api-key',
|
|
2266
2278
|
* });
|
|
2267
2279
|
* ```
|
|
@@ -2369,10 +2381,10 @@ declare function createSessionSDK(chain?: ChainName, config?: SimpleSDKConfig):
|
|
|
2369
2381
|
* ```
|
|
2370
2382
|
*/
|
|
2371
2383
|
|
|
2372
|
-
/** The canonical Veridex RP ID for cross-origin passkeys */
|
|
2373
|
-
declare const VERIDEX_RP_ID = "veridex.network";
|
|
2374
2384
|
/** Default auth portal URL */
|
|
2375
2385
|
declare const DEFAULT_AUTH_PORTAL_URL = "https://auth.veridex.network";
|
|
2386
|
+
/** Default relayer API URL for server-side session tokens */
|
|
2387
|
+
declare const DEFAULT_RELAYER_URL = "https://amused-kameko-veridex-demo-37453117.koyeb.app/api/v1";
|
|
2376
2388
|
/** Message types for postMessage communication */
|
|
2377
2389
|
declare const AUTH_MESSAGE_TYPES: {
|
|
2378
2390
|
readonly AUTH_REQUEST: "VERIDEX_AUTH_REQUEST";
|
|
@@ -2384,6 +2396,8 @@ interface CrossOriginAuthConfig {
|
|
|
2384
2396
|
rpId?: string;
|
|
2385
2397
|
/** Auth portal URL for popup/redirect flow */
|
|
2386
2398
|
authPortalUrl?: string;
|
|
2399
|
+
/** Relayer API URL for server-side session tokens */
|
|
2400
|
+
relayerUrl?: string;
|
|
2387
2401
|
/** Authentication mode: popup or redirect */
|
|
2388
2402
|
mode?: 'popup' | 'redirect';
|
|
2389
2403
|
/** Popup window features */
|
|
@@ -2406,6 +2420,17 @@ interface CrossOriginSession {
|
|
|
2406
2420
|
signature: WebAuthnSignature;
|
|
2407
2421
|
/** The credential used */
|
|
2408
2422
|
credential: PasskeyCredential$1;
|
|
2423
|
+
/** Server-validated session token ID (from relayer) */
|
|
2424
|
+
serverSessionId?: string;
|
|
2425
|
+
}
|
|
2426
|
+
/** Server-side session token returned by the relayer */
|
|
2427
|
+
interface ServerSessionToken {
|
|
2428
|
+
id: string;
|
|
2429
|
+
keyHash: string;
|
|
2430
|
+
appOrigin: string;
|
|
2431
|
+
permissions: string[];
|
|
2432
|
+
expiresAt: number;
|
|
2433
|
+
createdAt: number;
|
|
2409
2434
|
}
|
|
2410
2435
|
interface AuthPortalMessage {
|
|
2411
2436
|
type: typeof AUTH_MESSAGE_TYPES[keyof typeof AUTH_MESSAGE_TYPES];
|
|
@@ -2483,6 +2508,35 @@ declare class CrossOriginAuth {
|
|
|
2483
2508
|
* Get the auth portal URL.
|
|
2484
2509
|
*/
|
|
2485
2510
|
getAuthPortalUrl(): string;
|
|
2511
|
+
/**
|
|
2512
|
+
* Create a server-validated session token via the relayer.
|
|
2513
|
+
* Call this after authenticating (via ROR or auth portal) to get a
|
|
2514
|
+
* server-side session that the relayer can verify on subsequent requests.
|
|
2515
|
+
*/
|
|
2516
|
+
createServerSession(session: CrossOriginSession, options?: {
|
|
2517
|
+
permissions?: string[];
|
|
2518
|
+
expiresInMs?: number;
|
|
2519
|
+
}): Promise<ServerSessionToken>;
|
|
2520
|
+
/**
|
|
2521
|
+
* Validate an existing server session token.
|
|
2522
|
+
* Returns the session details if valid, null if expired/revoked.
|
|
2523
|
+
*/
|
|
2524
|
+
validateServerSession(sessionId: string): Promise<ServerSessionToken | null>;
|
|
2525
|
+
/**
|
|
2526
|
+
* Revoke a server session token.
|
|
2527
|
+
*/
|
|
2528
|
+
revokeServerSession(sessionId: string): Promise<boolean>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Full authentication flow: authenticate + create server session.
|
|
2531
|
+
* Automatically detects ROR support and falls back to auth portal.
|
|
2532
|
+
*/
|
|
2533
|
+
authenticateAndCreateSession(options?: {
|
|
2534
|
+
permissions?: string[];
|
|
2535
|
+
expiresInMs?: number;
|
|
2536
|
+
}): Promise<{
|
|
2537
|
+
session: CrossOriginSession;
|
|
2538
|
+
serverSession: ServerSessionToken;
|
|
2539
|
+
}>;
|
|
2486
2540
|
}
|
|
2487
2541
|
/**
|
|
2488
2542
|
* Create a CrossOriginAuth instance for third-party app integration.
|
|
@@ -3309,4 +3363,104 @@ type AuthenticateAndPrepareResult = {
|
|
|
3309
3363
|
*/
|
|
3310
3364
|
declare function authenticateAndPrepare(userParams: AuthenticateAndPrepareParams, apiKey: string): Promise<AuthenticateAndPrepareResult>;
|
|
3311
3365
|
|
|
3312
|
-
|
|
3366
|
+
/**
|
|
3367
|
+
* @packageDocumentation
|
|
3368
|
+
* @module erc8004/contracts
|
|
3369
|
+
* @description
|
|
3370
|
+
* Low-level ERC-8004 contract utilities shared across SDK layers.
|
|
3371
|
+
*
|
|
3372
|
+
* Provides:
|
|
3373
|
+
* - Contract instance creation for Identity, Reputation, and Validation registries
|
|
3374
|
+
* - Address resolution by chain and network
|
|
3375
|
+
* - ABI references
|
|
3376
|
+
*
|
|
3377
|
+
* This module lives in the core SDK (`@veridex/sdk`) so that both the agent-sdk
|
|
3378
|
+
* and relayer can share the same contract interaction utilities.
|
|
3379
|
+
*
|
|
3380
|
+
* References:
|
|
3381
|
+
* - ADR-0029 §SDK Module Structure
|
|
3382
|
+
* - ERC8004_IMPLEMENTATION_PLAN.md Phase 1
|
|
3383
|
+
*/
|
|
3384
|
+
/** Identity Registry — same address on ALL EVM mainnets */
|
|
3385
|
+
declare const ERC8004_MAINNET_IDENTITY = "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432";
|
|
3386
|
+
/** Reputation Registry — same address on ALL EVM mainnets */
|
|
3387
|
+
declare const ERC8004_MAINNET_REPUTATION = "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63";
|
|
3388
|
+
/** Identity Registry — same address on ALL EVM testnets */
|
|
3389
|
+
declare const ERC8004_TESTNET_IDENTITY = "0x8004A818BFB912233c491871b3d84c89A494BD9e";
|
|
3390
|
+
/** Reputation Registry — same address on ALL EVM testnets */
|
|
3391
|
+
declare const ERC8004_TESTNET_REPUTATION = "0x8004B663056A597Dffe9eCcC1965A193B7388713";
|
|
3392
|
+
/**
|
|
3393
|
+
* Resolve canonical ERC-8004 registry addresses for a given network.
|
|
3394
|
+
*/
|
|
3395
|
+
declare function getERC8004Addresses(testnet: boolean): {
|
|
3396
|
+
identityRegistry: string;
|
|
3397
|
+
reputationRegistry: string;
|
|
3398
|
+
};
|
|
3399
|
+
/**
|
|
3400
|
+
* Check if a chain has ERC-8004 singletons deployed.
|
|
3401
|
+
*/
|
|
3402
|
+
declare function isERC8004Chain(chainName: string): boolean;
|
|
3403
|
+
/** Chains where ERC-8004 singletons are deployed */
|
|
3404
|
+
declare const ERC8004_CHAINS: {
|
|
3405
|
+
readonly mainnet: readonly ["ethereum", "base", "polygon", "arbitrum", "optimism", "linea", "megaeth", "monad"];
|
|
3406
|
+
readonly testnet: readonly ["ethereum-sepolia", "base-sepolia", "polygon-amoy", "arbitrum-sepolia", "optimism-sepolia", "monad-testnet"];
|
|
3407
|
+
};
|
|
3408
|
+
/** Minimal Identity Registry ABI for read operations */
|
|
3409
|
+
declare const IDENTITY_REGISTRY_READ_ABI: readonly ["function ownerOf(uint256 tokenId) view returns (address)", "function balanceOf(address owner) view returns (uint256)", "function totalSupply() view returns (uint256)", "function agentURI(uint256 agentId) view returns (string)", "function agentWallet(uint256 agentId) view returns (address)", "function getMetadata(uint256 agentId, string key) view returns (string)"];
|
|
3410
|
+
/** Minimal Reputation Registry ABI for read operations */
|
|
3411
|
+
declare const REPUTATION_REGISTRY_READ_ABI: readonly ["function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) view returns (uint256 count, int128 summaryValue, uint8 summaryValueDecimals)", "function readFeedback(uint256 agentId, address clientAddress, uint256 feedbackIndex) view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)", "function getClients(uint256 agentId) view returns (address[])", "function getLastIndex(uint256 agentId, address clientAddress) view returns (uint256)"];
|
|
3412
|
+
/** Full Identity Registry ABI (read + write) */
|
|
3413
|
+
declare const IDENTITY_REGISTRY_ABI: readonly ["function register(string agentURI) returns (uint256)", "function register(string agentURI, tuple(string key, string value)[] metadata) returns (uint256)", "function ownerOf(uint256 tokenId) view returns (address)", "function balanceOf(address owner) view returns (uint256)", "function totalSupply() view returns (uint256)", "function agentURI(uint256 agentId) view returns (string)", "function agentWallet(uint256 agentId) view returns (address)", "function getMetadata(uint256 agentId, string key) view returns (string)", "function setAgentURI(uint256 agentId, string newURI)", "function setAgentWallet(uint256 agentId, address wallet, uint256 deadline, bytes signature)", "function unsetAgentWallet(uint256 agentId)", "function setMetadata(uint256 agentId, string key, string value)", "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)", "event AgentURIUpdated(uint256 indexed agentId, string newURI)", "event AgentWalletSet(uint256 indexed agentId, address wallet)", "event AgentWalletUnset(uint256 indexed agentId)", "event MetadataUpdated(uint256 indexed agentId, string key, string value)"];
|
|
3414
|
+
/** Full Reputation Registry ABI (read + write) */
|
|
3415
|
+
declare const REPUTATION_REGISTRY_ABI: readonly ["function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2)", "function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2, string endpointURI, string feedbackURI, bytes32 feedbackHash)", "function revokeFeedback(uint256 agentId, uint256 feedbackIndex)", "function appendResponse(uint256 agentId, address clientAddress, uint256 feedbackIndex, string responseURI, bytes32 responseHash)", "function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) view returns (uint256 count, int128 summaryValue, uint8 summaryValueDecimals)", "function readFeedback(uint256 agentId, address clientAddress, uint256 feedbackIndex) view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)", "function getClients(uint256 agentId) view returns (address[])", "function getLastIndex(uint256 agentId, address clientAddress) view returns (uint256)", "event FeedbackGiven(uint256 indexed agentId, address indexed client, int128 value, uint8 valueDecimals)", "event FeedbackRevoked(uint256 indexed agentId, address indexed client, uint256 feedbackIndex)", "event ResponseAppended(uint256 indexed agentId, address indexed client, uint256 feedbackIndex)"];
|
|
3416
|
+
/** Validation Registry ABI (Phase 3 — spec still under active update) */
|
|
3417
|
+
declare const VALIDATION_REGISTRY_ABI: readonly ["function validationRequest(address validatorAddress, uint256 agentId, string requestURI, bytes32 requestHash) returns (bytes32)", "function getValidationStatus(bytes32 requestHash) view returns (address validatorAddress, uint256 agentId, uint8 response, bytes32 responseHash, string tag, uint256 lastUpdate)", "function getSummary(uint256 agentId, address[] validatorAddresses, string tag) view returns (uint256 count, uint256 averageResponse)", "function getAgentValidations(uint256 agentId) view returns (bytes32[])"];
|
|
3418
|
+
|
|
3419
|
+
/**
|
|
3420
|
+
* @packageDocumentation
|
|
3421
|
+
* @module erc8004/types
|
|
3422
|
+
* @description
|
|
3423
|
+
* On-chain types for ERC-8004 registries.
|
|
3424
|
+
* These are the low-level types that map directly to contract return values.
|
|
3425
|
+
*
|
|
3426
|
+
* Higher-level SDK config types live in `@veridex/agent-sdk/identity/types`.
|
|
3427
|
+
*/
|
|
3428
|
+
/** Agent registration as stored on-chain in the ERC-8004 Identity Registry */
|
|
3429
|
+
interface ERC8004AgentRegistration {
|
|
3430
|
+
agentId: bigint;
|
|
3431
|
+
owner: string;
|
|
3432
|
+
agentURI: string;
|
|
3433
|
+
agentWallet: string;
|
|
3434
|
+
}
|
|
3435
|
+
/** Key-value metadata entry */
|
|
3436
|
+
interface ERC8004MetadataEntry {
|
|
3437
|
+
key: string;
|
|
3438
|
+
value: string;
|
|
3439
|
+
}
|
|
3440
|
+
/** Individual feedback entry from the Reputation Registry */
|
|
3441
|
+
interface ERC8004FeedbackEntry {
|
|
3442
|
+
value: bigint;
|
|
3443
|
+
valueDecimals: number;
|
|
3444
|
+
tag1: string;
|
|
3445
|
+
tag2: string;
|
|
3446
|
+
isRevoked: boolean;
|
|
3447
|
+
}
|
|
3448
|
+
/** Aggregated feedback summary from the Reputation Registry */
|
|
3449
|
+
interface ERC8004FeedbackSummary {
|
|
3450
|
+
count: bigint;
|
|
3451
|
+
summaryValue: bigint;
|
|
3452
|
+
summaryValueDecimals: number;
|
|
3453
|
+
}
|
|
3454
|
+
/** Validation status from the Validation Registry */
|
|
3455
|
+
interface ERC8004ValidationStatus {
|
|
3456
|
+
validatorAddress: string;
|
|
3457
|
+
agentId: bigint;
|
|
3458
|
+
response: number;
|
|
3459
|
+
responseHash: string;
|
|
3460
|
+
tag: string;
|
|
3461
|
+
lastUpdate: bigint;
|
|
3462
|
+
}
|
|
3463
|
+
/** CAIP-2 universal agent identifier format */
|
|
3464
|
+
type UniversalAgentIdentifier = string;
|
|
3465
|
+
|
|
3466
|
+
export { ARBITRUM_SEPOLIA_TOKENS, AUTH_MESSAGE_TYPES, type ActionDetails, type ActionDisplayType, AddBackupKeyResult, type AuthPortalMessage, type AuthenticateAndPrepareParams, type AuthenticateAndPrepareResult, AuthorizedKey, BASE_SEPOLIA_TOKENS, BalanceManager, type BalanceManagerConfig, type BridgeDetails, BridgeParams, BridgeResult, CHAIN_DISPLAY_INFO, CHAIN_NAMES, CHAIN_PRESETS, CONFIG_TYPE, ChainAddress, type ChainAddressConfig, ChainClient, ChainConfig, type ChainDeploymentConfig, ChainDetector, type ChainDetectorConfig, type ChainDisplay, type ChainName, type ChainTokenList, type ConfigDetails, type CrossChainConfig, CrossChainManager, type CrossChainProgress, type CrossChainProgressCallback, type CrossChainResult, type CrossChainStatus, CrossOriginAuth, type CrossOriginAuthConfig, type CrossOriginSession, DEFAULT_AUTH_PORTAL_URL, DEFAULT_REFRESH_BUFFER, DEFAULT_RELAYER_URL, DEFAULT_SESSION_DURATION, type DailySpendingSummary, DispatchResult, type DurationDisplay, type ERC8004AgentRegistration, type ERC8004FeedbackEntry, type ERC8004FeedbackSummary, type ERC8004MetadataEntry, type ERC8004ValidationStatus, ERC8004_CHAINS, ERC8004_MAINNET_IDENTITY, ERC8004_MAINNET_REPUTATION, ERC8004_TESTNET_IDENTITY, ERC8004_TESTNET_REPUTATION, ERROR_MESSAGES, ERROR_RANGES, ETHEREUM_SEPOLIA_TOKENS, EVM_ZERO_ADDRESS, type ExecuteDetails, ExecuteParams, type FormattedSpendingLimits, GasSponsor, type GasSponsorConfig, IDENTITY_REGISTRY_ABI, IDENTITY_REGISTRY_READ_ABI, IdentityState, IndexedDBSessionStorage, type KeyPair, LIMIT_PRESETS, type LimitCheckResult, type LimitPreset, type LimitViolationSuggestion, type LimitViolationType, LocalStorageSessionStorage, MAX_SESSION_DURATION, MIN_SESSION_DURATION, MONAD_TESTNET_TOKENS, type MultiChainVaultResult, NATIVE_TOKEN_ADDRESS, type NativeBalanceCapable, type NetworkType, OPTIMISM_SEPOLIA_TOKENS, PasskeyCredential$1 as PasskeyCredential, PasskeyManager, type PortfolioBalance, PreparedBridge, PreparedTransfer, REPUTATION_REGISTRY_ABI, REPUTATION_REGISTRY_READ_ABI, ReceiveAddress, type RecipientDisplay, type RelayFeeQuote, type RelayRequest, type RelayRoute, type RelayStatus, RelayerClient, type RelayerClientConfig, type RelayerInfo, RemoveKeyResult, type RiskLevel, type RiskWarning, type RiskWarningType, type ServerSessionToken, SessionStorage, type SetDailyLimitParams, type SetTransactionLimitParams, type SimpleSDKConfig, type SessionConfig as SimpleSessionConfig, type SpendingLimitChangedEvent, type SpendingLimitConfig, type SpendingLimitEventCallback, type SpendingLimits, SpendingLimitsManager, type SpendingLimitsManagerConfig, type SpendingTransaction, type SponsoredVaultResult, type SponsorshipSource, type SubmitActionResult, type SubmitQueryRequest, type SubmitQueryResult, type SubmitSignedActionRequest, TOKEN_REGISTRY, type TokenBalance, type TokenDisplay, type TokenInfo$1 as TokenInfo, type TrackerConfig, type TransactionAuditEntry, type TransactionCallback, TransactionParser, type TransactionParserConfig, type TransactionState, type TransactionStatus, type TransactionSummary, TransactionTracker, type TransferDetails, TransferParams, TransferResult, UnifiedIdentity, type UniversalAgentIdentifier, VAA, VALIDATION_REGISTRY_ABI, VERIDEX_ERRORS, VaultCreationResult, VaultInfo, VeridexConfig, type VeridexErrorCode, VeridexPayload, VeridexSDK, WalletManager, WalletManagerConfig, WebAuthnSignature, authenticateAndPrepare, calculatePercentage, computeSessionKeyHash, createAuditEntry, createChainDetector, createCrossOriginAuth, createGasSponsor, createHubSDK, createMainnetSDK, createRelayerClient, createSDK, createSessionSDK, createSessionStorage, createSpendingLimitsManager, createTestnetSDK, createTransactionParser, crossChainManager, decrypt, VeridexSDK as default, deriveEncryptionKey, encrypt, formatDuration, formatLargeAmount, formatTransactionState, generateSecp256k1KeyPair, getAllTokens, getChainConfig, getChainDisplay, getChainName, getChainPreset, getConfigTypeName, getDefaultHub, getERC8004Addresses, getErrorCategory, getErrorMessage, getExplorerUrl, getHubChains, getSuggestedAction, getSupportedChainIds, getSupportedChains, getTokenByAddress, getTokenBySymbol, getTokenList, hashAction, isAbiError, isChainSupported, isCoreError, isERC8004Chain, isNativeToken, isQueryError, isQueryExecutionError, isQueryParsingError, isRetryableError, logTransactionSummary, parseVeridexError, sendAuthError, sendAuthResponse, signWithSessionKey, validateSessionConfig, verifySessionSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { P as PasskeyManager, a as PasskeyCredential$1, W as WebAuthnSignature } from './index-
|
|
4
|
-
export { E as EVMHubClientAdapter, H as HubClient, b as PasskeyManagerConfig, S as SessionManager, d as detectRpId } from './index-
|
|
1
|
+
import { W as WalletManagerConfig, P as PasskeyCredential, U as UnifiedIdentity, C as ChainAddress, B as BridgeParams, a as ChainConfig, V as VAA, b as VeridexPayload, c as PreparedTransfer, d as PreparedBridge, e as VeridexConfig, f as ChainClient, T as TransferParams, E as ExecuteParams, D as DispatchResult, g as BridgeResult, h as TransferResult, R as ReceiveAddress, i as VaultInfo, j as VaultCreationResult, I as IdentityState, A as AuthorizedKey, k as AddBackupKeyResult, l as RemoveKeyResult } from './types-DakHNZIP.js';
|
|
2
|
+
export { r as ActionPayload, o as BridgeAction, q as ConfigAction, m as ConfigParams, v as CrossChainFees, p as ExecuteAction, t as TestResult, u as TransactionHistoryEntry, n as TransferAction, s as VAASignature } from './types-DakHNZIP.js';
|
|
3
|
+
import { P as PasskeyManager, a as PasskeyCredential$1, W as WebAuthnSignature } from './index-eXXqodd0.js';
|
|
4
|
+
export { E as EVMClient, e as EVMClientConfig, c as EVMHubClientAdapter, H as HubClient, b as PasskeyManagerConfig, S as SessionManager, V as VERIDEX_RP_ID, d as detectRpId, s as supportsRelatedOrigins } from './index-eXXqodd0.js';
|
|
5
5
|
import { ethers } from 'ethers';
|
|
6
6
|
import { BridgeParams as BridgeParams$1, ChainConfig as ChainConfig$1 } from './types.js';
|
|
7
7
|
export { AddGuardianResult, ApproveRecoveryResult, CancelRecoveryResult, ExecuteRecoveryResult, ExecutionPath, GuardianConfig, InitiateRecoveryResult, QueryProof, QuerySubmissionResult, RecoveryStatus, RegisterSessionParams, RemoveGuardianResult, RevokeSessionParams, SessionKey, SessionValidationResult, SetupGuardiansResult } from './types.js';
|
|
8
|
-
|
|
9
|
-
export {
|
|
8
|
+
export { SolanaClient, SolanaClientConfig } from './chains/solana/index.js';
|
|
9
|
+
export { AptosClient, AptosClientConfig } from './chains/aptos/index.js';
|
|
10
|
+
export { SuiClient, SuiClientConfig } from './chains/sui/index.js';
|
|
11
|
+
export { StarknetClient, StarknetClientConfig } from './chains/starknet/index.js';
|
|
12
|
+
export { FtPostCondition, NftPostCondition, PostConditionComparison, STACKS_ACTION_TYPES, StacksClient, StacksClientConfig, PostCondition as StacksPostCondition, StxPostCondition, buildSbtcWithdrawalPostConditions, buildExecutePostConditions as buildStacksExecutePostConditions, buildStxDepositPostConditions, buildStxWithdrawalPostConditions, getContractPrincipal as getStacksContractPrincipal, getStacksExplorerAddressUrl, getStacksExplorerTxUrl, getNetworkFromAddress as getStacksNetworkFromAddress, isContractPrincipal as isStacksContractPrincipal, isValidContractName as isValidStacksContractName, isValidStacksPrincipal, isValidStandardPrincipal as isValidStacksStandardPrincipal, parseContractPrincipal as parseStacksContractPrincipal, buildExecuteHash as stacksBuildExecuteHash, buildRegistrationHash as stacksBuildRegistrationHash, buildRevocationHash as stacksBuildRevocationHash, buildSessionRegistrationHash as stacksBuildSessionRegistrationHash, buildWithdrawalHash as stacksBuildWithdrawalHash, compressPublicKey as stacksCompressPublicKey, computeKeyHash as stacksComputeKeyHash, computeKeyHashFromCoords as stacksComputeKeyHashFromCoords, derToCompactSignature as stacksDerToCompactSignature, rsToCompactSignature as stacksRsToCompactSignature, validatePostConditions as validateStacksPostConditions } from './chains/stacks/index.js';
|
|
13
|
+
import { S as SessionStorage, a as SessionKey } from './types-DvFRnIBd.js';
|
|
14
|
+
export { A as ActionParams, b as SessionConfig, i as SessionError, h as SessionErrorCode, e as SessionEvent, f as SessionEventCallback, d as SessionManagerConfig, c as SessionSignature, g as SessionSignedAction } from './types-DvFRnIBd.js';
|
|
10
15
|
export { ACTION_BRIDGE, ACTION_CONFIG, ACTION_EXECUTE, ACTION_TRANSFER, ACTION_TYPES, HUB_ABI, MAINNET_CHAINS, PROTOCOL_VERSION, TESTNET_CHAINS, VAULT_ABI, VAULT_FACTORY_ABI, WORMHOLE_API, WORMHOLE_CHAIN_IDS, WORMHOLE_CHAIN_IDS_FLAT } from './constants.js';
|
|
11
16
|
export { base64URLDecode, base64URLEncode, computeKeyHash, encodeSignatureForSolidity, getAddressExplorerUrl, getChainByEvmId, getChainByWormholeId, getTxExplorerUrl, isEvmChain, isValidBytes32, isValidEvmAddress, isValidWormholeChainId, parseDERSignature, retryWithBackoff } from './utils.js';
|
|
12
17
|
export { buildChallenge, buildGaslessChallenge, createGaslessMessageHash, createMessageHash, decodeActionPayload, decodeBridgeAction, decodeExecuteAction, decodeTransferAction, encodeAptosTransferAction, encodeBridgeAction, encodeConfigAction, encodeExecuteAction, encodeSolanaTransferAction, encodeSuiTransferAction, encodeTransferAction, encodeVeridexPayload, formatAmount, generateNonce, padTo32Bytes, parseAmount, solanaAddressToBytes32, trimTo20Bytes } from './payload.js';
|
|
13
18
|
export { HubStateQuery, HubStateResult, PortfolioChainErrorCode, PortfolioChainResult, PortfolioQuery, PortfolioResult, QueryConfig, QueryHubStateError, QueryHubStateErrorCode, QueryHubStateNetwork, QueryHubStateOptions, QueryNetwork, QueryOperation, QueryOperationType, QueryPortfolioError, QueryPortfolioErrorCode, QueryPortfolioNetwork, QueryPortfolioOptions, QueryRequest, QueryResponse, WORMHOLE_QUERY_CHAIN_IDS, WORMHOLE_QUERY_PROXY_URLS, WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND, queryHubState, queryPortfolio } from './queries/index.js';
|
|
14
19
|
export { CONSISTENCY_LEVELS, FetchVAAOptions, GUARDIAN_CONFIG, WaitForSignaturesOptions, emitterToEvmAddress, encodeVAAForSolana, encodeVAAToBytes, evmAddressToBytes32, fetchVAA, fetchVAAByTxHash, fetchVAAByTxHashFallback, getSequenceFromTxReceipt, getWormholeCoreBridge, getWormholeRelayer, getWormholeTokenBridge, hasQuorum, normalizeEmitterAddress, parseVAA, parseVAABytes, parseVeridexPayload, supportsRelayer, validateEmitter, waitForGuardianSignatures } from './wormhole.js';
|
|
20
|
+
import '@solana/web3.js';
|
|
21
|
+
import '@aptos-labs/ts-sdk';
|
|
22
|
+
import '@mysten/sui/client';
|
|
23
|
+
import 'starknet';
|
|
15
24
|
import '@wormhole-foundation/wormhole-query-sdk';
|
|
16
25
|
|
|
17
26
|
/**
|
|
@@ -175,6 +184,7 @@ declare const BASE_SEPOLIA_TOKENS: ChainTokenList;
|
|
|
175
184
|
declare const OPTIMISM_SEPOLIA_TOKENS: ChainTokenList;
|
|
176
185
|
declare const ARBITRUM_SEPOLIA_TOKENS: ChainTokenList;
|
|
177
186
|
declare const ETHEREUM_SEPOLIA_TOKENS: ChainTokenList;
|
|
187
|
+
declare const MONAD_TESTNET_TOKENS: ChainTokenList;
|
|
178
188
|
/**
|
|
179
189
|
* All token lists indexed by Wormhole chain ID
|
|
180
190
|
*/
|
|
@@ -2107,10 +2117,12 @@ declare const CHAIN_NAMES: {
|
|
|
2107
2117
|
readonly FANTOM: "fantom";
|
|
2108
2118
|
readonly CELO: "celo";
|
|
2109
2119
|
readonly MOONBEAM: "moonbeam";
|
|
2120
|
+
readonly MONAD: "monad";
|
|
2110
2121
|
readonly SOLANA: "solana";
|
|
2111
2122
|
readonly APTOS: "aptos";
|
|
2112
2123
|
readonly SUI: "sui";
|
|
2113
2124
|
readonly STARKNET: "starknet";
|
|
2125
|
+
readonly STACKS: "stacks";
|
|
2114
2126
|
readonly NEAR: "near";
|
|
2115
2127
|
readonly SEI: "sei";
|
|
2116
2128
|
};
|
|
@@ -2120,7 +2132,7 @@ interface ChainPreset {
|
|
|
2120
2132
|
/** Human-readable chain name */
|
|
2121
2133
|
displayName: string;
|
|
2122
2134
|
/** Chain type for client selection */
|
|
2123
|
-
type: 'evm' | 'solana' | 'aptos' | 'sui' | 'starknet' | 'near' | 'cosmos';
|
|
2135
|
+
type: 'evm' | 'solana' | 'aptos' | 'sui' | 'starknet' | 'stacks' | 'near' | 'cosmos';
|
|
2124
2136
|
/** Whether this chain can be a hub */
|
|
2125
2137
|
canBeHub: boolean;
|
|
2126
2138
|
/** Testnet configuration */
|
|
@@ -2261,7 +2273,7 @@ interface SessionConfig {
|
|
|
2261
2273
|
*
|
|
2262
2274
|
* // With relayer for gasless transactions
|
|
2263
2275
|
* const gaslessSdk = await createSDK('base', {
|
|
2264
|
-
* relayerUrl: 'https://relayer.veridex.
|
|
2276
|
+
* relayerUrl: 'https://relayer.veridex.network',
|
|
2265
2277
|
* relayerApiKey: 'your-api-key',
|
|
2266
2278
|
* });
|
|
2267
2279
|
* ```
|
|
@@ -2369,10 +2381,10 @@ declare function createSessionSDK(chain?: ChainName, config?: SimpleSDKConfig):
|
|
|
2369
2381
|
* ```
|
|
2370
2382
|
*/
|
|
2371
2383
|
|
|
2372
|
-
/** The canonical Veridex RP ID for cross-origin passkeys */
|
|
2373
|
-
declare const VERIDEX_RP_ID = "veridex.network";
|
|
2374
2384
|
/** Default auth portal URL */
|
|
2375
2385
|
declare const DEFAULT_AUTH_PORTAL_URL = "https://auth.veridex.network";
|
|
2386
|
+
/** Default relayer API URL for server-side session tokens */
|
|
2387
|
+
declare const DEFAULT_RELAYER_URL = "https://amused-kameko-veridex-demo-37453117.koyeb.app/api/v1";
|
|
2376
2388
|
/** Message types for postMessage communication */
|
|
2377
2389
|
declare const AUTH_MESSAGE_TYPES: {
|
|
2378
2390
|
readonly AUTH_REQUEST: "VERIDEX_AUTH_REQUEST";
|
|
@@ -2384,6 +2396,8 @@ interface CrossOriginAuthConfig {
|
|
|
2384
2396
|
rpId?: string;
|
|
2385
2397
|
/** Auth portal URL for popup/redirect flow */
|
|
2386
2398
|
authPortalUrl?: string;
|
|
2399
|
+
/** Relayer API URL for server-side session tokens */
|
|
2400
|
+
relayerUrl?: string;
|
|
2387
2401
|
/** Authentication mode: popup or redirect */
|
|
2388
2402
|
mode?: 'popup' | 'redirect';
|
|
2389
2403
|
/** Popup window features */
|
|
@@ -2406,6 +2420,17 @@ interface CrossOriginSession {
|
|
|
2406
2420
|
signature: WebAuthnSignature;
|
|
2407
2421
|
/** The credential used */
|
|
2408
2422
|
credential: PasskeyCredential$1;
|
|
2423
|
+
/** Server-validated session token ID (from relayer) */
|
|
2424
|
+
serverSessionId?: string;
|
|
2425
|
+
}
|
|
2426
|
+
/** Server-side session token returned by the relayer */
|
|
2427
|
+
interface ServerSessionToken {
|
|
2428
|
+
id: string;
|
|
2429
|
+
keyHash: string;
|
|
2430
|
+
appOrigin: string;
|
|
2431
|
+
permissions: string[];
|
|
2432
|
+
expiresAt: number;
|
|
2433
|
+
createdAt: number;
|
|
2409
2434
|
}
|
|
2410
2435
|
interface AuthPortalMessage {
|
|
2411
2436
|
type: typeof AUTH_MESSAGE_TYPES[keyof typeof AUTH_MESSAGE_TYPES];
|
|
@@ -2483,6 +2508,35 @@ declare class CrossOriginAuth {
|
|
|
2483
2508
|
* Get the auth portal URL.
|
|
2484
2509
|
*/
|
|
2485
2510
|
getAuthPortalUrl(): string;
|
|
2511
|
+
/**
|
|
2512
|
+
* Create a server-validated session token via the relayer.
|
|
2513
|
+
* Call this after authenticating (via ROR or auth portal) to get a
|
|
2514
|
+
* server-side session that the relayer can verify on subsequent requests.
|
|
2515
|
+
*/
|
|
2516
|
+
createServerSession(session: CrossOriginSession, options?: {
|
|
2517
|
+
permissions?: string[];
|
|
2518
|
+
expiresInMs?: number;
|
|
2519
|
+
}): Promise<ServerSessionToken>;
|
|
2520
|
+
/**
|
|
2521
|
+
* Validate an existing server session token.
|
|
2522
|
+
* Returns the session details if valid, null if expired/revoked.
|
|
2523
|
+
*/
|
|
2524
|
+
validateServerSession(sessionId: string): Promise<ServerSessionToken | null>;
|
|
2525
|
+
/**
|
|
2526
|
+
* Revoke a server session token.
|
|
2527
|
+
*/
|
|
2528
|
+
revokeServerSession(sessionId: string): Promise<boolean>;
|
|
2529
|
+
/**
|
|
2530
|
+
* Full authentication flow: authenticate + create server session.
|
|
2531
|
+
* Automatically detects ROR support and falls back to auth portal.
|
|
2532
|
+
*/
|
|
2533
|
+
authenticateAndCreateSession(options?: {
|
|
2534
|
+
permissions?: string[];
|
|
2535
|
+
expiresInMs?: number;
|
|
2536
|
+
}): Promise<{
|
|
2537
|
+
session: CrossOriginSession;
|
|
2538
|
+
serverSession: ServerSessionToken;
|
|
2539
|
+
}>;
|
|
2486
2540
|
}
|
|
2487
2541
|
/**
|
|
2488
2542
|
* Create a CrossOriginAuth instance for third-party app integration.
|
|
@@ -3309,4 +3363,104 @@ type AuthenticateAndPrepareResult = {
|
|
|
3309
3363
|
*/
|
|
3310
3364
|
declare function authenticateAndPrepare(userParams: AuthenticateAndPrepareParams, apiKey: string): Promise<AuthenticateAndPrepareResult>;
|
|
3311
3365
|
|
|
3312
|
-
|
|
3366
|
+
/**
|
|
3367
|
+
* @packageDocumentation
|
|
3368
|
+
* @module erc8004/contracts
|
|
3369
|
+
* @description
|
|
3370
|
+
* Low-level ERC-8004 contract utilities shared across SDK layers.
|
|
3371
|
+
*
|
|
3372
|
+
* Provides:
|
|
3373
|
+
* - Contract instance creation for Identity, Reputation, and Validation registries
|
|
3374
|
+
* - Address resolution by chain and network
|
|
3375
|
+
* - ABI references
|
|
3376
|
+
*
|
|
3377
|
+
* This module lives in the core SDK (`@veridex/sdk`) so that both the agent-sdk
|
|
3378
|
+
* and relayer can share the same contract interaction utilities.
|
|
3379
|
+
*
|
|
3380
|
+
* References:
|
|
3381
|
+
* - ADR-0029 §SDK Module Structure
|
|
3382
|
+
* - ERC8004_IMPLEMENTATION_PLAN.md Phase 1
|
|
3383
|
+
*/
|
|
3384
|
+
/** Identity Registry — same address on ALL EVM mainnets */
|
|
3385
|
+
declare const ERC8004_MAINNET_IDENTITY = "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432";
|
|
3386
|
+
/** Reputation Registry — same address on ALL EVM mainnets */
|
|
3387
|
+
declare const ERC8004_MAINNET_REPUTATION = "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63";
|
|
3388
|
+
/** Identity Registry — same address on ALL EVM testnets */
|
|
3389
|
+
declare const ERC8004_TESTNET_IDENTITY = "0x8004A818BFB912233c491871b3d84c89A494BD9e";
|
|
3390
|
+
/** Reputation Registry — same address on ALL EVM testnets */
|
|
3391
|
+
declare const ERC8004_TESTNET_REPUTATION = "0x8004B663056A597Dffe9eCcC1965A193B7388713";
|
|
3392
|
+
/**
|
|
3393
|
+
* Resolve canonical ERC-8004 registry addresses for a given network.
|
|
3394
|
+
*/
|
|
3395
|
+
declare function getERC8004Addresses(testnet: boolean): {
|
|
3396
|
+
identityRegistry: string;
|
|
3397
|
+
reputationRegistry: string;
|
|
3398
|
+
};
|
|
3399
|
+
/**
|
|
3400
|
+
* Check if a chain has ERC-8004 singletons deployed.
|
|
3401
|
+
*/
|
|
3402
|
+
declare function isERC8004Chain(chainName: string): boolean;
|
|
3403
|
+
/** Chains where ERC-8004 singletons are deployed */
|
|
3404
|
+
declare const ERC8004_CHAINS: {
|
|
3405
|
+
readonly mainnet: readonly ["ethereum", "base", "polygon", "arbitrum", "optimism", "linea", "megaeth", "monad"];
|
|
3406
|
+
readonly testnet: readonly ["ethereum-sepolia", "base-sepolia", "polygon-amoy", "arbitrum-sepolia", "optimism-sepolia", "monad-testnet"];
|
|
3407
|
+
};
|
|
3408
|
+
/** Minimal Identity Registry ABI for read operations */
|
|
3409
|
+
declare const IDENTITY_REGISTRY_READ_ABI: readonly ["function ownerOf(uint256 tokenId) view returns (address)", "function balanceOf(address owner) view returns (uint256)", "function totalSupply() view returns (uint256)", "function agentURI(uint256 agentId) view returns (string)", "function agentWallet(uint256 agentId) view returns (address)", "function getMetadata(uint256 agentId, string key) view returns (string)"];
|
|
3410
|
+
/** Minimal Reputation Registry ABI for read operations */
|
|
3411
|
+
declare const REPUTATION_REGISTRY_READ_ABI: readonly ["function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) view returns (uint256 count, int128 summaryValue, uint8 summaryValueDecimals)", "function readFeedback(uint256 agentId, address clientAddress, uint256 feedbackIndex) view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)", "function getClients(uint256 agentId) view returns (address[])", "function getLastIndex(uint256 agentId, address clientAddress) view returns (uint256)"];
|
|
3412
|
+
/** Full Identity Registry ABI (read + write) */
|
|
3413
|
+
declare const IDENTITY_REGISTRY_ABI: readonly ["function register(string agentURI) returns (uint256)", "function register(string agentURI, tuple(string key, string value)[] metadata) returns (uint256)", "function ownerOf(uint256 tokenId) view returns (address)", "function balanceOf(address owner) view returns (uint256)", "function totalSupply() view returns (uint256)", "function agentURI(uint256 agentId) view returns (string)", "function agentWallet(uint256 agentId) view returns (address)", "function getMetadata(uint256 agentId, string key) view returns (string)", "function setAgentURI(uint256 agentId, string newURI)", "function setAgentWallet(uint256 agentId, address wallet, uint256 deadline, bytes signature)", "function unsetAgentWallet(uint256 agentId)", "function setMetadata(uint256 agentId, string key, string value)", "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)", "event AgentURIUpdated(uint256 indexed agentId, string newURI)", "event AgentWalletSet(uint256 indexed agentId, address wallet)", "event AgentWalletUnset(uint256 indexed agentId)", "event MetadataUpdated(uint256 indexed agentId, string key, string value)"];
|
|
3414
|
+
/** Full Reputation Registry ABI (read + write) */
|
|
3415
|
+
declare const REPUTATION_REGISTRY_ABI: readonly ["function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2)", "function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2, string endpointURI, string feedbackURI, bytes32 feedbackHash)", "function revokeFeedback(uint256 agentId, uint256 feedbackIndex)", "function appendResponse(uint256 agentId, address clientAddress, uint256 feedbackIndex, string responseURI, bytes32 responseHash)", "function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) view returns (uint256 count, int128 summaryValue, uint8 summaryValueDecimals)", "function readFeedback(uint256 agentId, address clientAddress, uint256 feedbackIndex) view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)", "function getClients(uint256 agentId) view returns (address[])", "function getLastIndex(uint256 agentId, address clientAddress) view returns (uint256)", "event FeedbackGiven(uint256 indexed agentId, address indexed client, int128 value, uint8 valueDecimals)", "event FeedbackRevoked(uint256 indexed agentId, address indexed client, uint256 feedbackIndex)", "event ResponseAppended(uint256 indexed agentId, address indexed client, uint256 feedbackIndex)"];
|
|
3416
|
+
/** Validation Registry ABI (Phase 3 — spec still under active update) */
|
|
3417
|
+
declare const VALIDATION_REGISTRY_ABI: readonly ["function validationRequest(address validatorAddress, uint256 agentId, string requestURI, bytes32 requestHash) returns (bytes32)", "function getValidationStatus(bytes32 requestHash) view returns (address validatorAddress, uint256 agentId, uint8 response, bytes32 responseHash, string tag, uint256 lastUpdate)", "function getSummary(uint256 agentId, address[] validatorAddresses, string tag) view returns (uint256 count, uint256 averageResponse)", "function getAgentValidations(uint256 agentId) view returns (bytes32[])"];
|
|
3418
|
+
|
|
3419
|
+
/**
|
|
3420
|
+
* @packageDocumentation
|
|
3421
|
+
* @module erc8004/types
|
|
3422
|
+
* @description
|
|
3423
|
+
* On-chain types for ERC-8004 registries.
|
|
3424
|
+
* These are the low-level types that map directly to contract return values.
|
|
3425
|
+
*
|
|
3426
|
+
* Higher-level SDK config types live in `@veridex/agent-sdk/identity/types`.
|
|
3427
|
+
*/
|
|
3428
|
+
/** Agent registration as stored on-chain in the ERC-8004 Identity Registry */
|
|
3429
|
+
interface ERC8004AgentRegistration {
|
|
3430
|
+
agentId: bigint;
|
|
3431
|
+
owner: string;
|
|
3432
|
+
agentURI: string;
|
|
3433
|
+
agentWallet: string;
|
|
3434
|
+
}
|
|
3435
|
+
/** Key-value metadata entry */
|
|
3436
|
+
interface ERC8004MetadataEntry {
|
|
3437
|
+
key: string;
|
|
3438
|
+
value: string;
|
|
3439
|
+
}
|
|
3440
|
+
/** Individual feedback entry from the Reputation Registry */
|
|
3441
|
+
interface ERC8004FeedbackEntry {
|
|
3442
|
+
value: bigint;
|
|
3443
|
+
valueDecimals: number;
|
|
3444
|
+
tag1: string;
|
|
3445
|
+
tag2: string;
|
|
3446
|
+
isRevoked: boolean;
|
|
3447
|
+
}
|
|
3448
|
+
/** Aggregated feedback summary from the Reputation Registry */
|
|
3449
|
+
interface ERC8004FeedbackSummary {
|
|
3450
|
+
count: bigint;
|
|
3451
|
+
summaryValue: bigint;
|
|
3452
|
+
summaryValueDecimals: number;
|
|
3453
|
+
}
|
|
3454
|
+
/** Validation status from the Validation Registry */
|
|
3455
|
+
interface ERC8004ValidationStatus {
|
|
3456
|
+
validatorAddress: string;
|
|
3457
|
+
agentId: bigint;
|
|
3458
|
+
response: number;
|
|
3459
|
+
responseHash: string;
|
|
3460
|
+
tag: string;
|
|
3461
|
+
lastUpdate: bigint;
|
|
3462
|
+
}
|
|
3463
|
+
/** CAIP-2 universal agent identifier format */
|
|
3464
|
+
type UniversalAgentIdentifier = string;
|
|
3465
|
+
|
|
3466
|
+
export { ARBITRUM_SEPOLIA_TOKENS, AUTH_MESSAGE_TYPES, type ActionDetails, type ActionDisplayType, AddBackupKeyResult, type AuthPortalMessage, type AuthenticateAndPrepareParams, type AuthenticateAndPrepareResult, AuthorizedKey, BASE_SEPOLIA_TOKENS, BalanceManager, type BalanceManagerConfig, type BridgeDetails, BridgeParams, BridgeResult, CHAIN_DISPLAY_INFO, CHAIN_NAMES, CHAIN_PRESETS, CONFIG_TYPE, ChainAddress, type ChainAddressConfig, ChainClient, ChainConfig, type ChainDeploymentConfig, ChainDetector, type ChainDetectorConfig, type ChainDisplay, type ChainName, type ChainTokenList, type ConfigDetails, type CrossChainConfig, CrossChainManager, type CrossChainProgress, type CrossChainProgressCallback, type CrossChainResult, type CrossChainStatus, CrossOriginAuth, type CrossOriginAuthConfig, type CrossOriginSession, DEFAULT_AUTH_PORTAL_URL, DEFAULT_REFRESH_BUFFER, DEFAULT_RELAYER_URL, DEFAULT_SESSION_DURATION, type DailySpendingSummary, DispatchResult, type DurationDisplay, type ERC8004AgentRegistration, type ERC8004FeedbackEntry, type ERC8004FeedbackSummary, type ERC8004MetadataEntry, type ERC8004ValidationStatus, ERC8004_CHAINS, ERC8004_MAINNET_IDENTITY, ERC8004_MAINNET_REPUTATION, ERC8004_TESTNET_IDENTITY, ERC8004_TESTNET_REPUTATION, ERROR_MESSAGES, ERROR_RANGES, ETHEREUM_SEPOLIA_TOKENS, EVM_ZERO_ADDRESS, type ExecuteDetails, ExecuteParams, type FormattedSpendingLimits, GasSponsor, type GasSponsorConfig, IDENTITY_REGISTRY_ABI, IDENTITY_REGISTRY_READ_ABI, IdentityState, IndexedDBSessionStorage, type KeyPair, LIMIT_PRESETS, type LimitCheckResult, type LimitPreset, type LimitViolationSuggestion, type LimitViolationType, LocalStorageSessionStorage, MAX_SESSION_DURATION, MIN_SESSION_DURATION, MONAD_TESTNET_TOKENS, type MultiChainVaultResult, NATIVE_TOKEN_ADDRESS, type NativeBalanceCapable, type NetworkType, OPTIMISM_SEPOLIA_TOKENS, PasskeyCredential$1 as PasskeyCredential, PasskeyManager, type PortfolioBalance, PreparedBridge, PreparedTransfer, REPUTATION_REGISTRY_ABI, REPUTATION_REGISTRY_READ_ABI, ReceiveAddress, type RecipientDisplay, type RelayFeeQuote, type RelayRequest, type RelayRoute, type RelayStatus, RelayerClient, type RelayerClientConfig, type RelayerInfo, RemoveKeyResult, type RiskLevel, type RiskWarning, type RiskWarningType, type ServerSessionToken, SessionStorage, type SetDailyLimitParams, type SetTransactionLimitParams, type SimpleSDKConfig, type SessionConfig as SimpleSessionConfig, type SpendingLimitChangedEvent, type SpendingLimitConfig, type SpendingLimitEventCallback, type SpendingLimits, SpendingLimitsManager, type SpendingLimitsManagerConfig, type SpendingTransaction, type SponsoredVaultResult, type SponsorshipSource, type SubmitActionResult, type SubmitQueryRequest, type SubmitQueryResult, type SubmitSignedActionRequest, TOKEN_REGISTRY, type TokenBalance, type TokenDisplay, type TokenInfo$1 as TokenInfo, type TrackerConfig, type TransactionAuditEntry, type TransactionCallback, TransactionParser, type TransactionParserConfig, type TransactionState, type TransactionStatus, type TransactionSummary, TransactionTracker, type TransferDetails, TransferParams, TransferResult, UnifiedIdentity, type UniversalAgentIdentifier, VAA, VALIDATION_REGISTRY_ABI, VERIDEX_ERRORS, VaultCreationResult, VaultInfo, VeridexConfig, type VeridexErrorCode, VeridexPayload, VeridexSDK, WalletManager, WalletManagerConfig, WebAuthnSignature, authenticateAndPrepare, calculatePercentage, computeSessionKeyHash, createAuditEntry, createChainDetector, createCrossOriginAuth, createGasSponsor, createHubSDK, createMainnetSDK, createRelayerClient, createSDK, createSessionSDK, createSessionStorage, createSpendingLimitsManager, createTestnetSDK, createTransactionParser, crossChainManager, decrypt, VeridexSDK as default, deriveEncryptionKey, encrypt, formatDuration, formatLargeAmount, formatTransactionState, generateSecp256k1KeyPair, getAllTokens, getChainConfig, getChainDisplay, getChainName, getChainPreset, getConfigTypeName, getDefaultHub, getERC8004Addresses, getErrorCategory, getErrorMessage, getExplorerUrl, getHubChains, getSuggestedAction, getSupportedChainIds, getSupportedChains, getTokenByAddress, getTokenBySymbol, getTokenList, hashAction, isAbiError, isChainSupported, isCoreError, isERC8004Chain, isNativeToken, isQueryError, isQueryExecutionError, isQueryParsingError, isRetryableError, logTransactionSummary, parseVeridexError, sendAuthError, sendAuthResponse, signWithSessionKey, validateSessionConfig, verifySessionSignature };
|