Skip to content

Improve DX for IdentityInput #1891

@arboleya

Description

@arboleya

Discussed in #1844

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 });

Metadata

Metadata

Assignees

No one assigned

    Labels

    featIssue is a feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions