def prepare_nonce_in_args(args: Any): if args.recall_nonce: if args.pem: account = Account(pem_file=args.pem, pem_index=args.pem_index) elif args.keyfile and args.passfile: account = Account(key_file=args.keyfile, pass_file=args.passfile) else: raise errors.NoWalletProvided() account.sync_nonce(ElrondProxy(args.proxy)) args.nonce = account.nonce
def _prepare_sender(args: Any) -> Account: if args.pem: sender = Account(pem_file=args.pem, pem_index=args.pem_index) elif args.keyfile and args.passfile: sender = Account(key_file=args.keyfile, pass_file=args.passfile) else: raise errors.NoWalletProvided() sender.nonce = args.nonce if args.recall_nonce: sender.sync_nonce(ElrondProxy(args.proxy)) return sender