Skip to content

Commit

Permalink
Start from seed.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeGruffins committed Dec 7, 2020
1 parent ddb2ea2 commit 28cab0a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions decred/examples/drain_xpriv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"""
Copyright (c) 2020, The Decred developers
This example script will dump all funds located in an xpriv to a specified address.
This example script will dump all funds located in an account derived from the
supplied xpriv seed to a specified address.
"""
import os
from urllib.parse import urlunsplit
Expand All @@ -22,6 +23,9 @@
EXTERNAL = 1
FEE_RATE = 10000
GAP_LIMIT = 20
ACCT_NUM = 0
COIN_TYPE = 20
PURPOSE = 44


def cfg(isTestnet):
Expand Down Expand Up @@ -229,8 +233,11 @@ def main():

# Printing a newline.
print()
internal = xpriv.child(INTERNAL)
external = xpriv.child(EXTERNAL)
purpose = xpriv.child(crypto.HARDENED_KEY_START + PURPOSE)
cointype = purpose.child(crypto.HARDENED_KEY_START + COIN_TYPE)
acct = cointype.child(crypto.HARDENED_KEY_START + ACCT_NUM)
internal = acct.child(INTERNAL)
external = acct.child(EXTERNAL)

dcrdConfig = cfg(isTestnet)
node = rpc.Client(
Expand Down

0 comments on commit 28cab0a

Please sign in to comment.