Skip to content

Instantly share code, notes, and snippets.

@ConnorMac
Last active February 16, 2018 07:48
Show Gist options
  • Save ConnorMac/ea1491ffa2015883e1140ca5f85d5a04 to your computer and use it in GitHub Desktop.
Save ConnorMac/ea1491ffa2015883e1140ca5f85d5a04 to your computer and use it in GitHub Desktop.
Stellar token creation and distribution
from stellar_base.builder import Builder
from stellar_base.address import Address
from stellar_base.asset import Asset
from stellar_base.keypair import Keypair
# Create accounts - These will need to be funded to work on the network
dist = Keypair.random()
issuer = Keypair.random()
# Trust issuer
dist_build = Builder(secret=dist.seed().decode(), network="TESTNET")
dist_build.append_trust_op(publickey, 'GOAT')
dist_build.sign()
dist_build.submit()
# Send to distribution account - Assuming you own 1000 goats
issuer_build = Builder(secret=issuer.seed().decode(), network="TESTNET")
issuer_build.append_payment_op(dist.address().decode(), 1000, "GOAT", issuer.address().decode())
issuer_build.sign()
issuer_build.submit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment