Skip to content

Commit

Permalink
AAdd transfer funding options to argparse.
Browse files Browse the repository at this point in the history
  • Loading branch information
praskoson committed Jun 7, 2021
1 parent 93e8e72 commit 340d616
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/flat-distributor/flat-distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ def main():
input_path = args.address_list
interactive = args.interactive
drop_amount = args.drop_amount
fund_recipient = args.fund_recipient
allow_unfunded_recipient = args.allow_unfunded_recipient
transfer(input_path, interactive,
drop_amount, TOKEN_MINT, TOKEN_DECIMALS,
RPC_URL, LOG_FOLDER_PREFIX, FULL_LOGS,
Expand Down Expand Up @@ -590,6 +592,18 @@ def transfer(input_path, interactive, drop_amount, mint,
help='Path to the file that contains all addresses that will receive the \
airdrop. Each address should be in a seperate line. The file must be UTF-8 encoded.'
)
parser_t.add_argument(
'--fund-recipient',
action='store_true',
required=False,
help='Create the associated token account for the recipient if it does not exist.'
)
parser_t.add_argument(
'--allow-unfunded-recipient',
action='store_true',
required=False,
help='Complete the transfer even if the recipient\'s address is not funded.'
)

if __name__ == '__main__':
main()
14 changes: 14 additions & 0 deletions tools/proportional-distributor/proportional-distributor.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ def main():
input_path = args.address_list
interactive = args.interactive
drop_amount = args.drop_amount
fund_recipient = args.fund_recipient
allow_unfunded_recipient = args.allow_unfunded_recipient
transfer(input_path, interactive,
drop_amount, TOKEN_MINT, TOKEN_DECIMALS,
RPC_URL, LOG_FOLDER_PREFIX, FULL_LOGS,
Expand Down Expand Up @@ -604,6 +606,18 @@ def transfer(input_path, interactive, drop_amount, mint,
help='Path to the file containing a list of addresses and balances, \
seperated by a comma, and with each pair in a separate line.'
)
parser_t.add_argument(
'--fund-recipient',
action='store_true',
required=False,
help='Create the associated token account for the recipient if it does not exist.'
)
parser_t.add_argument(
'--allow-unfunded-recipient',
action='store_true',
required=False,
help='Complete the transfer even if the recipient\'s address is not funded.'
)

if __name__ == '__main__':
main()

0 comments on commit 340d616

Please sign in to comment.