Skip to content

Commit 32db06c

Browse files
committed
feat: bump dojo v1.0.9
1 parent faf8d21 commit 32db06c

File tree

11 files changed

+138
-49
lines changed

11 files changed

+138
-49
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ jobs:
2020
run: git submodule update --init --recursive
2121

2222
- run: curl -L https://install.dojoengine.org | bash
23-
- run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.8
23+
- run: /home/runner/.config/.dojo/bin/dojoup -v v1.0.9
2424
- run: |
2525
cd worlds/dojo-starter
2626
/home/runner/.config/.dojo/bin/sozo build
2727
/home/runner/.config/.dojo/bin/sozo test
28+
- run: |
29+
cd worlds/onchain-dash
30+
/home/runner/.config/.dojo/bin/sozo build
31+
/home/runner/.config/.dojo/bin/sozo test
2832
2933
- name: "Setup npm"
3034
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ docs
44
.DS_Store
55
# Local Netlify folder
66
.netlify
7+
lerna-debug.log

examples/example-nodejs-bot/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ A Discord bot for interacting with your Dojo world via Torii.
44

55
Features:
66

7-
- Poll a Torii for information.
8-
- Expose a slash command for reading Torii state.
9-
- Easy to extend with new commands.
10-
- GraphQL codegen for Torii models.
7+
- Poll a Torii for information.
8+
- Expose a slash command for reading Torii state.
9+
- Easy to extend with new commands.
10+
- GraphQL codegen for Torii models.
1111

1212
---
1313

examples/example-vite-kitchen-sink/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ sozo migrate apply
4545

4646
### Notes
4747

48-
- you main want to update `actions` contract address in `src/components/caller-counter.tsx` & `src/components/global-counter.tsx` which is hardcoded in those files.
49-
- if you want to have braavos & argent wallet working, you need to deploy classes and deploy your wallet manually.
48+
- you main want to update `actions` contract address in `src/components/caller-counter.tsx` & `src/components/global-counter.tsx` which is hardcoded in those files.
49+
- if you want to have braavos & argent wallet working, you need to deploy classes and deploy your wallet manually.

examples/example-vite-react-sdk/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ This template provides a minimal setup to get React working in Vite with HMR and
44

55
Currently, two official plugins are available:
66

7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
99

1010
## Expanding the ESLint configuration
1111

1212
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
1313

14-
- Configure the top-level `parserOptions` property like this:
14+
- Configure the top-level `parserOptions` property like this:
1515

1616
```js
1717
export default tseslint.config({
@@ -25,9 +25,9 @@ export default tseslint.config({
2525
});
2626
```
2727

28-
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
28+
- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
29+
- Optionally add `...tseslint.configs.stylisticTypeChecked`
30+
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
3131

