Skip to content

feat: apply shinzohub client library to Studio#227

Merged
VanishMax merged 3 commits into
feat/shinzohubfrom
feat/studio-and-shinzohub
May 23, 2026
Merged

feat: apply shinzohub client library to Studio#227
VanishMax merged 3 commits into
feat/shinzohubfrom
feat/studio-and-shinzohub

Conversation

@VanishMax
Copy link
Copy Markdown
Collaborator

Closes #223

This PR shows how effective @shinzo/shinzohub library can be when applied to real-life use cases.

In here, I refactored Shinzo Studio to use this library and removed many complicated lines of code, keeping only the meaning. In short, registering a view now looks like this:

import { bundleView, validateView } from "@shinzo/lenses/view";
import { createView } from "@shinzo/shinzohub";

const view = {
  query,
  sdl,
  lenses: [{ wasmBytes, args }],
};

const validation = await validateView(view);
if (!validation.ok) throw new Error(validation.issues[0]?.message);

const bundle = await bundleView(view);
const hash = await createView(walletClient, { bundle });

What used to be a complicated bundling and sending transaction task now became just a plain formula.

@VanishMax VanishMax requested a review from NiranjanaBinoy May 22, 2026 13:17
@VanishMax VanishMax self-assigned this May 22, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 22, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
shinzo-studio 72ca929 Commit Preview URL

Branch Preview URL
May 22 2026, 01:51 PM

Comment on lines -161 to +147
const tx = await buildDeployTransaction(resolvedView, wasmBytesByStep);
const bundle = await bundleView(viewDefinition);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: view bundling now comes from lenses package

Comment on lines -212 to 177
txHash = await sendTransactionMutateAsync({
txHash = await createView(walletClient, {
account,
to: tx.to,
data: tx.data,
chainId,
gas,
gasPrice: gasPriceOverride,
bundle,
});
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: sending view registration transaction is now streamlined

@VanishMax VanishMax merged commit 0cca34a into feat/shinzohub May 23, 2026
2 checks passed
@VanishMax VanishMax deleted the feat/studio-and-shinzohub branch May 23, 2026 04:47
VanishMax added a commit that referenced this pull request May 23, 2026
* feat(shinzohub): create shinzohub client package

* fix(shinzohub): replace hex encodings with viem functions

* feat: add `getCreatedViewAddress` method

* fix(shinzohub): extract shinzo address validation

* feat: apply shinzohub client library to Studio (#227)

* feat(lenses): add view bundling to lenses package

* feat(studio): apply shinzohub package to deploy a view

* fix(studio): build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant