7

The best thing to do is to look at one of the official libraries and use them as guide. I can give you an high-level overview of the steps required to implement the base library to interact with stellar. First of all, you need a XDR serializer and deserializer. You probably also want to auto-generate the XDR object classes for you language using a tool like ...


6

The same sequence number is the solution for this case. I also had the similar issue setting up same sequence number for multiple transactions, here's a sample js sdk code I used to set same sequence number, // This method is not recommended but seems to be only working options // I could find at the time. // load account, which will have initial sequence ...


5

I hadn't run any benchmarks myself, but you can estimate the performance based on the few parameters. Cryptography Cryptography is the most CPU-consumptional part of SDK. Stellar JS SDK depends on Ed25519, SHA and CRC. And Ed25519 is the main concern, because the key derivation and signing are implemented on Ed25519 elliptic curves. If you open stellar-base ...


5

Addresses are the same no matter what network you are on. Transaction hashes are different, however. (The transaction hash pre-image is formed by taking the network ID, and appending the transaction envelope XDR to it.)


5

I believe that is the extra padding bytes set so that the length is a multiple of 4. From the RFC 4506 (a.k.a. the XDR Spec): The standard defines a string of n (numbered 0 through n-1) ASCII bytes to be the number n encoded as an unsigned integer (as described above), and followed by the n bytes of the string. Byte m of the string always ...


5

Your client will use the federated address as a destination in their wallet software, the wallet will call your server and get the account info + memo when the client wants to send funds to you.


4

As far as I know, there is no single endpoint in horizon API that allows you to check the account's balance and/ or filtered by memo at the same time. If you want to differentiate incoming transactions by memo, what you can do is to use event streaming transactions for a particular account to extract the memo and consider injecting your logic in there, let ...


4

To create accounts you create a transaction containing a createAccount operation. https://www.stellar.org/developers/guides/concepts/list-of-operations.html#create-account Friendbot is only there to give you an initial sum of testnet XLMs. Nothing else.


4

var StellarBase = require('stellar-base'); var jsxdr = require('js-xdr'); let signers = new jsxdr.VarArray(StellarBase.xdr.Signer, 20) .fromXDR('AAAAAQAAAAC+GwdMJxaEbnW0z0RP6jJvTg+s8mjVw7+wPpJEbZAJdQAAAAo=', 'base64'); for (signer of signers) { console.log(signer.key()); console.log(signer.weight()); } Please note that the column will be NULL when ...


3

I'm just going to guess here, since I don't do golang, but if you look at what Sign does, can't you just copy that implementation yourself, and skip the signing part? I.e., func (b *TransactionBuilder) Sign(signers ...string) (TransactionEnvelopeBuilder, error) { var result TransactionEnvelopeBuilder err := result.Mutate(b) if err != nil { ...


3

The SDK reference documentation is built automatically from the sources using JS Doc format parser, so it doesn't contain the detailed information and usage examples, only methods descriptions extracted from JS Doc comments. You'll find practical use cases with line-by-line comments here.


3

