Skip to content

Commit

Permalink
Adding batch claim method to dropper. Updated version to 0.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kellan Wampler committed Dec 6, 2023
1 parent ec4e44c commit d857dd9
Show file tree
Hide file tree
Showing 3 changed files with 658 additions and 27 deletions.
65 changes: 63 additions & 2 deletions cli/web3cli/DropperFacet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Code generated by moonworm : https://github.com/bugout-dev/moonworm
# Moonworm version : 0.6.2
# Code generated by moonworm : https://github.com/moonstream-to/moonworm
# Moonworm version : 0.8.0

import argparse
import json
Expand Down Expand Up @@ -102,6 +102,27 @@ def admin_terminus_info(
self.assert_contract_is_instantiated()
return self.contract.adminTerminusInfo.call(block_identifier=block_number)

def batch_claim(
self,
drop_id_list: List,
request_id_list: List,
block_deadline_list: List,
amount_list: List,
signer_list: List,
signature_list: List,
transaction_config,
) -> Any:
self.assert_contract_is_instantiated()
return self.contract.batchClaim(
drop_id_list,
request_id_list,
block_deadline_list,
amount_list,
signer_list,
signature_list,
transaction_config,
)

def claim(
self,
drop_id: int,
Expand Down Expand Up @@ -438,6 +459,24 @@ def handle_admin_terminus_info(args: argparse.Namespace) -> None:
print(result)


def handle_batch_claim(args: argparse.Namespace) -> None:
network.connect(args.network)
contract = DropperFacet(args.address)
transaction_config = get_transaction_config(args)
result = contract.batch_claim(
drop_id_list=args.drop_id_list,
request_id_list=args.request_id_list,
block_deadline_list=args.block_deadline_list,
amount_list=args.amount_list,
signer_list=args.signer_list,
signature_list=args.signature_list,
transaction_config=transaction_config,
)
print(result)
if args.verbose:
print(result.info())


def handle_claim(args: argparse.Namespace) -> None:
network.connect(args.network)
contract = DropperFacet(args.address)
Expand Down Expand Up @@ -757,6 +796,28 @@ def generate_cli() -> argparse.ArgumentParser:
add_default_arguments(admin_terminus_info_parser, False)
admin_terminus_info_parser.set_defaults(func=handle_admin_terminus_info)

batch_claim_parser = subcommands.add_parser("batch-claim")
add_default_arguments(batch_claim_parser, True)
batch_claim_parser.add_argument(
"--drop-id-list", required=True, help="Type: uint256[]", nargs="+"
)
batch_claim_parser.add_argument(
"--request-id-list", required=True, help="Type: uint256[]", nargs="+"
)
batch_claim_parser.add_argument(
"--block-deadline-list", required=True, help="Type: uint256[]", nargs="+"
)
batch_claim_parser.add_argument(
"--amount-list", required=True, help="Type: uint256[]", nargs="+"
)
batch_claim_parser.add_argument(
"--signer-list", required=True, help="Type: address[]", nargs="+"
)
batch_claim_parser.add_argument(
"--signature-list", required=True, help="Type: bytes[]", nargs="+"
)
batch_claim_parser.set_defaults(func=handle_batch_claim)

claim_parser = subcommands.add_parser("claim")
add_default_arguments(claim_parser, True)
claim_parser.add_argument(
Expand Down
Loading

0 comments on commit d857dd9

Please sign in to comment.