3232
```js
3333
// eslint.config.js

examples/example-vite-svelte-recs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also pow
1414

1515
**Why use this over SvelteKit?**
1616

17-
- It brings its own routing solution which might not be preferable for some users.
18-
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
17+
- It brings its own routing solution which might not be preferable for some users.
18+
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
1919

2020
This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
2121

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"build": "bash ./scripts/build-packages.sh",
55
"build-examples": "bash ./scripts/build-examples.sh",
66
"clean": "bash ./scripts/clean.sh",
7-
"prettier-check": "npx prettier --check {packages,examples}",
8-
"prettier": "npx prettier --write {packages,examples}",
7+
"prettier-check": "pnpx prettier --check {packages,examples}",
8+
"prettier": "pnpx prettier --write {packages,examples}",
99
"release": "pnpm build && pnpm prettier && npx lerna publish --no-private --force-publish",
1010
"docs": "npx typedoc --out docs",
1111
"prepare": "husky install"

packages/create-burner/readme.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ Easily manage, create, and interact with burner accounts on Starknets using this
3333

3434
## Features:
3535

36-
- Initialize and manage burner accounts.
37-
- Abstracts away intricacies related to creating, fetching, and setting active burner accounts.
38-
- Easily integrate with React apps using the provided hook.
39-
- Vanilla JS support.
36+
- Initialize and manage burner accounts.
37+
- Abstracts away intricacies related to creating, fetching, and setting active burner accounts.
38+
- Easily integrate with React apps using the provided hook.
39+
- Vanilla JS support.
4040

4141
## Table of Contents
4242

43-
- [Installation](#installation)
44-
- [Usage](#usage)
45-
- [With React](#with-react)
46-
- [Vanilla JavaScript](#vanilla-javascript)
47-
- [API](#api)
48-
- [Contribute](#contribute)
49-
- [License](#license)
43+
- [Installation](#installation)
44+
- [Usage](#usage)
45+
- [With React](#with-react)
46+
- [Vanilla JavaScript](#vanilla-javascript)
47+
- [API](#api)
48+
- [Contribute](#contribute)
49+
- [License](#license)
5050

5151
## Installation
5252

@@ -58,7 +58,7 @@ yarn add @dojoengine/create-burner starknet
5858

5959
### In the wild:
6060

61-
- [dojo-starter-react-app](https://github.com/dojoengine/dojo-starter-react-app)
61+
- [dojo-starter-react-app](https://github.com/dojoengine/dojo-starter-react-app)
6262

6363
## Usage
6464

@@ -90,25 +90,25 @@ const activeAccount = manager.getActiveAccount();
9090

9191
## API
9292

93-
- **useBurner**: A React hook that provides functionalities like creating burners, selecting them, and more.
94-
95-
- `get(address: string)`: Get a burner account based on its address.
96-
- `list()`: List all burners.
97-
- `select(address: string)`: Set a burner as the active account.
98-
- `create()`: Create a new burner.
99-
- `account`: The active burner account.
100-
- `isDeploying`: A boolean that indicates whether a burner is being deployed.
101-
- `listConnectors()`: List all available connectors that can be used with Starknet React.
102-
103-
- **BurnerManager**: A class for vanilla JS that offers methods to manage burner accounts.
104-
- `init()`: Initializes the manager.
105-
- `getActiveAccount()`: Retrieves the active burner account.
106-
- `get(address: string)`: Get a burner account based on its address.
107-
- `list()`: List all burners.
108-
- `select(address: string)`: Set a burner as the active account.
109-
- `create()`: Create a new burner.
110-
- `account`: The active burner account.
111-
- `isDeploying`: A boolean that indicates whether a burner is being deployed.
93+
- **useBurner**: A React hook that provides functionalities like creating burners, selecting them, and more.
94+
95+
- `get(address: string)`: Get a burner account based on its address.
96+
- `list()`: List all burners.
97+
- `select(address: string)`: Set a burner as the active account.
98+
- `create()`: Create a new burner.
99+
- `account`: The active burner account.
100+
- `isDeploying`: A boolean that indicates whether a burner is being deployed.
101+
- `listConnectors()`: List all available connectors that can be used with Starknet React.
102+
103+
- **BurnerManager**: A class for vanilla JS that offers methods to manage burner accounts.
104+
- `init()`: Initializes the manager.
105+
- `getActiveAccount()`: Retrieves the active burner account.
106+
- `get(address: string)`: Get a burner account based on its address.
107+
- `list()`: List all burners.
108+
- `select(address: string)`: Set a burner as the active account.
109+
- `create()`: Create a new burner.
110+
- `account`: The active burner account.
111+
- `isDeploying`: A boolean that indicates whether a burner is being deployed.
112112

113113
## Contribute
114114

packages/sdk/src/index.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,53 @@ export async function init<T extends SchemaType>(
198198
contract_addresses
199199
);
200200
},
201+
202+
/**
203+
* Subscribes to token balance updates
204+
*
205+
* # Parameters
206+
* @param {string[]} contract_addresses - Array of contract addresses to filter (empty for all)
207+
* @param {string[]} account_addresses - Array of account addresses to filter (empty for all)
208+
* @param {Funtion} callback - JavaScript function to call on updates
209+
*
210+
* # Returns
211+
* Result containing subscription handle or error
212+
* @returns torii.Subscription
213+
*/
214+
onTokenBalanceUpdated: (
215+
contract_addresses: string[],
216+
account_addresses: string[],
217+
callback: Function
218+
): torii.Subscription => {
219+
return client.onTokenBalanceUpdated(
220+
contract_addresses,
221+
account_addresses,
222+
callback
223+
);
224+
},
225+
226+
/**
227+
* Updates an existing token balance subscription
228+
*
229+
* # Parameters
230+
* @param {torii.Subscription} subscription - Existing subscription to update
231+
* @param {string[]} contract_addresses - New array of contract addresses to filter
232+
* @param {string[]} account_addresses - New array of account addresses to filter
233+
*
234+
* # Returns
235+
* Result containing unit or error
236+
* @returns {Promise<void>}
237+
*/
238+
updateTokenBalanceSubscription: async (
239+
subscription: torii.Subscription,
240+
contract_addresses: string[],
241+
account_addresses: string[]
242+
): Promise<void> => {
243+
return await client.updateTokenBalanceSubscription(
244+
subscription,
245+
contract_addresses,
246+
account_addresses
247+
);
248+
},
201249
};
202250
}

packages/sdk/src/types.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,42 @@ export interface SDK<T extends SchemaType> {
321321
account_addresses: string[],
322322
contract_addresses: string[]
323323
): Promise<torii.TokenBalances>;
324+
325+
/**
326+
* Subscribes to token balance updates
327+
*
328+
* # Parameters
329+
* @param {string[]} contract_addresses - Array of contract addresses to filter (empty for all)
330+
* @param {string[]} account_addresses - Array of account addresses to filter (empty for all)
331+
* @param {Funtion} callback - JavaScript function to call on updates
332+
*
333+
* # Returns
334+
* Result containing subscription handle or error
335+
* @returns torii.Subscription
336+
*/
337+
onTokenBalanceUpdated: (
338+
contract_addresses: string[],
339+
account_addresses: string[],
340+
callback: Function
341+
) => torii.Subscription;
342+
343+
/**
344+
* Updates an existing token balance subscription
345+
*
346+
* # Parameters
347+
* @param {torii.Subscription} subscription - Existing subscription to update
348+
* @param {string[]} contract_addresses - New array of contract addresses to filter
349+
* @param {string[]} account_addresses - New array of account addresses to filter
350+
*
351+
* # Returns
352+
* Result containing unit or error
353+
* @returns {Promise<void>}
354+
*/
355+
updateTokenBalanceSubscription: (
356+
subscription: torii.Subscription,
357+
contract_addresses: string[],
358+
account_addresses: string[]
359+
) => Promise<void>;
324360
}
325361

326362
/**

0 commit comments

Comments
 (0)