GithubHelp home page GithubHelp logo

haveno-dex / haveno-ts Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 23.0 20.96 MB

TypeScript library for using Haveno

Home Page: https://haveno-dex.github.io/haveno-ts/classes/HavenoClient.HavenoClient.html

License: Apache License 2.0

TypeScript 99.32% Shell 0.23% JavaScript 0.05% Dockerfile 0.41%
api grpc haveno typescript

haveno-ts's People

Contributors

abouolia avatar duriancrepe avatar erciccione avatar l0nelyc0w avatar lumnitzf avatar napoly avatar premek avatar randall-coding avatar tcobli avatar woodser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

haveno-ts's Issues

Failing market prices test

Hi,

Any idea what could be causing the following test to fail? I am running a local test network and have only changed the port for aliceWalletUrl in the test config. Thank you.

Alice posting offer
Alice done posting offer
Bob taking offer
Bob done taking offer in 6906 ms
Mining to unlock deposit txs
Done mining to unlock deposit txs
 FAIL  src/HavenoDaemon.test.ts (93.767 s)
  โ— Can get market prices

    ETH is not a valid currency code

      at new E (node_modules/grpc-web/index.js:21:1229)
      at Y (node_modules/grpc-web/index.js:56:272)
      at oc.<anonymous> (node_modules/grpc-web/index.js:55:197)
      at Ib (node_modules/grpc-web/index.js:33:182)
      at O (node_modules/grpc-web/index.js:32:614)
      at yc (node_modules/grpc-web/index.js:46:68)
      at oc.Object.<anonymous>.n.W (node_modules/grpc-web/index.js:44:252)
      at oc.Object.<anonymous>.n.R (node_modules/grpc-web/index.js:44:231)
      at XMLHttpRequest.invokeTheCallbackFunction (node_modules/jsdom/lib/jsdom/living/generated/EventHandlerNonNull.js:18:28)
      at XMLHttpRequest.<anonymous> (node_modules/jsdom/lib/jsdom/living/helpers/create-event-accessor.js:35:32)
      at innerInvokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:338:25)
      at invokeEventListeners (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:274:3)
      at XMLHttpRequestImpl._dispatch (node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:221:9)
      at fireAnEvent (node_modules/jsdom/lib/jsdom/living/helpers/events.js:18:36)
      at readyStateChange (node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:761:3)
      at EventEmitter.<anonymous> (node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:889:5)
      at Request.<anonymous> (node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:382:41)
      at IncomingMessage.<anonymous> (node_modules/jsdom/lib/jsdom/living/helpers/http-request.js:230:42)

SELLER_SAW_ARRIVED_PAYOUT_TX_PUBLISHED_MSG
 PASS  src/App.test.tsx

Test Suites: 1 failed, 1 passed, 2 total
Tests:       1 failed, 10 passed, 11 total
Snapshots:   0 total
Time:        94.5 s, estimated 95 s
Ran all test suites.

Contribute design assets?

Are there any Figma or Sketch files for the UI?

I'm a Product Designer and would love to help contribute to the design direction.

Thanks

Add copyright notice to all source files

The Apache 2 license requires us to add the following notice to all source files:

Copyright 2021, Haveno

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

We haven't included it in any file yet, but we should definitely do it in the future (and should be added to already existent files).

Bundle as Electron application

This issue requests bundling the UI as an electron application.

The application will need to bundle at least Haveno's daemon, frontend, monerod, and monero-wallet-rpc to be executed in a desktop environment.

Update Signed Offers view in legacy UI

This issue requests changes to the recently added Signed Offers view:

image

  • Change the visible columns to (in order, remove others): Date | Trader ID | Offer ID | Maker Penalty Fee | Key Images
  • Ability to right click an offer > "Copy to clipboard", which copies the signed offer to the clipboard as json (signedOffer.toJson())
  • Add a search box which searches trader id, offer id, and key images from each signed offer and filters the results

`postOffer` method unexpected error on server.

I want to post an offer to the Alias daemon, copied and pasted almost the same code from the test file, but keep getting that error on the Alias daemon.

I don't know if there's a misconfigratuon on my daemons. Couldn't understand the error so generic.

Code:

   const config = {
      direction: "buy", // buy or sell xmr
      amount: BigInt("200000000000"), // amount of xmr to trade
      assetCode: "eth", // counter asset to trade
      price: undefined, // use market price if undefined
      paymentAccountId: "50d93331-1640-41eb-b90e-e0352727008f",
      priceMargin: 0.0,
      minAmount: undefined,
      buyerSecurityDeposit: 0.15,
      awaitUnlockedBalance: false,
      triggerPrice: undefined,
    };
    
    client.postOffer(
        config.direction,
        config.amount,
        config.assetCode,
        config.paymentAccountId,
        config.buyerSecurityDeposit,
        config.price,
        config.marketPriceMargin,
        config.triggerPrice,
        config.minAmount
    );

Error:

Jun-05 12:21:39.987 [grpc-default-executor-2] INFO  b.d.g.i.CallRateMeteringInterceptor: CreateOffer has been called 1 time in the last second, rate limit is 10/second 
Jun 05, 2022 12:21:39 PM io.grpc.internal.SerializingExecutor run
SEVERE: Exception while executing runnable io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@6a9420c8
io.grpc.StatusRuntimeException: UNKNOWN: unexpected error on server
	at bisq.daemon.grpc.GrpcExceptionHandler.wrapException(GrpcExceptionHandler.java:99)
	at bisq.daemon.grpc.GrpcExceptionHandler.handleException(GrpcExceptionHandler.java:56)
	at bisq.daemon.grpc.GrpcOffersService.createOffer(GrpcOffersService.java:178)
	at bisq.proto.grpc.OffersGrpc$MethodHandlers.invoke(OffersGrpc.java:569)
	at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
	at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:814)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Jun-05 12:21:39.989 [grpc-default-executor-2] INFO  b.c.offer.CreateOfferService: create and get offer with offerId=031044-795d1c24-f77d-4027-ac64-d9b300d0ebdf-162, 
currencyCode=ETH, 
direction=BUY, 
price=100000000, 
useMarketBasedPrice=true, 
marketPriceMargin=0.0, 
amount=20000000, 
minAmount=20000000, 
buyerSecurityDeposit=0.15 
Jun-05 12:21:39.991 [grpc-default-executor-2] ERROR org.bitcoinj.core.Context: Performing thread fixup: you are accessing bitcoinj via a thread that has not had any context set on it. 
Jun-05 12:21:39.992 [grpc-default-executor-2] ERROR org.bitcoinj.core.Context: This error has been corrected for, but doing this makes your app less robust. 
Jun-05 12:21:39.992 [grpc-default-executor-2] ERROR org.bitcoinj.core.Context: You should use Context.propagate() or a ContextPropagatingThreadFactory. 
Jun-05 12:21:39.992 [grpc-default-executor-2] ERROR org.bitcoinj.core.Context: Please refer to the user guide for more information about this. 
Jun-05 12:21:39.992 [grpc-default-executor-2] ERROR org.bitcoinj.core.Context: Thread name is grpc-default-executor-2. 
Jun-05 12:21:39.992 [grpc-default-executor-2] INFO  org.bitcoinj.wallet.Wallet: Completing send tx with 2 outputs totalling 0.0302 BTC and a fee of 0.00 BTC/vkB 
Jun-05 12:21:39.992 [grpc-default-executor-2] INFO  b.c.btc.TxFeeEstimationService: We cannot do the fee estimation because there are not enough funds in the wallet. This is expected if the user pays from an external wallet. In that case we use an estimated tx vsize of 175 vbytes. 
Jun-05 12:21:39.992 [grpc-default-executor-2] INFO  b.c.btc.TxFeeEstimationService: Fee estimation resulted in a tx vsize of 175 vbytes and a tx fee of 1750 Sat. 
Jun-05 12:21:39.993 [grpc-default-executor-2] ERROR b.d.grpc.GrpcOffersService:  java.lang.NullPointerException: null
	at bisq.core.offer.CreateOfferService.createAndGetOffer(CreateOfferService.java:234)
	at bisq.core.api.CoreOffersService.createAndPlaceOffer(CoreOffersService.java:239)
	at bisq.core.api.CoreApi.createAnPlaceOffer(CoreApi.java:447)
	at bisq.daemon.grpc.GrpcOffersService.createOffer(GrpcOffersService.java:151)
	at bisq.proto.grpc.OffersGrpc$MethodHandlers.invoke(OffersGrpc.java:569)
	at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
	at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:814)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

java.lang.NullPointerException: null
	at bisq.core.offer.CreateOfferService.createAndGetOffer(CreateOfferService.java:234)
	at bisq.core.api.CoreOffersService.createAndPlaceOffer(CoreOffersService.java:239)
	at bisq.core.api.CoreApi.createAnPlaceOffer(CoreApi.java:447)
	at bisq.daemon.grpc.GrpcOffersService.createOffer(GrpcOffersService.java:151)
	at bisq.proto.grpc.OffersGrpc$MethodHandlers.invoke(OffersGrpc.java:569)
	at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172)
	at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331)
	at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:814)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

Remove the need to copy .proto files from Haveno repository

It would be better if .proto files are not needed to be copied and commited into this repository from the Haveno repository on every change, current instructions:

Copy grpc.proto and pb.proto from Haveno's protobuf definitions to ./config.

Some solutions could be:

  • expect the haveno repository to be cloned in the same directory like this one and use the files from there using ../haveno/...
  • use git / wget to download them from github (master branch) before build
  • use separate repo for .proto files and use git submodules in both repos that depends on them
  • move UI-POC to the main monorepo
  • ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.