-
Notifications
You must be signed in to change notification settings - Fork 54
feat: bump dojo v1.0.9 #363
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ docs | |
.DS_Store | ||
# Local Netlify folder | ||
.netlify | ||
lerna-debug.log |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -321,6 +321,42 @@ export interface SDK<T extends SchemaType> { | |||||||||||||||||||||
account_addresses: string[], | ||||||||||||||||||||||
contract_addresses: string[] | ||||||||||||||||||||||
): Promise<torii.TokenBalances>; | ||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
* Subscribes to token balance updates | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* # Parameters | ||||||||||||||||||||||
* @param {string[]} contract_addresses - Array of contract addresses to filter (empty for all) | ||||||||||||||||||||||
* @param {string[]} account_addresses - Array of account addresses to filter (empty for all) | ||||||||||||||||||||||
* @param {Funtion} callback - JavaScript function to call on updates | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* # Returns | ||||||||||||||||||||||
* Result containing subscription handle or error | ||||||||||||||||||||||
* @returns torii.Subscription | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
onTokenBalanceUpdated: ( | ||||||||||||||||||||||
contract_addresses: string[], | ||||||||||||||||||||||
account_addresses: string[], | ||||||||||||||||||||||
callback: Function | ||||||||||||||||||||||
) => torii.Subscription; | ||||||||||||||||||||||
Comment on lines
+337
to
+341
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Improve type safety of the callback parameter in interface The Apply this diff: -callback: Function
+callback: (balance: torii.TokenBalance) => void 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 340-340: 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) |
||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
* Updates an existing token balance subscription | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* # Parameters | ||||||||||||||||||||||
* @param {torii.Subscription} subscription - Existing subscription to update | ||||||||||||||||||||||
* @param {string[]} contract_addresses - New array of contract addresses to filter | ||||||||||||||||||||||
* @param {string[]} account_addresses - New array of account addresses to filter | ||||||||||||||||||||||
* | ||||||||||||||||||||||
* # Returns | ||||||||||||||||||||||
* Result containing unit or error | ||||||||||||||||||||||
* @returns {Promise<void>} | ||||||||||||||||||||||
*/ | ||||||||||||||||||||||
updateTokenBalanceSubscription: ( | ||||||||||||||||||||||
subscription: torii.Subscription, | ||||||||||||||||||||||
contract_addresses: string[], | ||||||||||||||||||||||
account_addresses: string[] | ||||||||||||||||||||||
) => Promise<void>; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
/** | ||||||||||||||||||||||
|
+4 −4 | Scarb.lock | |
+2 −2 | Scarb.toml | |
+3 −0 | dojo_dev.toml | |
+3 −0 | dojo_release.toml | |
+39 −6 | manifest_dev.json | |
+0 −2 | overlays/dev/actions.toml | |
+0 −2 | overlays/release/actions.toml | |
+11 −16 | src/models.cairo | |
+6 −5 | src/systems/actions.cairo | |
+4 −4 | src/tests/test_world.cairo |
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.
Improve type safety of the callback parameter
The
Function
type is too broad and can lead to runtime errors. Define a specific callback signature for better type safety.Apply this diff:
📝 Committable suggestion
🧰 Tools
🪛 Biome (1.9.4)
[error] 217-217: 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)