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

Support for f64 #48

Open
pindaroso opened this issue Jan 17, 2023 · 3 comments
Open

Support for f64 #48

pindaroso opened this issue Jan 17, 2023 · 3 comments

Comments

@pindaroso
Copy link

Good afternoon. Am wondering, is there any plan to add support for f64 here? I'm currently running into an issue.

# Somewhat redacted output...
➜  js git:(main) ✗ yarn solita
yarn run v1.22.19
$ solita
Removed existing IDL at x.json.
Disable this by setting 'removeExistingIdl: false' inside the '.solitarc.js' config.
Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf
cargo-build-bpf child: ~/.local/share/solana/install/active_release/bin/cargo-build-sbf --arch bpf
    Finished release [optimized] target(s) in 0.26s

IDL written to: x.json
Generating TypeScript SDK to /x/js/generated
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

AssertionError [ERR_ASSERTION]: Types to map primitive type need to be supported by Beet, f64 is not
    at TypeMapper.assertBeetSupported (/x/node_modules/@metaplex-foundation/solita/dist/src/type-mapper.js:417:29)
    at TypeMapper.mapPrimitiveType (/x/node_modules/@metaplex-foundation/solita/dist/src/type-mapper.js:95:14)
    at TypeMapper.map (/x/node_modules/@metaplex-foundation/solita/dist/src/type-mapper.js:177:25)
    at TypeRenderer.renderTypeField (/x/node_modules/@metaplex-foundation/solita/dist/src/render-type.js:24:52)
    at /x/node_modules/@metaplex-foundation/solita/dist/src/render-type.js:44:34
    at Array.map (<anonymous>)
    at TypeRenderer.renderTypeScriptType (/x/node_modules/@metaplex-foundation/solita/dist/src/render-type.js:44:14)
    at TypeRenderer.renderDataStructs (/x/node_modules/@metaplex-foundation/solita/dist/src/render-type.js:91:37)
    at TypeRenderer.determineIsFixable (/x/node_modules/@metaplex-foundation/solita/dist/src/render-type.js:101:14)
    at determineTypeIsFixable (/x/node_modules/@metaplex-foundation/solita/dist/src/render-type.js:127:21) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}

Thank you!

@pindaroso
Copy link
Author

Not sure what required, but have this basic PR in

@pindaroso
Copy link
Author

@thlorenz Hiya! Bump?

@staccDOTsol
Copy link

Hello! I'm not entirely sure, but it seems like you're running into an issue with the @metaplex-foundation/solita package not supporting f64 types. I'm not aware of any plans to add support for f64 at the moment, but you could try reaching out to the package maintainers to see if they have any plans to add support in the future. In the meantime, you could try using a different data type that is supported by the package.

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