-
Notifications
You must be signed in to change notification settings - Fork 322
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
CIP-0030: getCollateral({amount})
argument type
#636
Comments
good catch @itsfarseen ... I'd imagine one of the two is more commonly done in practice, and maybe it should be set to that; @Ryun1 @Crypto2099 any ideas? |
getCollateral({amount})
argument's type.getCollateral({amount})
argument type
@rphair I looked into common implementations by doing a Github code search. All implementations I found ignore the amount parameter. |
cc @vsubhuman, author of #208 |
@itsfarseen yes, that makes more sense now; in my non-dev experience I recall all wallets seem to use the "5 ada" convention. Still I'm glad we've got this on record, and if this parameter is ignored by common trade practice then I believe this should be referenced in CIP-0030... or if not then as a pending issue in @Ryun1's candidate CPS-0010 (#619). |
Bug reports should better be created in the appropriate repositories and not in the CIPs |
@itsfarseen could you please list the implementations that ignore the amount with links to the code |
Of course that's true about the wallet bug reports, but here we also have a CIP contradicting itself between the two source lines above, just a couple paragraphs apart. If I've mis-read that there's a contradiction there, please let me know how those 2 reported statements about the data type could both be true. Otherwise we need to prepare some kind of fix for the CIP text itself. |
cardano-js-sdk/dapp-connector Yoroi This PR says Emurgo/yoroi-frontend#3279 (comment):
Note: CIP-0030 function type says Examples where the amount is ignored
|
I'd hoped to get a quick answer at the CIP meeting today where this was briefly discussed. The best we can do for now, since we didn't have anyone stepping forward with a conclusive answer about how to solve the contradiction in the CIP, was that @Ryun1 or @Crypto2099 will, via the CIP Editors' Discord, open or lead a wallet dev discussion about (generally?) how collateral is characterised and (specifically?) which data type would best be implied by current usage. @itsfarseen you would be welcome in that discussion so please post if you need a reference or Discord invite there. |
I propose to use CBOR and disallow any other types, so that:
That said, I do feel that CIP-30 functions accepting and returning CBOR strings for every single argument is not ideal. We should have standardized JS types (using JSDoc or .d.ts files), similar to the CDDL types. All JS code should be able to exchange data using these types and should only need to convert to CBOR at the boundary of interaction with cardano nodes/RPCs. |
@rphair I'd love to join the discussion. My Discord username is itsfarseen. |
@itsfarseen & others: a Discord invite to the CIP discussion server is: https://discord.gg/tnQAjZYcTr - if there's a thread for this issue created there as per #636 (comment) we'll link to it here. |
@itsfarseen @Ryun1 @Crypto2099 this issue was given some attention in today's CIP meeting (after getting bumped off last agenda or two due to time constraints) and has been escalated to the Wallets Working Group meeting in about 2 days' time for concentrated visibility & resolving it there. |
CIPs/CIP-0030/README.md
Line 282 in 5498717
The type signature says
amount: cbor<Coin>
.CIPs/CIP-0030/README.md
Line 297 in 5498717
Here it says amount can be a BigNumber converted to string or a JS number.
Which is the correct version?
The text was updated successfully, but these errors were encountered: