-
Notifications
You must be signed in to change notification settings - Fork 14
Wasm bindings #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Wasm bindings #49
Conversation
|
[env] | ||
AR = "/opt/homebrew/opt/llvm/bin/llvm-ar" | ||
CC = "/opt/homebrew/opt/llvm/bin/clang" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not everyone building is going to use homebrew. You probably don't want to commit your own environment here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this is something we've been noting in the readme on wasm libs since it's mac specific
Original error:
More helpful notes from Dan: There's a separate https-in-websocket implementation and support on the relay so we can avoid it in the browser That implementation is here: https://github.com/MutinyWallet/mutiny-node/pull/820/files#diff-9bd1c92f85da5773c1cf3b66662d28004dd0c00ab719781af7d7a77aa712fb20R140-R187 and could be part of a wasm feature exclusive function You could get ohttp-keys out of band and encode the binary in your js blob to make smoke tests work without JIT fetching that's done with fetch_ohttp_keys Gotta just disable the |
@DanGould I noted your comment: You also mentioned the possibility of passing keys through bip21 OH1 param, who would be doing the passing here? would this be an additional QR shared between receiver and sender? I was thinking keys come from the relay. Anyway, I'm working to understand this better now, but any hints would be appreciated |
Read fetch_ohttp_keys to get the binary (file). You can get it with a GET request in your browser or with curl
Which user? OhttpKeys (OHTTP Key Configurations ) replace TLS certificates.
Yes, they expire, but are long lived so hard coding will work for demo purposes. If you control the directory server for the purposes of a demo you control when the keys are refreshed.
|
ok cool, makes sense now. they are gateway keys, not session keys. I added a convenience method to the cli for this payjoin/rust-payjoin#589 |
Experimenting with exposing just the Uri type with WASM bindings first Want to test "wasm" feature flag for WASM specific modifications to methods the .cargo/config settings are mac specific Hitting issue with the proxy
Need to sort out how to handle errors
…ate type output files
Just remove redundant (hopefully) rlib type
starting with only string inputs/outputs err: getting null rust pointer in browser when trying to call .id() or .to_json()
9e2eb80
to
46d7102
Compare
Need to pass in system time from JS conotext for WASM todo: turst current time logic into a helper method
wrap PdkRequest and make js getters err: currently getting a timeout error when actually making the request, probably the url or body is the issue
little comment: |
@darioAnongba I had used reqwest in this mutiny payjoin implementation. The only place it's used in the payjoin library is with the |
bdd7574
to
3a1b489
Compare
minimal implementations, assume happy path for now
partial implementation
What's the plan for rebase / review here? It'd be nice if there were some piece of this we could start with, like a feature that enables just a small surface of the API, maybe even a single struct since reviewing it all at once is going to be a lot harder, and the underlying payjoin-ffi crate keeps changing making rebases harder as the tip of this diverges. |
the browser demo is fully working now only supports v2 doesn't yet fully validate checks limited options
https://mutinynet.com/tx/f90380bdb2284a7586a386017177257d2454aab100f2a21d5ed2a6e3baf48f6e I'll start looking at merge conflicts to rebase and work up a minimal smaller pr to start. |
WIP!
Closes #46
WASM bindings are now building (only on Uri type rn)
the payjoinError depended on io so I modified that to just handle strings for now, need to sort out what we actually want to do here