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
from two1.lib.wallet import Wallet, exceptions | |
wallet = Wallet() | |
try: | |
wallet.create_account('signing') | |
print("successfully created account") | |
except exceptions.AccountCreationError: | |
print("failed to create account") | |
pass |
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
from two1.lib.wallet import Wallet | |
wallet = Wallet() | |
tx = wallet.send_to("13jtZRqzYK6fg9MFP1cRvjSB8g5TufEMmp", 1000) | |
print(tx) |
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
from two1.lib.wallet import Wallet | |
wallet = Wallet() | |
print(wallet) |
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
from two1.lib.wallet import Wallet, exceptions | |
from two1.lib.bitcoin.crypto import PublicKey | |
from two1.lib.bitcoin.script import Script | |
from two1.lib.bitcoin.txn import Transaction | |
SRV_ACCT = 'signing' | |
wallet = Wallet() | |
try: |
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
from two1.lib.wallet import Wallet, exceptions | |
from two1.lib.bitcoin.crypto import PublicKey | |
from two1.lib.bitcoin.script import Script | |
from two1.lib.bitcoin.txn import Transaction | |
SRV_ACCT = 'signing' | |
wallet = Wallet() | |
try: |
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 urllib2 | |
import re | |
url = 'http://www.google.com/finance/info?infotype=infoquoteall&q=' | |
def get_name(ticker): | |
try: | |
response = urllib2.urlopen(url+ticker) | |
except: | |
print("Oops! Looks like we don't support that ticker.") |
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
def shuffle(cards): | |
return [i for sublst in zip(cards[:len(cards) // 2], cards[len(cards) // 2:]) for i in sublst] | |
def main(deck_len): | |
cards = list(range(deck_len)) | |
start = shuffle(cards) | |
counter = 1 | |
while start != cards: | |
start = shuffle(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
import pandas as pd | |
import json | |
import time | |
import urllib2 | |
# Step1 | |
addrs = pd.read_csv('addresses.csv', dtype = {'Zip': str}) | |
addrs['Full Addr'] = addrs['Address'] + ', ' + addrs['City'] + ', ' + addrs['State']+ ', ' + addrs['Zip'] | |
#Step2 |
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
from two1.wallet import Two1Wallet | |
from two1.bitcoin.crypto import HDPublicKey | |
with open('{}/.two1/wallet/default_wallet.json'.format(expanduser('~'))) as data_file: | |
wallet_data = json.load(data_file) | |
wallet = Two1Wallet.import_from_mnemonic(mnemonic=wallet_data['master_seed']) | |
pubkey = wallet.get_payout_public_key() |
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
from two1.wallet import Two1Wallet | |
with open('{}/.two1/wallet/default_wallet.json'.format(expanduser('~'))) as data_file: | |
wallet_data = json.load(data_file) | |
wallet = Two1Wallet.import_from_mnemonic(mnemonic=wallet_data['master_seed']) | |
history = wallet.transaction_history() | |
print(history) |
OlderNewer