generated from MetaMask/template-snap-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from xmtp/rygine/js-sdk-upgrade
Upgrade JS SDK and proto packages
- Loading branch information
Showing
48 changed files
with
6,200 additions
and
3,251 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + React + TS</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
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
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
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
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,45 @@ | ||
import type { Client } from '@xmtp/xmtp-js'; | ||
import { useCallback } from 'react'; | ||
|
||
import { Button } from './Buttons'; | ||
import { Card } from './Card'; | ||
|
||
export const ListUserPreferences = ({ client }: { client: Client | null }) => { | ||
const handleList = useCallback(async () => { | ||
if (!client) { | ||
return; | ||
} | ||
try { | ||
const entries = await client.contacts.refreshConsentList(); | ||
const entriesString = entries | ||
.map((entry) => `${entry.key}:${entry.permissionType}`) | ||
.join('\n'); | ||
console.log('ENTRIES ======================='); | ||
console.log(entriesString); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}, [client]); | ||
|
||
if (!client) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Card | ||
content={{ | ||
title: 'List user preferences associated with connected client', | ||
description: 'List user preferences', | ||
button: ( | ||
<> | ||
<Button onClick={handleList} disabled={!client}> | ||
Execute | ||
</Button> | ||
</> | ||
), | ||
}} | ||
disabled={!client} | ||
fullWidth={false} | ||
/> | ||
); | ||
}; |
Oops, something went wrong.