@dcentralab/d402-client 0.1.2 → 0.2.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/index.mjs CHANGED
@@ -8993,7 +8993,27 @@ async function createIATPWallet(params) {
8993
8993
  chainId: chain.id
8994
8994
  };
8995
8995
  }
8996
+ async function getWalletsByOwner(params) {
8997
+ const { ownerAddress, network = "sepolia", rpcUrl } = params;
8998
+ const factoryConfig = getContractConfig("IATPWalletFactory" /* IATP_WALLET_FACTORY */, network);
8999
+ if (!factoryConfig) {
9000
+ throw new Error(`IATPWalletFactory not found for network: ${network}`);
9001
+ }
9002
+ const chain = network === "sepolia" ? sepolia : localhost;
9003
+ const transport = http(rpcUrl);
9004
+ const publicClient = createPublicClient({
9005
+ chain,
9006
+ transport
9007
+ });
9008
+ const wallets = await publicClient.readContract({
9009
+ address: factoryConfig.address,
9010
+ abi: factoryConfig.abi,
9011
+ functionName: "getWalletsByOwner",
9012
+ args: [ownerAddress]
9013
+ });
9014
+ return wallets;
9015
+ }
8996
9016
 
8997
- export { CHAIN_IDS, ContractName, D402Client, DEFAULT_VALIDITY_WINDOW_SECONDS, EIP712_TYPES, Invalid402ResponseError, MissingRequestConfigError, NETWORKS, PaymentAlreadyAttemptedError, PaymentAmountExceededError, PaymentError, PaymentVerificationError, TOKEN_ADDRESSES, UnsupportedNetworkError, UnsupportedSchemeError, createIATPWallet, createPaymentSelector, decodePayment, decodePaymentResponse, encodePayment, findMatchingPaymentRequirement, formatMoney, generateNonce, getAllContractAddresses, getChainId, getContractAbi, getContractAddress, getContractConfig, getCurrentTimestamp, getUsdcAddress, isContractDeployed, isValidAddress, normalizeAddress, parseMoney, parsePaymentRequirement, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc };
9017
+ export { CHAIN_IDS, ContractName, D402Client, DEFAULT_VALIDITY_WINDOW_SECONDS, EIP712_TYPES, Invalid402ResponseError, MissingRequestConfigError, NETWORKS, PaymentAlreadyAttemptedError, PaymentAmountExceededError, PaymentError, PaymentVerificationError, TOKEN_ADDRESSES, UnsupportedNetworkError, UnsupportedSchemeError, createIATPWallet, createPaymentSelector, decodePayment, decodePaymentResponse, encodePayment, findMatchingPaymentRequirement, formatMoney, generateNonce, getAllContractAddresses, getChainId, getContractAbi, getContractAddress, getContractConfig, getCurrentTimestamp, getUsdcAddress, getWalletsByOwner, isContractDeployed, isValidAddress, normalizeAddress, parseMoney, parsePaymentRequirement, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc };
8998
9018
  //# sourceMappingURL=index.mjs.map
8999
9019
  //# sourceMappingURL=index.mjs.map