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.raw_data (
Optional
[Dict
[str
,Any
]]) – Raw horizon response data.
- 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"
)- Return type
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(cls, 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(cls)[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
- 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
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
- 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
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
- 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
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
- 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
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
- 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
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
- 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
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
- 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
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 (
Optional
[int
]) – lower time boundary represented as millis since epochend_time (
Optional
[int
]) – upper time boundary represented as millis since epochoffset (
Optional
[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
- 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
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_pools"
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
- 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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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
- 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
- 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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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
- 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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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
- 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
- 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
- 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
- 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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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 (
Optional
[int
]) – lower time boundary represented as millis since epochend_time (
Optional
[int
]) – upper time boundary represented as millis since epochoffset (
Optional
[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
- 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
- Return type
AsyncGenerator
[Dict
[str
,Any
],None
]- Returns
an EventSource.
- Raise
StreamClientError
- Failed to fetch stream resource.
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_pools"
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
- 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
- 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 async stream(url, params=None)[source]¶
Creates an EventSource that listens for incoming messages from the server.
See MDN EventSource
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 requestspost_timeout (
float
) – the timeout for all POST requestsbackoff_factor (
float
) – a backoff factor to apply between attempts after the second trysession (
Optional
[Session
]) – the request sessionstream_session (
Optional
[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 (
Optional
[SigningKey
]) – The signing (private) Ed25519 key in the keypair.
- classmethod from_mnemonic_phrase(cls, 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(cls, 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(cls, raw_public_key)[source]¶
Generate a
Keypair
object from ed25519 public key raw bytes.
- classmethod from_raw_ed25519_seed(cls, raw_seed)[source]¶
Generate a
Keypair
object from ed25519 secret key seed raw bytes.
- classmethod from_secret(cls, 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- Return type
- Returns
public key
- property secret: str¶
Returns secret key associated with this
Keypair
object- Return type
- 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(cls, 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.
- Return type
- 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(cls, 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(cls, 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: Optional[str]¶
Get the multiplex address starting with
M
, returnNone
if account_id_id isNone
.
- classmethod from_account(cls, 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(cls, 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"
)- Return type
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"
)
- PUBLIC_NETWORK_PASSPHRASE: str = 'Public Global Stellar Network ; September 2015'¶
The Public 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(cls, 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(cls, 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(cls, xdr_object)[source]¶
Creates a
AllowTrust
object from an XDR Operation object.- Return type
- class stellar_sdk.operation.allow_trust.TrustLineEntryFlag(value)[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(cls, 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(cls, 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(cls, 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(cls, 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(cls, 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(cls, 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(cls, 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(cls, 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(cls, 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 (
List
[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(cls, 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 (
List
[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(cls, 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 (
Optional
[str
]) – Account of the inflation destination.clear_flags (
Union
[int
,AuthorizationFlag
,None
]) –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
,None
]) –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 (
Optional
[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 (
Optional
[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 (
Optional
[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 (
Optional
[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 (
Optional
[str
]) – sets the home domain used for reverse federation lookup.signer (
Optional
[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(cls, xdr_object)[source]¶
Creates a
SetOptions
object from an XDR Operation object.- Return type
- class stellar_sdk.operation.set_options.AuthorizationFlag(value)[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(cls, 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 (
Optional
[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(cls, 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(cls, 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(cls, 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(cls, predicate)[source]¶
Returns a not claim predicate.
- Parameters
predicate (
ClaimPredicate
) – a ClaimPredicate.- Return type
- Returns
a not claim predicate.
- classmethod predicate_or(cls, 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)[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(cls, 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(cls, 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(cls, 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(cls, 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(cls, 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 (
Optional
[TrustLineFlags
]) – The flags to clear.set_flags (
Optional
[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(cls, xdr_object)[source]¶
Creates a
SetTrustLineFlags
object from an XDR Operation object.- Return type
- class stellar_sdk.operation.set_trust_line_flags.TrustLineFlags(value)[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
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-testnet.stellar.org"
for public network)client (
Optional
[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 (
Optional
[int
]) – lower time boundary represented as millis since epochend_time (
Optional
[int
]) – upper time boundary represented as millis since epochoffset (
Optional
[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-testnet.stellar.org"
for public network)client (
Optional
[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 (
Optional
[int
]) – lower time boundary represented as millis since epochend_time (
Optional
[int
]) – upper time boundary represented as millis since epochoffset (
Optional
[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(cls, 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(cls, 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(cls, 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(cls, ed25519_signed_payload)[source]¶
Create ed25519 signed payload Signer from an ed25519 signed payload, click here for more information.
- classmethod from_xdr_object(cls, xdr_object)[source]¶
Create a
SignerKey
from an XDR SignerKey object.
- classmethod pre_auth_tx(cls, 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_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(cls, 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(cls, 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, 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 (
List
[Operation
]) – A list of operations objects (typically its subclasses as defined instellar_sdk.operation.Operation
.preconditions (
Optional
[Preconditions
]) – The preconditions for the validity of this transaction.memo (
Optional
[Memo
]) – The memo being sent with the transaction, being represented as one of the subclasses of theMemo
object.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(cls, 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(cls, 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(cls, xdr, network_passphrase)¶
Create a new
BaseTransactionEnvelope
from an XDR string.
- classmethod from_xdr_object(cls, 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(cls, 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(cls, 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 (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(cls, xdr, network_passphrase)¶
Create a new
BaseTransactionEnvelope
from an XDR string.
- classmethod from_xdr_object(cls, 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. The given source account must include a private key for signing the transaction or an error will be thrown.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.An example:
# Alice pay 10.25 XLM to Bob 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_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
,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 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_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_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_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_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 (
List
[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 (
List
[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_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 a 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 (
Optional
[str
]) – Account of the inflation destination.clear_flags (
Union
[int
,AuthorizationFlag
,None
]) –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
,None
]) –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 (
Optional
[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 (
Optional
[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 (
Optional
[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 (
Optional
[int
]) –A number from 0-255 (inclusive) representing the threshold this account sets on all operations it performs that have a high threshold.
sets the home domain used for reverse federation lookup.
signer (
Optional
[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 (
Optional
[TrustLineFlags
]) – The flags to clear.set_flags (
Optional
[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.
- 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.
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
XDR Utils¶
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 recommend that you always use HTTPS.client (
Optional
[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 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 recommend that you always use HTTPS.client (
Optional
[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 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 (
Optional
[BaseSyncClient
]) – Http Client used to send the request.federation_url (
Optional
[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 recommend 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 (
Optional
[BaseAsyncClient
]) – Http Client used to send the request.federation_url (
Optional
[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 recommend 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 (
Optional
[str
]) – Get federation_url from the domain, you don’t need to set this value if federation_url is set.federation_url (
Optional
[str
]) – The federation server URL (ex."https://stellar.org/federation"
).client (
Optional
[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 recommend 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 (
Optional
[str
]) – Get federation_url from the domain, you don’t need to set this value if federation_url is set.federation_url (
Optional
[str
]) – The federation server URL (ex."https://stellar.org/federation"
).client (
Optional
[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 recommend 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)[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(cls, 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(cls, 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 (
List
[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 (
List
[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.
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¶
AccountFlags¶
- class stellar_sdk.xdr.account_flags.AccountFlags(value)[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 default: void; };
AccountMergeResultCode¶
- class stellar_sdk.xdr.account_merge_result_code.AccountMergeResultCode(value)[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¶
AllowTrustResultCode¶
- class stellar_sdk.xdr.allow_trust_result_code.AllowTrustResultCode(value)[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¶
BeginSponsoringFutureReservesResultCode¶
- class stellar_sdk.xdr.begin_sponsoring_future_reserves_result_code.BeginSponsoringFutureReservesResultCode(value)[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)[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)[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¶
ChangeTrustResultCode¶
- class stellar_sdk.xdr.change_trust_result_code.ChangeTrustResultCode(value)[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¶
ClaimClaimableBalanceResultCode¶
- class stellar_sdk.xdr.claim_claimable_balance_result_code.ClaimClaimableBalanceResultCode(value)[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)[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¶
ClaimableBalanceID¶
ClaimableBalanceIDType¶
Claimant¶
ClaimantType¶
ClaimantV0¶
ClawbackClaimableBalanceOp¶
ClawbackClaimableBalanceResult¶
ClawbackClaimableBalanceResultCode¶
- class stellar_sdk.xdr.clawback_claimable_balance_result_code.ClawbackClaimableBalanceResultCode(value)[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)[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 };
CreateAccountOp¶
CreateAccountResult¶
CreateAccountResultCode¶
- class stellar_sdk.xdr.create_account_result_code.CreateAccountResultCode(value)[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; default: void; };
CreateClaimableBalanceResultCode¶
- class stellar_sdk.xdr.create_claimable_balance_result_code.CreateClaimableBalanceResultCode(value)[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 };
CreatePassiveSellOfferOp¶
CryptoKeyType¶
- class stellar_sdk.xdr.crypto_key_type.CryptoKeyType(value)[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¶
DontHave¶
EncryptedBody¶
EndSponsoringFutureReservesResult¶
EndSponsoringFutureReservesResultCode¶
- class stellar_sdk.xdr.end_sponsoring_future_reserves_result_code.EndSponsoringFutureReservesResultCode(value)[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)[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 };
Error¶
ErrorCode¶
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¶
Hash¶
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¶
Hyper¶
IPAddrType¶
InflationPayout¶
InflationResult¶
InflationResultCode¶
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: 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: void; }
Int32¶
Int64¶
Integer¶
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<>; };
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; } 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)[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)[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; }
LedgerEntryExt¶
LedgerEntryExtensionV1¶
LedgerEntryExtensionV1Ext¶
LedgerEntryType¶
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¶
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)[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; };
LedgerKeyAccount¶
LedgerKeyClaimableBalance¶
LedgerKeyData¶
LedgerKeyLiquidityPool¶
LedgerKeyOffer¶
LedgerKeyTrustLine¶
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)[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 };
LedgerUpgradeType¶
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¶
LiquidityPoolDepositResultCode¶
- class stellar_sdk.xdr.liquidity_pool_deposit_result_code.LiquidityPoolDepositResultCode(value)[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¶
LiquidityPoolWithdrawResultCode¶
- class stellar_sdk.xdr.liquidity_pool_withdraw_result_code.LiquidityPoolWithdrawResultCode(value)[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¶
ManageBuyOfferResultCode¶
- class stellar_sdk.xdr.manage_buy_offer_result_code.ManageBuyOfferResultCode(value)[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¶
ManageDataResultCode¶
- class stellar_sdk.xdr.manage_data_result_code.ManageDataResultCode(value)[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; default: 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¶
ManageSellOfferResultCode¶
- class stellar_sdk.xdr.manage_sell_offer_result_code.ManageSellOfferResultCode(value)[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)[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, 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 };
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; } 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)[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; }
OperationID¶
OperationIDId¶
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; } tr; default: void; };
OperationResultCode¶
- class stellar_sdk.xdr.operation_result_code.OperationResultCode(value)[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)[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; }
OperationType¶
- class stellar_sdk.xdr.operation_type.OperationType(value)[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 };
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_NO_ISSUER: Asset noIssuer; // the asset that caused the error default: void; };
PathPaymentStrictReceiveResultCode¶
- class stellar_sdk.xdr.path_payment_strict_receive_result_code.PathPaymentStrictReceiveResultCode(value)[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_NO_ISSUER: Asset noIssuer; // the asset that caused the error default: void; };
PathPaymentStrictSendResultCode¶
- class stellar_sdk.xdr.path_payment_strict_send_result_code.PathPaymentStrictSendResultCode(value)[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¶
PaymentResultCode¶
- class stellar_sdk.xdr.payment_result_code.PaymentResultCode(value)[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; };
PoolID¶
Price¶
PublicKey¶
PublicKeyType¶
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¶
RevokeSponsorshipResultCode¶
- class stellar_sdk.xdr.revoke_sponsorship_result_code.RevokeSponsorshipResultCode(value)[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¶
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¶
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¶
SetOptionsResultCode¶
- class stellar_sdk.xdr.set_options_result_code.SetOptionsResultCode(value)[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¶
SetTrustLineFlagsResultCode¶
- class stellar_sdk.xdr.set_trust_line_flags_result_code.SetTrustLineFlagsResultCode(value)[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; };
SignerKeyType¶
- class stellar_sdk.xdr.signer_key_type.SignerKeyType(value)[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¶
SponsorshipDescriptor¶
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, 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)[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 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; };
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¶
String¶
String32¶
String64¶
SurveyMessageCommandType¶
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¶
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; };
ThresholdIndexes¶
Thresholds¶
TimeBounds¶
TimePoint¶
TopologyResponseBody¶
- class stellar_sdk.xdr.topology_response_body.TopologyResponseBody(inbound_peers, outbound_peers, total_inbound_peer_count, total_outbound_peer_count)[source]¶
XDR Source Code:
struct TopologyResponseBody { PeerStatList inboundPeers; PeerStatList outboundPeers; uint32 totalInboundPeerCount; uint32 totalOutboundPeerCount; };
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; } 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¶
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 };
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<>; default: void; } result; // reserved for future use union switch (int v) { case 0: void; } ext; };
TransactionResultCode¶
- class stellar_sdk.xdr.transaction_result_code.TransactionResultCode(value)[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 };
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<>; default: void; }
TransactionResultSet¶
TransactionSet¶
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)[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 };