StellarCN / py-stellar-base

Stellar client library for the Python language
https://stellar-sdk.readthedocs.io
Apache License 2.0
348 stars 172 forks source link

Pass the allowed_methods parameter when the Retry class is instantiated #898

Closed L1590 closed 7 months ago

L1590 commented 7 months ago

code:

from stellar_sdk import SorobanServer, Server

soroban_server = SorobanServer(client=Server())
res = soroban_server.get_latest_ledger()

print(res)

error:

Traceback (most recent call last):
  File ".\sdk_sorban.py", line 3, in <module>
    soroban_server = SorobanServer(client=Server())
  File "D:\anaconda3\envs\defi\lib\site-packages\stellar_sdk\server.py", line 50, in __init__
    client = RequestsClient()
  File "D:\anaconda3\envs\defi\lib\site-packages\stellar_sdk\client\requests_client.py", line 71, in __init__
    retry = Retry(
TypeError: __init__() got an unexpected keyword argument 'allowed_methods'

can you help me?

overcat commented 7 months ago

You should not create SorobanServer in this way, please refer to our examples. https://github.com/StellarCN/py-stellar-base/blob/main/examples/soroban_deploy_contract.py#L17