From 6bfcbe12e9d688c100a91653a393ada452f72516 Mon Sep 17 00:00:00 2001 From: Kartik Soneji Date: Sat, 20 Apr 2024 22:38:29 +0530 Subject: [PATCH 1/3] fix `npm run format` on Windows --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0f4609..c8197be 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "// Lint": "-------------------------------------------------------------", "test": "npm run lint", "lint": "eslint . --fix", - "format": "prettier --write '{public,src}/**/*.{css,html,js,svelte}'", + "format": "prettier --write \"{public,src}/**/*.{css,html,js,svelte}\"", "prepare": "husky install" }, "lint-staged": { From 3bf1f7520e6992f15cc7bb6fba049176c5b4888b Mon Sep 17 00:00:00 2001 From: Kartik Soneji Date: Sat, 20 Apr 2024 22:07:51 +0530 Subject: [PATCH 2/3] add `paramsFormat` to `getBlockHeight` method --- src/lib/types/all-methods.js | 1 + src/lib/types/method-dev.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib/types/all-methods.js b/src/lib/types/all-methods.js index 9197715..00facd5 100644 --- a/src/lib/types/all-methods.js +++ b/src/lib/types/all-methods.js @@ -128,6 +128,7 @@ export const methods = { defaultParams: {}, name: "getBlockHeight", optionalParams: { commitment: "confirmed", minContextSlot: 0 }, + paramsFormat: "array", }, getBlockProduction: { defaultParams: {}, diff --git a/src/lib/types/method-dev.js b/src/lib/types/method-dev.js index a7bdece..f50d36d 100644 --- a/src/lib/types/method-dev.js +++ b/src/lib/types/method-dev.js @@ -130,6 +130,7 @@ export const methods = { defaultParams: {}, name: "getBlockHeight", optionalParams: { commitment: "confirmed", minContextSlot: 0 }, + paramsFormat: "object", }, getBlockProduction: { defaultParams: {}, From 8bc335da1ab8eb66742f83cd521d2d16a75172eb Mon Sep 17 00:00:00 2001 From: Kartik Soneji Date: Sat, 20 Apr 2024 22:07:30 +0530 Subject: [PATCH 3/3] add type `RpcMethod` --- src/lib/types/all-methods.js | 11 +++++++++++ src/lib/types/method-dev.js | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/lib/types/all-methods.js b/src/lib/types/all-methods.js index 00facd5..5235dea 100644 --- a/src/lib/types/all-methods.js +++ b/src/lib/types/all-methods.js @@ -1,3 +1,14 @@ +/** + * @typedef {{ + * name: string; + * defaultParams: Record; + * optionalParams?: [] | Record; + * paramsFormat: "object" | "array" | "none"; + * paramsStructure?: string[]; + * }} RpcMethod + */ + +/** @type Record */ export const methods = { getAccountInfo: { defaultParams: { diff --git a/src/lib/types/method-dev.js b/src/lib/types/method-dev.js index f50d36d..de8d3c9 100644 --- a/src/lib/types/method-dev.js +++ b/src/lib/types/method-dev.js @@ -1,3 +1,5 @@ +/** @typedef {import("./all-methods").RpcMethod} RpcMethod */ +/** @type Record */ export const methods = { getAsset: { defaultParams: {