@dcentralab/d402-client 0.3.8 → 0.3.10

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/index.d.mts CHANGED
@@ -636,6 +636,7 @@ interface WithdrawalRequest {
636
636
  token: Address;
637
637
  amount: bigint;
638
638
  requestedAt: bigint;
639
+ unlockTime: bigint;
639
640
  executed: boolean;
640
641
  }
641
642
 
@@ -762,6 +763,45 @@ declare function getWalletsByOwner(params: {
762
763
  network?: SupportedNetwork;
763
764
  rpcUrl?: string;
764
765
  }): Promise<Address[]>;
766
+ /**
767
+ * Get wallet info for debugging - includes owner, operator, and settlement layer addresses.
768
+ *
769
+ * @param params - Query parameters
770
+ * @param params.publicClient - Viem PublicClient
771
+ * @param params.walletAddress - IATPWallet contract address
772
+ * @param params.network - Network to query
773
+ * @returns Wallet info object
774
+ */
775
+ declare function getWalletInfo(params: {
776
+ publicClient: PublicClient;
777
+ walletAddress: Address;
778
+ network?: SupportedNetwork;
779
+ }): Promise<{
780
+ owner: Address;
781
+ operator: Address;
782
+ settlementLayer: Address;
783
+ }>;
784
+ /**
785
+ * Get EIP-712 domain info for an IATPWallet - used for debugging signature issues.
786
+ *
787
+ * Reads the eip712Domain function from the wallet contract.
788
+ *
789
+ * @param params - Query parameters
790
+ * @param params.publicClient - Viem PublicClient
791
+ * @param params.walletAddress - IATPWallet contract address
792
+ * @param params.network - Network to query
793
+ * @returns EIP-712 domain info
794
+ */
795
+ declare function getWalletEIP712Domain(params: {
796
+ publicClient: PublicClient;
797
+ walletAddress: Address;
798
+ network?: SupportedNetwork;
799
+ }): Promise<{
800
+ name: string;
801
+ version: string;
802
+ chainId: bigint;
803
+ verifyingContract: Address;
804
+ }>;
765
805
 
