Skip to content

Hovsteder/tron-energy-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

TRON Energy Rental — GitHub Action

Rent TRON Energy from PowerSun.vip before deploying smart contracts or sending transactions. Save 20-50% vs burning TRX.

Usage

- name: Rent Energy for deployment
  uses: Hovsteder/tron-energy-action@v1
  with:
    target-address: ${{ secrets.DEPLOYER_ADDRESS }}
    tx-count: '10'
    duration: '30'
    api-key: ${{ secrets.POWERSUN_API_KEY }}

Full Example — Smart Contract Deployment

name: Deploy Contract
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Estimate energy cost
        id: estimate
        uses: Hovsteder/tron-energy-action@v1
        with:
          target-address: ${{ secrets.DEPLOYER_ADDRESS }}
          tx-count: '1'
          tx-type: 'contract_call'
          duration: '30'
          api-key: ${{ secrets.POWERSUN_API_KEY }}
          estimate-only: 'true'

      - name: Show estimate
        run: |
          echo "Energy: ${{ steps.estimate.outputs.energy-amount }}"
          echo "Cost: ${{ steps.estimate.outputs.cost-trx }} TRX"
          echo "Savings: ${{ steps.estimate.outputs.savings-percent }}%"

      - name: Rent energy
        id: energy
        uses: Hovsteder/tron-energy-action@v1
        with:
          target-address: ${{ secrets.DEPLOYER_ADDRESS }}
          tx-count: '1'
          tx-type: 'contract_call'
          duration: '30'
          api-key: ${{ secrets.POWERSUN_API_KEY }}
          max-price-trx: '50'

      - name: Deploy contract
        run: npx tronbox migrate --network mainnet
        env:
          PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }}

Inputs

Input Required Default Description
target-address Yes TRON address to delegate energy to
tx-count No 1 Number of transactions
tx-type No trc20_transfer Transaction type
duration No 30 Duration in minutes (5-10080)
api-key Yes PowerSun API key (ps_*)
max-price-trx No Max acceptable price in TRX
estimate-only No false Only estimate, don't buy

Outputs

Output Description
order-id Order UUID
status Order status
cost-trx Total cost in TRX
energy-amount Energy amount rented
savings-percent Savings vs TRX burn (%)

Getting an API Key

  1. Visit powersun.vip
  2. Connect your TRON wallet
  3. Copy your API key from the dashboard
  4. Add it as a GitHub Secret: POWERSUN_API_KEY

Links

License

MIT

About

Rent TRON Energy in GitHub Actions CI/CD. Save 20-50% on TRX fees. Powered by PowerSun.vip

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors