A TypeScript-based tool for interacting with the Celestia blockchain using the CosmJS library.
- Reads mnemonic phrases from a
data/mnemonic.txt
; - Waits for a specified genesis timestamp before proceeding;
- Waits the positive balances of wallets;
- Sends transactions from donors to recipients;
- Prints the new balances of wallets again.
This script is capable of bundling multiple messages into a single transaction, allowing you to send tokens from one wallet to multiple different wallets in one action.
To utilize this feature, simply create a new line in data/mnemonic.txt
with the same sender (donor mnemonic), but a new recipient and a new amount of tokens.
The RPC_ENDPOINT
and EXPLORER_TX_PATH
values provided in the src/config.js
file are set for the testnet. It's imperative that every user of this script specifies their own values for these configurations.
-
RPC Endpoint: If everyone uses the same RPC endpoint, it will likely become overloaded and fail, resulting in unsuccessful transactions. Moreover, as of now, there are no publicly available mainnet RPC endpoints since the mainnet has not been launched yet. The functionality of this script heavily relies on the RPC endpoint, hence ensure to provide a reliable and unique endpoint for your use.
-
Explorer Transaction Path: Similar to the RPC endpoint, ensure to set the
EXPLORER_TX_PATH
to a suitable value based on your network (testnet/mainnet).
Please treat these configurations with utmost attention to ensure the proper functionality of the script.
Ensure you have Node.js v20.5.1 or newer installed on your machine, then follow these steps:
-
Clone the repository:
git clone https://github.com/cyberomanov/celestia-transfer.git cd celestia-transfer/
-
Install the dependencies (
@cosmjs/proto-signing: ^0.31.1
,@cosmjs/stargate: ^0.31.1
):npm install
-
Install TypeScript globally (if you haven't already):
npm install -g typescript
-
Prepare your
data/mnemonic.txt
file with the mnemonic phrases or private keys, recipients and amount to transfer (you can use the same mnemonic with several unique recipients).
Important: A memo is required for depositing funds on certain centralized exchanges. However, if you don't wish to specify a memo, ensure that the string ends withamount_to_transfer
.
Important: To send the entire balance without specifying a specific amount, setamount_to_transfer
to-1
.word1 word2 ... word12##celestia_recipient1##amount_to_transfer1##memo1 word1 word2 ... word12##celestia_recipient2##amount_to_transfer2 word13 word14 ... word24##celestia_recipient3##-1##memo2 word25 word26 ... word36##celestia_recipient4##-1 private_key1##celestia_recipient5##-1##memo3 private_key2##celestia_recipient6##amount_to_transfer1
-
Update the
src/config.js
file to set the RPC endpoint, gas multiplier, and other settings (carefully change the url from testnet to mainnet):export const RPC_ENDPOINT = "https://celestia-testnet-rpc.polkachu.com" export const GAS_MULTIPLIER = 1.5 export const EXPLORER_TX_PATH = "https://celestia.explorers.guru/transaction" export const GENESIS_TIMESTAMP = 1698764400000 export const DEFAULT_ADDRESS_PREFIX = "celestia" export const DEFAULT_TOKEN_PREFIX = "utia" export const DEFAULT_DENOMINATION = 1_000_000
-
Compile TypeScript to JavaScript:
tsc
-
Run the generated JavaScript file:
node build/index.js
Get results:
[20:49:49.492] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 10s left. [20:49:50.491] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 9s left. [20:49:51.492] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 8s left. [20:49:52.494] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 7s left. [20:49:53.496] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 6s left. [20:49:54.496] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 5s left. [20:49:55.497] genesis time is in the future. sleeping until then... 10/23/2023 8:50:00 PM | 0h 0m 4s left. /////// BALANCE /////// [20:49:55.893] celestia1l9r5ca9cc82fvv90qtyvlwr2vm2lq4cry6m9kq: 10 $TIA | 0.2 $TIA to celestia14470mugpq9dl0dhc4vzqu8q9mn44ka2n9t5g2m. /////// TRANSFER /////// [20:49:56.524] celestia1l9r5ca9cc82fvv90qtyvlwr2vm2lq4cry6m9kq -> 0.2 $TIA | fee: 0.1081 $TIA | https://celestia.explorers.guru/transaction/A4044EC99E9B312BDEFC32E466C0621FD014027B7D8D84826EBC37CD9443A52C [20:49:56.525] sleep 30 sec. /////// BALANCE /////// [20:50:26.905] celestia1l9r5ca9cc82fvv90qtyvlwr2vm2lq4cry6m9kq: 9.6919 $TIA | 0.2 $TIA to celestia14470mugpq9dl0dhc4vzqu8q9mn44ka2n9t5g2m. [20:50:26.905] celestia14470mugpq9dl0dhc4vzqu8q9mn44ka2n9t5g2m: 9.8516 $TIA. with love by @cyberomanov.
If you'd like to contribute to this project, please fork the repository and submit a pull request.
Telegram: @cyberomanov