Skip to content

Commit c9ee4aa

Browse files
committed
chore: improvements in rpc-client
1 parent ba17b55 commit c9ee4aa

File tree

13 files changed

+99
-190
lines changed

13 files changed

+99
-190
lines changed

.vitepress/data/nimiq-utils.data.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type ModuleContentMap = Record<string, ModuleContent>
104104
// Module content data
105105
const moduleContent: ModuleContentMap = {
106106
'address-book': {
107-
title: 'AddressBook',
107+
title: 'Address Book',
108108
description: 'Provides mapping of addresses to their corresponding labels for mainnet pools, services, and exchanges.',
109109
usageExamples: [
110110
{
@@ -188,7 +188,7 @@ console.log(\`Block \${blockNumber} is in epoch \${currentEpoch}, batch \${batch
188188
],
189189
},
190190
'browser-detection': {
191-
title: 'BrowserDetection',
191+
title: 'Browser Detection',
192192
description: 'Utility for detecting browser details including type, version, private mode, and device information.',
193193
usageExamples: [
194194
{
@@ -341,7 +341,7 @@ console.log(theme) // 'dark'
341341
],
342342
},
343343
'currency-info': {
344-
title: 'CurrencyInfo',
344+
title: 'Currency Info',
345345
description: 'Provides currency information including code, symbol, name, and decimal precision.',
346346
usageExamples: [
347347
{
@@ -453,7 +453,7 @@ console.log(historic) // Array of daily rates
453453
],
454454
},
455455
'formattable-number': {
456-
title: 'FormattableNumber',
456+
title: 'Formattable Number',
457457
description: 'Formats and converts numbers without precision loss with customizable formatting options.',
458458
usageExamples: [
459459
{
@@ -535,7 +535,7 @@ console.log(price.toString()) // '123.46'
535535
],
536536
},
537537
'rate-limit-scheduler': {
538-
title: 'RateLimitScheduler',
538+
title: 'Rate Limit Scheduler',
539539
description: 'Controls and limits task execution based on defined rate limits and parallel task limits.',
540540
usageExamples: [
541541
{
@@ -718,7 +718,7 @@ tween.start()
718718
],
719719
},
720720
'utf8-tools': {
721-
title: 'Utf8Tools',
721+
title: 'Utf8 Tools',
722722
description: 'Utility class for UTF-8 string and byte array conversions, validation, and truncation.',
723723
usageExamples: [
724724
{
@@ -752,7 +752,7 @@ console.log(string) // 'Hello, 世界!'
752752
],
753753
},
754754
'validation-utils': {
755-
title: 'ValidationUtils',
755+
title: 'Validation Utils',
756756
description: 'Utility class for validating, normalizing, and checking Nimiq addresses and hashes.',
757757
usageExamples: [
758758
{

.vitepress/theme.config.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,16 @@ export const themeConfig = {
159159
items: [
160160
{ text: 'Overview', link: '/rpc-client/', icon: 'i-tabler:layout-grid' },
161161
{ text: 'Open RPC Servers', link: '/rpc-client/open-servers', icon: 'i-tabler:server' },
162-
{ text: 'Integrations', icon: 'i-tabler:chart-funnel', items: [
163-
{ text: 'Raw Requests', link: '/rpc-client/integrations/raw', icon: 'i-tabler:terminal-2' },
164-
{ text: 'ARPL CLI Tool', link: '/rpc-client/integrations/arpl', icon: 'i-tabler:terminal' },
165-
{ text: 'TypeScript Client', link: '/rpc-client/integrations/typescript', icon: 'i-logos:typescript-icon' },
166-
{ text: 'JavaScript Native', link: '/rpc-client/integrations/javascript', icon: 'i-logos:javascript' },
167-
{ text: 'MCP Server (AI)', link: '/rpc-client/integrations/mcp', icon: 'i-tabler:robot' },
168-
169-
] },
162+
],
163+
},
164+
{
165+
label: 'Integrations',
166+
items: [
167+
{ text: 'Raw Requests', link: '/rpc-client/integrations/raw', icon: 'i-tabler:terminal-2' },
168+
{ text: 'ARPL CLI Tool', link: '/rpc-client/integrations/arpl', icon: 'i-tabler:terminal' },
169+
{ text: 'TypeScript Client', link: '/rpc-client/integrations/typescript', icon: 'i-logos:typescript-icon' },
170+
{ text: 'JavaScript Native', link: '/rpc-client/integrations/javascript', icon: 'i-logos:javascript' },
171+
{ text: 'MCP Server (AI)', link: '/rpc-client/integrations/mcp', icon: 'i-local:mcp' },
170172
],
171173
},
172174
{

.vitepress/theme/components/Banner.vue

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,33 @@ defineProps<{
99
</script>
1010

1111
<template>
12-
<section relative z-10 style="--pt: 0; --pb:0; --px: 0">
13-
<div
14-
class="nq-raw"
15-
outline="solid 1.5 offset--1.5 white/20"
16-
mx-auto bg-gradient-green w-full shadow relative of-hidden f-p-lg f-rounded-md
17-
>
18-
<div f-size="200/400" pointer-events-none absolute bottom="-10 lg:-0.2775em" right="-0.2em lg:-0.25em">
19-
<div text-transparent i-nimiq:logos-nimiq-mono>
20-
<div size-full bg-linear="to-bl from-transparent via-transparent to-neutral/20" />
21-
</div>
12+
<div
13+
class="nq-raw" outline="solid 1.5 offset--1.5 white/20" mx-auto bg-gradient-green w-full shadow relative
14+
of-hidden f-p-lg f-rounded-md
15+
>
16+
<div f-size="200/400" pointer-events-none absolute bottom="-10 lg:-0.2775em" right="-0.2em lg:-0.25em">
17+
<div text-transparent i-nimiq:logos-nimiq-mono>
18+
<div size-full bg-linear="to-bl from-transparent via-transparent to-neutral/20" />
2219
</div>
20+
</div>
2321

24-
<div flex="~ wrap justify-between items-end" max-w-full w-full relative z-10>
25-
<div max-w-60ch>
26-
<p v-if="label" nq-label text="12 white/80!">
27-
{{ label }}
28-
</p>
29-
<h3 text-white font-semibold f-text-2xl mt-4="!">
30-
{{ headline }}
31-
</h3>
32-
<p v-if="subline" text="white/80" mt-8>
33-
{{ subline }}
34-
</p>
35-
</div>
36-
<a v-if="linkHref && linkLabel" :href="linkHref" un-text-blue nq-arrow nq-pill-lg nq-pill-tertiary>
37-
{{ linkLabel }}
38-
</a>
22+
<div flex="~ wrap justify-between items-end" max-w-full w-full relative z-10>
23+
<div max-w-60ch>
24+
<p v-if="label" nq-label text="12 white/80!">
25+
{{ label }}
26+
</p>
27+
<h3 text-white font-semibold f-text-2xl mt-4="!">
28+
{{ headline }}
29+
</h3>
30+
<p v-if="subline" text="white/80" mt-8>
31+
{{ subline }}
32+
</p>
3933
</div>
34+
<a v-if="linkHref && linkLabel" :href="linkHref" un-text-blue nq-arrow nq-pill-lg nq-pill-tertiary>
35+
{{ linkLabel }}
36+
</a>
4037
</div>
41-
</section>
38+
</div>
4239
</template>
4340

4441
<style scoped>

.vitepress/theme/components/CategoryGrid.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defineProps<{
1818
</script>
1919

2020
<template>
21-
<div v-for="({ text, items }) in groups" :key="text" flex="~ col gap-12" nq-raw>
21+
<div v-for="({ text, items }) in groups" :key="text" flex="~ col gap-16" nq-raw f-mt-md>
2222
<h2 f-text-2xs="!" mx-0 nq-label mb-0="!">
2323
{{ text }}
2424
</h2>

.vitepress/theme/components/Hero.vue

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { useSlots } from 'vue'
23
import HexagonsBackground from './HexagonsBackground.vue'
34
45
interface Card {
@@ -21,25 +22,29 @@ interface Props {
2122
}
2223
2324
defineProps<Props>()
25+
26+
const slots = useSlots()
2427
</script>
2528

2629
<template>
2730
<section relative of-x-clip>
28-
<NqHeadline :title :description :align mt-0 h1 z-100 />
31+
<NqHeadline :title :description :align mt-0 :class="{ 'f-mb-sm': !!slots.default }" h1 z-100 />
2932
<div max-w-none="!" class="nq-raw" op-30 w-screen :class="cards ? 'bottom-32' : 'bottom--32'" absolute of-hidden>
3033
<ClientOnly>
31-
<HexagonsBackground :class="!cards ? 'op-50' : ''" />
34+
<HexagonsBackground pointer-events-none :class="!cards ? 'op-50' : ''" />
3235
</ClientOnly>
3336
</div>
3437

35-
<div v-if="cards" grid="~ cols-1 md:cols-2 md:rows-[auto_auto_auto] gap-32" z-100 f-min-h-3xl>
36-
<NqCard
37-
v-for="card in cards" :key="card.title" v-bind="card" :class="{ '[&_p]:z-10': card.bgColor }"
38-
:icon-class="!card.bgColor ? 'absolute size-32 right-12 top-12 hocus:text-white/80' : 'absolute size-200 op-60 md:op-100 right--12 bottom--24'"
39-
:style="card.hoverColor ? `--from:var(--colors-${card.hoverColor}-gradient-from); --to:var(--colors-${card.hoverColor}-gradient-to)` : undefined"
40-
:hover="card.hoverColor ? '[--nq-gradient-from:var(--from)] [--nq-gradient-to:var(--to)] text-white' : ''"
41-
/>
42-
</div>
38+
<slot name="default">
39+
<div v-if="cards" grid="~ cols-1 md:cols-2 md:rows-[auto_auto_auto] gap-32" z-100 f-min-h-3xl>
40+
<NqCard
41+
v-for="card in cards" :key="card.title" v-bind="card" :class="{ '[&_p]:z-10': card.bgColor }"
42+
:icon-class="!card.bgColor ? 'absolute size-32 right-12 top-12 hocus:text-white/80' : 'absolute size-200 op-60 md:op-100 right--12 bottom--24'"
43+
:style="card.hoverColor ? `--from:var(--colors-${card.hoverColor}-gradient-from); --to:var(--colors-${card.hoverColor}-gradient-to)` : undefined"
44+
:hover="card.hoverColor ? '[--nq-gradient-from:var(--from)] [--nq-gradient-to:var(--to)] text-white' : ''"
45+
/>
46+
</div>
47+
</slot>
4348
</section>
4449
</template>
4550

.vitepress/theme/components/Links.vue

Lines changed: 0 additions & 56 deletions
This file was deleted.

.vitepress/theme/components/Rpc/RpcPlayground.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function getErrorStatusCode(error: any): string | null {
5252
<p v-if="props.input.length === 0" font-italic>
5353
It does not require any parameters.
5454
</p>
55-
<fieldset v-else flex="~ col gap-sm">
55+
<fieldset v-else flex="~ col gap-16">
5656
<Input v-for="field in props.input" v-bind="field" :key="field.key" v-model="widget.userParams[field.key]" :label="field.key" />
5757
</fieldset>
5858
<div flex="~ items-center justify-end gap-6" f-mt-xs>

nimiq-utils/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ const moduleGroups = nimiqUtilsModules.filter(group =>
5050
)
5151
</script>
5252

53-
<Hero bg-neutral-0 v-bind="$frontmatter.hero" />
53+
<Hero v-bind="$frontmatter.hero" />
5454

55-
<NimiqFeatures bg-neutral-0 v-bind="$frontmatter.nimiqUtilsFeatures" />
55+
<NimiqFeatures v-bind="$frontmatter.nimiqUtilsFeatures" />
5656

57-
<section bg-neutral-0>
57+
<section>
5858

5959
<NqHeadline title="Quick Examples" description="See Nimiq Utils in action with real-world code snippets" f-mb-sm />
6060

@@ -124,7 +124,7 @@ const supplyAtBlock = posSupplyAt(1000000)
124124

125125
</section>
126126

127-
<section bg-neutral-0>
127+
<section>
128128

129129
<NqHeadline title="All Modules" description="Browse all available utility modules by category" f-mb-sm />
130130

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"eslint": "^9.35.0",
5757
"lint-staged": "^16.1.6",
5858
"markdown-it-mathjax3": "^4.3.2",
59-
"nimiq-css": "^1.0.0-beta.94",
60-
"nimiq-vitepress-theme": "^1.0.0-beta.94",
59+
"nimiq-css": "^1.0.0-beta.99",
60+
"nimiq-vitepress-theme": "^1.0.0-beta.99",
6161
"ofetch": "^1.4.1",
6262
"pathe": "^2.0.3",
6363
"pkg-types": "^2.3.0",

0 commit comments

Comments
 (0)