My objective is to create a path payment, to pay from one funded testnet account to another. A code snippet is below (Can't include the whole function, I guess because it exceeds stack exchange code snippet limit).
.addOperation(StellarSdk.Operation.pathPayment({
source: sourcePublicKey,
destination: receiverPublicKey,
sendAsset: new StellarSdk.Asset.native(),
sendMax: "500",
destAsset: new StellarSdk.Asset("USD",receiverPublicKey),
destAmount: "1",
}))
I haven't specified a PATH, and my understanding is that Stellar will find the optimum route. However, I'm getting a transaction failure 'op_too_few_offers'.
Is this because I'm running on the testnet, and the stellar exchange is more "sparse" in terms of offers etc?
(Assumption of mine is that XLM to USD is probably a common case when developing/testing).
The line "sendAsset: new StellarSdk.Asset.native()" will (as I understand it), specify the source asset as XLM.
[Note - sourcePublicKey and receiverPublicKey are fine, I just cant show the whole block of code to illustrate where they are initialized]