@veridex/sdk 1.0.0-beta.17 → 1.0.0-beta.20

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.
Files changed (37) hide show
  1. package/README.md +416 -117
  2. package/dist/auth/prepareAuth.d.mts +25 -0
  3. package/dist/auth/prepareAuth.d.ts +25 -0
  4. package/dist/auth/prepareAuth.js +1553 -0
  5. package/dist/auth/prepareAuth.js.map +1 -0
  6. package/dist/auth/prepareAuth.mjs +1530 -0
  7. package/dist/auth/prepareAuth.mjs.map +1 -0
  8. package/dist/chains/aptos/index.d.mts +1 -1
  9. package/dist/chains/aptos/index.d.ts +1 -1
  10. package/dist/chains/evm/index.d.mts +2 -2
  11. package/dist/chains/evm/index.d.ts +2 -2
  12. package/dist/chains/solana/index.d.mts +1 -1
  13. package/dist/chains/solana/index.d.ts +1 -1
  14. package/dist/chains/stacks/index.d.mts +1 -1
  15. package/dist/chains/stacks/index.d.ts +1 -1
  16. package/dist/chains/starknet/index.d.mts +1 -1
  17. package/dist/chains/starknet/index.d.ts +1 -1
  18. package/dist/chains/sui/index.d.mts +1 -1
  19. package/dist/chains/sui/index.d.ts +1 -1
  20. package/dist/{index-CYOyIE3b.d.mts → index-Dy29mvBf.d.mts} +1 -1
  21. package/dist/{index-BXcR_ypI.d.ts → index-eXXqodd0.d.ts} +1 -1
  22. package/dist/index.d.mts +103 -25
  23. package/dist/index.d.ts +103 -25
  24. package/dist/index.js +198 -25
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +185 -17
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/queries/index.js +36 -1
  29. package/dist/queries/index.js.map +1 -1
  30. package/dist/queries/index.mjs +36 -1
  31. package/dist/queries/index.mjs.map +1 -1
  32. package/dist/{types-DE2ICQik.d.mts → types-DakHNZIP.d.mts} +2 -0
  33. package/dist/{types-DE2ICQik.d.ts → types-DakHNZIP.d.ts} +2 -0
  34. package/dist/types.d.mts +2 -0
  35. package/dist/types.d.ts +2 -0
  36. package/dist/types.js.map +1 -1
  37. package/package.json +6 -1
package/dist/index.mjs CHANGED
@@ -1686,11 +1686,46 @@ var ETHEREUM_SEPOLIA_TOKENS = {
1686
1686
  }
1687
1687
  ]
1688
1688
  };
1689
+ var MONAD_TESTNET_TOKENS = {
1690
+ wormholeChainId: 10048,
1691
+ chainName: "Monad Testnet",
1692
+ nativeToken: {
1693
+ symbol: "MON",
1694
+ name: "Monad",
1695
+ decimals: 18,
1696
+ address: NATIVE_TOKEN_ADDRESS,
1697
+ isNative: true
1698
+ },
1699
+ tokens: [
1700
+ {
1701
+ symbol: "USDC",
1702
+ name: "USD Coin",
1703
+ decimals: 6,
1704
+ address: "0x754704Bc059F8C67012fEd69BC8A327a5aafb603",
1705
+ isNative: false
1706
+ },
1707
+ {
1708
+ symbol: "AUSD",
1709
+ name: "Agora Dollar",
1710
+ decimals: 18,
1711
+ address: "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
1712
+ isNative: false
1713
+ },
1714
+ {
1715
+ symbol: "WMON",
1716
+ name: "Wrapped MON",
1717
+ decimals: 18,
1718
+ address: "0x3bd359C1119dA7Da1D913D1C4D2B7c461115433A",
1719
+ isNative: false
1720
+ }
1721
+ ]
1722
+ };
1689
1723
  var TOKEN_REGISTRY = {
1690
1724
  10004: BASE_SEPOLIA_TOKENS,
1691
1725
  10005: OPTIMISM_SEPOLIA_TOKENS,
1692
1726
  10003: ARBITRUM_SEPOLIA_TOKENS,
1693
- 10002: ETHEREUM_SEPOLIA_TOKENS
1727
+ 10002: ETHEREUM_SEPOLIA_TOKENS,
1728
+ 10048: MONAD_TESTNET_TOKENS
1694
1729
  };
