@@ -14,13 +14,6 @@ It polls the RPC periodically, automatically batching and de-duping requests for
14
14
15
15
See https://github.com/p2p-org/p2p-agoric-vstorage-viewer to explore vstorage more.
16
16
17
- * package.json:*
18
- ```
19
- "@agoric/rpc": "^0.4.1-dev-7cf64bb.0"
20
- ```
21
-
22
-
23
- * app.ts:*
24
17
``` ts
25
18
import {
26
19
makeAgoricChainStorageWatcher ,
@@ -31,7 +24,7 @@ const watcher = makeAgoricChainStorageWatcher(rpc, chainName);
31
24
32
25
// Watch vstorage children at a given node.
33
26
const stopWatching = watcher .watchLatest <string []>(
34
- [Kind .Children , ' published.vaultFactory.managers' ,
27
+ [Kind .Children , ' published.vaultFactory.managers' ] ,
35
28
managerIds => {
36
29
console .log (' Got vault manager IDs:' , managerIds );
37
30
}
@@ -42,7 +35,7 @@ stopWatching();
42
35
43
36
// Watch vstorage data at a given node.
44
37
watcher .watchLatest <Brands >(
45
- [Kind .Data , ' published.agoricNames.brand' ,
38
+ [Kind .Data , ' published.agoricNames.brand' ] ,
46
39
brands => {
47
40
console .log (' Do something with the brands' );
48
41
}
@@ -51,14 +44,6 @@ watcher.watchLatest<Brands>(
51
44
52
45
## Connecting to User's Account (Keplr)
53
46
54
- *package.json:*
55
- ` ` `
56
- " @agoric/notifier" : " ^0.6.2" ,
57
- " @agoric/rpc" : " ^0.4.1-dev-7cf64bb.0" ,
58
- " @agoric/web-components" : " 0.10.1-dev-7cf64bb.0"
59
- ` ` `
60
-
61
- *app.ts:*
62
47
``` ts
63
48
import { subscribeLatest } from ' @agoric/notifier' ;
64
49
import { makeAgoricChainStorageWatcher } from ' @agoric/rpc' ;
@@ -75,13 +60,6 @@ for await (const purses of subscribeLatest(pursesNotifier)) {
75
60
76
61
## Executing Offers
77
62
78
- *package.json:*
79
- ` ` `
80
- " @agoric/rpc" : " ^0.4.1-dev-7cf64bb.0" ,
81
- " @agoric/web-components" : " 0.10.1-dev-7cf64bb.0"
82
- ` ` `
83
-
84
- *app.ts:*
85
63
``` ts
86
64
import { makeAgoricChainStorageWatcher } from ' @agoric/rpc' ;
87
65
import { makeAgoricWalletConnection } from ' @agoric/web-components' ;
@@ -99,6 +77,7 @@ connection.makeOffer(
99
77
callPipe: [
100
78
[' getSwapManagerForBrand' , [amountToGive .brand ]],
101
79
[' makeSwapOffer' ]
80
+ ]
102
81
},
103
82
{
104
83
give: { In: amountToGive },
@@ -113,7 +92,7 @@ connection.makeOffer(
113
92
console .log (' Transaction submitted:' , data .txn );
114
93
console .log (' Offer id:' , data .offerId );
115
94
}
116
- if (status === ' refunded' )
95
+ if (status === ' refunded' ) {
117
96
console .log (' Offer refunded' );
118
97
}
119
98
if (status === ' accepted' ) {
0 commit comments