GithubHelp home page GithubHelp logo

Option type missing from docs about stellar-docs HOT 4 OPEN

stellar avatar stellar commented on September 27, 2024
Option type missing from docs

from stellar-docs.

Comments (4)

Julian-dev28 avatar Julian-dev28 commented on September 27, 2024

@tamirms @paulbellamy

How is the status on this Issue? We have had some updates since it was opened and I'm thinking that things may have changed or it this issue has been resolved.

I would appreciate an update when you get a chance

Thanks!

from stellar-docs.

paulbellamy avatar paulbellamy commented on September 27, 2024

stellar/stellar-xdr#70 completely overhauled the scval system since this issue was written. There are two ways Option is represented in xdr.

In the ContractSpec (what you get if you do a soroban contract inspect), there is an ScSpecTypeOption type, which acts like rust's Option<T>

In the actual invocation xdr, there is no explicit Option type. Instead there is an ScVoid value, which you can pass for any value that should be None. This roughly means that in the arguments every argument is implicitly optional. But if you make the wrong one optional the transaction will be rejected.

We should probably think of a good way to explain this to people.

Good luck 🤷

from stellar-docs.

janewang avatar janewang commented on September 27, 2024

Add to this page https://developers.stellar.org/docs/smart-contracts/example-contracts/custom-types

from stellar-docs.

leighmcculloch avatar leighmcculloch commented on September 27, 2024

Should add to this page too: https://developers.stellar.org/docs/tools/sdks/build-your-own

from stellar-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.