This file contains hidden or 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
Verifying that +luisdeleon is my openname (Bitcoin username). https://onename.io/luisdeleon |
This file contains hidden or 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 hashlib | |
hash_object = hashlib.sha256(b'Hello World') | |
hex_dig = hash_object.hexdigest() | |
print(hex_dig) |
This file contains hidden or 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
// The data parameter is not used in the Ethereum plugin | |
let wallet = try? PocketEth.createWallet(data: nil) |
This file contains hidden or 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
// The data parameter is not used in the Ethereum plugin | |
let privateKey = "plain_text_private_key" | |
let address = "0x000000000" | |
let importedWallet = try? PocketEth.importWallet(privateKey: privateKey, address: address, data: nil) |
This file contains hidden or 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
// Ethereum's transaction object | |
var params = [AnyHashable : Any]() | |
params["to"] = "0x0000000000" | |
params["data"] = nil | |
params["nonce"] = BigUInt.init(0) | |
// In wei | |
params["gasPrice"] = BigUInt.init(0) | |
params["gasLimit"] = BigUInt.init(0) | |
params["value"] = BigUint.init(0) |
This file contains hidden or 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
// Queries are structured like JSON-RPC calls, all methods are supported except sendTransaction and sendRawTransaction | |
let queryParams = ["rpcMethod": "eth_getTransactionCount", "rpcParams": ["0x0", "latest"]] | |
// The decoder is going to be used to try and decode the response in case it's a hex or any other data type that needs decoding | |
// You can pass in nil and get the raw response from the blockchain | |
let decoder = ["returnTypes": ["uint256"]] | |
let query = try? PocketEth.createQuery(params: queryParams, decoder: decoder) |
This file contains hidden or 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
Pocket.shared.sendTransaction(transaction: transaction) { (transactionResponse, error) in | |
if error != nil { | |
return | |
} | |
guard let txHash = transactionResponse?.hash else { | |
return | |
} | |
// Do something with the txHash |
This file contains hidden or 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
Pocket.shared.executeQuery(query: query) { (queryResponse, error) in | |
if error != nil { | |
return | |
} | |
// Do something with the queryResponse.result.value() | |
} |
This file contains hidden or 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 TerminalHttpProvider = require('@terminal-packages/sdk').TerminalHttpProvider; | |
const PocketProvider = require('pocket-js-web3-provider'); | |
const Web3 = require('web3'); | |
var pocketProvider = new PocketProvider("ETH", "1", "<Your Pocket Dev ID here>", { | |
// This is just a stub, only gets called when eth_sendRawTransaction or eth_sendTransaction are called. | |
transactionSigner: { | |
/* | |
Callback method called to determine wether or not the |
This file contains hidden or 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
{"genesis_time":"2020-05-22T16:04:03.57251Z","chain_id":"loadnet","consensus_params":{"block":{"max_bytes":"4000000","max_gas":"-1","time_iota_ms":"1"},"evidence":{"max_age":"1000000"},"validator":{"pub_key_types":["ed25519"]}},"app_hash":"","app_state":{"pos":{"params":{"relays_to_tokens_multiplier":"1000","unstaking_time":"1814400000000000","max_validators":"5000","stake_denom":"upokt","stake_minimum":"1000000","session_block_frequency":"25","dao_allocation":"10","proposer_allocation":"1","maximum_chains":"15","max_jailed_blocks":"1000","max_evidence_age":"120000000000","signed_blocks_window":"100","min_signed_per_window":"0.500000000000000000","downtime_jail_duration":"600000000000","slash_fraction_double_sign":"0.050000000000000000","slash_fraction_downtime":"0.010000000000000000"},"prevState_total_power":"0","prevState_validator_powers":null,"validators":[{"address":"bb6fd938b03ec5cec114ece7d1107cc24cde570d","public_key":"a1726b1cf7950cf3268ddb691cdf91e726543e4b2f28b152cce4cc77ac939094","jailed":false,"s |
OlderNewer