Skip to content

Instantly share code, notes, and snippets.

@vladimirfomene
Created October 18, 2023 09:41
Show Gist options
  • Save vladimirfomene/3cb4a35c432e68c1bf7ea8951a043bee to your computer and use it in GitHub Desktop.
Save vladimirfomene/3cb4a35c432e68c1bf7ea8951a043bee to your computer and use it in GitHub Desktop.
import base64, codecs, json, requests
REST_HOST = 'localhost:8289'
MACAROON_PATH = './volumes/tapd/alice-tap/data/regtest/admin.macaroon'
TLS_PATH = './volumes/tapd/alice-tap/tls.cert'
batch_key_hex = '020cccd7a1f96d34ab42f40cf580fd81d88ce0caa72c5fec75d261c4f66cbeb000'
batch_key = bytes.fromhex(batch_key_hex)
url = f'https://{REST_HOST}/v1/taproot-assets/assets/mint/batches/{batch_key}'
macaroon = codecs.encode(open(MACAROON_PATH, 'rb').read(), 'hex')
headers = {'Grpc-Metadata-macaroon': macaroon}
r = requests.get(url, headers=headers, verify=TLS_PATH)
print(r.json())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment