We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
IdentityInput
Originally posted by Dhaiwat10 March 7, 2024 Take this Sway function signature for example:
fn new_game(player: Identity);
If you try to call this function via the TS SDK, it would look something like this:
await contract.functions.new_game({ Address: { value: walletAddress }); await contract.functions.new_game({ ContractId: { value: contractId });
The idea is to change it to something like:
type Identity = {address: string, contractId?: never} | {address?: never; contractId: string} await contract.functions.new_game({ address: walletAddress }); await contract.functions.new_game({ contractId: contractId });
The text was updated successfully, but these errors were encountered:
It seems to me that we can generalize this approach for all enums, not just the Identity one? For example, this is currently possible:
Identity
// call-test-contract const { value } = await contract.functions .take_b256_enum({ Value: 'qweqwe', Data: 'asds' }) .call();
But we'd want to only provide Value or Data.
Value
Data
Sorry, something went wrong.
forc build --json-abi-with-callpaths
nedsalk
No branches or pull requests
Discussed in #1844
Originally posted by Dhaiwat10 March 7, 2024
Take this Sway function signature for example:
If you try to call this function via the TS SDK, it would look something like this:
The idea is to change it to something like:
The text was updated successfully, but these errors were encountered: