0

I want to make a account (public key) to trust a asset I issue myself.

When I run an allowTrust operation, snippet below, I get op_no_trustline error :

                const issuingAccount = await this.stellarServer.loadAccount(issuerKeys.publicKey())
                const transaction = new TransactionBuilder(issuingAccount, {
                    fee: BASE_FEE,
                    networkPassphrase: Networks.TESTNET
                })
                .addOperation(Operation.allowTrust({
                    trustor,
                    assetCode,
                    authorize: true
                }))
                .setTimeout(0)
                .build()
                transaction.sign(issuerKeys)
                const result = await this.stellarServer.submitTransaction(transaction)

I don't know why I get this error, since I want to allow the trustor(account) to trust the asset I created?

I have set this setFlags: AuthRevocableFlag | AuthRequiredFlag to the issue account.

0

The trustor needs to first create a trustline in any case.

Since your asset is "AuthRequired" they will create an unauthorized trustline first (which could be also seen as a kind of authorization request) using the changeTrust operation, you can authorize/approve that trustline only if it exists in the first place.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.