15

Both representation have benefits. From what I remember, when we picked the amount + price, we considered the following properties compared to just having amount for sale & amount to buy: it discourages "dust" trades. Offers with amount_s/amount_b ratio will in average end up at the same price, but individual trades will be rounded up and rounded down ...


13

No, you can't. If we look at the XDR definition of setOptionsOp, we can see all the fields are optional, if a field is not None then the corresponding value will be set. So what can you do? Home domain From the SQL definition of the accounts table we see that homedomain cannot be null, by default it's the empty string. To unset it we simply set it to ''. ...


9

Each transaction can contain up to 100 operations (this number may be changed in the future). For the most basic operations (peer-to-peer funds transfer, orders on the Stellar exchange) it's almost always a 1:1 ratio. However, there are a lot of cases when anchors or any other applications combine multiple operations into the single transaction. For ...


6

You are using a different version of Horizon server. These fields were added in v0.12.0 which is now a pre-release but will be released later this week. Docker image latest tag will be updated once this new release is out (or you can use it now by using testing tag).


6

This is as per design. Operations are executed in order as one ACID transaction, meaning that either all operations are applied or none are. If any operation fails, the whole transaction fails. https://www.stellar.org/developers/guides/concepts/transactions.html#list-of-operations


4

Each DataEntry increases the required minimum balance by the size of the base reserve (currently 0.5 XLM). The minimum balance for a basic account is 2 × base reserve. Each additional entry costs the base reserve. Entries include: Trustlines Offers Signers Data entries For example, an account with 1 trustline and 2 offers would have ...


4

Your answer is correct, except that the thing you say is impossible is actually easy. A Stellar transaction can contain up to 100 operations, and each operation can have its own source account. So it's trivial to form a transaction in which A pays some asset to B and B pays some asset to A. Because the transaction is atomic, either both will execute or ...


3

If you have both asset (USD and EUR) on Stellar, there's no problem at all. const {Server, Network, Keypair, TransactionBuilder, Operation, Asset} = require('stellar-sdk') Network.useTestNetwork() const server = new Server('https://horizon-testnet.stellar.org'), aliceAddress = 'GDE5SEXCPDZ4CSQSYUJNBBC27OXD2ORQLPU2MGI2QRVD3VMFBDXAZVLK', bobAddress ...


3

Payment is actually a result of the successful execution of a payment operation. A successful payment operation will yield two effects (Account Credited and Account Debited). If a transaction fails it yields no effects, and won't be displayed in payment API endpoint.


3

You could use the spread operator on an object of type []build.TransactionMutator that is passed into the build.Transaction method (on github.com/stellar/go/build). Here's a code sample: import ( “github.com/stellar/go/build" ) // BuildWithOps builds a transaction with a dynamic list of operations func BuildWithOps(sourceAccount string, seq uint64, ...


3

I misunderstood the documentation. The mac_key should be any valid Stellar Private Key. After changing it, I'm getting the HMAC-SHA256 encoded string.


3

The link provides purpose in a nutshell: Passive 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 offers so the two offers don’t immediately act on each other. As in the example above, with normal offers those two offers would cancel each other out and ...


3

Transaction processing is not refering to a group of operations and also is not a operation itself. It is kind of creating the transaction itself. Let me explain it with an example: Account A (thresholds low=1, medium=2, high=2, two signers with weight=1 each) Account B (default) Account C (default) Account A creates a payment transaction on behalf of B ...


3

OperationId is unique within the network, so you need not to pair it with TransactionId. (TransactionId is also known as TransactionHash.) You may consider OperationId a better choice for primary key, if the transactions contain more than one operation. The operation details endpoint provides information on a single operation. The operation ID provided ...


2

You could use the all effects endpoint in streaming mode, and programmatically filter trading and trustline effects that involve the target asset.


2

I've seen many transactions with the same hash. If transaction has the same hash as the other one it means they are identical. You can have two transactions that are doing the same thing (ex. sending 1 XLM from A to B) but they need to have a different sequence numbers and this will make their hashes different.


