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 main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func main() { | |
fmt.Println("Serving files in the current directory on port 8080") |
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
curl --location 'https://api.thegraph.com/subgraphs/name/ensdomains/ens' \ | |
--header 'Content-Type: application/json' \ | |
--data '{ | |
"query": "query getRecords($id: String!) {\n domain(id: $id) {\n name\n isMigrated\n createdAt\n resolver {\n texts\n coinTypes\n contentHash\n addr {\n id\n }\n }\n id\n }\n}", | |
"variables": { | |
"id": "0xee6c4522aab0003e8d14cd40a6af439055fd2577951148c14b6cea9a53475835" | |
}, | |
"operationName": "getRecords" | |
}' |
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
#!/bin/bash | |
# Check if the correct number of arguments were provided | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 image_directory file_extension compression_quality" | |
exit 1 | |
fi | |
dir="$1" | |
ext="${2:-png}" |
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
*~ | |
.vscode | |
node_modules/ |
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
// Copyright © 2017-2020 Trust Wallet. | |
// | |
// This file is part of Trust. The full Trust copyright notice, including | |
// terms governing use, modification, and redistribution, is contained in the | |
// file LICENSE at the root of the source code distribution tree. | |
import Security | |
@_cdecl("random32") | |
public func random32() -> UInt32 { | |
var bytes = [UInt8](repeating: 0, count: 32) |
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
var testEndpointCORS = (url) => { | |
var method = "POST"; | |
var xhr = new XMLHttpRequest(); | |
var json = { | |
jsonrpc: "2.0", | |
method: "eth_getBlockByHash", | |
params: [ | |
"0xb3b20624f8f0f86eb50dd04688409e5cea4bd02d700bf6e79e9384d47d6a5a35", | |
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
#!/usr/bin/env node | |
const { utils } = require('ethers'); | |
const secp256k1 = require('secp256k1'); | |
function ethereumMessage(str) { | |
const data = Buffer.from(str, 'utf8'); | |
const prefix = Buffer.from( | |
`\u{19}Ethereum Signed Message:\n${data.length}`, | |
'utf8', |
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 main | |
// #cgo CFLAGS: -I${SRCDIR}/wallet-core/include | |
// #cgo LDFLAGS: -L${SRCDIR}/wallet-core/build/ios -lTrezorCrypto -lTrustWalletCore -lprotobuf -lc++ | |
// #include <TrustWalletCore/TWHDWallet.h> | |
// #include <TrustWalletCore/TWString.h> | |
import "C" | |
import "fmt" |
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
#!/bin/bash | |
plistbuddy=/usr/libexec/PlistBuddy | |
result="result.md" | |
rm -rf $result && touch $result | |
for ipa in *.ipa | |
do | |
info=$(unzip -l $ipa | grep -Eo 'Payload/[^/]+/Info.plist') | |
directory=$(dirname "$info") | |
app=$(basename "$directory") |
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
func testKusama() { | |
let key = PrivateKey(data: Data(hexString: "0x85fca134b3fe3fd523d8b528608d803890e26c93c86dc3d97b8d59c7b3540c97")!)! | |
let pubkey = key.getPublicKeyEd25519() | |
print("public key", pubkey.data.hexString) | |
let preimage = Data([0x2]) + pubkey.data | |
print("preimage", preimage.hexString) | |
let hash = Hash.blake2b(data: "SS58PRE".data(using: .utf8)! + preimage, size: 64) | |
print("blake2b hash", hash.hexString) | |
let decoded = Base58.decodeNoCheck(string: "HewiDTQv92L2bVtkziZC8ASxrFUxr6ajQ62RXAnwQ8FDVmg")! | |
let checksum = hash[0..<2] |
NewerOlder