@fairblock/stabletrust 1.0.8 → 1.0.9
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/examples/simple-snippets.js +1 -2
- package/package.json +1 -1
- package/src/client.js +1 -1
- package/src/index.d.ts +7 -0
|
@@ -2,8 +2,7 @@ import { ethers } from "ethers";
|
|
|
2
2
|
import dotenv from "dotenv";
|
|
3
3
|
import { ConfidentialTransferClient } from "@fairblock/stabletrust";
|
|
4
4
|
dotenv.config();
|
|
5
|
-
const RPC_URL =
|
|
6
|
-
process.env.ETHEREUM_RPC_URL || "https://rpc.testnet.stable.xyz";
|
|
5
|
+
const RPC_URL = process.env.RPC_URL || "https://rpc.testnet.stable.xyz";
|
|
7
6
|
const EXPLORER_URL =
|
|
8
7
|
process.env.EXPLORER_URL || "https://testnet.stablescan.xyz/tx/";
|
|
9
8
|
async function minimalFlow() {
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -948,7 +948,7 @@ export class ConfidentialTransferClient {
|
|
|
948
948
|
* @param {string} tokenAddress - Token address
|
|
949
949
|
* @returns {Promise<bigint>} Token balance
|
|
950
950
|
*/
|
|
951
|
-
async
|
|
951
|
+
async getPublicBalance(address, tokenAddress) {
|
|
952
952
|
try {
|
|
953
953
|
if (!address || !ethers.isAddress(address)) {
|
|
954
954
|
throw new Error(`Invalid address: ${address}`);
|
package/src/index.d.ts
CHANGED
|
@@ -153,6 +153,13 @@ declare module "@fairblock/stabletrust" {
|
|
|
153
153
|
* Get the current fee amount for confidential transfers
|
|
154
154
|
*/
|
|
155
155
|
getFeeAmount(): Promise<bigint>;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get the public ERC20 balance for an address (for comparison with confidential balance)
|
|
159
|
+
* @param address Account address
|
|
160
|
+
* @param tokenAddress Token contract address
|
|
161
|
+
*/
|
|
162
|
+
getPublicBalance(address: string, tokenAddress: string): Promise<bigint>;
|
|
156
163
|
}
|
|
157
164
|
|
|
158
165
|
/**
|