Payment Path Help

Technical questions about the Ripple API, the protocol, etc.

Payment Path Help

Postby dsouthbogs » Sat Nov 25, 2017 4:53 pm

I am trying to learn how to send payments through a path that uses orderbooks. Here is an example of what i am trying to do:

Code: Select all
const myPayment = {
  "source": {
    "address": "SOURCE_ADDRESS",
    "maxAmount": {
      "value": "0.02",
      "currency": "USD",
      "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
    }
  },
  "destination": {
    "address": "DESTINATION_ADDRESS",
    "amount": {
      "value": "0.01",
      "currency": "USD",
      "counterparty": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"
    }
  },
  "allowPartialPayment": true,
  "noDirectRipple": true,
  "paths": '[[{"currency":"CNY","issuer":"razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"}]]'
};


I keep getting one of two errors from this.

Error 1:
Code: Select all
Payment Prepared
Current Ledger 34537189
Tentative Result:  terQUEUED
Tentative Message:  Held until escalated fee drops.
{ [AssertionError: 'terQUEUED' === 'tesSUCCESS']
  name: 'AssertionError',
  actual: 'terQUEUED',
  expected: 'tesSUCCESS',
  operator: '===',
  message: '\'terQUEUED\' === \'tesSUCCESS\'',
  generatedMessage: true }


Error 2:
Code: Select all
Payment Prepared
Current Ledger 34537297
[RippledError(Submit failed, { resultCode: 'temBAD_PATH_LOOP',
  resultMessage: 'Malformed: Loop in path.' })]


Can someone tell me what these errors mean and how to resolve them? I am also curious as to why the errors change between 1 and 2 (e.g. sometimes I will get error 1 and sometimes error 2 ).
dsouthbogs
 
Posts: 44
Joined: Wed Jan 01, 2014 4:37 am

Re: Payment Path Help

Postby dsouthbogs » Sat Nov 25, 2017 5:00 pm

Quick Update. Even if I use
Code: Select all
 return api.getPaths
to get the following paths:

Code: Select all
paths: '[[{"currency":"BTC","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"},{"currency":"USD","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}],[{"currency":"USD","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}],[{"currency":"CNY","issuer":"rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y"},{"currency":"USD","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}],[{"currency":"CNY","issuer":"razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA"},{"currency":"USD","issuer":"rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B"}]]' },


I still get the errors.
dsouthbogs
 
Posts: 44
Joined: Wed Jan 01, 2014 4:37 am

Re: Payment Path Help

Postby dsouthbogs » Sun Nov 26, 2017 1:38 am

I am assuming that I was getting the 'temBAD_PATH_LOOP' because I was trying for a circular path (i.e. same currency & counterparty for source and destination). However, I am still curious about the the other error. Shouldn't I always just get 'temBAD_PATH_LOOP' ??
dsouthbogs
 
Posts: 44
Joined: Wed Jan 01, 2014 4:37 am


Return to Developers

Who is online

Users browsing this forum: No registered users and 6 guests
cron