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

Support for getBalance #20

Merged

Conversation

aryzing
Copy link
Contributor

@aryzing aryzing commented Jun 24, 2024

  • Support for getBalance.
  • Minor improvements / tweaks (added new schemas)

https://linear.app/xverseapp/issue/ENG-4527

@aryzing aryzing changed the title Misc changes Support for getBalance Jun 25, 2024
@aryzing aryzing requested a review from m-aboelenein June 25, 2024 15:46
@aryzing aryzing force-pushed the edu/misc-changes branch from 573add8 to 090c935 Compare June 27, 2024 09:54
@aryzing aryzing force-pushed the edu/misc-changes branch from 090c935 to c6e299d Compare June 27, 2024 10:11
@aryzing aryzing force-pushed the edu/misc-changes branch from 971ab73 to daca9f6 Compare July 1, 2024 13:58
@@ -7,7 +7,8 @@ import { MethodParamsAndResult, rpcRequestMessageSchema } from '../../types';
import * as v from 'valibot';

export const getInfoMethodName = 'getInfo';
export const getInfoParamsSchema = v.null();
export const getInfoParamsSchema = v.nullish(v.null());
Copy link
Member

Choose a reason for hiding this comment

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

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For maximum compatibility, so devs can use either null or undefined when no params are needed. We should have come up with a better API that doesn't require the request(arg1, arg2) function to necessarily need a second argument.

@@ -26,6 +26,8 @@ export interface RequestOptions<Payload extends RequestPayload, Response> {

// RPC Request and Response types

export const RpcIdSchema = v.optional(v.union([v.string(), v.number(), v.null()]));
Copy link
Member

Choose a reason for hiding this comment

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

curious: is this equivalent?

Suggested change
export const RpcIdSchema = v.optional(v.union([v.string(), v.number(), v.null()]));
export const RpcIdSchema = v.nullish(v.union([v.string(), v.number()]));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, recently learned about nullish, makes for more compact type defs

Copy link
Member

@teebszet teebszet left a comment

Choose a reason for hiding this comment

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

question: is this a breaking version?

i see wallet_connect and wallet_disconnect were removed, but not sure if those were released yet?

@teebszet teebszet changed the base branch from main to revert-22-revert-18-eduard/schema-validators July 1, 2024 14:30
@teebszet teebszet removed the request for review from m-aboelenein July 1, 2024 14:33
@aryzing
Copy link
Contributor Author

aryzing commented Jul 1, 2024

It shouldn't break existing apps. The changes are mostly additive. The wallet_connect/disconnect methods were never used / released / documented. I should have closed #18 as the work here superseded some of that work.

@aryzing aryzing merged commit f9fbf35 into revert-22-revert-18-eduard/schema-validators Jul 1, 2024
1 check passed
@aryzing aryzing deleted the edu/misc-changes branch July 1, 2024 15:46
@aryzing aryzing restored the edu/misc-changes branch July 3, 2024 13:21
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.

3 participants