-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update sendBTC.ts #226
base: main
Are you sure you want to change the base?
Update sendBTC.ts #226
Conversation
chore: changed PRIVATE_KEY to BTC_PRIVATE_KEY and the CLI command to "btc-deposit-and-call"
📝 WalkthroughWalkthroughThis change updates the Bitcoin deposit task in Changes
Possibly related PRs
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/tasks/src/sendBTC.ts (1)
49-49
: Consider making the transaction fee configurable.The transaction fee is currently hardcoded to 10000 satoshis. Consider making this configurable to handle network congestion and priority requirements.
+ .addOptionalParam("fee", "Transaction fee in satoshis", "10000")
Then update the fee calculation:
- const fee = 10000; + const fee = parseInt(args.fee);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/tasks/src/sendBTC.ts
(2 hunks)
🔇 Additional comments (2)
packages/tasks/src/sendBTC.ts (2)
170-172
:❓ Verification inconclusive
LGTM! The task name is now more descriptive, but note this is a breaking change.
The new name
"btc-deposit-and-call"
better reflects that this task not only sends BTC but also interacts with contracts on ZetaChain. However, this is a breaking change that could affect existing scripts.Let's check for any references to the old task name that might need updating:
🏁 Script executed:
#!/bin/bash # Search for references to the old task name rg -i "send-btc"Length of output: 16
Heads-up: Task Name Change is Breaking – Manual Verification Recommended
LGTM! The new task name
"btc-deposit-and-call"
now clearly indicates that the task encompasses both BTC deposits and contract interactions on ZetaChain. Note that this renaming is a breaking change, so please ensure all integrations (scripts, documentation, etc.) referencing the old task name"send-btc"
are updated accordingly.
- Action Item: Although our automated search for
"send-btc"
produced no matches, please perform a manual verification to guarantee that no lingering references exist in the codebase or external documentation.
105-110
:✅ Verification successful
LGTM! The environment variable change improves clarity.
The change from
PRIVATE_KEY
toBTC_PRIVATE_KEY
better reflects its specific purpose and aligns with the Hardhat-generated.env
file structure.Let's verify that this is the only occurrence of
PRIVATE_KEY
that needs to be updated for Bitcoin transactions:
🏁 Script executed:
#!/bin/bash # Search for any remaining instances of PRIVATE_KEY that might need updating rg -i "private_key" --type tsLength of output: 1601
LGTM! Environment variable update in
packages/tasks/src/sendBTC.ts
is correct.The change—switching from
PRIVATE_KEY
toBTC_PRIVATE_KEY
and updating the error message—is properly implemented for Bitcoin transactions. Our repository search confirms that for BTC-related functionality, the dedicated variable is now used insendBTC.ts
and also correctly set inpackages/tasks/src/account.ts
and referenced inpackages/tasks/src/balances.ts
. (Other instances ofPRIVATE_KEY
found in files likesendZETA.ts
andfaucet.ts
appear to be intended for non-BTC use.)Please verify that these remaining
PRIVATE_KEY
references are intentional for their respective chains.
I've made to changes!
chore: changed PRIVATE_KEY to BTC_PRIVATE_KEY
chore: CLI command from "send-btc" to "btc-deposit-and-call"
After use this cli npx hardhat account --save it will create the .env on vercel, with 4 fields...
PRIVATE_KEY,EVM_PRIVATE_KEY,BTC_PRIVATE_KEY,SOLANA_PRIVATE_KEY
Since Hardhat already creates a dedicated BTC_PRIVATE_KEY variable, it makes sense to use it instead of relying on PRIVATE_KEY for Bitcoin. This change ensures that the correct private key is used when interacting with the Bitcoin network.
This is especially useful for users who have a different private key for Bitcoin, as is my case.
Summary by CodeRabbit