beet icon indicating copy to clipboard operation
beet copied to clipboard

Support for f64

Open pindaroso opened this issue 2 years ago • 3 comments

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 avatar Jan 17 '23 19:01 pindaroso

Not sure what required, but have this basic PR in

pindaroso avatar Jan 17 '23 19:01 pindaroso

@thlorenz Hiya! Bump?

pindaroso avatar Jan 18 '23 20:01 pindaroso

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.

staccDOTsol avatar Mar 25 '23 22:03 staccDOTsol