Models¶
-
class
polaris.models.
Asset
[source]¶ Asset(id, created, modified, code, issuer, significant_decimals, deposit_enabled, deposit_fee_fixed, deposit_fee_percent, deposit_min_amount, deposit_max_amount, withdrawal_enabled, withdrawal_fee_fixed, withdrawal_fee_percent, withdrawal_min_amount, withdrawal_max_amount, send_fee_fixed, send_fee_percent, send_min_amount, send_max_amount, distribution_seed, sep24_enabled, sep6_enabled, sep31_enabled, symbol)
-
code
¶ The asset code as defined on the Stellar network.
-
deposit_enabled
¶ True
if deposit for this asset is supported.
-
deposit_fee_fixed
¶ Optional fixed (base) fee for deposit. In units of the deposited asset. This is in addition to any
fee_percent
. Omit if there is no fee or the fee schedule is complex.
-
deposit_fee_percent
¶ Optional percentage fee for deposit. In percentage points. This is in addition to any
fee_fixed
. Omit if there is no fee or the fee schedule is complex.
-
deposit_max_amount
¶ Optional maximum amount. No limit if not specified.
-
deposit_min_amount
¶ Optional minimum amount. No limit if not specified.
-
distribution_account
¶ The Stellar public key derived from Asset.distribution_seed
-
distribution_seed
¶ The distribution stellar account secret key. The value is stored in the database using Fernet symmetric encryption, and only decrypted when in the Asset object is in memory.
-
issuer
¶ The issuing Stellar account address.
-
send_fee_fixed
¶ Optional fixed (base) fee for sending this asset in units of this asset. This is in addition to any
send_fee_percent
. If null,fee_fixed
will not be displayed in SEP31 /info response.
-
send_fee_percent
¶ Optional percentage fee for sending this asset in percentage points. This is in addition to any
send_fee_fixed
. If null,fee_percent
will not be displayed in SEP31 /info response.
-
send_max_amount
¶ Optional maximum amount. No limit if not specified.
-
send_min_amount
¶ Optional minimum amount. No limit if not specified.
-
sep24_enabled
¶ True if this asset is transferable via SEP-24
-
sep31_enabled
¶ True if this asset is transferable via SEP-31
-
sep6_enabled
¶ True if this asset is transferable via SEP-6
-
significant_decimals
¶ The number of decimal places Polaris should save when collecting input amounts
-
symbol
¶ The symbol used in HTML pages when displaying amounts of this asset
-
withdrawal_enabled
¶ True
if withdrawal for this asset is supported.
-
withdrawal_fee_fixed
¶ Optional fixed (base) fee for withdraw. In units of the withdrawn asset. This is in addition to any
fee_percent
.
-
withdrawal_fee_percent
¶ Optional percentage fee for withdraw in percentage points. This is in addition to any
fee_fixed
.
-
withdrawal_max_amount
¶ Optional maximum amount. No limit if not specified.
-
withdrawal_min_amount
¶ Optional minimum amount. No limit if not specified.
-
-
class
polaris.models.
Transaction
[source]¶ Transaction(id, paging_token, stellar_account, asset, kind, status, status_eta, status_message, stellar_transaction_id, external_transaction_id, amount_in, amount_expected, amount_out, amount_fee, started_at, completed_at, from_address, to_address, required_info_updates, required_info_message, memo, memo_type, receiving_anchor_account, refunded, protocol, pending_signatures, envelope_xdr, channel_seed, claimable_balance_supported, claimable_balance_id, more_info_url, on_change_callback, pending_execution_attempt, client_domain)
-
KIND
= <class 'model_utils.choices.Choices'>¶ Choices object for
deposit
,withdrawal
, orsend
.
-
MEMO_TYPES
= <class 'model_utils.choices.Choices'>¶ Type for the
memo
. Can be either hash, id, or text
-
PROTOCOL
= <class 'model_utils.choices.Choices'>¶ Values for protocol column
-
amount_expected
¶ Amount the client specified would be sent to the anchor at the start of a transaction. Note that
Transaction.amount_in
can differ from this field after funds have been received. Until then, the fields will match. This field makes it possible to check if the amount sent to the anchor matches the amount the client initially specified in an API request or form.
-
amount_fee
¶ Amount of fee charged by anchor.
-
amount_in
¶ Amount received by anchor at start of transaction as a string with up to 7 decimals. Excludes any fees charged before the anchor received the funds.
-
amount_out
¶ Amount sent by anchor to user at end of transaction as a string with up to 7 decimals. Excludes amount converted to XLM to fund account and any external fees.
-
channel_seed
¶ A keypair of the account used when sending SEP-6 or SEP-24 deposit transactions to Transaction.to_address, if present. This is only used for transactions requiring signatures Polaris cannot add itself.
-
claimable_balance_id
¶ The ID of the claimable balance used to send funds to the user. This column will be
None
ifclaimable_balance_supported
isFalse
or if the transaction has not yet been submitted to the Stellar network.
-
claimable_balance_supported
¶ claimable_balance_supported is a boolean to indicate if the wallet supports the SEP24 requirements for handeling claimable balance deposits.
-
client_domain
¶ The hostname of the client application that requested this transaction on behalf of the user. The SIGNING_KEY on https://client_domain/.well-known/stellar.toml signed the challenge transaction used to obtain the authentication token necessary to request this transaction, effectively allowing requests including the authentication token to be attributed to it.
-
completed_at
¶ Completion date and time of transaction. Assigned null for in-progress transactions.
-
envelope_xdr
¶ The base64-encoded XDR blob that can be deserialized to inspect and sign the encoded transaction.
-
external_transaction_id
¶ (optional) ID of transaction on external network that either started the deposit or completed the withdrawal.
-
from_address
¶ Sent from address, perhaps BTC, IBAN, or bank account.
-
id
¶ Unique, anchor-generated id for the deposit/withdrawal.
-
kind
¶ The character field for the available
KIND
choices.
-
memo
¶ (optional) Value of memo to attach to transaction, for hash this should be base64-encoded.
-
memo_type
¶ (optional) Type of memo that anchor should attach to the Stellar payment transaction, one of text, id or hash.
-
message
¶ Human readable explanation of transaction status
-
more_info_url
¶ A URL that is opened by wallets after the interactive flow is complete. It can include banking information for users to start deposits, the status of the transaction, or any other information the user might need to know about the transaction.
-
on_change_callback
¶ A URL that the anchor should POST a JSON message to when the status property of the transaction created as a result of this request changes.
-
paging_token
¶ The token to be used as a cursor for querying before or after this transaction
-
pending_execution_attempt
¶ An internal column used to ensure transactions are not retrieved from the database and executed by different processes running the same command, specifically poll_pending_deposits, check_trustlines or execute_outgoing_transactions.
-
pending_signatures
¶ Boolean for whether or not non-Polaris signatures are needed for this transaction’s envelope.
-
protocol
¶ Either ‘sep6’, ‘sep24’, or ‘sep31’
-
receiving_anchor_account
¶ Stellar account to send payment or withdrawal funds to
-
refunded
¶ True if the transaction was refunded, false otherwise.
-
required_info_message
¶ (SEP31) (optional) A human readable message indicating any errors that require updated information from the sender
-
required_info_updates
¶ (SEP31) (optional) A set of fields that require an update from the sender, in the same format as described in /info.
-
started_at
¶ Start date and time of transaction.
-
status
¶ Choices field for processing status of deposit, withdrawal, & send.
SEP-6 & SEP-24 Statuses:
completed
deposit/withdrawal fully completed
pending_external
deposit/withdrawal has been submitted to external network, but is not yet confirmed. This is the status when waiting on Bitcoin or other external crypto network to complete a transaction, or when waiting on a bank transfer.
pending_anchor
deposit/withdrawal is being processed internally by anchor.
pending_stellar
deposit/withdrawal operation has been submitted to Stellar network, but is not yet confirmed.
pending_trust
the user must add a trust-line for the asset for the deposit to complete.
pending_user
the user must take additional action before the deposit / withdrawal can complete.
pending_user_transfer_start
the user has not yet initiated their transfer to the anchor. This is the necessary first step in any deposit or withdrawal flow.
incomplete
there is not yet enough information for this transaction to be initiated. Perhaps the user has not yet entered necessary info in an interactive flow.
no_market
could not complete deposit because no satisfactory asset/XLM market was available to create the account.
too_small
deposit/withdrawal size less than min_amount.
too_large
deposit/withdrawal size exceeded max_amount.
error
catch-all for any error not enumerated above.
SEP-31 Statuses:
pending_sender
awaiting payment to be initiated by sending anchor.
pending_stellar
transaction has been submitted to Stellar network, but is not yet confirmed.
pending_transaction_info_update
transaction details must be updated to successfully execute transaction off-chain
pending_customer_info_update
customer (SEP-12) information must be updated to facilitate transactions
pending_receiver
payment is being processed by the receiving anchor.
pending_external
payment has been submitted to external network, but is not yet confirmed.
completed
deposit/withdrawal fully completed.
error
catch-all for any error not enumerated above.
-
status_eta
¶ (optional) Estimated number of seconds until a status change is expected.
-
status_message
¶ A message stored in association to the current status for debugging
-
stellar_account
¶ The stellar source account for the transaction.
-
stellar_transaction_id
¶ transaction_id on Stellar network of the transfer that either completed the deposit or started the withdrawal.
-
to_address
¶ Sent to address (perhaps BTC, IBAN, or bank account in the case of a withdrawal or send, Stellar address in the case of a deposit).
-