2

I read the question as Is there a method where I can provide a txn id and automatically refund the payment I received The answer is no. You will have to issue a new payment to effect any refunds. Additionally, a transaction is a sequence of 1 or more operations and may include zero, one or many payment operations. So it is not possible to precisely ...


2

Stellar expert is blocked by my adblocker, so I used Horizon to check the envelope XDR of your transaction. It decodes to these two operations. The operations do not specify a source account, so they are modifying the source account of the transaction. Namely GCXRMMINCZYBOJ3UT7CLHJOVZEEIEWU5YXBOP4ZCTESSVQ4SGJN27G3T. The account operations endpoint you ...


2

Yes you can use a CallBuilder to retrieve the account object: const server = new StellarSdk.Server('https://horizon.stellar.org') const callBuilder = server.accounts.accountId(${myPublicKey}) const account = callBuilder.call() console.log(account) The data entries values are in base64.


2

If you need all operations per ledger you can use the Operations for Ledger endpoint. It won't necessarily be more performant per request but should reduce the number of requests you make.


2

My best guess is that your PostgreSQL db works inefficiently with indexes on a large collection. Usually it means that your server has not enough RAM and is unable to keep indexes and cache in memory. In order to find a bottleneck, you can analyze query performance with built-in PostgreSQL tools.


2

If I understand you correctly, it should look like this: const horizon = new StellarSdk.Server('https://horizon-testnet.stellar.org/') /** * @param sourceAccountSecret {String} - account secret key * @param operations {Array<StellarSdk.Operation>} - operations to apply * @returns {Promise<StellarSdk.Transaction>} **/ function submitOperations(...


2

The memo can be seen on the transaction. e.g. "memo_type": "text", "memo": "chp_290", You can then decode the envelope_xdr value to drill down on the details of the operations within the transaction. Or you can make a subsequent call to the payments by transaction endpoint, where the asset and amount can be seen. e.g. "type": "payment", "...


2

In this particular case you should use server.payments().forAccount(destination2) (if you want to track only payments) or server.operations().forAccount(destination2) (for all operation types) because a transaction itself does not transfer any funds. Think of it as a batch (unit of work) that contains one or more operations. Read more about transaction and ...


2

That is the object returned from a successful submitTransaction call, it is not the transaction record object that you get from calling server.transactions().transaction(hash). If you would like to get the operation object, you can either decode the envelope_xdr or call server.operations.forTransactions(transactionID) just parse the transactionID from the ...


2

According to the Stellar docs and source code, what you get back is just a plain object, straight from Horizon. https://stellar.github.io/js-stellar-sdk/Server.html#submitTransaction https://github.com/stellar/js-stellar-sdk/blob/master/src/server.js#L63 Here is more documentation on what Horizon returns: https://github.com/stellar/go/blob/master/...


2

It is the MANAGE_OFFER_CROSS_SELF error described in the guides and it prevents you from unintentionally fullfilling your own previous offer: The account has opposite offer of equal or lesser price active, so the account creating this offer would immediately cross itself. You should have a look at passive offers for this case.


2

Stellar Transactions satisfy the ACID property: either all operations in the transaction are applied or none is. For example, you can have a transaction with two operations: in one Alice sends Bob Lumens, and in the other Bob sends Alice another asset. When they submit the transaction to the network, the core will check that it can apply both operations ...


1

When you don't set any path you still have a sendAsset and a destAsset, so the expected behavior is a conversion from one to another under the defined thresholds (destAmount and sendMax). You get this error because of course you there's not enough offer for the conversion to happen fully. In most cases you would want to omit the path attribute when one of ...


1

If you don't set path param then the path payment behavior is convert sendAsset to destAsset with default order book (between two assets). Unfortunately you have to "search" for path first and then "build the path" for path payment. Please notice that find payment paths still needs some work. I did multiple tests and finally I had to build a custom ...


Only top voted, non community-wiki answers of a minimum length are eligible