-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'custom-content-types' of https://github.com/xmtp/xmtp-r…
…eact-native into np/custom-content-types-android
- Loading branch information
Showing
36 changed files
with
9,406 additions
and
11,372 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ["universe/native", "universe/web"], | ||
ignorePatterns: ["build"], | ||
}; | ||
extends: ['universe/native', 'universe/web'], | ||
ignorePatterns: ['build'], | ||
plugins: ['prettier'], | ||
globals: { | ||
__dirname: true, | ||
}, | ||
} |
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 @@ | ||
name: Lint | ||
on: | ||
pull_request: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
- run: npm install | ||
- run: npm run eslint |
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,7 @@ | ||
module.exports = { | ||
semi: false, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
arrowParens: 'always', | ||
printWidth: 80, | ||
} |
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
const path = require("path"); | ||
const path = require('path') | ||
module.exports = function (api) { | ||
api.cache(true); | ||
api.cache(true) | ||
return { | ||
presets: ["babel-preset-expo"], | ||
presets: ['babel-preset-expo'], | ||
plugins: [ | ||
[ | ||
"module-resolver", | ||
'module-resolver', | ||
{ | ||
extensions: [".tsx", ".ts", ".js", ".json"], | ||
extensions: ['.tsx', '.ts', '.js', '.json'], | ||
alias: { | ||
// For development, we want to alias the library to the source | ||
"xmtp-react-native-sdk": path.join( | ||
'xmtp-react-native-sdk': path.join( | ||
__dirname, | ||
"..", | ||
"src", | ||
"index.ts", | ||
'..', | ||
'src', | ||
'index.ts' | ||
), | ||
}, | ||
}, | ||
], | ||
"@babel/plugin-proposal-export-namespace-from", | ||
'@babel/plugin-proposal-export-namespace-from', | ||
], | ||
}; | ||
}; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,37 +1,37 @@ | ||
let Client = require("@xmtp/xmtp-js").Client; | ||
let Wallet = require("ethers").Wallet; | ||
const Client = require('@xmtp/xmtp-js').Client | ||
const Wallet = require('ethers').Wallet | ||
|
||
console.log("NODE VERSION", process.version); | ||
console.log('NODE VERSION', process.version) | ||
|
||
// 0xf4BF19Ed562651837bc11ff975472ABd239D35B5 | ||
const keyBytes = [ | ||
80, 7, 53, 52, 122, 163, 75, 130, 199, 86, 216, 14, 29, 2, 255, 71, 121, 51, | ||
165, 3, 208, 178, 193, 207, 223, 217, 75, 247, 84, 78, 204, 3, | ||
]; | ||
] | ||
|
||
async function checkAll() { | ||
const wallet = new Wallet(keyBytes); | ||
const wallet = new Wallet(keyBytes) | ||
const client = await Client.create(wallet, { | ||
apiUrl: "http://wakunode:5555", | ||
}); | ||
apiUrl: 'http://wakunode:5555', | ||
}) | ||
|
||
console.log("Listening…"); | ||
console.log('Listening…') | ||
|
||
try { | ||
for await (const message of await client.conversations.streamAllMessages()) { | ||
if (message.senderAddress === wallet.address) { | ||
continue; | ||
continue | ||
} | ||
|
||
await message.conversation.send({ | ||
text: "HI " + message.senderAddress, | ||
}); | ||
console.log(`Replied to ${message.senderAddress}`); | ||
text: 'HI ' + message.senderAddress, | ||
}) | ||
console.log(`Replied to ${message.senderAddress}`) | ||
} | ||
} catch (e) { | ||
console.info(`Error:`, e); | ||
await checkAll(); | ||
console.info(`Error:`, e) | ||
await checkAll() | ||
} | ||
} | ||
|
||
checkAll().then(() => console.log("Done")); | ||
checkAll().then(() => console.log('Done')) |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { registerRootComponent } from "expo"; | ||
import { registerRootComponent } from 'expo' | ||
|
||
import App from "./App"; | ||
import App from './App' | ||
|
||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App); | ||
// It also ensures that whether you load the app in Expo Go or in a native build, | ||
// the environment is set up appropriately | ||
registerRootComponent(App); | ||
registerRootComponent(App) |
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
// Learn more https://docs.expo.io/guides/customizing-metro | ||
const { getDefaultConfig } = require("expo/metro-config"); | ||
const path = require("path"); | ||
const { getDefaultConfig } = require('expo/metro-config') | ||
const path = require('path') | ||
|
||
const config = getDefaultConfig(__dirname); | ||
const extraNodeModules = require("node-libs-browser"); | ||
config.resolver.extraNodeModules = extraNodeModules; | ||
const config = getDefaultConfig(__dirname) | ||
const extraNodeModules = require('node-libs-browser') | ||
config.resolver.extraNodeModules = extraNodeModules | ||
// npm v7+ will install ../node_modules/react-native because of peerDependencies. | ||
// To prevent the incompatible react-native bewtween ./node_modules/react-native and ../node_modules/react-native, | ||
// excludes the one from the parent folder when bundling. | ||
config.resolver.blockList = [ | ||
...Array.from(config.resolver.blockList ?? []), | ||
new RegExp(path.resolve("..", "node_modules", "react-native")), | ||
]; | ||
new RegExp(path.resolve('..', 'node_modules', 'react-native')), | ||
] | ||
|
||
config.resolver.nodeModulesPaths = [ | ||
path.resolve(__dirname, "./node_modules"), | ||
path.resolve(__dirname, "../node_modules"), | ||
]; | ||
path.resolve(__dirname, './node_modules'), | ||
path.resolve(__dirname, '../node_modules'), | ||
] | ||
|
||
config.watchFolders = [path.resolve(__dirname, "..")]; | ||
config.watchFolders = [path.resolve(__dirname, '..')] | ||
|
||
config.transformer.getTransformOptions = async () => ({ | ||
transform: { | ||
experimentalImportSupport: false, | ||
inlineRequires: true, | ||
}, | ||
}); | ||
}) | ||
|
||
module.exports = config; | ||
module.exports = config |
Oops, something went wrong.