@dcentralab/d402-client 0.2.3 → 0.2.4
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 -0
- package/dist/index.d.ts +6 -0
- 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
|
@@ -971,6 +971,7 @@ declare function getAvailableBalance(params: {
|
|
|
971
971
|
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
972
972
|
* @param params.settlementLayerAddress - IATPSettlementLayer contract address
|
|
973
973
|
* @param params.providerAddress - Provider (utility agent) address
|
|
974
|
+
* @param params.tokenAddress - Token contract address
|
|
974
975
|
* @param params.network - Network (default: "sepolia")
|
|
975
976
|
* @returns Locked balance in base units (wei)
|
|
976
977
|
*
|
|
@@ -982,6 +983,7 @@ declare function getAvailableBalance(params: {
|
|
|
982
983
|
* publicClient,
|
|
983
984
|
* settlementLayerAddress: '0x...',
|
|
984
985
|
* providerAddress: '0xUtilityAgent...',
|
|
986
|
+
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
985
987
|
* })
|
|
986
988
|
*
|
|
987
989
|
* console.log('Locked balance:', locked)
|
|
@@ -991,6 +993,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
991
993
|
publicClient: PublicClient;
|
|
992
994
|
settlementLayerAddress: Address;
|
|
993
995
|
providerAddress: Address;
|
|
996
|
+
tokenAddress: Address;
|
|
994
997
|
network?: 'sepolia';
|
|
995
998
|
}): Promise<bigint>;
|
|
996
999
|
/**
|
|
@@ -1003,6 +1006,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1003
1006
|
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
1004
1007
|
* @param params.settlementLayerAddress - IATPSettlementLayer contract address
|
|
1005
1008
|
* @param params.providerAddress - Provider (utility agent) address
|
|
1009
|
+
* @param params.tokenAddress - Token contract address
|
|
1006
1010
|
* @param params.network - Network (default: "sepolia")
|
|
1007
1011
|
* @returns Unlocked balance in base units (wei)
|
|
1008
1012
|
*
|
|
@@ -1014,6 +1018,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1014
1018
|
* publicClient,
|
|
1015
1019
|
* settlementLayerAddress: '0x...',
|
|
1016
1020
|
* providerAddress: '0xUtilityAgent...',
|
|
1021
|
+
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
1017
1022
|
* })
|
|
1018
1023
|
*
|
|
1019
1024
|
* console.log('Unlocked balance:', unlocked)
|
|
@@ -1023,6 +1028,7 @@ declare function getUnlockedBalanceForProvider(params: {
|
|
|
1023
1028
|
publicClient: PublicClient;
|
|
1024
1029
|
settlementLayerAddress: Address;
|
|
1025
1030
|
providerAddress: Address;
|
|
1031
|
+
tokenAddress: Address;
|
|
1026
1032
|
network?: 'sepolia';
|
|
1027
1033
|
}): Promise<bigint>;
|
|
1028
1034
|
|
package/dist/index.d.ts
CHANGED
|
@@ -971,6 +971,7 @@ declare function getAvailableBalance(params: {
|
|
|
971
971
|
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
972
972
|
* @param params.settlementLayerAddress - IATPSettlementLayer contract address
|
|
973
973
|
* @param params.providerAddress - Provider (utility agent) address
|
|
974
|
+
* @param params.tokenAddress - Token contract address
|
|
974
975
|
* @param params.network - Network (default: "sepolia")
|
|
975
976
|
* @returns Locked balance in base units (wei)
|
|
976
977
|
*
|
|
@@ -982,6 +983,7 @@ declare function getAvailableBalance(params: {
|
|
|
982
983
|
* publicClient,
|
|
983
984
|
* settlementLayerAddress: '0x...',
|
|
984
985
|
* providerAddress: '0xUtilityAgent...',
|
|
986
|
+
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
985
987
|
* })
|
|
986
988
|
*
|
|
987
989
|
* console.log('Locked balance:', locked)
|
|
@@ -991,6 +993,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
991
993
|
publicClient: PublicClient;
|
|
992
994
|
settlementLayerAddress: Address;
|
|
993
995
|
providerAddress: Address;
|
|
996
|
+
tokenAddress: Address;
|
|
994
997
|
network?: 'sepolia';
|
|
995
998
|
}): Promise<bigint>;
|
|
996
999
|
/**
|
|
@@ -1003,6 +1006,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1003
1006
|
* @param params.publicClient - Viem PublicClient (from wagmi usePublicClient)
|
|
1004
1007
|
* @param params.settlementLayerAddress - IATPSettlementLayer contract address
|
|
1005
1008
|
* @param params.providerAddress - Provider (utility agent) address
|
|
1009
|
+
* @param params.tokenAddress - Token contract address
|
|
1006
1010
|
* @param params.network - Network (default: "sepolia")
|
|
1007
1011
|
* @returns Unlocked balance in base units (wei)
|
|
1008
1012
|
*
|
|
@@ -1014,6 +1018,7 @@ declare function getLockedBalanceForProvider(params: {
|
|
|
1014
1018
|
* publicClient,
|
|
1015
1019
|
* settlementLayerAddress: '0x...',
|
|
1016
1020
|
* providerAddress: '0xUtilityAgent...',
|
|
1021
|
+
* tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238', // USDC
|
|
1017
1022
|
* })
|
|
1018
1023
|
*
|
|
1019
1024
|
* console.log('Unlocked balance:', unlocked)
|
|
@@ -1023,6 +1028,7 @@ declare function getUnlockedBalanceForProvider(params: {
|
|
|
1023
1028
|
publicClient: PublicClient;
|
|
1024
1029
|
settlementLayerAddress: Address;
|
|
1025
1030
|
providerAddress: Address;
|
|
1031
|
+
tokenAddress: Address;
|
|
1026
1032
|
network?: 'sepolia';
|
|
1027
1033
|
}): Promise<bigint>;
|
|
1028
1034
|
|
package/dist/index.js
CHANGED
|
@@ -5234,7 +5234,7 @@ 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, settlementLayerAddress, 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}`);
|
|
@@ -5243,12 +5243,12 @@ async function getLockedBalanceForProvider(params) {
|
|
|
5243
5243
|
address: settlementLayerAddress,
|
|
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, settlementLayerAddress, 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}`);
|
|
@@ -5257,7 +5257,7 @@ async function getUnlockedBalanceForProvider(params) {
|
|
|
5257
5257
|
address: settlementLayerAddress,
|
|
5258
5258
|
abi: settlementConfig.abi,
|
|
5259
5259
|
functionName: "getUnlockedBalanceForProvider",
|
|
5260
|
-
args: [providerAddress]
|
|
5260
|
+
args: [providerAddress, tokenAddress]
|
|
5261
5261
|
});
|
|
5262
5262
|
return balance;
|
|
5263
5263
|
}
|