Package genlayer#
Top level#
Common import for all contracts
It exposes most of the types to the top scope and encapsulates other utility under
glnamespace which is a proxy togenlayer.gl
- genlayer.gl#
Blockchain specific functionality, that won’t work without GenVM and reexports form
genlayer.pyprovided for convenienceProxy to
genlayer.glmodule.
- class genlayer.Address[source]#
Bases:
objectRepresents GenLayer Address
- __format__(fmt: Literal['x', 'b64', 'cd', '']) str[source]#
Default object formatter.
Return str(self) if format_spec is empty. Raise TypeError otherwise.
- Return type:
- __init__(val: str | Buffer)[source]#
- Parameters:
val (str | Buffer) – either a hex encoded address (that starts with ‘0x’), or base64 encoded address, or buffer of 20 bytes
Warning
checksum validation is not performed
- property as_b64: str#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_b64 'WzjaanAcVoVF3PywP8uHX1a+3cQ='
- Returns:
base64 representation of an address (most compact string)
- property as_bytes: bytes#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_bytes b'[8\xdajp\x1cV\x85E\xdc\xfc\xb0?\xcb\x87_V\xbe\xdd\xc4'
- Returns:
raw bytes of an address (most compact representation)
- property as_hex: str#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_hex '0x5B38Da6a701c568545dCfcB03FcB875f56beddC4'
- Returns:
checksum string representation
- property as_int: u160#
>>> Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_int 1123907236495940146162314350759402901750813440091 >>> hex(Address('0x5b38da6a701c568545dcfcb03fcb875f56beddc4').as_int) '0xc4ddbe565f87cb3fb0fcdc4585561c706ada385b'
- Returns:
int representation of an address (unsigned little endian)
- class genlayer.Array[source]#
Bases:
Sequence,SizedArray,GenericConstantly sized array that can be persisted on the blockchain
- __getitem__(idx: SupportsIndex) T[source]#
- __getitem__(idx: slice) Array
- class genlayer.DynArray[source]#
Bases:
MutableSequence,GenericRepresents exponentially growing array (
listin python terms) that can be persisted on the blockchain- __setitem__(idx: SupportsIndex, val: T) None[source]#
- __setitem__(idx: slice, val: collections.abc.Sequence[T]) None
- class genlayer.TreeMap[source]#
Bases:
MutableMapping,GenericRepresents a mapping from keys to values that can be persisted on the blockchain
- Tparam K:
must implement
genlayer.py.storage.tree_map.Comparableprotocol (“<” is needed) and be storage-allowed- Tparam V:
must be storage-allowed
- __gl_allow_storage__ = True#
- compute_if_absent(k: K, supplier: Callable[[], V]) V[source]#
- Returns:
Value associated with k if it is present, otherwise get’s new value from the supplier, stores it at k and returns
- Return type:
V
Integer aliases#
It also have aliases for signed and unsigned integer types (such as u256) and bigint alias that can be used in storage unlike regular int
gl#
Blockchain specific functionality, that won’t work without GenVM
and reexports form genlayer.py provided for convenience
- class genlayer.gl.Contract[source]#
Bases:
BaseContractClass for declaring main GenVM contract.
This class must be inherited by user contracts to be deployable on GenVM. It provides essential contract functionality including balance access, address information, and storage proxying.
Only one
Contractsubclass is allowed per module. The class automatically generates storage management code and registers itself as the main contract.- Example:
>>> import genlayer.gl as gl >>> >>> class MyContract(gl.Contract): >>> def __init__(self, initial_value: int): >>> self.value = initial_value >>> >>> @gl.public.view >>> def get_value(self) -> int: >>> return self.value >>> >>> @gl.public.write >>> def set_value(self, new_value: int): >>> self.value = new_value
Warning
Only one Contract subclass is allowed per Python module. Attempting to define multiple Contract subclasses will raise a TypeError.
- classmethod __get_schema__() str[source]#
Generate and return the JSON schema for this contract.
This method analyzes the contract class and generates a JSON schema describing its public interface, including all public methods and their type signatures.
- Returns:
JSON string containing the contract schema
- Return type:
Note
This method is used internally by the GenVM runtime for contract introspection and interface generation
- abstract __handle_undefined_method__(method_name: str, args: list[Any], kwargs: dict[str, Any])[source]#
Handle calls to undefined methods.
This method is called when a message is sent to the contract with a method name that doesn’t exist. If it is overriden, it must be either a
gl.public.writeorgl.public.write.payablemethod.- Parameters:
- Raises:
NotImplementedError – Must be implemented by subclasses if used
- Example:
>>> class MyContract(gl.Contract): >>> @gl.public.write >>> def __handle_undefined_method__(self, method_name: str, args: list, kwargs: dict): >>> if method_name == "fallback_method": >>> self.handle_fallback(args, kwargs) >>> else: >>> raise ValueError(f"Unknown method: {method_name}")
- __on_errored_message__()[source]#
Handle failed messages that included value transfers.
This method is called when am emitted message with non-zero value fails during execution. By default, it simply accepts the refunded value. Override this method to implement custom error handling logic.
The method must be decorated with
@gl.public.write.payable.- Example:
>>> class MyContract(gl.Contract): >>> @gl.public.write.payable >>> def __on_errored_message__(self): >>> # Log the failed transaction >>> failed_value = gl.message.value >>> self.failed_transfers.append((gl.message.sender, failed_value))
- abstract __receive__()[source]#
Handle plain value transfers to this contract.
This method is called when native tokens are sent to the contract without calling any specific method. It must be implemented as a public payable write method.
- Raises:
NotImplementedError – Must be implemented by subclasses if used
- Example:
>>> class MyContract(gl.Contract): >>> @gl.public.write.payable >>> def __receive__(self): >>> # Handle incoming transfers >>> sender = gl.message.sender >>> value = gl.message.value >>> self.total_received += value
- property balance: u256#
Current balance of the contract in native tokens.
- class genlayer.gl.Event[source]#
Bases:
objectclass TransferOccurredEvent(gl.Event): def __init__(self, from: Address, to: Address, /): ... class TransferOccurredEvent(gl.Event): def __init__(self, from: Address, to: Address, /, **blob): ...
- class genlayer.gl.MessageRawType[source]#
Bases:
TypedDict- __optional_keys__ = frozenset({})#
- __required_keys__ = frozenset({'chain_id', 'contract_address', 'datetime', 'entry_data', 'entry_kind', 'entry_stage_data', 'is_init', 'origin_address', 'sender_address', 'stack', 'value'})#
- __total__ = True#
- chain_id: u256#
Current chain ID
- entry_kind: int#
- One of:
0forMAIN1forSANDBOX2forCONSENSUS_STAGE
See startup-process-reference for more details.
- entry_stage_data: Encodable#
- value: u256#
- class genlayer.gl.MessageType[source]#
Bases:
NamedTupleMessageType(contract_address, sender_address, origin_address, value, chain_id)
- __getnewargs__()#
Return self as a plain tuple. Used by copy and pickle.
- static __new__(_cls, contract_address: Address, sender_address: Address, origin_address: Address, value: u256, chain_id: u256)#
Create new instance of MessageType(contract_address, sender_address, origin_address, value, chain_id)
- __repr__()#
Return a nicely formatted representation string
- chain_id: u256#
Current chain ID
- value: u256#
Alias for field number 3
- genlayer.gl.contract_interface(_declaration: GenVMContractDeclaration) Callable[[Address], ContractProxy][source]#
Decorator for creating type-safe contract interfaces.
This decorator creates a factory function that returns strongly-typed contract proxies, enabling IDE autocompletion and static type checking for contract interactions.
- Parameters:
_contr – Contract declaration class with View and Write nested classes
- Returns:
Factory function that creates typed contract proxies
- Return type:
- Example:
>>> @gl.contract_interface >>> class ERC20Contract: >>> class View: >>> def balance_of(self, owner: Address) -> u256: ... >>> def total_supply(self) -> u256: ... >>> >>> class Write: >>> def transfer(self, to: Address, amount: u256) -> None: ... >>> def approve(self, spender: Address, amount: u256) -> None: ... >>> >>> # Usage: >>> token = ERC20Contract(token_address) >>> balance = token.view().balance_of(user_address) # Fully typed! >>> token.emit().transfer(recipient, amount)
Note
This decorator provides no runtime functionality - it’s purely for type safety and developer experience. The actual contract interaction uses the same runtime mechanisms as get_contract_at.
- genlayer.gl.deploy_contract(*, code: bytes, args: Sequence[Encodable] = [], kwargs: Mapping[str, Encodable] = {}, salt_nonce: u256 | Literal[0] = u256(0), value: u256 = u256(0), on: ON = 'finalized') Address | None[source]#
Deploy a new GenVM contract to the blockchain.
This function deploys a new contract using the provided
codeand constructor arguments. The deployment address can be deterministic (with a salt) or non-deterministic.- Parameters:
code (bytes) – Source code of the contract to deploy. It can be regular Python code. See runners-reference for more information
args (Sequence[Encodable]) – Positional arguments for the contract constructor
kwargs (Mapping[str, Encodable]) – Keyword arguments for the contract constructor
salt_nonce (u256 | Literal[0]) – Salt for deterministic deployment. Use 0 for non-deterministic.
value (u256) – Amount of native tokens to send to the contract during deployment
on (ON) – When to execute the deployment (‘accepted’ or ‘finalized’)
- Returns:
Contract address if salt_nonce != 0, None otherwise
- Return type:
Address | None
- Example:
>>> # Non-deterministic deployment >>> deploy_contract( >>> code=contract_source_str.encode('utf-8'), >>> args=[initial_supply], >>> kwargs={"name": "MyToken", "symbol": "MTK"} >>> ) >>> >>> # Deterministic deployment >>> address = deploy_contract( >>> code=contract_source_zip_as_bytes, >>> args=[initial_supply], >>> salt_nonce=u256(12345), >>> value=u256(1000) # Send 1000 native tokens >>> ) >>> print(f'Contract deployed at: {address}')
Note
- For deterministic deployments (salt_nonce != 0), the contract address
is computed using CREATE2 and is returned immediately
- For non-deterministic deployments (salt_nonce == 0), the address is
assigned by the consensus and not returned. Considering asynchronous nature of GenLayer consensus the address should not be predicted
The contract’s constructor will be called with the provided
argsandkwargs- Refer to consensus documentation for CREATE2 address derivation process and
details about transaction ordering
- genlayer.gl.get_contract_at(address: Address) ContractProxy[source]#
Create a proxy object for interacting with a deployed GenVM contract.
This function returns a contract proxy that provides runtime access to the methods of a deployed contract without requiring type annotations describing its interface.
- Parameters:
address (Address) – Address of the deployed contract
- Returns:
ContractProxy object for interacting with the contract
- Return type:
ContractProxy
- Example:
>>> addr = Address('0x1234567890abcdef...') >>> contract = get_contract_at(addr) >>> result = contract.view().some_view_method(arg1, arg2) >>> contract.emit(value=u256(100)).some_write_method(arg1)
- genlayer.gl.message: MessageType = Ellipsis#
Represents fields from a transaction message that was sent
- genlayer.gl.message_raw: MessageRawType = Ellipsis#
Raw message, parsed
- genlayer.gl.private(f)[source]#
Decorator that marks method as private. As all methods are private by default it does nothing.
- class genlayer.gl.public[source]#
Bases:
object- write = <genlayer.gl.annotations._write object>#
Decorator that marks a contract method as a public write. Has .payable
@gl.public.write def foo(self) -> None: ... @gl.public.write.payable def bar(self) -> None: ... @gl.public.write.min_gas(leader=100, validator=20).payable def bar(self) -> None: ...
- Return type:
T
gl.vm#
- class genlayer.gl.vm.Return[source]#
Bases:
GenericRepresents a successful return value from a VM operation.
- __eq__(other)#
Return self==value.
- __hash__ = None#
- __repr__()#
Return repr(self).
- calldata: T#
Decoded return value from the VM execution
- exception genlayer.gl.vm.UserError[source]#
Bases:
ExceptionRepresents an error that user contract rose during execution of their code in the VM.
- __eq__(other)#
Return self==value.
- __hash__ = None#
- __repr__()#
Return repr(self).
- class genlayer.gl.vm.VMError[source]#
Bases:
objectRepresents an error that occurred within the VM during execution.
It indicates user-caused error, such as OOM.
- __eq__(other)#
Return self==value.
- __hash__ = None#
- __repr__()#
Return repr(self).
- genlayer.gl.vm.run_nondet(leader_fn: ~typing.Callable[[], T], validator_fn: ~typing.Callable[[Result], bool], /, *, compare_user_errors: ~typing.Callable[[~genlayer.gl.vm.UserError, ~genlayer.gl.vm.UserError], bool] = <function <lambda>>, compare_vm_errors: ~typing.Callable[[~genlayer.gl.vm.VMError, ~genlayer.gl.vm.VMError], bool] = <function <lambda>>) T[source]#
Executes a non-deterministic block with comprehensive error handling.
This is the recommended API for custom non-deterministic execution. It provides safer error handling compared to
run_nondet_unsafe()by running the validator in a sandbox and handling validator errors with provided functions with sensible defaults.- Parameters:
leader_fn (Callable[[], T]) – Function executed by the leader node
validator_fn (Callable[[Result], bool]) – Function that validates the leader’s result, is ran in a sandbox
compare_user_errors (Callable[[UserError, UserError], bool]) – Function to compare UserError instances for equality
compare_vm_errors (Callable[[VMError, VMError], bool]) – Function to compare VMError instances for equality
- Returns:
The result from the leader if validation passes
- Return type:
T
Error handling: - If leader and validator both succeed: returns leader result - If leader fails and validator agrees: propagates leader error - If results don’t match: consensus fails
- Example:
>>> def leader() -> list[int]: ... return fetch_external_data() >>> def validator(result): ... if not isinstance(result, Return): ... return False ... my_data = leader() ... return numpy.linalg.norm(np.array(result.calldata) - np.array(my_data)) < 0.1 >>> value = run_nondet(leader, validator)
Note
supports
.lazy()version, which will returnLazy
- genlayer.gl.vm.run_nondet_unsafe(leader_fn: Callable[[], T], validator_fn: Callable[[Result], bool], /) T[source]#
Executes a non-deterministic block with leader-validator consensus.
This is the most generic API for non-deterministic execution. The leader function runs as is, validators one checks the result.
- Parameters:
- Returns:
The result from the leader (iff validation passes, otherwise VM will be terminated)
- Return type:
T
Warning
This function does not use extra sandbox for catching validator errors. Validator error will result in a
Disagreeerror in executor (same as if this function returnedFalse). Userun_nondet()instead if you want to catch and inspectvalidator_fnerrors, or use sandbox inside of it.Note
All sub-vm returns go through
genlayer.py.calldataencoding.- Example:
>>> def leader(): ... return os.urandom(1)[0] % 3 >>> def validator(result): ... return unpack_result(result) == 1 # agree in 33% of cases >>> value = gl.vm.run_nondet_unsafe(leader, validator)
Note
supports
.lazy()version, which will returnLazy
- genlayer.gl.vm.spawn_sandbox(fn: Callable[[], T], *, allow_write_ops: bool = False) Return | VMError | UserError[source]#
Runs a function in an isolated sandbox environment.
The function is executed in a separate VM instance with controlled permissions. This provides isolation and security for potentially unsafe operations. Determinism of spawned VM matches the determinism of the current VM.
- Parameters:
- Return type:
- Example:
>>> result = spawn_sandbox(lambda: risky_computation()) >>> safe_value = unpack_result(result)
Note
supports
.lazy()version, which will returnLazy
- genlayer.gl.vm.unpack_result(res: Result, /) T[source]#
Extracts the successful result from a VM operation result.
- Parameters:
res (Result) – The result from a VM operation
- Returns:
The actual return value if successful
- Raises:
- Return type:
T
- Example:
>>> result = gl.vm.spawn_sandbox(lambda: 42) >>> value = unpack_result(result) # Returns 42 or raises on error
gl.advanced#
This module provides some “advanced” features that can be used for optimizations
Warning
If you are using something “advanced” you must know what you do
gl.calldata#
This module is responsible for working with genvm calldata
Calldata natively supports following types:
Primitive types:
Composite types:
list(and any othercollections.abc.Sequence)dictwithstrkeys (and any othercollections.abc.Mappingwithstrkeys)
For full calldata specification see genvm repo
- class genlayer.gl.calldata.CalldataEncodable[source]#
Bases:
objectAbstract class to support calldata encoding for custom types
Can be used to simplify code
- exception genlayer.gl.calldata.DecodingError[source]#
Bases:
ValueError
- genlayer.gl.calldata.decode(mem0: Buffer, *, memview2bytes: Callable[[memoryview], Any] = bytes) Decoded[source]#
Decodes calldata encoded bytes into python DSL
Out of composite types it will contain only
dictandlist- Return type:
Decoded
- genlayer.gl.calldata.encode(x: EncodableWithDefault, *, default: Callable[[EncodableWithDefault], Encodable] = encode_default_parameter) bytes[source]#
Encodes python object into calldata bytes
- Parameters:
default (Callable[[EncodableWithDefault], Encodable]) – function to be applied to each object recursively, it must return object encodable to calldata
- Return type:
gl.storage#
- class genlayer.gl.storage.Array[source]#
Bases:
Sequence,SizedArray,GenericConstantly sized array that can be persisted on the blockchain
- __getitem__(idx: SupportsIndex) T[source]#
- __getitem__(idx: slice) Array
- class genlayer.gl.storage.DynArray[source]#
Bases:
MutableSequence,GenericRepresents exponentially growing array (
listin python terms) that can be persisted on the blockchain- __setitem__(idx: SupportsIndex, val: T) None[source]#
- __setitem__(idx: slice, val: collections.abc.Sequence[T]) None
- class genlayer.gl.storage.Indirection[source]#
Bases:
GenericThis class provides ability to save data at its own slot. Occupies 1 byte to prevent collision.
- class genlayer.gl.storage.Root[source]#
Bases:
objectThis ABI is known and used by:
genvm
node
- __gl_allow_storage__ = True#
- __init__(*args, **kwargs)#
- property code#
contract code
- property contract_instance#
- property locked_slots#
Slot ids that can not be modified after deployment. Use
Slot.as_int()for conversion of Slot tointBy default it will be populated bycode,frozen_slots
- property upgraders#
- class genlayer.gl.storage.TreeMap[source]#
Bases:
MutableMapping,GenericRepresents a mapping from keys to values that can be persisted on the blockchain
- Tparam K:
must implement
genlayer.py.storage.tree_map.Comparableprotocol (“<” is needed) and be storage-allowed- Tparam V:
must be storage-allowed
- __gl_allow_storage__ = True#
- compute_if_absent(k: K, supplier: Callable[[], V]) V[source]#
- Returns:
Value associated with k if it is present, otherwise get’s new value from the supplier, stores it at k and returns
- Return type:
V
- class genlayer.gl.storage.VLA[source]#
Bases:
PseudoSequence,GenericVariable Length Array. Can be used in pair with
Indirectionto save length at the same place as data. Can also be used in C language way. Occupies at least 4 bytes (for length)
gl.evm#
This module is responsible for interactions with ghost/external contracts
- class genlayer.gl.evm.ContractDeclaration[source]#
-
Interface for declaring interfaces of external contracts
- __init__(*args, **kwargs)#
- class genlayer.gl.evm.ContractProxy[source]#
Bases:
Generic- __init__(address: Address, view_impl: Callable[[ContractProxy], TView], balance_impl: Callable[[ContractProxy], u256], send_impl: Callable[[ContractProxy, TransactionDataKwArgs], TWrite], transfer_impl: Callable[[ContractProxy, TransactionDataKwArgs], None])[source]#
- property balance: u256#
- class genlayer.gl.evm.InplaceTuple[source]#
Bases:
objectThis class indicates that tuple should be encoded/decoded in-place. Which means that even if it is dynamically sized, it is ignored. It is useful for encoding/decoding arguments and returns
tuple[InplaceTuple, str, u256]
- genlayer.gl.evm.contract_interface(contr: ContractDeclaration) Callable[[Address], ContractProxy][source]#
- Return type:
gl.eq_principle#
- genlayer.gl.eq_principle.prompt_comparative(fn: Callable[[], T], principle: str) T[source]#
Comparative equivalence principle that utilizes NLP for verifying that results are equivalent
For validator: in case of non-
Returnresult infn, agreement will be decided bygenlayer.gl.vm.run_nondet(), which executed validator wrapper function in a sandbox VM. If on the other hand leader reported an error, while our function execution is successful, the validator votesFalse.- Parameters:
- Return type:
T
See
genlayer.gl.vm.run_nondet()for description of data transformationsNote
As leader results are encoded as calldata,
format()is used for string representation. However, operating on strings by yourself is more safe in generalWarning
See
genlayer.gl.vm.run_nondet()for description of data transformationsNote
supports
.lazy()version, which will returnLazy
- genlayer.gl.eq_principle.prompt_non_comparative(fn: Callable[[], str], *, task: str, criteria: str) str[source]#
Non-comparative equivalence principle that must cover most common use cases
Both leader and validator finish their execution via NLP, that is used to perform
taskoninput. Leader just executes this task, but the validator checks if task was performed with integrity. This principle is useful when task is subjective. For instance, when you want to check if some text is a good summary of the input text.For validator: in case of non-
Returnresult infn, agreement will be decided bygenlayer.gl.vm.run_nondet(), which executed validator wrapper function in a sandbox VM. If on the other hand leader reported an error, while our function execution is successful, the validator votesFalse.Note
supports
.lazy()version, which will returnLazy- Return type:
- genlayer.gl.eq_principle.strict_eq(fn: Callable[[], T]) T[source]#
Comparative equivalence principle that checks for strict equality
This function checks that VM result is of the same type and has the same value inside. It is the most performant equivalence principle, but it is also the most strict one.
- Parameters:
fn (Callable[[], T]) – function that provides result that will be validated
- Return type:
T
Warning
See
genlayer.gl.vm.run_nondet()for description of data transformationsNote
supports
.lazy()version, which will returnLazy
gl.nondet#
- class genlayer.gl.nondet.Image[source]#
Bases:
objectImage(raw: bytes, pil: ‘PIL.Image.Image’)
- __eq__(other)#
Return self==value.
- __hash__ = None#
- __repr__()#
Return repr(self).
- pil: PIL.Image.Image#
- genlayer.gl.nondet.exec_prompt(prompt: str, *, images: collections.abc.Sequence[bytes | Image] | None = None) str[source]#
- genlayer.gl.nondet.exec_prompt(prompt: str, *, response_format: Literal['text'], images: collections.abc.Sequence[bytes | Image] | None = None) str
- genlayer.gl.nondet.exec_prompt(prompt: str, *, response_format: Literal['json'], image: bytes | Image | None = None) dict[str, Any]
API to execute a prompt (perform NLP)
- Parameters:
prompt (
str) – prompt itself**config (
ExecPromptKwArgs) – configuration
- Return type:
str
Note
supports
.lazy()version, which will returnLazy
gl.nondet.web#
- class genlayer.gl.nondet.web.Response[source]#
Bases:
objectResponse(status: int, headers: dict[str, bytes], body: bytes | None)
- __eq__(other)#
Return self==value.
- __hash__ = None#
- __repr__()#
Return repr(self).
- genlayer.gl.nondet.web.delete(url: str, *, body: str | bytes | None = None, headers: dict[str, str | bytes] = {}) Response[source]#
Note
supports
.lazy()version, which will returnLazy- Return type:
- genlayer.gl.nondet.web.get(url: str, *, headers: dict[str, str | bytes] = {}) Response[source]#
Note
supports
.lazy()version, which will returnLazy- Return type:
- genlayer.gl.nondet.web.head(url: str, *, body: str | bytes | None = None, headers: dict[str, str | bytes] = {}) Response[source]#
Note
supports
.lazy()version, which will returnLazy- Return type:
- genlayer.gl.nondet.web.patch(url: str, *, body: str | bytes | None = None, headers: dict[str, str | bytes] = {}) Response[source]#
Note
supports
.lazy()version, which will returnLazy- Return type:
- genlayer.gl.nondet.web.post(url: str, *, body: str | bytes | None = None, headers: dict[str, str | bytes] = {}) Response[source]#
Note
supports
.lazy()version, which will returnLazy- Return type:
- genlayer.gl.nondet.web.render(url: str, *, wait_after_loaded: str | None = None, mode: Literal['text', 'html']) str[source]#
- genlayer.gl.nondet.web.render(url: str, *, wait_after_loaded: str | None = None, mode: Literal['screenshot']) Image
API to get a webpage after rendering it in a browser-like environment
- Parameters:
url – url of website
mode – Mode in which to return the result
wait_after_loaded – How long to wait after dom loaded (for js to emit dynamic content). Should be in format such as “1000ms” or “1s”
Note
supports
.lazy()version, which will returnLazy