766
806
  /**
767
807
  * IATPWallet withdrawal functions
@@ -1224,8 +1264,8 @@ declare function getUsdcAddress(network: SupportedNetwork): `0x${string}`;
1224
1264
  * from external APIs. It supports many networks that may appear in 402 responses,
1225
1265
  * even if IATP contracts are not deployed on those networks.
1226
1266
  *
1227
- * Note: IATP contracts are currently only deployed on Sepolia. This function exists
1228
- * to handle 402 responses from any API that might support other networks.
1267
+ * Note: IATP contracts are deployed on Sepolia and Arbitrum. This function can also
1268
+ * handle 402 responses from APIs that might reference other networks by chain ID.
1229
1269
  *
1230
1270
  * @param network - Network name or chain ID as string
1231
1271
  * @returns Chain ID as number
@@ -1336,4 +1376,4 @@ declare class UnsupportedNetworkError extends PaymentError {
1336
1376
  constructor(network: string);
1337
1377
  }
1338
1378
 
1339
- export { ContractName, D402Client, type D402ClientConfig, type D402Response, type EIP712Domain, Invalid402ResponseError, type JsonRpcPayload, type McpToolResult, MissingRequestConfigError, type ParsedMcpResponse, PaymentAlreadyAttemptedError, PaymentAmountExceededError, type PaymentAuthorization, PaymentError, type PaymentRequirement, type PaymentSelector, type PaymentSelectorOptions, PaymentVerificationError, type SignedPayment, type SupportedNetwork, UnsupportedNetworkError, UnsupportedSchemeError, type WalletCreationResult, type WithdrawalRequest, buildMcpHeaders, buildToolCallPayload, createIATPWallet, createPaymentSelector, decodePayment, decodePaymentResponse, encodePayment, executeWithdrawal, extractToolResult, findMatchingPaymentRequirement, formatMoney, generateNonce, getAvailableBalance, getChain, getChainId, getContractAbi, getContractAddress, getContractConfig, getCurrentTimestamp, getLockedBalanceForProvider, getUnlockedBalanceForProvider, getUsdcAddress, getWalletsByOwner, getWithdrawalRequest, initMcpSession, isValidAddress, normalizeAddress, parseAllPaymentRequirements, parseMcpResponse, parseMoney, parsePaymentRequirement, requestWithdrawal, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc, withdrawAllAvailableEpochs };
1379
+ export { ContractName, D402Client, type D402ClientConfig, type D402Response, type EIP712Domain, Invalid402ResponseError, type JsonRpcPayload, type McpToolResult, MissingRequestConfigError, type ParsedMcpResponse, PaymentAlreadyAttemptedError, PaymentAmountExceededError, type PaymentAuthorization, PaymentError, type PaymentRequirement, type PaymentSelector, type PaymentSelectorOptions, PaymentVerificationError, type SignedPayment, type SupportedNetwork, UnsupportedNetworkError, UnsupportedSchemeError, type WalletCreationResult, type WithdrawalRequest, buildMcpHeaders, buildToolCallPayload, createIATPWallet, createPaymentSelector, decodePayment, decodePaymentResponse, encodePayment, executeWithdrawal, extractToolResult, findMatchingPaymentRequirement, formatMoney, generateNonce, getAvailableBalance, getChain, getChainId, getContractAbi, getContractAddress, getContractConfig, getCurrentTimestamp, getLockedBalanceForProvider, getUnlockedBalanceForProvider, getUsdcAddress, getWalletEIP712Domain, getWalletInfo, getWalletsByOwner, getWithdrawalRequest, initMcpSession, isValidAddress, normalizeAddress, parseAllPaymentRequirements, parseMcpResponse, parseMoney, parsePaymentRequirement, requestWithdrawal, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc, withdrawAllAvailableEpochs };
package/dist/index.d.ts CHANGED
@@ -636,6 +636,7 @@ interface WithdrawalRequest {
636
636
  token: Address;
637
637
  amount: bigint;
638
638
  requestedAt: bigint;
639
+ unlockTime: bigint;
639
640
  executed: boolean;
640
641
  }
641
642
 
@@ -762,6 +763,45 @@ declare function getWalletsByOwner(params: {
762
763
  network?: SupportedNetwork;
763
764
  rpcUrl?: string;
764
765
  }): Promise<Address[]>;
766
+ /**
767
+ * Get wallet info for debugging - includes owner, operator, and settlement layer addresses.
768
+ *
769
+ * @param params - Query parameters
770
+ * @param params.publicClient - Viem PublicClient
771
+ * @param params.walletAddress - IATPWallet contract address
772
+ * @param params.network - Network to query
773
+ * @returns Wallet info object
774
+ */
775
+ declare function getWalletInfo(params: {
776
+ publicClient: PublicClient;
777
+ walletAddress: Address;
778
+ network?: SupportedNetwork;
779
+ }): Promise<{
780
+ owner: Address;
781
+ operator: Address;
782
+ settlementLayer: Address;
783
+ }>;
784
+ /**
785
+ * Get EIP-712 domain info for an IATPWallet - used for debugging signature issues.
786
+ *
787
+ * Reads the eip712Domain function from the wallet contract.
788
+ *
789
+ * @param params - Query parameters
790
+ * @param params.publicClient - Viem PublicClient
791
+ * @param params.walletAddress - IATPWallet contract address
792
+ * @param params.network - Network to query
793
+ * @returns EIP-712 domain info
794
+ */
795
+ declare function getWalletEIP712Domain(params: {
796
+ publicClient: PublicClient;
797
+ walletAddress: Address;
798
+ network?: SupportedNetwork;
799
+ }): Promise<{
800
+ name: string;
801
+ version: string;
802
+ chainId: bigint;
803
+ verifyingContract: Address;
804
+ }>;
765
805
 
