Models

class polaris.models.Asset[source]

This defines an Asset, as described in the SEP-24 Info endpoint.

code

The asset code as defined on the Stellar network.

deposit_enabled

True if SEP-6 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.

issuer

The issuing Stellar account address.

significant_decimals

The number of decimal places Polaris should save when collecting input amounts

withdrawal_enabled

True if SEP-6 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]

This defines a Transaction, as described in the SEP-24 Transactions endpoint.

KIND = <class 'model_utils.choices.Choices'>

Choices object for deposit or withdrawal.

MEMO_TYPES = <class 'model_utils.choices.Choices'>

Type for the deposit_memo. Can be either hash, id, or text

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.

asset

The Django foreign key to the associated Asset

completed_at

Completion date and time of transaction. Assigned null for in-progress transactions.

deposit_memo

(optional) Value of memo to attach to transaction, for hash this should be base64-encoded.

deposit_memo_type

(optional) Type of memo that anchor should attach to the Stellar payment transaction, one of text, id or hash.

external_extra
external_extra_text

The bank name or store name that the user will be withdrawing their funds to.

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.

message

Human readable explanation of transaction status

paging_token

The token to be used as a cursor for querying before or after this transaction

refunded

True if the transaction was refunded, false otherwise.

started_at

Start date and time of transaction.

status

Choices object for processing status of deposit/withdrawal.

  • 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.

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, Stellar address in the case of a deposit).

withdraw_anchor_account

(optional) The stellar account ID of the user that wants to do the withdrawal. This is only needed if the anchor requires KYC information for withdrawal. The anchor can use account to look up the user’s KYC information.

withdraw_memo

(if specified) use this memo in the payment transaction to the anchor.

withdraw_memo_type

Field for the MEMO_TYPES Choices