Skip to content

Commit

Permalink
Rename method names
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Jun 27, 2024
1 parent 596a6e1 commit 573add8
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/request/types/walletMethods.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
import { MethodParamsAndResult, rpcRequestMessageSchema } from '../../types';
import * as v from 'valibot';

export const connectMethodName = 'wallet_connect';
export const connectParamsSchema = v.undefined();
export const connectResultSchema = v.literal(true);
export const connectRequestMessageSchema = v.object({
export const grantPermissionsMethodName = 'wallet_grantPermissions';
export const grantPermissionsParamsSchema = v.undefined();
export const grantPermissionsResultSchema = v.literal(true);
export const grantPermissionsRequestMessageSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(connectMethodName),
params: connectParamsSchema,
method: v.literal(grantPermissionsMethodName),
params: grantPermissionsParamsSchema,
id: v.string(),
}).entries,
});
export type Connect = MethodParamsAndResult<
v.InferOutput<typeof connectParamsSchema>,
v.InferOutput<typeof connectResultSchema>
v.InferOutput<typeof grantPermissionsParamsSchema>,
v.InferOutput<typeof grantPermissionsResultSchema>
>;

export const disconnectMethodName = 'wallet_disconnect';
export const disconnectParamsSchema = v.undefined();
export const disconnectResultSchema = v.literal(true);
export const disconnectRequestMessageSchema = v.object({
export const revokePermissionsMethodName = 'wallet_revokePermissions';
export const revokePermissionsParamsSchema = v.undefined();
export const revokePermissionsResultSchema = v.literal(true);
export const revokePermissionsRequestMessageSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(disconnectMethodName),
params: disconnectParamsSchema,
method: v.literal(revokePermissionsMethodName),
params: revokePermissionsParamsSchema,
id: v.string(),
}).entries,
});
export type Disconnect = MethodParamsAndResult<
v.InferOutput<typeof disconnectParamsSchema>,
v.InferOutput<typeof disconnectResultSchema>
v.InferOutput<typeof revokePermissionsParamsSchema>,
v.InferOutput<typeof revokePermissionsResultSchema>
>;

0 comments on commit 573add8

Please sign in to comment.