@fairblock/stabletrust 1.0.10 → 1.0.11
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/complete-flow.js +11 -0
- package/package.json +1 -1
- package/src/client.js +2 -5
|
@@ -168,6 +168,17 @@ async function main() {
|
|
|
168
168
|
const withdrawRes = await trackPerformance("WITHDRAW_TOKENS", () =>
|
|
169
169
|
client.withdraw(recipient, TOKEN_ADDRESS, withdrawAmount),
|
|
170
170
|
);
|
|
171
|
+
let recipientConfidentialBalanceBeforeWithdraw =
|
|
172
|
+
await client.getConfidentialBalance(
|
|
173
|
+
recipient.address,
|
|
174
|
+
recipientKeys.privateKey,
|
|
175
|
+
TOKEN_ADDRESS,
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
console.log(
|
|
179
|
+
"Recipient Confidential Balance (Pre-Withdraw):",
|
|
180
|
+
ethers.formatUnits(recipientConfidentialBalanceBeforeWithdraw.amount, 2),
|
|
181
|
+
);
|
|
171
182
|
const withdrawHash = withdrawRes.result.hash;
|
|
172
183
|
console.log(`Transaction Hash: ${withdrawHash}`);
|
|
173
184
|
console.log(`View Transaction: ${EXPLORER_URL}${withdrawHash}`);
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -880,11 +880,8 @@ export class ConfidentialTransferClient {
|
|
|
880
880
|
* @private
|
|
881
881
|
*/
|
|
882
882
|
async _waitForGlobalState(address, actionLabel) {
|
|
883
|
-
// Initial cooldown to allow the relayer/indexer to pick up the transaction
|
|
884
|
-
await sleep(10000);
|
|
885
|
-
|
|
886
883
|
let attempts = 0;
|
|
887
|
-
const maxAttempts =
|
|
884
|
+
const maxAttempts = 300;
|
|
888
885
|
|
|
889
886
|
while (attempts < maxAttempts) {
|
|
890
887
|
try {
|
|
@@ -899,7 +896,7 @@ export class ConfidentialTransferClient {
|
|
|
899
896
|
);
|
|
900
897
|
}
|
|
901
898
|
|
|
902
|
-
await sleep(
|
|
899
|
+
await sleep(200);
|
|
903
900
|
attempts++;
|
|
904
901
|
}
|
|
905
902
|
|