From cf587f6736c4c4753c14186dba9c75cbda6f6d36 Mon Sep 17 00:00:00 2001 From: Alex Risch Date: Tue, 6 Feb 2024 11:44:24 -0700 Subject: [PATCH] Group Chat Installed groupd chat version Added mls opt in --- ios/Podfile.lock | 18 ++++++++-------- package.json | 2 +- src/context/ClientContext.tsx | 6 ++++-- .../OnboardingEnableIdentityScreen.tsx | 2 ++ yarn.lock | 21 ++++++++++++------- 5 files changed, 30 insertions(+), 19 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a91c1fc..de3299e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -110,6 +110,7 @@ PODS: - hermes-engine/Pre-built (= 0.73.0) - hermes-engine/Pre-built (0.73.0) - libevent (2.1.12) + - LibXMTP (0.4.1-beta0) - Logging (1.0.0) - MessagePacker (0.4.7) - MMKV (1.3.2): @@ -1216,17 +1217,16 @@ PODS: - GenericJSON (~> 2.0) - Logging (~> 1.0.0) - secp256k1.swift (~> 0.1) - - XMTP (0.7.7-alpha0): + - XMTP (0.7.8-alpha0): - Connect-Swift (= 0.3.0) - GzipSwift + - LibXMTP (= 0.4.1-beta0) - web3.swift - - XMTPRust (= 0.3.7-beta0) - - XMTPReactNative (1.25.1): + - XMTPReactNative (1.27.0-beta.1): - ExpoModulesCore - MessagePacker - secp256k1.swift - - XMTP (= 0.7.7-alpha0) - - XMTPRust (0.3.7-beta0) + - XMTP (= 0.7.8-alpha0) - Yoga (1.14.0) DEPENDENCIES: @@ -1355,6 +1355,7 @@ SPEC REPOS: - GenericJSON - GzipSwift - libevent + - LibXMTP - Logging - MessagePacker - MMKV @@ -1365,7 +1366,6 @@ SPEC REPOS: - SwiftProtobuf - web3.swift - XMTP - - XMTPRust EXTERNAL SOURCES: boost: @@ -1565,6 +1565,7 @@ SPEC CHECKSUMS: GzipSwift: 893f3e48e597a1a4f62fafcb6514220fcf8287fa hermes-engine: 34304f8c6e8fa68f63a5fe29af82f227d817d7a7 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 + LibXMTP: a3bb8d00c275034e55f1f7bf632335821c792d3c Logging: 9ef4ecb546ad3169398d5a723bc9bea1c46bef26 MessagePacker: ab2fe250e86ea7aedd1a9ee47a37083edd41fd02 MMKV: f21593c0af4b3f2a0ceb8f820f28bb639ea22bb7 @@ -1634,9 +1635,8 @@ SPEC CHECKSUMS: SwiftProtobuf: b02b5075dcf60c9f5f403000b3b0c202a11b6ae1 WatermelonDB: 842d22ba555425aa9f3ce551239a001200c539bc web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959 - XMTP: b2488aa96eced55fd41a5aece1334be6b5ab622d - XMTPReactNative: 5c1ce9decb8722bbbe8cf41dd2179d60f56078f9 - XMTPRust: 8848a2ba761b2c961d666632f2ad27d1082faa93 + XMTP: 7c308fde3213aa0b0ad8198c9984932260f22b65 + XMTPReactNative: 9e0ad9cc76f6156727baf3767259151a5ff7faac Yoga: e64aa65de36c0832d04e8c7bd614396c77a80047 PODFILE CHECKSUM: c765268d8eab018a5f4619e1d00ca4dab437bc4f diff --git a/package.json b/package.json index 7100d18..26183a7 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@tanstack/react-query": "^5.17.19", "@thirdweb-dev/react-native": "^0.5.4", "@thirdweb-dev/react-native-compat": "^0.5.4", - "@xmtp/react-native-sdk": "1.25.1", + "@xmtp/react-native-sdk": "1.27.0-beta.1", "aws-sdk": "^2.1540.0", "ethers": "^5", "expo": ">=50.0.0-0 <51.0.0", diff --git a/src/context/ClientContext.tsx b/src/context/ClientContext.tsx index 9862225..60706e4 100644 --- a/src/context/ClientContext.tsx +++ b/src/context/ClientContext.tsx @@ -7,6 +7,7 @@ import React, { useEffect, useState, } from 'react'; +import {AppConfig} from '../consts/AppConfig'; import {getClientKeys} from '../services/encryptedStorage'; interface ClientContextValue { @@ -39,9 +40,10 @@ export const ClientProvider: FC = ({children}) => { } Client.createFromKeyBundle(keys, { codecs: [new RemoteAttachmentCodec()], + enableAlphaMls: AppConfig.GROUPS_ENABLED, }) - .then(client => { - setClient(client); + .then(newClient => { + setClient(newClient); setLoading(false); }) .catch(() => { diff --git a/src/screens/OnboardingEnableIdentityScreen.tsx b/src/screens/OnboardingEnableIdentityScreen.tsx index 12ff3cf..4cdb547 100644 --- a/src/screens/OnboardingEnableIdentityScreen.tsx +++ b/src/screens/OnboardingEnableIdentityScreen.tsx @@ -7,6 +7,7 @@ import {Button} from '../components/common/Button'; import {Icon} from '../components/common/Icon'; import {Screen} from '../components/common/Screen'; import {Text} from '../components/common/Text'; +import {AppConfig} from '../consts/AppConfig'; import {EventEmitterEvents} from '../consts/EventEmitters'; import {useClientContext} from '../context/ClientContext'; import {useTypedNavigation} from '../hooks/useTypedNavigation'; @@ -53,6 +54,7 @@ export const OnboardingEnableIdentityScreen = () => { } try { const client = await Client.create(signer, { + enableAlphaMls: AppConfig.GROUPS_ENABLED, preEnableIdentityCallback: async () => { await enableIdentityPromise; }, diff --git a/yarn.lock b/yarn.lock index 0e3a16d..fd3eea5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5962,7 +5962,7 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/hashes@1.3.3", "@noble/hashes@^1.3.2", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1", "@noble/hashes@~1.3.2": +"@noble/hashes@1.3.3", "@noble/hashes@^1.3.2", "@noble/hashes@^1.3.3", "@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1", "@noble/hashes@~1.3.2": version "1.3.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== @@ -9350,15 +9350,17 @@ rxjs "^7.8.0" undici "^5.8.1" -"@xmtp/react-native-sdk@1.25.1": - version "1.25.1" - resolved "https://registry.yarnpkg.com/@xmtp/react-native-sdk/-/react-native-sdk-1.25.1.tgz#e18ade85faed1a80c2af6ffa6b108244134f0255" - integrity sha512-JeeWsvyhhzxYpp99foNApBEmMSQnzZHg+Me9arDzQ+xoM+9tGX1Jpc2vSh3l2OL06QzFXxR68YKlEJ6g/xDhtw== +"@xmtp/react-native-sdk@1.27.0-beta.1": + version "1.27.0-beta.1" + resolved "https://registry.yarnpkg.com/@xmtp/react-native-sdk/-/react-native-sdk-1.27.0-beta.1.tgz#ca6227207007f3d7411d22de1966ba8218567d05" + integrity sha512-gqXI9kzmEjq7p1sZOc++prf7t60s5cpVRIn6oYph1qbs8/Vk9C+k/PmO7cfpxgXFRIdAjIOucaMX7Lf2Aie3WA== dependencies: + "@ethersproject/bytes" "^5.7.0" "@msgpack/msgpack" "^3.0.0-beta2" + "@noble/hashes" "^1.3.3" "@xmtp/proto" "^3.25.0" buffer "^6.0.3" - ethers "^5.7.2" + text-encoding "^0.7.0" "@yarnpkg/lockfile@^1.1.0": version "1.1.0" @@ -12133,7 +12135,7 @@ ethereumjs-util@^7.1.3, ethereumjs-util@^7.1.5: ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@5.7.2, ethers@^5, ethers@^5.7.2: +ethers@5.7.2, ethers@^5: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -18395,6 +18397,11 @@ text-encoding-utf-8@^1.0.2: resolved "https://registry.yarnpkg.com/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz#585b62197b0ae437e3c7b5d0af27ac1021e10d13" integrity sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg== +text-encoding@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.7.0.tgz#f895e836e45990624086601798ea98e8f36ee643" + integrity sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA== + text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"