- Install Android SDK command line tools only: https://developer.android.com/studio/#command-tools
- Extract .zip to
/opt/android/cmdline-tools/tools/
sudo chown -R $(whoami) /opt/android/
- For API Level 26:
/opt/android/cmdline-tools/tools/bin/sdkmanager "platforms;android-26" "build-tools;26.0.3" "add-ons;addon-google_apis-google-24"
npm install -g react-native-cli
react-native init ReactNativeProject
cd ReactNativeProject
- Plug in your android phone
yarn android
/npm run android
/react-native run-android
yarn start
/npm run start
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
const promiseCache = new Map(); | |
const responseCache = new Map(); | |
const buildCache = <TData>(cacheKey: string, cache: Map<string, TData>) => ({ | |
forget: () => cache.delete(cacheKey), | |
get: () => cache.get(cacheKey), | |
set: (data: TData) => cache.set(cacheKey, data), | |
}); | |
const getCache = <TData>(cacheKey: string) => { |
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
const { session, Stage } = require('telegraf') | |
const sceneSessionKey = 'sceneSession' | |
const scene = /* new Scene() */; | |
const stage = new Stage([scene], { sessionName: sceneSessionKey }) | |
const emptySessionScene = { | |
session: { __scenes: {} }, | |
expires: null | |
} |
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
pragma solidity ^0.8.0; | |
interface IERC20 { | |
function name() external view returns (string memory); | |
function symbol() external view returns (string memory); | |
function decimals() external view returns (uint8); | |
function totalSupply() external view returns (uint256); | |
function balanceOf(address account) external view returns (uint256); | |
} |
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
pragma solidity ^0.8.0; | |
interface IERC20 { | |
function name() external view returns (string memory); | |
function symbol() external view returns (string memory); | |
function decimals() external view returns (uint8); | |
function balanceOf(address account) external view returns (uint256); | |
} | |
interface IPancakePair { |
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
const Telegraf = require('telegraf') | |
const session = require('telegraf/session') | |
const Stage = require('telegraf/stage') | |
const Scene = require('telegraf/scenes/base') | |
const mongoose = require('mongoose') | |
require('dotenv').config() | |
const scheme = new mongoose.Schema({ | |
key: String, | |
session: {}, |