Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
async def main():
supra_client_config = SupraClientConfig(
expiration_ttl=300,
gas_unit_price=100,
gas_unit_price=100_000,
max_gas_amount=100_000,
)
supra_client = SupraClient(RPC_NODE_URL, supra_client_config)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "uv_build"

[project]
name = "supra-sdk"
version = "0.1.0"
version = "0.1.1"
description = "A Python SDK for seamless interaction with the Supra-L1 network, supporting Move-VM operations and transactions."
requires-python = ">=3.12"
license = { file = "LICENSE" }
Expand Down
11 changes: 7 additions & 4 deletions supra_sdk/clients/rest/supra_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ class TransactionConfig:
Attributes:
expiration_ttl (int): Time-to-live, in seconds, before a transaction expires and is rejected by the network.
Defaults to 600.
gas_unit_price (int): Price per unit of gas used to execute the transaction. Defaults to 100.
gas_unit_price (int): Price per unit of gas used to execute the transaction. Defaults to
`min_configured_gas_price` obtained from `rpc/v3/transactions/estimate_gas_price` endpoint.
max_gas_amount (int): Maximum number of gas units allowed per transaction. Defaults to 500,000.
transaction_wait_time_in_seconds (int): Number of seconds to wait for a transaction to be executed before timing
out. Defaults to 20.
Expand All @@ -60,7 +61,7 @@ class TransactionConfig:
"""

expiration_ttl: int = 600
gas_unit_price: int = 100
gas_unit_price: int | None = None
max_gas_amount: int = 500_000
transaction_wait_time_in_seconds: int = 20
polling_wait_time_in_seconds: int = 1
Expand Down Expand Up @@ -98,7 +99,8 @@ class SupraClient(

Attributes:
_chain_id (int | None): The chain-id of the network.
api_client (supra_sdk.clients.api_client.ApiClient): Inherited from `RestClient`. Used to send HTTP requests to the Supra RPC node.
api_client (supra_sdk.clients.api_client.ApiClient): Inherited from `RestClient`. Used to send HTTP requests to
the Supra RPC node.

"""

Expand Down Expand Up @@ -305,7 +307,8 @@ async def create_raw_transaction(
sequence_number,
transaction_payload,
self.transaction_config.max_gas_amount,
self.transaction_config.gas_unit_price,
self.transaction_config.gas_unit_price
or (await self.estimate_gas_price())["min_configured_gas_price"],
int(time.time()) + self.transaction_config.expiration_ttl,
await self.chain_id(),
)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.