Create account with threshold key
Description: This PR introduces an example for creating an account with a threshold key in the Hedera JavaScript SDK, which mirrors the existing example in the Hedera Java SDK.
Problem The Hedera Java SDK already includes an example (CreateAccountThresholdKeyExample.java) that demonstrates how to create an account with a threshold key. This feature is essential for ensuring security by requiring multiple signatures to authorize transactions.
However, there is currently no such example in the Hedera JavaScript SDK. Developers using the JavaScript SDK would greatly benefit from a similar example to guide them through creating accounts with threshold keys in JavaScript, as it's a crucial security feature.
Solution
This PR provides a new example in the JavaScript SDK that follows the structure of the existing Java example. Key steps include:
- Generating key pairs using PrivateKey.generateED25519().
- Initializing a KeyList with a threshold and adding public keys to create the threshold key.
- Creating an account using the threshold key.
- Demonstrating a transaction that requires multiple signatures from the threshold key.
- Cleaning up by deleting the account, again requiring multi-signatures.
Related issue(s):
Fixes #2511
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 84.46%. Comparing base (
734aa62) to head (740d567). Report is 16 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #2579 +/- ##
==========================================
+ Coverage 84.43% 84.46% +0.02%
==========================================
Files 283 283
Lines 71038 71088 +50
==========================================
+ Hits 59981 60044 +63
+ Misses 11057 11044 -13
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@ivaylogarnev-limechain updated file used Logger and Loglevel from @hashgraph/sdk instead of javascript
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
@agadzhalov @rwalworth
@rwalworth please approve
for this PR some checks failed: Build & Test / Test using Node 16 (pull_request) codecov/project please advice @ivaylogarnev-limechain
for this PR some checks failed: Build & Test / Test using Node 16 (pull_request) codecov/project please advice @ivaylogarnev-limechain
Which pull request are you referring to? The current one looks good.
its okay now before it was showing some checks didn't pass thank you for reaching out. I appreciate it @ivaylogarnev-limechain