ripple-unmaintained / ripple-lib-java

Java version of ripple-lib (work in progress)
ISC License
126 stars 109 forks source link

How to setup an OfferCreate Transaction? #30

Closed chrosim closed 10 years ago

chrosim commented 10 years ago

Hi, currently I am stuck at trying to setup an OfferCreate transaction. Could anyone provide some information on how to do this? What I have done so far is following, but I have no idea if this is correct:

Account account = client.accountFromSeed(blob.getString("master_seed")); final TransactionManager tm = account.transactionManager(); final ManagedTxn tx = new ManagedTxn(TransactionType.OfferCreate, tm.transactionID++); tx.put(Amount.Amount, "1"); tx.put(Field.TakerGets, Amount.fromString("1.0/BTC/rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B")); tx.put(Field.TakerPays, Amount.fromString("1.0/XRP/"));