API Documentation
Account
- class stellar_sdk.account.Account(account, sequence, raw_data=None)[source]
The
Account
object represents a single account on the Stellar network and its sequence number.Account tracks the sequence number as it is used by
TransactionBuilder
.Normally, you can get an
Account
instance throughstellar_sdk.server.Server.load_account()
orstellar_sdk.server_async.ServerAsync.load_account()
.An example:
from stellar_sdk import Keypair, Server server = Server(horizon_url="https://horizon-testnet.stellar.org") source = Keypair.from_secret("SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD") # `account` can also be a muxed account source_account = server.load_account(account=source.public_key)
See Accounts for more information.
- Parameters:
account (
Union
[str
,MuxedAccount
]) – Account Id of the account (ex."GB3KJPLFUYN5VL6R3GU3EGCGVCKFDSD7BEDX42HWG5BWFKB3KQGJJRMA"
) or muxed account (ex."MBZSQ3YZMZEWL5ZRCEQ5CCSOTXCFCMKDGFFP4IEQN2KN6LCHCLI46AAAAAAAAAAE2L2QE"
)sequence (
int
) – Current sequence number of the account.
- load_ed25519_public_key_signers()[source]
Load ed25519 public key signers.
- Return type:
List
[Ed25519PublicKeySigner
]
- property universal_account_id: str
Get the universal account id, if account is ed25519 public key, it will return ed25519 public key (ex.
"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
), otherwise it will return muxed account (ex."MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY"
)
Address
- class stellar_sdk.address.Address(address)[source]
Represents a single address in the Stellar network. An address can represent an account or a contract.
- Parameters:
address (
str
) – ID of the account or contract. (ex.GBJCHUKZMTFSLOMNC7P4TS4VJJBTCYL3XKSOLXAUJSD56C4LHND5TWUC
orCA7QYNF7SOWQ3GLR2BGMZEHXAVIRZA4KVWLTJJFC7MGXUA74P7UJUWDA
)
- static from_raw_contract(contract)[source]
Creates a new contract Address object from a buffer of raw bytes.
- class stellar_sdk.address.AddressType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Represents an Address type.
- ACCOUNT = 0
An account address, address looks like
GBJCHUKZMTFSLOMNC7P4TS4VJJBTCYL3XKSOLXAUJSD56C4LHND5TWUC
.
- CONTRACT = 1
An contract address, address looks like
CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5
.
Asset
- class stellar_sdk.asset.Asset(code, issuer=None)[source]
The
Asset
object, which represents an asset and its corresponding issuer on the Stellar network.The following example shows how to create an Asset object:
from stellar_sdk import Asset native_asset = Asset.native() # You can also create a native asset through Asset("XLM"). credit_alphanum4_asset = Asset("USD", "GBSKJPM2FM6O2C6GVZNAUAMGXZ6I4QIUPMNWVDN2NZULPWWTV3GI2SOX") credit_alphanum12_asset = Asset("BANANA", "GA6VT2PDD73TNNRYLPJPJYAAI7EGKBATZ7V562S7XY7TJD4GNOXRG6OS") print(f"Asset type: {credit_alphanum4_asset.type}\n" f"Asset code: {credit_alphanum4_asset.code}\n" f"Asset issuer: {credit_alphanum4_asset.issuer}\n" f"Is native asset: {credit_alphanum4_asset.is_native()}")
For more information about the formats used for asset codes and how issuers work on Stellar’s network, see Stellar’s guide on assets.
- Parameters:
code (
str
) – The asset code, in the formats specified in Stellar’s guide on assets.issuer (
Optional
[str
]) – The account ID of the issuer. Note if the currency is the native currency (XLM (Lumens)), no issuer is necessary.
- Raises:
AssetCodeInvalidError
: ifcode
is invalid.AssetIssuerInvalidError
: ifissuer
is not a valid ed25519 public key.
- static check_if_asset_code_is_valid(code)[source]
Check whether the code passed in by the user is a valid asset code, if not, an exception will be thrown.
- Parameters:
code (
str
) – The asset code.- Raises:
AssetCodeInvalidError
: ifcode
is invalid.- Return type:
- classmethod from_xdr_object(xdr_object)[source]
Create a
Asset
from an XDR Asset/ChangeTrustAsset/TrustLineAsset object.Please note that this function only supports processing the following types of assets:
ASSET_TYPE_NATIVE
ASSET_TYPE_CREDIT_ALPHANUM4
ASSET_TYPE_CREDIT_ALPHANUM12
- Parameters:
xdr_object (
Union
[Asset
,ChangeTrustAsset
,TrustLineAsset
]) – The XDR Asset/ChangeTrustAsset/TrustLineAsset object.- Return type:
- Returns:
A new
Asset
object from the given XDR object.
- guess_asset_type()[source]
Return the type of the asset, Can be one of following types:
native
,credit_alphanum4
orcredit_alphanum12
.- Return type:
- Returns:
The type of the asset.
- is_native()[source]
Return
Ture
if theAsset
object is the native asset.- Return type:
- Returns:
True
if the asset object is native,False
otherwise.
- classmethod native()[source]
Returns an asset object for the native asset.
- Return type:
- Returns:
An asset object for the native asset.
- to_change_trust_asset_xdr_object()[source]
Returns the xdr object for this asset.
- Return type:
- Returns:
XDR ChangeTrustAsset object
- to_trust_line_asset_xdr_object()[source]
Returns the xdr object for this asset.
- Return type:
- Returns:
XDR TrustLineAsset object
Call Builder
AccountsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.AccountsCallBuilder(horizon_url, client)[source]
Creates a new
AccountsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.accounts()
.See List All Accounts for more information.
- Parameters:
horizon_url – Horizon server URL.
client (
BaseSyncClient
) – The client instance used to send request.
- account_id(account_id)
Returns information and links relating to a single account. The balances section in the returned JSON will also list all the trust lines this account has set up.
See Retrieve an Account for more information.
- Parameters:
account_id (
str
) – account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AccountCallBuilder instance
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_asset(asset)
Filtering accounts who have a trustline to an asset. The result is a list of accounts.
See List All Accounts for more information.
- Parameters:
asset (
Asset
) – an issued asset- Returns:
current AccountCallBuilder instance
- for_liquidity_pool(liquidity_pool_id)
Filtering accounts who have a trustline for the given pool. The result is a list of accounts.
See List All Accounts for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string., for example:"dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7"
- Returns:
current AccountCallBuilder instance
- for_signer(signer)
Filtering accounts who have a given signer. The result is a list of accounts.
See List All Accounts for more information.
- Parameters:
signer (
str
) – signer’s account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AccountCallBuilder instance
- for_sponsor(sponsor)
Filtering accounts where the given account is sponsoring the account or any of its sub-entries.
See List All Accounts for more information.
- Parameters:
sponsor (
str
) – the sponsor id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AccountCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
AssetsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.AssetsCallBuilder(horizon_url, client)[source]
Creates a new
AssetsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.assets()
.See List All Assets for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_code(asset_code)
This endpoint filters all assets by the asset code.
See List All Assets for more information.
- Parameters:
asset_code (
str
) – asset code, for example: USD- Returns:
current AssetCallBuilder instance
- for_issuer(asset_issuer)
This endpoint filters all assets by the asset issuer.
See List All Assets for more information.
- Parameters:
asset_issuer (
str
) – asset issuer, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AssetCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
ClaimableBalancesCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.ClaimableBalancesCallBuilder(horizon_url, client)[source]
Creates a new
ClaimableBalancesCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.claimable_balance()
.See List Claimable Balances for more information.
- Parameters:
horizon_url – Horizon server URL.
client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- claimable_balance(claimable_balance_id)
Returns information and links relating to a single claimable balance.
See List Claimable Balances for more information.
- Parameters:
claimable_balance_id (
str
) – claimable balance id- Returns:
current AccountCallBuilder instance
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_asset(asset)
Returns all claimable balances which provide a balance for the given asset.
See List Claimable Balances for more information.
- Parameters:
asset (
Asset
) – an asset- Returns:
current ClaimableBalancesCallBuilder instance
- for_claimant(claimant)
Returns all claimable balances which can be claimed by the given account ID.
See List Claimable Balances for more information.
- Parameters:
claimant (
str
) – the account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current ClaimableBalancesCallBuilder instance
- for_sponsor(sponsor)
Returns all claimable balances which are sponsored by the given account ID.
See List Claimable Balances for more information.
- Parameters:
sponsor (
str
) – the sponsor id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current ClaimableBalancesCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
DataCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.DataCallBuilder(horizon_url, client, account_id, data_name)[source]
Creates a new
DataCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.data()
.See Retrieve an Account’s Data for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.account_id (
str
) – account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
data_name (
str
) – Key name
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
EffectsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.EffectsCallBuilder(horizon_url, client)[source]
Creates a new
EffectsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.effects()
.See List All Effects for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
See Retrieve an Account’s Effects for more information.
- Parameters:
account_id (
str
) – account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
this EffectCallBuilder instance
- for_ledger(sequence)
Effects are the specific ways that the ledger was changed by any operation. This endpoint represents all effects that occurred in the given ledger.
See Retrieve a Ledger’s Effects for more information.
- for_liquidity_pool(liquidity_pool_id)
This endpoint represents all effects that occurred as a result of a given liquidity pool.
See Liquidity Pools - Retrieve related Effects for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
this EffectsCallBuilder instance
- for_operation(operation_id)
This endpoint represents all effects that occurred as a result of a given operation.
See Retrieve an Operation’s Effects for more information.
- for_transaction(transaction_hash)
This endpoint represents all effects that occurred as a result of a given transaction.
See Retrieve a Transaction’s Effects for more information.
- Parameters:
transaction_hash (
str
) – transaction hash- Returns:
this EffectCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
FeeStatsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.FeeStatsCallBuilder(horizon_url, client)[source]
Creates a new
FeeStatsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.fee_stats()
.See Fee Stats for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
LedgersCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.LedgersCallBuilder(horizon_url, client)[source]
Creates a new
LedgersCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.ledgers()
.See List All Ledgers for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- ledger(sequence)
Provides information on a single ledger.
See Retrieve a Ledger for more information.
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
LiquidityPoolsBuilder
- class stellar_sdk.call_builder.call_builder_sync.LiquidityPoolsBuilder(horizon_url, client)[source]
Creates a new
LiquidityPoolsBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.liquidity_pools()
.See List Liquidity Pools for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
Filter pools for a specific account
See List Liquidity Pools for more information.
- Parameters:
account_id (
str
) – account id- Returns:
current LiquidityPoolsBuilder instance
- for_reserves(reserves)
Get pools by reserves.
Horizon will provide an endpoint to find all liquidity pools which contain a given set of reserve assets.
See List Liquidity Pools for more information.
- Returns:
current LiquidityPoolsBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- liquidity_pool(liquidity_pool_id)
Provides information on a liquidity pool.
See Retrieve a Liquidity Pool for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
current LiquidityPoolsBuilder instance
OffersCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.OffersCallBuilder(horizon_url, client)[source]
Creates a new
OffersCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.offers()
.See List All Offers for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all offers a given account has currently open and can be used in streaming mode.
See Retrieve an Account’s Offers for more information.
- Parameters:
account_id (
str
) – Account ID- Returns:
current PaymentsCallBuilder instance
- for_buying(buying)
Returns all offers buying an asset.
People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the current offers, allowing filtering by seller, selling_asset or buying_asset.
See List All Offers for more information.
- Parameters:
buying (
Asset
) – The asset being bought.- Returns:
this OffersCallBuilder instance
- for_seller(seller)
Returns all offers where the given account is the seller.
People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the current offers, allowing filtering by seller, selling_asset or buying_asset.
See List All Offers for more information.
- Parameters:
seller (
str
) – Account ID of the offer creator- Returns:
this OffersCallBuilder instance
- for_selling(selling)
Returns all offers selling an asset.
People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the current offers, allowing filtering by seller, selling_asset or buying_asset.
See List All Offers for more information.
- Parameters:
selling (
Asset
) – The asset being sold.- Returns:
this OffersCallBuilder instance
- for_sponsor(sponsor)
Filtering offers where the given account is sponsoring the offer entry.
See List All Offers for more information.
- Parameters:
sponsor (
str
) – the sponsor id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current OffersCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- offer(offer_id)
Returns information and links relating to a single offer.
See Retrieve an Offer for more information.
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
OperationsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.OperationsCallBuilder(horizon_url, client)[source]
Creates a new
OperationsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.operations()
.See List All Operations for more information.
- Parameters:
horizon_url – Horizon server URL.
client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all operations that were included in valid transactions that affected a particular account.
See Retrieve an Account’s Operations for more information.
- Parameters:
account_id (
str
) – Account ID- Returns:
this OperationCallBuilder instance
- for_claimable_balance(claimable_balance_id)
This endpoint represents successful operations referencing a given claimable balance and can be used in streaming mode.
See Claimable Balances - Retrieve related Operations for more information.
- Parameters:
claimable_balance_id (
str
) – This claimable balance’s id encoded in a hex string representation.- Returns:
this OperationCallBuilder instance
- for_ledger(sequence)
This endpoint returns all operations that occurred in a given ledger.
See Retrieve a Ledger’s Operations for more information.
- for_liquidity_pool(liquidity_pool_id)
This endpoint represents all operations that are part of a given liquidity pool.
See Liquidity Pools - Retrieve related Operations for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
this OperationCallBuilder instance
- for_transaction(transaction_hash)
This endpoint represents all operations that are part of a given transaction.
See Retrieve a Transaction’s Operations for more information.
- Parameters:
transaction_hash (
str
) – Transaction Hash- Returns:
this OperationCallBuilder instance
- include_failed(include_failed)
Adds a parameter defining whether to include failed transactions. By default only operations of successful transactions are returned.
- Parameters:
include_failed (
bool
) – Set to True to include operations of failed transactions.- Returns:
current OperationsCallBuilder instance
- join(join)
join represents join param in queries, currently only supports transactions
- Parameters:
join (
str
) – join represents join param in queries, currently only supports transactions- Returns:
current OperationsCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- operation(operation_id)
The operation details endpoint provides information on a single operation. The operation ID provided in the id argument specifies which operation to load.
See Retrieve an Operation for more information.
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
OrderbookCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.OrderbookCallBuilder(horizon_url, client, selling, buying)[source]
Creates a new
OrderbookCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.orderbook()
.See Orderbook for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.selling (
Asset
) – Asset being soldbuying (
Asset
) – Asset being bought
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
PaymentsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.PaymentsCallBuilder(horizon_url, client)[source]
Creates a new
PaymentsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.payments()
.See List All Payments for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver.
See Retrieve an Account’s Payments for more information.
- Parameters:
account_id (
str
) – Account ID- Returns:
current PaymentsCallBuilder instance
- for_ledger(sequence)
This endpoint represents all payment operations that are part of a valid transactions in a given ledger.
See Retrieve a Ledger’s Payments for more information.
- for_transaction(transaction_hash)
This endpoint represents all payment operations that are part of a given transaction.
P.S. The documentation provided by SDF seems to be missing this API.
- Parameters:
transaction_hash (
str
) – Transaction hash- Returns:
current PaymentsCallBuilder instance
- include_failed(include_failed)
Adds a parameter defining whether to include failed transactions. By default only payments of successful transactions are returned.
- Parameters:
include_failed (
bool
) – Set toTrue
to include payments of failed transactions.- Returns:
current PaymentsCallBuilder instance
- join(join)
join represents join param in queries, currently only supports transactions
- Parameters:
join (
str
) – join represents join param in queries, currently only supports transactions- Returns:
current OperationsCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
RootCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.RootCallBuilder(horizon_url, client)[source]
Creates a new
RootCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.root()
.- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
StrictReceivePathsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.StrictReceivePathsCallBuilder(horizon_url, client, source, destination_asset, destination_amount)[source]
Creates a new
StrictReceivePathsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.strict_receive_paths()
.The Stellar Network allows payments to be made across assets through path payments. A path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee).
A path search is specified using:
The source address or source assets.
The asset and amount that the destination account should receive.
As part of the search, horizon will load a list of assets available to the source address and will find any payment paths from those source assets to the desired destination asset. The search’s amount parameter will be used to determine if there a given path can satisfy a payment of the desired amount.
If a list of assets is passed as the source, horizon will find any payment paths from those source assets to the desired destination asset.
See List Strict Receive Payment Paths for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.source (
Union
[str
,List
[Asset
]]) – The sender’s account ID or a list of Assets. Any returned path must use a source that the sender can hold.destination_asset (
Asset
) – The destination asset.destination_amount (
Union
[str
,Decimal
]) – The amount, denominated in the destination asset, that any returned path should be able to satisfy.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
StrictSendPathsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.StrictSendPathsCallBuilder(horizon_url, client, source_asset, source_amount, destination)[source]
Creates a new
StrictSendPathsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.strict_send_paths()
.The Stellar Network allows payments to be made across assets through path payments. A strict send path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee).
A strict send path search is specified using:
The source asset
The source amount
The destination assets or destination account.
As part of the search, horizon will load a list of assets available to the source address and will find any payment paths from those source assets to the desired destination asset. The search’s source_amount parameter will be used to determine if there a given path can satisfy a payment of the desired amount.
See List Strict Send Payment Paths for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.source_asset (
Asset
) – The asset to be sent.source_amount (
Union
[str
,Decimal
]) – The amount, denominated in the source asset, that any returned path should be able to satisfy.destination (
Union
[str
,List
[Asset
]]) – The destination account or the destination assets.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
TradeAggregationsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.TradeAggregationsCallBuilder(horizon_url, client, base, counter, resolution, start_time=None, end_time=None, offset=None)[source]
Creates a new
TradeAggregationsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.trade_aggregations()
.Trade Aggregations facilitate efficient gathering of historical trade data.
See List Trade Aggregations for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.base (
Asset
) – base assetcounter (
Asset
) – counter assetresolution (
int
) – segment duration as millis since epoch. Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).start_time (
int
) – lower time boundary represented as millis since epochend_time (
int
) – upper time boundary represented as millis since epochoffset (
int
) – segments can be offset using this parameter. Expressed in milliseconds. Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
TradesCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.TradesCallBuilder(horizon_url, client)[source]
Creates a new
TradesCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.trades()
.See List All Trades for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
Filter trades for a specific account
See Retrieve an Account’s Trades for more information.
- Parameters:
account_id (
str
) – account id- Returns:
current TradesCallBuilder instance
- for_asset_pair(base, counter)
Filter trades for a specific asset pair (orderbook)
See List All Trades for more information.
- for_liquidity_pool(liquidity_pool_id)
Filter trades for a specific liquidity pool.
See Liquidity Pools - Retrieve related Trades
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
current TradesCallBuilder instance
- for_offer(offer_id)
Filter trades for a specific offer
See List All Trades for more information.
- for_trade_type(trade_type)
Filter trades for a specific trade type
Horizon will reject requests which attempt to set trade_type to
liquidity_pools
when using the offer id filter.- Parameters:
trade_type (
str
) – trade type, the currently supported types are"orderbook"
,"liquidity_pool"
and"all"
, defaults to"all"
.- Returns:
current TradesCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
TransactionsCallBuilder
- class stellar_sdk.call_builder.call_builder_sync.TransactionsCallBuilder(horizon_url, client)[source]
Creates a new
TransactionsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.Server.transactions()
.See List All Transactions for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseSyncClient
) – The client instance used to send request.
- call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all transactions that affected a given account.
See Retrieve an Account’s Transactions for more information.
- Parameters:
account_id (
str
) – account id- Returns:
current TransactionsCallBuilder instance
- for_claimable_balance(claimable_balance_id)
This endpoint represents all transactions referencing a given claimable balance and can be used in streaming mode.
See Claimable Balances - Retrieve related Transactions
- Parameters:
claimable_balance_id (
str
) – This claimable balance’s id encoded in a hex string representation.- Returns:
current TransactionsCallBuilder instance
- for_ledger(sequence)
This endpoint represents all transactions in a given ledger.
See Retrieve a Ledger’s Transactions for more information.
- for_liquidity_pool(liquidity_pool_id)
This endpoint represents all transactions referencing a given liquidity pool.
See Liquidity Pools - Retrieve related Transactions
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
this TransactionsCallBuilder instance
- include_failed(include_failed)
Adds a parameter defining whether to include failed transactions. By default only transactions of successful transactions are returned.
- Parameters:
include_failed (
bool
) – Set to True to include failed transactions.- Returns:
current TransactionsCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- transaction(transaction_hash)
The transaction details endpoint provides information on a single transaction. The transaction hash provided in the hash argument specifies which transaction to load.
See Retrieve a Transaction for more information.
- Parameters:
transaction_hash (
str
) – transaction hash- Returns:
current TransactionsCallBuilder instance
Call Builder Async
AccountsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.AccountsCallBuilder(horizon_url, client)[source]
Creates a new
AccountsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.accounts()
.See List All Accounts for more information.
- Parameters:
horizon_url – Horizon server URL.
client (
BaseAsyncClient
) – The client instance used to send request.
- account_id(account_id)
Returns information and links relating to a single account. The balances section in the returned JSON will also list all the trust lines this account has set up.
See Retrieve an Account for more information.
- Parameters:
account_id (
str
) – account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AccountCallBuilder instance
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_asset(asset)
Filtering accounts who have a trustline to an asset. The result is a list of accounts.
See List All Accounts for more information.
- Parameters:
asset (
Asset
) – an issued asset- Returns:
current AccountCallBuilder instance
- for_liquidity_pool(liquidity_pool_id)
Filtering accounts who have a trustline for the given pool. The result is a list of accounts.
See List All Accounts for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string., for example:"dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7"
- Returns:
current AccountCallBuilder instance
- for_signer(signer)
Filtering accounts who have a given signer. The result is a list of accounts.
See List All Accounts for more information.
- Parameters:
signer (
str
) – signer’s account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AccountCallBuilder instance
- for_sponsor(sponsor)
Filtering accounts where the given account is sponsoring the account or any of its sub-entries.
See List All Accounts for more information.
- Parameters:
sponsor (
str
) – the sponsor id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AccountCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
AssetsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.AssetsCallBuilder(horizon_url, client)[source]
Creates a new
AssetsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.assets()
.See List All Assets for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_code(asset_code)
This endpoint filters all assets by the asset code.
See List All Assets for more information.
- Parameters:
asset_code (
str
) – asset code, for example: USD- Returns:
current AssetCallBuilder instance
- for_issuer(asset_issuer)
This endpoint filters all assets by the asset issuer.
See List All Assets for more information.
- Parameters:
asset_issuer (
str
) – asset issuer, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current AssetCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
ClaimableBalancesCallBuilder
- class stellar_sdk.call_builder.call_builder_async.ClaimableBalancesCallBuilder(horizon_url, client)[source]
Creates a new
ClaimableBalancesCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.claimable_balance()
.See List Claimable Balances for more information.
- Parameters:
horizon_url – Horizon server URL.
client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- claimable_balance(claimable_balance_id)
Returns information and links relating to a single claimable balance.
See List Claimable Balances for more information.
- Parameters:
claimable_balance_id (
str
) – claimable balance id- Returns:
current AccountCallBuilder instance
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_asset(asset)
Returns all claimable balances which provide a balance for the given asset.
See List Claimable Balances for more information.
- Parameters:
asset (
Asset
) – an asset- Returns:
current ClaimableBalancesCallBuilder instance
- for_claimant(claimant)
Returns all claimable balances which can be claimed by the given account ID.
See List Claimable Balances for more information.
- Parameters:
claimant (
str
) – the account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current ClaimableBalancesCallBuilder instance
- for_sponsor(sponsor)
Returns all claimable balances which are sponsored by the given account ID.
See List Claimable Balances for more information.
- Parameters:
sponsor (
str
) – the sponsor id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current ClaimableBalancesCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
DataCallBuilder
- class stellar_sdk.call_builder.call_builder_async.DataCallBuilder(horizon_url, client, account_id, data_name)[source]
Creates a new
DataCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.data()
.See Retrieve an Account’s Data for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.account_id (
str
) – account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
data_name (
str
) – Key name
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
EffectsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.EffectsCallBuilder(horizon_url, client)[source]
Creates a new
EffectsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.effects()
.See List All Effects for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all effects that changed a given account. It will return relevant effects from the creation of the account to the current ledger.
See Retrieve an Account’s Effects for more information.
- Parameters:
account_id (
str
) – account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
this EffectCallBuilder instance
- for_ledger(sequence)
Effects are the specific ways that the ledger was changed by any operation. This endpoint represents all effects that occurred in the given ledger.
See Retrieve a Ledger’s Effects for more information.
- for_liquidity_pool(liquidity_pool_id)
This endpoint represents all effects that occurred as a result of a given liquidity pool.
See Liquidity Pools - Retrieve related Effects for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
this EffectsCallBuilder instance
- for_operation(operation_id)
This endpoint represents all effects that occurred as a result of a given operation.
See Retrieve an Operation’s Effects for more information.
- for_transaction(transaction_hash)
This endpoint represents all effects that occurred as a result of a given transaction.
See Retrieve a Transaction’s Effects for more information.
- Parameters:
transaction_hash (
str
) – transaction hash- Returns:
this EffectCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
FeeStatsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.FeeStatsCallBuilder(horizon_url, client)[source]
Creates a new
FeeStatsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.fee_stats()
.See Fee Stats for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
LedgersCallBuilder
- class stellar_sdk.call_builder.call_builder_async.LedgersCallBuilder(horizon_url, client)[source]
Creates a new
LedgersCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.ledgers()
.See List All Ledgers for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- ledger(sequence)
Provides information on a single ledger.
See Retrieve a Ledger for more information.
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
LiquidityPoolsBuilder
- class stellar_sdk.call_builder.call_builder_async.LiquidityPoolsBuilder(horizon_url, client)[source]
Creates a new
LiquidityPoolsBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.liquidity_pools()
.See List Liquidity Pools for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
Filter pools for a specific account
See List Liquidity Pools for more information.
- Parameters:
account_id (
str
) – account id- Returns:
current LiquidityPoolsBuilder instance
- for_reserves(reserves)
Get pools by reserves.
Horizon will provide an endpoint to find all liquidity pools which contain a given set of reserve assets.
See List Liquidity Pools for more information.
- Returns:
current LiquidityPoolsBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- liquidity_pool(liquidity_pool_id)
Provides information on a liquidity pool.
See Retrieve a Liquidity Pool for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
current LiquidityPoolsBuilder instance
OffersCallBuilder
- class stellar_sdk.call_builder.call_builder_async.OffersCallBuilder(horizon_url, client)[source]
Creates a new
OffersCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.offers()
.See List All Offers for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all offers a given account has currently open and can be used in streaming mode.
See Retrieve an Account’s Offers for more information.
- Parameters:
account_id (
str
) – Account ID- Returns:
current PaymentsCallBuilder instance
- for_buying(buying)
Returns all offers buying an asset.
People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the current offers, allowing filtering by seller, selling_asset or buying_asset.
See List All Offers for more information.
- Parameters:
buying (
Asset
) – The asset being bought.- Returns:
this OffersCallBuilder instance
- for_seller(seller)
Returns all offers where the given account is the seller.
People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the current offers, allowing filtering by seller, selling_asset or buying_asset.
See List All Offers for more information.
- Parameters:
seller (
str
) – Account ID of the offer creator- Returns:
this OffersCallBuilder instance
- for_selling(selling)
Returns all offers selling an asset.
People on the Stellar network can make offers to buy or sell assets. This endpoint represents all the current offers, allowing filtering by seller, selling_asset or buying_asset.
See List All Offers for more information.
- Parameters:
selling (
Asset
) – The asset being sold.- Returns:
this OffersCallBuilder instance
- for_sponsor(sponsor)
Filtering offers where the given account is sponsoring the offer entry.
See List All Offers for more information.
- Parameters:
sponsor (
str
) – the sponsor id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
- Returns:
current OffersCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- offer(offer_id)
Returns information and links relating to a single offer.
See Retrieve an Offer for more information.
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
OperationsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.OperationsCallBuilder(horizon_url, client)[source]
Creates a new
OperationsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.operations()
.See List All Operations for more information.
- Parameters:
horizon_url – Horizon server URL.
client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all operations that were included in valid transactions that affected a particular account.
See Retrieve an Account’s Operations for more information.
- Parameters:
account_id (
str
) – Account ID- Returns:
this OperationCallBuilder instance
- for_claimable_balance(claimable_balance_id)
This endpoint represents successful operations referencing a given claimable balance and can be used in streaming mode.
See Claimable Balances - Retrieve related Operations for more information.
- Parameters:
claimable_balance_id (
str
) – This claimable balance’s id encoded in a hex string representation.- Returns:
this OperationCallBuilder instance
- for_ledger(sequence)
This endpoint returns all operations that occurred in a given ledger.
See Retrieve a Ledger’s Operations for more information.
- for_liquidity_pool(liquidity_pool_id)
This endpoint represents all operations that are part of a given liquidity pool.
See Liquidity Pools - Retrieve related Operations for more information.
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
this OperationCallBuilder instance
- for_transaction(transaction_hash)
This endpoint represents all operations that are part of a given transaction.
See Retrieve a Transaction’s Operations for more information.
- Parameters:
transaction_hash (
str
) – Transaction Hash- Returns:
this OperationCallBuilder instance
- include_failed(include_failed)
Adds a parameter defining whether to include failed transactions. By default only operations of successful transactions are returned.
- Parameters:
include_failed (
bool
) – Set to True to include operations of failed transactions.- Returns:
current OperationsCallBuilder instance
- join(join)
join represents join param in queries, currently only supports transactions
- Parameters:
join (
str
) – join represents join param in queries, currently only supports transactions- Returns:
current OperationsCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- operation(operation_id)
The operation details endpoint provides information on a single operation. The operation ID provided in the id argument specifies which operation to load.
See Retrieve an Operation for more information.
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
OrderbookCallBuilder
- class stellar_sdk.call_builder.call_builder_async.OrderbookCallBuilder(horizon_url, client, selling, buying)[source]
Creates a new
OrderbookCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.orderbook()
.See Orderbook for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.selling (
Asset
) – Asset being soldbuying (
Asset
) – Asset being bought
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
PaymentsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.PaymentsCallBuilder(horizon_url, client)[source]
Creates a new
PaymentsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.payments()
.See List All Payments for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint responds with a collection of Payment operations where the given account was either the sender or receiver.
See Retrieve an Account’s Payments for more information.
- Parameters:
account_id (
str
) – Account ID- Returns:
current PaymentsCallBuilder instance
- for_ledger(sequence)
This endpoint represents all payment operations that are part of a valid transactions in a given ledger.
See Retrieve a Ledger’s Payments for more information.
- for_transaction(transaction_hash)
This endpoint represents all payment operations that are part of a given transaction.
P.S. The documentation provided by SDF seems to be missing this API.
- Parameters:
transaction_hash (
str
) – Transaction hash- Returns:
current PaymentsCallBuilder instance
- include_failed(include_failed)
Adds a parameter defining whether to include failed transactions. By default only payments of successful transactions are returned.
- Parameters:
include_failed (
bool
) – Set toTrue
to include payments of failed transactions.- Returns:
current PaymentsCallBuilder instance
- join(join)
join represents join param in queries, currently only supports transactions
- Parameters:
join (
str
) – join represents join param in queries, currently only supports transactions- Returns:
current OperationsCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
RootCallBuilder
- class stellar_sdk.call_builder.call_builder_async.RootCallBuilder(horizon_url, client)[source]
Creates a new
RootCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.root()
.- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
StrictReceivePathsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.StrictReceivePathsCallBuilder(horizon_url, client, source, destination_asset, destination_amount)[source]
Creates a new
StrictReceivePathsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.strict_receive_paths()
.The Stellar Network allows payments to be made across assets through path payments. A path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee).
A path search is specified using:
The source address or source assets.
The asset and amount that the destination account should receive.
As part of the search, horizon will load a list of assets available to the source address and will find any payment paths from those source assets to the desired destination asset. The search’s amount parameter will be used to determine if there a given path can satisfy a payment of the desired amount.
If a list of assets is passed as the source, horizon will find any payment paths from those source assets to the desired destination asset.
See List Strict Receive Payment Paths for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.source (
Union
[str
,List
[Asset
]]) – The sender’s account ID or a list of Assets. Any returned path must use a source that the sender can hold.destination_asset (
Asset
) – The destination asset.destination_amount (
Union
[str
,Decimal
]) – The amount, denominated in the destination asset, that any returned path should be able to satisfy.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
StrictSendPathsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.StrictSendPathsCallBuilder(horizon_url, client, source_asset, source_amount, destination)[source]
Creates a new
StrictSendPathsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.strict_send_paths()
.The Stellar Network allows payments to be made across assets through path payments. A strict send path payment specifies a series of assets to route a payment through, from source asset (the asset debited from the payer) to destination asset (the asset credited to the payee).
A strict send path search is specified using:
The source asset
The source amount
The destination assets or destination account.
As part of the search, horizon will load a list of assets available to the source address and will find any payment paths from those source assets to the desired destination asset. The search’s source_amount parameter will be used to determine if there a given path can satisfy a payment of the desired amount.
See List Strict Send Payment Paths for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.source_asset (
Asset
) – The asset to be sent.source_amount (
Union
[str
,Decimal
]) – The amount, denominated in the source asset, that any returned path should be able to satisfy.destination (
Union
[str
,List
[Asset
]]) – The destination account or the destination assets.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
TradeAggregationsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.TradeAggregationsCallBuilder(horizon_url, client, base, counter, resolution, start_time=None, end_time=None, offset=None)[source]
Creates a new
TradeAggregationsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.trade_aggregations()
.Trade Aggregations facilitate efficient gathering of historical trade data.
See List Trade Aggregations for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.base (
Asset
) – base assetcounter (
Asset
) – counter assetresolution (
int
) – segment duration as millis since epoch. Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).start_time (
int
) – lower time boundary represented as millis since epochend_time (
int
) – upper time boundary represented as millis since epochoffset (
int
) – segments can be offset using this parameter. Expressed in milliseconds. Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
TradesCallBuilder
- class stellar_sdk.call_builder.call_builder_async.TradesCallBuilder(horizon_url, client)[source]
Creates a new
TradesCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.trades()
.See List All Trades for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
Filter trades for a specific account
See Retrieve an Account’s Trades for more information.
- Parameters:
account_id (
str
) – account id- Returns:
current TradesCallBuilder instance
- for_asset_pair(base, counter)
Filter trades for a specific asset pair (orderbook)
See List All Trades for more information.
- for_liquidity_pool(liquidity_pool_id)
Filter trades for a specific liquidity pool.
See Liquidity Pools - Retrieve related Trades
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
current TradesCallBuilder instance
- for_offer(offer_id)
Filter trades for a specific offer
See List All Trades for more information.
- for_trade_type(trade_type)
Filter trades for a specific trade type
Horizon will reject requests which attempt to set trade_type to
liquidity_pools
when using the offer id filter.- Parameters:
trade_type (
str
) – trade type, the currently supported types are"orderbook"
,"liquidity_pool"
and"all"
, defaults to"all"
.- Returns:
current TradesCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
TransactionsCallBuilder
- class stellar_sdk.call_builder.call_builder_async.TransactionsCallBuilder(horizon_url, client)[source]
Creates a new
TransactionsCallBuilder
pointed to server defined by horizon_url. Do not create this object directly, usestellar_sdk.ServerAsync.transactions()
.See List All Transactions for more information.
- Parameters:
horizon_url (
str
) – Horizon server URL.client (
BaseAsyncClient
) – The client instance used to send request.
- async call()
Triggers a HTTP request using this builder’s current configuration.
- Return type:
- Returns:
If it is called synchronous, the response will be returned. If it is called asynchronously, it will return Coroutine.
- Raises:
ConnectionError
: if you have not successfully connected to the server.NotFoundError
: if status_code == 404BadRequestError
: if 400 <= status_code < 500 and status_code != 404BadResponseError
: if 500 <= status_code < 600UnknownRequestError
: if an unknown error occurs, please submit an issue
- cursor(cursor)
Sets
cursor
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- for_account(account_id)
This endpoint represents all transactions that affected a given account.
See Retrieve an Account’s Transactions for more information.
- Parameters:
account_id (
str
) – account id- Returns:
current TransactionsCallBuilder instance
- for_claimable_balance(claimable_balance_id)
This endpoint represents all transactions referencing a given claimable balance and can be used in streaming mode.
See Claimable Balances - Retrieve related Transactions
- Parameters:
claimable_balance_id (
str
) – This claimable balance’s id encoded in a hex string representation.- Returns:
current TransactionsCallBuilder instance
- for_ledger(sequence)
This endpoint represents all transactions in a given ledger.
See Retrieve a Ledger’s Transactions for more information.
- for_liquidity_pool(liquidity_pool_id)
This endpoint represents all transactions referencing a given liquidity pool.
See Liquidity Pools - Retrieve related Transactions
- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Returns:
this TransactionsCallBuilder instance
- include_failed(include_failed)
Adds a parameter defining whether to include failed transactions. By default only transactions of successful transactions are returned.
- Parameters:
include_failed (
bool
) – Set to True to include failed transactions.- Returns:
current TransactionsCallBuilder instance
- limit(limit)
Sets
limit
parameter for the current call. Returns the CallBuilder object on which this method has been called.See Pagination
- Parameters:
limit (
int
) – Number of records the server should return.- Returns:
- order(desc=True)
Sets order parameter for the current call. Returns the CallBuilder object on which this method has been called.
- Parameters:
desc (
bool
) – Sort direction,True
to get desc sort direction, the default setting isTrue
.- Returns:
current CallBuilder instance
- async stream()
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
an EventSource.
- Raise:
StreamClientError
- Failed to fetch stream resource.
- transaction(transaction_hash)
The transaction details endpoint provides information on a single transaction. The transaction hash provided in the hash argument specifies which transaction to load.
See Retrieve a Transaction for more information.
- Parameters:
transaction_hash (
str
) – transaction hash- Returns:
current TransactionsCallBuilder instance
Client
BaseAsyncClient
- class stellar_sdk.client.base_async_client.BaseAsyncClient[source]
This is an abstract class, and if you want to implement your own asynchronous client, you must implement this class.
- abstract stream(url, params=None)[source]
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
- Parameters:
- Return type:
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns:
a dict AsyncGenerator for server response
- Raise:
BaseSyncClient
- class stellar_sdk.client.base_sync_client.BaseSyncClient[source]
This is an abstract class, and if you want to implement your own synchronous client, you must implement this class.
- abstract stream(url, params=None)[source]
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
AiohttpClient
- class stellar_sdk.client.aiohttp_client.AiohttpClient(pool_size=None, request_timeout=11, post_timeout=33.0, backoff_factor=0.5, user_agent=None, custom_headers=None, **kwargs)[source]
The
AiohttpClient
object is a asynchronous http client, which represents the interface for making requests to a server instance.- Parameters:
pool_size (
Optional
[int
]) – persistent connection to Horizon and connection poolrequest_timeout (
float
) – the timeout for all GET requestspost_timeout (
float
) – the timeout for all POST requestsbackoff_factor (
Optional
[float
]) – a backoff factor to apply between attempts after the second tryuser_agent (
Optional
[str
]) – the server can use it to identify youcustom_headers (
Optional
[Dict
[str
,str
]]) – any additional HTTP headers to add in requests
RequestsClient
- class stellar_sdk.client.requests_client.RequestsClient(pool_size=10, num_retries=3, request_timeout=11, post_timeout=33.0, backoff_factor=0.5, session=None, stream_session=None, custom_headers=None)[source]
The
RequestsClient
object is a synchronous http client, which represents the interface for making requests to a server instance.- Parameters:
pool_size (
int
) – persistent connection to Horizon and connection poolnum_retries (
int
) – configurable request retry functionalityrequest_timeout (
int
) – the timeout for all GET requests (for each retry)post_timeout (
float
) – the timeout for all POST requests (for each retry)backoff_factor (
float
) – a backoff factor to apply between attempts after the second trysession (
Session
) – the request sessionstream_session (
Session
) – the stream request sessioncustom_headers (
Optional
[Dict
[str
,str
]]) – any additional HTTP headers to add in requests
- stream(url, params=None)[source]
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
SimpleRequestsClient
- class stellar_sdk.client.simple_requests_client.SimpleRequestsClient[source]
The
SimpleRequestsClient
object is a synchronous http client, which represents the interface for making requests to a server instance.This client is to guide you in writing a client that suits your needs. I don’t recommend that you actually use it.
Response
Exceptions
SdkError
BadSignatureError
Ed25519PublicKeyInvalidError
Ed25519SecretSeedInvalidError
MissingEd25519SecretSeedError
MemoInvalidException
AssetCodeInvalidError
AssetIssuerInvalidError
NoApproximationError
SignatureExistError
BaseRequestError
ConnectionError
BaseHorizonError
NotFoundError
BadRequestError
BadResponseError
FeatureNotEnabledError
Keypair
- class stellar_sdk.keypair.Keypair(verify_key, signing_key=None)[source]
The
Keypair
object, which represents a signing and verifying key for use with the Stellar network.Instead of instantiating the class directly, we recommend using one of several class methods:
Learn how to create a key through our documentation: Generate Keypair.
- Parameters:
verify_key (
VerifyKey
) – The verifying (public) Ed25519 key in the keypair.signing_key (
SigningKey
) – The signing (private) Ed25519 key in the keypair.
- classmethod from_mnemonic_phrase(mnemonic_phrase, language=Language.ENGLISH, passphrase='', index=0)[source]
Generate a
Keypair
object via a mnemonic phrase.- Parameters:
mnemonic_phrase (
str
) – A unique string used to deterministically generate keypairs.language (
Union
[Language
,str
]) – The language of the mnemonic phrase, defaults to english.passphrase (
str
) – An optional passphrase used as part of the salt during PBKDF2 rounds when generating the seed from the mnemonic.index (
int
) –The index of the keypair generated by the mnemonic. This allows for multiple Keypairs to be derived from the same mnemonic, such as:
>>> from stellar_sdk.keypair import Keypair >>> mnemonic = 'update hello cry airport drive chunk elite boat shaft sea describe number' # Don't use this mnemonic in practice. >>> kp1 = Keypair.from_mnemonic_phrase(mnemonic, index=0) >>> kp2 = Keypair.from_mnemonic_phrase(mnemonic, index=1) >>> kp3 = Keypair.from_mnemonic_phrase(mnemonic, index=2)
- Return type:
- Returns:
A new
Keypair
object derived from the mnemonic.
- classmethod from_public_key(public_key)[source]
Generate a
Keypair
object from a public key.- Parameters:
public_key (
str
) – public key (ex."GATPGGOIE6VWADVKD3ER3IFO2IH6DTOA5G535ITB3TT66FZFSIZEAU2B"
)- Return type:
- Returns:
A new
Keypair
object derived by the public key.- Raise:
Ed25519PublicKeyInvalidError
: if public_key is not a valid ed25519 public key.
- classmethod from_raw_ed25519_public_key(raw_public_key)[source]
Generate a
Keypair
object from ed25519 public key raw bytes.
- classmethod from_raw_ed25519_seed(raw_seed)[source]
Generate a
Keypair
object from ed25519 secret key seed raw bytes.
- classmethod from_secret(secret)[source]
Generate a
Keypair
object from a secret key.- Parameters:
secret (
str
) – secret key (ex."SB2LHKBL24ITV2Y346BU46XPEL45BDAFOOJLZ6SESCJZ6V5JMP7D6G5X"
)- Return type:
- Returns:
A new
Keypair
object derived by the secret.- Raise:
Ed25519SecretSeedInvalidError
: if secret is not a valid ed25519 secret seed.
- static generate_mnemonic_phrase(language=Language.ENGLISH, strength=128)[source]
Generate a mnemonic phrase.
- property public_key: str
Returns public key associated with this
Keypair
object- Returns:
public key
- property secret: str
Returns secret key associated with this
Keypair
object- Returns:
secret key
- Raise:
MissingEd25519SecretSeedError
TheKeypair
does not contain secret seed
- sign(data)[source]
Sign the provided data with the keypair’s private key.
- Parameters:
data (
bytes
) – The data to sign.- Return type:
- Returns:
signed bytes
- Raise:
MissingEd25519SecretSeedError
: ifKeypair
does not contain secret seed.
- sign_decorated(data)[source]
Sign the provided data with the keypair’s private key and returns DecoratedSignature.
- Parameters:
data (
bytes
) – signed bytes- Return type:
- Returns:
sign decorated
- sign_payload_decorated(data)[source]
Returns the decorated signature hint for a signed payload signer.
The signature hint of an ed25519 signed payload signer is the last 4 bytes of the ed25519 public key XORed with last 4 bytes of the payload. If the payload has a length less than 4 bytes, then 1 to 4 zero bytes are appended to the payload such that it has a length of 4 bytes, for calculating the hint.
- Parameters:
data (
bytes
) – data to both sign and treat as the payload- Return type:
- Returns:
sign decorated
- signature_hint()[source]
Returns signature hint associated with this
Keypair
object- Return type:
- Returns:
signature hint
- verify(data, signature)[source]
Verify the provided data and signature match this keypair’s public key.
- Parameters:
- Raise:
BadSignatureError
: if the verification failed and the signature was incorrect.- Return type:
LiquidityPoolAsset
- stellar_sdk.liquidity_pool_asset.LIQUIDITY_POOL_FEE_V18 = 30
LIQUIDITY_POOL_FEE_V18 is the default liquidity pool fee in protocol v18. It defaults to 30 base points (0.3%).
- class stellar_sdk.liquidity_pool_asset.LiquidityPoolAsset(asset_a, asset_b, fee=30)[source]
The
LiquidityPoolAsset
object, which represents a liquidity pool trustline change.- Parameters:
asset_a (
Asset
) – The first asset in the Pool, it must respect the rule asset_a < asset_b. Seestellar_sdk.liquidity_pool_asset.LiquidityPoolAsset.is_valid_lexicographic_order()
for more details on how assets are sorted.asset_b (
Asset
) – The second asset in the Pool, it must respect the rule asset_a < asset_b. Seestellar_sdk.liquidity_pool_asset.LiquidityPoolAsset.is_valid_lexicographic_order()
for more details on how assets are sorted.fee (
int
) – The liquidity pool fee. For now the only fee supported is 30.
- Raise:
ValueError
- classmethod from_xdr_object(xdr_object)[source]
Create a
LiquidityPoolAsset
from an XDR ChangeTrustAsset object.- Parameters:
xdr_object (
ChangeTrustAsset
) – The XDR ChangeTrustAsset object.- Return type:
- Returns:
A new
LiquidityPoolAsset
object from the given XDR ChangeTrustAsset object.
- static is_valid_lexicographic_order(asset_a, asset_b)[source]
Compares if asset_a < asset_b according with the criteria:
First compare the type (eg. native before alphanum4 before alphanum12).
If the types are equal, compare the assets codes.
If the asset codes are equal, compare the issuers.
- property liquidity_pool_id: str
Computes the liquidity pool id for current instance.
- Returns:
Liquidity pool id.
LiquidityPoolId
- class stellar_sdk.liquidity_pool_id.LiquidityPoolId(liquidity_pool_id)[source]
The
LiquidityPoolId
object, which represents the asset referenced by a trustline to a liquidity pool.- Parameters:
liquidity_pool_id (
str
) – The ID of the liquidity pool in hex string.- Raise:
ValueError
- classmethod from_xdr_object(xdr_object)[source]
Create a
LiquidityPoolId
from an XDR Asset object.- Parameters:
xdr_object (
TrustLineAsset
) – The XDR TrustLineAsset object.- Return type:
- Returns:
A new
LiquidityPoolId
object from the given XDR TrustLineAsset object.
Memo
Memo
- class stellar_sdk.memo.Memo[source]
The
Memo
object, which represents the base class for memos for use with Stellar transactions.The memo for a transaction contains optional extra information about the transaction taking place. It is the responsibility of the client to interpret this value.
See the following implementations that serve a more practical use with the library:
NoneMemo
- No memo.TextMemo
- A string encoded using either ASCII or UTF-8, up to 28-bytes long.IdMemo
- A 64 bit unsigned integer.HashMemo
- A 32 byte hash.RetHashMemo
- A 32 byte hash intended to be interpreted as the hash of the transaction the sender is refunding.
See Stellar’s documentation on Transactions for more information on how memos are used within transactions, as well as information on the available types of memos.
NoneMemo
TextMemo
- class stellar_sdk.memo.TextMemo(text)[source]
The
TextMemo
, which representsMEMO_TEXT
in a transaction.- Parameters:
text (
Union
[str
,bytes
]) – A string encoded using either ASCII or UTF-8, up to 28-bytes long. Note, text can be anything, see this issue for more information.- Raises:
MemoInvalidException
: iftext
is not a valid text memo.
IdMemo
- class stellar_sdk.memo.IdMemo(memo_id)[source]
The
IdMemo
which representsMEMO_ID
in a transaction.- Parameters:
memo_id (
int
) – A 64 bit unsigned integer.- Raises:
MemoInvalidException
: ifid
is not a valid id memo.
HashMemo
- class stellar_sdk.memo.HashMemo(memo_hash)[source]
The
HashMemo
which representsMEMO_HASH
in a transaction.- Parameters:
memo_hash (
Union
[bytes
,str
]) – A 32 byte hash hex encoded string.- Raises:
MemoInvalidException
: ifmemo_hash
is not a valid hash memo.
ReturnHashMemo
- class stellar_sdk.memo.ReturnHashMemo(memo_return)[source]
The
ReturnHashMemo
which representsMEMO_RETURN
in a transaction.MEMO_RETURN is typically used with refunds/returns over the network - it is a 32 byte hash intended to be interpreted as the hash of the transaction the sender is refunding.
- Parameters:
memo_return (
Union
[bytes
,str
]) – A 32 byte hash or hex encoded string intended to be interpreted as the hash of the transaction the sender is refunding.- Raises:
MemoInvalidException
: ifmemo_return
is not a valid return hash memo.
- classmethod from_xdr_object(xdr_object)[source]
Returns an
ReturnHashMemo
object from XDR memo object.- Return type:
- to_xdr_object()[source]
Creates an XDR Memo object that represents this
ReturnHashMemo
.- Return type:
MuxedAccount
- class stellar_sdk.muxed_account.MuxedAccount(account_id, account_muxed_id=None)[source]
The
MuxedAccount
object, which represents a multiplexed account on Stellar’s network.An example:
from stellar_sdk import MuxedAccount account_id = "GAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSTVY" account_muxed_id = 1234 account_muxed = "MAQAA5L65LSYH7CQ3VTJ7F3HHLGCL3DSLAR2Y47263D56MNNGHSQSAAAAAAAAAAE2LP26" # generate account_muxed muxed = MuxedAccount(account=account_id, account_muxed_id=1234) # account_muxed_id is optional. print(f"account_muxed: {muxed.account_muxed}") # `account_muxed` returns ``None`` if `account_muxed_id` is ``None``. # parse account_muxed muxed = MuxedAccount.from_account(account_muxed) print(f"account_id: {muxed.account_id}\n" f"account_muxed_id: {muxed.account_muxed_id}")
See SEP-0023 for more information.
- Parameters:
account_id (
str
) – ed25519 account id, for example:"GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
. It should be a string starting withG
. If you want to build a MuxedAccount object using an address starting withM
, please usestellar_sdk.MuxedAccount.from_account()
.account_muxed_id (
Optional
[int
]) – account multiplexing id (ex.1234
)
- property account_muxed: str | None
Get the multiplex address starting with
M
, returnNone
if account_id_id isNone
.
- classmethod from_account(account)[source]
Create a
MuxedAccount
object from account id or muxed account id.- Parameters:
account (
str
) – account id or muxed account id (ex."GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
or"MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY"
)- Return type:
- classmethod from_xdr_object(xdr_object)[source]
Create a
MuxedAccount
object from an XDR Asset object.- Parameters:
xdr_object (
MuxedAccount
) – The MuxedAccount object.- Return type:
- Returns:
A new
MuxedAccount
object from the given XDR MuxedAccount object.
- to_xdr_object()[source]
Returns the xdr object for this MuxedAccount object.
- Return type:
- Returns:
XDR MuxedAccount object
- property universal_account_id: str
Get the universal account id, if account_muxed_id is
None
, it will return ed25519 public key (ex."GDGQVOKHW4VEJRU2TETD6DBRKEO5ERCNF353LW5WBFW3JJWQ2BRQ6KDD"
), otherwise it will return muxed account (ex."MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY"
)
Network
- class stellar_sdk.network.Network(network_passphrase)[source]
The
Network
object, which represents a Stellar network.This class represents such a stellar network such as the Public network and the Test network.
- Parameters:
network_passphrase (
str
) – The passphrase for the network. (ex."Public Global Stellar Network ; September 2015"
)
-
FUTURENET_NETWORK_PASSPHRASE:
str
= 'Test SDF Future Network ; October 2022' The Future network passphrase.
-
PUBLIC_NETWORK_PASSPHRASE:
str
= 'Public Global Stellar Network ; September 2015' The Public network passphrase.
- SANDBOX_NETWORK_PASSPHRASE = 'Local Sandbox Stellar Network ; September 2022'
The Sandbox network passphrase.
-
STANDALONE_NETWORK_PASSPHRASE:
str
= 'Standalone Network ; February 2017' The Standalone network passphrase.
- network_id()[source]
Get the network ID of the network, which is an hash of the passphrase.
- Return type:
- Returns:
The network ID of the network.
Operation
Operation
- class stellar_sdk.operation.Operation(source=None)[source]
The
Operation
object, which represents an operation on Stellar’s network.An operation is an individual command that mutates Stellar’s ledger. It is typically rolled up into a transaction (a transaction is a list of operations with additional metadata).
Operations are executed on behalf of the source account specified in the transaction, unless there is an override defined for the operation.
For more on operations, see Stellar’s documentation on operations as well as Stellar’s List of Operations, which includes information such as the security necessary for a given operation, as well as information about when validity checks occur on the network.
The
Operation
class is typically not used, but rather one of its subclasses is typically included in transactions.- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Create the appropriate
Operation
subclass from the XDR object.
- static get_source_from_xdr_obj(xdr_object)[source]
Get the source account from account the operation xdr object.
- Parameters:
xdr_object (
Operation
) – the operation xdr object.- Return type:
- Returns:
The source account from account the operation xdr object.
- static to_xdr_amount(value)[source]
Converts an amount to the appropriate value to send over the network as a part of an XDR object.
Each asset amount is encoded as a signed 64-bit integer in the XDR structures. An asset amount unit (that which is seen by end users) is scaled down by a factor of ten million (10,000,000) to arrive at the native 64-bit integer representation. For example, the integer amount value 25,123,456 equals 2.5123456 units of the asset. This scaling allows for seven decimal places of precision in human-friendly amount units.
This static method correctly multiplies the value by the scaling factor in order to come to the integer value used in XDR structures.
See Stellar’s documentation on Asset Precision for more information.
AccountMerge
- class stellar_sdk.operation.AccountMerge(destination, source=None)[source]
The
AccountMerge
object, which represents a AccountMerge operation on Stellar’s network.Transfers the native balance (the amount of XLM an account holds) to another account and removes the source account from the ledger.
Threshold: High
See Account Merge for more information.
- Parameters:
destination (
Union
[MuxedAccount
,str
]) – Destination to merge the source account into.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
AccountMerge
object from an XDR Operation object.- Return type:
AllowTrust
- class stellar_sdk.operation.AllowTrust(trustor, asset_code, authorize, source=None)[source]
The
AllowTrust
object, which represents a AllowTrust operation on Stellar’s network.Updates the authorized flag of an existing trustline. This can only be called by the issuer of a trustline’s asset.
The issuer can only clear the authorized flag if the issuer has the
AUTH_REVOCABLE_FLAG
set. Otherwise, the issuer can only set the authorized flag.Threshold: Low
See Allow Trust for more information.
- Parameters:
trustor (
str
) – The trusting account (the one being authorized).asset_code (
str
) – The asset code being authorized.authorize (
Union
[TrustLineEntryFlag
,bool
]) – True to authorize the line, False to deauthorize,if you need further control, you can also usestellar_sdk.operation.allow_trust.TrustLineEntryFlag
.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
AllowTrust
object from an XDR Operation object.- Return type:
- class stellar_sdk.operation.allow_trust.TrustLineEntryFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Indicates which flags to set. For details about the flags, please refer to the CAP-0018.
UNAUTHORIZED_FLAG: The account can hold a balance but cannot receive payments, send payments, maintain offers or manage offers
AUTHORIZED_FLAG: The account can hold a balance, receive payments, send payments, maintain offers or manage offers
AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG: The account can hold a balance and maintain offers but cannot receive payments, send payments or manage offers
BumpSequence
- class stellar_sdk.operation.BumpSequence(bump_to, source=None)[source]
The
BumpSequence
object, which represents a BumpSequence operation on Stellar’s network.Bump sequence allows to bump forward the sequence number of the source account of the operation, allowing to invalidate any transactions with a smaller sequence number. If the specified bumpTo sequence number is greater than the source account’s sequence number, the account’s sequence number is updated with that value, otherwise it’s not modified.
Threshold: Low
See Bump Sequence for more information.
- Parameters:
bump_to (
int
) – Sequence number to bump to.source (
Union
[MuxedAccount
,str
,None
]) – The optional source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
BumpSequence
object from an XDR Operation object.- Return type:
ChangeTrust
- class stellar_sdk.operation.ChangeTrust(asset, limit=None, source=None)[source]
The
ChangeTrust
object, which represents a ChangeTrust operation on Stellar’s network.Creates, updates, or deletes a trustline. For more on trustlines, please refer to the assets documentation.
Threshold: Medium
See Change Trust for more information.
- Parameters:
asset (
Union
[Asset
,LiquidityPoolAsset
]) – The asset for the trust line.limit (
Union
[str
,Decimal
,None
]) – The limit for the asset, defaults to max int64(922337203685.4775807
). If the limit is set to"0"
it deletes the trustline.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ChangeTrust
object from an XDR Operation object.- Return type:
CreateAccount
- class stellar_sdk.operation.CreateAccount(destination, starting_balance, source=None)[source]
The
CreateAccount
object, which represents a Create Account operation on Stellar’s network.This operation creates and funds a new account with the specified starting balance.
Threshold: Medium
See Create Account for more information.
- Parameters:
destination (
str
) – Destination account ID to create an account for.starting_balance (
Union
[str
,Decimal
]) – Amount in XLM the account should be funded for. Must be greater than the reserve balance amount.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
CreateAccount
object from an XDR Operation object.- Return type:
CreatePassiveSellOffer
- class stellar_sdk.operation.CreatePassiveSellOffer(selling, buying, amount, price, source=None)[source]
The
CreatePassiveSellOffer
object, which represents a CreatePassiveSellOffer operation on Stellar’s network.A passive sell offer is an offer that does not act on and take a reverse offer of equal price. Instead, they only take offers of lesser price. For example, if an offer exists to buy 5 BTC for 30 XLM, and you make a passive sell offer to buy 30 XLM for 5 BTC, your passive sell offer does not take the first offer.
Note that regular offers made later than your passive sell offer can act on and take your passive sell offer, even if the regular offer is of the same price as your passive sell offer.
Passive sell offers allow market makers to have zero spread. If you want to trade EUR for USD at 1:1 price and USD for EUR also at 1:1, you can create two passive sell offers so the two offers don’t immediately act on each other.
Once the passive sell offer is created, you can manage it like any other offer using the manage offer operation - see
ManageBuyOffer
for more details.Threshold: Medium
See Create Passive Sell Offer for more information.
- Parameters:
selling (
Asset
) – What you’re selling.buying (
Asset
) – What you’re buying.amount (
Union
[str
,Decimal
]) – The total amount you’re selling.price (
Union
[Price
,str
,Decimal
]) – Price of 1 unit of selling in terms of buying.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
CreatePassiveSellOffer
object from an XDR Operation object.- Return type:
Inflation
- class stellar_sdk.operation.Inflation(source=None)[source]
The
Inflation
object, which represents a Inflation operation on Stellar’s network.This operation runs inflation.
Threshold: Low
- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
LiquidityPoolDeposit
- class stellar_sdk.operation.LiquidityPoolDeposit(liquidity_pool_id, max_amount_a, max_amount_b, min_price, max_price, source=None)[source]
The
LiquidityPoolDeposit
object, which represents a LiquidityPoolDeposit operation on Stellar’s network.Creates a liquidity pool deposit operation.
Threshold: Medium
See Liquidity Pool Deposit for more information.
- Parameters:
liquidity_pool_id (
str
) – The liquidity pool ID.max_amount_a (
Union
[str
,Decimal
]) – Maximum amount of first asset to deposit.max_amount_b (
Union
[str
,Decimal
]) – Maximum amount of second asset to deposit.min_price (
Union
[str
,Decimal
,Price
]) – Minimum deposit_a/deposit_b price.max_price (
Union
[str
,Decimal
,Price
]) – Maximum deposit_a/deposit_b price.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
LiquidityPoolDeposit
object from an XDR Operation object.- Return type:
LiquidityPoolWithdraw
- class stellar_sdk.operation.LiquidityPoolWithdraw(liquidity_pool_id, amount, min_amount_a, min_amount_b, source=None)[source]
The
LiquidityPoolWithdraw
object, which represents a LiquidityPoolWithdraw operation on Stellar’s network.Creates a liquidity pool withdraw operation.
Threshold: Medium
See Liquidity Pool Withdraw for more information.
- Parameters:
liquidity_pool_id (
str
) – The liquidity pool ID.amount (
Union
[str
,Decimal
]) – Amount of pool shares to withdraw.min_amount_a (
Union
[str
,Decimal
]) – Minimum amount of first asset to withdraw.min_amount_b (
Union
[str
,Decimal
]) – Minimum amount of second asset to withdraw.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
LiquidityPoolWithdraw
object from an XDR Operation object.- Return type:
ManageBuyOffer
- class stellar_sdk.operation.ManageBuyOffer(selling, buying, amount, price, offer_id=0, source=None)[source]
The
ManageBuyOffer
object, which represents a ManageBuyOffer operation on Stellar’s network.Creates, updates, or deletes an buy offer.
If you want to create a new offer set offer_id to
0
.If you want to update an existing offer set offer_id to existing offer ID.
If you want to delete an existing offer set offer_id to existing offer ID and set amount to
0
.Threshold: Medium
See Manage Buy Offer for more information.
- Parameters:
selling (
Asset
) – What you’re selling.buying (
Asset
) – What you’re buying.amount (
Union
[str
,Decimal
]) – Amount being bought. if set to0
, delete the offer.price (
Union
[Price
,str
,Decimal
]) – Price of thing being bought in terms of what you are selling.offer_id (
int
) – If0
, will create a new offer (default). Otherwise, edits an existing offer.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ManageBuyOffer
object from an XDR Operation object.- Return type:
ManageData
- class stellar_sdk.operation.ManageData(data_name, data_value, source=None)[source]
The
ManageData
object, which represents a ManageData operation on Stellar’s network.Allows you to set, modify or delete a Data Entry (name/value pair) that is attached to a particular account. An account can have an arbitrary amount of DataEntries attached to it. Each DataEntry increases the minimum balance needed to be held by the account.
DataEntries can be used for application specific things. They are not used by the core Stellar protocol.
Threshold: Medium
See Manage Data for more information.
- Parameters:
data_name (
str
) – If this is a new Name it will add the given name/value pair to the account. If this Name is already present then the associated value will be modified. Up to 64 bytes long.data_value (
Union
[str
,bytes
,None
]) – If not present then the existing data_name will be deleted. If present then this value will be set in the DataEntry. Up to 64 bytes long.source (
Union
[MuxedAccount
,str
,None
]) – The optional source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ManageData
object from an XDR Operation object.- Return type:
ManageSellOffer
- class stellar_sdk.operation.ManageSellOffer(selling, buying, amount, price, offer_id=0, source=None)[source]
The
ManageSellOffer
object, which represents a ManageSellOffer operation on Stellar’s network.Creates, updates, or deletes an sell offer.
If you want to create a new offer set offer_id to
0
.If you want to update an existing offer set offer_id to existing offer ID.
If you want to delete an existing offer set offer_id to existing offer ID and set amount to
0
.Threshold: Medium
See Manage Sell Offer for more information.
- Parameters:
selling (
Asset
) – What you’re selling.buying (
Asset
) – What you’re buying.amount (
Union
[str
,Decimal
]) – The total amount you’re selling. If0
, deletes the offer.price (
Union
[Price
,str
,Decimal
]) – Price of 1 unit of selling in terms of buying.offer_id (
int
) – If0
, will create a new offer (default). Otherwise, edits an existing offer.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ManageSellOffer
object from an XDR Operation object.- Return type:
PathPaymentStrictReceive
- class stellar_sdk.operation.PathPaymentStrictReceive(destination, send_asset, send_max, dest_asset, dest_amount, path, source=None)[source]
The
PathPaymentStrictReceive
object, which represents a PathPaymentStrictReceive operation on Stellar’s network.Sends an amount in a specific asset to a destination account through a path of offers. This allows the asset sent (e.g. 450 XLM) to be different from the asset received (e.g. 6 BTC).
Threshold: Medium
See Path Payment Strict Receive for more information.
- Parameters:
destination (
Union
[MuxedAccount
,str
]) – The destination account to send to.send_asset (
Asset
) – The asset to pay with.send_max (
Union
[str
,Decimal
]) – The maximum amount of send_asset to send.dest_asset (
Asset
) – The asset the destination will receive.dest_amount (
Union
[str
,Decimal
]) – The amount the destination receives.path (
Sequence
[Asset
]) – A list of Asset objects to use as the path.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
PathPaymentStrictReceive
object from an XDR Operation object.- Return type:
PathPaymentStrictSend
- class stellar_sdk.operation.PathPaymentStrictSend(destination, send_asset, send_amount, dest_asset, dest_min, path, source=None)[source]
The
PathPaymentStrictSend
object, which represents a PathPaymentStrictSend operation on Stellar’s network.Sends an amount in a specific asset to a destination account through a path of offers. This allows the asset sent (e.g, 450 XLM) to be different from the asset received (e.g, 6 BTC).
Threshold: Medium
See Path Payment Strict Send for more information.
- Parameters:
destination (
Union
[MuxedAccount
,str
]) – The destination account to send to.send_asset (
Asset
) – The asset to pay with.send_amount (
Union
[str
,Decimal
]) – Amount of send_asset to send.dest_asset (
Asset
) – The asset the destination will receive.dest_min (
Union
[str
,Decimal
]) – The minimum amount of dest_asset to be received.path (
Sequence
[Asset
]) – A list of Asset objects to use as the path.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
PathPaymentStrictSend
object from an XDR Operation object.- Return type:
Payment
- class stellar_sdk.operation.Payment(destination, asset, amount, source=None)[source]
The
Payment
object, which represents a Payment operation on Stellar’s network.Sends an amount in a specific asset to a destination account.
Threshold: Medium
See Payment for more information.
- Parameters:
SetOptions
- class stellar_sdk.operation.SetOptions(inflation_dest=None, clear_flags=None, set_flags=None, master_weight=None, low_threshold=None, med_threshold=None, high_threshold=None, signer=None, home_domain=None, source=None)[source]
The
SetOptions
object, which represents a SetOptions operation on Stellar’s network.This operation sets the options for an account.
For more information on the signing options, please refer to the multi-sig doc.
When updating signers or other thresholds, the threshold of this operation is high.
Threshold: Medium or High
See Set Options for more information.
- Parameters:
inflation_dest (
str
) – Account of the inflation destination.clear_flags (
Union
[int
,AuthorizationFlag
]) –Indicates which flags to clear. For details about the flags, please refer to the Control Access to an Asset - Flag. The bit mask integer subtracts from the existing flags of the account. This allows for setting specific bits without knowledge of existing flags, you can also use
stellar_sdk.operation.set_options.AuthorizationFlag
AUTHORIZATION_REQUIRED = 1
AUTHORIZATION_REVOCABLE = 2
AUTHORIZATION_IMMUTABLE = 4
AUTHORIZATION_CLAWBACK_ENABLED = 8
set_flags (
Union
[int
,AuthorizationFlag
]) –Indicates which flags to set. For details about the flags, please refer to the Control Access to an Asset - Flag. The bit mask integer adds onto the existing flags of the account. This allows for setting specific bits without knowledge of existing flags, you can also use
stellar_sdk.operation.set_options.AuthorizationFlag
AUTHORIZATION_REQUIRED = 1
AUTHORIZATION_REVOCABLE = 2
AUTHORIZATION_IMMUTABLE = 4
AUTHORIZATION_CLAWBACK_ENABLED = 8
master_weight (
int
) – A number from 0-255 (inclusive) representing the weight of the master key. If the weight of the master key is updated to 0, it is effectively disabled.low_threshold (
int
) – A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a low threshold.med_threshold (
int
) – A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a medium threshold.high_threshold (
int
) – A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a high threshold.home_domain (
str
) – sets the home domain used for reverse federation lookup.signer (
Signer
) – Add, update, or remove a signer from the account.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
SetOptions
object from an XDR Operation object.- Return type:
- class stellar_sdk.operation.set_options.AuthorizationFlag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Indicates which flags to set. For details about the flags, please refer to the Control Access to an Asset - Flag.
CreateClaimableBalance
- class stellar_sdk.operation.CreateClaimableBalance(asset, amount, claimants, source=None)[source]
The
CreateClaimableBalance
object, which represents a CreateClaimableBalance operation on Stellar’s network.Creates a ClaimableBalanceEntry. See Claimable Balance for more information on parameters and usage.
Threshold: Medium
See Create Claimable Balance for more information.
- Parameters:
- classmethod from_xdr_object(xdr_object)[source]
Creates a
CreateClaimableBalance
object from an XDR Operation object.- Return type:
- class stellar_sdk.operation.Claimant(destination, predicate=None)[source]
The
Claimant
object represents a claimable balance claimant.- Parameters:
destination (
str
) – The destination account ID.predicate (
ClaimPredicate
) – The claim predicate. It is optional, it defaults to unconditional if none is specified.
- class stellar_sdk.operation.ClaimPredicate(claim_predicate_type, and_predicates, or_predicates, not_predicate, abs_before, rel_before)[source]
The
ClaimPredicate
object, which represents a ClaimPredicate on Stellar’s network.We do not recommend that you build it through the constructor, please use the helper function.
- Parameters:
claim_predicate_type (
ClaimPredicateType
) – Type of ClaimPredicate.and_predicates (
Optional
[ClaimPredicateGroup
]) – The ClaimPredicates.or_predicates (
Optional
[ClaimPredicateGroup
]) – The ClaimPredicates.not_predicate (
Optional
[ClaimPredicate
]) – The ClaimPredicate.rel_before (
Optional
[int
]) – seconds since closeTime of the ledger in which the ClaimableBalanceEntry was created.
- classmethod predicate_and(left, right)[source]
Returns an and claim predicate
- Parameters:
left (
ClaimPredicate
) – a ClaimPredicate.right (
ClaimPredicate
) – a ClaimPredicate.
- Return type:
- Returns:
an and claim predicate.
- classmethod predicate_before_absolute_time(abs_before)[source]
Returns a before_absolute_time claim predicate.
This predicate will be fulfilled if the closing time of the ledger that includes the
CreateClaimableBalance
operation is less than this (absolute) Unix timestamp.- Parameters:
abs_before (
int
) – Unix epoch.- Return type:
- Returns:
a before_absolute_time claim predicate.
- classmethod predicate_before_relative_time(seconds)[source]
Returns a before_relative_time claim predicate.
This predicate will be fulfilled if the closing time of the ledger that includes the
CreateClaimableBalance
operation plus this relative time delta (in seconds) is less than the current time.- Parameters:
seconds (
int
) – seconds since closeTime of the ledger in which the ClaimableBalanceEntry was created.- Return type:
- Returns:
a before_relative_time claim predicate.
- classmethod predicate_not(predicate)[source]
Returns a not claim predicate.
- Parameters:
predicate (
ClaimPredicate
) – a ClaimPredicate.- Return type:
- Returns:
a not claim predicate.
- classmethod predicate_or(left, right)[source]
Returns an or claim predicate
- Parameters:
left (
ClaimPredicate
) – a ClaimPredicate.right (
ClaimPredicate
) – a ClaimPredicate.
- Return type:
- Returns:
an or claim predicate.
- class stellar_sdk.operation.create_claimable_balance.ClaimPredicateType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Currently supported claim predicate types.
- class stellar_sdk.operation.create_claimable_balance.ClaimPredicateGroup(left, right)[source]
Used to assemble the left and right values for and_predicates and or_predicates.
- Parameters:
left (
ClaimPredicate
) – The ClaimPredicate.right (
ClaimPredicate
) – The ClaimPredicate.
ClaimClaimableBalance
- class stellar_sdk.operation.ClaimClaimableBalance(balance_id, source=None)[source]
The
ClaimClaimableBalance
object, which represents a ClaimClaimableBalance operation on Stellar’s network.Claims a ClaimableBalanceEntry and adds the amount of asset on the entry to the source account.
Threshold: Low
See Claim Claimable Balance for more information.
- Parameters:
balance_id (
str
) – The claimable balance id to be claimed.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ClaimClaimableBalance
object from an XDR Operation object.- Return type:
BeginSponsoringFutureReserves
- class stellar_sdk.operation.BeginSponsoringFutureReserves(sponsored_id, source=None)[source]
The
BeginSponsoringFutureReserves
object, which represents a BeginSponsoringFutureReserves operation on Stellar’s network.Establishes the is-sponsoring-future-reserves-for relationship between the source account and sponsoredID. See Sponsored Reserves for more information.
Threshold: Medium
See Begin Sponsoring Future Reserves for more information.
- Parameters:
sponsored_id (
str
) – The sponsored account id.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
BeginSponsoringFutureReserves
object from an XDR Operation object.- Return type:
EndSponsoringFutureReserves
- class stellar_sdk.operation.EndSponsoringFutureReserves(source=None)[source]
The
EndSponsoringFutureReserves
object, which represents a EndSponsoringFutureReserves operation on Stellar’s network.Terminates the current is-sponsoring-future-reserves-for relationship in which the source account is sponsored. See Sponsored Reserves for more information.
Threshold: Medium
See End Sponsoring Future Reserves.
- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
EndSponsoringFutureReserves
object from an XDR Operation object.- Return type:
RevokeSponsorship
- class stellar_sdk.operation.RevokeSponsorship(revoke_sponsorship_type, account_id, trustline, offer, data, claimable_balance_id, signer, liquidity_pool_id, source=None)[source]
The
RevokeSponsorship
object, which represents a RevokeSponsorship operation on Stellar’s network.The logic of this operation depends on the state of the source account.
If the source account is not sponsored or is sponsored by the owner of the specified entry or sub-entry, then attempt to revoke the sponsorship. If the source account is sponsored, the next step depends on whether the entry is sponsored or not. If it is sponsored, attempt to transfer the sponsorship to the sponsor of the source account. If the entry is not sponsored, then establish the sponsorship. See Sponsored Reserves for more information.
Threshold: Medium
See Revoke Sponsorship for more information.
- Parameters:
revoke_sponsorship_type (
RevokeSponsorshipType
) – The sponsored account id.claimable_balance_id (
Optional
[str
]) – The sponsored claimable balance.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
RevokeSponsorship
object from an XDR Operation object.- Return type:
Clawback
- class stellar_sdk.operation.Clawback(asset, from_, amount, source=None)[source]
The
Clawback
object, which represents a Clawback operation on Stellar’s network.Claws back an amount of an asset from an account.
Threshold: Medium
See Clawback for more information.
- Parameters:
ClawbackClaimableBalance
- class stellar_sdk.operation.ClawbackClaimableBalance(balance_id, source=None)[source]
The
ClawbackClaimableBalance
object, which represents a ClawbackClaimableBalance operation on Stellar’s network.Claws back a claimable balance
Threshold: Medium
See Clawback Claimable Balance for more information.
- Parameters:
balance_id (
str
) – The claimable balance ID to be clawed back.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ClawbackClaimableBalance
object from an XDR Operation object.- Return type:
SetTrustLineFlags
- class stellar_sdk.operation.SetTrustLineFlags(trustor, asset, clear_flags=None, set_flags=None, source=None)[source]
The
SetTrustLineFlags
object, which represents a SetTrustLineFlags operation on Stellar’s network.Updates the flags of an existing trust line. This is called by the issuer of the related asset.
Threshold: Low
See Set Trustline Flags for more information.
- Parameters:
trustor (
str
) – The account whose trustline this is.asset (
Asset
) – The asset on the trustline.clear_flags (
TrustLineFlags
) – The flags to clear.set_flags (
TrustLineFlags
) – The flags to set.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
SetTrustLineFlags
object from an XDR Operation object.- Return type:
- class stellar_sdk.operation.set_trust_line_flags.TrustLineFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Indicates which flags to set. For details about the flags, please refer to the CAP-0035.
AUTHORIZED_FLAG: issuer has authorized account to perform transactions with its credit
AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG: issuer has authorized account to maintain and reduce liabilities for its credit
TRUSTLINE_CLAWBACK_ENABLED_FLAG: issuer has specified that it may clawback its credit, and that claimable balances created with its credit may also be clawed back
InvokeHostFunction
- class stellar_sdk.operation.InvokeHostFunction(host_function, auth=None, source=None)[source]
The
InvokeHostFunction
object, which represents a InvokeHostFunction operation on Stellar’s network.Threshold: Medium
See Interacting with Soroban via Stellar.
- Parameters:
host_function (
HostFunction
) – The host function to invoke.auth (
Sequence
[SorobanAuthorizationEntry
]) – The authorizations required to execute the host function.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
InvokeHostFunction
object from an XDR Operation object.- Return type:
ExtendFootprintTTL
- class stellar_sdk.operation.ExtendFootprintTTL(extend_to, source=None)[source]
The
ExtendFootprintTTL
object, which represents a ExtendFootprintTTL operation on Stellar’s network.Threshold: Medium
See ExtendFootprintTTLOp.
- Parameters:
extend_to (
int
) – The number of ledgers past the LCL (last closed ledger) by which to extend the validity of the ledger keys in this transaction.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
ExtendFootprintTTL
object from an XDR Operation object.- Return type:
RestoreFootprint
- class stellar_sdk.operation.RestoreFootprint(source=None)[source]
The
RestoreFootprint
object, which represents a RestoreFootprint operation on Stellar’s network.Threshold: Medium
See RestoreFootprintOp.
- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- classmethod from_xdr_object(xdr_object)[source]
Creates a
RestoreFootprint
object from an XDR Operation object.- Return type:
Price
- class stellar_sdk.price.Price(n, d)[source]
Create a new price. Price in Stellar is represented as a fraction.
An example:
from stellar_sdk import Price price_a = Price(1, 2) price_b = Price.from_raw_price("0.5")
Server
- class stellar_sdk.server.Server(horizon_url='https://horizon-testnet.stellar.org/', client=None)[source]
Server handles the network connection to a Horizon instance and exposes an interface for requests to that instance.
An example:
from stellar_sdk import Server server = Server("https://horizon-testnet.stellar.org") resp = server.transactions().limit(10).order(desc=True).call() print(resp)
- Parameters:
horizon_url (
str
) – Horizon Server URL (ex."https://horizon-testnet.stellar.org"
for test network,"https://horizon.stellar.org"
for public network)client (
BaseSyncClient
) – Http client used to send the request
- accounts()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.AccountsCallBuilder
object configured by a current Horizon server configuration.
- assets()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.AssetsCallBuilder
object configured by a current Horizon server configuration.
- claimable_balances()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.ClaimableBalancesCallBuilder
object configured by a current Horizon server configuration.
- data(account_id, data_name)[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.DataCallBuilder
object configured by a current Horizon server configuration.
- effects()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.EffectsCallBuilder
object configured by a current Horizon server configuration.
- fee_stats()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.FeeStatsCallBuilder
object configured by a current Horizon server configuration.
- fetch_base_fee()[source]
Fetch the base fee. Since this hits the server, if the server call fails, you might get an error. You should be prepared to use a default value if that happens.
- Return type:
- Returns:
the base fee
- Raises:
ConnectionError
NotFoundError
BadRequestError
BadResponseError
UnknownRequestError
- ledgers()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.LedgersCallBuilder
object configured by a current Horizon server configuration.
- liquidity_pools()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.LiquidityPoolsBuilder
object configured by a current Horizon server configuration.
- load_account(account_id)[source]
Fetches an account’s most current base state (like sequence) in the ledger and then creates and returns an
stellar_sdk.account.Account
object.If you want to get complete account information, please use
stellar_sdk.server.Server.accounts()
.- Parameters:
account_id (
Union
[MuxedAccount
,Keypair
,str
]) – The account to load.- Return type:
- Returns:
an
stellar_sdk.account.Account
object.- Raises:
ConnectionError
NotFoundError
BadRequestError
BadResponseError
UnknownRequestError
- offers()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.OffersCallBuilder
object configured by a current Horizon server configuration.
- operations()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.OperationsCallBuilder
object configured by a current Horizon server configuration.
- orderbook(selling, buying)[source]
- Parameters:
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.OrderbookCallBuilder
object configured by a current Horizon server configuration.
- payments()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.PaymentsCallBuilder
object configured by a current Horizon server configuration.
- root()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.RootCallBuilder
object configured by a current Horizon server configuration.
- strict_receive_paths(source, destination_asset, destination_amount)[source]
- Parameters:
source (
Union
[str
,List
[Asset
]]) – The sender’s account ID or a list of Assets. Any returned path must use a source that the sender can hold.destination_asset (
Asset
) – The destination asset.destination_amount (
Union
[str
,Decimal
]) – The amount, denominated in the destination asset, that any returned path should be able to satisfy.
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.StrictReceivePathsCallBuilder
object configured by a current Horizon server configuration.
- strict_send_paths(source_asset, source_amount, destination)[source]
- Parameters:
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.StrictReceivePathsCallBuilder
object configured by a current Horizon server configuration.
- submit_transaction(transaction_envelope, skip_memo_required_check=False)[source]
Submits a transaction to the network.
- Parameters:
transaction_envelope (
Union
[TransactionEnvelope
,FeeBumpTransactionEnvelope
,str
]) –stellar_sdk.transaction_envelope.TransactionEnvelope
object or base64 encoded xdrskip_memo_required_check (
bool
) – Allow skipping memo
- Return type:
- Returns:
the response from horizon
- Raises:
ConnectionError
NotFoundError
BadRequestError
BadResponseError
UnknownRequestError
AccountRequiresMemoError
- trade_aggregations(base, counter, resolution, start_time=None, end_time=None, offset=None)[source]
- Parameters:
base (
Asset
) – base assetcounter (
Asset
) – counter assetresolution (
int
) – segment duration as millis since epoch. Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).start_time (
int
) – lower time boundary represented as millis since epochend_time (
int
) – upper time boundary represented as millis since epochoffset (
int
) – segments can be offset using this parameter. Expressed in milliseconds. Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.TradeAggregationsCallBuilder
object configured by a current Horizon server configuration.
- trades()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.TradesCallBuilder
object configured by a current Horizon server configuration.
- transactions()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_sync.TransactionsCallBuilder
object configured by a current Horizon server configuration.
ServerAsync
- class stellar_sdk.server_async.ServerAsync(horizon_url='https://horizon-testnet.stellar.org/', client=None)[source]
ServerAsync handles the network connection to a Horizon instance and exposes an interface for requests to that instance.
An example:
import asyncio from stellar_sdk import ServerAsync async def example(): async with ServerAsync("https://horizon-testnet.stellar.org") as server: resp = await server.transactions().limit(10).order(desc=True).call() print(resp) asyncio.run(example())
- Parameters:
horizon_url (
str
) – Horizon Server URL (ex."https://horizon-testnet.stellar.org"
for test network,"https://horizon.stellar.org"
for public network)client (
BaseAsyncClient
) – Http client used to send the request
- accounts()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.AccountsCallBuilder
object configured by a current Horizon server configuration.
- assets()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.AssetsCallBuilder
object configured by a current Horizon server configuration.
- claimable_balances()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.ClaimableBalancesCallBuilder
object configured by a current Horizon server configuration.
- data(account_id, data_name)[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.DataCallBuilder
object configured by a current Horizon server configuration.
- effects()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.EffectsCallBuilder
object configured by a current Horizon server configuration.
- fee_stats()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.FeeStatsCallBuilder
object configured by a current Horizon server configuration.
- async fetch_base_fee()[source]
Fetch the base fee. Since this hits the server, if the server call fails, you might get an error. You should be prepared to use a default value if that happens.
- Return type:
- Returns:
the base fee
- Raises:
ConnectionError
NotFoundError
BadRequestError
BadResponseError
UnknownRequestError
- ledgers()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.LedgersCallBuilder
object configured by a current Horizon server configuration.
- liquidity_pools()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.LiquidityPoolsBuilder
object configured by a current Horizon server configuration.
- async load_account(account_id)[source]
Fetches an account’s most current base state (like sequence) in the ledger and then creates and returns an
stellar_sdk.account.Account
object.If you want to get complete account information, please use
stellar_sdk.server.Server.accounts()
.- Parameters:
account_id (
Union
[MuxedAccount
,Keypair
,str
]) – The account to load.- Return type:
- Returns:
an
stellar_sdk.account.Account
object.- Raises:
ConnectionError
NotFoundError
BadRequestError
BadResponseError
UnknownRequestError
- offers()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.OffersCallBuilder
object configured by a current Horizon server configuration.
- operations()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.OperationsCallBuilder
object configured by a current Horizon server configuration.
- orderbook(selling, buying)[source]
- Parameters:
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.OrderbookCallBuilder
object configured by a current Horizon server configuration.
- payments()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.PaymentsCallBuilder
object configured by a current Horizon server configuration.
- root()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.RootCallBuilder
object configured by a current Horizon server configuration.
- strict_receive_paths(source, destination_asset, destination_amount)[source]
- Parameters:
source (
Union
[str
,List
[Asset
]]) – The sender’s account ID or a list of Assets. Any returned path must use a source that the sender can hold.destination_asset (
Asset
) – The destination asset.destination_amount (
Union
[str
,Decimal
]) – The amount, denominated in the destination asset, that any returned path should be able to satisfy.
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.StrictReceivePathsCallBuilder
object configured by a current Horizon server configuration.
- strict_send_paths(source_asset, source_amount, destination)[source]
- Parameters:
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.StrictReceivePathsCallBuilder
object configured by a current Horizon server configuration.
- async submit_transaction(transaction_envelope, skip_memo_required_check=False)[source]
Submits a transaction to the network.
- Parameters:
transaction_envelope (
Union
[TransactionEnvelope
,FeeBumpTransactionEnvelope
,str
]) –stellar_sdk.transaction_envelope.TransactionEnvelope
object or base64 encoded xdrskip_memo_required_check (
bool
) – Allow skipping memo
- Return type:
- Returns:
the response from horizon
- Raises:
ConnectionError
NotFoundError
BadRequestError
BadResponseError
UnknownRequestError
AccountRequiresMemoError
- trade_aggregations(base, counter, resolution, start_time=None, end_time=None, offset=None)[source]
- Parameters:
base (
Asset
) – base assetcounter (
Asset
) – counter assetresolution (
int
) – segment duration as millis since epoch. Supported values are 1 minute (60000), 5 minutes (300000), 15 minutes (900000), 1 hour (3600000), 1 day (86400000) and 1 week (604800000).start_time (
int
) – lower time boundary represented as millis since epochend_time (
int
) – upper time boundary represented as millis since epochoffset (
int
) – segments can be offset using this parameter. Expressed in milliseconds. Can only be used if the resolution is greater than 1 hour. Value must be in whole hours, less than the provided resolution, and less than 24 hours.
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.TradeAggregationsCallBuilder
object configured by a current Horizon server configuration.
- trades()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.TradesCallBuilder
object configured by a current Horizon server configuration.
- transactions()[source]
- Return type:
- Returns:
New
stellar_sdk.call_builder.call_builder_async.TransactionsCallBuilder
object configured by a current Horizon server configuration.
Signer
- class stellar_sdk.signer.Signer(signer_key, weight)[source]
The
Signer
object, which represents an account signer on Stellar’s network.An example:
from stellar_sdk import Signer
signer_ed25519 = Signer.ed25519_public_key(“GCC3U63F5OJIG4VS6XCFUJGCQRRMNCVGASDGIZZEPA3AZ242K4JVPIYV”, 1) signer_sha256_hash = Signer.sha256_hash(“XCC3U63F5OJIG4VS6XCFUJGCQRRMNCVGASDGIZZEPA3AZ242K4JVPRP5”, 2) signer_pre_auth_tx = Signer.pre_auth_tx(“TCC3U63F5OJIG4VS6XCFUJGCQRRMNCVGASDGIZZEPA3AZ242K4JVOVKE”, 3) print(f”signer_ed25519 account id: {signer_ed25519.signer_key.encoded_signer_key}”) print(f”signer_ed25519 weight: {signer_ed25519.weight}”)
- classmethod ed25519_public_key(account_id, weight)[source]
Create ED25519 PUBLIC KEY Signer from account id.
- Parameters:
- Return type:
- Returns:
ED25519 PUBLIC KEY Signer
- Raises:
Ed25519PublicKeyInvalidError
: ifaccount_id
is not a valid ed25519 public key.
- classmethod pre_auth_tx(pre_auth_tx_hash, weight)[source]
Create Pre AUTH TX Signer from the sha256 hash of a transaction, click here for more information.
SignerKey
- class stellar_sdk.signer_key.SignerKey(signer_key, signer_key_type)[source]
The
SignerKey
object, which represents an account signer key on Stellar’s network.- Parameters:
signer_key (
bytes
) – The signer key.signer_key – The signer key type.
- classmethod ed25519_public_key(account_id)[source]
Create ED25519 PUBLIC KEY Signer from account id.
- Parameters:
- Return type:
- Returns:
ED25519 PUBLIC KEY Signer
- Raises:
Ed25519PublicKeyInvalidError
: ifaccount_id
is not a valid ed25519 public key.
- classmethod ed25519_signed_payload(ed25519_signed_payload)[source]
Create ed25519 signed payload Signer from an ed25519 signed payload, click here for more information.
- classmethod pre_auth_tx(pre_auth_tx_hash)[source]
Create Pre AUTH TX Signer from the sha256 hash of a transaction, click here for more information.
StrKey
- class stellar_sdk.strkey.StrKey[source]
StrKey is a helper class that allows encoding and decoding strkey.
- static decode_ed25519_public_key(data)[source]
Decodes encoded ed25519 public key strkey to raw data.
- Parameters:
data (
str
) – encoded ed25519 public key strkey- Return type:
- Returns:
raw bytes
- Raises:
- static decode_ed25519_secret_seed(data)[source]
Decodes encoded ed25519 secret seed strkey to raw data.
- Parameters:
data (
str
) – encoded ed25519 secret seed strkey- Return type:
- Returns:
raw bytes
- Raises:
- static decode_ed25519_signed_payload(data)[source]
Decodes encoded ed25519 signed payload strkey to raw data.
- static decode_muxed_account(data)[source]
Decodes encoded muxed account strkey to raw data.
- Parameters:
data (
str
) – encoded muxed account strkey- Return type:
- Returns:
raw bytes
- Raises:
ValueError
- static encode_ed25519_secret_seed(data)[source]
Encodes data to encoded ed25519 secret seed strkey.
- static encode_ed25519_signed_payload(data)[source]
Encodes data to encoded ed25519 signed payload strkey.
- static encode_muxed_account(data)[source]
Encodes data to encoded muxed account strkey.
- Parameters:
data (
MuxedAccount
) – data to encode- Return type:
- Returns:
encoded muxed account strkey
- Raises:
ValueError
- static is_valid_contract(contract)[source]
Returns
True
if the given contract is a valid encoded contract strkey.- Parameters:
pre_auth_tx – encoded contract strkey
- Return type:
- Returns:
True
if the given key is valid
- static is_valid_ed25519_public_key(public_key)[source]
Returns
True
if the given seed is a valid ed25519 public key strkey.
- static is_valid_ed25519_secret_seed(seed)[source]
Returns
True
if the given seed is a valid ed25519 secret seed strkey.
- static is_valid_ed25519_signed_payload(ed25519_signed_payload)[source]
Returns
True
if the given ed25519_signed_payload is a valid encoded ed25519 signed payload strkey.
TimeBounds
- class stellar_sdk.time_bounds.TimeBounds(min_time, max_time)[source]
TimeBounds represents the time interval that a transaction is valid.
The UNIX timestamp (in seconds), determined by ledger time, of a lower and upper bound of when this transaction will be valid. If a transaction is submitted too early or too late, it will fail to make it into the transaction set. max_time equal
0
means that it’s not set.See Stellar’s documentation on Transactions for more information on how TimeBounds are used within transactions.
- Parameters:
- Raises:
ValueError
: if max_time less than min_time.
- classmethod from_xdr_object(xdr_object)[source]
Create a
TimeBounds
from an XDR TimeBounds object.- Parameters:
xdr_object (
TimeBounds
) – The XDR TimeBounds object.- Return type:
- Returns:
A new
TimeBounds
object from the given XDR TimeBounds object.
DecoratedSignature
- class stellar_sdk.decorated_signature.DecoratedSignature(signature_hint, signature)[source]
- classmethod from_xdr_object(xdr_object)[source]
Create a
DecoratedSignature
from an XDR DecoratedSignature object.- Parameters:
xdr_object (
DecoratedSignature
) – The XDR DecoratedSignature object.- Return type:
- Returns:
A new
DecoratedSignature
object from the given XDR DecoratedSignature object.
Transaction
- class stellar_sdk.transaction.Transaction(source, sequence, fee, operations, memo=None, preconditions=None, soroban_data=None, v1=True)[source]
The
Transaction
object, which represents a transaction(Transaction or TransactionV0) on Stellar’s network.A transaction contains a list of operations, which are all executed in order as one ACID transaction, along with an associated source account, fee, account sequence number, list of signatures, both an optional memo and an optional TimeBounds. Typically a
Transaction
is placed in aTransactionEnvelope
which is then signed before being sent over the network.For more information on Transactions in Stellar, see Stellar’s guide on transactions.
- Parameters:
source (
Union
[MuxedAccount
,Keypair
,str
]) – the source account for the transaction.sequence (
int
) – The sequence number for the transaction.fee (
int
) – The max fee amount for the transaction, which should equal FEE (currently least 100 stroops) multiplied by the number of operations in the transaction. See Stellar’s latest documentation on fees for more information.operations (
Sequence
[Operation
]) – A list of operations objects (typically its subclasses as defined instellar_sdk.operation.Operation
.preconditions (
Preconditions
) – The preconditions for the validity of this transaction.memo (
Memo
) – The memo being sent with the transaction, being represented as one of the subclasses of theMemo
object.soroban_data (
SorobanTransactionData
) – The soroban data being sent with the transaction, being represented asSorobanTransactionData
.v1 (
bool
) – When this value is set toTrue
, V1 transactions will be generated, otherwise V0 transactions will be generated. See CAP-0015 for more information.
- classmethod from_xdr(xdr, v1=True)[source]
Create a new
Transaction
from an XDR string.- Parameters:
- Return type:
- Returns:
A new
Transaction
object from the given XDR Transaction base64 string object.
- classmethod from_xdr_object(xdr_object, v1=True)[source]
Create a new
Transaction
from an XDR object.- Parameters:
xdr_object (
Union
[Transaction
,TransactionV0
]) – The XDR object that represents a transaction.v1 (
bool
) –Temporary feature flag to allow alpha testing of Stellar Protocol 13 transactions. We will remove this once all transactions are supposed to be v1. See CAP-0015 for more information.
- Return type:
- Returns:
A new
Transaction
object from the given XDR Transaction object.
- get_claimable_balance_id(operation_index)[source]
Calculate the claimable balance ID for an operation within the transaction.
- Parameters:
operation_index (
int
) – the index of the CreateClaimableBalance operation.- Return type:
- Returns:
a hex string representing the claimable balance ID.
- Raises:
IndexError
: if operation_index is invalid.TypeError
: if operation at operation_index is notFeeBumpTransactionEnvelope
.
- to_xdr_object()[source]
Get an XDR object representation of this
Transaction
.- Return type:
- Returns:
XDR Transaction object
TransactionEnvelope
- class stellar_sdk.transaction_envelope.TransactionEnvelope(transaction, network_passphrase, signatures=None)[source]
The
TransactionEnvelope
object, which represents a transaction envelope ready to sign and submit to send over the network.When a transaction is ready to be prepared for sending over the network, it must be put into a
TransactionEnvelope
, which includes additional metadata such as the signers for a given transaction. Ultimately, this class handles signing and conversion to and from XDR for usage on Stellar’s network.- Parameters:
transaction (
Transaction
) – The transaction that is encapsulated in this envelope.signatures (list) – which contains a list of signatures that have already been created.
network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from.
- classmethod from_xdr(xdr, network_passphrase)
Create a new
BaseTransactionEnvelope
from an XDR string.
- classmethod from_xdr_object(xdr_object, network_passphrase)[source]
Create a new
TransactionEnvelope
from an XDR object.- Parameters:
xdr_object (
TransactionEnvelope
) – The XDR object that represents a transaction envelope.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from.
- Return type:
- Returns:
A new
TransactionEnvelope
object from the given XDR TransactionEnvelope object.
- hash()
Get the XDR Hash of the signature base.
This hash is ultimately what is signed before transactions are sent over the network. See
signature_base()
for more details about this process.- Return type:
- Returns:
The XDR Hash of this transaction envelope’s signature base.
- hash_hex()
Return a hex encoded hash for this transaction envelope.
- Return type:
- Returns:
A hex encoded hash for this transaction envelope.
- sign(signer)
Sign this transaction envelope with a given keypair.
Note that the signature must not already be in this instance’s list of signatures.
- sign_extra_signers_payload(signer)[source]
Sign this extra signers’ payload with a given keypair.
Note that the signature must not already be in this instance’s list of signatures.
- sign_hashx(preimage)
Sign this transaction envelope with a Hash(x) signature.
See Stellar’s documentation on Multi-Sig for more details on Hash(x) signatures.
- signature_base()[source]
Get the signature base of this transaction envelope.
Return the “signature base” of this transaction, which is the value that, when hashed, should be signed to create a signature that validators on the Stellar Network will accept.
It is composed of a 4 prefix bytes followed by the xdr-encoded form of this transaction.
- Return type:
- Returns:
The signature base of this transaction envelope.
- to_transaction_envelope_v1()[source]
Create a new
TransactionEnvelope
, if the internal tx is not v1, we will convert it to v1.- Return type:
- to_xdr()
Get the base64 encoded XDR string representing this
BaseTransactionEnvelope
.- Return type:
- Returns:
XDR TransactionEnvelope base64 string object
- to_xdr_object()[source]
Get an XDR object representation of this
TransactionEnvelope
.- Return type:
- Returns:
XDR TransactionEnvelope object
FeeBumpTransaction
- class stellar_sdk.fee_bump_transaction.FeeBumpTransaction(fee_source, base_fee, inner_transaction_envelope)[source]
The
FeeBumpTransaction
object, which represents a fee bump transaction on Stellar’s network.See Fee-Bump Transactions for more information. See CAP-0015 for more information.
- Parameters:
fee_source (
Union
[MuxedAccount
,Keypair
,str
]) – The account paying for the transaction.base_fee (
int
) – The max fee willing to pay per operation in inner transaction (in stroops).inner_transaction_envelope (
TransactionEnvelope
) – The TransactionEnvelope to be bumped by the fee bump transaction.
- classmethod from_xdr(xdr, network_passphrase)[source]
Create a new
FeeBumpTransaction
from an XDR string.- Parameters:
- Return type:
- Returns:
A new
FeeBumpTransaction
object from the given XDR FeeBumpTransaction base64 string object.
- classmethod from_xdr_object(xdr_object, network_passphrase)[source]
Create a new
FeeBumpTransaction
from an XDR object.- Parameters:
xdr_object (
FeeBumpTransaction
) – The XDR object that represents a fee bump transaction.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from.
- Return type:
- Returns:
A new
FeeBumpTransaction
object from the given XDR Transaction object.
- to_xdr_object()[source]
Get an XDR object representation of this
FeeBumpTransaction
.- Return type:
- Returns:
XDR Transaction object
FeeBumpTransactionEnvelope
- class stellar_sdk.fee_bump_transaction_envelope.FeeBumpTransactionEnvelope(transaction, network_passphrase, signatures=None)[source]
The
FeeBumpTransactionEnvelope
object, which represents a fee bump transaction envelope ready to sign and submit to send over the network.When a fee bump transaction is ready to be prepared for sending over the network, it must be put into a
FeeBumpTransactionEnvelope
, which includes additional metadata such as the signers for a given transaction. Ultimately, this class handles signing and conversion to and from XDR for usage on Stellar’s network.See Fee-Bump Transactions for more information. See CAP-0015 for more information.
- Parameters:
transaction (
FeeBumpTransaction
) – The fee bump transaction that is encapsulated in this envelope.signatures (
Sequence
[DecoratedSignature
]) – which contains a list of signatures that have already been created.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from.
- classmethod from_xdr(xdr, network_passphrase)
Create a new
BaseTransactionEnvelope
from an XDR string.
- classmethod from_xdr_object(xdr_object, network_passphrase)[source]
Create a new
FeeBumpTransactionEnvelope
from an XDR object.- Parameters:
xdr_object (
TransactionEnvelope
) – The XDR object that represents a fee bump transaction envelope.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from.
- Return type:
- Returns:
A new
FeeBumpTransactionEnvelope
object from the given XDR TransactionEnvelope object.
- hash()
Get the XDR Hash of the signature base.
This hash is ultimately what is signed before transactions are sent over the network. See
signature_base()
for more details about this process.- Return type:
- Returns:
The XDR Hash of this transaction envelope’s signature base.
- hash_hex()
Return a hex encoded hash for this transaction envelope.
- Return type:
- Returns:
A hex encoded hash for this transaction envelope.
- sign(signer)
Sign this transaction envelope with a given keypair.
Note that the signature must not already be in this instance’s list of signatures.
- sign_hashx(preimage)
Sign this transaction envelope with a Hash(x) signature.
See Stellar’s documentation on Multi-Sig for more details on Hash(x) signatures.
- signature_base()[source]
Get the signature base of this transaction envelope.
Return the “signature base” of this transaction, which is the value that, when hashed, should be signed to create a signature that validators on the Stellar Network will accept.
It is composed of a 4 prefix bytes followed by the xdr-encoded form of this transaction.
- Return type:
- Returns:
The signature base of this transaction envelope.
- to_xdr()
Get the base64 encoded XDR string representing this
BaseTransactionEnvelope
.- Return type:
- Returns:
XDR TransactionEnvelope base64 string object
TransactionBuilder
- class stellar_sdk.transaction_builder.TransactionBuilder(source_account, network_passphrase='Test SDF Network ; September 2015', base_fee=100, v1=True)[source]
Transaction builder helps constructs a new
TransactionEnvelope
using the givenAccount
as the transaction’s “source account”. The transaction will use the current sequence number of the given account as its sequence number and increment the given account’s sequence number by one.Operations can be added to the transaction via their corresponding builder methods, and each returns the
TransactionEnvelope
object, so they can be chained together. After adding the desired operations, call thebuild()
method on the TransactionBuilder to return a fully constructedTransactionEnvelope
that can be signed.Be careful about unsubmitted transactions! When you build a transaction, stellar-sdk automatically increments the source account’s sequence number. If you end up not submitting this transaction and submitting another one instead, it’ll fail due to the sequence number being wrong. So if you decide not to use a built transaction, make sure to update the source account’s sequence number with
stellar_sdk.server.Server.load_account()
orstellar_sdk.server_async.ServerAsync.load_account()
before creating another transaction.The following code example creates a new transaction with
CreateAccount
andPayment
operations. The Transaction’s source account(alice) first funds bob, then sends a payment to bob. The built transaction is then signed by alice_keypair:# Alice funds Bob with 5 XLM and then pays Bob 10.25 XLM from stellar_sdk import Server, Asset, Keypair, TransactionBuilder, Network alice_keypair = Keypair.from_secret("SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD") bob_address = "GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2SGZVOOPVH" server = Server("https://horizon-testnet.stellar.org") alice_account = server.load_account(alice_keypair.public_key) network_passphrase = Network.TESTNET_NETWORK_PASSPHRASE base_fee = 100 transaction = ( TransactionBuilder( source_account=alice_account, network_passphrase=network_passphrase, base_fee=base_fee, ) .add_text_memo("Hello, Stellar!") .append_create_account_op(bob_address, "5") .append_payment_op(bob_address, Asset.native(), "10.25") .set_timeout(30) .build() ) transaction.sign(alice_keypair) response = server.submit_transaction(transaction) print(response)
- Parameters:
source_account (
Account
) – The source account for this transaction.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. Defaults toTest SDF Network ; September 2015
.base_fee (
int
) – Max fee you’re willing to pay per operation in this transaction (in stroops).v1 (
bool
) –When this value is set to True, V1 transactions will be generated, otherwise V0 transactions will be generated. See CAP-0015 for more information.
- add_extra_signer(signer_key)[source]
For the transaction to be valid, there must be a signature corresponding to every Signer in this array, even if the signature is not otherwise required by the source account or operations. Internally this will set the
SignerKey
precondition.
- add_hash_memo(memo_hash)[source]
Set the memo for the transaction to a new
HashMemo
.- Parameters:
memo_hash (
Union
[bytes
,str
]) – A 32 byte hash or hex encoded string to use as the memo.- Return type:
- Returns:
This builder instance.
- Raises:
MemoInvalidException
: if memo_hash is not a valid hash memo.
- add_id_memo(memo_id)[source]
Set the memo for the transaction to a new
IdMemo
.- Parameters:
memo_id (
int
) – A 64 bit unsigned integer to set as the memo.- Return type:
- Returns:
This builder instance.
- Raises:
MemoInvalidException
: if memo_id is not a valid id memo.
- add_memo(memo)[source]
Set the memo for the transaction build by this
Builder
.- Parameters:
memo (
Memo
) – A memo to add to this transaction.- Return type:
- Returns:
This builder instance.
- add_return_hash_memo(memo_return)[source]
Set the memo for the transaction to a new
RetHashMemo
.- Parameters:
memo_return (
Union
[bytes
,str
]) – A 32 byte hash or hex encoded string intended to be interpreted as the hash of the transaction the sender is refunding.- Return type:
- Returns:
This builder instance.
- Raises:
MemoInvalidException
: if memo_return is not a valid return hash memo.
- add_text_memo(memo_text)[source]
Set the memo for the transaction to a new
TextMemo
.- Parameters:
memo_text (
Union
[str
,bytes
]) – The text for the memo to add.- Return type:
- Returns:
This builder instance.
- Raises:
MemoInvalidException
: if memo_text is not a valid text memo.
- add_time_bounds(min_time, max_time)[source]
Sets a timeout precondition on the transaction.
Because of the distributed nature of the Stellar network it is possible that the status of your transaction will be determined after a long time if the network is highly congested. If you want to be sure to receive the status of the transaction within a given period you should set the
TimeBounds
with max_time on the transaction (this is whatset_timeout()
does internally).Please note that Horizon may still return 504 Gateway Timeout error, even for short timeouts. In such case you need to resubmit the same transaction again without making any changes to receive a status. This method is using the machine system time (UTC), make sure it is set correctly.
Add a UNIX timestamp, determined by ledger time, of a lower and upper bound of when this transaction will be valid. If a transaction is submitted too early or too late, it will fail to make it into the transaction set. max_time equal
0
means that it’s not set.- Parameters:
- Return type:
- Returns:
This builder instance.
- append_account_merge_op(destination, source=None)[source]
Append a
AccountMerge
operation to the list of operations.- Parameters:
destination (
Union
[MuxedAccount
,str
]) – The ID of the offer. 0 for new offer. Set to existing offer ID to update or delete.source (
Union
[MuxedAccount
,str
,None
]) – The source address that is being merged into the destination account.
- Return type:
- Returns:
This builder instance.
- append_allow_trust_op(trustor, asset_code, authorize, source=None)[source]
Append an
AllowTrust
operation to the list of operations.- Parameters:
trustor (
str
) – The account of the recipient of the trustline.asset_code (
str
) – The asset of the trustline the source account is authorizing. For example, if an anchor wants to allow another account to hold its USD credit, the type is USD:anchor.authorize (
Union
[TrustLineEntryFlag
,bool
]) – True to authorize the line, False to deauthorize,if you need further control, you can also usestellar_sdk.operation.allow_trust.TrustLineEntryFlag
.source (
Union
[MuxedAccount
,str
,None
]) – The source address that is establishing the trust in the allow trust operation.
- Return type:
- Returns:
This builder instance.
- append_begin_sponsoring_future_reserves_op(sponsored_id, source=None)[source]
Append a
BeginSponsoringFutureReserves
operation to the list of operations.- Parameters:
sponsored_id (
str
) – The sponsored account id.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_bump_sequence_op(bump_to, source=None)[source]
Append a
BumpSequence
operation to the list of operations.- Parameters:
bump_to (
int
) – Sequence number to bump to.source (
Union
[MuxedAccount
,str
,None
]) – The source address that is running the inflation operation.
- Return type:
- Returns:
This builder instance.
- append_change_trust_op(asset, limit=None, source=None)[source]
Append a
ChangeTrust
operation to the list of operations.- Parameters:
asset (
Union
[Asset
,LiquidityPoolAsset
]) – The asset for the trust line.limit (
Union
[str
,Decimal
]) – The limit for the asset, defaults to max int64(922337203685.4775807
). If the limit is set to"0"
it deletes the trustline.source (
Union
[MuxedAccount
,str
,None
]) – The source address to add the trustline to.
- Return type:
- Returns:
This builder instance.
- append_claim_claimable_balance_op(balance_id, source=None)[source]
Append a
ClaimClaimableBalance
operation to the list of operations.- Parameters:
balance_id (
str
) – The claimable balance id to be claimed.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- append_clawback_claimable_balance_op(balance_id, source=None)[source]
Append an
ClawbackClaimableBalance
operation to the list of operations.- Parameters:
balance_id (
str
) – The claimable balance ID to be clawed back.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_clawback_op(asset, from_, amount, source=None)[source]
Append an
Clawback
operation to the list of operations.- Parameters:
- Return type:
- append_create_account_op(destination, starting_balance, source=None)[source]
Append a
CreateAccount
operation to the list of operations.- Parameters:
destination (
str
) – Account address that is created and funded.starting_balance (
Union
[str
,Decimal
]) – Amount of XLM to send to the newly created account. This XLM comes from the source account.source (
Union
[MuxedAccount
,str
,None
]) – The source address to deduct funds from to fund the new account.
- Return type:
- Returns:
This builder instance.
- append_create_claimable_balance_op(asset, amount, claimants, source=None)[source]
Append a
CreateClaimableBalance
operation to the list of operations.- Parameters:
- Return type:
- append_create_contract_op(wasm_id, address, salt=None, auth=None, source=None)[source]
Append an
InvokeHostFunction
operation to the list of operations.You can use this method to create a contract.
- Parameters:
wasm_id (
Union
[bytes
,str
]) – The ID of the contract code to install.address (
Union
[str
,Address
]) – The address using to derive the contract ID.salt (
Optional
[bytes
]) – The 32-byte salt to use to derive the contract ID.auth (
Sequence
[SorobanAuthorizationEntry
]) – The authorizations required to execute the host function.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_create_passive_sell_offer_op(selling, buying, amount, price, source=None)[source]
Append a
CreatePassiveSellOffer
operation to the list of operations.- Parameters:
selling (
Asset
) – What you’re selling.buying (
Asset
) – What you’re buying.amount (
Union
[str
,Decimal
]) – The total amount you’re selling.price (
Union
[Price
,str
,Decimal
]) – Price of 1 unit of selling in terms of buying.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_create_stellar_asset_contract_from_address_op(address, salt=None, auth=None, source=None)[source]
Append an
InvokeHostFunction
operation to the list of operations.You can use this method to create a new Soroban token contract.
I do not recommend using this method, please check the documentation for more information.
- Parameters:
address (
Union
[str
,Address
]) – The address using to derive the contract ID.salt (
Optional
[bytes
]) – The 32-byte salt to use to derive the contract ID.auth (
Sequence
[SorobanAuthorizationEntry
]) – The authorizations required to execute the host function.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_create_stellar_asset_contract_from_asset_op(asset, source=None)[source]
Append an
InvokeHostFunction
operation to the list of operations.You can use this method to deploy a contract that wraps a classic asset.
- Parameters:
asset (
Asset
) – The asset to wrap.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_ed25519_public_key_signer(account_id, weight, source=None)[source]
Add a ed25519 public key signer to an account via a
SetOptions <stellar_sdk.operation.SetOptions
operation. This is a helper function forappend_set_options_op()
.- Parameters:
- Return type:
- Returns:
This builder instance.
- append_end_sponsoring_future_reserves_op(source=None)[source]
Append a
EndSponsoringFutureReserves
operation to the list of operations.- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.- Return type:
- Returns:
This builder instance.
- append_extend_footprint_ttl_op(extend_to, source=None)[source]
Append an
ExtendFootprintTTL
operation to the list of operations.- Parameters:
extend_to (
int
) – The number of ledgers past the LCL (last closed ledger) by which to extend the validity of the ledger keys in this transaction.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_hashx_signer(sha256_hash, weight, source=None)[source]
Add a sha256 hash(HashX) signer to an account via a
SetOptions <stellar_sdk.operation.SetOptions
operation. This is a helper function forappend_set_options_op()
.- Parameters:
sha256_hash (
Union
[bytes
,str
]) – The address of the new sha256 hash(hashX) signer, a 32 byte hash, hex encoded string or encode strkey. (ex."XDNA2V62PVEFBZ74CDJKTUHLY4Y7PL5UAV2MAM4VWF6USFE3SH235FXL"
,"da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be"
or bytes)weight (
int
) – The weight of the new signer.source (
Union
[MuxedAccount
,str
,None
]) – The source account that is adding a signer to its list of signers.
- Return type:
- Returns:
This builder instance.
- append_inflation_op(source=None)[source]
Append a
Inflation
operation to the list of operations.- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source address that is running the inflation operation.- Return type:
- Returns:
This builder instance.
- append_invoke_contract_function_op(contract_id, function_name, parameters=None, auth=None, source=None)[source]
Append an
InvokeHostFunction
operation to the list of operations.You can use this method to invoke a contract function.
- Parameters:
contract_id (
str
) – The ID of the contract to invoke.function_name (
str
) – The name of the function to invoke.parameters (
Sequence
[SCVal
]) – The parameters to pass to the method.auth (
Sequence
[SorobanAuthorizationEntry
]) – The authorizations required to execute the host function.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_liquidity_pool_deposit_op(liquidity_pool_id, max_amount_a, max_amount_b, min_price, max_price, source=None)[source]
Append an
LiquidityPoolDeposit
operation to the list of operations.- Parameters:
liquidity_pool_id (
str
) – The liquidity pool ID.max_amount_a (
Union
[str
,Decimal
]) – Maximum amount of first asset to deposit.max_amount_b (
Union
[str
,Decimal
]) – Maximum amount of second asset to deposit.min_price (
Union
[str
,Decimal
,Price
]) – Minimum deposit_a/deposit_b price.max_price (
Union
[str
,Decimal
,Price
]) – Maximum deposit_a/deposit_b price.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_liquidity_pool_withdraw_op(liquidity_pool_id, amount, min_amount_a, min_amount_b, source=None)[source]
Append an
LiquidityPoolWithdraw
operation to the list of operations.- Parameters:
liquidity_pool_id (
str
) – The liquidity pool ID.amount (
Union
[str
,Decimal
]) – Amount of pool shares to withdraw.min_amount_a (
Union
[str
,Decimal
]) – Minimum amount of first asset to withdraw.min_amount_b (
Union
[str
,Decimal
]) – Minimum amount of second asset to withdraw.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_manage_buy_offer_op(selling, buying, amount, price, offer_id=0, source=None)[source]
Append a
ManageBuyOffer
operation to the list of operations.- Parameters:
selling (
Asset
) – What you’re selling.buying (
Asset
) – What you’re buying.amount (
Union
[str
,Decimal
]) – Amount being bought. if set to0
, delete the offer.price (
Union
[Price
,str
,Decimal
]) – Price of thing being bought in terms of what you are selling.offer_id (
int
) – If0
, will create a new offer (default). Otherwise, edits an existing offer.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_manage_data_op(data_name, data_value, source=None)[source]
Append a
ManageData
operation to the list of operations.- Parameters:
data_name (
str
) – If this is a new Name it will add the given name/value pair to the account. If this Name is already present then the associated value will be modified. Up to 64 bytes long.data_value (
Union
[str
,bytes
,None
]) – If not present then the existing data_name will be deleted. If present then this value will be set in the DataEntry. Up to 64 bytes long.source (
Union
[MuxedAccount
,str
,None
]) – The source account on which data is being managed. operation.
- Return type:
- Returns:
This builder instance.
- append_manage_sell_offer_op(selling, buying, amount, price, offer_id=0, source=None)[source]
Append a
ManageSellOffer
operation to the list of operations.- Parameters:
selling (
Asset
) – What you’re selling.buying (
Asset
) – What you’re buying.amount (
Union
[str
,Decimal
]) – The total amount you’re selling. If0
, deletes the offer.price (
Union
[Price
,str
,Decimal
]) – Price of 1 unit of selling in terms of buying.offer_id (
int
) – If0
, will create a new offer (default). Otherwise, edits an existing offer.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_operation(operation)[source]
Add an operation to the builder instance
- Parameters:
operation (
Operation
) – an operation- Return type:
- Returns:
This builder instance.
- append_path_payment_strict_receive_op(destination, send_asset, send_max, dest_asset, dest_amount, path, source=None)[source]
Append a
PathPaymentStrictReceive
operation to the list of operations.- Parameters:
destination (
Union
[MuxedAccount
,str
]) – The destination account to send to.send_asset (
Asset
) – The asset to pay with.send_max (
Union
[str
,Decimal
]) – The maximum amount of send_asset to send.dest_asset (
Asset
) – The asset the destination will receive.dest_amount (
Union
[str
,Decimal
]) – The amount the destination receives.path (
Sequence
[Asset
]) – A list of Asset objects to use as the path.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_path_payment_strict_send_op(destination, send_asset, send_amount, dest_asset, dest_min, path, source=None)[source]
Append a
PathPaymentStrictSend
operation to the list of operations.- Parameters:
destination (
Union
[MuxedAccount
,str
]) – The destination account to send to.send_asset (
Asset
) – The asset to pay with.send_amount (
Union
[str
,Decimal
]) – Amount of send_asset to send.dest_asset (
Asset
) – The asset the destination will receive.dest_min (
Union
[str
,Decimal
]) – The minimum amount of dest_asset to be received.path (
Sequence
[Asset
]) – A list of Asset objects to use as the path.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_payment_op(destination, asset, amount, source=None)[source]
Append a
Payment
operation to the list of operations.- Parameters:
- Return type:
- Returns:
This builder instance.
- append_pre_auth_tx_signer(pre_auth_tx_hash, weight, source=None)[source]
Add a PreAuthTx signer to an account via a
SetOptions <stellar_sdk.operation.SetOptions
operation. This is a helper function forappend_set_options_op()
.- Parameters:
pre_auth_tx_hash (
Union
[str
,bytes
]) – The address of the new preAuthTx signer - obtained by calling hash on theTransactionEnvelope
, a 32 byte hash, hex encoded string or encode strkey. (ex."TDNA2V62PVEFBZ74CDJKTUHLY4Y7PL5UAV2MAM4VWF6USFE3SH234BSS"
,"da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be"
or bytes)weight (
int
) – The weight of the new signer.source – The source account that is adding a signer to its list of signers.
- Return type:
- Returns:
This builder instance.
- append_restore_footprint_op(source=None)[source]
Append an
RestoreFootprint
operation to the list of operations.- Parameters:
source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.- Returns:
This builder instance.
- append_revoke_account_sponsorship_op(account_id, source=None)[source]
Append a
RevokeSponsorship
operation for an account to the list of operations.- Parameters:
account_id (
str
) – The sponsored account ID.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_revoke_claimable_balance_sponsorship_op(claimable_balance_id, source=None)[source]
Append a
RevokeSponsorship
operation for a claimable to the list of operations.- Parameters:
claimable_balance_id (
str
) – The sponsored claimable balance ID.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_revoke_data_sponsorship_op(account_id, data_name, source=None)[source]
Append a
RevokeSponsorship
operation for a data entry to the list of operations.- Parameters:
- Return type:
- Returns:
This builder instance.
- append_revoke_ed25519_public_key_signer_sponsorship_op(account_id, signer_key, source=None)[source]
Append a
RevokeSponsorship
operation for an ed25519_public_key signer to the list of operations.- Parameters:
account_id (
str
) – The account ID where the signer sponsorship is being removed from.signer_key (
str
) – The account id of the ed25519_public_key signer. (ex."GDNA2V62PVEFBZ74CDJKTUHLY4Y7PL5UAV2MAM4VWF6USFE3SH2354AD"
)source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_revoke_hashx_signer_sponsorship_op(account_id, signer_key, source=None)[source]
Append a
RevokeSponsorship
operation for a hashx signer to the list of operations.- Parameters:
account_id (
str
) – The account ID where the signer sponsorship is being removed from.signer_key (
Union
[bytes
,str
]) – The account id of the hashx signer. (ex."XDNA2V62PVEFBZ74CDJKTUHLY4Y7PL5UAV2MAM4VWF6USFE3SH235FXL"
,"da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be"
or bytes)source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_revoke_liquidity_pool_sponsorship_op(liquidity_pool_id, source=None)[source]
Append a
RevokeSponsorship
operation for a claimable to the list of operations.- Parameters:
liquidity_pool_id (
str
) – The sponsored liquidity pool ID in hex string.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_revoke_offer_sponsorship_op(seller_id, offer_id, source=None)[source]
Append a
RevokeSponsorship
operation for an offer to the list of operations.- Parameters:
- Return type:
- Returns:
This builder instance.
- append_revoke_pre_auth_tx_signer_sponsorship_op(account_id, signer_key, source=None)[source]
Append a
RevokeSponsorship
operation for a pre_auth_tx signer to the list of operations.- Parameters:
account_id (
str
) – The account ID where the signer sponsorship is being removed from.signer_key (
Union
[bytes
,str
]) – The account id of the pre_auth_tx signer. (ex."TDNA2V62PVEFBZ74CDJKTUHLY4Y7PL5UAV2MAM4VWF6USFE3SH234BSS"
,"da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be"
or bytes)source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_revoke_trustline_sponsorship_op(account_id, asset, source=None)[source]
Append a
RevokeSponsorship
operation for a trustline to the list of operations.- Parameters:
account_id (
str
) – The account ID which owns the trustline.asset (
Union
[Asset
,LiquidityPoolId
]) – The asset in the trustline.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_set_options_op(inflation_dest=None, clear_flags=None, set_flags=None, master_weight=None, low_threshold=None, med_threshold=None, high_threshold=None, home_domain=None, signer=None, source=None)[source]
Append a
SetOptions
operation to the list of operations.- Parameters:
inflation_dest (
str
) – Account of the inflation destination.clear_flags (
Union
[int
,AuthorizationFlag
]) –Indicates which flags to clear. For details about the flags, please refer to the Control Access to an Asset - Flag. The bit mask integer subtracts from the existing flags of the account. This allows for setting specific bits without knowledge of existing flags, you can also use
stellar_sdk.operation.set_options.AuthorizationFlag
AUTHORIZATION_REQUIRED = 1
AUTHORIZATION_REVOCABLE = 2
AUTHORIZATION_IMMUTABLE = 4
AUTHORIZATION_CLAWBACK_ENABLED = 8
set_flags (
Union
[int
,AuthorizationFlag
]) –Indicates which flags to set. For details about the flags, please refer to the Control Access to an Asset - Flag. The bit mask integer adds onto the existing flags of the account. This allows for setting specific bits without knowledge of existing flags, you can also use
stellar_sdk.operation.set_options.AuthorizationFlag
AUTHORIZATION_REQUIRED = 1
AUTHORIZATION_REVOCABLE = 2
AUTHORIZATION_IMMUTABLE = 4
AUTHORIZATION_CLAWBACK_ENABLED = 8
master_weight (
int
) – A number from 0-255 (inclusive) representing the weight of the master key. If the weight of the master key is updated to 0, it is effectively disabled.low_threshold (
int
) –A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a low threshold.
med_threshold (
int
) –A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a medium threshold.
high_threshold (
int
) –A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a high threshold.
home_domain (
str
) –sets the home domain used for reverse federation lookup.
signer (
Signer
) – Add, update, or remove a signer from the account.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_set_trust_line_flags_op(trustor, asset, clear_flags=None, set_flags=None, source=None)[source]
Append an
SetTrustLineFlags
operation to the list of operations.- Parameters:
trustor (
str
) – The account whose trustline this is.asset (
Asset
) – The asset on the trustline.clear_flags (
TrustLineFlags
) – The flags to clear.set_flags (
TrustLineFlags
) – The flags to set.source (
Union
[MuxedAccount
,str
,None
]) – The source account for the operation. Defaults to the transaction’s source account.
- Return type:
- Returns:
This builder instance.
- append_upload_contract_wasm_op(contract, source=None)[source]
Append an
InvokeHostFunction
operation to the list of operations.You can use this method to install a contract code, and then use
append_create_contract_op()
to create a contract.- Parameters:
- Return type:
- Returns:
This builder instance.
- build()[source]
This will build the transaction envelope. It will also increment the source account’s sequence number by 1.
- Return type:
- Returns:
New transaction envelope.
- static build_fee_bump_transaction(fee_source, base_fee, inner_transaction_envelope, network_passphrase='Test SDF Network ; September 2015')[source]
Create a
FeeBumpTransactionEnvelope
object.See CAP-0015 for more information.
- Parameters:
fee_source (
Union
[MuxedAccount
,Keypair
,str
]) – The account paying for the transaction.base_fee (
int
) – The max fee willing to pay per operation in inner transaction (in stroops).inner_transaction_envelope (
TransactionEnvelope
) – The TransactionEnvelope to be bumped by the fee bump transaction.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from.
- Return type:
- Returns:
a
TransactionBuilder
via the XDR object.
- static from_xdr(xdr, network_passphrase)[source]
Create a
TransactionBuilder
orFeeBumpTransactionEnvelope
via an XDR object.Warning
I don’t recommend you to use this function, because it loses its signature when constructing TransactionBuilder. Please use
stellar_sdk.helpers.parse_transaction_envelope_from_xdr()
instead.In addition, if xdr is not of
TransactionEnvelope
, it sets the fields of this builder (the transaction envelope, transaction, operations, source, etc.) to all of the fields in the provided XDR transaction envelope, but the signature will not be added to it.- Parameters:
- Return type:
- Returns:
a
TransactionBuilder
orFeeBumpTransactionEnvelope
via the XDR object.
- set_ledger_bounds(min_ledger, max_ledger)[source]
If you want to prepare a transaction which will only be valid within some range of ledgers, you can set a ledger_bounds precondition. Internally this will set the
LedgerBounds
preconditions.- Parameters:
min_ledger (
int
) – The minimum ledger this transaction is valid at, or after. Cannot be negative. If the value is0
, the transaction is valid immediately.max_ledger (
int
) – The maximum ledger this transaction is valid before. Cannot be negative. If the value is0
, the transaction is valid indefinitely.
- Return type:
- Returns:
This builder instance.
- set_min_sequence_age(min_sequence_age)[source]
For the transaction to be valid, the current ledger time must be at least min_sequence_age greater than source account’s sequence_time. Internally this will set the min_sequence_age precondition.
- Parameters:
min_sequence_age (
int
) – The minimum amount of time between source account sequence time and the ledger time when this transaction will become valid. If the value is0
orNone
, the transaction is unrestricted by the account sequence age. Cannot be negative.- Return type:
- Returns:
This builder instance.
- set_min_sequence_ledger_gap(min_sequence_ledger_gap)[source]
For the transaction to be valid, the current ledger number must be at least min_sequence_ledger_gap greater than source account’s ledger sequence. Internally this will set the min_sequence_ledger_gap precondition.
- Parameters:
min_sequence_ledger_gap (
int
) – The minimum number of ledgers between source account sequence and the ledger number when this transaction will become valid. If the value is0
orNone
, the transaction is unrestricted by the account sequence ledger. Cannot be negative.- Return type:
- Returns:
This builder instance.
- set_min_sequence_number(min_sequence_number)[source]
If you want to prepare a transaction which will be valid only while the account sequence number is min_sequence_number <= source_account_sequence_number < tx.sequence.
Note that after execution the account’s sequence number is always raised to tx.sequence. Internally this will set the min_sequence_number precondition.
- Parameters:
min_sequence_number (
int
) – The minimum source account sequence number this transaction is valid for. If the value isNone
the transaction is valid when source account’s sequence number == tx.sequence - 1.- Return type:
- Returns:
This builder instance.
- set_soroban_data(soroban_data)[source]
Set the SorobanTransactionData. For non-contract(non-Soroban) transactions, this setting has no effect.
In the case of Soroban transactions, set to an instance of SorobanTransactionData. This can typically be obtained from the simulation response based on a transaction with a InvokeHostFunctionOp. It provides necessary resource estimations for contract invocation.
- Parameters:
soroban_data (
Union
[SorobanTransactionData
,str
]) – The SorobanTransactionData as XDR object or base64 encoded string.- Return type:
- Returns:
This builder instance.
SorobanDataBuilder
- class stellar_sdk.SorobanDataBuilder[source]
Supports building
Memo
structures with various items set to specific values.This is recommended for when you are building
RestoreFootprint
,ExtendFootprintTTL
operations to avoid (re)building the entire data structure from scratch.By default, an empty instance will be created.
- classmethod from_xdr(soroban_data)[source]
Create a new
SorobanDataBuilder
object from an XDR object.- Parameters:
soroban_data (
Union
[str
,SorobanTransactionData
]) – The XDR object that represents a SorobanTransactionData.- Return type:
- Returns:
This builder.
- set_read_only(read_only)[source]
Sets the read-only portion of the storage access footprint to be a certain set of ledger keys.
- set_read_write(read_write)[source]
Sets the read-write portion of the storage access footprint to be a certain set of ledger keys.
- set_resource_fee(fee)[source]
Sets the “resource” fee portion of the Soroban data.
- Parameters:
fee (
int
) – The resource fee to set (int64)- Return type:
- Returns:
This builder.
SorobanServer
- class stellar_sdk.SorobanServer(server_url='https://soroban-testnet.stellar.org:443', client=None)[source]
Server handles the network connection to a Soroban RPC instance and exposes an interface for requests to that instance.
- Parameters:
server_url (
str
) – Soroban RPC server URL. (ex.https://soroban-testnet.stellar.org:443
)client (
Optional
[BaseSyncClient
]) – A client instance that will be used to make requests.
- get_contract_data(contract_id, key, durability=Durability.PERSISTENT)[source]
Reads the current value of contract data ledger entries directly.
- Parameters:
contract_id (
str
) – The contract ID containing the data to load. Encoded as Stellar Contract Address, for example:"CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"
key (
SCVal
) – The key of the contract data to load.durability (
Durability
) – The “durability keyspace” that this ledger key belongs to, which is eitherDurability.TEMPORARY
orDurability.PERSISTENT
. Defaults toDurability.PERSISTENT
.
- Return type:
- Returns:
A
LedgerEntryResult
object contains the ledger entry result orNone
if not found.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- get_events(start_ledger, filters=None, cursor=None, limit=None)[source]
Fetch a list of events that occurred in the ledger range.
See Soroban Documentation - getEvents
- Parameters:
start_ledger (
int
) – The first ledger to include in the results.filters (
Sequence
[EventFilter
]) – A list of filters to apply to the results.cursor (
str
) – A cursor value for use in pagination.limit (
int
) – The maximum number of records to return.
- Return type:
- Returns:
A
GetEventsResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- get_health()[source]
General node health check.
See Soroban Documentation - getHealth
- Return type:
- Returns:
A
GetHealthResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- get_latest_ledger()[source]
Fetches the latest ledger meta info from network which Soroban-RPC is connected to.
- Return type:
- Returns:
A
GetLatestLedgerResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- get_ledger_entries(keys)[source]
For reading the current value of ledger entries directly.
Allows you to directly inspect the current state of a contract, a contract’s code, or any other ledger entry. This is a backup way to access your contract data which may not be available via events or simulateTransaction.
See Soroban Documentation - getLedgerEntries
- Parameters:
- Return type:
- Returns:
A
GetLedgerEntriesResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- get_network()[source]
General info about the currently configured network.
- Return type:
- Returns:
A
GetNetworkResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- get_transaction(transaction_hash)[source]
Fetch the specified transaction.
See Soroban Documentation - getTransaction
- Parameters:
transaction_hash (
str
) – The hash of the transaction to fetch.- Return type:
- Returns:
A
GetTransactionResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- load_account(account_id)[source]
Load an account from the server, you can use the returned account object as source account for transactions.
- prepare_transaction(transaction_envelope, simulate_transaction_response=None)[source]
Submit a trial contract invocation, first run a simulation of the contract invocation as defined on the incoming transaction, and apply the results to a new copy of the transaction which is then returned. Setting the ledger footprint and authorization, so the resulting transaction is ready for signing and sending.
The returned transaction will also have an updated fee that is the sum of fee set on incoming transaction with the contract resource fees estimated from simulation. It is advisable to check the fee on returned transaction and validate or take appropriate measures for interaction with user to confirm it is acceptable.
You can call the
simulate_transaction()
method directly first if you want to inspect estimated fees for a given transaction in detail first if that is of importance.- Parameters:
transaction_envelope (
TransactionEnvelope
) – The transaction to prepare. It should include exactly one operation, which must be one ofRestoreFootprint
,ExtendFootprintTTL
, orInvokeHostFunction
. Any provided footprint will be ignored. You can usestellar_sdk.Transaction.is_soroban_transaction()
to check if a transaction is a Soroban transaction. Any provided footprint will be overwritten. However, if your operation has existing auth entries, they will be preferred over ALL auth entries from the simulation. In other words, if you include auth entries, you don’t care about the auth returned from the simulation. Other fields (footprint, etc.) will be filled as normal.simulate_transaction_response (
SimulateTransactionResponse
) – The response of the simulation of the transaction, typically you don’t need to pass this parameter, it will be automatically called if you don’t pass it.
- Return type:
- Returns:
A copy of the
TransactionEnvelope
, with the expected authorizations (in the case of invocation) and ledger footprint added. The transaction fee will also automatically be padded with the contract’s minimum resource fees discovered from the simulation.
- send_transaction(transaction_envelope)[source]
Submit a real transaction to the Stellar network. This is the only way to make changes “on-chain”.
See Soroban Documentation - sendTransaction
- Parameters:
transaction_envelope (
Union
[TransactionEnvelope
,str
]) – The transaction to send.- Return type:
- Returns:
A
SendTransactionResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- simulate_transaction(transaction_envelope, addl_resources=None)[source]
Submit a trial contract invocation to get back return values, expected ledger footprint, and expected costs.
See Soroban Documentation - simulateTransaction
- Parameters:
transaction_envelope (
TransactionEnvelope
) – The transaction to simulate. It should include exactly one operation, which must be one ofRestoreFootprint
,InvokeHostFunction
orExtendFootprintTTL
operation. Any provided footprint will be ignored.addl_resources (
Optional
[ResourceLeeway
]) – Additional resource include in the simulation.
- Return type:
- Returns:
A
SimulateTransactionResponse
object contains the cost, footprint, result/auth requirements (if applicable), and error of the transaction.
SorobanServer
- class stellar_sdk.SorobanServerAsync(server_url='https://soroban-testnet.stellar.org:443', client=None)[source]
Server handles the network connection to a Soroban RPC instance and exposes an interface for requests to that instance.
- Parameters:
server_url (
str
) – Soroban RPC server URL. (ex.https://soroban-testnet.stellar.org:443
)client (
Optional
[BaseAsyncClient
]) – A client instance that will be used to make requests.
- async get_contract_data(contract_id, key, durability=Durability.PERSISTENT)[source]
Reads the current value of contract data ledger entries directly.
- Parameters:
contract_id (
str
) – The contract ID containing the data to load. Encoded as Stellar Contract Address, for example:"CCJZ5DGASBWQXR5MPFCJXMBI333XE5U3FSJTNQU7RIKE3P5GN2K2WYD5"
key (
SCVal
) – The key of the contract data to load.durability (
Durability
) – The “durability keyspace” that this ledger key belongs to, which is eitherDurability.TEMPORARY
orDurability.PERSISTENT
. Defaults toDurability.PERSISTENT
.
- Return type:
- Returns:
A
LedgerEntryResult
object contains the ledger entry result orNone
if not found.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async get_events(start_ledger, filters=None, cursor=None, limit=None)[source]
Fetch a list of events that occurred in the ledger range.
See Soroban Documentation - getEvents
- Parameters:
start_ledger (
int
) – The first ledger to include in the results.filters (
Sequence
[EventFilter
]) – A list of filters to apply to the results.cursor (
str
) – A cursor value for use in pagination.limit (
int
) – The maximum number of records to return.
- Return type:
- Returns:
A
GetEventsResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async get_health()[source]
General node health check.
See Soroban Documentation - getHealth
- Return type:
- Returns:
A
GetHealthResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async get_latest_ledger()[source]
Fetches the latest ledger meta info from network which Soroban-RPC is connected to.
- Return type:
- Returns:
A
GetLatestLedgerResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async get_ledger_entries(keys)[source]
For reading the current value of ledger entries directly.
Allows you to directly inspect the current state of a contract, a contract’s code, or any other ledger entry. This is a backup way to access your contract data which may not be available via events or simulateTransaction.
See Soroban Documentation - getLedgerEntries
- Parameters:
- Return type:
- Returns:
A
GetLedgerEntriesResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async get_network()[source]
General info about the currently configured network.
- Return type:
- Returns:
A
GetNetworkResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async get_transaction(transaction_hash)[source]
Fetch the specified transaction.
See Soroban Documentation - getTransaction
- Parameters:
transaction_hash (
str
) – The hash of the transaction to fetch.- Return type:
- Returns:
A
GetTransactionResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async load_account(account_id)[source]
Load an account from the server, you can use the returned account object as source account for transactions.
- async prepare_transaction(transaction_envelope, simulate_transaction_response=None)[source]
Submit a trial contract invocation, first run a simulation of the contract invocation as defined on the incoming transaction, and apply the results to a new copy of the transaction which is then returned. Setting the ledger footprint and authorization, so the resulting transaction is ready for signing and sending.
The returned transaction will also have an updated fee that is the sum of fee set on incoming transaction with the contract resource fees estimated from simulation. It is advisable to check the fee on returned transaction and validate or take appropriate measures for interaction with user to confirm it is acceptable.
You can call the
simulate_transaction()
method directly first if you want to inspect estimated fees for a given transaction in detail first if that is of importance.- Parameters:
transaction_envelope (
TransactionEnvelope
) – The transaction to prepare. It should include exactly one operation, which must be one ofRestoreFootprint
,ExtendFootprintTTL
, orInvokeHostFunction
. Any provided footprint will be ignored. You can usestellar_sdk.Transaction.is_soroban_transaction()
to check if a transaction is a Soroban transaction. Any provided footprint will be overwritten. However, if your operation has existing auth entries, they will be preferred over ALL auth entries from the simulation. In other words, if you include auth entries, you don’t care about the auth returned from the simulation. Other fields (footprint, etc.) will be filled as normal.simulate_transaction_response (
SimulateTransactionResponse
) – The response of the simulation of the transaction, typically you don’t need to pass this parameter, it will be automatically called if you don’t pass it.
- Return type:
- Returns:
A copy of the
TransactionEnvelope
, with the expected authorizations (in the case of invocation) and ledger footprint added. The transaction fee will also automatically be padded with the contract’s minimum resource fees discovered from the simulation.
- async send_transaction(transaction_envelope)[source]
Submit a real transaction to the Stellar network. This is the only way to make changes “on-chain”.
See Soroban Documentation - sendTransaction
- Parameters:
transaction_envelope (
Union
[TransactionEnvelope
,str
]) – The transaction to send.- Return type:
- Returns:
A
SendTransactionResponse
object.- Raises:
SorobanRpcErrorResponse
- If the Soroban-RPC instance returns an error response.
- async simulate_transaction(transaction_envelope, addl_resources=None)[source]
Submit a trial contract invocation to get back return values, expected ledger footprint, and expected costs.
See Soroban Documentation - simulateTransaction
- Parameters:
transaction_envelope (
TransactionEnvelope
) – The transaction to simulate. It should include exactly one operation, which must be one ofRestoreFootprint
,InvokeHostFunction
orExtendFootprintTTL
operation. Any provided footprint will be ignored.addl_resources (
Optional
[ResourceLeeway
]) – Additional resource include in the simulation.
- Return type:
- Returns:
A
SimulateTransactionResponse
object contains the cost, footprint, result/auth requirements (if applicable), and error of the transaction.
Soroban RPC Definitions
- pydantic model stellar_sdk.soroban_rpc.Error[source]
Show JSON schema
{ "title": "Error", "type": "object", "properties": { "code": { "title": "Code", "type": "integer" }, "message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Message" }, "data": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Data" } }, "required": [ "code" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.EventFilter[source]
Show JSON schema
{ "title": "EventFilter", "type": "object", "properties": { "type": { "anyOf": [ { "$ref": "#/$defs/EventFilterType" }, { "type": "null" } ], "default": null }, "contractIds": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Contractids" }, "topics": { "anyOf": [ { "items": { "items": { "type": "string" }, "type": "array" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Topics" } }, "$defs": { "EventFilterType": { "enum": [ "system", "contract", "diagnostic" ], "title": "EventFilterType", "type": "string" } } }
- Config:
populate_by_name: bool = True
- Fields:
-
field event_type:
Optional
[EventFilterType
] = None (alias 'type')
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class stellar_sdk.soroban_rpc.EventFilterType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
- pydantic model stellar_sdk.soroban_rpc.EventInfo[source]
Show JSON schema
{ "title": "EventInfo", "type": "object", "properties": { "type": { "title": "Type", "type": "string" }, "ledger": { "title": "Ledger", "type": "integer" }, "ledgerClosedAt": { "format": "date-time", "title": "Ledgerclosedat", "type": "string" }, "contractId": { "title": "Contractid", "type": "string" }, "id": { "title": "Id", "type": "string" }, "pagingToken": { "title": "Pagingtoken", "type": "string" }, "topic": { "items": { "type": "string" }, "title": "Topic", "type": "array" }, "value": { "title": "Value", "type": "string" }, "inSuccessfulContractCall": { "title": "Insuccessfulcontractcall", "type": "boolean" } }, "required": [ "type", "ledger", "ledgerClosedAt", "contractId", "id", "pagingToken", "topic", "value", "inSuccessfulContractCall" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetEventsRequest[source]
Response for JSON-RPC method getEvents.
See getEvents documentation for more information.
Show JSON schema
{ "title": "GetEventsRequest", "description": "Response for JSON-RPC method getEvents.\n\nSee `getEvents documentation <https://soroban.stellar.org/api/methods/getEvents#parameters>`__ for\nmore information.", "type": "object", "properties": { "startLedger": { "title": "Startledger", "type": "integer" }, "filters": { "anyOf": [ { "items": { "$ref": "#/$defs/EventFilter" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Filters" }, "pagination": { "anyOf": [ { "$ref": "#/$defs/PaginationOptions" }, { "type": "null" } ], "default": null } }, "$defs": { "EventFilter": { "properties": { "type": { "anyOf": [ { "$ref": "#/$defs/EventFilterType" }, { "type": "null" } ], "default": null }, "contractIds": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Contractids" }, "topics": { "anyOf": [ { "items": { "items": { "type": "string" }, "type": "array" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Topics" } }, "title": "EventFilter", "type": "object" }, "EventFilterType": { "enum": [ "system", "contract", "diagnostic" ], "title": "EventFilterType", "type": "string" }, "PaginationOptions": { "properties": { "cursor": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Cursor" }, "limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Limit" } }, "title": "PaginationOptions", "type": "object" } }, "required": [ "startLedger" ] }
- Fields:
-
field filters:
Optional
[Sequence
[EventFilter
]] = None
-
field pagination:
Optional
[PaginationOptions
] = None
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetEventsResponse[source]
Response for JSON-RPC method getEvents.
See getEvents documentation for more information.
Show JSON schema
{ "title": "GetEventsResponse", "description": "Response for JSON-RPC method getEvents.\n\nSee `getEvents documentation <https://soroban.stellar.org/api/methods/getEvents#returns>`__ for\nmore information.", "type": "object", "properties": { "events": { "items": { "$ref": "#/$defs/EventInfo" }, "title": "Events", "type": "array" }, "latestLedger": { "title": "Latestledger", "type": "integer" } }, "$defs": { "EventInfo": { "properties": { "type": { "title": "Type", "type": "string" }, "ledger": { "title": "Ledger", "type": "integer" }, "ledgerClosedAt": { "format": "date-time", "title": "Ledgerclosedat", "type": "string" }, "contractId": { "title": "Contractid", "type": "string" }, "id": { "title": "Id", "type": "string" }, "pagingToken": { "title": "Pagingtoken", "type": "string" }, "topic": { "items": { "type": "string" }, "title": "Topic", "type": "array" }, "value": { "title": "Value", "type": "string" }, "inSuccessfulContractCall": { "title": "Insuccessfulcontractcall", "type": "boolean" } }, "required": [ "type", "ledger", "ledgerClosedAt", "contractId", "id", "pagingToken", "topic", "value", "inSuccessfulContractCall" ], "title": "EventInfo", "type": "object" } }, "required": [ "events", "latestLedger" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetHealthResponse[source]
Response for JSON-RPC method getHealth.
See getHealth documentation for more information.
Show JSON schema
{ "title": "GetHealthResponse", "description": "Response for JSON-RPC method getHealth.\n\nSee `getHealth documentation <https://soroban.stellar.org/api/methods/getHealth#returns>`__ for\nmore information.", "type": "object", "properties": { "status": { "title": "Status", "type": "string" } }, "required": [ "status" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetLatestLedgerResponse[source]
Response for JSON-RPC method getLatestLedger.
See getLatestLedger documentation for more information.
Show JSON schema
{ "title": "GetLatestLedgerResponse", "description": "Response for JSON-RPC method getLatestLedger.\n\nSee `getLatestLedger documentation <https://soroban.stellar.org/api/methods/getLatestLedger#returns>`__ for\nmore information.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "protocolVersion": { "title": "Protocolversion", "type": "integer" }, "sequence": { "title": "Sequence", "type": "integer" } }, "required": [ "id", "protocolVersion", "sequence" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetLedgerEntriesRequest[source]
Response for JSON-RPC method getLedgerEntries.
See getLedgerEntries documentation for more information.
Show JSON schema
{ "title": "GetLedgerEntriesRequest", "description": "Response for JSON-RPC method getLedgerEntries.\n\nSee `getLedgerEntries documentation <https://soroban.stellar.org/api/methods/getLedgerEntries#parameters>`__ for\nmore information.", "type": "object", "properties": { "keys": { "items": { "type": "string" }, "title": "Keys", "type": "array" } }, "required": [ "keys" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetLedgerEntriesResponse[source]
Response for JSON-RPC method getLedgerEntries.
See getLedgerEntries documentation for more information.
Show JSON schema
{ "title": "GetLedgerEntriesResponse", "description": "Response for JSON-RPC method getLedgerEntries.\n\nSee `getLedgerEntries documentation <https://soroban.stellar.org/api/methods/getLedgerEntries#return>`__ for\nmore information.", "type": "object", "properties": { "entries": { "anyOf": [ { "items": { "$ref": "#/$defs/LedgerEntryResult" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Entries" }, "latestLedger": { "title": "Latestledger", "type": "integer" } }, "$defs": { "LedgerEntryResult": { "properties": { "key": { "title": "Key", "type": "string" }, "xdr": { "title": "Xdr", "type": "string" }, "lastModifiedLedgerSeq": { "title": "Lastmodifiedledgerseq", "type": "integer" }, "liveUntilLedgerSeq": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Liveuntilledgerseq" } }, "required": [ "key", "xdr", "lastModifiedLedgerSeq" ], "title": "LedgerEntryResult", "type": "object" } }, "required": [ "latestLedger" ] }
-
field entries:
Optional
[List
[LedgerEntryResult
]] = None
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
-
field entries:
- pydantic model stellar_sdk.soroban_rpc.GetNetworkResponse[source]
Response for JSON-RPC method getNetwork.
See getNetwork documentation for more information.
Show JSON schema
{ "title": "GetNetworkResponse", "description": "Response for JSON-RPC method getNetwork.\n\nSee `getNetwork documentation <https://soroban.stellar.org/api/methods/getNetwork#returns>`__ for\nmore information.", "type": "object", "properties": { "friendbotUrl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Friendboturl" }, "passphrase": { "title": "Passphrase", "type": "string" }, "protocolVersion": { "title": "Protocolversion", "type": "integer" } }, "required": [ "passphrase", "protocolVersion" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetTransactionRequest[source]
Response for JSON-RPC method getTransaction.
See getTransaction documentation for more information.
Show JSON schema
{ "title": "GetTransactionRequest", "description": "Response for JSON-RPC method getTransaction.\n\nSee `getTransaction documentation <https://soroban.stellar.org/api/methods/getTransaction#parameters>`__ for\nmore information.", "type": "object", "properties": { "hash": { "title": "Hash", "type": "string" } }, "required": [ "hash" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.GetTransactionResponse[source]
Response for JSON-RPC method getTransaction.
See getTransaction documentation for more information.
Show JSON schema
{ "title": "GetTransactionResponse", "description": "Response for JSON-RPC method getTransaction.\n\nSee `getTransaction documentation <https://soroban.stellar.org/api/methods/getTransaction#returns>`__ for\nmore information.", "type": "object", "properties": { "status": { "$ref": "#/$defs/GetTransactionStatus" }, "latestLedger": { "title": "Latestledger", "type": "integer" }, "latestLedgerCloseTime": { "title": "Latestledgerclosetime", "type": "integer" }, "oldestLedger": { "title": "Oldestledger", "type": "integer" }, "oldestLedgerCloseTime": { "title": "Oldestledgerclosetime", "type": "integer" }, "applicationOrder": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Applicationorder" }, "feeBump": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Feebump" }, "envelopeXdr": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Envelopexdr" }, "resultXdr": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Resultxdr" }, "resultMetaXdr": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Resultmetaxdr" }, "ledger": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Ledger" }, "createdAt": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Createdat" } }, "$defs": { "GetTransactionStatus": { "enum": [ "SUCCESS", "NOT_FOUND", "FAILED" ], "title": "GetTransactionStatus", "type": "string" } }, "required": [ "status", "latestLedger", "latestLedgerCloseTime", "oldestLedger", "oldestLedgerCloseTime" ] }
- Fields:
-
field status:
GetTransactionStatus
[Required]
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class stellar_sdk.soroban_rpc.GetTransactionStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
- FAILED = 'FAILED'
TransactionStatusFailed indicates the transaction was included in the ledger and it was executed with an error.
- NOT_FOUND = 'NOT_FOUND'
indicates the transaction was not found in Soroban-RPC’s transaction store.
- SUCCESS = 'SUCCESS'
indicates the transaction was included in the ledger and it was executed without errors.
- pydantic model stellar_sdk.soroban_rpc.LedgerEntryResult[source]
Show JSON schema
{ "title": "LedgerEntryResult", "type": "object", "properties": { "key": { "title": "Key", "type": "string" }, "xdr": { "title": "Xdr", "type": "string" }, "lastModifiedLedgerSeq": { "title": "Lastmodifiedledgerseq", "type": "integer" }, "liveUntilLedgerSeq": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Liveuntilledgerseq" } }, "required": [ "key", "xdr", "lastModifiedLedgerSeq" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.PaginationOptions[source]
Show JSON schema
{ "title": "PaginationOptions", "type": "object", "properties": { "cursor": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Cursor" }, "limit": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Limit" } } }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.Request[source]
Represent the request sent to Soroban-RPC.
See JSON-RPC 2.0 Specification - Request object for more information.
Show JSON schema
{ "title": "Request", "description": "Represent the request sent to Soroban-RPC.\n\nSee `JSON-RPC 2.0 Specification - Request object <https://www.jsonrpc.org/specification#request_object>`__ for more information.", "type": "object", "properties": { "jsonrpc": { "default": "2.0", "title": "Jsonrpc", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "integer" } ], "title": "Id" }, "method": { "title": "Method", "type": "string" }, "params": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Params" } }, "required": [ "id", "method" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.ResourceConfig[source]
ResourceConfig represents the additional resource leeways for transaction simulation.
Show JSON schema
{ "title": "ResourceConfig", "description": "ResourceConfig represents the additional resource leeways for transaction simulation.", "type": "object", "properties": { "instructionLeeway": { "title": "Instructionleeway", "type": "integer" } }, "required": [ "instructionLeeway" ] }
- Config:
populate_by_name: bool = True
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.Response[source]
Represent the response returned from Soroban-RPC.
See JSON-RPC 2.0 Specification - Response object for more information.
Show JSON schema
{ "title": "Response", "description": "Represent the response returned from Soroban-RPC.\n\nSee `JSON-RPC 2.0 Specification - Response object <https://www.jsonrpc.org/specification#response_object>`__ for more information.", "type": "object", "properties": { "jsonrpc": { "title": "Jsonrpc", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "integer" } ], "title": "Id" }, "result": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Result" }, "error": { "anyOf": [ { "$ref": "#/$defs/Error" }, { "type": "null" } ], "default": null } }, "$defs": { "Error": { "properties": { "code": { "title": "Code", "type": "integer" }, "message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Message" }, "data": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Data" } }, "required": [ "code" ], "title": "Error", "type": "object" } }, "required": [ "jsonrpc", "id" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.RestorePreamble[source]
Show JSON schema
{ "title": "RestorePreamble", "type": "object", "properties": { "transactionData": { "title": "Transactiondata", "type": "string" }, "minResourceFee": { "title": "Minresourcefee", "type": "integer" } }, "required": [ "transactionData", "minResourceFee" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.SendTransactionRequest[source]
Response for JSON-RPC method sendTransaction.
See sendTransaction documentation for more information.
Show JSON schema
{ "title": "SendTransactionRequest", "description": "Response for JSON-RPC method sendTransaction.\n\nSee `sendTransaction documentation <https://soroban.stellar.org/api/methods/sendTransaction#parameters>`__ for\nmore information.", "type": "object", "properties": { "transaction": { "title": "Transaction", "type": "string" } }, "required": [ "transaction" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.SendTransactionResponse[source]
Response for JSON-RPC method sendTransaction.
See sendTransaction documentation for more information.
Show JSON schema
{ "title": "SendTransactionResponse", "description": "Response for JSON-RPC method sendTransaction.\n\nSee `sendTransaction documentation <https://soroban.stellar.org/api/methods/sendTransaction#returns>`__ for\nmore information.", "type": "object", "properties": { "errorResultXdr": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Errorresultxdr" }, "diagnosticEventsXdr": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Diagnosticeventsxdr" }, "status": { "$ref": "#/$defs/SendTransactionStatus" }, "hash": { "title": "Hash", "type": "string" }, "latestLedger": { "title": "Latestledger", "type": "integer" }, "latestLedgerCloseTime": { "title": "Latestledgerclosetime", "type": "integer" } }, "$defs": { "SendTransactionStatus": { "enum": [ "ERROR", "PENDING", "DUPLICATE", "TRY_AGAIN_LATER" ], "title": "SendTransactionStatus", "type": "string" } }, "required": [ "status", "hash", "latestLedger", "latestLedgerCloseTime" ] }
- Fields:
-
field status:
SendTransactionStatus
[Required]
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- class stellar_sdk.soroban_rpc.SendTransactionStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
- DUPLICATE = 'DUPLICATE'
represents the status value returned by stellar-core when a submitted transaction is a duplicate
- ERROR = 'ERROR'
represents the status value returned by stellar-core when an error occurred from submitting a transaction
- PENDING = 'PENDING'
represents the status value returned by stellar-core when a transaction has been accepted for processing
- TRY_AGAIN_LATER = 'TRY_AGAIN_LATER'
represents the status value returned by stellar-core when a submitted transaction was not included in the previous 4 ledgers and get banned for being added in the next few ledgers.
- pydantic model stellar_sdk.soroban_rpc.SimulateHostFunctionResult[source]
Show JSON schema
{ "title": "SimulateHostFunctionResult", "type": "object", "properties": { "auth": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Auth" }, "xdr": { "title": "Xdr", "type": "string" } }, "required": [ "xdr" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.SimulateTransactionCost[source]
Show JSON schema
{ "title": "SimulateTransactionCost", "type": "object", "properties": { "cpuInsns": { "title": "Cpuinsns", "type": "integer" }, "memBytes": { "title": "Membytes", "type": "integer" } }, "required": [ "cpuInsns", "memBytes" ] }
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.SimulateTransactionRequest[source]
Response for JSON-RPC method simulateTransaction.
Note
The simulation response will have different model representations with different members present or absent depending on type of response that it is conveying. For example, the simulation response for invoke host function, could be one of three types: error, success, or restore operation needed.
See simulateTransaction documentation for more information.
Show JSON schema
{ "title": "SimulateTransactionRequest", "description": "Response for JSON-RPC method simulateTransaction.\n\n.. note::\n The simulation response will have different model representations with different\n members present or absent depending on type of response that it is conveying. For example, the\n simulation response for invoke host function, could be one of three types: error, success, or\n restore operation needed.\n\nSee `simulateTransaction documentation <https://soroban.stellar.org/api/methods/simulateTransaction#parameters>`__ for\nmore information.", "type": "object", "properties": { "transaction": { "title": "Transaction", "type": "string" }, "resourceConfig": { "anyOf": [ { "$ref": "#/$defs/ResourceConfig" }, { "type": "null" } ], "default": null } }, "$defs": { "ResourceConfig": { "description": "ResourceConfig represents the additional resource leeways for transaction simulation.", "properties": { "instructionLeeway": { "title": "Instructionleeway", "type": "integer" } }, "required": [ "instructionLeeway" ], "title": "ResourceConfig", "type": "object" } }, "required": [ "transaction" ] }
- Config:
populate_by_name: bool = True
- Fields:
-
field resource_config:
Optional
[ResourceConfig
] = None (alias 'resourceConfig')
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.SimulateTransactionResponse[source]
Response for JSON-RPC method simulateTransaction.
See simulateTransaction documentation for more information.
Show JSON schema
{ "title": "SimulateTransactionResponse", "description": "Response for JSON-RPC method simulateTransaction.\n\nSee `simulateTransaction documentation <https://soroban.stellar.org/api/methods/simulateTransaction#returns>`__ for\nmore information.", "type": "object", "properties": { "error": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Error" }, "transactionData": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Transactiondata" }, "minResourceFee": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Minresourcefee" }, "events": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Events" }, "results": { "anyOf": [ { "items": { "$ref": "#/$defs/SimulateHostFunctionResult" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Results" }, "cost": { "anyOf": [ { "$ref": "#/$defs/SimulateTransactionCost" }, { "type": "null" } ], "default": null }, "restorePreamble": { "anyOf": [ { "$ref": "#/$defs/RestorePreamble" }, { "type": "null" } ], "default": null }, "latestLedger": { "title": "Latestledger", "type": "integer" } }, "$defs": { "RestorePreamble": { "properties": { "transactionData": { "title": "Transactiondata", "type": "string" }, "minResourceFee": { "title": "Minresourcefee", "type": "integer" } }, "required": [ "transactionData", "minResourceFee" ], "title": "RestorePreamble", "type": "object" }, "SimulateHostFunctionResult": { "properties": { "auth": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Auth" }, "xdr": { "title": "Xdr", "type": "string" } }, "required": [ "xdr" ], "title": "SimulateHostFunctionResult", "type": "object" }, "SimulateTransactionCost": { "properties": { "cpuInsns": { "title": "Cpuinsns", "type": "integer" }, "memBytes": { "title": "Membytes", "type": "integer" } }, "required": [ "cpuInsns", "memBytes" ], "title": "SimulateTransactionCost", "type": "object" } }, "required": [ "latestLedger" ] }
- Fields:
-
field cost:
Optional
[SimulateTransactionCost
] = None
-
field restore_preamble:
Optional
[RestorePreamble
] = None (alias 'restorePreamble')
-
field results:
Optional
[List
[SimulateHostFunctionResult
]] = None
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.SimulateTransactionResult[source]
Show JSON schema
{ "title": "SimulateTransactionResult", "type": "object", "properties": { "auth": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Auth" }, "events": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Events" }, "footprint": { "title": "Footprint", "type": "string" }, "xdr": { "title": "Xdr", "type": "string" } }, "required": [ "footprint", "xdr" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- pydantic model stellar_sdk.soroban_rpc.TransactionResponseError[source]
Show JSON schema
{ "title": "TransactionResponseError", "type": "object", "properties": { "code": { "title": "Code", "type": "string" }, "message": { "title": "Message", "type": "string" }, "data": { "title": "Data", "type": "object" } }, "required": [ "code", "message", "data" ] }
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
scval
- stellar_sdk.scval.to_address(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from anstellar_sdk.address.Address
object.- Parameters:
data (
Union
[Address
,str
]) – Thestellar_sdk.address.Address
object to convert.- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_ADDRESS
.
- stellar_sdk.scval.from_address(sc_val)[source]
Creates an
stellar_sdk.address.Address
object from astellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An
stellar_sdk.address.Address
object.- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_ADDRESS
.
- stellar_sdk.scval.to_bool(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from a bool value.
- stellar_sdk.scval.from_bool(sc_val)[source]
Creates a bool value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
A bool value.
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_BOOL
.
- stellar_sdk.scval.to_bytes(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from a bytes value.
- stellar_sdk.scval.from_bytes(sc_val)[source]
Creates a bytes value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
A bytes value.
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_BYTES
.
- stellar_sdk.scval.to_duration(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The duration. (uint64)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_DURATION
.- Raises:
ValueError
ifvalue
is out of uint64 range.
- stellar_sdk.scval.from_duration(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
The duration. (uint64)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_DURATION
.
- stellar_sdk.scval.to_int32(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (int32)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_I32
.- Raises:
ValueError
ifvalue
is out of int32 range.
- stellar_sdk.scval.from_int32(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (int32)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_I32
.
- stellar_sdk.scval.to_int64(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (int64)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_I64
.- Raises:
ValueError
ifvalue
is out of int64 range.
- stellar_sdk.scval.from_int64(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (int64)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_I64
.
- stellar_sdk.scval.to_int128(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (int128)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_I128
.- Raises:
ValueError
ifvalue
is out of int128 range.
- stellar_sdk.scval.from_int128(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (int128)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_I128
.
- stellar_sdk.scval.to_int256(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (int256)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_I256
.- Raises:
ValueError
ifvalue
is out of int256 range.
- stellar_sdk.scval.from_int256(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (int256)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_I256
.
- stellar_sdk.scval.to_map(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an OrderedDict value.
- stellar_sdk.scval.from_map(sc_val)[source]
Creates a dict value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
The map value.
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_MAP
.
- stellar_sdk.scval.to_string(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from a string value.
- stellar_sdk.scval.from_string(sc_val)[source]
Creates a string value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
A string value in bytes.
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_STRING
.
- stellar_sdk.scval.to_symbol(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from a symbol value.
- stellar_sdk.scval.from_symbol(sc_val)[source]
Creates a symbol value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
A symbol value.
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_SYMBOL
.
- stellar_sdk.scval.to_timepoint(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The time point. (uint64)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_TIME_POINT
.- Raises:
ValueError
ifvalue
is out of uint64 range.
- stellar_sdk.scval.from_timepoint(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
The time point. (uint64)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_TIMEPOINT
.
- stellar_sdk.scval.to_uint32(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (uint32)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_U32
.- Raises:
ValueError
ifvalue
is out of uint32 range.
- stellar_sdk.scval.from_uint32(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (uint32)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_U32
.
- stellar_sdk.scval.to_uint64(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (uint64)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_U64
.- Raises:
ValueError
ifvalue
is out of uint64 range.
- stellar_sdk.scval.from_uint64(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (uint64)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_U64
.
- stellar_sdk.scval.to_uint128(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (uint128)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_U128
.- Raises:
ValueError
ifvalue
is out of uint128 range.
- stellar_sdk.scval.from_uint128(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
An int value. (uint128)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_U128
.
- stellar_sdk.scval.to_uint256(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from an int value.- Parameters:
data (
int
) – The int to convert. (uint256)- Return type:
- Returns:
A new
stellar_sdk.xdr.SCVal
XDR object with typestellar_sdk.xdr.SCValType.SCV_U256
.- Raises:
ValueError
ifvalue
is out of uint256 range.
- stellar_sdk.scval.from_uint256(sc_val)[source]
Creates an int value from a
stellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
The value. (uint256)
- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_U256
.
- stellar_sdk.scval.to_vec(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object from a list ofstellar_sdk.xdr.SCVal
XDR objects.
- stellar_sdk.scval.from_vec(sc_val)[source]
Creates a list of
stellar_sdk.xdr.SCVal
XDR objects from astellar_sdk.xdr.SCVal
XDR object.- Parameters:
sc_val (
SCVal
) – Thestellar_sdk.xdr.SCVal
XDR object to convert.- Return type:
- Returns:
The list of
stellar_sdk.xdr.SCVal
XDR objects.- Raises:
ValueError
ifsc_val
is not of typestellar_sdk.xdr.SCValType.SCV_VEC
.
- stellar_sdk.scval.to_enum(key, data)[source]
Creates a
stellar_sdk.xdr.SCVal
XDR object corresponding to the Enum in the Rust SDK.Warning
Please note that this API is experimental and may be removed at any time. I recommend using the
from_vec()
to implement it.
- stellar_sdk.scval.from_enum(sc_val)[source]
Creates a tuple corresponding to the Enum in the Rust SDK.
Warning
Please note that this API is experimental and may be removed at any time. I recommend using the
from_vec()
andfrom_symbol()
to implement it.
- stellar_sdk.scval.to_tuple_struct(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object corresponding to the Tuple Struct in the Rust SDK.Warning
Please note that this API is experimental and may be removed at any time. I recommend using the
to_vec()
to implement it.
- stellar_sdk.scval.from_tuple_struct(sc_val)[source]
Creates a list corresponding to the Tuple Struct in the Rust SDK.
Warning
Please note that this API is experimental and may be removed at any time. I recommend using the
from_vec()
to implement it.
- stellar_sdk.scval.to_struct(data)[source]
Creates a new
stellar_sdk.xdr.SCVal
XDR object corresponding to the Struct in the Rust SDK.Warning
Please note that this API is experimental and may be removed at any time. I recommend using the
to_map()
andto_symbol()
to implement it.
- stellar_sdk.scval.from_struct(sc_val)[source]
Creates a dict corresponding to the Struct in the Rust SDK.
Warning
Please note that this API is experimental and may be removed at any time. I recommend using the
from_map()
andfrom_symbol()
to implement it.
Auth
- stellar_sdk.auth.authorize_entry(entry, signer, valid_until_ledger_sequence, network_passphrase)[source]
Actually authorizes an existing authorization entry using the given the credentials and expiration details, returning a signed copy.
This “fills out” the authorization entry with a signature, indicating to the
stellar_sdk.InvokeHostFunction
it’s attached to that:a particular identity (i.e. signing
stellar_sdk.Keypair
or other signer)- approving the execution of an invocation tree (i.e. a
simulation-acquired
stellar_xdr.SorobanAuthorizedInvocation
or otherwise built)
on a particular network (uniquely identified by its passphrase, see
stellar_sdk.Network
)until a particular ledger sequence is reached.
- Parameters:
entry (
Union
[SorobanAuthorizationEntry
,str
]) – an unsigned Soroban authorization entry.signer (
Union
[Keypair
,Callable
[[HashIDPreimage
],bytes
]]) – either aKeypair
or a function which takes a payload (astellar_xdr.HashIDPreimage
instance) input and returns a bytes signature, the signing key should correspond to the address in the entry.valid_until_ledger_sequence (
int
) – the (exclusive) future ledger sequence number until which this authorization entry should be valid (if currentLedgerSeq==validUntil, this is expired)network_passphrase (
str
) – the network passphrase is incorporated into the signature (seestellar_sdk.Network
for options)
- Return type:
- Returns:
a signed Soroban authorization entry.
- stellar_sdk.auth.authorize_invocation(signer, public_key, valid_until_ledger_sequence, invocation, network_passphrase)[source]
This builds an entry from scratch, allowing you to express authorization as a function of:
a particular identity (i.e. signing
stellar_sdk.Keypair
or other signer)- approving the execution of an invocation tree (i.e. a
simulation-acquired
stellar_xdr.SorobanAuthorizedInvocation
or otherwise built)
on a particular network (uniquely identified by its passphrase, see
stellar_sdk.Network
)until a particular ledger sequence is reached.
This is in contrast to
authorize_entry()
, which signs an existing entry “in place”.- Parameters:
signer (
Union
[Keypair
,Callable
[[HashIDPreimage
],bytes
]]) – either aKeypair
or a function which takes a payload (astellar_xdr.HashIDPreimage
instance) input and returns a bytes signature, the signing key should correspond to the address in the entry.public_key (
Optional
[str
]) – the public identity of the signer (when providing aKeypair
to signer, this can be omitted, as it just uses the public key of the keypair)valid_until_ledger_sequence (
int
) – the (exclusive) future ledger sequence number until which this authorization entry should be valid (if currentLedgerSeq==validUntil, this is expired)invocation (
SorobanAuthorizedInvocation
) – invocation the invocation tree that we’re authorizing (likely, this comes from transaction simulation)network_passphrase (
str
) – the network passphrase is incorporated into the signature (seestellar_sdk.Network
for options)
- Returns:
a signed Soroban authorization entry.
Helpers
- stellar_sdk.helpers.parse_transaction_envelope_from_xdr(xdr, network_passphrase)[source]
When you are not sure whether your XDR belongs to
TransactionEnvelope
orFeeBumpTransactionEnvelope
, you can use this helper function.An example:
from stellar_sdk import Network from stellar_sdk.helpers import parse_transaction_envelope_from_xdr xdr = "AAAAAgAAAADHJNEDn33/C1uDkDfzDfKVq/4XE9IxDfGiLCfoV7riZQAAA+gCI4TVABpRPgAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAUxpcmEAAAAAabIaDgm0ypyJpsVfEjZw2mO3Enq4Q4t5URKfWtqukSUAAAABVVNEAAAAAADophqGHmCvYPgHc+BjRuXHLL5Z3K3aN2CNWO9CUR2f3AAAAAAAAAAAE8G9mAADcH8AAAAAMYdBWgAAAAAAAAABV7riZQAAAEARGCGwYk/kEB2Z4UL20y536evnwmmSc4c2FnxlvUcPZl5jgWHcNwY8LTpFhdrUN9TZWciCRp/JCZYa0SJh8cYB" te = parse_transaction_envelope_from_xdr(xdr, Network.PUBLIC_NETWORK_PASSPHRASE) print(te)
- Parameters:
- Raises:
ValueError
- XDR is neitherTransactionEnvelope
norFeeBumpTransactionEnvelope
- Return type:
Stellar Ecosystem Proposals
SEP 0001: stellar.toml
- stellar_sdk.sep.stellar_toml.fetch_stellar_toml(domain, client=None, use_http=False)[source]
Retrieve the stellar.toml file from a given domain.
Retrieve the stellar.toml file for information about interacting with Stellar’s federation protocol for a given Stellar Anchor (specified by a domain).
- Parameters:
domain (
str
) – The domain the .toml file is hosted at.use_http (
bool
) – Specifies whether the request should go over plain HTTP vs HTTPS. Note it is recommended that you always use HTTPS.client (
BaseSyncClient
) – Http Client used to send the request.
- Return type:
- Returns:
The stellar.toml file as an object via
toml.loads()
.- Raises:
StellarTomlNotFoundError
: if the Stellar toml file could not be found.
- async stellar_sdk.sep.stellar_toml.fetch_stellar_toml_async(domain, client=None, use_http=False)[source]
Retrieve the stellar.toml file from a given domain.
Retrieve the stellar.toml file for information about interacting with Stellar’s federation protocol for a given Stellar Anchor (specified by a domain).
- Parameters:
domain (
str
) – The domain the .toml file is hosted at.use_http (
bool
) – Specifies whether the request should go over plain HTTP vs HTTPS. Note it is recommended that you always use HTTPS.client (
BaseAsyncClient
) – Http Client used to send the request.
- Return type:
- Returns:
The stellar.toml file as an object via
toml.loads()
.- Raises:
StellarTomlNotFoundError
: if the Stellar toml file could not be found.
SEP 0002: Federation protocol
- stellar_sdk.sep.federation.resolve_stellar_address(stellar_address, client=None, federation_url=None, use_http=False)[source]
Get the federation record if the user was found for a given Stellar address.
- Parameters:
stellar_address (
str
) – address Stellar address (ex."bob*stellar.org"
).client (
BaseSyncClient
) – Http Client used to send the request.federation_url (
str
) – The federation server URL (ex."https://stellar.org/federation"
), if you don’t set this value, we will try to get it from stellar_address.use_http (
bool
) – Specifies whether the request should go over plain HTTP vs HTTPS. Note it is recommended that you always use HTTPS.
- Return type:
- Returns:
Federation record.
- async stellar_sdk.sep.federation.resolve_stellar_address_async(stellar_address, client=None, federation_url=None, use_http=False)[source]
Get the federation record if the user was found for a given Stellar address.
- Parameters:
stellar_address (
str
) – address Stellar address (ex."bob*stellar.org"
).client (
BaseAsyncClient
) – Http Client used to send the request.federation_url (
str
) – The federation server URL (ex."https://stellar.org/federation"
), if you don’t set this value, we will try to get it from stellar_address.use_http (
bool
) – Specifies whether the request should go over plain HTTP vs HTTPS. Note it is recommended that you always use HTTPS.
- Return type:
- Returns:
Federation record.
- async stellar_sdk.sep.federation.resolve_account_id_async(account_id, domain=None, federation_url=None, client=None, use_http=False)[source]
Given an account ID, get their federation record if the user was found
- Parameters:
account_id (
str
) – Account ID (ex."GBYNR2QJXLBCBTRN44MRORCMI4YO7FZPFBCNOKTOBCAAFC7KC3LNPRYS"
)domain (
str
) – Get federation_url from the domain, you don’t need to set this value if federation_url is set.federation_url (
str
) – The federation server URL (ex."https://stellar.org/federation"
).client (
BaseAsyncClient
) – Http Client used to send the request.use_http (
bool
) – Specifies whether the request should go over plain HTTP vs HTTPS. Note it is recommended that you always use HTTPS.
- Return type:
- Returns:
Federation record.
- stellar_sdk.sep.federation.resolve_account_id(account_id, domain=None, federation_url=None, client=None, use_http=False)[source]
Given an account ID, get their federation record if the user was found
- Parameters:
account_id (
str
) – Account ID (ex."GBYNR2QJXLBCBTRN44MRORCMI4YO7FZPFBCNOKTOBCAAFC7KC3LNPRYS"
)domain (
str
) – Get federation_url from the domain, you don’t need to set this value if federation_url is set.federation_url (
str
) – The federation server URL (ex."https://stellar.org/federation"
).client (
BaseSyncClient
) – Http Client used to send the request.use_http (
bool
) – Specifies whether the request should go over plain HTTP vs HTTPS. Note it is recommended that you always use HTTPS.
- Return type:
- Returns:
Federation record.
SEP 0005: Key Derivation Methods for Stellar Accounts
- class stellar_sdk.sep.mnemonic.StellarMnemonic(language=Language.ENGLISH)[source]
Please use
stellar_sdk.keypair.Keypair.generate_mnemonic_phrase()
andstellar_sdk.keypair.Keypair.from_mnemonic_phrase()
- class stellar_sdk.sep.mnemonic.Language(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
The type of language supported by the mnemonic.
- CHINESE_SIMPLIFIED = 'chinese_simplified'
- CHINESE_TRADITIONAL = 'chinese_traditional'
- ENGLISH = 'english'
- FRENCH = 'french'
- ITALIAN = 'italian'
- JAPANESE = 'japanese'
- KOREAN = 'korean'
- SPANISH = 'spanish'
SEP 0007: URI Scheme to facilitate delegated signing
- class stellar_sdk.sep.stellar_uri.PayStellarUri(destination, amount=None, asset=None, memo=None, callback=None, message=None, network_passphrase=None, origin_domain=None, signature=None)[source]
A request for a payment to be signed.
See SEP-0007
- Parameters:
destination (
str
) – A valid account ID or payment address.amount (
Union
[str
,Decimal
,None
]) – Amount that destination will receive.memo (
Optional
[Memo
]) – A memo to attach to the transaction.callback (
Optional
[str
]) – The uri to post the transaction to after signing.message (
Optional
[str
]) – An message for displaying to the user.network_passphrase (
Optional
[str
]) – The passphrase of the target network.origin_domain (
Optional
[str
]) – A fully qualified domain name that specifies the originating domain of the URI request.signature (
Optional
[str
]) – A base64 encode signature of the hash of the URI request.
- classmethod from_uri(uri)[source]
Parse Stellar Pay URI and generate
PayStellarUri
object.- Parameters:
uri (
str
) – Stellar Pay URI.- Return type:
- Returns:
PayStellarUri
object from uri.
- sign(signer)
Sign the URI.
- class stellar_sdk.sep.stellar_uri.TransactionStellarUri(transaction_envelope, replace=None, callback=None, pubkey=None, message=None, network_passphrase=None, origin_domain=None, signature=None)[source]
A request for a transaction to be signed.
See SEP-0007
- Parameters:
transaction_envelope (
Union
[TransactionEnvelope
,FeeBumpTransactionEnvelope
]) – Transaction waiting to be signed.replace (
Optional
[List
[Replacement
]]) – A value that identifies the fields to be replaced in the xdr using the Txrep (SEP-0011) representation.callback (
Optional
[str
]) – The uri to post the transaction to after signing.pubkey (
Optional
[str
]) – Specify which public key you want the URI handler to sign for.message (
Optional
[str
]) – An message for displaying to the user.network_passphrase (
Optional
[str
]) – The passphrase of the target network.origin_domain (
Optional
[str
]) – A fully qualified domain name that specifies the originating domain of the URI request.signature (
Optional
[str
]) – A base64 encode signature of the hash of the URI request.
- classmethod from_uri(uri, network_passphrase)[source]
Parse Stellar Transaction URI and generate
TransactionStellarUri
object.- Parameters:
- Return type:
- Returns:
TransactionStellarUri
object from uri.
- sign(signer)
Sign the URI.
- class stellar_sdk.sep.stellar_uri.Replacement(txrep_tx_field_name, reference_identifier, hint)[source]
Used to represent a single replacement.
An example:
r1 = Replacement("sourceAccount", "X", "account on which to create the trustline") r2 = Replacement("seqNum", "Y", "sequence for sourceAccount") replacements = [r1, r2]
See SEP-0007
SEP 0010: Stellar Web Authentication
- stellar_sdk.sep.stellar_web_authentication.build_challenge_transaction(server_secret, client_account_id, home_domain, web_auth_domain, network_passphrase, timeout=900, client_domain=None, client_signing_key=None, memo=None)[source]
Returns a valid SEP0010 challenge transaction which you can use for Stellar Web Authentication.
- Parameters:
server_secret (
str
) – secret key for server’s stellar.toml SIGNING_KEY.client_account_id (
str
) – The stellar account (G...
) or muxed account (M...
) that the wallet wishes to authenticate with the server.home_domain (
str
) – The fully qualified domain name of the service requiring authentication (ex."example.com"
).web_auth_domain (
str
) – The fully qualified domain name of the service issuing the challenge.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. (ex."Public Global Stellar Network ; September 2015"
)timeout (
int
) – Challenge duration in seconds (default to 15 minutes).client_domain (
Optional
[str
]) – The domain of the client application requesting authenticationclient_signing_key (
Optional
[str
]) – The stellar account listed as the SIGNING_KEY on the client domain’s TOML filememo (
Optional
[int
]) – The ID memo to attach to the transaction. Not permitted if client_account_id is a muxed account
- Return type:
- Returns:
A base64 encoded string of the raw TransactionEnvelope xdr struct for the transaction.
- stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction(challenge_transaction, server_account_id, home_domains, web_auth_domain, network_passphrase)[source]
Reads a SEP 10 challenge transaction and returns the decoded transaction envelope and client account ID contained within.
It also verifies that transaction is signed by the server.
It does not verify that the transaction has been signed by the client or that any signatures other than the servers on the transaction are valid. Use one of the following functions to completely verify the transaction:
stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_threshold()
stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signers()
- Parameters:
challenge_transaction (
str
) – SEP0010 transaction challenge transaction in base64.server_account_id (
str
) – public key for server’s account.home_domains (
Union
[str
,Iterable
[str
]]) – The home domain that is expected to be included in the first Manage Data operation’s string key. If a list is provided, one of the domain names in the array must match.web_auth_domain (
str
) – The home domain that is expected to be included as the value of the Manage Data operation with the ‘web_auth_domain’ key. If no such operation is included, this parameter is not used.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. (ex."Public Global Stellar Network ; September 2015"
)
- Raises:
InvalidSep10ChallengeError
- if the validation fails, the exception will be thrown.- Return type:
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_threshold(challenge_transaction, server_account_id, home_domains, web_auth_domain, network_passphrase, threshold, signers)[source]
Verifies that for a SEP 10 challenge transaction all signatures on the transaction are accounted for and that the signatures meet a threshold on an account. A transaction is verified if it is signed by the server account, and all other signatures match a signer that has been provided as an argument, and those signatures meet a threshold on the account.
- Parameters:
challenge_transaction (
str
) – SEP0010 transaction challenge transaction in base64.server_account_id (
str
) – public key for server’s account.home_domains (
Union
[str
,Iterable
[str
]]) – The home domain that is expected to be included in the first Manage Data operation’s string key. If a list is provided, one of the domain names in the array must match.web_auth_domain (
str
) – The home domain that is expected to be included as the value of the Manage Data operation with the ‘web_auth_domain’ key. If no such operation is included, this parameter is not used.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. (ex."Public Global Stellar Network ; September 2015"
)threshold (
int
) – The medThreshold on the client account.signers (
Sequence
[Ed25519PublicKeySigner
]) – The signers of client account.
- Raises:
InvalidSep10ChallengeError
: - The transaction is invalid according tostellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()
. - One or more signatures in the transaction are not identifiable as the server account or one of the signers provided in the arguments. - The signatures are all valid but do not meet the threshold.- Return type:
List
[Ed25519PublicKeySigner
]
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signed_by_client_master_key(challenge_transaction, server_account_id, home_domains, web_auth_domain, network_passphrase)[source]
An alias for
stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction()
.- Parameters:
challenge_transaction (
str
) – SEP0010 transaction challenge transaction in base64.server_account_id (
str
) – public key for server’s account.home_domains (
Union
[str
,Iterable
[str
]]) – The home domain that is expected to be included in the first Manage Data operation’s string key. If a list is provided, one of the domain names in the array must match.web_auth_domain (
str
) – The home domain that is expected to be included as the value of the Manage Data operation with the ‘web_auth_domain’ key. If no such operation is included, this parameter is not used.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. (ex."Public Global Stellar Network ; September 2015"
)
- Raises:
InvalidSep10ChallengeError
- if the validation fails, the exception will be thrown.- Return type:
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction_signers(challenge_transaction, server_account_id, home_domains, web_auth_domain, network_passphrase, signers)[source]
Verifies that for a SEP 10 challenge transaction all signatures on the transaction are accounted for. A transaction is verified if it is signed by the server account, and all other signatures match a signer that has been provided as an argument. Additional signers can be provided that do not have a signature, but all signatures must be matched to a signer for verification to succeed. If verification succeeds a list of signers that were found is returned, excluding the server account ID.
- Parameters:
challenge_transaction (
str
) – SEP0010 transaction challenge transaction in base64.server_account_id (
str
) – public key for server’s account.home_domains (
Union
[str
,Iterable
[str
]]) – The home domain that is expected to be included in the first Manage Data operation’s string key. If a list is provided, one of the domain names in the array must match.web_auth_domain (
str
) – The home domain that is expected to be included as the value of the Manage Data operation with the ‘web_auth_domain’ key, if present.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. (ex."Public Global Stellar Network ; September 2015"
)signers (
Sequence
[Ed25519PublicKeySigner
]) – The signers of client account.
- Raises:
InvalidSep10ChallengeError
: - The transaction is invalid according tostellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()
. - One or more signatures in the transaction are not identifiable as the server account or one of the signers provided in the arguments.- Return type:
List
[Ed25519PublicKeySigner
]
- stellar_sdk.sep.stellar_web_authentication.verify_challenge_transaction(challenge_transaction, server_account_id, home_domains, web_auth_domain, network_passphrase)[source]
Verifies if a transaction is a valid SEP0010 v1.2 challenge transaction, if the validation fails, an exception will be thrown.
This function performs the following checks:
verify that transaction sequenceNumber is equal to zero;
verify that transaction source account is equal to the server’s signing key;
verify that transaction has time bounds set, and that current time is between the minimum and maximum bounds;
verify that transaction contains a single Manage Data operation and it’s source account is not null;
verify that transaction envelope has a correct signature by server’s signing key;
verify that transaction envelope has a correct signature by the operation’s source account;
- Parameters:
challenge_transaction (
str
) – SEP0010 transaction challenge transaction in base64.server_account_id (
str
) – public key for server’s account.home_domains (
Union
[str
,Iterable
[str
]]) – The home domain that is expected to be included in the first Manage Data operation’s string key. If a list is provided, one of the domain names in the array must match.web_auth_domain (
str
) – The home domain that is expected to be included as the value of the Manage Data operation with the web_auth_domain key, if present.network_passphrase (
str
) – The network to connect to for verifying and retrieving additional attributes from. (ex."Public Global Stellar Network ; September 2015"
)
- Raises:
InvalidSep10ChallengeError
- if the validation fails, the exception will be thrown.- Return type:
- class stellar_sdk.sep.stellar_web_authentication.ChallengeTransaction(transaction, client_account_id, matched_home_domain, memo=None)[source]
Used to store the results produced by
stellar_sdk.sep.stellar_web_authentication.read_challenge_transaction()
.- Parameters:
transaction (
TransactionEnvelope
) – The TransactionEnvelope parsed from challenge xdr.client_account_id (
str
) – The stellar account that the wallet wishes to authenticate with the server.matched_home_domain (
str
) – The domain name that has been matched.memo (
Optional
[int
]) – The ID memo attached to the transaction
SEP 0011: Txrep: human-readable low-level representation of Stellar transactions
- stellar_sdk.sep.txrep.to_txrep(transaction_envelope)[source]
Generate a human-readable format for Stellar transactions.
MuxAccount is currently not supported.
Txrep is a human-readable representation of Stellar transactions that functions like an assembly language for XDR.
See SEP-0011
- Parameters:
transaction_envelope (
Union
[TransactionEnvelope
,FeeBumpTransactionEnvelope
]) – Transaction envelope object.- Return type:
- Returns:
A human-readable format for Stellar transactions.
- stellar_sdk.sep.txrep.from_txrep(txrep, network_passphrase)[source]
Parse txrep and generate transaction envelope object.
MuxAccount is currently not supported.
Txrep is a human-readable representation of Stellar transactions that functions like an assembly language for XDR.
See SEP-0011
- Parameters:
- Return type:
- Returns:
A human-readable format for Stellar transactions.
SEP 0035: Operation IDs
- class stellar_sdk.sep.toid.TOID(ledger_sequence, transaction_order, operation_order)[source]
TOID represents the total order of Ledgers, Transactions and Operations. This is an implementation of SEP-35: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0035.md
Operations within the stellar network have a total order, expressed by three pieces of information: the ledger sequence the operation was validated in, the order which the operation’s containing transaction was applied in that ledger, and the index of the operation within that parent transaction.
- Parameters:
ledger_sequence (
int
) – The ledger sequence the operation was validated in.transaction_order (
int
) – The order that the transaction was applied within the ledger where it was validated. The application order value starts at 1. The maximum supported number of transactions per operation is 1,048,575.operation_order (
int
) – The index of the operation within that parent transaction. The operation index value starts at 1. The maximum supported number of operations per transaction is 4095.
- classmethod after_ledger(ledger_sequence)[source]
Creates a new toid that represents the ledger time after any contents (e.g. transactions, operations) that occur within the specified ledger.
- increment_operation_order()[source]
Increments the operation order by 1, rolling over to the next ledger if overflow occurs. This allows queries to easily advance a cursor to the next operation.
- Return type:
- Returns:
The current TOID instance.
Exceptions
- class stellar_sdk.sep.exceptions.StellarTomlNotFoundError[source]
If the SEP 0010 toml file not found, the exception will be thrown.
- class stellar_sdk.sep.exceptions.InvalidFederationAddress[source]
If the federation address is invalid, the exception will be thrown.
- class stellar_sdk.sep.exceptions.FederationServerNotFoundError[source]
If the federation address is invalid, the exception will be thrown.
- class stellar_sdk.sep.exceptions.BadFederationResponseError(response)[source]
If the federation address is invalid, the exception will be thrown.
- Parameters:
response – client response
- class stellar_sdk.sep.exceptions.InvalidSep10ChallengeError[source]
If the SEP 0010 validation fails, the exception will be thrown.
- class stellar_sdk.sep.exceptions.AccountRequiresMemoError(message, account_id, operation_index)[source]
AccountRequiresMemoError is raised when a transaction is trying to submit an operation to an account which requires a memo.
This error contains two attributes to help you identify the account requiring the memo and the operation where the account is the destination.
See SEP-0029 for more information.
stellar_sdk.xdr
AccountEntry
- class stellar_sdk.xdr.account_entry.AccountEntry(account_id, balance, seq_num, num_sub_entries, inflation_dest, flags, home_domain, thresholds, signers, ext)[source]
XDR Source Code:
struct AccountEntry { AccountID accountID; // master public key for this account int64 balance; // in stroops SequenceNumber seqNum; // last sequence number used for this account uint32 numSubEntries; // number of sub-entries this account has // drives the reserve AccountID* inflationDest; // Account to vote for during inflation uint32 flags; // see AccountFlags string32 homeDomain; // can be used for reverse federation and memo lookup // fields used for signatures // thresholds stores unsigned bytes: [weight of master|low|medium|high] Thresholds thresholds; Signer signers<MAX_SIGNERS>; // possible signers for this account // reserved for future use union switch (int v) { case 0: void; case 1: AccountEntryExtensionV1 v1; } ext; };
AccountEntryExt
AccountEntryExtensionV1
AccountEntryExtensionV1Ext
AccountEntryExtensionV2
- class stellar_sdk.xdr.account_entry_extension_v2.AccountEntryExtensionV2(num_sponsored, num_sponsoring, signer_sponsoring_i_ds, ext)[source]
XDR Source Code:
struct AccountEntryExtensionV2 { uint32 numSponsored; uint32 numSponsoring; SponsorshipDescriptor signerSponsoringIDs<MAX_SIGNERS>; union switch (int v) { case 0: void; case 3: AccountEntryExtensionV3 v3; } ext; };
AccountEntryExtensionV2Ext
AccountEntryExtensionV3
- class stellar_sdk.xdr.account_entry_extension_v3.AccountEntryExtensionV3(ext, seq_ledger, seq_time)[source]
XDR Source Code:
struct AccountEntryExtensionV3 { // We can use this to add more fields, or because it is first, to // change AccountEntryExtensionV3 into a union. ExtensionPoint ext; // Ledger number at which `seqNum` took on its present value. uint32 seqLedger; // Time at which `seqNum` took on its present value. TimePoint seqTime; };
AccountFlags
- class stellar_sdk.xdr.account_flags.AccountFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum AccountFlags { // masks for each flag // Flags set on issuer accounts // TrustLines are created with authorized set to "false" requiring // the issuer to set it for each TrustLine AUTH_REQUIRED_FLAG = 0x1, // If set, the authorized flag in TrustLines can be cleared // otherwise, authorization cannot be revoked AUTH_REVOCABLE_FLAG = 0x2, // Once set, causes all AUTH_* flags to be read-only AUTH_IMMUTABLE_FLAG = 0x4, // Trustlines are created with clawback enabled set to "true", // and claimable balances created from those trustlines are created // with clawback enabled set to "true" AUTH_CLAWBACK_ENABLED_FLAG = 0x8 };
AccountID
AccountMergeResult
- class stellar_sdk.xdr.account_merge_result.AccountMergeResult(code, source_account_balance=None)[source]
XDR Source Code:
union AccountMergeResult switch (AccountMergeResultCode code) { case ACCOUNT_MERGE_SUCCESS: int64 sourceAccountBalance; // how much got transferred from source account case ACCOUNT_MERGE_MALFORMED: case ACCOUNT_MERGE_NO_ACCOUNT: case ACCOUNT_MERGE_IMMUTABLE_SET: case ACCOUNT_MERGE_HAS_SUB_ENTRIES: case ACCOUNT_MERGE_SEQNUM_TOO_FAR: case ACCOUNT_MERGE_DEST_FULL: case ACCOUNT_MERGE_IS_SPONSOR: void; };
AccountMergeResultCode
- class stellar_sdk.xdr.account_merge_result_code.AccountMergeResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum AccountMergeResultCode { // codes considered as "success" for the operation ACCOUNT_MERGE_SUCCESS = 0, // codes considered as "failure" for the operation ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist ACCOUNT_MERGE_IMMUTABLE_SET = -3, // source account has AUTH_IMMUTABLE set ACCOUNT_MERGE_HAS_SUB_ENTRIES = -4, // account has trust lines/offers ACCOUNT_MERGE_SEQNUM_TOO_FAR = -5, // sequence number is over max allowed ACCOUNT_MERGE_DEST_FULL = -6, // can't add source balance to // destination balance ACCOUNT_MERGE_IS_SPONSOR = -7 // can't merge account that is a sponsor };
AllowTrustOp
AllowTrustResult
- class stellar_sdk.xdr.allow_trust_result.AllowTrustResult(code)[source]
XDR Source Code:
union AllowTrustResult switch (AllowTrustResultCode code) { case ALLOW_TRUST_SUCCESS: void; case ALLOW_TRUST_MALFORMED: case ALLOW_TRUST_NO_TRUST_LINE: case ALLOW_TRUST_TRUST_NOT_REQUIRED: case ALLOW_TRUST_CANT_REVOKE: case ALLOW_TRUST_SELF_NOT_ALLOWED: case ALLOW_TRUST_LOW_RESERVE: void; };
AllowTrustResultCode
- class stellar_sdk.xdr.allow_trust_result_code.AllowTrustResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum AllowTrustResultCode { // codes considered as "success" for the operation ALLOW_TRUST_SUCCESS = 0, // codes considered as "failure" for the operation ALLOW_TRUST_MALFORMED = -1, // asset is not ASSET_TYPE_ALPHANUM ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline // source account does not require trust ALLOW_TRUST_TRUST_NOT_REQUIRED = -3, ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust, ALLOW_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created // on revoke due to low reserves };
AlphaNum12
AlphaNum4
Asset
- class stellar_sdk.xdr.asset.Asset(type, alpha_num4=None, alpha_num12=None)[source]
XDR Source Code:
union Asset switch (AssetType type) { case ASSET_TYPE_NATIVE: // Not credit void; case ASSET_TYPE_CREDIT_ALPHANUM4: AlphaNum4 alphaNum4; case ASSET_TYPE_CREDIT_ALPHANUM12: AlphaNum12 alphaNum12; // add other asset types here in the future };
AssetCode
- class stellar_sdk.xdr.asset_code.AssetCode(type, asset_code4=None, asset_code12=None)[source]
XDR Source Code:
union AssetCode switch (AssetType type) { case ASSET_TYPE_CREDIT_ALPHANUM4: AssetCode4 assetCode4; case ASSET_TYPE_CREDIT_ALPHANUM12: AssetCode12 assetCode12; // add other asset types here in the future };
AssetCode12
AssetCode4
AssetType
Auth
AuthCert
AuthenticatedMessage
AuthenticatedMessageV0
BeginSponsoringFutureReservesOp
BeginSponsoringFutureReservesResult
- class stellar_sdk.xdr.begin_sponsoring_future_reserves_result.BeginSponsoringFutureReservesResult(code)[source]
XDR Source Code:
union BeginSponsoringFutureReservesResult switch ( BeginSponsoringFutureReservesResultCode code) { case BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS: void; case BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED: case BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED: case BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE: void; };
BeginSponsoringFutureReservesResultCode
- class stellar_sdk.xdr.begin_sponsoring_future_reserves_result_code.BeginSponsoringFutureReservesResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum BeginSponsoringFutureReservesResultCode { // codes considered as "success" for the operation BEGIN_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, // codes considered as "failure" for the operation BEGIN_SPONSORING_FUTURE_RESERVES_MALFORMED = -1, BEGIN_SPONSORING_FUTURE_RESERVES_ALREADY_SPONSORED = -2, BEGIN_SPONSORING_FUTURE_RESERVES_RECURSIVE = -3 };
Boolean
BucketEntry
- class stellar_sdk.xdr.bucket_entry.BucketEntry(type, live_entry=None, dead_entry=None, meta_entry=None)[source]
XDR Source Code:
union BucketEntry switch (BucketEntryType type) { case LIVEENTRY: case INITENTRY: LedgerEntry liveEntry; case DEADENTRY: LedgerKey deadEntry; case METAENTRY: BucketMetadata metaEntry; };
BucketEntryType
- class stellar_sdk.xdr.bucket_entry_type.BucketEntryType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum BucketEntryType { METAENTRY = -1, // At-and-after protocol 11: bucket metadata, should come first. LIVEENTRY = 0, // Before protocol 11: created-or-updated; // At-and-after protocol 11: only updated. DEADENTRY = 1, INITENTRY = 2 // At-and-after protocol 11: only created. };
BucketMetadata
BucketMetadataExt
BumpSequenceOp
BumpSequenceResult
BumpSequenceResultCode
- class stellar_sdk.xdr.bump_sequence_result_code.BumpSequenceResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum BumpSequenceResultCode { // codes considered as "success" for the operation BUMP_SEQUENCE_SUCCESS = 0, // codes considered as "failure" for the operation BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds };
ChangeTrustAsset
- class stellar_sdk.xdr.change_trust_asset.ChangeTrustAsset(type, alpha_num4=None, alpha_num12=None, liquidity_pool=None)[source]
XDR Source Code:
union ChangeTrustAsset switch (AssetType type) { case ASSET_TYPE_NATIVE: // Not credit void; case ASSET_TYPE_CREDIT_ALPHANUM4: AlphaNum4 alphaNum4; case ASSET_TYPE_CREDIT_ALPHANUM12: AlphaNum12 alphaNum12; case ASSET_TYPE_POOL_SHARE: LiquidityPoolParameters liquidityPool; // add other asset types here in the future };
ChangeTrustOp
ChangeTrustResult
- class stellar_sdk.xdr.change_trust_result.ChangeTrustResult(code)[source]
XDR Source Code:
union ChangeTrustResult switch (ChangeTrustResultCode code) { case CHANGE_TRUST_SUCCESS: void; case CHANGE_TRUST_MALFORMED: case CHANGE_TRUST_NO_ISSUER: case CHANGE_TRUST_INVALID_LIMIT: case CHANGE_TRUST_LOW_RESERVE: case CHANGE_TRUST_SELF_NOT_ALLOWED: case CHANGE_TRUST_TRUST_LINE_MISSING: case CHANGE_TRUST_CANNOT_DELETE: case CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES: void; };
ChangeTrustResultCode
- class stellar_sdk.xdr.change_trust_result_code.ChangeTrustResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ChangeTrustResultCode { // codes considered as "success" for the operation CHANGE_TRUST_SUCCESS = 0, // codes considered as "failure" for the operation CHANGE_TRUST_MALFORMED = -1, // bad input CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance // cannot create with a limit of 0 CHANGE_TRUST_LOW_RESERVE = -4, // not enough funds to create a new trust line, CHANGE_TRUST_SELF_NOT_ALLOWED = -5, // trusting self is not allowed CHANGE_TRUST_TRUST_LINE_MISSING = -6, // Asset trustline is missing for pool CHANGE_TRUST_CANNOT_DELETE = -7, // Asset trustline is still referenced in a pool CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = -8 // Asset trustline is deauthorized };
ClaimAtom
- class stellar_sdk.xdr.claim_atom.ClaimAtom(type, v0=None, order_book=None, liquidity_pool=None)[source]
XDR Source Code:
union ClaimAtom switch (ClaimAtomType type) { case CLAIM_ATOM_TYPE_V0: ClaimOfferAtomV0 v0; case CLAIM_ATOM_TYPE_ORDER_BOOK: ClaimOfferAtom orderBook; case CLAIM_ATOM_TYPE_LIQUIDITY_POOL: ClaimLiquidityAtom liquidityPool; };
ClaimAtomType
ClaimClaimableBalanceOp
ClaimClaimableBalanceResult
- class stellar_sdk.xdr.claim_claimable_balance_result.ClaimClaimableBalanceResult(code)[source]
XDR Source Code:
union ClaimClaimableBalanceResult switch (ClaimClaimableBalanceResultCode code) { case CLAIM_CLAIMABLE_BALANCE_SUCCESS: void; case CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST: case CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM: case CLAIM_CLAIMABLE_BALANCE_LINE_FULL: case CLAIM_CLAIMABLE_BALANCE_NO_TRUST: case CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED: void; };
ClaimClaimableBalanceResultCode
- class stellar_sdk.xdr.claim_claimable_balance_result_code.ClaimClaimableBalanceResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ClaimClaimableBalanceResultCode { CLAIM_CLAIMABLE_BALANCE_SUCCESS = 0, CLAIM_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, CLAIM_CLAIMABLE_BALANCE_CANNOT_CLAIM = -2, CLAIM_CLAIMABLE_BALANCE_LINE_FULL = -3, CLAIM_CLAIMABLE_BALANCE_NO_TRUST = -4, CLAIM_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -5 };
ClaimLiquidityAtom
- class stellar_sdk.xdr.claim_liquidity_atom.ClaimLiquidityAtom(liquidity_pool_id, asset_sold, amount_sold, asset_bought, amount_bought)[source]
XDR Source Code:
struct ClaimLiquidityAtom { PoolID liquidityPoolID; // amount and asset taken from the pool Asset assetSold; int64 amountSold; // amount and asset sent to the pool Asset assetBought; int64 amountBought; };
ClaimOfferAtom
- class stellar_sdk.xdr.claim_offer_atom.ClaimOfferAtom(seller_id, offer_id, asset_sold, amount_sold, asset_bought, amount_bought)[source]
XDR Source Code:
struct ClaimOfferAtom { // emitted to identify the offer AccountID sellerID; // Account that owns the offer int64 offerID; // amount and asset taken from the owner Asset assetSold; int64 amountSold; // amount and asset sent to the owner Asset assetBought; int64 amountBought; };
ClaimOfferAtomV0
- class stellar_sdk.xdr.claim_offer_atom_v0.ClaimOfferAtomV0(seller_ed25519, offer_id, asset_sold, amount_sold, asset_bought, amount_bought)[source]
XDR Source Code:
struct ClaimOfferAtomV0 { // emitted to identify the offer uint256 sellerEd25519; // Account that owns the offer int64 offerID; // amount and asset taken from the owner Asset assetSold; int64 amountSold; // amount and asset sent to the owner Asset assetBought; int64 amountBought; };
ClaimPredicate
- class stellar_sdk.xdr.claim_predicate.ClaimPredicate(type, and_predicates=None, or_predicates=None, not_predicate=None, abs_before=None, rel_before=None)[source]
XDR Source Code:
union ClaimPredicate switch (ClaimPredicateType type) { case CLAIM_PREDICATE_UNCONDITIONAL: void; case CLAIM_PREDICATE_AND: ClaimPredicate andPredicates<2>; case CLAIM_PREDICATE_OR: ClaimPredicate orPredicates<2>; case CLAIM_PREDICATE_NOT: ClaimPredicate* notPredicate; case CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME: int64 absBefore; // Predicate will be true if closeTime < absBefore case CLAIM_PREDICATE_BEFORE_RELATIVE_TIME: int64 relBefore; // Seconds since closeTime of the ledger in which the // ClaimableBalanceEntry was created };
ClaimPredicateType
- class stellar_sdk.xdr.claim_predicate_type.ClaimPredicateType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ClaimPredicateType { CLAIM_PREDICATE_UNCONDITIONAL = 0, CLAIM_PREDICATE_AND = 1, CLAIM_PREDICATE_OR = 2, CLAIM_PREDICATE_NOT = 3, CLAIM_PREDICATE_BEFORE_ABSOLUTE_TIME = 4, CLAIM_PREDICATE_BEFORE_RELATIVE_TIME = 5 };
ClaimableBalanceEntry
- class stellar_sdk.xdr.claimable_balance_entry.ClaimableBalanceEntry(balance_id, claimants, asset, amount, ext)[source]
XDR Source Code:
struct ClaimableBalanceEntry { // Unique identifier for this ClaimableBalanceEntry ClaimableBalanceID balanceID; // List of claimants with associated predicate Claimant claimants<10>; // Any asset including native Asset asset; // Amount of asset int64 amount; // reserved for future use union switch (int v) { case 0: void; case 1: ClaimableBalanceEntryExtensionV1 v1; } ext; };
ClaimableBalanceEntryExt
ClaimableBalanceEntryExtensionV1
ClaimableBalanceEntryExtensionV1Ext
ClaimableBalanceFlags
- class stellar_sdk.xdr.claimable_balance_flags.ClaimableBalanceFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ClaimableBalanceFlags { // If set, the issuer account of the asset held by the claimable balance may // clawback the claimable balance CLAIMABLE_BALANCE_CLAWBACK_ENABLED_FLAG = 0x1 };
ClaimableBalanceID
ClaimableBalanceIDType
Claimant
ClaimantType
ClaimantV0
ClawbackClaimableBalanceOp
ClawbackClaimableBalanceResult
- class stellar_sdk.xdr.clawback_claimable_balance_result.ClawbackClaimableBalanceResult(code)[source]
XDR Source Code:
union ClawbackClaimableBalanceResult switch ( ClawbackClaimableBalanceResultCode code) { case CLAWBACK_CLAIMABLE_BALANCE_SUCCESS: void; case CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST: case CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER: case CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED: void; };
ClawbackClaimableBalanceResultCode
- class stellar_sdk.xdr.clawback_claimable_balance_result_code.ClawbackClaimableBalanceResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ClawbackClaimableBalanceResultCode { // codes considered as "success" for the operation CLAWBACK_CLAIMABLE_BALANCE_SUCCESS = 0, // codes considered as "failure" for the operation CLAWBACK_CLAIMABLE_BALANCE_DOES_NOT_EXIST = -1, CLAWBACK_CLAIMABLE_BALANCE_NOT_ISSUER = -2, CLAWBACK_CLAIMABLE_BALANCE_NOT_CLAWBACK_ENABLED = -3 };
ClawbackOp
ClawbackResult
ClawbackResultCode
- class stellar_sdk.xdr.clawback_result_code.ClawbackResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ClawbackResultCode { // codes considered as "success" for the operation CLAWBACK_SUCCESS = 0, // codes considered as "failure" for the operation CLAWBACK_MALFORMED = -1, CLAWBACK_NOT_CLAWBACK_ENABLED = -2, CLAWBACK_NO_TRUST = -3, CLAWBACK_UNDERFUNDED = -4 };
ConfigSettingContractBandwidthV0
- class stellar_sdk.xdr.config_setting_contract_bandwidth_v0.ConfigSettingContractBandwidthV0(ledger_max_txs_size_bytes, tx_max_size_bytes, fee_tx_size1_kb)[source]
XDR Source Code:
struct ConfigSettingContractBandwidthV0 { // Maximum sum of all transaction sizes in the ledger in bytes uint32 ledgerMaxTxsSizeBytes; // Maximum size in bytes for a transaction uint32 txMaxSizeBytes; // Fee for 1 KB of transaction size int64 feeTxSize1KB; };
ConfigSettingContractComputeV0
- class stellar_sdk.xdr.config_setting_contract_compute_v0.ConfigSettingContractComputeV0(ledger_max_instructions, tx_max_instructions, fee_rate_per_instructions_increment, tx_memory_limit)[source]
XDR Source Code:
struct ConfigSettingContractComputeV0 { // Maximum instructions per ledger int64 ledgerMaxInstructions; // Maximum instructions per transaction int64 txMaxInstructions; // Cost of 10000 instructions int64 feeRatePerInstructionsIncrement; // Memory limit per transaction. Unlike instructions, there is no fee // for memory, just the limit. uint32 txMemoryLimit; };
ConfigSettingContractEventsV0
- class stellar_sdk.xdr.config_setting_contract_events_v0.ConfigSettingContractEventsV0(tx_max_contract_events_size_bytes, fee_contract_events1_kb)[source]
XDR Source Code:
struct ConfigSettingContractEventsV0 { // Maximum size of events that a contract call can emit. uint32 txMaxContractEventsSizeBytes; // Fee for generating 1KB of contract events. int64 feeContractEvents1KB; };
ConfigSettingContractExecutionLanesV0
ConfigSettingContractHistoricalDataV0
ConfigSettingContractLedgerCostV0
- class stellar_sdk.xdr.config_setting_contract_ledger_cost_v0.ConfigSettingContractLedgerCostV0(ledger_max_read_ledger_entries, ledger_max_read_bytes, ledger_max_write_ledger_entries, ledger_max_write_bytes, tx_max_read_ledger_entries, tx_max_read_bytes, tx_max_write_ledger_entries, tx_max_write_bytes, fee_read_ledger_entry, fee_write_ledger_entry, fee_read1_kb, bucket_list_target_size_bytes, write_fee1_kb_bucket_list_low, write_fee1_kb_bucket_list_high, bucket_list_write_fee_growth_factor)[source]
XDR Source Code:
struct ConfigSettingContractLedgerCostV0 { // Maximum number of ledger entry read operations per ledger uint32 ledgerMaxReadLedgerEntries; // Maximum number of bytes that can be read per ledger uint32 ledgerMaxReadBytes; // Maximum number of ledger entry write operations per ledger uint32 ledgerMaxWriteLedgerEntries; // Maximum number of bytes that can be written per ledger uint32 ledgerMaxWriteBytes; // Maximum number of ledger entry read operations per transaction uint32 txMaxReadLedgerEntries; // Maximum number of bytes that can be read per transaction uint32 txMaxReadBytes; // Maximum number of ledger entry write operations per transaction uint32 txMaxWriteLedgerEntries; // Maximum number of bytes that can be written per transaction uint32 txMaxWriteBytes; int64 feeReadLedgerEntry; // Fee per ledger entry read int64 feeWriteLedgerEntry; // Fee per ledger entry write int64 feeRead1KB; // Fee for reading 1KB // The following parameters determine the write fee per 1KB. // Write fee grows linearly until bucket list reaches this size int64 bucketListTargetSizeBytes; // Fee per 1KB write when the bucket list is empty int64 writeFee1KBBucketListLow; // Fee per 1KB write when the bucket list has reached `bucketListTargetSizeBytes` int64 writeFee1KBBucketListHigh; // Write fee multiplier for any additional data past the first `bucketListTargetSizeBytes` uint32 bucketListWriteFeeGrowthFactor; };
ConfigSettingEntry
- class stellar_sdk.xdr.config_setting_entry.ConfigSettingEntry(config_setting_id, contract_max_size_bytes=None, contract_compute=None, contract_ledger_cost=None, contract_historical_data=None, contract_events=None, contract_bandwidth=None, contract_cost_params_cpu_insns=None, contract_cost_params_mem_bytes=None, contract_data_key_size_bytes=None, contract_data_entry_size_bytes=None, state_archival_settings=None, contract_execution_lanes=None, bucket_list_size_window=None, eviction_iterator=None)[source]
XDR Source Code:
union ConfigSettingEntry switch (ConfigSettingID configSettingID) { case CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES: uint32 contractMaxSizeBytes; case CONFIG_SETTING_CONTRACT_COMPUTE_V0: ConfigSettingContractComputeV0 contractCompute; case CONFIG_SETTING_CONTRACT_LEDGER_COST_V0: ConfigSettingContractLedgerCostV0 contractLedgerCost; case CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0: ConfigSettingContractHistoricalDataV0 contractHistoricalData; case CONFIG_SETTING_CONTRACT_EVENTS_V0: ConfigSettingContractEventsV0 contractEvents; case CONFIG_SETTING_CONTRACT_BANDWIDTH_V0: ConfigSettingContractBandwidthV0 contractBandwidth; case CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS: ContractCostParams contractCostParamsCpuInsns; case CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES: ContractCostParams contractCostParamsMemBytes; case CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES: uint32 contractDataKeySizeBytes; case CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES: uint32 contractDataEntrySizeBytes; case CONFIG_SETTING_STATE_ARCHIVAL: StateArchivalSettings stateArchivalSettings; case CONFIG_SETTING_CONTRACT_EXECUTION_LANES: ConfigSettingContractExecutionLanesV0 contractExecutionLanes; case CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW: uint64 bucketListSizeWindow<>; case CONFIG_SETTING_EVICTION_ITERATOR: EvictionIterator evictionIterator; };
ConfigSettingID
- class stellar_sdk.xdr.config_setting_id.ConfigSettingID(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ConfigSettingID { CONFIG_SETTING_CONTRACT_MAX_SIZE_BYTES = 0, CONFIG_SETTING_CONTRACT_COMPUTE_V0 = 1, CONFIG_SETTING_CONTRACT_LEDGER_COST_V0 = 2, CONFIG_SETTING_CONTRACT_HISTORICAL_DATA_V0 = 3, CONFIG_SETTING_CONTRACT_EVENTS_V0 = 4, CONFIG_SETTING_CONTRACT_BANDWIDTH_V0 = 5, CONFIG_SETTING_CONTRACT_COST_PARAMS_CPU_INSTRUCTIONS = 6, CONFIG_SETTING_CONTRACT_COST_PARAMS_MEMORY_BYTES = 7, CONFIG_SETTING_CONTRACT_DATA_KEY_SIZE_BYTES = 8, CONFIG_SETTING_CONTRACT_DATA_ENTRY_SIZE_BYTES = 9, CONFIG_SETTING_STATE_ARCHIVAL = 10, CONFIG_SETTING_CONTRACT_EXECUTION_LANES = 11, CONFIG_SETTING_BUCKETLIST_SIZE_WINDOW = 12, CONFIG_SETTING_EVICTION_ITERATOR = 13 };
ConfigUpgradeSet
ConfigUpgradeSetKey
ContractCodeEntry
ContractCostParamEntry
ContractCostParams
ContractCostType
- class stellar_sdk.xdr.contract_cost_type.ContractCostType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ContractCostType { // Cost of running 1 wasm instruction WasmInsnExec = 0, // Cost of allocating a slice of memory (in bytes) MemAlloc = 1, // Cost of copying a slice of bytes into a pre-allocated memory MemCpy = 2, // Cost of comparing two slices of memory MemCmp = 3, // Cost of a host function dispatch, not including the actual work done by // the function nor the cost of VM invocation machinary DispatchHostFunction = 4, // Cost of visiting a host object from the host object storage. Exists to // make sure some baseline cost coverage, i.e. repeatly visiting objects // by the guest will always incur some charges. VisitObject = 5, // Cost of serializing an xdr object to bytes ValSer = 6, // Cost of deserializing an xdr object from bytes ValDeser = 7, // Cost of computing the sha256 hash from bytes ComputeSha256Hash = 8, // Cost of computing the ed25519 pubkey from bytes ComputeEd25519PubKey = 9, // Cost of verifying ed25519 signature of a payload. VerifyEd25519Sig = 10, // Cost of instantiation a VM from wasm bytes code. VmInstantiation = 11, // Cost of instantiation a VM from a cached state. VmCachedInstantiation = 12, // Cost of invoking a function on the VM. If the function is a host function, // additional cost will be covered by `DispatchHostFunction`. InvokeVmFunction = 13, // Cost of computing a keccak256 hash from bytes. ComputeKeccak256Hash = 14, // Cost of computing an ECDSA secp256k1 signature from bytes. ComputeEcdsaSecp256k1Sig = 15, // Cost of recovering an ECDSA secp256k1 key from a signature. RecoverEcdsaSecp256k1Key = 16, // Cost of int256 addition (`+`) and subtraction (`-`) operations Int256AddSub = 17, // Cost of int256 multiplication (`*`) operation Int256Mul = 18, // Cost of int256 division (`/`) operation Int256Div = 19, // Cost of int256 power (`exp`) operation Int256Pow = 20, // Cost of int256 shift (`shl`, `shr`) operation Int256Shift = 21, // Cost of drawing random bytes using a ChaCha20 PRNG ChaCha20DrawBytes = 22 };
ContractDataDurability
ContractDataEntry
ContractEvent
- class stellar_sdk.xdr.contract_event.ContractEvent(ext, contract_id, type, body)[source]
XDR Source Code:
struct ContractEvent { // We can use this to add more fields, or because it // is first, to change ContractEvent into a union. ExtensionPoint ext; Hash* contractID; ContractEventType type; union switch (int v) { case 0: struct { SCVal topics<>; SCVal data; } v0; } body; };
ContractEventBody
ContractEventType
ContractEventV0
ContractExecutable
ContractExecutableType
ContractIDPreimage
- class stellar_sdk.xdr.contract_id_preimage.ContractIDPreimage(type, from_address=None, from_asset=None)[source]
XDR Source Code:
union ContractIDPreimage switch (ContractIDPreimageType type) { case CONTRACT_ID_PREIMAGE_FROM_ADDRESS: struct { SCAddress address; uint256 salt; } fromAddress; case CONTRACT_ID_PREIMAGE_FROM_ASSET: Asset fromAsset; };
ContractIDPreimageFromAddress
ContractIDPreimageType
CreateAccountOp
CreateAccountResult
- class stellar_sdk.xdr.create_account_result.CreateAccountResult(code)[source]
XDR Source Code:
union CreateAccountResult switch (CreateAccountResultCode code) { case CREATE_ACCOUNT_SUCCESS: void; case CREATE_ACCOUNT_MALFORMED: case CREATE_ACCOUNT_UNDERFUNDED: case CREATE_ACCOUNT_LOW_RESERVE: case CREATE_ACCOUNT_ALREADY_EXIST: void; };
CreateAccountResultCode
- class stellar_sdk.xdr.create_account_result_code.CreateAccountResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum CreateAccountResultCode { // codes considered as "success" for the operation CREATE_ACCOUNT_SUCCESS = 0, // account was created // codes considered as "failure" for the operation CREATE_ACCOUNT_MALFORMED = -1, // invalid destination CREATE_ACCOUNT_UNDERFUNDED = -2, // not enough funds in source account CREATE_ACCOUNT_LOW_RESERVE = -3, // would create an account below the min reserve CREATE_ACCOUNT_ALREADY_EXIST = -4 // account already exists };
CreateClaimableBalanceOp
CreateClaimableBalanceResult
- class stellar_sdk.xdr.create_claimable_balance_result.CreateClaimableBalanceResult(code, balance_id=None)[source]
XDR Source Code:
union CreateClaimableBalanceResult switch ( CreateClaimableBalanceResultCode code) { case CREATE_CLAIMABLE_BALANCE_SUCCESS: ClaimableBalanceID balanceID; case CREATE_CLAIMABLE_BALANCE_MALFORMED: case CREATE_CLAIMABLE_BALANCE_LOW_RESERVE: case CREATE_CLAIMABLE_BALANCE_NO_TRUST: case CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED: case CREATE_CLAIMABLE_BALANCE_UNDERFUNDED: void; };
CreateClaimableBalanceResultCode
- class stellar_sdk.xdr.create_claimable_balance_result_code.CreateClaimableBalanceResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum CreateClaimableBalanceResultCode { CREATE_CLAIMABLE_BALANCE_SUCCESS = 0, CREATE_CLAIMABLE_BALANCE_MALFORMED = -1, CREATE_CLAIMABLE_BALANCE_LOW_RESERVE = -2, CREATE_CLAIMABLE_BALANCE_NO_TRUST = -3, CREATE_CLAIMABLE_BALANCE_NOT_AUTHORIZED = -4, CREATE_CLAIMABLE_BALANCE_UNDERFUNDED = -5 };
CreateContractArgs
CreatePassiveSellOfferOp
CryptoKeyType
- class stellar_sdk.xdr.crypto_key_type.CryptoKeyType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum CryptoKeyType { KEY_TYPE_ED25519 = 0, KEY_TYPE_PRE_AUTH_TX = 1, KEY_TYPE_HASH_X = 2, KEY_TYPE_ED25519_SIGNED_PAYLOAD = 3, // MUXED enum values for supported type are derived from the enum values // above by ORing them with 0x100 KEY_TYPE_MUXED_ED25519 = 0x100 };
Curve25519Public
Curve25519Secret
DataEntry
DataEntryExt
DataValue
DecoratedSignature
DiagnosticEvent
DontHave
Double
Duration
EncryptedBody
EndSponsoringFutureReservesResult
- class stellar_sdk.xdr.end_sponsoring_future_reserves_result.EndSponsoringFutureReservesResult(code)[source]
XDR Source Code:
union EndSponsoringFutureReservesResult switch ( EndSponsoringFutureReservesResultCode code) { case END_SPONSORING_FUTURE_RESERVES_SUCCESS: void; case END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED: void; };
EndSponsoringFutureReservesResultCode
- class stellar_sdk.xdr.end_sponsoring_future_reserves_result_code.EndSponsoringFutureReservesResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum EndSponsoringFutureReservesResultCode { // codes considered as "success" for the operation END_SPONSORING_FUTURE_RESERVES_SUCCESS = 0, // codes considered as "failure" for the operation END_SPONSORING_FUTURE_RESERVES_NOT_SPONSORED = -1 };
EnvelopeType
- class stellar_sdk.xdr.envelope_type.EnvelopeType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum EnvelopeType { ENVELOPE_TYPE_TX_V0 = 0, ENVELOPE_TYPE_SCP = 1, ENVELOPE_TYPE_TX = 2, ENVELOPE_TYPE_AUTH = 3, ENVELOPE_TYPE_SCPVALUE = 4, ENVELOPE_TYPE_TX_FEE_BUMP = 5, ENVELOPE_TYPE_OP_ID = 6, ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7, ENVELOPE_TYPE_CONTRACT_ID = 8, ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9 };
Error
ErrorCode
- class stellar_sdk.xdr.error_code.ErrorCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ErrorCode { ERR_MISC = 0, // Unspecific error ERR_DATA = 1, // Malformed data ERR_CONF = 2, // Misconfiguration error ERR_AUTH = 3, // Authentication failure ERR_LOAD = 4 // System overloaded };
EvictionIterator
ExtendFootprintTTLOp
ExtendFootprintTTLResult
- class stellar_sdk.xdr.extend_footprint_ttl_result.ExtendFootprintTTLResult(code)[source]
XDR Source Code:
union ExtendFootprintTTLResult switch (ExtendFootprintTTLResultCode code) { case EXTEND_FOOTPRINT_TTL_SUCCESS: void; case EXTEND_FOOTPRINT_TTL_MALFORMED: case EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED: case EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE: void; };
ExtendFootprintTTLResultCode
- class stellar_sdk.xdr.extend_footprint_ttl_result_code.ExtendFootprintTTLResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ExtendFootprintTTLResultCode { // codes considered as "success" for the operation EXTEND_FOOTPRINT_TTL_SUCCESS = 0, // codes considered as "failure" for the operation EXTEND_FOOTPRINT_TTL_MALFORMED = -1, EXTEND_FOOTPRINT_TTL_RESOURCE_LIMIT_EXCEEDED = -2, EXTEND_FOOTPRINT_TTL_INSUFFICIENT_REFUNDABLE_FEE = -3 };
ExtensionPoint
FeeBumpTransaction
- class stellar_sdk.xdr.fee_bump_transaction.FeeBumpTransaction(fee_source, fee, inner_tx, ext)[source]
XDR Source Code:
struct FeeBumpTransaction { MuxedAccount feeSource; int64 fee; union switch (EnvelopeType type) { case ENVELOPE_TYPE_TX: TransactionV1Envelope v1; } innerTx; union switch (int v) { case 0: void; } ext; };
FeeBumpTransactionEnvelope
- class stellar_sdk.xdr.fee_bump_transaction_envelope.FeeBumpTransactionEnvelope(tx, signatures)[source]
XDR Source Code:
struct FeeBumpTransactionEnvelope { FeeBumpTransaction tx; /* Each decorated signature is a signature over the SHA256 hash of * a TransactionSignaturePayload */ DecoratedSignature signatures<20>; };
FeeBumpTransactionExt
FeeBumpTransactionInnerTx
Float
FloodAdvert
FloodDemand
GeneralizedTransactionSet
Hash
HashIDPreimage
- class stellar_sdk.xdr.hash_id_preimage.HashIDPreimage(type, operation_id=None, revoke_id=None, contract_id=None, soroban_authorization=None)[source]
XDR Source Code:
union HashIDPreimage switch (EnvelopeType type) { case ENVELOPE_TYPE_OP_ID: struct { AccountID sourceAccount; SequenceNumber seqNum; uint32 opNum; } operationID; case ENVELOPE_TYPE_POOL_REVOKE_OP_ID: struct { AccountID sourceAccount; SequenceNumber seqNum; uint32 opNum; PoolID liquidityPoolID; Asset asset; } revokeID; case ENVELOPE_TYPE_CONTRACT_ID: struct { Hash networkID; ContractIDPreimage contractIDPreimage; } contractID; case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION: struct { Hash networkID; int64 nonce; uint32 signatureExpirationLedger; SorobanAuthorizedInvocation invocation; } sorobanAuthorization; };
HashIDPreimageContractID
HashIDPreimageOperationID
HashIDPreimageRevokeID
Hello
- class stellar_sdk.xdr.hello.Hello(ledger_version, overlay_version, overlay_min_version, network_id, version_str, listening_port, peer_id, cert, nonce)[source]
XDR Source Code:
struct Hello { uint32 ledgerVersion; uint32 overlayVersion; uint32 overlayMinVersion; Hash networkID; string versionStr<100>; int listeningPort; NodeID peerID; AuthCert cert; uint256 nonce; };
HmacSha256Key
HmacSha256Mac
HostFunction
- class stellar_sdk.xdr.host_function.HostFunction(type, invoke_contract=None, create_contract=None, wasm=None)[source]
XDR Source Code:
union HostFunction switch (HostFunctionType type) { case HOST_FUNCTION_TYPE_INVOKE_CONTRACT: InvokeContractArgs invokeContract; case HOST_FUNCTION_TYPE_CREATE_CONTRACT: CreateContractArgs createContract; case HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM: opaque wasm<>; };
HostFunctionType
- class stellar_sdk.xdr.host_function_type.HostFunctionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum HostFunctionType { HOST_FUNCTION_TYPE_INVOKE_CONTRACT = 0, HOST_FUNCTION_TYPE_CREATE_CONTRACT = 1, HOST_FUNCTION_TYPE_UPLOAD_CONTRACT_WASM = 2 };
Hyper
IPAddrType
InflationPayout
InflationResult
InflationResultCode
- class stellar_sdk.xdr.inflation_result_code.InflationResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum InflationResultCode { // codes considered as "success" for the operation INFLATION_SUCCESS = 0, // codes considered as "failure" for the operation INFLATION_NOT_TIME = -1 };
InnerTransactionResult
- class stellar_sdk.xdr.inner_transaction_result.InnerTransactionResult(fee_charged, result, ext)[source]
XDR Source Code:
struct InnerTransactionResult { // Always 0. Here for binary compatibility. int64 feeCharged; union switch (TransactionResultCode code) { // txFEE_BUMP_INNER_SUCCESS is not included case txSUCCESS: case txFAILED: OperationResult results<>; case txTOO_EARLY: case txTOO_LATE: case txMISSING_OPERATION: case txBAD_SEQ: case txBAD_AUTH: case txINSUFFICIENT_BALANCE: case txNO_ACCOUNT: case txINSUFFICIENT_FEE: case txBAD_AUTH_EXTRA: case txINTERNAL_ERROR: case txNOT_SUPPORTED: // txFEE_BUMP_INNER_FAILED is not included case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: case txSOROBAN_INVALID: void; } result; // reserved for future use union switch (int v) { case 0: void; } ext; };
InnerTransactionResultExt
InnerTransactionResultPair
InnerTransactionResultResult
- class stellar_sdk.xdr.inner_transaction_result_result.InnerTransactionResultResult(code, results=None)[source]
XDR Source Code:
union switch (TransactionResultCode code) { // txFEE_BUMP_INNER_SUCCESS is not included case txSUCCESS: case txFAILED: OperationResult results<>; case txTOO_EARLY: case txTOO_LATE: case txMISSING_OPERATION: case txBAD_SEQ: case txBAD_AUTH: case txINSUFFICIENT_BALANCE: case txNO_ACCOUNT: case txINSUFFICIENT_FEE: case txBAD_AUTH_EXTRA: case txINTERNAL_ERROR: case txNOT_SUPPORTED: // txFEE_BUMP_INNER_FAILED is not included case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: case txSOROBAN_INVALID: void; }
Int128Parts
Int256Parts
Int32
Int64
Integer
InvokeContractArgs
InvokeHostFunctionOp
InvokeHostFunctionResult
- class stellar_sdk.xdr.invoke_host_function_result.InvokeHostFunctionResult(code, success=None)[source]
XDR Source Code:
union InvokeHostFunctionResult switch (InvokeHostFunctionResultCode code) { case INVOKE_HOST_FUNCTION_SUCCESS: Hash success; // sha256(InvokeHostFunctionSuccessPreImage) case INVOKE_HOST_FUNCTION_MALFORMED: case INVOKE_HOST_FUNCTION_TRAPPED: case INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED: case INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED: case INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE: void; };
InvokeHostFunctionResultCode
- class stellar_sdk.xdr.invoke_host_function_result_code.InvokeHostFunctionResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum InvokeHostFunctionResultCode { // codes considered as "success" for the operation INVOKE_HOST_FUNCTION_SUCCESS = 0, // codes considered as "failure" for the operation INVOKE_HOST_FUNCTION_MALFORMED = -1, INVOKE_HOST_FUNCTION_TRAPPED = -2, INVOKE_HOST_FUNCTION_RESOURCE_LIMIT_EXCEEDED = -3, INVOKE_HOST_FUNCTION_ENTRY_ARCHIVED = -4, INVOKE_HOST_FUNCTION_INSUFFICIENT_REFUNDABLE_FEE = -5 };
InvokeHostFunctionSuccessPreImage
LedgerBounds
LedgerCloseMeta
LedgerCloseMetaV0
- class stellar_sdk.xdr.ledger_close_meta_v0.LedgerCloseMetaV0(ledger_header, tx_set, tx_processing, upgrades_processing, scp_info)[source]
XDR Source Code:
struct LedgerCloseMetaV0 { LedgerHeaderHistoryEntry ledgerHeader; // NB: txSet is sorted in "Hash order" TransactionSet txSet; // NB: transactions are sorted in apply order here // fees for all transactions are processed first // followed by applying transactions TransactionResultMeta txProcessing<>; // upgrades are applied last UpgradeEntryMeta upgradesProcessing<>; // other misc information attached to the ledger close SCPHistoryEntry scpInfo<>; };
LedgerCloseMetaV1
- class stellar_sdk.xdr.ledger_close_meta_v1.LedgerCloseMetaV1(ext, ledger_header, tx_set, tx_processing, upgrades_processing, scp_info, total_byte_size_of_bucket_list, evicted_temporary_ledger_keys, evicted_persistent_ledger_entries)[source]
XDR Source Code:
struct LedgerCloseMetaV1 { // We forgot to add an ExtensionPoint in v0 but at least // we can add one now in v1. ExtensionPoint ext; LedgerHeaderHistoryEntry ledgerHeader; GeneralizedTransactionSet txSet; // NB: transactions are sorted in apply order here // fees for all transactions are processed first // followed by applying transactions TransactionResultMeta txProcessing<>; // upgrades are applied last UpgradeEntryMeta upgradesProcessing<>; // other misc information attached to the ledger close SCPHistoryEntry scpInfo<>; // Size in bytes of BucketList, to support downstream // systems calculating storage fees correctly. uint64 totalByteSizeOfBucketList; // Temp keys that are being evicted at this ledger. LedgerKey evictedTemporaryLedgerKeys<>; // Archived restorable ledger entries that are being // evicted at this ledger. LedgerEntry evictedPersistentLedgerEntries<>; };
LedgerCloseValueSignature
LedgerEntry
- class stellar_sdk.xdr.ledger_entry.LedgerEntry(last_modified_ledger_seq, data, ext)[source]
XDR Source Code:
struct LedgerEntry { uint32 lastModifiedLedgerSeq; // ledger the LedgerEntry was last changed union switch (LedgerEntryType type) { case ACCOUNT: AccountEntry account; case TRUSTLINE: TrustLineEntry trustLine; case OFFER: OfferEntry offer; case DATA: DataEntry data; case CLAIMABLE_BALANCE: ClaimableBalanceEntry claimableBalance; case LIQUIDITY_POOL: LiquidityPoolEntry liquidityPool; case CONTRACT_DATA: ContractDataEntry contractData; case CONTRACT_CODE: ContractCodeEntry contractCode; case CONFIG_SETTING: ConfigSettingEntry configSetting; case TTL: TTLEntry ttl; } data; // reserved for future use union switch (int v) { case 0: void; case 1: LedgerEntryExtensionV1 v1; } ext; };
LedgerEntryChange
- class stellar_sdk.xdr.ledger_entry_change.LedgerEntryChange(type, created=None, updated=None, removed=None, state=None)[source]
XDR Source Code:
union LedgerEntryChange switch (LedgerEntryChangeType type) { case LEDGER_ENTRY_CREATED: LedgerEntry created; case LEDGER_ENTRY_UPDATED: LedgerEntry updated; case LEDGER_ENTRY_REMOVED: LedgerKey removed; case LEDGER_ENTRY_STATE: LedgerEntry state; };
LedgerEntryChangeType
- class stellar_sdk.xdr.ledger_entry_change_type.LedgerEntryChangeType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum LedgerEntryChangeType { LEDGER_ENTRY_CREATED = 0, // entry was added to the ledger LEDGER_ENTRY_UPDATED = 1, // entry was modified in the ledger LEDGER_ENTRY_REMOVED = 2, // entry was removed from the ledger LEDGER_ENTRY_STATE = 3 // value of the entry };
LedgerEntryChanges
LedgerEntryData
- class stellar_sdk.xdr.ledger_entry_data.LedgerEntryData(type, account=None, trust_line=None, offer=None, data=None, claimable_balance=None, liquidity_pool=None, contract_data=None, contract_code=None, config_setting=None, ttl=None)[source]
XDR Source Code:
union switch (LedgerEntryType type) { case ACCOUNT: AccountEntry account; case TRUSTLINE: TrustLineEntry trustLine; case OFFER: OfferEntry offer; case DATA: DataEntry data; case CLAIMABLE_BALANCE: ClaimableBalanceEntry claimableBalance; case LIQUIDITY_POOL: LiquidityPoolEntry liquidityPool; case CONTRACT_DATA: ContractDataEntry contractData; case CONTRACT_CODE: ContractCodeEntry contractCode; case CONFIG_SETTING: ConfigSettingEntry configSetting; case TTL: TTLEntry ttl; }
LedgerEntryExt
LedgerEntryExtensionV1
LedgerEntryExtensionV1Ext
LedgerEntryType
- class stellar_sdk.xdr.ledger_entry_type.LedgerEntryType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum LedgerEntryType { ACCOUNT = 0, TRUSTLINE = 1, OFFER = 2, DATA = 3, CLAIMABLE_BALANCE = 4, LIQUIDITY_POOL = 5, CONTRACT_DATA = 6, CONTRACT_CODE = 7, CONFIG_SETTING = 8, TTL = 9 };
LedgerFootprint
LedgerHeader
- class stellar_sdk.xdr.ledger_header.LedgerHeader(ledger_version, previous_ledger_hash, scp_value, tx_set_result_hash, bucket_list_hash, ledger_seq, total_coins, fee_pool, inflation_seq, id_pool, base_fee, base_reserve, max_tx_set_size, skip_list, ext)[source]
XDR Source Code:
struct LedgerHeader { uint32 ledgerVersion; // the protocol version of the ledger Hash previousLedgerHash; // hash of the previous ledger header StellarValue scpValue; // what consensus agreed to Hash txSetResultHash; // the TransactionResultSet that led to this ledger Hash bucketListHash; // hash of the ledger state uint32 ledgerSeq; // sequence number of this ledger int64 totalCoins; // total number of stroops in existence. // 10,000,000 stroops in 1 XLM int64 feePool; // fees burned since last inflation run uint32 inflationSeq; // inflation sequence number uint64 idPool; // last used global ID, used for generating objects uint32 baseFee; // base fee per operation in stroops uint32 baseReserve; // account base reserve in stroops uint32 maxTxSetSize; // maximum size a transaction set can be Hash skipList[4]; // hashes of ledgers in the past. allows you to jump back // in time without walking the chain back ledger by ledger // each slot contains the oldest ledger that is mod of // either 50 5000 50000 or 500000 depending on index // skipList[0] mod(50), skipList[1] mod(5000), etc // reserved for future use union switch (int v) { case 0: void; case 1: LedgerHeaderExtensionV1 v1; } ext; };
LedgerHeaderExt
LedgerHeaderExtensionV1
LedgerHeaderExtensionV1Ext
LedgerHeaderFlags
- class stellar_sdk.xdr.ledger_header_flags.LedgerHeaderFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum LedgerHeaderFlags { DISABLE_LIQUIDITY_POOL_TRADING_FLAG = 0x1, DISABLE_LIQUIDITY_POOL_DEPOSIT_FLAG = 0x2, DISABLE_LIQUIDITY_POOL_WITHDRAWAL_FLAG = 0x4 };
LedgerHeaderHistoryEntry
LedgerHeaderHistoryEntryExt
LedgerKey
- class stellar_sdk.xdr.ledger_key.LedgerKey(type, account=None, trust_line=None, offer=None, data=None, claimable_balance=None, liquidity_pool=None, contract_data=None, contract_code=None, config_setting=None, ttl=None)[source]
XDR Source Code:
union LedgerKey switch (LedgerEntryType type) { case ACCOUNT: struct { AccountID accountID; } account; case TRUSTLINE: struct { AccountID accountID; TrustLineAsset asset; } trustLine; case OFFER: struct { AccountID sellerID; int64 offerID; } offer; case DATA: struct { AccountID accountID; string64 dataName; } data; case CLAIMABLE_BALANCE: struct { ClaimableBalanceID balanceID; } claimableBalance; case LIQUIDITY_POOL: struct { PoolID liquidityPoolID; } liquidityPool; case CONTRACT_DATA: struct { SCAddress contract; SCVal key; ContractDataDurability durability; } contractData; case CONTRACT_CODE: struct { Hash hash; } contractCode; case CONFIG_SETTING: struct { ConfigSettingID configSettingID; } configSetting; case TTL: struct { // Hash of the LedgerKey that is associated with this TTLEntry Hash keyHash; } ttl; };
LedgerKeyAccount
LedgerKeyClaimableBalance
LedgerKeyConfigSetting
LedgerKeyContractCode
LedgerKeyContractData
LedgerKeyData
LedgerKeyLiquidityPool
LedgerKeyOffer
LedgerKeyTrustLine
LedgerKeyTtl
LedgerSCPMessages
LedgerUpgrade
- class stellar_sdk.xdr.ledger_upgrade.LedgerUpgrade(type, new_ledger_version=None, new_base_fee=None, new_max_tx_set_size=None, new_base_reserve=None, new_flags=None, new_config=None, new_max_soroban_tx_set_size=None)[source]
XDR Source Code:
union LedgerUpgrade switch (LedgerUpgradeType type) { case LEDGER_UPGRADE_VERSION: uint32 newLedgerVersion; // update ledgerVersion case LEDGER_UPGRADE_BASE_FEE: uint32 newBaseFee; // update baseFee case LEDGER_UPGRADE_MAX_TX_SET_SIZE: uint32 newMaxTxSetSize; // update maxTxSetSize case LEDGER_UPGRADE_BASE_RESERVE: uint32 newBaseReserve; // update baseReserve case LEDGER_UPGRADE_FLAGS: uint32 newFlags; // update flags case LEDGER_UPGRADE_CONFIG: // Update arbitrary `ConfigSetting` entries identified by the key. ConfigUpgradeSetKey newConfig; case LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE: // Update ConfigSettingContractExecutionLanesV0.ledgerMaxTxCount without // using `LEDGER_UPGRADE_CONFIG`. uint32 newMaxSorobanTxSetSize; };
LedgerUpgradeType
- class stellar_sdk.xdr.ledger_upgrade_type.LedgerUpgradeType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum LedgerUpgradeType { LEDGER_UPGRADE_VERSION = 1, LEDGER_UPGRADE_BASE_FEE = 2, LEDGER_UPGRADE_MAX_TX_SET_SIZE = 3, LEDGER_UPGRADE_BASE_RESERVE = 4, LEDGER_UPGRADE_FLAGS = 5, LEDGER_UPGRADE_CONFIG = 6, LEDGER_UPGRADE_MAX_SOROBAN_TX_SET_SIZE = 7 };
Liabilities
LiquidityPoolConstantProductParameters
- class stellar_sdk.xdr.liquidity_pool_constant_product_parameters.LiquidityPoolConstantProductParameters(asset_a, asset_b, fee)[source]
XDR Source Code:
struct LiquidityPoolConstantProductParameters { Asset assetA; // assetA < assetB Asset assetB; int32 fee; // Fee is in basis points, so the actual rate is (fee/100)% };
LiquidityPoolDepositOp
- class stellar_sdk.xdr.liquidity_pool_deposit_op.LiquidityPoolDepositOp(liquidity_pool_id, max_amount_a, max_amount_b, min_price, max_price)[source]
XDR Source Code:
struct LiquidityPoolDepositOp { PoolID liquidityPoolID; int64 maxAmountA; // maximum amount of first asset to deposit int64 maxAmountB; // maximum amount of second asset to deposit Price minPrice; // minimum depositA/depositB Price maxPrice; // maximum depositA/depositB };
LiquidityPoolDepositResult
- class stellar_sdk.xdr.liquidity_pool_deposit_result.LiquidityPoolDepositResult(code)[source]
XDR Source Code:
union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code) { case LIQUIDITY_POOL_DEPOSIT_SUCCESS: void; case LIQUIDITY_POOL_DEPOSIT_MALFORMED: case LIQUIDITY_POOL_DEPOSIT_NO_TRUST: case LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED: case LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED: case LIQUIDITY_POOL_DEPOSIT_LINE_FULL: case LIQUIDITY_POOL_DEPOSIT_BAD_PRICE: case LIQUIDITY_POOL_DEPOSIT_POOL_FULL: void; };
LiquidityPoolDepositResultCode
- class stellar_sdk.xdr.liquidity_pool_deposit_result_code.LiquidityPoolDepositResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum LiquidityPoolDepositResultCode { // codes considered as "success" for the operation LIQUIDITY_POOL_DEPOSIT_SUCCESS = 0, // codes considered as "failure" for the operation LIQUIDITY_POOL_DEPOSIT_MALFORMED = -1, // bad input LIQUIDITY_POOL_DEPOSIT_NO_TRUST = -2, // no trust line for one of the // assets LIQUIDITY_POOL_DEPOSIT_NOT_AUTHORIZED = -3, // not authorized for one of the // assets LIQUIDITY_POOL_DEPOSIT_UNDERFUNDED = -4, // not enough balance for one of // the assets LIQUIDITY_POOL_DEPOSIT_LINE_FULL = -5, // pool share trust line doesn't // have sufficient limit LIQUIDITY_POOL_DEPOSIT_BAD_PRICE = -6, // deposit price outside bounds LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full };
LiquidityPoolEntry
- class stellar_sdk.xdr.liquidity_pool_entry.LiquidityPoolEntry(liquidity_pool_id, body)[source]
XDR Source Code:
struct LiquidityPoolEntry { PoolID liquidityPoolID; union switch (LiquidityPoolType type) { case LIQUIDITY_POOL_CONSTANT_PRODUCT: struct { LiquidityPoolConstantProductParameters params; int64 reserveA; // amount of A in the pool int64 reserveB; // amount of B in the pool int64 totalPoolShares; // total number of pool shares issued int64 poolSharesTrustLineCount; // number of trust lines for the // associated pool shares } constantProduct; } body; };
LiquidityPoolEntryBody
- class stellar_sdk.xdr.liquidity_pool_entry_body.LiquidityPoolEntryBody(type, constant_product=None)[source]
XDR Source Code:
union switch (LiquidityPoolType type) { case LIQUIDITY_POOL_CONSTANT_PRODUCT: struct { LiquidityPoolConstantProductParameters params; int64 reserveA; // amount of A in the pool int64 reserveB; // amount of B in the pool int64 totalPoolShares; // total number of pool shares issued int64 poolSharesTrustLineCount; // number of trust lines for the // associated pool shares } constantProduct; }
LiquidityPoolEntryConstantProduct
- class stellar_sdk.xdr.liquidity_pool_entry_constant_product.LiquidityPoolEntryConstantProduct(params, reserve_a, reserve_b, total_pool_shares, pool_shares_trust_line_count)[source]
XDR Source Code:
struct { LiquidityPoolConstantProductParameters params; int64 reserveA; // amount of A in the pool int64 reserveB; // amount of B in the pool int64 totalPoolShares; // total number of pool shares issued int64 poolSharesTrustLineCount; // number of trust lines for the // associated pool shares }
LiquidityPoolParameters
LiquidityPoolType
LiquidityPoolWithdrawOp
- class stellar_sdk.xdr.liquidity_pool_withdraw_op.LiquidityPoolWithdrawOp(liquidity_pool_id, amount, min_amount_a, min_amount_b)[source]
XDR Source Code:
struct LiquidityPoolWithdrawOp { PoolID liquidityPoolID; int64 amount; // amount of pool shares to withdraw int64 minAmountA; // minimum amount of first asset to withdraw int64 minAmountB; // minimum amount of second asset to withdraw };
LiquidityPoolWithdrawResult
- class stellar_sdk.xdr.liquidity_pool_withdraw_result.LiquidityPoolWithdrawResult(code)[source]
XDR Source Code:
union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code) { case LIQUIDITY_POOL_WITHDRAW_SUCCESS: void; case LIQUIDITY_POOL_WITHDRAW_MALFORMED: case LIQUIDITY_POOL_WITHDRAW_NO_TRUST: case LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED: case LIQUIDITY_POOL_WITHDRAW_LINE_FULL: case LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM: void; };
LiquidityPoolWithdrawResultCode
- class stellar_sdk.xdr.liquidity_pool_withdraw_result_code.LiquidityPoolWithdrawResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum LiquidityPoolWithdrawResultCode { // codes considered as "success" for the operation LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0, // codes considered as "failure" for the operation LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1, // bad input LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2, // no trust line for one of the // assets LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3, // not enough balance of the // pool share LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4, // would go above limit for one // of the assets LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough };
ManageBuyOfferOp
- class stellar_sdk.xdr.manage_buy_offer_op.ManageBuyOfferOp(selling, buying, buy_amount, price, offer_id)[source]
XDR Source Code:
struct ManageBuyOfferOp { Asset selling; Asset buying; int64 buyAmount; // amount being bought. if set to 0, delete the offer Price price; // price of thing being bought in terms of what you are // selling // 0=create a new offer, otherwise edit an existing offer int64 offerID; };
ManageBuyOfferResult
- class stellar_sdk.xdr.manage_buy_offer_result.ManageBuyOfferResult(code, success=None)[source]
XDR Source Code:
union ManageBuyOfferResult switch (ManageBuyOfferResultCode code) { case MANAGE_BUY_OFFER_SUCCESS: ManageOfferSuccessResult success; case MANAGE_BUY_OFFER_MALFORMED: case MANAGE_BUY_OFFER_SELL_NO_TRUST: case MANAGE_BUY_OFFER_BUY_NO_TRUST: case MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED: case MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED: case MANAGE_BUY_OFFER_LINE_FULL: case MANAGE_BUY_OFFER_UNDERFUNDED: case MANAGE_BUY_OFFER_CROSS_SELF: case MANAGE_BUY_OFFER_SELL_NO_ISSUER: case MANAGE_BUY_OFFER_BUY_NO_ISSUER: case MANAGE_BUY_OFFER_NOT_FOUND: case MANAGE_BUY_OFFER_LOW_RESERVE: void; };
ManageBuyOfferResultCode
- class stellar_sdk.xdr.manage_buy_offer_result_code.ManageBuyOfferResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ManageBuyOfferResultCode { // codes considered as "success" for the operation MANAGE_BUY_OFFER_SUCCESS = 0, // codes considered as "failure" for the operation MANAGE_BUY_OFFER_MALFORMED = -1, // generated offer would be invalid MANAGE_BUY_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling MANAGE_BUY_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying MANAGE_BUY_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell MANAGE_BUY_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy MANAGE_BUY_OFFER_LINE_FULL = -6, // can't receive more of what it's buying MANAGE_BUY_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell MANAGE_BUY_OFFER_CROSS_SELF = -8, // would cross an offer from the same user MANAGE_BUY_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling MANAGE_BUY_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying // update errors MANAGE_BUY_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer MANAGE_BUY_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer };
ManageDataOp
ManageDataResult
- class stellar_sdk.xdr.manage_data_result.ManageDataResult(code)[source]
XDR Source Code:
union ManageDataResult switch (ManageDataResultCode code) { case MANAGE_DATA_SUCCESS: void; case MANAGE_DATA_NOT_SUPPORTED_YET: case MANAGE_DATA_NAME_NOT_FOUND: case MANAGE_DATA_LOW_RESERVE: case MANAGE_DATA_INVALID_NAME: void; };
ManageDataResultCode
- class stellar_sdk.xdr.manage_data_result_code.ManageDataResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ManageDataResultCode { // codes considered as "success" for the operation MANAGE_DATA_SUCCESS = 0, // codes considered as "failure" for the operation MANAGE_DATA_NOT_SUPPORTED_YET = -1, // The network hasn't moved to this protocol change yet MANAGE_DATA_NAME_NOT_FOUND = -2, // Trying to remove a Data Entry that isn't there MANAGE_DATA_LOW_RESERVE = -3, // not enough funds to create a new Data Entry MANAGE_DATA_INVALID_NAME = -4 // Name not a valid string };
ManageOfferEffect
ManageOfferSuccessResult
- class stellar_sdk.xdr.manage_offer_success_result.ManageOfferSuccessResult(offers_claimed, offer)[source]
XDR Source Code:
struct ManageOfferSuccessResult { // offers that got claimed while creating this offer ClaimAtom offersClaimed<>; union switch (ManageOfferEffect effect) { case MANAGE_OFFER_CREATED: case MANAGE_OFFER_UPDATED: OfferEntry offer; case MANAGE_OFFER_DELETED: void; } offer; };
ManageOfferSuccessResultOffer
ManageSellOfferOp
- class stellar_sdk.xdr.manage_sell_offer_op.ManageSellOfferOp(selling, buying, amount, price, offer_id)[source]
XDR Source Code:
struct ManageSellOfferOp { Asset selling; Asset buying; int64 amount; // amount being sold. if set to 0, delete the offer Price price; // price of thing being sold in terms of what you are buying // 0=create a new offer, otherwise edit an existing offer int64 offerID; };
ManageSellOfferResult
- class stellar_sdk.xdr.manage_sell_offer_result.ManageSellOfferResult(code, success=None)[source]
XDR Source Code:
union ManageSellOfferResult switch (ManageSellOfferResultCode code) { case MANAGE_SELL_OFFER_SUCCESS: ManageOfferSuccessResult success; case MANAGE_SELL_OFFER_MALFORMED: case MANAGE_SELL_OFFER_SELL_NO_TRUST: case MANAGE_SELL_OFFER_BUY_NO_TRUST: case MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED: case MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED: case MANAGE_SELL_OFFER_LINE_FULL: case MANAGE_SELL_OFFER_UNDERFUNDED: case MANAGE_SELL_OFFER_CROSS_SELF: case MANAGE_SELL_OFFER_SELL_NO_ISSUER: case MANAGE_SELL_OFFER_BUY_NO_ISSUER: case MANAGE_SELL_OFFER_NOT_FOUND: case MANAGE_SELL_OFFER_LOW_RESERVE: void; };
ManageSellOfferResultCode
- class stellar_sdk.xdr.manage_sell_offer_result_code.ManageSellOfferResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum ManageSellOfferResultCode { // codes considered as "success" for the operation MANAGE_SELL_OFFER_SUCCESS = 0, // codes considered as "failure" for the operation MANAGE_SELL_OFFER_MALFORMED = -1, // generated offer would be invalid MANAGE_SELL_OFFER_SELL_NO_TRUST = -2, // no trust line for what we're selling MANAGE_SELL_OFFER_BUY_NO_TRUST = -3, // no trust line for what we're buying MANAGE_SELL_OFFER_SELL_NOT_AUTHORIZED = -4, // not authorized to sell MANAGE_SELL_OFFER_BUY_NOT_AUTHORIZED = -5, // not authorized to buy MANAGE_SELL_OFFER_LINE_FULL = -6, // can't receive more of what it's buying MANAGE_SELL_OFFER_UNDERFUNDED = -7, // doesn't hold what it's trying to sell MANAGE_SELL_OFFER_CROSS_SELF = -8, // would cross an offer from the same user MANAGE_SELL_OFFER_SELL_NO_ISSUER = -9, // no issuer for what we're selling MANAGE_SELL_OFFER_BUY_NO_ISSUER = -10, // no issuer for what we're buying // update errors MANAGE_SELL_OFFER_NOT_FOUND = -11, // offerID does not match an existing offer MANAGE_SELL_OFFER_LOW_RESERVE = -12 // not enough funds to create a new Offer };
Memo
- class stellar_sdk.xdr.memo.Memo(type, text=None, id=None, hash=None, ret_hash=None)[source]
XDR Source Code:
union Memo switch (MemoType type) { case MEMO_NONE: void; case MEMO_TEXT: string text<28>; case MEMO_ID: uint64 id; case MEMO_HASH: Hash hash; // the hash of what to pull from the content server case MEMO_RETURN: Hash retHash; // the hash of the tx you are rejecting };
MemoType
MessageType
- class stellar_sdk.xdr.message_type.MessageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum MessageType { ERROR_MSG = 0, AUTH = 2, DONT_HAVE = 3, GET_PEERS = 4, // gets a list of peers this guy knows about PEERS = 5, GET_TX_SET = 6, // gets a particular txset by hash TX_SET = 7, GENERALIZED_TX_SET = 17, TRANSACTION = 8, // pass on a tx you have heard about // SCP GET_SCP_QUORUMSET = 9, SCP_QUORUMSET = 10, SCP_MESSAGE = 11, GET_SCP_STATE = 12, // new messages HELLO = 13, SURVEY_REQUEST = 14, SURVEY_RESPONSE = 15, SEND_MORE = 16, SEND_MORE_EXTENDED = 20, FLOOD_ADVERT = 18, FLOOD_DEMAND = 19 };
MuxedAccount
MuxedAccountMed25519
NodeID
OfferEntry
- class stellar_sdk.xdr.offer_entry.OfferEntry(seller_id, offer_id, selling, buying, amount, price, flags, ext)[source]
XDR Source Code:
struct OfferEntry { AccountID sellerID; int64 offerID; Asset selling; // A Asset buying; // B int64 amount; // amount of A /* price for this offer: price of A in terms of B price=AmountB/AmountA=priceNumerator/priceDenominator price is after fees */ Price price; uint32 flags; // see OfferEntryFlags // reserved for future use union switch (int v) { case 0: void; } ext; };
OfferEntryExt
OfferEntryFlags
Opaque
Operation
- class stellar_sdk.xdr.operation.Operation(source_account, body)[source]
XDR Source Code:
struct Operation { // sourceAccount is the account used to run the operation // if not set, the runtime defaults to "sourceAccount" specified at // the transaction level MuxedAccount* sourceAccount; union switch (OperationType type) { case CREATE_ACCOUNT: CreateAccountOp createAccountOp; case PAYMENT: PaymentOp paymentOp; case PATH_PAYMENT_STRICT_RECEIVE: PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; case MANAGE_SELL_OFFER: ManageSellOfferOp manageSellOfferOp; case CREATE_PASSIVE_SELL_OFFER: CreatePassiveSellOfferOp createPassiveSellOfferOp; case SET_OPTIONS: SetOptionsOp setOptionsOp; case CHANGE_TRUST: ChangeTrustOp changeTrustOp; case ALLOW_TRUST: AllowTrustOp allowTrustOp; case ACCOUNT_MERGE: MuxedAccount destination; case INFLATION: void; case MANAGE_DATA: ManageDataOp manageDataOp; case BUMP_SEQUENCE: BumpSequenceOp bumpSequenceOp; case MANAGE_BUY_OFFER: ManageBuyOfferOp manageBuyOfferOp; case PATH_PAYMENT_STRICT_SEND: PathPaymentStrictSendOp pathPaymentStrictSendOp; case CREATE_CLAIMABLE_BALANCE: CreateClaimableBalanceOp createClaimableBalanceOp; case CLAIM_CLAIMABLE_BALANCE: ClaimClaimableBalanceOp claimClaimableBalanceOp; case BEGIN_SPONSORING_FUTURE_RESERVES: BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; case END_SPONSORING_FUTURE_RESERVES: void; case REVOKE_SPONSORSHIP: RevokeSponsorshipOp revokeSponsorshipOp; case CLAWBACK: ClawbackOp clawbackOp; case CLAWBACK_CLAIMABLE_BALANCE: ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; case SET_TRUST_LINE_FLAGS: SetTrustLineFlagsOp setTrustLineFlagsOp; case LIQUIDITY_POOL_DEPOSIT: LiquidityPoolDepositOp liquidityPoolDepositOp; case LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; case INVOKE_HOST_FUNCTION: InvokeHostFunctionOp invokeHostFunctionOp; case EXTEND_FOOTPRINT_TTL: ExtendFootprintTTLOp extendFootprintTTLOp; case RESTORE_FOOTPRINT: RestoreFootprintOp restoreFootprintOp; } body; };
OperationBody
- class stellar_sdk.xdr.operation_body.OperationBody(type, create_account_op=None, payment_op=None, path_payment_strict_receive_op=None, manage_sell_offer_op=None, create_passive_sell_offer_op=None, set_options_op=None, change_trust_op=None, allow_trust_op=None, destination=None, manage_data_op=None, bump_sequence_op=None, manage_buy_offer_op=None, path_payment_strict_send_op=None, create_claimable_balance_op=None, claim_claimable_balance_op=None, begin_sponsoring_future_reserves_op=None, revoke_sponsorship_op=None, clawback_op=None, clawback_claimable_balance_op=None, set_trust_line_flags_op=None, liquidity_pool_deposit_op=None, liquidity_pool_withdraw_op=None, invoke_host_function_op=None, extend_footprint_ttl_op=None, restore_footprint_op=None)[source]
XDR Source Code:
union switch (OperationType type) { case CREATE_ACCOUNT: CreateAccountOp createAccountOp; case PAYMENT: PaymentOp paymentOp; case PATH_PAYMENT_STRICT_RECEIVE: PathPaymentStrictReceiveOp pathPaymentStrictReceiveOp; case MANAGE_SELL_OFFER: ManageSellOfferOp manageSellOfferOp; case CREATE_PASSIVE_SELL_OFFER: CreatePassiveSellOfferOp createPassiveSellOfferOp; case SET_OPTIONS: SetOptionsOp setOptionsOp; case CHANGE_TRUST: ChangeTrustOp changeTrustOp; case ALLOW_TRUST: AllowTrustOp allowTrustOp; case ACCOUNT_MERGE: MuxedAccount destination; case INFLATION: void; case MANAGE_DATA: ManageDataOp manageDataOp; case BUMP_SEQUENCE: BumpSequenceOp bumpSequenceOp; case MANAGE_BUY_OFFER: ManageBuyOfferOp manageBuyOfferOp; case PATH_PAYMENT_STRICT_SEND: PathPaymentStrictSendOp pathPaymentStrictSendOp; case CREATE_CLAIMABLE_BALANCE: CreateClaimableBalanceOp createClaimableBalanceOp; case CLAIM_CLAIMABLE_BALANCE: ClaimClaimableBalanceOp claimClaimableBalanceOp; case BEGIN_SPONSORING_FUTURE_RESERVES: BeginSponsoringFutureReservesOp beginSponsoringFutureReservesOp; case END_SPONSORING_FUTURE_RESERVES: void; case REVOKE_SPONSORSHIP: RevokeSponsorshipOp revokeSponsorshipOp; case CLAWBACK: ClawbackOp clawbackOp; case CLAWBACK_CLAIMABLE_BALANCE: ClawbackClaimableBalanceOp clawbackClaimableBalanceOp; case SET_TRUST_LINE_FLAGS: SetTrustLineFlagsOp setTrustLineFlagsOp; case LIQUIDITY_POOL_DEPOSIT: LiquidityPoolDepositOp liquidityPoolDepositOp; case LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawOp liquidityPoolWithdrawOp; case INVOKE_HOST_FUNCTION: InvokeHostFunctionOp invokeHostFunctionOp; case EXTEND_FOOTPRINT_TTL: ExtendFootprintTTLOp extendFootprintTTLOp; case RESTORE_FOOTPRINT: RestoreFootprintOp restoreFootprintOp; }
OperationMeta
OperationResult
- class stellar_sdk.xdr.operation_result.OperationResult(code, tr=None)[source]
XDR Source Code:
union OperationResult switch (OperationResultCode code) { case opINNER: union switch (OperationType type) { case CREATE_ACCOUNT: CreateAccountResult createAccountResult; case PAYMENT: PaymentResult paymentResult; case PATH_PAYMENT_STRICT_RECEIVE: PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; case MANAGE_SELL_OFFER: ManageSellOfferResult manageSellOfferResult; case CREATE_PASSIVE_SELL_OFFER: ManageSellOfferResult createPassiveSellOfferResult; case SET_OPTIONS: SetOptionsResult setOptionsResult; case CHANGE_TRUST: ChangeTrustResult changeTrustResult; case ALLOW_TRUST: AllowTrustResult allowTrustResult; case ACCOUNT_MERGE: AccountMergeResult accountMergeResult; case INFLATION: InflationResult inflationResult; case MANAGE_DATA: ManageDataResult manageDataResult; case BUMP_SEQUENCE: BumpSequenceResult bumpSeqResult; case MANAGE_BUY_OFFER: ManageBuyOfferResult manageBuyOfferResult; case PATH_PAYMENT_STRICT_SEND: PathPaymentStrictSendResult pathPaymentStrictSendResult; case CREATE_CLAIMABLE_BALANCE: CreateClaimableBalanceResult createClaimableBalanceResult; case CLAIM_CLAIMABLE_BALANCE: ClaimClaimableBalanceResult claimClaimableBalanceResult; case BEGIN_SPONSORING_FUTURE_RESERVES: BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; case END_SPONSORING_FUTURE_RESERVES: EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; case REVOKE_SPONSORSHIP: RevokeSponsorshipResult revokeSponsorshipResult; case CLAWBACK: ClawbackResult clawbackResult; case CLAWBACK_CLAIMABLE_BALANCE: ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; case SET_TRUST_LINE_FLAGS: SetTrustLineFlagsResult setTrustLineFlagsResult; case LIQUIDITY_POOL_DEPOSIT: LiquidityPoolDepositResult liquidityPoolDepositResult; case LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; case INVOKE_HOST_FUNCTION: InvokeHostFunctionResult invokeHostFunctionResult; case EXTEND_FOOTPRINT_TTL: ExtendFootprintTTLResult extendFootprintTTLResult; case RESTORE_FOOTPRINT: RestoreFootprintResult restoreFootprintResult; } tr; case opBAD_AUTH: case opNO_ACCOUNT: case opNOT_SUPPORTED: case opTOO_MANY_SUBENTRIES: case opEXCEEDED_WORK_LIMIT: case opTOO_MANY_SPONSORING: void; };
OperationResultCode
- class stellar_sdk.xdr.operation_result_code.OperationResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum OperationResultCode { opINNER = 0, // inner object result is valid opBAD_AUTH = -1, // too few valid signatures / wrong network opNO_ACCOUNT = -2, // source account was not found opNOT_SUPPORTED = -3, // operation not supported at this time opTOO_MANY_SUBENTRIES = -4, // max number of subentries already reached opEXCEEDED_WORK_LIMIT = -5, // operation did too much work opTOO_MANY_SPONSORING = -6 // account is sponsoring too many entries };
OperationResultTr
- class stellar_sdk.xdr.operation_result_tr.OperationResultTr(type, create_account_result=None, payment_result=None, path_payment_strict_receive_result=None, manage_sell_offer_result=None, create_passive_sell_offer_result=None, set_options_result=None, change_trust_result=None, allow_trust_result=None, account_merge_result=None, inflation_result=None, manage_data_result=None, bump_seq_result=None, manage_buy_offer_result=None, path_payment_strict_send_result=None, create_claimable_balance_result=None, claim_claimable_balance_result=None, begin_sponsoring_future_reserves_result=None, end_sponsoring_future_reserves_result=None, revoke_sponsorship_result=None, clawback_result=None, clawback_claimable_balance_result=None, set_trust_line_flags_result=None, liquidity_pool_deposit_result=None, liquidity_pool_withdraw_result=None, invoke_host_function_result=None, extend_footprint_ttl_result=None, restore_footprint_result=None)[source]
XDR Source Code:
union switch (OperationType type) { case CREATE_ACCOUNT: CreateAccountResult createAccountResult; case PAYMENT: PaymentResult paymentResult; case PATH_PAYMENT_STRICT_RECEIVE: PathPaymentStrictReceiveResult pathPaymentStrictReceiveResult; case MANAGE_SELL_OFFER: ManageSellOfferResult manageSellOfferResult; case CREATE_PASSIVE_SELL_OFFER: ManageSellOfferResult createPassiveSellOfferResult; case SET_OPTIONS: SetOptionsResult setOptionsResult; case CHANGE_TRUST: ChangeTrustResult changeTrustResult; case ALLOW_TRUST: AllowTrustResult allowTrustResult; case ACCOUNT_MERGE: AccountMergeResult accountMergeResult; case INFLATION: InflationResult inflationResult; case MANAGE_DATA: ManageDataResult manageDataResult; case BUMP_SEQUENCE: BumpSequenceResult bumpSeqResult; case MANAGE_BUY_OFFER: ManageBuyOfferResult manageBuyOfferResult; case PATH_PAYMENT_STRICT_SEND: PathPaymentStrictSendResult pathPaymentStrictSendResult; case CREATE_CLAIMABLE_BALANCE: CreateClaimableBalanceResult createClaimableBalanceResult; case CLAIM_CLAIMABLE_BALANCE: ClaimClaimableBalanceResult claimClaimableBalanceResult; case BEGIN_SPONSORING_FUTURE_RESERVES: BeginSponsoringFutureReservesResult beginSponsoringFutureReservesResult; case END_SPONSORING_FUTURE_RESERVES: EndSponsoringFutureReservesResult endSponsoringFutureReservesResult; case REVOKE_SPONSORSHIP: RevokeSponsorshipResult revokeSponsorshipResult; case CLAWBACK: ClawbackResult clawbackResult; case CLAWBACK_CLAIMABLE_BALANCE: ClawbackClaimableBalanceResult clawbackClaimableBalanceResult; case SET_TRUST_LINE_FLAGS: SetTrustLineFlagsResult setTrustLineFlagsResult; case LIQUIDITY_POOL_DEPOSIT: LiquidityPoolDepositResult liquidityPoolDepositResult; case LIQUIDITY_POOL_WITHDRAW: LiquidityPoolWithdrawResult liquidityPoolWithdrawResult; case INVOKE_HOST_FUNCTION: InvokeHostFunctionResult invokeHostFunctionResult; case EXTEND_FOOTPRINT_TTL: ExtendFootprintTTLResult extendFootprintTTLResult; case RESTORE_FOOTPRINT: RestoreFootprintResult restoreFootprintResult; }
OperationType
- class stellar_sdk.xdr.operation_type.OperationType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum OperationType { CREATE_ACCOUNT = 0, PAYMENT = 1, PATH_PAYMENT_STRICT_RECEIVE = 2, MANAGE_SELL_OFFER = 3, CREATE_PASSIVE_SELL_OFFER = 4, SET_OPTIONS = 5, CHANGE_TRUST = 6, ALLOW_TRUST = 7, ACCOUNT_MERGE = 8, INFLATION = 9, MANAGE_DATA = 10, BUMP_SEQUENCE = 11, MANAGE_BUY_OFFER = 12, PATH_PAYMENT_STRICT_SEND = 13, CREATE_CLAIMABLE_BALANCE = 14, CLAIM_CLAIMABLE_BALANCE = 15, BEGIN_SPONSORING_FUTURE_RESERVES = 16, END_SPONSORING_FUTURE_RESERVES = 17, REVOKE_SPONSORSHIP = 18, CLAWBACK = 19, CLAWBACK_CLAIMABLE_BALANCE = 20, SET_TRUST_LINE_FLAGS = 21, LIQUIDITY_POOL_DEPOSIT = 22, LIQUIDITY_POOL_WITHDRAW = 23, INVOKE_HOST_FUNCTION = 24, EXTEND_FOOTPRINT_TTL = 25, RESTORE_FOOTPRINT = 26 };
PathPaymentStrictReceiveOp
- class stellar_sdk.xdr.path_payment_strict_receive_op.PathPaymentStrictReceiveOp(send_asset, send_max, destination, dest_asset, dest_amount, path)[source]
XDR Source Code:
struct PathPaymentStrictReceiveOp { Asset sendAsset; // asset we pay with int64 sendMax; // the maximum amount of sendAsset to // send (excluding fees). // The operation will fail if can't be met MuxedAccount destination; // recipient of the payment Asset destAsset; // what they end up with int64 destAmount; // amount they end up with Asset path<5>; // additional hops it must go through to get there };
PathPaymentStrictReceiveResult
- class stellar_sdk.xdr.path_payment_strict_receive_result.PathPaymentStrictReceiveResult(code, success=None, no_issuer=None)[source]
XDR Source Code:
union PathPaymentStrictReceiveResult switch ( PathPaymentStrictReceiveResultCode code) { case PATH_PAYMENT_STRICT_RECEIVE_SUCCESS: struct { ClaimAtom offers<>; SimplePaymentResult last; } success; case PATH_PAYMENT_STRICT_RECEIVE_MALFORMED: case PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED: case PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST: case PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED: case PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION: case PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST: case PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED: case PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL: void; case PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER: Asset noIssuer; // the asset that caused the error case PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS: case PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF: case PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX: void; };
PathPaymentStrictReceiveResultCode
- class stellar_sdk.xdr.path_payment_strict_receive_result_code.PathPaymentStrictReceiveResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum PathPaymentStrictReceiveResultCode { // codes considered as "success" for the operation PATH_PAYMENT_STRICT_RECEIVE_SUCCESS = 0, // success // codes considered as "failure" for the operation PATH_PAYMENT_STRICT_RECEIVE_MALFORMED = -1, // bad input PATH_PAYMENT_STRICT_RECEIVE_UNDERFUNDED = -2, // not enough funds in source account PATH_PAYMENT_STRICT_RECEIVE_SRC_NO_TRUST = -3, // no trust line on source account PATH_PAYMENT_STRICT_RECEIVE_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer PATH_PAYMENT_STRICT_RECEIVE_NO_DESTINATION = -5, // destination account does not exist PATH_PAYMENT_STRICT_RECEIVE_NO_TRUST = -6, // dest missing a trust line for asset PATH_PAYMENT_STRICT_RECEIVE_NOT_AUTHORIZED = -7, // dest not authorized to hold asset PATH_PAYMENT_STRICT_RECEIVE_LINE_FULL = -8, // dest would go above their limit PATH_PAYMENT_STRICT_RECEIVE_NO_ISSUER = -9, // missing issuer on one asset PATH_PAYMENT_STRICT_RECEIVE_TOO_FEW_OFFERS = -10, // not enough offers to satisfy path PATH_PAYMENT_STRICT_RECEIVE_OFFER_CROSS_SELF = -11, // would cross one of its own offers PATH_PAYMENT_STRICT_RECEIVE_OVER_SENDMAX = -12 // could not satisfy sendmax };
PathPaymentStrictReceiveResultSuccess
PathPaymentStrictSendOp
- class stellar_sdk.xdr.path_payment_strict_send_op.PathPaymentStrictSendOp(send_asset, send_amount, destination, dest_asset, dest_min, path)[source]
XDR Source Code:
struct PathPaymentStrictSendOp { Asset sendAsset; // asset we pay with int64 sendAmount; // amount of sendAsset to send (excluding fees) MuxedAccount destination; // recipient of the payment Asset destAsset; // what they end up with int64 destMin; // the minimum amount of dest asset to // be received // The operation will fail if it can't be met Asset path<5>; // additional hops it must go through to get there };
PathPaymentStrictSendResult
- class stellar_sdk.xdr.path_payment_strict_send_result.PathPaymentStrictSendResult(code, success=None, no_issuer=None)[source]
XDR Source Code:
union PathPaymentStrictSendResult switch (PathPaymentStrictSendResultCode code) { case PATH_PAYMENT_STRICT_SEND_SUCCESS: struct { ClaimAtom offers<>; SimplePaymentResult last; } success; case PATH_PAYMENT_STRICT_SEND_MALFORMED: case PATH_PAYMENT_STRICT_SEND_UNDERFUNDED: case PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST: case PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED: case PATH_PAYMENT_STRICT_SEND_NO_DESTINATION: case PATH_PAYMENT_STRICT_SEND_NO_TRUST: case PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED: case PATH_PAYMENT_STRICT_SEND_LINE_FULL: void; case PATH_PAYMENT_STRICT_SEND_NO_ISSUER: Asset noIssuer; // the asset that caused the error case PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS: case PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF: case PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN: void; };
PathPaymentStrictSendResultCode
- class stellar_sdk.xdr.path_payment_strict_send_result_code.PathPaymentStrictSendResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum PathPaymentStrictSendResultCode { // codes considered as "success" for the operation PATH_PAYMENT_STRICT_SEND_SUCCESS = 0, // success // codes considered as "failure" for the operation PATH_PAYMENT_STRICT_SEND_MALFORMED = -1, // bad input PATH_PAYMENT_STRICT_SEND_UNDERFUNDED = -2, // not enough funds in source account PATH_PAYMENT_STRICT_SEND_SRC_NO_TRUST = -3, // no trust line on source account PATH_PAYMENT_STRICT_SEND_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer PATH_PAYMENT_STRICT_SEND_NO_DESTINATION = -5, // destination account does not exist PATH_PAYMENT_STRICT_SEND_NO_TRUST = -6, // dest missing a trust line for asset PATH_PAYMENT_STRICT_SEND_NOT_AUTHORIZED = -7, // dest not authorized to hold asset PATH_PAYMENT_STRICT_SEND_LINE_FULL = -8, // dest would go above their limit PATH_PAYMENT_STRICT_SEND_NO_ISSUER = -9, // missing issuer on one asset PATH_PAYMENT_STRICT_SEND_TOO_FEW_OFFERS = -10, // not enough offers to satisfy path PATH_PAYMENT_STRICT_SEND_OFFER_CROSS_SELF = -11, // would cross one of its own offers PATH_PAYMENT_STRICT_SEND_UNDER_DESTMIN = -12 // could not satisfy destMin };
PathPaymentStrictSendResultSuccess
PaymentOp
PaymentResult
- class stellar_sdk.xdr.payment_result.PaymentResult(code)[source]
XDR Source Code:
union PaymentResult switch (PaymentResultCode code) { case PAYMENT_SUCCESS: void; case PAYMENT_MALFORMED: case PAYMENT_UNDERFUNDED: case PAYMENT_SRC_NO_TRUST: case PAYMENT_SRC_NOT_AUTHORIZED: case PAYMENT_NO_DESTINATION: case PAYMENT_NO_TRUST: case PAYMENT_NOT_AUTHORIZED: case PAYMENT_LINE_FULL: case PAYMENT_NO_ISSUER: void; };
PaymentResultCode
- class stellar_sdk.xdr.payment_result_code.PaymentResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum PaymentResultCode { // codes considered as "success" for the operation PAYMENT_SUCCESS = 0, // payment successfully completed // codes considered as "failure" for the operation PAYMENT_MALFORMED = -1, // bad input PAYMENT_UNDERFUNDED = -2, // not enough funds in source account PAYMENT_SRC_NO_TRUST = -3, // no trust line on source account PAYMENT_SRC_NOT_AUTHORIZED = -4, // source not authorized to transfer PAYMENT_NO_DESTINATION = -5, // destination account does not exist PAYMENT_NO_TRUST = -6, // destination missing a trust line for asset PAYMENT_NOT_AUTHORIZED = -7, // destination not authorized to hold asset PAYMENT_LINE_FULL = -8, // destination would go above their limit PAYMENT_NO_ISSUER = -9 // missing issuer on asset };
PeerAddress
PeerAddressIp
PeerStatList
PeerStats
- class stellar_sdk.xdr.peer_stats.PeerStats(id, version_str, messages_read, messages_written, bytes_read, bytes_written, seconds_connected, unique_flood_bytes_recv, duplicate_flood_bytes_recv, unique_fetch_bytes_recv, duplicate_fetch_bytes_recv, unique_flood_message_recv, duplicate_flood_message_recv, unique_fetch_message_recv, duplicate_fetch_message_recv)[source]
XDR Source Code:
struct PeerStats { NodeID id; string versionStr<100>; uint64 messagesRead; uint64 messagesWritten; uint64 bytesRead; uint64 bytesWritten; uint64 secondsConnected; uint64 uniqueFloodBytesRecv; uint64 duplicateFloodBytesRecv; uint64 uniqueFetchBytesRecv; uint64 duplicateFetchBytesRecv; uint64 uniqueFloodMessageRecv; uint64 duplicateFloodMessageRecv; uint64 uniqueFetchMessageRecv; uint64 duplicateFetchMessageRecv; };
PersistedSCPState
PersistedSCPStateV0
PersistedSCPStateV1
PoolID
PreconditionType
Preconditions
PreconditionsV2
- class stellar_sdk.xdr.preconditions_v2.PreconditionsV2(time_bounds, ledger_bounds, min_seq_num, min_seq_age, min_seq_ledger_gap, extra_signers)[source]
XDR Source Code:
struct PreconditionsV2 { TimeBounds* timeBounds; // Transaction only valid for ledger numbers n such that // minLedger <= n < maxLedger (if maxLedger == 0, then // only minLedger is checked) LedgerBounds* ledgerBounds; // If NULL, only valid when sourceAccount's sequence number // is seqNum - 1. Otherwise, valid when sourceAccount's // sequence number n satisfies minSeqNum <= n < tx.seqNum. // Note that after execution the account's sequence number // is always raised to tx.seqNum, and a transaction is not // valid if tx.seqNum is too high to ensure replay protection. SequenceNumber* minSeqNum; // For the transaction to be valid, the current ledger time must // be at least minSeqAge greater than sourceAccount's seqTime. Duration minSeqAge; // For the transaction to be valid, the current ledger number // must be at least minSeqLedgerGap greater than sourceAccount's // seqLedger. uint32 minSeqLedgerGap; // For the transaction to be valid, there must be a signature // corresponding to every Signer in this array, even if the // signature is not otherwise required by the sourceAccount or // operations. SignerKey extraSigners<2>; };
Price
PublicKey
PublicKeyType
RestoreFootprintOp
RestoreFootprintResult
- class stellar_sdk.xdr.restore_footprint_result.RestoreFootprintResult(code)[source]
XDR Source Code:
union RestoreFootprintResult switch (RestoreFootprintResultCode code) { case RESTORE_FOOTPRINT_SUCCESS: void; case RESTORE_FOOTPRINT_MALFORMED: case RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED: case RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE: void; };
RestoreFootprintResultCode
- class stellar_sdk.xdr.restore_footprint_result_code.RestoreFootprintResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum RestoreFootprintResultCode { // codes considered as "success" for the operation RESTORE_FOOTPRINT_SUCCESS = 0, // codes considered as "failure" for the operation RESTORE_FOOTPRINT_MALFORMED = -1, RESTORE_FOOTPRINT_RESOURCE_LIMIT_EXCEEDED = -2, RESTORE_FOOTPRINT_INSUFFICIENT_REFUNDABLE_FEE = -3 };
RevokeSponsorshipOp
- class stellar_sdk.xdr.revoke_sponsorship_op.RevokeSponsorshipOp(type, ledger_key=None, signer=None)[source]
XDR Source Code:
union RevokeSponsorshipOp switch (RevokeSponsorshipType type) { case REVOKE_SPONSORSHIP_LEDGER_ENTRY: LedgerKey ledgerKey; case REVOKE_SPONSORSHIP_SIGNER: struct { AccountID accountID; SignerKey signerKey; } signer; };
RevokeSponsorshipOpSigner
RevokeSponsorshipResult
- class stellar_sdk.xdr.revoke_sponsorship_result.RevokeSponsorshipResult(code)[source]
XDR Source Code:
union RevokeSponsorshipResult switch (RevokeSponsorshipResultCode code) { case REVOKE_SPONSORSHIP_SUCCESS: void; case REVOKE_SPONSORSHIP_DOES_NOT_EXIST: case REVOKE_SPONSORSHIP_NOT_SPONSOR: case REVOKE_SPONSORSHIP_LOW_RESERVE: case REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE: case REVOKE_SPONSORSHIP_MALFORMED: void; };
RevokeSponsorshipResultCode
- class stellar_sdk.xdr.revoke_sponsorship_result_code.RevokeSponsorshipResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum RevokeSponsorshipResultCode { // codes considered as "success" for the operation REVOKE_SPONSORSHIP_SUCCESS = 0, // codes considered as "failure" for the operation REVOKE_SPONSORSHIP_DOES_NOT_EXIST = -1, REVOKE_SPONSORSHIP_NOT_SPONSOR = -2, REVOKE_SPONSORSHIP_LOW_RESERVE = -3, REVOKE_SPONSORSHIP_ONLY_TRANSFERABLE = -4, REVOKE_SPONSORSHIP_MALFORMED = -5 };
RevokeSponsorshipType
SCAddress
SCAddressType
SCBytes
SCContractInstance
SCEnvMetaEntry
SCEnvMetaKind
SCError
- class stellar_sdk.xdr.sc_error.SCError(type, contract_code=None, code=None)[source]
XDR Source Code:
union SCError switch (SCErrorType type) { case SCE_CONTRACT: uint32 contractCode; case SCE_WASM_VM: case SCE_CONTEXT: case SCE_STORAGE: case SCE_OBJECT: case SCE_CRYPTO: case SCE_EVENTS: case SCE_BUDGET: case SCE_VALUE: case SCE_AUTH: SCErrorCode code; };
SCErrorCode
- class stellar_sdk.xdr.sc_error_code.SCErrorCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SCErrorCode { SCEC_ARITH_DOMAIN = 0, // Some arithmetic was undefined (overflow, divide-by-zero). SCEC_INDEX_BOUNDS = 1, // Something was indexed beyond its bounds. SCEC_INVALID_INPUT = 2, // User provided some otherwise-bad data. SCEC_MISSING_VALUE = 3, // Some value was required but not provided. SCEC_EXISTING_VALUE = 4, // Some value was provided where not allowed. SCEC_EXCEEDED_LIMIT = 5, // Some arbitrary limit -- gas or otherwise -- was hit. SCEC_INVALID_ACTION = 6, // Data was valid but action requested was not. SCEC_INTERNAL_ERROR = 7, // The host detected an error in its own logic. SCEC_UNEXPECTED_TYPE = 8, // Some type wasn't as expected. SCEC_UNEXPECTED_SIZE = 9 // Something's size wasn't as expected. };
SCErrorType
- class stellar_sdk.xdr.sc_error_type.SCErrorType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SCErrorType { SCE_CONTRACT = 0, // Contract-specific, user-defined codes. SCE_WASM_VM = 1, // Errors while interpreting WASM bytecode. SCE_CONTEXT = 2, // Errors in the contract's host context. SCE_STORAGE = 3, // Errors accessing host storage. SCE_OBJECT = 4, // Errors working with host objects. SCE_CRYPTO = 5, // Errors in cryptographic operations. SCE_EVENTS = 6, // Errors while emitting events. SCE_BUDGET = 7, // Errors relating to budget limits. SCE_VALUE = 8, // Errors working with host values or SCVals. SCE_AUTH = 9 // Errors from the authentication subsystem. };
SCMap
SCMapEntry
SCMetaEntry
SCMetaKind
SCMetaV0
SCNonceKey
SCPBallot
SCPEnvelope
SCPHistoryEntry
SCPHistoryEntryV0
SCPNomination
SCPQuorumSet
SCPStatement
- class stellar_sdk.xdr.scp_statement.SCPStatement(node_id, slot_index, pledges)[source]
XDR Source Code:
struct SCPStatement { NodeID nodeID; // v uint64 slotIndex; // i union switch (SCPStatementType type) { case SCP_ST_PREPARE: struct { Hash quorumSetHash; // D SCPBallot ballot; // b SCPBallot* prepared; // p SCPBallot* preparedPrime; // p' uint32 nC; // c.n uint32 nH; // h.n } prepare; case SCP_ST_CONFIRM: struct { SCPBallot ballot; // b uint32 nPrepared; // p.n uint32 nCommit; // c.n uint32 nH; // h.n Hash quorumSetHash; // D } confirm; case SCP_ST_EXTERNALIZE: struct { SCPBallot commit; // c uint32 nH; // h.n Hash commitQuorumSetHash; // D used before EXTERNALIZE } externalize; case SCP_ST_NOMINATE: SCPNomination nominate; } pledges; };
SCPStatementConfirm
SCPStatementExternalize
SCPStatementPledges
- class stellar_sdk.xdr.scp_statement_pledges.SCPStatementPledges(type, prepare=None, confirm=None, externalize=None, nominate=None)[source]
XDR Source Code:
union switch (SCPStatementType type) { case SCP_ST_PREPARE: struct { Hash quorumSetHash; // D SCPBallot ballot; // b SCPBallot* prepared; // p SCPBallot* preparedPrime; // p' uint32 nC; // c.n uint32 nH; // h.n } prepare; case SCP_ST_CONFIRM: struct { SCPBallot ballot; // b uint32 nPrepared; // p.n uint32 nCommit; // c.n uint32 nH; // h.n Hash quorumSetHash; // D } confirm; case SCP_ST_EXTERNALIZE: struct { SCPBallot commit; // c uint32 nH; // h.n Hash commitQuorumSetHash; // D used before EXTERNALIZE } externalize; case SCP_ST_NOMINATE: SCPNomination nominate; }
SCPStatementPrepare
- class stellar_sdk.xdr.scp_statement_prepare.SCPStatementPrepare(quorum_set_hash, ballot, prepared, prepared_prime, n_c, n_h)[source]
XDR Source Code:
struct { Hash quorumSetHash; // D SCPBallot ballot; // b SCPBallot* prepared; // p SCPBallot* preparedPrime; // p' uint32 nC; // c.n uint32 nH; // h.n }
SCPStatementType
SCSpecEntry
- class stellar_sdk.xdr.sc_spec_entry.SCSpecEntry(kind, function_v0=None, udt_struct_v0=None, udt_union_v0=None, udt_enum_v0=None, udt_error_enum_v0=None)[source]
XDR Source Code:
union SCSpecEntry switch (SCSpecEntryKind kind) { case SC_SPEC_ENTRY_FUNCTION_V0: SCSpecFunctionV0 functionV0; case SC_SPEC_ENTRY_UDT_STRUCT_V0: SCSpecUDTStructV0 udtStructV0; case SC_SPEC_ENTRY_UDT_UNION_V0: SCSpecUDTUnionV0 udtUnionV0; case SC_SPEC_ENTRY_UDT_ENUM_V0: SCSpecUDTEnumV0 udtEnumV0; case SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0: SCSpecUDTErrorEnumV0 udtErrorEnumV0; };
SCSpecEntryKind
- class stellar_sdk.xdr.sc_spec_entry_kind.SCSpecEntryKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SCSpecEntryKind { SC_SPEC_ENTRY_FUNCTION_V0 = 0, SC_SPEC_ENTRY_UDT_STRUCT_V0 = 1, SC_SPEC_ENTRY_UDT_UNION_V0 = 2, SC_SPEC_ENTRY_UDT_ENUM_V0 = 3, SC_SPEC_ENTRY_UDT_ERROR_ENUM_V0 = 4 };
SCSpecFunctionInputV0
SCSpecFunctionV0
SCSpecType
- class stellar_sdk.xdr.sc_spec_type.SCSpecType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SCSpecType { SC_SPEC_TYPE_VAL = 0, // Types with no parameters. SC_SPEC_TYPE_BOOL = 1, SC_SPEC_TYPE_VOID = 2, SC_SPEC_TYPE_ERROR = 3, SC_SPEC_TYPE_U32 = 4, SC_SPEC_TYPE_I32 = 5, SC_SPEC_TYPE_U64 = 6, SC_SPEC_TYPE_I64 = 7, SC_SPEC_TYPE_TIMEPOINT = 8, SC_SPEC_TYPE_DURATION = 9, SC_SPEC_TYPE_U128 = 10, SC_SPEC_TYPE_I128 = 11, SC_SPEC_TYPE_U256 = 12, SC_SPEC_TYPE_I256 = 13, SC_SPEC_TYPE_BYTES = 14, SC_SPEC_TYPE_STRING = 16, SC_SPEC_TYPE_SYMBOL = 17, SC_SPEC_TYPE_ADDRESS = 19, // Types with parameters. SC_SPEC_TYPE_OPTION = 1000, SC_SPEC_TYPE_RESULT = 1001, SC_SPEC_TYPE_VEC = 1002, SC_SPEC_TYPE_MAP = 1004, SC_SPEC_TYPE_TUPLE = 1005, SC_SPEC_TYPE_BYTES_N = 1006, // User defined types. SC_SPEC_TYPE_UDT = 2000 };
SCSpecTypeBytesN
SCSpecTypeDef
- class stellar_sdk.xdr.sc_spec_type_def.SCSpecTypeDef(type, option=None, result=None, vec=None, map=None, tuple=None, bytes_n=None, udt=None)[source]
XDR Source Code:
union SCSpecTypeDef switch (SCSpecType type) { case SC_SPEC_TYPE_VAL: case SC_SPEC_TYPE_BOOL: case SC_SPEC_TYPE_VOID: case SC_SPEC_TYPE_ERROR: case SC_SPEC_TYPE_U32: case SC_SPEC_TYPE_I32: case SC_SPEC_TYPE_U64: case SC_SPEC_TYPE_I64: case SC_SPEC_TYPE_TIMEPOINT: case SC_SPEC_TYPE_DURATION: case SC_SPEC_TYPE_U128: case SC_SPEC_TYPE_I128: case SC_SPEC_TYPE_U256: case SC_SPEC_TYPE_I256: case SC_SPEC_TYPE_BYTES: case SC_SPEC_TYPE_STRING: case SC_SPEC_TYPE_SYMBOL: case SC_SPEC_TYPE_ADDRESS: void; case SC_SPEC_TYPE_OPTION: SCSpecTypeOption option; case SC_SPEC_TYPE_RESULT: SCSpecTypeResult result; case SC_SPEC_TYPE_VEC: SCSpecTypeVec vec; case SC_SPEC_TYPE_MAP: SCSpecTypeMap map; case SC_SPEC_TYPE_TUPLE: SCSpecTypeTuple tuple; case SC_SPEC_TYPE_BYTES_N: SCSpecTypeBytesN bytesN; case SC_SPEC_TYPE_UDT: SCSpecTypeUDT udt; };
SCSpecTypeMap
SCSpecTypeOption
SCSpecTypeResult
SCSpecTypeTuple
SCSpecTypeUDT
SCSpecTypeVec
SCSpecUDTEnumCaseV0
SCSpecUDTEnumV0
SCSpecUDTErrorEnumCaseV0
SCSpecUDTErrorEnumV0
SCSpecUDTStructFieldV0
SCSpecUDTStructV0
SCSpecUDTUnionCaseTupleV0
SCSpecUDTUnionCaseV0
- class stellar_sdk.xdr.sc_spec_udt_union_case_v0.SCSpecUDTUnionCaseV0(kind, void_case=None, tuple_case=None)[source]
XDR Source Code:
union SCSpecUDTUnionCaseV0 switch (SCSpecUDTUnionCaseV0Kind kind) { case SC_SPEC_UDT_UNION_CASE_VOID_V0: SCSpecUDTUnionCaseVoidV0 voidCase; case SC_SPEC_UDT_UNION_CASE_TUPLE_V0: SCSpecUDTUnionCaseTupleV0 tupleCase; };
SCSpecUDTUnionCaseV0Kind
SCSpecUDTUnionCaseVoidV0
SCSpecUDTUnionV0
SCString
SCSymbol
SCVal
- class stellar_sdk.xdr.sc_val.SCVal(type, b=None, error=None, u32=None, i32=None, u64=None, i64=None, timepoint=None, duration=None, u128=None, i128=None, u256=None, i256=None, bytes=None, str=None, sym=None, vec=None, map=None, address=None, nonce_key=None, instance=None)[source]
XDR Source Code:
union SCVal switch (SCValType type) { case SCV_BOOL: bool b; case SCV_VOID: void; case SCV_ERROR: SCError error; case SCV_U32: uint32 u32; case SCV_I32: int32 i32; case SCV_U64: uint64 u64; case SCV_I64: int64 i64; case SCV_TIMEPOINT: TimePoint timepoint; case SCV_DURATION: Duration duration; case SCV_U128: UInt128Parts u128; case SCV_I128: Int128Parts i128; case SCV_U256: UInt256Parts u256; case SCV_I256: Int256Parts i256; case SCV_BYTES: SCBytes bytes; case SCV_STRING: SCString str; case SCV_SYMBOL: SCSymbol sym; // Vec and Map are recursive so need to live // behind an option, due to xdrpp limitations. case SCV_VEC: SCVec *vec; case SCV_MAP: SCMap *map; case SCV_ADDRESS: SCAddress address; // Special SCVals reserved for system-constructed contract-data // ledger keys, not generally usable elsewhere. case SCV_LEDGER_KEY_CONTRACT_INSTANCE: void; case SCV_LEDGER_KEY_NONCE: SCNonceKey nonce_key; case SCV_CONTRACT_INSTANCE: SCContractInstance instance; };
SCValType
- class stellar_sdk.xdr.sc_val_type.SCValType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SCValType { SCV_BOOL = 0, SCV_VOID = 1, SCV_ERROR = 2, // 32 bits is the smallest type in WASM or XDR; no need for u8/u16. SCV_U32 = 3, SCV_I32 = 4, // 64 bits is naturally supported by both WASM and XDR also. SCV_U64 = 5, SCV_I64 = 6, // Time-related u64 subtypes with their own functions and formatting. SCV_TIMEPOINT = 7, SCV_DURATION = 8, // 128 bits is naturally supported by Rust and we use it for Soroban // fixed-point arithmetic prices / balances / similar "quantities". These // are represented in XDR as a pair of 2 u64s. SCV_U128 = 9, SCV_I128 = 10, // 256 bits is the size of sha256 output, ed25519 keys, and the EVM machine // word, so for interop use we include this even though it requires a small // amount of Rust guest and/or host library code. SCV_U256 = 11, SCV_I256 = 12, // Bytes come in 3 flavors, 2 of which have meaningfully different // formatting and validity-checking / domain-restriction. SCV_BYTES = 13, SCV_STRING = 14, SCV_SYMBOL = 15, // Vecs and maps are just polymorphic containers of other ScVals. SCV_VEC = 16, SCV_MAP = 17, // Address is the universal identifier for contracts and classic // accounts. SCV_ADDRESS = 18, // The following are the internal SCVal variants that are not // exposed to the contracts. SCV_CONTRACT_INSTANCE = 19, // SCV_LEDGER_KEY_CONTRACT_INSTANCE and SCV_LEDGER_KEY_NONCE are unique // symbolic SCVals used as the key for ledger entries for a contract's // instance and an address' nonce, respectively. SCV_LEDGER_KEY_CONTRACT_INSTANCE = 20, SCV_LEDGER_KEY_NONCE = 21 };
SCVec
SendMore
SendMoreExtended
SequenceNumber
SetOptionsOp
- class stellar_sdk.xdr.set_options_op.SetOptionsOp(inflation_dest, clear_flags, set_flags, master_weight, low_threshold, med_threshold, high_threshold, home_domain, signer)[source]
XDR Source Code:
struct SetOptionsOp { AccountID* inflationDest; // sets the inflation destination uint32* clearFlags; // which flags to clear uint32* setFlags; // which flags to set // account threshold manipulation uint32* masterWeight; // weight of the master account uint32* lowThreshold; uint32* medThreshold; uint32* highThreshold; string32* homeDomain; // sets the home domain // Add, update or remove a signer for the account // signer is deleted if the weight is 0 Signer* signer; };
SetOptionsResult
- class stellar_sdk.xdr.set_options_result.SetOptionsResult(code)[source]
XDR Source Code:
union SetOptionsResult switch (SetOptionsResultCode code) { case SET_OPTIONS_SUCCESS: void; case SET_OPTIONS_LOW_RESERVE: case SET_OPTIONS_TOO_MANY_SIGNERS: case SET_OPTIONS_BAD_FLAGS: case SET_OPTIONS_INVALID_INFLATION: case SET_OPTIONS_CANT_CHANGE: case SET_OPTIONS_UNKNOWN_FLAG: case SET_OPTIONS_THRESHOLD_OUT_OF_RANGE: case SET_OPTIONS_BAD_SIGNER: case SET_OPTIONS_INVALID_HOME_DOMAIN: case SET_OPTIONS_AUTH_REVOCABLE_REQUIRED: void; };
SetOptionsResultCode
- class stellar_sdk.xdr.set_options_result_code.SetOptionsResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SetOptionsResultCode { // codes considered as "success" for the operation SET_OPTIONS_SUCCESS = 0, // codes considered as "failure" for the operation SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags SET_OPTIONS_INVALID_INFLATION = -4, // inflation account does not exist SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey SET_OPTIONS_INVALID_HOME_DOMAIN = -9, // malformed home domain SET_OPTIONS_AUTH_REVOCABLE_REQUIRED = -10 // auth revocable is required for clawback };
SetTrustLineFlagsOp
SetTrustLineFlagsResult
- class stellar_sdk.xdr.set_trust_line_flags_result.SetTrustLineFlagsResult(code)[source]
XDR Source Code:
union SetTrustLineFlagsResult switch (SetTrustLineFlagsResultCode code) { case SET_TRUST_LINE_FLAGS_SUCCESS: void; case SET_TRUST_LINE_FLAGS_MALFORMED: case SET_TRUST_LINE_FLAGS_NO_TRUST_LINE: case SET_TRUST_LINE_FLAGS_CANT_REVOKE: case SET_TRUST_LINE_FLAGS_INVALID_STATE: case SET_TRUST_LINE_FLAGS_LOW_RESERVE: void; };
SetTrustLineFlagsResultCode
- class stellar_sdk.xdr.set_trust_line_flags_result_code.SetTrustLineFlagsResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SetTrustLineFlagsResultCode { // codes considered as "success" for the operation SET_TRUST_LINE_FLAGS_SUCCESS = 0, // codes considered as "failure" for the operation SET_TRUST_LINE_FLAGS_MALFORMED = -1, SET_TRUST_LINE_FLAGS_NO_TRUST_LINE = -2, SET_TRUST_LINE_FLAGS_CANT_REVOKE = -3, SET_TRUST_LINE_FLAGS_INVALID_STATE = -4, SET_TRUST_LINE_FLAGS_LOW_RESERVE = -5 // claimable balances can't be created // on revoke due to low reserves };
Signature
SignatureHint
SignedSurveyRequestMessage
SignedSurveyResponseMessage
Signer
SignerKey
- class stellar_sdk.xdr.signer_key.SignerKey(type, ed25519=None, pre_auth_tx=None, hash_x=None, ed25519_signed_payload=None)[source]
XDR Source Code:
union SignerKey switch (SignerKeyType type) { case SIGNER_KEY_TYPE_ED25519: uint256 ed25519; case SIGNER_KEY_TYPE_PRE_AUTH_TX: /* SHA-256 Hash of TransactionSignaturePayload structure */ uint256 preAuthTx; case SIGNER_KEY_TYPE_HASH_X: /* Hash of random 256 bit preimage X */ uint256 hashX; case SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD: struct { /* Public key that must sign the payload. */ uint256 ed25519; /* Payload to be raw signed by ed25519. */ opaque payload<64>; } ed25519SignedPayload; };
SignerKeyEd25519SignedPayload
SignerKeyType
- class stellar_sdk.xdr.signer_key_type.SignerKeyType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum SignerKeyType { SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519, SIGNER_KEY_TYPE_PRE_AUTH_TX = KEY_TYPE_PRE_AUTH_TX, SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X, SIGNER_KEY_TYPE_ED25519_SIGNED_PAYLOAD = KEY_TYPE_ED25519_SIGNED_PAYLOAD };
SimplePaymentResult
SorobanAddressCredentials
SorobanCredentials
SorobanCredentialsType
SorobanResources
- class stellar_sdk.xdr.soroban_resources.SorobanResources(footprint, instructions, read_bytes, write_bytes)[source]
XDR Source Code:
struct SorobanResources { // The ledger footprint of the transaction. LedgerFootprint footprint; // The maximum number of instructions this transaction can use uint32 instructions; // The maximum number of bytes this transaction can read from ledger uint32 readBytes; // The maximum number of bytes this transaction can write to ledger uint32 writeBytes; };
SorobanTransactionData
- class stellar_sdk.xdr.soroban_transaction_data.SorobanTransactionData(ext, resources, resource_fee)[source]
XDR Source Code:
struct SorobanTransactionData { ExtensionPoint ext; SorobanResources resources; // Amount of the transaction `fee` allocated to the Soroban resource fees. // The fraction of `resourceFee` corresponding to `resources` specified // above is *not* refundable (i.e. fees for instructions, ledger I/O), as // well as fees for the transaction size. // The remaining part of the fee is refundable and the charged value is // based on the actual consumption of refundable resources (events, ledger // rent bumps). // The `inclusionFee` used for prioritization of the transaction is defined // as `tx.fee - resourceFee`. int64 resourceFee; };
SorobanTransactionMeta
- class stellar_sdk.xdr.soroban_transaction_meta.SorobanTransactionMeta(ext, events, return_value, diagnostic_events)[source]
XDR Source Code:
struct SorobanTransactionMeta { ExtensionPoint ext; ContractEvent events<>; // custom events populated by the // contracts themselves. SCVal returnValue; // return value of the host fn invocation // Diagnostics events that are not hashed. // This will contain all contract and diagnostic events. Even ones // that were emitted in a failed contract call. DiagnosticEvent diagnosticEvents<>; };
SponsorshipDescriptor
StateArchivalSettings
- class stellar_sdk.xdr.state_archival_settings.StateArchivalSettings(max_entry_ttl, min_temporary_ttl, min_persistent_ttl, persistent_rent_rate_denominator, temp_rent_rate_denominator, max_entries_to_archive, bucket_list_size_window_sample_size, eviction_scan_size, starting_eviction_scan_level)[source]
XDR Source Code:
struct StateArchivalSettings { uint32 maxEntryTTL; uint32 minTemporaryTTL; uint32 minPersistentTTL; // rent_fee = wfee_rate_average / rent_rate_denominator_for_type int64 persistentRentRateDenominator; int64 tempRentRateDenominator; // max number of entries that emit archival meta in a single ledger uint32 maxEntriesToArchive; // Number of snapshots to use when calculating average BucketList size uint32 bucketListSizeWindowSampleSize; // Maximum number of bytes that we scan for eviction per ledger uint64 evictionScanSize; // Lowest BucketList level to be scanned to evict entries uint32 startingEvictionScanLevel; };
StellarMessage
- class stellar_sdk.xdr.stellar_message.StellarMessage(type, error=None, hello=None, auth=None, dont_have=None, peers=None, tx_set_hash=None, tx_set=None, generalized_tx_set=None, transaction=None, signed_survey_request_message=None, signed_survey_response_message=None, q_set_hash=None, q_set=None, envelope=None, get_scp_ledger_seq=None, send_more_message=None, send_more_extended_message=None, flood_advert=None, flood_demand=None)[source]
XDR Source Code:
union StellarMessage switch (MessageType type) { case ERROR_MSG: Error error; case HELLO: Hello hello; case AUTH: Auth auth; case DONT_HAVE: DontHave dontHave; case GET_PEERS: void; case PEERS: PeerAddress peers<100>; case GET_TX_SET: uint256 txSetHash; case TX_SET: TransactionSet txSet; case GENERALIZED_TX_SET: GeneralizedTransactionSet generalizedTxSet; case TRANSACTION: TransactionEnvelope transaction; case SURVEY_REQUEST: SignedSurveyRequestMessage signedSurveyRequestMessage; case SURVEY_RESPONSE: SignedSurveyResponseMessage signedSurveyResponseMessage; // SCP case GET_SCP_QUORUMSET: uint256 qSetHash; case SCP_QUORUMSET: SCPQuorumSet qSet; case SCP_MESSAGE: SCPEnvelope envelope; case GET_SCP_STATE: uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest case SEND_MORE: SendMore sendMoreMessage; case SEND_MORE_EXTENDED: SendMoreExtended sendMoreExtendedMessage; // Pull mode case FLOOD_ADVERT: FloodAdvert floodAdvert; case FLOOD_DEMAND: FloodDemand floodDemand; };
StellarValue
- class stellar_sdk.xdr.stellar_value.StellarValue(tx_set_hash, close_time, upgrades, ext)[source]
XDR Source Code:
struct StellarValue { Hash txSetHash; // transaction set to apply to previous ledger TimePoint closeTime; // network close time // upgrades to apply to the previous ledger (usually empty) // this is a vector of encoded 'LedgerUpgrade' so that nodes can drop // unknown steps during consensus if needed. // see notes below on 'LedgerUpgrade' for more detail // max size is dictated by number of upgrade types (+ room for future) UpgradeType upgrades<6>; // reserved for future use union switch (StellarValueType v) { case STELLAR_VALUE_BASIC: void; case STELLAR_VALUE_SIGNED: LedgerCloseValueSignature lcValueSignature; } ext; };
StellarValueExt
StellarValueType
StoredDebugTransactionSet
StoredTransactionSet
String
String32
String64
SurveyMessageCommandType
SurveyMessageResponseType
SurveyRequestMessage
- class stellar_sdk.xdr.survey_request_message.SurveyRequestMessage(surveyor_peer_id, surveyed_peer_id, ledger_num, encryption_key, command_type)[source]
XDR Source Code:
struct SurveyRequestMessage { NodeID surveyorPeerID; NodeID surveyedPeerID; uint32 ledgerNum; Curve25519Public encryptionKey; SurveyMessageCommandType commandType; };
SurveyResponseBody
- class stellar_sdk.xdr.survey_response_body.SurveyResponseBody(type, topology_response_body_v0=None, topology_response_body_v1=None)[source]
XDR Source Code:
union SurveyResponseBody switch (SurveyMessageResponseType type) { case SURVEY_TOPOLOGY_RESPONSE_V0: TopologyResponseBodyV0 topologyResponseBodyV0; case SURVEY_TOPOLOGY_RESPONSE_V1: TopologyResponseBodyV1 topologyResponseBodyV1; };
SurveyResponseMessage
- class stellar_sdk.xdr.survey_response_message.SurveyResponseMessage(surveyor_peer_id, surveyed_peer_id, ledger_num, command_type, encrypted_body)[source]
XDR Source Code:
struct SurveyResponseMessage { NodeID surveyorPeerID; NodeID surveyedPeerID; uint32 ledgerNum; SurveyMessageCommandType commandType; EncryptedBody encryptedBody; };
TTLEntry
ThresholdIndexes
Thresholds
TimeBounds
TimePoint
TopologyResponseBodyV0
- class stellar_sdk.xdr.topology_response_body_v0.TopologyResponseBodyV0(inbound_peers, outbound_peers, total_inbound_peer_count, total_outbound_peer_count)[source]
XDR Source Code:
struct TopologyResponseBodyV0 { PeerStatList inboundPeers; PeerStatList outboundPeers; uint32 totalInboundPeerCount; uint32 totalOutboundPeerCount; };
TopologyResponseBodyV1
- class stellar_sdk.xdr.topology_response_body_v1.TopologyResponseBodyV1(inbound_peers, outbound_peers, total_inbound_peer_count, total_outbound_peer_count, max_inbound_peer_count, max_outbound_peer_count)[source]
XDR Source Code:
struct TopologyResponseBodyV1 { PeerStatList inboundPeers; PeerStatList outboundPeers; uint32 totalInboundPeerCount; uint32 totalOutboundPeerCount; uint32 maxInboundPeerCount; uint32 maxOutboundPeerCount; };
Transaction
- class stellar_sdk.xdr.transaction.Transaction(source_account, fee, seq_num, cond, memo, operations, ext)[source]
XDR Source Code:
struct Transaction { // account used to run the transaction MuxedAccount sourceAccount; // the fee the sourceAccount will pay uint32 fee; // sequence number to consume in the account SequenceNumber seqNum; // validity conditions Preconditions cond; Memo memo; Operation operations<MAX_OPS_PER_TX>; // reserved for future use union switch (int v) { case 0: void; case 1: SorobanTransactionData sorobanData; } ext; };
TransactionEnvelope
- class stellar_sdk.xdr.transaction_envelope.TransactionEnvelope(type, v0=None, v1=None, fee_bump=None)[source]
XDR Source Code:
union TransactionEnvelope switch (EnvelopeType type) { case ENVELOPE_TYPE_TX_V0: TransactionV0Envelope v0; case ENVELOPE_TYPE_TX: TransactionV1Envelope v1; case ENVELOPE_TYPE_TX_FEE_BUMP: FeeBumpTransactionEnvelope feeBump; };
TransactionExt
TransactionHistoryEntry
- class stellar_sdk.xdr.transaction_history_entry.TransactionHistoryEntry(ledger_seq, tx_set, ext)[source]
XDR Source Code:
struct TransactionHistoryEntry { uint32 ledgerSeq; TransactionSet txSet; // when v != 0, txSet must be empty union switch (int v) { case 0: void; case 1: GeneralizedTransactionSet generalizedTxSet; } ext; };
TransactionHistoryEntryExt
TransactionHistoryResultEntry
- class stellar_sdk.xdr.transaction_history_result_entry.TransactionHistoryResultEntry(ledger_seq, tx_result_set, ext)[source]
XDR Source Code:
struct TransactionHistoryResultEntry { uint32 ledgerSeq; TransactionResultSet txResultSet; // reserved for future use union switch (int v) { case 0: void; } ext; };
TransactionHistoryResultEntryExt
TransactionMeta
TransactionMetaV1
TransactionMetaV2
- class stellar_sdk.xdr.transaction_meta_v2.TransactionMetaV2(tx_changes_before, operations, tx_changes_after)[source]
XDR Source Code:
struct TransactionMetaV2 { LedgerEntryChanges txChangesBefore; // tx level changes before operations // are applied if any OperationMeta operations<>; // meta for each operation LedgerEntryChanges txChangesAfter; // tx level changes after operations are // applied if any };
TransactionMetaV3
- class stellar_sdk.xdr.transaction_meta_v3.TransactionMetaV3(ext, tx_changes_before, operations, tx_changes_after, soroban_meta)[source]
XDR Source Code:
struct TransactionMetaV3 { ExtensionPoint ext; LedgerEntryChanges txChangesBefore; // tx level changes before operations // are applied if any OperationMeta operations<>; // meta for each operation LedgerEntryChanges txChangesAfter; // tx level changes after operations are // applied if any SorobanTransactionMeta* sorobanMeta; // Soroban-specific meta (only for // Soroban transactions). };
TransactionPhase
TransactionResult
- class stellar_sdk.xdr.transaction_result.TransactionResult(fee_charged, result, ext)[source]
XDR Source Code:
struct TransactionResult { int64 feeCharged; // actual fee charged for the transaction union switch (TransactionResultCode code) { case txFEE_BUMP_INNER_SUCCESS: case txFEE_BUMP_INNER_FAILED: InnerTransactionResultPair innerResultPair; case txSUCCESS: case txFAILED: OperationResult results<>; case txTOO_EARLY: case txTOO_LATE: case txMISSING_OPERATION: case txBAD_SEQ: case txBAD_AUTH: case txINSUFFICIENT_BALANCE: case txNO_ACCOUNT: case txINSUFFICIENT_FEE: case txBAD_AUTH_EXTRA: case txINTERNAL_ERROR: case txNOT_SUPPORTED: // case txFEE_BUMP_INNER_FAILED: handled above case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: case txSOROBAN_INVALID: void; } result; // reserved for future use union switch (int v) { case 0: void; } ext; };
TransactionResultCode
- class stellar_sdk.xdr.transaction_result_code.TransactionResultCode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum TransactionResultCode { txFEE_BUMP_INNER_SUCCESS = 1, // fee bump inner transaction succeeded txSUCCESS = 0, // all operations succeeded txFAILED = -1, // one of the operations failed (none were applied) txTOO_EARLY = -2, // ledger closeTime before minTime txTOO_LATE = -3, // ledger closeTime after maxTime txMISSING_OPERATION = -4, // no operation was specified txBAD_SEQ = -5, // sequence number does not match source account txBAD_AUTH = -6, // too few valid signatures / wrong network txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve txNO_ACCOUNT = -8, // source account not found txINSUFFICIENT_FEE = -9, // fee is too small txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction txINTERNAL_ERROR = -11, // an unknown error occurred txNOT_SUPPORTED = -12, // transaction type not supported txFEE_BUMP_INNER_FAILED = -13, // fee bump inner transaction failed txBAD_SPONSORSHIP = -14, // sponsorship not confirmed txBAD_MIN_SEQ_AGE_OR_GAP = -15, // minSeqAge or minSeqLedgerGap conditions not met txMALFORMED = -16, // precondition is invalid txSOROBAN_INVALID = -17 // soroban-specific preconditions were not met };
TransactionResultExt
TransactionResultMeta
TransactionResultPair
TransactionResultResult
- class stellar_sdk.xdr.transaction_result_result.TransactionResultResult(code, inner_result_pair=None, results=None)[source]
XDR Source Code:
union switch (TransactionResultCode code) { case txFEE_BUMP_INNER_SUCCESS: case txFEE_BUMP_INNER_FAILED: InnerTransactionResultPair innerResultPair; case txSUCCESS: case txFAILED: OperationResult results<>; case txTOO_EARLY: case txTOO_LATE: case txMISSING_OPERATION: case txBAD_SEQ: case txBAD_AUTH: case txINSUFFICIENT_BALANCE: case txNO_ACCOUNT: case txINSUFFICIENT_FEE: case txBAD_AUTH_EXTRA: case txINTERNAL_ERROR: case txNOT_SUPPORTED: // case txFEE_BUMP_INNER_FAILED: handled above case txBAD_SPONSORSHIP: case txBAD_MIN_SEQ_AGE_OR_GAP: case txMALFORMED: case txSOROBAN_INVALID: void; }
TransactionResultSet
TransactionSet
TransactionSetV1
TransactionSignaturePayload
- class stellar_sdk.xdr.transaction_signature_payload.TransactionSignaturePayload(network_id, tagged_transaction)[source]
XDR Source Code:
struct TransactionSignaturePayload { Hash networkId; union switch (EnvelopeType type) { // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 case ENVELOPE_TYPE_TX: Transaction tx; case ENVELOPE_TYPE_TX_FEE_BUMP: FeeBumpTransaction feeBump; } taggedTransaction; };
TransactionSignaturePayloadTaggedTransaction
- class stellar_sdk.xdr.transaction_signature_payload_tagged_transaction.TransactionSignaturePayloadTaggedTransaction(type, tx=None, fee_bump=None)[source]
XDR Source Code:
union switch (EnvelopeType type) { // Backwards Compatibility: Use ENVELOPE_TYPE_TX to sign ENVELOPE_TYPE_TX_V0 case ENVELOPE_TYPE_TX: Transaction tx; case ENVELOPE_TYPE_TX_FEE_BUMP: FeeBumpTransaction feeBump; }
TransactionV0
- class stellar_sdk.xdr.transaction_v0.TransactionV0(source_account_ed25519, fee, seq_num, time_bounds, memo, operations, ext)[source]
XDR Source Code:
struct TransactionV0 { uint256 sourceAccountEd25519; uint32 fee; SequenceNumber seqNum; TimeBounds* timeBounds; Memo memo; Operation operations<MAX_OPS_PER_TX>; union switch (int v) { case 0: void; } ext; };
TransactionV0Envelope
TransactionV0Ext
TransactionV1Envelope
TrustLineAsset
- class stellar_sdk.xdr.trust_line_asset.TrustLineAsset(type, alpha_num4=None, alpha_num12=None, liquidity_pool_id=None)[source]
XDR Source Code:
union TrustLineAsset switch (AssetType type) { case ASSET_TYPE_NATIVE: // Not credit void; case ASSET_TYPE_CREDIT_ALPHANUM4: AlphaNum4 alphaNum4; case ASSET_TYPE_CREDIT_ALPHANUM12: AlphaNum12 alphaNum12; case ASSET_TYPE_POOL_SHARE: PoolID liquidityPoolID; // add other asset types here in the future };
TrustLineEntry
- class stellar_sdk.xdr.trust_line_entry.TrustLineEntry(account_id, asset, balance, limit, flags, ext)[source]
XDR Source Code:
struct TrustLineEntry { AccountID accountID; // account this trustline belongs to TrustLineAsset asset; // type of asset (with issuer) int64 balance; // how much of this asset the user has. // Asset defines the unit for this; int64 limit; // balance cannot be above this uint32 flags; // see TrustLineFlags // reserved for future use union switch (int v) { case 0: void; case 1: struct { Liabilities liabilities; union switch (int v) { case 0: void; case 2: TrustLineEntryExtensionV2 v2; } ext; } v1; } ext; };
TrustLineEntryExt
TrustLineEntryExtensionV2
TrustLineEntryExtensionV2Ext
TrustLineEntryV1
TrustLineEntryV1Ext
TrustLineFlags
- class stellar_sdk.xdr.trust_line_flags.TrustLineFlags(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum TrustLineFlags { // issuer has authorized account to perform transactions with its credit AUTHORIZED_FLAG = 1, // issuer has authorized account to maintain and reduce liabilities for its // credit AUTHORIZED_TO_MAINTAIN_LIABILITIES_FLAG = 2, // issuer has specified that it may clawback its credit, and that claimable // balances created with its credit may also be clawed back TRUSTLINE_CLAWBACK_ENABLED_FLAG = 4 };
TxAdvertVector
TxDemandVector
TxSetComponent
TxSetComponentTxsMaybeDiscountedFee
TxSetComponentType
- class stellar_sdk.xdr.tx_set_component_type.TxSetComponentType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]
XDR Source Code:
enum TxSetComponentType { // txs with effective fee <= bid derived from a base fee (if any). // If base fee is not specified, no discount is applied. TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0 };
UInt128Parts
UInt256Parts
Uint256
Uint32
Uint64
UnsignedHyper
UnsignedInteger
UpgradeEntryMeta
UpgradeType
Value
Constants
- stellar_sdk.xdr.constants.AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED: int = 200
const AUTH_MSG_FLAG_FLOW_CONTROL_BYTES_REQUESTED = 200;
- stellar_sdk.xdr.constants.CONTRACT_COST_COUNT_LIMIT: int = 1024
const CONTRACT_COST_COUNT_LIMIT = 1024;
- stellar_sdk.xdr.constants.MASK_CLAIMABLE_BALANCE_FLAGS: int = 1
const MASK_CLAIMABLE_BALANCE_FLAGS = 0x1;