Comments (5)
You have it opposite. Check out the documentation for the payment transaction - https://xrpl.org/payment.html#main_content_wrapper especially the payment types section on cross currency payments - https://xrpl.org/payment.html#types-of-payments
To clarify, anything we add in this domain would just potentially simplify this operation for a common use case. You can do full cross currency payments using this library already, so there's nothing "missing" in xrpl-py around this functionality.
from xrpl-py.
closing - please open another issue if you have more questions! feel free!
from xrpl-py.
(edited for version 1.1.0 to show easier imports)
hey there @wojakkk, adding helper functions for cross currency payments is in our backlog. we'll be likely tackling it after the 1.1 release (coming soon!). in the meantime, you can still use the full capabilities of the ledger to make cross currency payments by submitting Payment
and Offer
transactions directly, so you don't have to wait for any helper functions to do this. below code would send a cross currency MXN -> JPY payment as you describe
from xrpl.models import IssuedCurrencyAmount, Payment
from xrpl.transaction import safe_sign_and_submit_transaction
from xrpl.clients import JsonRpcClient
from xrpl.wallet import Wallet
wallet = Wallet(seed, 0)
client = JsonRpcClient(url)
safe_sign_and_submit_transaction(
Payment(
account=wallet.classic_address,
amount=IssuedCurrencyAmount(
currency="JPY",
issuer="11231", # you would need to know a JPY issuer to use
value="100",
),
send_max=IssuedCurrencyAmount(
currency="MXN",
issuer="11231", # whatever the issuer is of the MXN you want to send
value="1",
),
destination="1231231", # address of receiver
),
wallet,
client,
)
from xrpl-py.
Thanks @ledhed2222, great to hear that its being developed soon!
from xrpl-py.
@ledhed2222 So is this how the code that you linked me works? :
amount var = the currency/amount being used in the transaction
send_max var = the currency/amount that will be exchanged for amount_var and sent to destination address
Me -> "amount" currency -> (exchanged for send_max, market price)-> "send_max" currency -> destination
How does this particularly work, im quite confused.
from xrpl-py.
Related Issues (20)
- `Ledger` method crash when use Clio server HOT 4
- Use network ID instead of URL to identify faucet network
- Add better error message for inputting `wallet` instead of `wallet.address` HOT 1
- Explicitly send `api_version` with every request HOT 1
- edgecase: nothing inside in `Memo` Field HOT 9
- destination_tag with length of 10 issue HOT 2
- Better type validation for classes
- Error: ModuleNotFoundError: No module named 'xrpl.clients'; 'xrpl' is not a package HOT 4
- Fix `LedgerObject.from_xrpl` to only accept CamelCase JSON keys HOT 8
- Investigate speeding up docs
- Upgrade docs, display docs for older releases of xrpl-py
- AsyncWebsocketClient uses ever increasing memory with subsequent requests HOT 9
- Use Network ID to determine the correct faucet to use HOT 2
- Cannot convert mnemonic to seed HOT 1
- Delete data, URI, DIDDocument fields in DID object
- Usefulness of RequestID in Websocket connections HOT 8
- Unable to complete a transaction on mainnet HOT 5
- Feature request for ledger_index
- Replace darglint docstring linter
- Improve test coverage HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xrpl-py.