@dcentralab/d402-client 0.2.3 → 0.2.5

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
@@ -969,8 +969,8 @@ declare function getAvailableBalance(params: {
969
969
  *
970
970
  * @param params - Query parameters
971
971
  * @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
972
- * @param params.settlementLayerAddress - IATPSettlementLayer contract address
973
- * @param params.providerAddress - Provider (utility agent) address
972
+ * @param params.providerAddress - Provider (utility agent) IATPWallet address
973
+ * @param params.tokenAddress - Token contract address
974
974
  * @param params.network - Network (default: "sepolia")
975
975
  * @returns Locked balance in base units (wei)
976
976
  *
@@ -980,8 +980,9 @@ declare function getAvailableBalance(params: {
980
980
  *
981
981
  * const locked = await getLockedBalanceForProvider({
982
982
  * publicClient,
983
- * settlementLayerAddress: '0x...',
984
- * providerAddress: '0xUtilityAgent...',
983
+ * providerAddress: '0xUtilityAgentWallet...',
984
+ * tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
985
+ * network: 'sepolia'
985
986
  * })
986
987
  *
987
988
  * console.log('Locked balance:', locked)
@@ -989,8 +990,8 @@ declare function getAvailableBalance(params: {
989
990
  */
990
991
  declare function getLockedBalanceForProvider(params: {
991
992
  publicClient: PublicClient;
992
- settlementLayerAddress: Address;
993
993
  providerAddress: Address;
994
+ tokenAddress: Address;
994
995
  network?: 'sepolia';
995
996
  }): Promise<bigint>;
996
997
  /**
@@ -1001,8 +1002,8 @@ declare function getLockedBalanceForProvider(params: {
1001
1002
  *
1002
1003
  * @param params - Query parameters
1003
1004
  * @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
1004
- * @param params.settlementLayerAddress - IATPSettlementLayer contract address
1005
- * @param params.providerAddress - Provider (utility agent) address
1005
+ * @param params.providerAddress - Provider (utility agent) IATPWallet address
1006
+ * @param params.tokenAddress - Token contract address
1006
1007
  * @param params.network - Network (default: "sepolia")
1007
1008
  * @returns Unlocked balance in base units (wei)
1008
1009
  *
@@ -1012,8 +1013,9 @@ declare function getLockedBalanceForProvider(params: {
1012
1013
  *
1013
1014
  * const unlocked = await getUnlockedBalanceForProvider({
1014
1015
  * publicClient,
1015
- * settlementLayerAddress: '0x...',
1016
- * providerAddress: '0xUtilityAgent...',
1016
+ * providerAddress: '0xUtilityAgentWallet...',
1017
+ * tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
1018
+ * network: 'sepolia'
1017
1019
  * })
1018
1020
  *
1019
1021
  * console.log('Unlocked balance:', unlocked)
@@ -1021,8 +1023,8 @@ declare function getLockedBalanceForProvider(params: {
1021
1023
  */
1022
1024
  declare function getUnlockedBalanceForProvider(params: {
1023
1025
  publicClient: PublicClient;
1024
- settlementLayerAddress: Address;
1025
1026
  providerAddress: Address;
1027
+ tokenAddress: Address;
1026
1028
  network?: 'sepolia';
1027
1029
  }): Promise<bigint>;
1028
1030
 
package/dist/index.d.ts CHANGED
@@ -969,8 +969,8 @@ declare function getAvailableBalance(params: {
969
969
  *
970
970
  * @param params - Query parameters
971
971
  * @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
972
- * @param params.settlementLayerAddress - IATPSettlementLayer contract address
973
- * @param params.providerAddress - Provider (utility agent) address
972
+ * @param params.providerAddress - Provider (utility agent) IATPWallet address
973
+ * @param params.tokenAddress - Token contract address
974
974
  * @param params.network - Network (default: "sepolia")
975
975
  * @returns Locked balance in base units (wei)
976
976
  *
@@ -980,8 +980,9 @@ declare function getAvailableBalance(params: {
980
980
  *
981
981
  * const locked = await getLockedBalanceForProvider({
982
982
  * publicClient,
983
- * settlementLayerAddress: '0x...',
984
- * providerAddress: '0xUtilityAgent...',
983
+ * providerAddress: '0xUtilityAgentWallet...',
984
+ * tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
985
+ * network: 'sepolia'
985
986
  * })
986
987
  *
987
988
  * console.log('Locked balance:', locked)
@@ -989,8 +990,8 @@ declare function getAvailableBalance(params: {
989
990
  */
990
991
  declare function getLockedBalanceForProvider(params: {
991
992
  publicClient: PublicClient;
992
- settlementLayerAddress: Address;
993
993
  providerAddress: Address;
994
+ tokenAddress: Address;
994
995
  network?: 'sepolia';
995
996
  }): Promise<bigint>;
996
997
  /**
@@ -1001,8 +1002,8 @@ declare function getLockedBalanceForProvider(params: {
1001
1002
  *
1002
1003
  * @param params - Query parameters
1003
1004
  * @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
1004
- * @param params.settlementLayerAddress - IATPSettlementLayer contract address
1005
- * @param params.providerAddress - Provider (utility agent) address
1005
+ * @param params.providerAddress - Provider (utility agent) IATPWallet address
1006
+ * @param params.tokenAddress - Token contract address
1006
1007
  * @param params.network - Network (default: "sepolia")
1007
1008
  * @returns Unlocked balance in base units (wei)
1008
1009
  *
@@ -1012,8 +1013,9 @@ declare function getLockedBalanceForProvider(params: {
1012
1013
  *
1013
1014
  * const unlocked = await getUnlockedBalanceForProvider({
1014
1015
  * publicClient,
1015
- * settlementLayerAddress: '0x...',
1016
- * providerAddress: '0xUtilityAgent...',
1016
+ * providerAddress: '0xUtilityAgentWallet...',
1017
+ * tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
1018
+ * network: 'sepolia'
1017
1019
  * })
1018
1020
  *
1019
1021
  * console.log('Unlocked balance:', unlocked)
@@ -1021,8 +1023,8 @@ declare function getLockedBalanceForProvider(params: {
1021
1023
  */
1022
1024
  declare function getUnlockedBalanceForProvider(params: {
1023
1025
  publicClient: PublicClient;
1024
- settlementLayerAddress: Address;
1025
1026
  providerAddress: Address;
1027
+ tokenAddress: Address;
1026
1028
  network?: 'sepolia';
1027
1029
  }): Promise<bigint>;
1028
1030
 
package/dist/index.js CHANGED
@@ -5234,30 +5234,30 @@ init_constants();
5234
5234
 
5235
5235
  // src/settlement.ts
5236
5236
  async function getLockedBalanceForProvider(params) {
5237
- const { publicClient, settlementLayerAddress, providerAddress, network = "sepolia" } = params;
5237
+ const { publicClient, providerAddress, tokenAddress, network = "sepolia" } = params;
5238
5238
  const settlementConfig = getContractConfig("IATPSettlementLayer" /* IATP_SETTLEMENT_LAYER */, network);
5239
5239
  if (!settlementConfig) {
5240
5240
  throw new Error(`IATPSettlementLayer contract not found for network: ${network}`);
5241
5241
  }
5242
5242
  const balance = await publicClient.readContract({
5243
- address: settlementLayerAddress,
5243
+ address: settlementConfig.address,
5244
5244
  abi: settlementConfig.abi,
5245
5245
  functionName: "getLockedBalanceForProvider",
5246
- args: [providerAddress]
5246
+ args: [providerAddress, tokenAddress]
5247
5247
  });
5248
5248
  return balance;
5249
5249
  }
5250
5250
  async function getUnlockedBalanceForProvider(params) {
5251
- const { publicClient, settlementLayerAddress, providerAddress, network = "sepolia" } = params;
5251
+ const { publicClient, providerAddress, tokenAddress, network = "sepolia" } = params;
5252
5252
  const settlementConfig = getContractConfig("IATPSettlementLayer" /* IATP_SETTLEMENT_LAYER */, network);
5253
5253
  if (!settlementConfig) {
5254
5254
  throw new Error(`IATPSettlementLayer contract not found for network: ${network}`);
5255
5255
  }
5256
5256
  const balance = await publicClient.readContract({
5257
- address: settlementLayerAddress,
5257
+ address: settlementConfig.address,
5258
5258
  abi: settlementConfig.abi,
5259
5259
  functionName: "getUnlockedBalanceForProvider",
5260
- args: [providerAddress]
5260
+ args: [providerAddress, tokenAddress]
5261
5261
  });
5262
5262
  return balance;
5263
5263
  }