@dcentralab/d402-client 0.2.4 → 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 +6 -10
- package/dist/index.d.ts +6 -10
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -969,8 +969,7 @@ 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.
|
|
973
|
-
* @param params.providerAddress - Provider (utility agent) address
|
|
972
|
+
* @param params.providerAddress - Provider (utility agent) IATPWallet address
|
|
974
973
|
* @param params.tokenAddress - Token contract address
|
|
975
974
|
* @param params.network - Network (default: "sepolia")
|
|
976
975
|
* @returns Locked balance in base units (wei)
|
|
@@ -981,9 +980,9 @@ declare function getAvailableBalance(params: {
|
|
|
981
980
|
*
|
|
982
981
|
* const locked = await getLockedBalanceForProvider({
|
|
983
982
|
* publicClient,
|
|
984
|
-
*
|
|
985
|
-
* providerAddress: '0xUtilityAgent...',
|
|
983
|
+
* providerAddress: '0xUtilityAgentWallet...',
|
|
986
984
|
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
985
|
+
* network: 'sepolia'
|
|
987
986
|
* })
|
|
988
987
|
*
|
|
989
988
|
* console.log('Locked balance:', locked)
|
|
@@ -991,7 +990,6 @@ declare function getAvailableBalance(params: {
|
|
|
991
990
|
*/
|
|
992
991
|
declare function getLockedBalanceForProvider(params: {
|
|
993
992
|
publicClient: PublicClient;
|
|
994
|
-
settlementLayerAddress: Address;
|
|
995
993
|
providerAddress: Address;
|
|
996
994
|
tokenAddress: Address;
|
|
997
995
|
network?: 'sepolia';
|
|
@@ -1004,8 +1002,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1004
1002
|
*
|
|
1005
1003
|
* @param params - Query parameters
|
|
1006
1004
|
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
1007
|
-
* @param params.
|
|
1008
|
-
* @param params.providerAddress - Provider (utility agent) address
|
|
1005
|
+
* @param params.providerAddress - Provider (utility agent) IATPWallet address
|
|
1009
1006
|
* @param params.tokenAddress - Token contract address
|
|
1010
1007
|
* @param params.network - Network (default: "sepolia")
|
|
1011
1008
|
* @returns Unlocked balance in base units (wei)
|
|
@@ -1016,9 +1013,9 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1016
1013
|
*
|
|
1017
1014
|
* const unlocked = await getUnlockedBalanceForProvider({
|
|
1018
1015
|
* publicClient,
|
|
1019
|
-
*
|
|
1020
|
-
* providerAddress: '0xUtilityAgent...',
|
|
1016
|
+
* providerAddress: '0xUtilityAgentWallet...',
|
|
1021
1017
|
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
1018
|
+
* network: 'sepolia'
|
|
1022
1019
|
* })
|
|
1023
1020
|
*
|
|
1024
1021
|
* console.log('Unlocked balance:', unlocked)
|
|
@@ -1026,7 +1023,6 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1026
1023
|
*/
|
|
1027
1024
|
declare function getUnlockedBalanceForProvider(params: {
|
|
1028
1025
|
publicClient: PublicClient;
|
|
1029
|
-
settlementLayerAddress: Address;
|
|
1030
1026
|
providerAddress: Address;
|
|
1031
1027
|
tokenAddress: Address;
|
|
1032
1028
|
network?: 'sepolia';
|
package/dist/index.d.ts
CHANGED
|
@@ -969,8 +969,7 @@ 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.
|
|
973
|
-
* @param params.providerAddress - Provider (utility agent) address
|
|
972
|
+
* @param params.providerAddress - Provider (utility agent) IATPWallet address
|
|
974
973
|
* @param params.tokenAddress - Token contract address
|
|
975
974
|
* @param params.network - Network (default: "sepolia")
|
|
976
975
|
* @returns Locked balance in base units (wei)
|
|
@@ -981,9 +980,9 @@ declare function getAvailableBalance(params: {
|
|
|
981
980
|
*
|
|
982
981
|
* const locked = await getLockedBalanceForProvider({
|
|
983
982
|
* publicClient,
|
|
984
|
-
*
|
|
985
|
-
* providerAddress: '0xUtilityAgent...',
|
|
983
|
+
* providerAddress: '0xUtilityAgentWallet...',
|
|
986
984
|
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
985
|
+
* network: 'sepolia'
|
|
987
986
|
* })
|
|
988
987
|
*
|
|
989
988
|
* console.log('Locked balance:', locked)
|
|
@@ -991,7 +990,6 @@ declare function getAvailableBalance(params: {
|
|
|
991
990
|
*/
|
|
992
991
|
declare function getLockedBalanceForProvider(params: {
|
|
993
992
|
publicClient: PublicClient;
|
|
994
|
-
settlementLayerAddress: Address;
|
|
995
993
|
providerAddress: Address;
|
|
996
994
|
tokenAddress: Address;
|
|
997
995
|
network?: 'sepolia';
|
|
@@ -1004,8 +1002,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1004
1002
|
*
|
|
1005
1003
|
* @param params - Query parameters
|
|
1006
1004
|
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
1007
|
-
* @param params.
|
|
1008
|
-
* @param params.providerAddress - Provider (utility agent) address
|
|
1005
|
+
* @param params.providerAddress - Provider (utility agent) IATPWallet address
|
|
1009
1006
|
* @param params.tokenAddress - Token contract address
|
|
1010
1007
|
* @param params.network - Network (default: "sepolia")
|
|
1011
1008
|
* @returns Unlocked balance in base units (wei)
|
|
@@ -1016,9 +1013,9 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1016
1013
|
*
|
|
1017
1014
|
* const unlocked = await getUnlockedBalanceForProvider({
|
|
1018
1015
|
* publicClient,
|
|
1019
|
-
*
|
|
1020
|
-
* providerAddress: '0xUtilityAgent...',
|
|
1016
|
+
* providerAddress: '0xUtilityAgentWallet...',
|
|
1021
1017
|
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
1018
|
+
* network: 'sepolia'
|
|
1022
1019
|
* })
|
|
1023
1020
|
*
|
|
1024
1021
|
* console.log('Unlocked balance:', unlocked)
|
|
@@ -1026,7 +1023,6 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1026
1023
|
*/
|
|
1027
1024
|
declare function getUnlockedBalanceForProvider(params: {
|
|
1028
1025
|
publicClient: PublicClient;
|
|
1029
|
-
settlementLayerAddress: Address;
|
|
1030
1026
|
providerAddress: Address;
|
|
1031
1027
|
tokenAddress: Address;
|
|
1032
1028
|
network?: 'sepolia';
|
package/dist/index.js
CHANGED
|
@@ -5234,13 +5234,13 @@ init_constants();
|
|
|
5234
5234
|
|
|
5235
5235
|
// src/settlement.ts
|
|
5236
5236
|
async function getLockedBalanceForProvider(params) {
|
|
5237
|
-
const { publicClient,
|
|
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:
|
|
5243
|
+
address: settlementConfig.address,
|
|
5244
5244
|
abi: settlementConfig.abi,
|
|
5245
5245
|
functionName: "getLockedBalanceForProvider",
|
|
5246
5246
|
args: [providerAddress, tokenAddress]
|
|
@@ -5248,13 +5248,13 @@ async function getLockedBalanceForProvider(params) {
|
|
|
5248
5248
|
return balance;
|
|
5249
5249
|
}
|
|
5250
5250
|
async function getUnlockedBalanceForProvider(params) {
|
|
5251
|
-
const { publicClient,
|
|
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:
|
|
5257
|
+
address: settlementConfig.address,
|
|
5258
5258
|
abi: settlementConfig.abi,
|
|
5259
5259
|
functionName: "getUnlockedBalanceForProvider",
|
|
5260
5260
|
args: [providerAddress, tokenAddress]
|