Comments (3)
The first thing I see is you are using wrong classes to define the currencies.
Use the following:
For issued currencies:
from xrpl.models.currencies import IssuedCurrency
For XRP:
from xrpl.models.currencies import XRP
from xrpl-py.
Websockets in python are weird (at least for me). Here's how I would do what (I think) you're trying to do:
from xrpl.clients import WebsocketClient
from xrpl.models import Subscribe, XRP, IssuedCurrency
from xrpl.models.requests.subscribe import SubscribeBook
URL = "wss://something"
def fetch(issuer):
with WebsocketClient(URL) as client:
client.send(Subscribe(
books=[
SubscribeBook(
taker_gets=XRP(),
taker_pays=IssuedCurrency(.....), # fill this in
taker=issuer,
),
],
))
for message in client:
print(message)
from xrpl-py.
The first thing I see is you are using wrong classes to define the currencies. Use the following:
For issued currencies: from xrpl.models.currencies import IssuedCurrency
For XRP: from xrpl.models.currencies import XRP
Yes this solves it.
I had looked at the model here
Which is how I referenced the Currency. It must inherit but this works now.
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.