Skip to content

Commit

Permalink
Merge pull request #63 from Agoric/pc/fix-wallet-connection
Browse files Browse the repository at this point in the history
fix: wallet connection and chainStorageWatcher
  • Loading branch information
0xpatrickdev authored Feb 3, 2024
2 parents 307783b + 2e808bb commit 1f74994
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 4,340 deletions.
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@agoric/rpc": "0.9.1-dev-f471a83.0",
"@agoric/store": "^0.9.2",
"@agoric/ui-components": "^0.9.0",
"@agoric/web-components": "0.12.0",
"@agoric/web-components": "^0.15.0",
"@testing-library/react": "^14.1.2",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
Expand Down
12 changes: 7 additions & 5 deletions ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ const terms = {

type Wallet = Awaited<ReturnType<typeof makeAgoricWalletConnection>>;

const watcher = makeAgoricChainStorageWatcher(
'http://localhost:26657',
'agoriclocal',
);
const ENDPOINTS = {
RPC: 'http://localhost:26657',
API: 'http://localhost:1317',
};

const watcher = makeAgoricChainStorageWatcher(ENDPOINTS.API, 'agoriclocal');

interface CopyBag<T = string> {
payload: Array<[T, bigint]>;
Expand Down Expand Up @@ -84,7 +86,7 @@ const setup = async () => {

const connectWallet = async () => {
await suggestChain('https://local.agoric.net/network-config');
const wallet = await makeAgoricWalletConnection(watcher);
const wallet = await makeAgoricWalletConnection(watcher, ENDPOINTS.RPC);
useAppStore.setState({ wallet });
const { pursesNotifier } = wallet;
for await (const purses of subscribeLatest(pursesNotifier)) {
Expand Down
Loading

0 comments on commit 1f74994

Please sign in to comment.