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
// package and imports | |
@Singleton | |
class MyPreferences | |
@Inject constructor(val context: Context) { | |
companion object { | |
private const val PREF_FILE_NAME = "pg_cfg" |
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
package io.jackqack.hodler.utils | |
import android.content.Context | |
import android.os.Build | |
import android.os.VibrationEffect | |
import android.os.Vibrator | |
object Vibrator { | |
private const val VIBRATE_LENGTH_LONG_TOUCH = 50L |
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
/** | |
* Simple [TextView.OnEditorActionListener] implementation for handling IME action | |
* @param onAction called when IME action selected or Enter is clicked | |
*/ | |
class EnterActionListener(private val onAction: () -> Unit) : TextView.OnEditorActionListener { | |
override fun onEditorAction(v: TextView?, actionId: Int, event: KeyEvent?): Boolean { | |
// If triggered by an enter key, this is the event; otherwise, this is null. | |
// if shift key is down, then we want to insert the '\n' char in the TextView; | |
if (event == null || event.isShiftPressed) return false |
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
import android.util.Log | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.cancel | |
import kotlinx.coroutines.withContext | |
import net.monetizemyapp.toolbox.extentions.toHexString | |
import okio.* | |
import java.net.Socket | |
import javax.net.ssl.SSLSocketFactory |
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
import { ethers, Wallet } from 'ethers' | |
// const ALCHEMY_URL = `https://eth-goerli.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_API_KEY!}` | |
const ETH_REGISTRAR_ADDRESS = '0x283Af0B28c62C092C9727F1Ee09c02CA627EB7F5' // goerli | |
const ETH_REGISTRAR_ABI = [ | |
'function available(string) view returns (bool)', | |
'function makeCommitment(string,address,bytes32) pure returns (bytes32)', | |
'function commit(bytes32)', | |
'function register(string,address,uint256,bytes32) payable', |
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
import { useLocalStorage } from "usehooks-ts" | |
import { RegistrationStep } from "../types" | |
// Registrations map example | |
// const registrations = { | |
// 'xdomain1.eth': { | |
// domain: 'xdomain1.eth', | |
// name: 'xdomain1', | |
// owner: '0x9C51161bA2FB02Cc0a403332B607117685f34831', |
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
import { MIN_COMMIT_TIME_S } from 'lib/constants' | |
import { useRegistration } from 'lib/hooks/storage' | |
import { RegistrationStatus } from 'lib/types' | |
import { useSigner, useFeeData, useAccount } from 'wagmi' | |
import { CommitmentForm } from './CommitmentForm' | |
import { RegisterStep } from './RegisterStep' | |
import { Success } from './Success' | |
import { WaitMinute } from './WaitMinute' | |
export const Step = ({ |
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
import { ethers } from 'ethers' | |
import { namehash } from 'ethers/lib/utils.js' | |
const ENS_RESOLVER_ADDRESS = '0x2800Ec5BAB9CE9226d19E0ad5BC607e3cfC4347E' // goerli | |
const ENS_RESOLVER_ABI = [ | |
'function addr(bytes32 node) external view returns (address)', | |
'function setAddr(bytes32 node, address a) external', | |
'function text(bytes32 node, string calldata key) external view returns (string memory)', | |
'function setText(bytes32 node, string calldata key, string calldata value) external', | |
'function multicall(bytes[] calldata data) external returns(bytes[] memory results)' |