0

I have been facing this issue for a while using Ripple JSON RPC, am actually working on a PoC for cross border transaction, as part of my use cases, I need to send transaction in NGN and be received in USD/EUR.

I have read your David Schwartz response here https://forum.ripple.com/viewtopic.php?f=2&t=15980 and here https://forum.ripple.com/viewtopic.php?f=2&t=8079 but still having issues with the transaction

Here is my request

{ "method": "submit", "params": [ { "offline": false, "secret": "sssssssssssssssssssssss", "tx_json": { "SendMax" : { "currency" : "USD", "value" : "200", "issuer" : "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc" }, "Account": "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc", "Amount":{ "value": "100", "issuer": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj", "currency": "NGN" }, "Destination": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj", "TransactionType": "Payment" }, "fee_mult_max": 10000 } ] }

and I got this as my response

{ "result": { "engine_result": "tecPATH_PARTIAL", "engine_result_code": 101, "engine_result_message": "Path could not send full amount.", "status": "success", "tx_blob": "1200002280000000240000005661D5038D7EA4C680000000000000000000000000004E474E0000000000CD2B28791E0BEB754A75AF8DB99BDEF21DD8D4A968400000000000000A69D5071AFD498D000000000000000000000000000055534400000000007A04D90FD6B8D1400B5CD796391444090AF06C1F7321031810282977B92281325F0AC5DAF4AB7EDB3FBBE5404A38D657E327B1A46B7897744730450221008269F1C23E2C719A73F7F41D484C0577C1EBF496D8BD6009AA975A852C627E7202207FBD5CBA3EF5F5BE7696FAF5C45F2E22BDCEA7FD48BA99D75897BF58C474BD0D81147A04D90FD6B8D1400B5CD796391444090AF06C1F8314CD2B28791E0BEB754A75AF8DB99BDEF21DD8D4A9", "tx_json": { "Account": "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc", "Amount": { "currency": "NGN", "issuer": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj", "value": "100" }, "Destination": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj", "Fee": "10", "Flags": 2147483648, "SendMax": { "currency": "USD", "issuer": "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc", "value": "200" }, "Sequence": 86, "SigningPubKey": "031810282977B92281325F0AC5DAF4AB7EDB3FBBE5404A38D657E327B1A46B7897", "TransactionType": "Payment", "TxnSignature": "30450221008269F1C23E2C719A73F7F41D484C0577C1EBF496D8BD6009AA975A852C627E7202207FBD5CBA3EF5F5BE7696FAF5C45F2E22BDCEA7FD48BA99D75897BF58C474BD0D", "hash": "A658DE84ABFED32E0E52FBF02E60FBC81E32C5E6186427C33AEBD938188FE4BB" } } }

I understand that tecPATH_PARTIAL means that the transaction failed because the provided paths did not have enough liquidity to send the full amount.

But I did not specify the path bcos I understand it's best when ripple choose the path.

I will appreciate any help in right direction

https://bitcoin.stackexchange.com/users/85/david-schwartz

1

So, after many days I was able to solve this problem. I was able to send transaction from one customer having (NGN) to another Customer who received it in (USD).

For others who may likely face similar problem in the future, this are the steps I took to solve this problem.

Step 1

I created offers for all the currencies. see example request and response below

{ "method": "submit", "params": [ { "offline": false, "secret": "snYothV5CFDMpMYStmL5VwMHzxHFr", "fee_mult_max": 1000, "tx_json": { "TakerGets": { "currency": "EUR", "value": "0.94", "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk" }, "TakerPays": { "currency": "USD", "value": "1", "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ" }, "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk", "TransactionType": "OfferCreate", "Fee": "12", "Flags": "65536" } } ] }

and sample response

{ "result": { "engine_result": "tesSUCCESS", "engine_result_code": 0, "engine_result_message": "The transaction was applied. Only final in a validated ledger.", "status": "success", "tx_blob": "1200072200010000240000001764D4838D7EA4C68000000000000000000000000000555344000000000045249D498FF76EF67DACD0958930DB02EE4A9D4465D46165400CE380000000000000000000000000004555520000000000C260B3831882A44608EE81C2F3726AA72D11CA9568400000000000000C732102272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A6542674473045022100CD7511B302ED7D0C299C0F2C1014EA5AA62F7584B361B940C0E8A98FBA04EDE10220047590E7A678818000B5B221EBBC3D21AB1FCE5C003F8F02AAC41F96D054F90A8114C260B3831882A44608EE81C2F3726AA72D11CA95", "tx_json": { "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk", "Fee": "12", "Flags": 65536, "Sequence": 23, "SigningPubKey": "02272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A65426", "TakerGets": { "currency": "EUR", "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk", "value": "0.94" }, "TakerPays": { "currency": "USD", "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "value": "1" }, "TransactionType": "OfferCreate", "TxnSignature": "3045022100CD7511B302ED7D0C299C0F2C1014EA5AA62F7584B361B940C0E8A98FBA04EDE10220047590E7A678818000B5B221EBBC3D21AB1FCE5C003F8F02AAC41F96D054F90A", "hash": "C35F98185CEBD03EEBCBDB6BB4364288DD8A0EDCF6FE137E9E3950524353AC8B" } } }

Step 2 I Did a find path to get the path to use in sending the transaction, based on the offers earlier created in step 1

{ "method": "ripple_path_find", "params": [ { "source_account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "source_currencies": [ { "currency": "XRP" }, { "currency": "USD" } ], "destination_amount": { "currency": "NGN", "value": "305", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD" }, "destination_account": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ", "SendMax": { "currency": "USD", "value": "1", "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ" } } ] }

Sample Response

{ "result": { "alternatives": [ { "paths_canonical": [], "paths_computed": [ [ { "account": "rntHFZfVgoCeBNYDxSejkPewViFow1Sz6r", "type": 1, "type_hex": "0000000000000001" }, { "account": "rJHPyhod8HuZhps6Gerf7t3yLfinpVLXNT", "type": 1, "type_hex": "0000000000000001" }, { "currency": "NGN", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD", "type": 48, "type_hex": "0000000000000030" } ], [ { "currency": "EUR", "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk", "type": 48, "type_hex": "0000000000000030" }, { "currency": "NGN", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD", "type": 48, "type_hex": "0000000000000030" } ] ], "source_amount": { "currency": "USD", "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "value": "1" } } ], "destination_account": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ", "destination_amount": { "currency": "NGN", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD", "value": "305" }, "destination_currencies": [ "NGN", "XRP" ], "full_reply": true, "ledger_current_index": 3, "source_account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "status": "success", "validated": false } }

Step 3 I used one of the paths returned in the response from above to send payment request.

Sample Request

{ "method": "submit", "params": [ { "offline": false, "secret": "sn1GPS42vNZXg6GYrsSXxYv2VrbkG", "fee_mult_max": 100000, "tx_json": { "Amount": { "currency": "NGN", "value": "305", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD" }, "Account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "Destination": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ", "TransactionType": "Payment", "Fee": "10", "Flags": "0", "Paths": [ [ { "type_hex": "0000000000000030", "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk", "type": "48", "currency": "EUR" }, { "type_hex": "0000000000000030", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD", "type": "48", "currency": "NGN" } ] ], "SendMax": { "currency": "USD", "value": "1", "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ" } } } ] }

Sample Response

{ "result": { "engine_result": "tesSUCCESS", "engine_result_code": 0, "engine_result_message": "The transaction was applied. Only final in a validated ledger.", "status": "success", "tx_blob": "1200002200000000240000000461D50AD5F57690A0000000000000000000000000004E474E00000000009B0C47828166D6258E8E7F0AA3B464FEA9C17E6668400000000000000A69D4838D7EA4C68000000000000000000000000000555344000000000045249D498FF76EF67DACD0958930DB02EE4A9D4473210336DF52033C6AE8F955A8AE89CE32793C0DB54A3DA2477A0F769EA9A4320D754D74463044022019DBE3D2C7ADF58AD35F1924889B8612EC46E8421492BDC591D50EEABCBC0BA9022046F9D34D8DAF24698B3B5A973AB575E5901A1C14EB80E8ABDC25B0D8010F0983811445249D498FF76EF67DACD0958930DB02EE4A9D4483146757FA04E0212B971F7F76E3E4A85A1B280EAE770112300000000000000000000000004555520000000000C260B3831882A44608EE81C2F3726AA72D11CA95300000000000000000000000004E474E00000000009B0C47828166D6258E8E7F0AA3B464FEA9C17E6600", "tx_json": { "Account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "Amount": { "currency": "NGN", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD", "value": "305" }, "Destination": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ", "Fee": "10", "Flags": 0, "Paths": [ [ { "currency": "EUR", "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk", "type": 48, "type_hex": "0000000000000030" }, { "currency": "NGN", "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD", "type": 48, "type_hex": "0000000000000030" } ] ], "SendMax": { "currency": "USD", "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ", "value": "1" }, "Sequence": 4, "SigningPubKey": "0336DF52033C6AE8F955A8AE89CE32793C0DB54A3DA2477A0F769EA9A4320D754D", "TransactionType": "Payment", "TxnSignature": "3044022019DBE3D2C7ADF58AD35F1924889B8612EC46E8421492BDC591D50EEABCBC0BA9022046F9D34D8DAF24698B3B5A973AB575E5901A1C14EB80E8ABDC25B0D8010F0983", "hash": "58906C7DEFCF60ED6AC55A646BE3BF50E32F7B633AC6CD62E1AA6799888AA5EA" } } }

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.