Skip to content

NEED HELP: DelegateResource method add to the Library. #193

Open
@maksus

Description

@maksus

I have tried to add method from Tron FullNode HTTP API 'DelegateResource' to be able to send ENERGY and BANDWIDTH from Staking2.0 to another address (https://developers.tron.network/reference/delegateresource-1).
But Library doesn't catch it up.

Can anyone please help me (ready to pay for the help)?

Code I am trying to add to 'TransactionBuilder.php' file in 'src' directory:

public function DelegateEnergy(float $amount, string $resource, string $address, string $toaddress) {
return $this->tron->getManager()->request('wallet/delegateresource', [
'owner_address' => $this->tron->address2HexString($address),
'receiver_address' => $this->tron->address2HexString($toaddress),
'balance' => $this->tron->toTron($amount),
'resource' => $resource,
'lock' => false,
'visible' => true
]);
}

Code I am calling the method:

 $raw_tx = $tron->tron->DelegateEnergy('1000', 'ENERGY', 'from_address', 'destination_address');

ERROR I get - "Fatal error: Uncaught Error: Call to a member function DelegateEnergy() on null in".

My Method doesn't show when checking the TRON Class's method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions