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

Is TransactionUtilitiesKt removed from token sdk ? #159

Closed
yashbhavsar007 opened this issue Nov 27, 2019 · 2 comments
Closed

Is TransactionUtilitiesKt removed from token sdk ? #159

yashbhavsar007 opened this issue Nov 27, 2019 · 2 comments

Comments

@yashbhavsar007
Copy link

yashbhavsar007 commented Nov 27, 2019

I have received all the dependencies related to token-sdk and here I am attaching image for same
Screenshot 2019-11-27 at 3 52 28 PM

What I want to do?
I want to import com.r3.corda.lib.tokens.contracts.utilities.TransactionUtilities for below code
val fungibleToken = FungibleToken(amount,holder,TransactionUtilitiesKt.getAttachmentIdForGenericParam(tokenPointer))

Note: I'm doing code in kotlin

What happened ?
It says unresolved reference at TransactionUtilities So, The TransactionUtilities removed in the latest updates? if yes suggest any way to call FungibleToken.

Any suggestions/help appreciated.

@kasiastreich
Copy link
Contributor

Hi, function that you are trying to use is an extension function on TokenType: fun TokenType.getAttachmentIdForGenericParam(): SecureHash?. So to use it from kotlin you would call it this way: amount.token.tokenType.getAttachmentIdForGenericParam() (TransactionUtilitiesKt.etc is Java syntax for calling extension functions). However you don't have to use it at all, as there is a reasonable default for FungibleToken constructor. Hope that helps!
If the imports don't work, try to clean caches, there was no change to TransactionUtilities since 1.0

@yashbhavsar007
Copy link
Author

Yes this one worked for me! Thank you for your help!

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