-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: update sdk #398
chore: update sdk #398
Conversation
WalkthroughThe changes update the SDK by adding a new parameter Changes
Sequence Diagram(s)sequenceDiagram
participant C as Caller
participant S as SDK
participant CL as Client
C->>S: Call getTokens(contract_addresses, token_ids)
S->>CL: Forward call with contract_addresses & token_ids
CL-->>S: Return tokens data
S-->>C: Return tokens data
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (4)
📒 Files selected for processing (13)
💤 Files with no reviewable changes (9)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/sdk/src/index.ts
(5 hunks)packages/sdk/src/types.ts
(5 hunks)worlds/dojo-starter
(1 hunks)worlds/onchain-dash
(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- worlds/onchain-dash
- worlds/dojo-starter
🧰 Additional context used
🪛 Biome (1.9.4)
packages/sdk/src/index.ts
[error] 305-305: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (2)
packages/sdk/src/types.ts (1)
327-327
: LGTM! The token-related method signatures have been consistently updated.The changes consistently add the
token_ids
parameter to all token-related methods in the SDK interface, along with proper documentation. This enhancement allows for more granular filtering of tokens.Also applies to: 331-333, 343-344, 363-363, 383-384
packages/sdk/src/index.ts (1)
260-260
: LGTM! The token-related method implementations have been consistently updated.The changes consistently add the
token_ids
parameter to all token-related methods and properly pass it to the corresponding client methods.Also applies to: 264-267, 278-284, 304-311, 331-338
@@ -295,11 +301,13 @@ export async function init<T extends SchemaType>( | |||
onTokenBalanceUpdated: ( | |||
contract_addresses: string[], | |||
account_addresses: string[], | |||
token_ids: string[], | |||
callback: Function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Replace Function
type with a more specific callback type.
Using the Function
type reduces type safety as it accepts any function-like value. Consider defining a more specific callback type.
Apply this diff to improve type safety:
-callback: Function
+callback: (response: { data?: torii.TokenBalances; error?: Error }) => void
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
callback: Function | |
callback: (response: { data?: torii.TokenBalances; error?: Error }) => void |
🧰 Tools
🪛 Biome (1.9.4)
[error] 305-305: Don't use 'Function' as a type.
Prefer explicitly define the function shape. This type accepts any function-like value, which can be a common source of bugs.
(lint/complexity/noBannedTypes)
1e689fe
to
175c80f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/ci.yaml (1)
53-57
: Optional cleanup for commented-out Codecov steps.
The commented-out section for uploading coverage reports to Codecov remains in the workflow. If these steps are no longer planned for use, consider removing them to simplify the file and maintain clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
examples/example-vite-react-phaser-recs/src/dojo/generated/setup.ts
is excluded by!**/generated/**
examples/example-vite-react-pwa-recs/src/dojo/generated/setup.ts
is excluded by!**/generated/**
examples/example-vite-react-threejs-recs/src/dojo/generated/setup.ts
is excluded by!**/generated/**
examples/example-vue-app-recs/src/dojo/generated/setup.ts
is excluded by!**/generated/**
📒 Files selected for processing (12)
.github/workflows/ci.yaml
(1 hunks)examples/example-vanillajs-phaser-recs/src/dojo/setup.ts
(0 hunks)examples/example-vite-experimental-sdk/src/main.ts
(0 hunks)examples/example-vite-grpc-playground/src/main.tsx
(0 hunks)examples/example-vite-kitchen-sink/src/main.tsx
(1 hunks)examples/example-vite-phaser-sdk/src/main.ts
(0 hunks)examples/example-vite-react-app-recs/src/dojo/setup.ts
(0 hunks)examples/example-vite-react-sdk/src/main.tsx
(0 hunks)examples/example-vite-react-sql/src/main.tsx
(0 hunks)examples/example-vite-svelte-recs/src/dojo/setup.ts
(0 hunks)worlds/dojo-starter
(1 hunks)worlds/onchain-dash
(1 hunks)
💤 Files with no reviewable changes (8)
- examples/example-vite-experimental-sdk/src/main.ts
- examples/example-vite-react-sql/src/main.tsx
- examples/example-vite-phaser-sdk/src/main.ts
- examples/example-vite-react-sdk/src/main.tsx
- examples/example-vite-grpc-playground/src/main.tsx
- examples/example-vite-react-app-recs/src/dojo/setup.ts
- examples/example-vite-svelte-recs/src/dojo/setup.ts
- examples/example-vanillajs-phaser-recs/src/dojo/setup.ts
✅ Files skipped from review due to trivial changes (1)
- worlds/onchain-dash
🚧 Files skipped from review as they are similar to previous changes (2)
- worlds/dojo-starter
- examples/example-vite-kitchen-sink/src/main.tsx
🔇 Additional comments (1)
.github/workflows/ci.yaml (1)
22-23
: Updated dojoup version usage.
The CI workflow now explicitly callsdojoup
with versionv1.1.1
, which is in line with the SDK update objectives. Please verify that the new version is compatible with subsequent commands (e.g., thesozo build
andsozo test
steps) and that no breaking changes were introduced.
82f5bc6
to
185925a
Compare
185925a
to
896c98e
Compare
update sdk to support dojoengine/dojo.c@4bd2be5
Summary by CodeRabbit
New Features
Refactor
Chores
dojoup
command in the CI workflow.