@dcentralab/d402-client 0.3.16 → 0.3.17
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 +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1161,6 +1161,22 @@ declare function getUnlockedBalanceForProvider(params: {
|
|
|
1161
1161
|
tokenAddress: Address;
|
|
1162
1162
|
network?: SupportedNetwork;
|
|
1163
1163
|
}): Promise<bigint>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Get total dispute amount currently in progress for a provider.
|
|
1166
|
+
*
|
|
1167
|
+
* @param params - Query parameters
|
|
1168
|
+
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
1169
|
+
* @param params.providerAddress - Provider (utility agent) IATPWallet address
|
|
1170
|
+
* @param params.tokenAddress - Token contract address
|
|
1171
|
+
* @param params.network - Network: "sepolia" | "arbitrum" (default: "sepolia")
|
|
1172
|
+
* @returns Total dispute amount in progress in base units (wei)
|
|
1173
|
+
*/
|
|
1174
|
+
declare function getProviderTotalDisputeInProgress(params: {
|
|
1175
|
+
publicClient: PublicClient;
|
|
1176
|
+
providerAddress: Address;
|
|
1177
|
+
tokenAddress: Address;
|
|
1178
|
+
network?: SupportedNetwork;
|
|
1179
|
+
}): Promise<bigint>;
|
|
1164
1180
|
|
|
1165
1181
|
/**
|
|
1166
1182
|
* IATPSettlementLayer operations
|
|
@@ -1436,4 +1452,4 @@ declare class UnsupportedNetworkError extends PaymentError {
|
|
|
1436
1452
|
constructor(network: string);
|
|
1437
1453
|
}
|
|
1438
1454
|
|
|
1439
|
-
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, validateConsumerSignature, withdrawAllAvailableEpochs, withdrawAllFromSettlement };
|
|
1455
|
+
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, getProviderTotalDisputeInProgress, getUnlockedBalanceForProvider, getUsdcAddress, getWalletEIP712Domain, getWalletInfo, getWalletsByOwner, getWithdrawalRequest, initMcpSession, isValidAddress, normalizeAddress, parseAllPaymentRequirements, parseMcpResponse, parseMoney, parsePaymentRequirement, requestWithdrawal, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc, validateConsumerSignature, withdrawAllAvailableEpochs, withdrawAllFromSettlement };
|
package/dist/index.d.ts
CHANGED
|
@@ -1161,6 +1161,22 @@ declare function getUnlockedBalanceForProvider(params: {
|
|
|
1161
1161
|
tokenAddress: Address;
|
|
1162
1162
|
network?: SupportedNetwork;
|
|
1163
1163
|
}): Promise<bigint>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Get total dispute amount currently in progress for a provider.
|
|
1166
|
+
*
|
|
1167
|
+
* @param params - Query parameters
|
|
1168
|
+
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
1169
|
+
* @param params.providerAddress - Provider (utility agent) IATPWallet address
|
|
1170
|
+
* @param params.tokenAddress - Token contract address
|
|
1171
|
+
* @param params.network - Network: "sepolia" | "arbitrum" (default: "sepolia")
|
|
1172
|
+
* @returns Total dispute amount in progress in base units (wei)
|
|
1173
|
+
*/
|
|
1174
|
+
declare function getProviderTotalDisputeInProgress(params: {
|
|
1175
|
+
publicClient: PublicClient;
|
|
1176
|
+
providerAddress: Address;
|
|
1177
|
+
tokenAddress: Address;
|
|
1178
|
+
network?: SupportedNetwork;
|
|
1179
|
+
}): Promise<bigint>;
|
|
1164
1180
|
|
|
1165
1181
|
/**
|
|
1166
1182
|
* IATPSettlementLayer operations
|
|
@@ -1436,4 +1452,4 @@ declare class UnsupportedNetworkError extends PaymentError {
|
|
|
1436
1452
|
constructor(network: string);
|
|
1437
1453
|
}
|
|
1438
1454
|
|
|
1439
|
-
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, validateConsumerSignature, withdrawAllAvailableEpochs, withdrawAllFromSettlement };
|
|
1455
|
+
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, getProviderTotalDisputeInProgress, getUnlockedBalanceForProvider, getUsdcAddress, getWalletEIP712Domain, getWalletInfo, getWalletsByOwner, getWithdrawalRequest, initMcpSession, isValidAddress, normalizeAddress, parseAllPaymentRequirements, parseMcpResponse, parseMoney, parsePaymentRequirement, requestWithdrawal, selectPaymentRequirement, signD402Payment, sortPaymentRequirements, usdToUsdc, validateConsumerSignature, withdrawAllAvailableEpochs, withdrawAllFromSettlement };
|
package/dist/index.js
CHANGED
|
@@ -11071,6 +11071,20 @@ async function getUnlockedBalanceForProvider(params) {
|
|
|
11071
11071
|
});
|
|
11072
11072
|
return balance;
|
|
11073
11073
|
}
|
|
11074
|
+
async function getProviderTotalDisputeInProgress(params) {
|
|
11075
|
+
const { publicClient, providerAddress, tokenAddress, network = "sepolia" } = params;
|
|
11076
|
+
const settlementConfig = getContractConfig("IATPSettlementLayer" /* IATP_SETTLEMENT_LAYER */, network);
|
|
11077
|
+
if (!settlementConfig) {
|
|
11078
|
+
throw new Error(`IATPSettlementLayer contract not found for network: ${network}`);
|
|
11079
|
+
}
|
|
11080
|
+
const amount = await publicClient.readContract({
|
|
11081
|
+
address: settlementConfig.address,
|
|
11082
|
+
abi: settlementConfig.abi,
|
|
11083
|
+
functionName: "providerTotalDisputeInProgress",
|
|
11084
|
+
args: [providerAddress, tokenAddress]
|
|
11085
|
+
});
|
|
11086
|
+
return amount;
|
|
11087
|
+
}
|
|
11074
11088
|
|
|
11075
11089
|
// src/settlement/operations.ts
|
|
11076
11090
|
async function withdrawAllAvailableEpochs(params) {
|
|
@@ -11136,6 +11150,7 @@ exports.getContractAddress = getContractAddress;
|
|
|
11136
11150
|
exports.getContractConfig = getContractConfig;
|
|
11137
11151
|
exports.getCurrentTimestamp = getCurrentTimestamp;
|
|
11138
11152
|
exports.getLockedBalanceForProvider = getLockedBalanceForProvider;
|
|
11153
|
+
exports.getProviderTotalDisputeInProgress = getProviderTotalDisputeInProgress;
|
|
11139
11154
|
exports.getUnlockedBalanceForProvider = getUnlockedBalanceForProvider;
|
|
11140
11155
|
exports.getUsdcAddress = getUsdcAddress;
|
|
11141
11156
|
exports.getWalletEIP712Domain = getWalletEIP712Domain;
|