From bfe0f67e28e7a08cb51987ad0cd502a7d85ab2e0 Mon Sep 17 00:00:00 2001 From: 0xIchigo <0xIchigo@protonmail.com> Date: Sat, 25 Nov 2023 01:07:03 -0500 Subject: [PATCH 1/2] Add Optional Encoding Param to getAccountInfo --- package.json | 2 +- src/lib/components/RPCMenu.svelte | 20 ++++++++++---------- src/lib/components/RaceModal.svelte | 2 +- src/lib/types/all-methods.js | 1 + src/lib/types/doc.js | 12 +++++++++--- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index c0fd229..e3980ec 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "*.{js,jsx,ts,tsx}": [ "npm run lint", "npm run format", - "git add" + "git add ." ] }, "devDependencies": { diff --git a/src/lib/components/RPCMenu.svelte b/src/lib/components/RPCMenu.svelte index 5aac477..e9395ac 100644 --- a/src/lib/components/RPCMenu.svelte +++ b/src/lib/components/RPCMenu.svelte @@ -7,23 +7,23 @@ let questions = Object.keys(methods).map((method, index) => { return { id: index + 1, text: method }; }); - + export let answer = ""; - - if (typeof window !== 'undefined') { + + if (typeof window !== "undefined") { // Initialize from localStorage - answer = localStorage.getItem('rpcUrl') || ""; + answer = localStorage.getItem("rpcUrl") || ""; } - + let isVisible = false; $: { - if (!answer && typeof window !== 'undefined') { - answer = localStorage.getItem('rpcUrl') || ""; + if (!answer && typeof window !== "undefined") { + answer = localStorage.getItem("rpcUrl") || ""; } let rpcUrlValue = answer; - + if (!rpcUrlValue) { currentRPC.set("https://api.mainnet-beta.solana.com"); } @@ -32,8 +32,8 @@ } currentRPC.set(rpcUrlValue); - if (typeof window !== 'undefined') { - localStorage.setItem('rpcUrl', rpcUrlValue); // Save to localStorage + if (typeof window !== "undefined") { + localStorage.setItem("rpcUrl", rpcUrlValue); // Save to localStorage } } diff --git a/src/lib/components/RaceModal.svelte b/src/lib/components/RaceModal.svelte index 826045a..685a7d2 100644 --- a/src/lib/components/RaceModal.svelte +++ b/src/lib/components/RaceModal.svelte @@ -187,7 +187,7 @@
diff --git a/src/lib/types/all-methods.js b/src/lib/types/all-methods.js index 4f01bcc..2101d10 100644 --- a/src/lib/types/all-methods.js +++ b/src/lib/types/all-methods.js @@ -6,6 +6,7 @@ export const methods = { }, optionalParams: { commitment: "confirmed", + encoding: "base58", minContextSlot: 0, }, paramsFormat: "array", diff --git a/src/lib/types/doc.js b/src/lib/types/doc.js index 0d211ae..b30779a 100644 --- a/src/lib/types/doc.js +++ b/src/lib/types/doc.js @@ -27,20 +27,26 @@ export const methods = { type: "string", }, dataSlice: { - description: "Encoding format for Account data", + description: + "Request a slice of the account's data", fields: { length: { - description: "number of bytes to return", + description: + "The number of bytes to return", type: "usize", }, offset: { description: - "byte offset from which to start reading", + "The byte offset from which to start reading", type: "usize", }, }, type: "object", }, + encoding: { + description: "Encoding format for Account data", + type: "string", + }, minContextSlot: { description: "The minimum slot that the request can be evaluated at", From 74fc3ed7258db4c5710cceb9e2ae65ddb5ede84c Mon Sep 17 00:00:00 2001 From: 0xIchigo <0xIchigo@protonmail.com> Date: Sat, 25 Nov 2023 01:27:12 -0500 Subject: [PATCH 2/2] Fix Annoying Lint Warnings --- package.json | 2 +- src/lib/components/Docs.svelte | 2 +- src/lib/components/RPCMenu.svelte | 2 +- src/lib/components/Request.svelte | 2 +- src/lib/components/Response.svelte | 2 +- src/lib/types/all-methods.js | 197 +++++++------- src/lib/types/doc.js | 398 ++++++++++++++--------------- src/lib/types/method-dev.js | 223 ++++++++-------- src/lib/types/method-params.js | 16 +- src/lib/types/race-methods.js | 44 ++-- src/lib/utils/handle-run.js | 2 +- 11 files changed, 444 insertions(+), 446 deletions(-) diff --git a/package.json b/package.json index e3980ec..e0f4609 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "// Lint": "-------------------------------------------------------------", "test": "npm run lint", - "lint": "eslint .", + "lint": "eslint . --fix", "format": "prettier --write '{public,src}/**/*.{css,html,js,svelte}'", "prepare": "husky install" }, diff --git a/src/lib/components/Docs.svelte b/src/lib/components/Docs.svelte index f35f6d8..aed566f 100644 --- a/src/lib/components/Docs.svelte +++ b/src/lib/components/Docs.svelte @@ -82,7 +82,7 @@ {#if selectedMethod}