Skip to content

fix: use starknet.shortstring.encodeShortString instead of torii-wasm… #448

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/sharp-rocks-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@dojoengine/sdk": patch
"@dojoengine/core": patch
"@dojoengine/create-burner": patch
"@dojoengine/create-dojo": patch
"@dojoengine/predeployed-connector": patch
"@dojoengine/react": patch
"@dojoengine/state": patch
"@dojoengine/torii-client": patch
"@dojoengine/torii-wasm": patch
"@dojoengine/utils": patch
"@dojoengine/utils-wasm": patch
Comment on lines +2 to +12
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify package bump scope
Ensure you’re only bumping versions for packages that actually include code changes. Unnecessary version bumps across unrelated packages (e.g., @dojoengine/core, @dojoengine/react, etc.) can lead to noise and unintended releases.

Run the following script to list which packages have real file changes and confirm alignment with this changeset:

Compare the output to your list and prune any packages that didn’t change.


🏁 Script executed:

#!/bin/bash
# Identify packages with changes since main
base=$(git merge-base HEAD origin/main)
git diff --name-only $base HEAD \
  | grep '^packages/' \
  | cut -d'/' -f2 \
  | sort -u

Length of output: 199


Prune unchanged packages from this changeset
Only @dojoengine/sdk has file changes since main. Please remove all other package bumps from .changeset/sharp-rocks-enjoy.md.

  • File: .changeset/sharp-rocks-enjoy.md (lines 2–12)
  • Remove entries for unaffected packages

Suggested diff:

@@ .changeset/sharp-rocks-enjoy.md
- "@dojoengine/core": patch
- "@dojoengine/create-burner": patch
- "@dojoengine/create-dojo": patch
- "@dojoengine/predeployed-connector": patch
- "@dojoengine/react": patch
- "@dojoengine/state": patch
- "@dojoengine/torii-client": patch
- "@dojoengine/torii-wasm": patch
- "@dojoengine/utils": patch
- "@dojoengine/utils-wasm": patch

Leave only:

"@dojoengine/sdk": patch
🤖 Prompt for AI Agents
In the file .changeset/sharp-rocks-enjoy.md between lines 2 and 12, the
changeset currently lists version bumps for multiple packages, but only
@dojoengine/sdk has actual code changes. Remove all other package entries from
this changeset so that only "@dojoengine/sdk": patch remains, ensuring the
changeset accurately reflects the packages with real modifications.

---

fix: use starknet.shortstring.encodeShortString instead of torii-wasm equivalent
7 changes: 3 additions & 4 deletions packages/sdk/src/__tests__/clauseBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import {
ClauseBuilder,
MemberClause,
OrComposeClause,
} from "../web/clauseBuilder";
import {
} from "../internal/clauseBuilder";
import type {
ComparisonOperator,
LogicalOperator,
PatternMatching,
} from "@dojoengine/torii-wasm";
import { SchemaType } from "../internal/types";
import type { SchemaType } from "../internal/types";

// Test models interface
interface TestModels extends SchemaType {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/__tests__/toriiQueryBuilder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
import { ToriiQueryBuilder } from "../internal/toriiQueryBuilder";
import type { Clause, OrderBy } from "@dojoengine/torii-wasm";
import type { SchemaType } from "../internal/types";
import { ClauseBuilder } from "../web/clauseBuilder";
import { ClauseBuilder } from "../internal/clauseBuilder";

interface TestModels extends SchemaType {
dojo_starter: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import {
ComparisonOperator,
MemberValue,
PatternMatching,
cairoShortStringToFelt,
} from "@dojoengine/torii-wasm/node";
import {
convertToPrimitive,
type MemberValueParam,
} from "../internal/convertToMemberValue.ts";
import { shortString } from "starknet";
import type { SchemaType } from "../internal/types.ts";

type ClauseBuilderInterface = {
Expand Down Expand Up @@ -146,10 +146,10 @@ export class ClauseBuilder<T extends SchemaType> {
const memberValue: MemberValue = Array.isArray(value)
? {
List: value.map((i) =>
convertToPrimitive(i, cairoShortStringToFelt)
convertToPrimitive(i, shortString.encodeShortString)
),
}
: convertToPrimitive(value, cairoShortStringToFelt);
: convertToPrimitive(value, shortString.encodeShortString);

this.clause = {
Member: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { Pagination } from "../internal/pagination.ts";
import { parseEntities } from "../internal/parseEntities.ts";

export * from "../internal/toriiQueryBuilder.ts";
export * from "./clauseBuilder.ts";
export * from "../internal/clauseBuilder.ts";
export * from "./worker.ts";
export * from "../internal/types.ts";
export * from "../internal/models.ts";
Expand Down
244 changes: 0 additions & 244 deletions packages/sdk/src/web/clauseBuilder.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdk/src/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { parseEntities } from "../internal/parseEntities";

export * from "../internal/types";
export * from "./queryBuilder";
export * from "./clauseBuilder";
export * from "../internal/clauseBuilder";
export * from "../internal/toriiQueryBuilder";

/**
Expand Down
Loading