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

Client return types #3

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Client return types #3

merged 5 commits into from
Feb 29, 2024

Conversation

Ryang-21
Copy link
Collaborator

@Ryang-21 Ryang-21 commented Feb 27, 2024

  • Changed client function return type to the xdr of the operation
  • Made client parsers accessible
  • exported contract errors and nativeToScVal
  • updated contract specs

@Ryang-21 Ryang-21 requested a review from mootz12 February 27, 2024 05:54
src/index.ts Outdated
@@ -1,7 +1,8 @@
export * from "./governor.js";
export * from "./votes.js";
export * from "./contract_result.js";

export * from "./contract_error.js";
export { nativeToScVal } from "@stellar/stellar-sdk";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am OK with letting this workaround go by, but part of me thinks we should try transforming the incoming Array<any> into:

arg: string[]

fn {
    real_arg = arg.map // map string to xdr.ScVal
}

That way users of the SDK have a clear parameter type (we probs need to add a comment explaining what kind of string it is)

@Ryang-21 Ryang-21 requested a review from mootz12 February 27, 2024 17:08
Comment on lines +172 to +174
else {
result.result = new Ok(undefined as T);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@mootz12 mootz12 merged commit 2688d90 into main Feb 29, 2024
@mootz12 mootz12 deleted the client-return-types branch February 29, 2024 21:15
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

Successfully merging this pull request may close these issues.

2 participants