-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bace879
commit cb711ad
Showing
4 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
For more complete examples and setup see [Agoric/ui-kit](https://github.com/Agoric/ui-kit) | ||
|
||
```ts | ||
import { | ||
makeAgoricChainStorageWatcher, | ||
AgoricChainStoragePathKind as Kind | ||
} from '@agoric/rpc'; | ||
|
||
const watcher = makeAgoricChainStorageWatcher(rpc, chainName); | ||
|
||
// Watch vstorage children at a given node. | ||
const stopWatching = watcher.watchLatest<string[]>( | ||
[Kind.Children, 'published.vaultFactory.managers'], | ||
managerIds => { | ||
console.log('Got vault manager IDs:', managerIds); | ||
} | ||
) | ||
|
||
// Stop watching. | ||
stopWatching(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## Linting and formatting | ||
|
||
To scan the package for linting and formatting errors, run | ||
|
||
```bash | ||
yarn lint | ||
``` | ||
|
||
To automatically fix linting and formatting errors, run | ||
|
||
```bash | ||
yarn format | ||
``` | ||
|
||
## Tooling configs | ||
|
||
For most of the tools, the configuration is in the `package.json` to minimize | ||
the amount of files in this package. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
## Linting and formatting | ||
For complete examples and setup see [Agoric/ui-kit](https://github.com/Agoric/ui-kit) | ||
|
||
To scan the package for linting and formatting errors, run | ||
```ts | ||
import { subscribeLatest } from '@agoric/notifier'; | ||
import { makeAgoricChainStorageWatcher } from '@agoric/rpc'; | ||
import { makeAgoricWalletConnection } from '@agoric/web-components'; | ||
|
||
```bash | ||
yarn lint | ||
``` | ||
const watcher = makeAgoricChainStorageWatcher(rpc, chainName); | ||
const connection = await makeAgoricWalletConnection(watcher); | ||
const {pursesNotifier, publicSubscribersNotifier} = chainConnection; | ||
|
||
To automatically fix linting and formatting errors, run | ||
// Sign an on-chain offer transaction. | ||
connection.makeOffer(...offer); | ||
|
||
```bash | ||
yarn format | ||
// Read the user's token balances. | ||
for await (const purses of subscribeLatest(pursesNotifier)) { | ||
console.log('Got user purses:', purses); | ||
} | ||
``` | ||
|
||
## Tooling configs | ||
|
||
For most of the tools, the configuration is in the `package.json` to minimize | ||
the amount of files in this package. |