Just pick a horizon server to query (e.g., https://horizon.stellar.org/). Then for account balances you want the Account endpoint, which you can query like this: curl https://horizon.stellar.org/accounts/GDOZSTU2PMCVID4TYBMMES6IDBO7SYBQY366S4VSK6SG2AS2R44RLIUH (but substitute a real account account). You'll find the balances in the balances field of the ...


3

createAccount is an operation that you can include in a transaction. It works like a payment from your account to the account specified in the operation. But it has a side-effect of creating the destination account. As such, it will only succeed if the account doesn't already exist and the payment amount is greater than the reserve balance. payment is also ...


3

It looks like the SignatureHint for hash(x) in your transaction is invalid. Signature hint for hash(x) is the 4 last bytes of the hash, not the preimage. Fix required around: Hint: xdr.SignatureHint(Hint(key)), The sha256 hash is equal: de30cab57041840f20d7df031d9704b2ddafeb408d52f2fe18f0a77aef511df5 So the hint should be equal ef511df5 but it's d7d888f2....


3

Time bounds are part of the transaction itself, and are added in the Java SDK using the addTimeBounds method. https://stellar.github.io/java-stellar-sdk/org/stellar/sdk/Transaction.Builder.html#addTimeBounds-org.stellar.sdk.TimeBounds- Here's an example for transaction 3: SetOptionsOperation setOptionsOperation = new SetOptionsOperation.Builder() ....


3

So I finally found out what was the problem. The thresholds weren't set correctly. I leave here the correct ones: setOptions({ setFlags: 3, // Operation.AuthFlags.Required | Operation.AuthFlags.Revocable signer: { ed25519PublicKey: environment.stellar.stellarMainKey, weight: 1, }, lowThreshold: 1, medThreshold: 2, highThreshold: ...


3

You can't generate xPub for Stellar keys according to SEP-0005. Stellar is using SLIP-0010 (as defined in SEP-0005). From "Master key generation" section: ed25519 curve the private keys are no longer multipliers for the group generator; instead the hash of the private key is the multiplier. For this reason, our scheme for ed25519 does not support public ...


3

The operations-for-account endpoint will list all operations for that specific account incl. changes to the trustlines. If you scroll to the bottom on this stellar laboratory page (after clicking submit) it will show you the following operation which changed the authorize flag to false: { [...] "id": "41852832801886209", "paging_token": "...


3

The asset issuer is different. The account has a balance of FOC-GDK... tokens, but the payment was a FOC-GD5... token payment. Since the trustline is for FOC-GD5... and the payment is also originated by FOC-GD5... those payments are new minted FOC-GD5... tokens, not the FOC-GDK... that the account holds. You allways have to reference the asset_issuer/...


3

check this out: https://github.com/StellarCN/py-stellar-base/blob/6329db3658c9b646a69c567019d95b41b7363eee/stellar_base/utils.py#L251 def is_valid_address(address): try: return decode_check('account', address) except (DecodeError, TypeError): raise StellarAddressInvalidError('Invalid Stellar Address: {}'.format(address))


3

Transactions contain an arbitrary list of operations inside them. Typically there is just one operation, but it’s possible to have multiple (up to 100). This is the documentation I believe you're looking for: https://www.stellar.org/developers/guides/concepts/transactions.html#list-of-operations


2

To make your case work: First, use accountB to trust "ASTRO"(issued by accountA), and sign with accountB. This means that now accountA recognizes ASTRO. Then, you may send this ASTRO(by accountA) freely to accountB. Explanation: On Stellar, there is an operation [Change Trust] that allows a user to "trust" an asset (or the other way, revoke the ...


2

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


2

There is an operation called createAccount, and it's used to activate accounts with a starting balance. In fact all friendbot does is exactly what you are saying (it has a base account with a large balance and it does createAccount with 10000 lumens). https://stellar.github.io/js-stellar-sdk/Operation.html#.createAccount Here's some sample code: const ...


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

There is a good explanation on how to query the total supply of an asset created by an entity on Stellar's DEX here. Once you have the result from the trustline query, you would iterate over all the asset holders, with their balances, and sum the balance amounts.


2

Maybe due to yesterday's scheduled cleanup. After clean up all the data's that are stored in the testnetwork will be removed permanently. Anyway the custom asset details will be not shown in issuer account. It can only be visible in the distributor accounts where you transfer the amount from issuer or created the trustline to issuer


2

The whole point of a block chain is that you cannot ever cancel the transaction after you submit it. So if you have submitted it to stellar, it's too late. Solution: don't do that until after the user approves the transaction, which should include signing the transaction object you are creating client side. If they don't, do not submit that client side ...


2

tx_bad_seq error means that current source account sequence doesn't match the sequence specified in the transaction itself. Tx sequence should be equal to account sequence + 1 to pass the verification. The account sequence is effectively a "nonce" intended to prevent transaction replay. It is incremented after each transaction. Failed transactions (for ...


2

The operation to withdraw is a payment. In order to make a payment from an account, the transaction must be signed with sufficient signers to meet the threshold for a medium security operation. Every account can set different levels for high, medium and low operations. And each signer has a weight. The weight of all signers must exceed the threshold for ...


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