Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove V2 JS SDK and other dependencies #1531

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ module.exports = {
alias: {
"fast-text-encoding": "text-encoding",
crypto: "crypto-browserify",
// This entrypoint mapping is done in @xmtp/user-preferences-bindings-wasm's "exports" in package.json
// but we don't want to enable unstable_enablePackageExports for now in metro.config.js
"@xmtp/user-preferences-bindings-wasm/web":
"@xmtp/user-preferences-bindings-wasm/dist/web/user_preferences_bindings_wasm",
"react-native-webview": "react-native-webview/src/index.ts",

// Folder aliases
Expand Down
3 changes: 2 additions & 1 deletion config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { DEFAULT_SUPPORTED_CHAINS } from "@utils/evm/wallets";
import { XmtpEnv } from "@xmtp/xmtp-js";
import { Platform } from "react-native";
import { base, baseSepolia } from "wagmi/chains";
import { getApiUri } from "./utils/apiConfig";
import { Environments, isDev, isPreview } from "./utils/getEnv";

type XmtpEnv = "local" | "dev" | "production";

declare const process: {
env: {
[key: string]: string;
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ios": "expo run:ios",
"ios:checkBuildDeps": "./scripts/ios/checkBuildDeps.sh",
"run:ios": "EXPO_ENV=dev expo run:ios",
"postinstall": "patch-package && node scripts/wasm.js && husky install && cross-os postinstall",
"postinstall": "patch-package && husky install && cross-os postinstall",
"start": "EXPO_ENV=dev expo start --scheme converse-dev",
"start:preview": "EXPO_ENV=preview expo start",
"test": "echo \"➜ Running tests...\" && jest --testPathIgnorePatterns='.*\\.perf-test\\.tsx$'",
Expand Down Expand Up @@ -77,15 +77,11 @@
"@thirdweb-dev/react-native-adapter": "^1.5.0",
"@walletconnect/react-native-compat": "^2.17.1",
"@web3modal/ethers5": "^3.5.5",
"@xmtp/content-type-reaction": "^1.1.7",
"@xmtp/content-type-read-receipt": "^1.1.9",
"@xmtp/content-type-remote-attachment": "^1.1.8",
"@xmtp/content-type-reply": "^1.1.9",
"@xmtp/content-type-transaction-reference": "^1.0.3",
"@xmtp/content-type-primitives": "^2.0.0",
"@xmtp/content-type-transaction-reference": "^2.0.0",
"@xmtp/frames-client": "^0.5.4",
"@xmtp/proto": "^3.60.0",
"@xmtp/react-native-sdk": "^3.1.6",
"@xmtp/xmtp-js": "11.5.0",
"@xstate/react": "^5.0.0",
"@yornaath/batshit": "^0.10.1",
"alchemy-sdk": "^3.4.4",
Expand Down
13 changes: 0 additions & 13 deletions patches/@xmtp+user-preferences-bindings-wasm+0.3.6.patch

This file was deleted.

Binary file not shown.
14 changes: 0 additions & 14 deletions scripts/wasm.js

This file was deleted.

21 changes: 0 additions & 21 deletions utils/test/xmtp.ts

This file was deleted.

7 changes: 5 additions & 2 deletions utils/xmtpRN/content-types/coinbasePayment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ContentTypeId } from "@xmtp/xmtp-js";
import type { ContentCodec, EncodedContent } from "@xmtp/xmtp-js";
import { ContentTypeId } from "@xmtp/content-type-primitives";
import type {
ContentCodec,
EncodedContent,
} from "@xmtp/content-type-primitives";

const ContentTypeCoinbasePayment = new ContentTypeId({
authorityId: "coinbase.com",
Expand Down
12 changes: 5 additions & 7 deletions utils/xmtpRN/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { setupAccountTopicSubscription } from "@/features/notifications/utils/ac
import { getChatStore } from "@data/store/accountsStore";
import logger from "@utils/logger";
import { retryWithBackoff } from "@utils/retryWithBackoff";
import { Client } from "@xmtp/xmtp-js";
import { AppState } from "react-native";
import {
getXmtpClientFromAddress,
Expand All @@ -18,13 +17,12 @@ import {
import { stopStreamingAllMessage, streamAllMessages } from "./messages";

const instantiatingClientForAccount: {
[account: string]: Promise<ConverseXmtpClientType | Client> | undefined;
[account: string]: Promise<ConverseXmtpClientType> | undefined;
} = {};

export const getXmtpClient = async (
account: string
// todo(any): why is this Union necessary? Why can't we just use ConverseXmtpClientType?
): Promise<ConverseXmtpClientType | Client> => {
): Promise<ConverseXmtpClientType> => {
const lowerCaseAccount = account.toLowerCase();
if (account && xmtpClientByAccount[lowerCaseAccount]) {
return xmtpClientByAccount[lowerCaseAccount];
Expand Down Expand Up @@ -53,9 +51,9 @@ export const getXmtpClient = async (
delete instantiatingClientForAccount[lowerCaseAccount];
}
})();
return instantiatingClientForAccount[lowerCaseAccount] as Promise<
ConverseXmtpClientType | Client
>;
return instantiatingClientForAccount[
lowerCaseAccount
] as Promise<ConverseXmtpClientType>;
};

export const onSyncLost = async (account: string, error: any) => {
Expand Down
165 changes: 26 additions & 139 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7048,7 +7048,7 @@ __metadata:
languageName: node
linkType: hard

"@noble/secp256k1@npm:1.7.1, @noble/secp256k1@npm:^1.5.2, @noble/secp256k1@npm:^1.7.1":
"@noble/secp256k1@npm:^1.5.2":
version: 1.7.1
resolution: "@noble/secp256k1@npm:1.7.1"
checksum: 10c0/48091801d39daba75520012027d0ff0b1719338d96033890cfe0d287ad75af00d82769c0194a06e7e4fbd816ae3f204f4a59c9e26f0ad16b429f7e9b5403ccd5
Expand Down Expand Up @@ -12279,63 +12279,21 @@ __metadata:
languageName: node
linkType: hard

"@xmtp/content-type-reaction@npm:^1.1.7":
version: 1.1.7
resolution: "@xmtp/content-type-reaction@npm:1.1.7"
dependencies:
"@xmtp/xmtp-js": "npm:^11.3.12"
peerDependencies:
"@xmtp/xmtp-js": ^11.1.1
checksum: 10c0/d9fa2aa36c82e522606558f926e9f8dfa8565094418854d4713716472065d0a86fd6a377a4b8d88b53e7d2bda686c2da4eee11d23f13e9d1091c8faa5cc40c8d
languageName: node
linkType: hard

"@xmtp/content-type-read-receipt@npm:^1.1.9":
version: 1.1.9
resolution: "@xmtp/content-type-read-receipt@npm:1.1.9"
dependencies:
"@xmtp/proto": "npm:^3.29.0"
"@xmtp/xmtp-js": "npm:^11.3.12"
peerDependencies:
"@xmtp/xmtp-js": ^11.1.1
checksum: 10c0/16cf621c4beef016bd3b3a428c387f45cf8f3599e20b9e48e06b8cd617e06252e7e0b0bb94cb3621cc8211acd42ac2f518beb65974d10f468aa9650def25c59a
languageName: node
linkType: hard

"@xmtp/content-type-remote-attachment@npm:^1.1.8":
version: 1.1.8
resolution: "@xmtp/content-type-remote-attachment@npm:1.1.8"
dependencies:
"@noble/secp256k1": "npm:^1.7.1"
"@xmtp/proto": "npm:^3.29.0"
"@xmtp/xmtp-js": "npm:^11.3.12"
peerDependencies:
"@xmtp/xmtp-js": ^11.1.1
checksum: 10c0/05cab26468ce4d221e036debaa377c598e3cdb3543cc930a257c24044e619210a4a0614a47a1dad22997fcc937b07962d01407f834a95be4023fcddee6e8cec2
languageName: node
linkType: hard

"@xmtp/content-type-reply@npm:^1.1.9":
version: 1.1.9
resolution: "@xmtp/content-type-reply@npm:1.1.9"
"@xmtp/content-type-primitives@npm:^2.0.0":
version: 2.0.0
resolution: "@xmtp/content-type-primitives@npm:2.0.0"
dependencies:
"@xmtp/proto": "npm:^3.29.0"
"@xmtp/xmtp-js": "npm:^11.3.12"
peerDependencies:
"@xmtp/xmtp-js": ^11.1.1
checksum: 10c0/e2bd7f4242897f510bac202d7c4ebc175bca26d321b382981940a20838569a7a02afb8ed97d3dd8916be9277526559e121478d32d0850c2881653d50794946f7
"@xmtp/proto": "npm:^3.72.0"
checksum: 10c0/6e882168cea89e92f4f7c9fe1e3b0106d20ab032b1216afce7a65a741076bf6205f66701cc65c7afd84dcaa48dd0716d83138b310906abb74ec846a05a33062c
languageName: node
linkType: hard

"@xmtp/content-type-transaction-reference@npm:^1.0.3":
version: 1.0.3
resolution: "@xmtp/content-type-transaction-reference@npm:1.0.3"
"@xmtp/content-type-transaction-reference@npm:^2.0.0":
version: 2.0.0
resolution: "@xmtp/content-type-transaction-reference@npm:2.0.0"
dependencies:
"@xmtp/proto": "npm:^3.29.0"
"@xmtp/xmtp-js": "npm:^11.3.12"
peerDependencies:
"@xmtp/xmtp-js": ^11.3.2
checksum: 10c0/aceca2a8ee1593fa68957895e81db0eff9a79ae32c7262fe17c0ee60b94a2facb81e428764f8eb800e7e6a5fb5a945f1026e9b6c7a01375a91ae23e7a1769d20
"@xmtp/content-type-primitives": "npm:^2.0.0"
checksum: 10c0/f2889a44834d74f791ed74862709073fa9d0943e7e4ab0d2d798abdaec6768c2382db0b41a85e0b6183334394e206ab82901dbd0da56bde7113b42996aa1bcca
languageName: node
linkType: hard

Expand All @@ -12353,18 +12311,6 @@ __metadata:
languageName: node
linkType: hard

"@xmtp/proto@npm:3.45.0":
version: 3.45.0
resolution: "@xmtp/proto@npm:3.45.0"
dependencies:
long: "npm:^5.2.0"
protobufjs: "npm:^7.0.0"
rxjs: "npm:^7.8.0"
undici: "npm:^5.8.1"
checksum: 10c0/fb04f27443f6893c668bbad62a015ff7c5706ddd563da26fbf88f478486035c55d41220d8023d4d52316cd2d7a9c2e3c33e3aeda07433abe3896482f78b95c30
languageName: node
linkType: hard

"@xmtp/proto@npm:3.54.0":
version: 3.54.0
resolution: "@xmtp/proto@npm:3.54.0"
Expand All @@ -12389,7 +12335,7 @@ __metadata:
languageName: node
linkType: hard

"@xmtp/proto@npm:^3.29.0, @xmtp/proto@npm:^3.60.0":
"@xmtp/proto@npm:^3.60.0":
version: 3.60.0
resolution: "@xmtp/proto@npm:3.60.0"
dependencies:
Expand All @@ -12401,6 +12347,18 @@ __metadata:
languageName: node
linkType: hard

"@xmtp/proto@npm:^3.72.0":
version: 3.72.4
resolution: "@xmtp/proto@npm:3.72.4"
dependencies:
long: "npm:^5.2.0"
protobufjs: "npm:^7.0.0"
rxjs: "npm:^7.8.0"
undici: "npm:^5.8.1"
checksum: 10c0/39b4930de9582fea3d1d907e96c2a9baf51a8d36257a736c1f605fc3cc70bed15b22c498b55d13c0dd1b37c8b8ffd804412dfe1769ef12e42e8479759ceff0e1
languageName: node
linkType: hard

"@xmtp/react-native-sdk@npm:^3.1.6":
version: 3.1.6
resolution: "@xmtp/react-native-sdk@npm:3.1.6"
Expand All @@ -12420,28 +12378,6 @@ __metadata:
languageName: node
linkType: hard

"@xmtp/user-preferences-bindings-wasm@npm:^0.3.6":
version: 0.3.6
resolution: "@xmtp/user-preferences-bindings-wasm@npm:0.3.6"
checksum: 10c0/8a28468e3c82c85157dd7962485fec2712f448aa510fb46c51ea0e01139b0e316aa52ecbbc4a84604b254aa848e045dd378b1c116465c7739926a9a0bb4425f6
languageName: node
linkType: hard

"@xmtp/xmtp-js@npm:11.5.0, @xmtp/xmtp-js@npm:^11.3.12":
version: 11.5.0
resolution: "@xmtp/xmtp-js@npm:11.5.0"
dependencies:
"@noble/secp256k1": "npm:1.7.1"
"@xmtp/proto": "npm:3.45.0"
"@xmtp/user-preferences-bindings-wasm": "npm:^0.3.6"
async-mutex: "npm:^0.5.0"
elliptic: "npm:^6.5.4"
long: "npm:^5.2.3"
viem: "npm:2.7.15"
checksum: 10c0/039dedaeafdf3d2c72536271f663b6b75caab294c5bcd3b8c3e47e32fb716a6959b22722366c03c111bcd82278ae9303fe76cd3099dd6ad8c272d0043799b897
languageName: node
linkType: hard

"@xstate/react@npm:^5.0.0":
version: 5.0.0
resolution: "@xstate/react@npm:5.0.0"
Expand Down Expand Up @@ -12529,21 +12465,6 @@ __metadata:
languageName: node
linkType: hard

"abitype@npm:1.0.0":
version: 1.0.0
resolution: "abitype@npm:1.0.0"
peerDependencies:
typescript: ">=5.0.4"
zod: ^3 >=3.22.0
peerDependenciesMeta:
typescript:
optional: true
zod:
optional: true
checksum: 10c0/d685351a725c49f81bdc588e2f3825c28ad96c59048d4f36bf5e4ef30935c31f7e60b5553c70177b77a9e4d8b04290eea43d3d9c1c2562cb130381c88b15d39f
languageName: node
linkType: hard

"abitype@npm:1.0.6":
version: 1.0.6
resolution: "abitype@npm:1.0.6"
Expand Down Expand Up @@ -13254,15 +13175,6 @@ __metadata:
languageName: node
linkType: hard

"async-mutex@npm:^0.5.0":
version: 0.5.0
resolution: "async-mutex@npm:0.5.0"
dependencies:
tslib: "npm:^2.4.0"
checksum: 10c0/9096e6ad6b674c894d8ddd5aa4c512b09bb05931b8746ebd634952b05685608b2b0820ed5c406e6569919ff5fe237ab3c491e6f2887d6da6b6ba906db3ee9c32
languageName: node
linkType: hard

"async-retry@npm:1.2.3":
version: 1.2.3
resolution: "async-retry@npm:1.2.3"
Expand Down Expand Up @@ -15227,15 +15139,11 @@ __metadata:
"@walletconnect/react-native-compat": "npm:^2.17.1"
"@web3modal/ethers5": "npm:^3.5.5"
"@welldone-software/why-did-you-render": "npm:^8.0.3"
"@xmtp/content-type-reaction": "npm:^1.1.7"
"@xmtp/content-type-read-receipt": "npm:^1.1.9"
"@xmtp/content-type-remote-attachment": "npm:^1.1.8"
"@xmtp/content-type-reply": "npm:^1.1.9"
"@xmtp/content-type-transaction-reference": "npm:^1.0.3"
"@xmtp/content-type-primitives": "npm:^2.0.0"
"@xmtp/content-type-transaction-reference": "npm:^2.0.0"
"@xmtp/frames-client": "npm:^0.5.4"
"@xmtp/proto": "npm:^3.60.0"
"@xmtp/react-native-sdk": "npm:^3.1.6"
"@xmtp/xmtp-js": "npm:11.5.0"
"@xstate/react": "npm:^5.0.0"
"@yornaath/batshit": "npm:^0.10.1"
alchemy-sdk: "npm:^3.4.4"
Expand Down Expand Up @@ -32274,27 +32182,6 @@ __metadata:
languageName: node
linkType: hard

"viem@npm:2.7.15":
version: 2.7.15
resolution: "viem@npm:2.7.15"
dependencies:
"@adraffy/ens-normalize": "npm:1.10.0"
"@noble/curves": "npm:1.2.0"
"@noble/hashes": "npm:1.3.2"
"@scure/bip32": "npm:1.3.2"
"@scure/bip39": "npm:1.2.1"
abitype: "npm:1.0.0"
isows: "npm:1.0.3"
ws: "npm:8.13.0"
peerDependencies:
typescript: ">=5.0.4"
peerDependenciesMeta:
typescript:
optional: true
checksum: 10c0/c9e987d959e5b91578fc0082a4142a83832d27575ec23fdafd7569d46acaa6f65ccd4c8a5a0b3ebfac8bfe0b2d74cd48d7e51357701806d9bebb9607077b242a
languageName: node
linkType: hard

"viem@npm:^1.0.0, viem@npm:^1.1.4":
version: 1.21.4
resolution: "viem@npm:1.21.4"
Expand Down
Loading