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

create a non-native coin object #6

Closed
JohnGabrielRodi opened this issue May 25, 2022 · 0 comments
Closed

create a non-native coin object #6

JohnGabrielRodi opened this issue May 25, 2022 · 0 comments

Comments

@JohnGabrielRodi
Copy link

JohnGabrielRodi commented May 25, 2022

The examples for creating a claimable balance deal with coins just created and issued:

$iomAsset = new AssetTypeCreditAlphaNum4("coin", $sourceAccountId);

or with sending a native asset instead:

$opb = new CreateClaimableBalanceOperationBuilder($claimants, Asset::native(), "11.99");

So what I can't figure out is how to create the $iomasset object here from a non-native custom asset already in a distribution wallet.

$opb = new CreateClaimableBalanceOperationBuilder($claimants, $iomAsset, "1862");
$sourceAccount = $sdk->requestAccount($sourceAccountId);
$transaction = (new TransactionBuilder($sourceAccount))
->addOperation($opb->build())->build();

Really need fast help on this. Would be super grateful.

update

I figured it out:

$iomAsset = Asset::createNonNativeAsset("lord", "GAJQTYELJNE7E6DFHWLOFAEQUJM3JDO2APLRJTKHU3WRNOTRREYNVQME");

$opb = new CreateClaimableBalanceOperationBuilder($claimants, $iomAsset, "1862");
$sourceAccount = $sdk->requestAccount($sourceAccountId);
$transaction = (new TransactionBuilder($sourceAccount))
->addOperation($opb->build())->build();

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