Skip to content

Commit

Permalink
feat(CDF-3933): Fix fauced transaction wait
Browse files Browse the repository at this point in the history
  • Loading branch information
jair-rosa-cb committed Oct 31, 2024
1 parent 43ffabd commit 63614f2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
20 changes: 10 additions & 10 deletions quickstart-template/discord_tutorial/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion quickstart-template/discord_tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"description": "",
"type": "module",
"dependencies": {
"@coinbase/coinbase-sdk": "^0.9.1",
"@coinbase/coinbase-sdk": "^0.10.0",
"axios": "^1.7.7",
"body-parser": "^1.20.3",
"dotenv": "^16.4.5",
Expand Down
6 changes: 5 additions & 1 deletion quickstart-template/discord_tutorial/webhook-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ const webhookNotificationUri = process.env.WEBHOOK_NOTIFICATION_URL;
console.log(`💰 Wallet USDC balance:`, balance);
if (balance <= 0) {
// If wallet doesn't have funds we need to add funds to it
await myWallet.faucet(Coinbase.assets.Usdc);
const faucetTx = await myWallet.faucet(Coinbase.assets.Usdc);

// Wait for the faucet transaction to confirm.
await faucetTx.wait();

console.log("✅ Funds added!");

// Sometimes funds take a few seconds to be available on the wallet, so lets wait 5 secs
Expand Down

0 comments on commit 63614f2

Please sign in to comment.