Skip to content

Commit

Permalink
Use string instead of bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Jun 26, 2024
1 parent f18a3a3 commit 596a6e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
17 changes: 11 additions & 6 deletions src/request/types/btcMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,25 @@ export const getBalanceMethodName = 'getBalance';
export const getBalanceParamsSchema = v.undefined();
export const getBalanceResultSchema = v.object({
/**
* The confirmed balance of the wallet in sats.
* The confirmed balance of the wallet in sats. Using a string due to chrome
* messages not supporting bigint
* (https://issues.chromium.org/issues/40116184).
*/
confirmed: v.bigint(),
confirmed: v.string(),

/**
* The unconfirmed balance of the wallet in sats.
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
* messages not supporting bigint
* (https://issues.chromium.org/issues/40116184).
*/
unconfirmed: v.bigint(),
unconfirmed: v.string(),

/**
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
* sats.
* sats. Using a string due to chrome messages not supporting bigint
* (https://issues.chromium.org/issues/40116184).
*/
total: v.bigint(),
total: v.string(),
});
export const getBalanceRequestMessageSchema = v.object({
...rpcRequestMessageSchema.entries,
Expand Down
4 changes: 2 additions & 2 deletions src/request/types/walletMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as v from 'valibot';
export const connectMethodName = 'wallet_connect';
export const connectParamsSchema = v.undefined();
export const connectResultSchema = v.literal(true);
export const connectSchema = v.object({
export const connectRequestMessageSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(connectMethodName),
Expand All @@ -20,7 +20,7 @@ export type Connect = MethodParamsAndResult<
export const disconnectMethodName = 'wallet_disconnect';
export const disconnectParamsSchema = v.undefined();
export const disconnectResultSchema = v.literal(true);
export const disconnectSchema = v.object({
export const disconnectRequestMessageSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(disconnectMethodName),
Expand Down

0 comments on commit 596a6e1

Please sign in to comment.