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

How to use tuple and uint with none value in stacks.js transaction? #1555

Closed
llwinner opened this issue Sep 27, 2023 · 2 comments
Closed

How to use tuple and uint with none value in stacks.js transaction? #1555

llwinner opened this issue Sep 27, 2023 · 2 comments

Comments

@llwinner
Copy link

I want to call a contract function with stacks.js, and the functions args contain tuple and uint. I read the README file about how to call a contract, that example just use bufferCVFromString function, and the parameter is not empty.
The contract function I want to call has 5 parameters, some tuple or uint parameter's value can be none, but I don't know how to do with stacks.js.
Please help me, thanks!

@friedger
Copy link
Collaborator

friedger commented Sep 27, 2023

You can use nonceCV() https://stacks.js.org/functions/_stacks_transactions.noneCV-1

There is also someCV(...) when using uints and tuples with parameters of type optional.

@llwinner
Copy link
Author

@friedger Thanks for your reply. It helps me!

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

No branches or pull requests

2 participants