-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a h160-to-ss58 converter script
- Loading branch information
Watchmaker
committed
Oct 16, 2024
1 parent
0c137bb
commit 6de223f
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { ethers } = require('ethers'); | ||
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api'); | ||
const { convertH160ToSS58 } = require('./address-mapping.js'); | ||
|
||
// PROTECT YOUR PRIVATE KEYS WELL, NEVER COMMIT THEM TO GITHUB OR SHARE WITH ANYONE | ||
const { ethPrivateKey, subSeed, rpcUrl, wsUrl } = require('./config.js'); | ||
|
||
async function main() { | ||
// Get ethereum address that matches the private key from the secrets file | ||
// const recipientEthereumAddress = "put your destination address here"; | ||
// const recipientEthereumAddress = "0x709615c655B24919F48B365D292521EFcC74467B"; | ||
const recipientEthereumAddress = "0xd685a847471F7f07Ce36f89F99C198B098B13817"; | ||
const ss58Address = convertH160ToSS58(recipientEthereumAddress); | ||
console.log(`For your Ethereum H160 address: ${recipientEthereumAddress}, the SS58 address is: ${ss58Address}`); | ||
process.exit(0); | ||
} | ||
|
||
main().catch(console.error); | ||
console.warn = () => {}; |