xpring-eng / xpring4j Goto Github PK
View Code? Open in Web Editor NEWXpring4j has been deprecated. Instead, use xrpl4j
Home Page: https://github.com/XRPLF/xrpl4j
License: MIT License
Xpring4j has been deprecated. Instead, use xrpl4j
Home Page: https://github.com/XRPLF/xrpl4j
License: MIT License
As per this https://github.com/xpring-eng/xpring4j#xrppayidclient the method name is xrpAddressForPayID
but the actual method name is xrpAddressForPayId
The last d is the problem.
PayIDUtils method parsePayID returns a deprecated type:
PayIDComponents parsedPayID = PayIDUtils.parsePayID(inValidPayID);
Should PayIDUtils be moved to an idiomatically cased class?
When using the API in multiple threads, an exception is thrown.
Example code:
Wallet fromSeedWallet = new Wallet("qwertyuiop123", true); // qwertyuiop123 > enter seed.
Throws this exception when used in multiple threads like e.g. batch jobs.
java.lang.IllegalStateException: Multi threaded access requested by thread Thread[scheduler_Worker-2,5,main] but is not allowed for language(s) js.
at com.oracle.truffle.polyglot.PolyglotEngineException.illegalState(PolyglotEngineException.java:132) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.polyglot.PolyglotContextImpl.throwDeniedThreadAccess(PolyglotContextImpl.java:660) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.polyglot.PolyglotContextImpl.checkAllThreadAccesses(PolyglotContextImpl.java:563) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.polyglot.PolyglotContextImpl.enterThreadChanged(PolyglotContextImpl.java:490) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.polyglot.PolyglotEngineImpl.enter(PolyglotEngineImpl.java:1599) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:89) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.api.impl.DefaultCallTarget.call(DefaultCallTarget.java:99) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.api.impl.DefaultRuntimeAccessor$DefaultRuntimeSupport.callProfiled(DefaultRuntimeAccessor.java:131) ~[truffle-api-20.2.0.jar:na]
at com.oracle.truffle.polyglot.PolyglotValue$InteropValue.invoke(PolyglotValue.java:2809) ~[truffle-api-20.2.0.jar:na]
at org.graalvm.polyglot.Value.invokeMember(Value.java:549) ~[graal-sdk-20.2.0.jar:na]
at io.xpring.xrpl.javascript.JavaScriptWalletFactory.walletFromSeed(JavaScriptWalletFactory.java:85) ~[xpring4j-6.1.1.jar:na]
at io.xpring.xrpl.Wallet.<init>(Wallet.java:35) ~[xpring4j-6.1.1.jar:na]
Hi
I have using XrpClient but I have to face some issues
while sending XRP payments.
I have attached the ERROR Log file.
java.txt
Kindly support us.
I am trying to setup a Java Xpring for testing purposes.
`import java.math.BigInteger;
import io.xpring.common.XrplNetwork;
import io.xpring.xrpl.XrpClient;
import io.xpring.xrpl.XrpException;
public class Main {
public static void main(String[] args) {
try {
XrpClient xrpClient = new XrpClient("test.xrp.xpring.io:50051", XrplNetwork.TEST);
String address = "X7u4MQVhU2YxS4P9fWzQjnNuDRUkP3GM6kiVjTjcQgUU3Jr";
BigInteger balance;
balance = xrpClient.getBalance(address);
System.out.println(balance);
} catch (XrpException e) {
e.printStackTrace();
}
}
}`
The above code is taken from the main wiki.
The results:
Exception in thread "main" java.lang.ExceptionInInitializerError at io.xpring.xrpl.javascript.JavaScriptUtils.<init>(JavaScriptUtils.java:26) at io.xpring.xrpl.Utils.<clinit>(Utils.java:20) at io.xpring.xrpl.DefaultXrpClient.getBalance(DefaultXrpClient.java:104) at io.xpring.xrpl.ReliableSubmissionXrpClient.getBalance(ReliableSubmissionXrpClient.java:17) at io.xpring.xrpl.XrpClient.getBalance(XrpClient.java:51) at org.thothtrust.cryptocurrency.xrp.bridge.Main.main(Main.java:15) Caused by: org.graalvm.polyglot.PolyglotException: SyntaxError: Invalid regular expression: /[֑-ۯۺ-ࣿ�?-??-?�-﷿ﹰ-ﻼ]/: Range out of order in character class at <js>.:anonymous(/index.js:22) at <js>.:anonymous(/index.js:22) at <js>.r(/index.js:1) at <js>.:anonymous(/index.js:22) at <js>.r(/index.js:1) at <js>.:anonymous(/index.js:22) at <js>.r(/index.js:1) at <js>.:anonymous(/index.js:22) at <js>.r(/index.js:1) at <js>.:anonymous(/index.js:1) at <js>.:anonymous(/index.js:1) at <js>.:anonymous(/index.js:1) at <js>.:program(/index.js:1) at org.graalvm.polyglot.Context.eval(Context.java:345) at io.xpring.xrpl.javascript.JavaScriptLoader.<clinit>(JavaScriptLoader.java:49) ... 6 more
The Maven dependency has been successfully included into the Eclipse IDE java project with Maven just for additional information. The maven dependency seems to be using xpring4j-6.0.2.jar.
Hi folks, it seems the SDK currently requires android api v.26+.
Do you know if it would be possible to extend it to 21 to support more devices?
Thank you!
ERROR [2020-02-09 01:31:44,766] io.grpc.internal.ManagedChannelOrphanWrapper: *~*~*~ Channel ManagedChannelImpl{logId=25, target=grpc.xpring.tech:80} was not shutdown properly!!! ~*~*~*
Make sure to call shutdown()/shutdownNow() and wait until awaitTermination() returns true.
! java.lang.RuntimeException: ManagedChannel allocation site
! at io.grpc.internal.ManagedChannelOrphanWrapper$ManagedChannelReference.<init>(ManagedChannelOrphanWrapper.java:94)
! at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:52)
! at io.grpc.internal.ManagedChannelOrphanWrapper.<init>(ManagedChannelOrphanWrapper.java:43)
! at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:524)
! at io.xpring.xrpl.DefaultXpringClient.<init>(DefaultXpringClient.java:39)
! at io.xpring.xrpl.XpringClient.<init>(XpringClient.java:17)
Hi;
the example for getting balance from a wallet does not seem to be correct.
the 'address' variable is never used.
I assume this:
String address = "rHsMGQEkVNJmpGWs8XUBoTBiAAbwxZN5v3"; BigInteger balance = xpringClient.getBalance(XRPL_ADDRESS);
should be like this:
String address = "rHsMGQEkVNJmpGWs8XUBoTBiAAbwxZN5v3"; BigInteger balance = xpringClient.getBalance(address);
myCode
String MAIN_RPC_URL = "main.xrp.xpring.io:50051";
String PUBLIC_KEY = "";
String PRIVATE_KEY = "";
XrpClient xrpClient = new XrpClient(MAIN_RPC_URL, XrplNetwork.MAIN);
String address = "classicAddress";
String tag = "123456";
BigDecimal amount = new BigDecimal("1");
Wallet wallet = Wallet.walletFromKeys(PUBLIC_KEY,PRIVATE_KEY, false);
ClassicAddress classicAddress = ImmutableClassicAddress.builder()
.address(address)
.tag(Integer.valueOf(tag))
.isTest(false)
.build();
String transactionHash = xrpClient
.send(toBigInteger(amount), Utils.encodeXAddress(classicAddress), wallet);
The code successfully returns the transaction hash, but when I query this hash, I find that it fails, Did not submit the DestinationTag,this is the URL:
https://livenet.xrpl.org/transactions/F8081122E463152D13DA5163A905D017D414D30665FC764CB854A743E548F115
我在瑞波区块链浏览器查询,该交易广播失败了,原因是收放的地址必须要求填入DestinationTag,但是我在代码里面有带上 tag,在浏览器查询的详情里面发现没有带上 tag,请修复下这个问题,这是浏览器查询地址
https://livenet.xrpl.org/transactions/F8081122E463152D13DA5163A905D017D414D30665FC764CB854A743E548F115
Currently, the sendPayment
API takes the following parameters:
final String destinationPaymentPointer,
final UnsignedLong amount,
final String accountId,
final String bearerToken
These should change to
final UnsignedLong amount,
final String destinationPaymentPointer,
final String senderAccountId,
final String bearerToken
to align parameters across all SDK languages.
I notice you mention in the readme about testnet URL grpc.xpring.tech:80
how about mainnet URL?
Thanks
I've setup my username and a Personal Acces Token (PAT) in ~/.m2/settings.xml as described here:
And have added the repository, as per the README, to my project's pom.xml..
<repositories>
<repository>
<id>github</id>
<name>GitHub xpring-eng Apache Maven Packages</name>
<url>https://maven.pkg.github.com/xpring-eng</url>
</repository>
</repositories>
Yet I'm still unable to retrieve the artifacts from the repo, using this dependency in the pom.
<dependency>
<groupId>io.xpring</groupId>
<artifactId>xpring4j</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
I keep getting (variations of):
"Could not find artifact io.xpring:xpring4j:jar:1.0 in central (https://repo1.maven.org/maven2)"
I've tried disabling the central repo, granting more access rights to the PAT, changing the version (1.0, 1.0-SNAPSHOT) but nothing seems to work.
What am I doing wrong? What am I missing?
The build frequently breaks (see here). I think this is because the IT doesn't use an async polling mechanism like a CountDownLatch or, even better, something like Awaitility.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.