This script automates the process of sending a power up transaction on the WAX POWER UP Mechanism every 24 hours and 59 minutes using Node.js and the @wharfkit/session
package.
- Node.js installed on your machine.
- A WAX account.
- Private key associated with your WAX account.
- The following npm packages:
@wharfkit/session
@wharfkit/wallet-plugin-privatekey
node-cron
-
Clone this repository or download the script file.
-
Open a terminal and navigate to the directory containing the script.
-
Install the required packages by running:
npm install @wharfkit/session @wharfkit/wallet-plugin-privatekey node-cron
-
Open the script file and replace the placeholders with your actual data:
// Replace with your actual WAX wallet address const accountName = 'WAX_WALLET_ADDRESS'; // Replace with the permission name, typically 'active' or 'owner' const permissionName = 'PERMISSION_NAME'; // Replace with your actual private key const privateKey = 'PRIVATE_KEY'; // Replace with the appropriate CPU fraction needed for the power up const cpuFrac = 66732210668; // Replace with the maximum payment amount you are willing to transfer const maxPayment = '1.98312389 WAX'; // Replace with the payer's wallet address const payerAddress = 'PAYER_ADDRESS'; // Replace with the receiver's wallet address const receiverAddress = 'RECEIVER_ADDRESS';
-
Save the changes to the script file.
-
Run the script by executing:
node script.js
- WAX Mainnet Chain ID: The script is configured to interact with the WAX Mainnet.
- Endpoint: The endpoint used is
https://wax.greymass.com
.
cpu_frac: 22021630 days: 1 max_payment: 0.00175947 WAX COST: 0.00117296 STAKED_WAXP: 1