766
806
  /**
767
807
  * IATPWallet withdrawal functions
@@ -1224,8 +1264,8 @@ declare function getUsdcAddress(network: SupportedNetwork): `0x${string}`;
1224
1264
  * from external APIs. It supports many networks that may appear in 402 responses,
1225
1265
  * even if IATP contracts are not deployed on those networks.
1226
1266
  *
1227
- * Note: IATP contracts are currently only deployed on Sepolia. This function exists
1228
- * to handle 402 responses from any API that might support other networks.
1267
+ * Note: IATP contracts are deployed on Sepolia and Arbitrum. This function can also
1268
+ * handle 402 responses from APIs that might reference other networks by chain ID.
1229
1269
  *
1230
1270
  * @param network - Network name or chain ID as string
1231
1271
  * @returns Chain ID as number
@@ -1336,4 +1376,4 @@ declare class UnsupportedNetworkError extends PaymentError {
1336
1376
  constructor(network: string);
1337
1377
  }
1338
1378
 
1339
- export { ContractName, D402Client, type D402ClientConfig, type D402Response, type EIP712Domain, Invalid402ResponseError, type JsonRpcPayload, type McpToolResult, MissingRequestConfigError, type ParsedMcpResponse, PaymentAlreadyAttemptedError, PaymentAmountExceededError, type PaymentAuthorization, PaymentError, type PaymentRequirement, type PaymentSelector, type PaymentSelectorOptions, PaymentVerificationError, type SignedPayment, type SupportedNetwork, UnsupportedNetworkError, UnsupportedSchemeError, type WalletCreationResult, type WithdrawalRequest, buildMcpHeaders, buildToolCallPayload, createIATPWallet, createPaymentSelector, decodePayment, decodePaymentResponse, encodePayment, executeWithdrawal, extractToolResult, findMatchingPaymentRequirement, formatMoney, generateNonce, getAvailableBalance, getChain, getChainId, getContractAbi, getContractAddress, getContractConfig, getCurrentTimestamp, getLockedBalanceForProvider, getUnlockedBalanceForProvider, getUsdcAddress, getWalletsByOwner, getWithdrawalRequest, initMcpSession, isValidAddress, normalizeAddress, parseAllPaymentRequirements, parseMcpResponse, parseMoney, parsePaymentRequirement, requestWithdrawal, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc, withdrawAllAvailableEpochs };
1379
+ export { ContractName, D402Client, type D402ClientConfig, type D402Response, type EIP712Domain, Invalid402ResponseError, type JsonRpcPayload, type McpToolResult, MissingRequestConfigError, type ParsedMcpResponse, PaymentAlreadyAttemptedError, PaymentAmountExceededError, type PaymentAuthorization, PaymentError, type PaymentRequirement, type PaymentSelector, type PaymentSelectorOptions, PaymentVerificationError, type SignedPayment, type SupportedNetwork, UnsupportedNetworkError, UnsupportedSchemeError, type WalletCreationResult, type WithdrawalRequest, buildMcpHeaders, buildToolCallPayload, createIATPWallet, createPaymentSelector, decodePayment, decodePaymentResponse, encodePayment, executeWithdrawal, extractToolResult, findMatchingPaymentRequirement, formatMoney, generateNonce, getAvailableBalance, getChain, getChainId, getContractAbi, getContractAddress, getContractConfig, getCurrentTimestamp, getLockedBalanceForProvider, getUnlockedBalanceForProvider, getUsdcAddress, getWalletEIP712Domain, getWalletInfo, getWalletsByOwner, getWithdrawalRequest, initMcpSession, isValidAddress, normalizeAddress, parseAllPaymentRequirements, parseMcpResponse, parseMoney, parsePaymentRequirement, requestWithdrawal, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc, withdrawAllAvailableEpochs };