1695
1730
  function getTokenList(wormholeChainId) {
1696
1731
  return TOKEN_REGISTRY[wormholeChainId] ?? null;
@@ -6695,14 +6730,6 @@ var WORMHOLE_QUERY_PROXY_URLS = {
6695
6730
  mainnet: "https://query.wormhole.com/v1/query",
6696
6731
  testnet: "https://testnet.query.wormhole.com/v1/query"
6697
6732
  };
6698
- var WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND = 6;
6699
- var WORMHOLE_QUERY_CHAIN_IDS = {
6700
- ETHEREUM: 2,
6701
- POLYGON: 5,
6702
- ARBITRUM: 23,
6703
- OPTIMISM: 24,
6704
- BASE: 30
6705
- };
6706
6733
 
6707
6734
  // src/queries/hubState.ts
6708
6735
  var QueryHubStateError = class extends Error {
@@ -12060,6 +12087,8 @@ var CHAIN_NAMES = {
12060
12087
  FANTOM: "fantom",
12061
12088
  CELO: "celo",
12062
12089
  MOONBEAM: "moonbeam",
12090
+ // EVM L1s (High Performance)
12091
+ MONAD: "monad",
12063
12092
  // Non-EVM
12064
12093
  SOLANA: "solana",
12065
12094
  APTOS: "aptos",
@@ -12497,6 +12526,45 @@ var CHAIN_PRESETS = {
12497
12526
  }
12498
12527
  },
12499
12528
  // ────────────────────────────────────────────────────────────────────────
12529
+ // MONAD - High-Performance L1 with EIP-7951 P256 + Agent Gateway
12530
+ // ────────────────────────────────────────────────────────────────────────
12531
+ monad: {
12532
+ displayName: "Monad",
12533
+ type: "evm",
12534
+ canBeHub: true,
12535
+ // Has native P-256 precompile (EIP-7951)
12536
+ testnet: {
12537
+ name: "Monad Testnet",
12538
+ chainId: 10143,
12539
+ wormholeChainId: 10048,
12540
+ rpcUrl: "https://testnet-rpc.monad.xyz",
12541
+ explorerUrl: "https://testnet.monadvision.com",
12542
+ isEvm: true,
12543
+ contracts: {
12544
+ vaultFactory: "0x07F608AFf6d63b68029488b726d895c4Bb593038",
12545
+ vaultImplementation: "0xD66153fccFB6731fB6c4944FbD607ba86A76a1f6",
12546
+ wormholeCoreBridge: "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd",
12547
+ // Agent Gateway contracts
12548
+ serviceDirectory: "0x0D2B4193e78107678a5aC29d795e0EcD361aE3A7"
12549
+ },
12550
+ hubChainId: 10004
12551
+ // Base Sepolia
12552
+ },
12553
+ mainnet: {
12554
+ name: "Monad",
12555
+ chainId: 143,
12556
+ wormholeChainId: 0,
12557
+ // TBD
12558
+ rpcUrl: "https://rpc.monad.xyz",
12559
+ explorerUrl: "https://monadscan.com",
12560
+ isEvm: true,
12561
+ contracts: {
12562
+ wormholeCoreBridge: "0x194B123c5E96B9b2E49763619985790Dc241CAC0",
12563
+ tokenBridge: "0x0B2719cdA2F10595369e6673ceA3Ee2EDFa13BA7"
12564
+ }
12565
+ }
12566
+ },
12567
+ // ────────────────────────────────────────────────────────────────────────
12500
12568
  // SEI
12501
12569
  // ────────────────────────────────────────────────────────────────────────
12502
12570
  sei: {
@@ -14529,6 +14597,101 @@ function getSuggestedAction(code) {
14529
14597
  return "An error occurred. Please try again or contact support.";
14530
14598
  }
14531
14599
  }
14600
+
14601
+ // src/erc8004/contracts.ts
14602
+ var ERC8004_MAINNET_IDENTITY = "0x8004A169FB4a3325136EB29fA0ceB6D2e539a432";
14603
+ var ERC8004_MAINNET_REPUTATION = "0x8004BAa17C55a88189AE136b182e5fdA19dE9b63";
14604
+ var ERC8004_TESTNET_IDENTITY = "0x8004A818BFB912233c491871b3d84c89A494BD9e";
14605
+ var ERC8004_TESTNET_REPUTATION = "0x8004B663056A597Dffe9eCcC1965A193B7388713";
14606
+ function getERC8004Addresses(testnet) {
14607
+ return {
14608
+ identityRegistry: testnet ? ERC8004_TESTNET_IDENTITY : ERC8004_MAINNET_IDENTITY,
14609
+ reputationRegistry: testnet ? ERC8004_TESTNET_REPUTATION : ERC8004_MAINNET_REPUTATION
14610
+ };
14611
+ }
14612
+ function isERC8004Chain(chainName) {
14613
+ return ERC8004_CHAINS.mainnet.includes(chainName) || ERC8004_CHAINS.testnet.includes(chainName);
14614
+ }
14615
+ var ERC8004_CHAINS = {
14616
+ mainnet: [
14617
+ "ethereum",
14618
+ "base",
14619
+ "polygon",
14620
+ "arbitrum",
14621
+ "optimism",
14622
+ "linea",
14623
+ "megaeth",
14624
+ "monad"
14625
+ ],
14626
+ testnet: [
14627
+ "ethereum-sepolia",
14628
+ "base-sepolia",
14629
+ "polygon-amoy",
14630
+ "arbitrum-sepolia",
14631
+ "optimism-sepolia",
14632
+ "monad-testnet"
14633
+ ]
14634
+ };
14635
+ var IDENTITY_REGISTRY_READ_ABI = [
14636
+ "function ownerOf(uint256 tokenId) view returns (address)",
14637
+ "function balanceOf(address owner) view returns (uint256)",
14638
+ "function totalSupply() view returns (uint256)",
14639
+ "function agentURI(uint256 agentId) view returns (string)",
14640
+ "function agentWallet(uint256 agentId) view returns (address)",
14641
+ "function getMetadata(uint256 agentId, string key) view returns (string)"
14642
+ ];
14643
+ var REPUTATION_REGISTRY_READ_ABI = [
14644
+ "function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) view returns (uint256 count, int128 summaryValue, uint8 summaryValueDecimals)",
14645
+ "function readFeedback(uint256 agentId, address clientAddress, uint256 feedbackIndex) view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)",
14646
+ "function getClients(uint256 agentId) view returns (address[])",
14647
+ "function getLastIndex(uint256 agentId, address clientAddress) view returns (uint256)"
14648
+ ];
14649
+ var IDENTITY_REGISTRY_ABI = [
14650
+ // Registration
14651
+ "function register(string agentURI) returns (uint256)",
14652
+ "function register(string agentURI, tuple(string key, string value)[] metadata) returns (uint256)",
14653
+ // Read — ERC-721 standard
14654
+ "function ownerOf(uint256 tokenId) view returns (address)",
14655
+ "function balanceOf(address owner) view returns (uint256)",
14656
+ "function totalSupply() view returns (uint256)",
14657
+ // Read — ERC-8004 specific
14658
+ "function agentURI(uint256 agentId) view returns (string)",
14659
+ "function agentWallet(uint256 agentId) view returns (address)",
14660
+ "function getMetadata(uint256 agentId, string key) view returns (string)",
14661
+ // Write — URI and wallet management
14662
+ "function setAgentURI(uint256 agentId, string newURI)",
14663
+ "function setAgentWallet(uint256 agentId, address wallet, uint256 deadline, bytes signature)",
14664
+ "function unsetAgentWallet(uint256 agentId)",
14665
+ "function setMetadata(uint256 agentId, string key, string value)",
14666
+ // Events
14667
+ "event Transfer(address indexed from, address indexed to, uint256 indexed tokenId)",
14668
+ "event AgentURIUpdated(uint256 indexed agentId, string newURI)",
14669
+ "event AgentWalletSet(uint256 indexed agentId, address wallet)",
14670
+ "event AgentWalletUnset(uint256 indexed agentId)",
14671
+ "event MetadataUpdated(uint256 indexed agentId, string key, string value)"
14672
+ ];
14673
+ var REPUTATION_REGISTRY_ABI = [
14674
+ // Write
14675
+ "function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2)",
14676
+ "function giveFeedback(uint256 agentId, int128 value, uint8 valueDecimals, string tag1, string tag2, string endpointURI, string feedbackURI, bytes32 feedbackHash)",
14677
+ "function revokeFeedback(uint256 agentId, uint256 feedbackIndex)",
14678
+ "function appendResponse(uint256 agentId, address clientAddress, uint256 feedbackIndex, string responseURI, bytes32 responseHash)",
14679
+ // Read
14680
+ "function getSummary(uint256 agentId, address[] clientAddresses, string tag1, string tag2) view returns (uint256 count, int128 summaryValue, uint8 summaryValueDecimals)",
14681
+ "function readFeedback(uint256 agentId, address clientAddress, uint256 feedbackIndex) view returns (int128 value, uint8 valueDecimals, string tag1, string tag2, bool isRevoked)",
14682
+ "function getClients(uint256 agentId) view returns (address[])",
14683
+ "function getLastIndex(uint256 agentId, address clientAddress) view returns (uint256)",
14684
+ // Events
14685
+ "event FeedbackGiven(uint256 indexed agentId, address indexed client, int128 value, uint8 valueDecimals)",
14686
+ "event FeedbackRevoked(uint256 indexed agentId, address indexed client, uint256 feedbackIndex)",
14687
+ "event ResponseAppended(uint256 indexed agentId, address indexed client, uint256 feedbackIndex)"
14688
+ ];
14689
+ var VALIDATION_REGISTRY_ABI = [
14690
+ "function validationRequest(address validatorAddress, uint256 agentId, string requestURI, bytes32 requestHash) returns (bytes32)",
14691
+ "function getValidationStatus(bytes32 requestHash) view returns (address validatorAddress, uint256 agentId, uint8 response, bytes32 responseHash, string tag, uint256 lastUpdate)",
14692
+ "function getSummary(uint256 agentId, address[] validatorAddresses, string tag) view returns (uint256 count, uint256 averageResponse)",
14693
+ "function getAgentValidations(uint256 agentId) view returns (bytes32[])"
14694
+ ];
14532
14695
  export {
14533
14696
  ACTION_BRIDGE,
14534
14697
  ACTION_CONFIG,
@@ -14552,6 +14715,11 @@ export {
14552
14715
  DEFAULT_REFRESH_BUFFER,
14553
14716
  DEFAULT_RELAYER_URL,
14554
14717
  DEFAULT_SESSION_DURATION,
14718
+ ERC8004_CHAINS,
14719
+ ERC8004_MAINNET_IDENTITY,
14720
+ ERC8004_MAINNET_REPUTATION,
14721
+ ERC8004_TESTNET_IDENTITY,
14722
+ ERC8004_TESTNET_REPUTATION,
14555
14723
  ERROR_MESSAGES,
14556
14724
  ERROR_RANGES,
14557
14725
  ETHEREUM_SEPOLIA_TOKENS,
@@ -14561,18 +14729,21 @@ export {
14561
14729
  GUARDIAN_CONFIG,
14562
14730
  GasSponsor,
14563
14731
  HUB_ABI,
14732
+ IDENTITY_REGISTRY_ABI,
14733
+ IDENTITY_REGISTRY_READ_ABI,
14564
14734
  IndexedDBSessionStorage,
14565
14735
  LIMIT_PRESETS,
14566
14736
  LocalStorageSessionStorage,
14567
14737
  MAINNET_CHAINS,
14568
14738
  MAX_SESSION_DURATION,
14569
14739
  MIN_SESSION_DURATION,
14740
+ MONAD_TESTNET_TOKENS,
14570
14741
  NATIVE_TOKEN_ADDRESS,
14571
14742
  OPTIMISM_SEPOLIA_TOKENS,
14572
14743
  PROTOCOL_VERSION,
14573
14744
  PasskeyManager,
14574
- QueryHubStateError,
14575
- QueryPortfolioError,
14745
+ REPUTATION_REGISTRY_ABI,
14746
+ REPUTATION_REGISTRY_READ_ABI,
14576
14747
  RelayerClient,
14577
14748
  STACKS_ACTION_TYPES,
14578
14749
  SessionError,
@@ -14586,6 +14757,7 @@ export {
14586
14757
  TOKEN_REGISTRY,
14587
14758
  TransactionParser,
14588
14759
  TransactionTracker,
14760
+ VALIDATION_REGISTRY_ABI,
14589
14761
  VAULT_ABI,
14590
14762
  VAULT_FACTORY_ABI,
14591
14763
  VERIDEX_ERRORS,
@@ -14594,11 +14766,7 @@ export {
14594
14766
  WORMHOLE_API,
14595
14767
  WORMHOLE_CHAIN_IDS,
14596
14768
  WORMHOLE_CHAIN_IDS_FLAT,
14597
- WORMHOLE_QUERY_CHAIN_IDS,
14598
- WORMHOLE_QUERY_PROXY_URLS,
14599
- WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND,
14600
14769
  WalletManager,
14601
- authenticateAndPrepare,
14602
14770
  base64URLDecode,
14603
14771
  base64URLEncode,
14604
14772
  buildChallenge,
@@ -14667,6 +14835,7 @@ export {
14667
14835
  getChainPreset,
14668
14836
  getConfigTypeName,
14669
14837
  getDefaultHub,
14838
+ getERC8004Addresses,
14670
14839
  getErrorCategory,
14671
14840
  getErrorMessage,
14672
14841
  getExplorerUrl,
@@ -14691,6 +14860,7 @@ export {
14691
14860
  isAbiError,
14692
14861
  isChainSupported,
14693
14862
  isCoreError,
14863
+ isERC8004Chain,
14694
14864
  isEvmChain,
14695
14865
  isNativeToken,
14696
14866
  isQueryError,
@@ -14714,8 +14884,6 @@ export {
14714
14884
  parseVAABytes,
14715
14885
  parseVeridexError,
14716
14886
  parseVeridexPayload,
14717
- queryHubState,
14718
- queryPortfolio,
14719
14887
  retryWithBackoff,
14720
14888
  sendAuthError,
14721
14889
  sendAuthResponse,