Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using payment operation with other asset, informing the amout #55

Open
RASTecnoTI opened this issue Jul 28, 2020 · 2 comments
Open

Using payment operation with other asset, informing the amout #55

RASTecnoTI opened this issue Jul 28, 2020 · 2 comments

Comments

@RASTecnoTI
Copy link

Hi

I tested the code and worked very well.

I would like to know if is possibile create one payment using um asset instead XLM (in my case called TREEP) and inform the amout to transfer?
I tested using 04-submit-transaction.php

Like this:

image

Thank you!

@RASTecnoTI
Copy link
Author

I guess that is this block

// Build the payment transaction
$transaction = \ZuluCrypto\StellarSdk\Server::publicNet()
->buildTransaction($sourceKeypair->getPublicKey())
->addOperation(
PaymentOp::newNativePayment($destinationAccountId, 1)
)
;

@AgostinhoBarbosa
Copy link

Good afternoon, I have the same problem, how should I do to inform a payment using TREEP, I am trying as I exercise below but I return error 504
$asset = Asset::newCustomAsset('TREEP', "GAVBWV24PZ6POVQGQO5UEWGO3TO7ERYXRFFI6V5VH3BMTPDZOHVOFA3G");

            $txEnvelope = $server->buildTransaction( $origem_keypar )
                                 ->setTextMemo($data['memorando'])
                                 ->addCustomAssetPaymentOp($asset,  $valor, $destino_keypar )
                                 ->getTransactionEnvelope();

$txEnvelope->sign($origem_keypar);

        $b64Tx = base64_encode($txEnvelope->toXdr());
        
        $return = $server->submitB64Transaction($b64Tx);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants