mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-22 20:45:53 +00:00
Add Tron (TRC20/TRX) send/transfer support
Reuses the existing generic fee-sufficiency validation (sufficientTransferableBalanceToPayOriginFee) and send flow unchanged. Transaction construction goes through TronGrid's own createtransaction/triggersmartcontract endpoints (verified live against Shasta testnet) rather than a hand-rolled protobuf implementation; signing reuses the existing secp256k1 path (SignerPayloadRaw.skipMessageHashing) already used for Ethereum, no new crypto library. Also fixes a Phase 1 gap: Chain.isValidAddress() had no isTronBased branch, so every Tron send would have failed address validation. No Energy staking/delegation/rental UI - only Tron's default protocol behavior (burn TRX to cover Bandwidth/Energy shortfall).
This commit is contained in:
+13
@@ -63,6 +63,19 @@ class SubstrateFee(
|
||||
override val asset: Chain.Asset
|
||||
) : Fee
|
||||
|
||||
/**
|
||||
* Fee for a Tron transaction (native TRX or TRC-20), always denominated in TRX (sun), regardless of which asset
|
||||
* is being sent - Tron has no separate "gas token" concept, network resources (bandwidth/energy) are always
|
||||
* burned as TRX. [amount] is this client's own estimate of that burn (see `RealTronTransactionService`); the
|
||||
* network only ever burns what it actually uses, so the real cost can be lower, but never higher than what this
|
||||
* client authorized via `fee_limit` when submitting.
|
||||
*/
|
||||
class TronFee(
|
||||
override val amount: BigInteger,
|
||||
override val submissionOrigin: SubmissionOrigin,
|
||||
override val asset: Chain.Asset
|
||||
) : Fee
|
||||
|
||||
class SubstrateFeeBase(
|
||||
override val amount: BigInteger,
|
||||
override val asset: Chain.Asset
|
||||
|
||||
Reference in New Issue
Block a user