Skip to content

Instantly share code, notes, and snippets.

@yuma300
Created February 23, 2015 23:03
Show Gist options
  • Save yuma300/309956575579ddb12db1 to your computer and use it in GitHub Desktop.
Save yuma300/309956575579ddb12db1 to your computer and use it in GitHub Desktop.
var Remote = require('ripple-lib').Remote;
var remote = new Remote({
// see the API Reference for available options
servers: [ 'wss://s1.ripple.com:443' ]
});
var options = {
taker_gets: {
value: "1",
currency: "JPY",
issuer: "r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN"
},
taker_pays: {
value: "1",
currency: "BTC",
issuer: "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q"
}
};
remote.connect(function() {
/* remote connected */
remote.requestBookOffers(options, function(err, info) {
process.stdout.write(JSON.stringify(info));
});
});
{"ledger_current_index":11892258,"offers":[{"Account":"rEjgz1gT7V8Yi6GMNT4ZG34Zf3TcboTQXw","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1500C90E7D9F3A4C8","BookNode":"0000000000000000","Flags":0,"LedgerEntryType":"Offer","OwnerNode":"0000000000000005","PreviousTxnID":"DFBE50905928D6DA62D966BF00DBE9B3A972895B1A629DF1D3B6F291A998DBDC","PreviousTxnLgrSeq":11892249,"Sequence":185512,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"1130.89384052"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0.04"},"index":"255DDEEEB18120A53B2BFDAE4D5437545AE19AB7E4B74829CB30E4AD0E055C4B","owner_funds":"24691.7409354905","quality":"0.00003537025188996296"},{"Account":"rDVBFXkLaPUn9G6SAkpeSYo7EJhtBSyqsM","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1500C92A58A63FD26","BookNode":"0000000000000000","Expiration":478056048,"Flags":0,"LedgerEntryType":"Offer","OwnerNode":"0000000000000DE4","PreviousTxnID":"1B8CE79A2EE64CD5B8333A7CAA799A481BCE2FE7C7C2DC48C99B55B3356EDDCF","PreviousTxnLgrSeq":11892116,"Sequence":119032,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"12044.79902960492"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0.4262581396652873"},"index":"F4038731765211A7E08E62BBC5603D175EC6AC670AA54921E7110ACDAEF19B52","owner_funds":"10246.89250566738","quality":"0.00003538939409595686","taker_gets_funded":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"10246.89250566738"},"taker_pays_funded":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0.3626313171419698"}},{"Account":"rDVBFXkLaPUn9G6SAkpeSYo7EJhtBSyqsM","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1500CD4684244FF80","BookNode":"0000000000000000","Expiration":478056049,"Flags":0,"LedgerEntryType":"Offer","OwnerNode":"0000000000000DE4","PreviousTxnID":"EC12EE4ED4E3127DEC4EE7C89BD8B72CCB607C5BD0A144DAEF4628CEE0329D01","PreviousTxnLgrSeq":11892116,"Sequence":119034,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"31014.24351423999"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"1.119999999999999"},"index":"0244D72BFE9C70C62BCCE9E17E826CF1BF3BF29B5632ACC3619FE2B4634BFAF3","quality":"0.0000361124397403328","taker_gets_funded":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"0"},"taker_pays_funded":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0"}},{"Account":"rK5j9n8baXfL4gzUoZsfxBvvsv97P5swaV","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1500D783FD511F4FE","BookNode":"0000000000000000","Flags":0,"LedgerEntryType":"Offer","OwnerNode":"00000000000087E4","PreviousTxnID":"27B167FC443F94BF89FCCC39C6B33965A5D3942924A82A778342D52A2434EE38","PreviousTxnLgrSeq":11892257,"Sequence":1380338,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"8254.40029317982"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0.312956527931"},"index":"D8DE5C7EE23A85B7A51E1695AD3D618CB13CC3F6CF25F5B42659A854DB3FC6DB","owner_funds":"8254.40029317982","quality":"0.00003791390250235134"},{"Account":"rDVBFXkLaPUn9G6SAkpeSYo7EJhtBSyqsM","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1500DA41C448E0F3C","BookNode":"0000000000000000","Expiration":478056050,"Flags":0,"LedgerEntryType":"Offer","OwnerNode":"0000000000000DE4","PreviousTxnID":"E416E3CF953E24428CBEB0C3E34ED07BF64173798F0D8FAB909BBB9FB5875947","PreviousTxnLgrSeq":11892116,"Sequence":119036,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"58339.16704586934"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"2.239999999999999"},"index":"E318838BAB6C8188C0594BC0498A91124B1BF2CAAFB6DA8EBF763B988DD32436","quality":"0.0000383961601343878","taker_gets_funded":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"0"},"taker_pays_funded":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0"}},{"Account":"rUMPg9YKN9s3crUMnYL9DeyrxktUFaurGV","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1512384359830C581","BookNode":"0000000000000000","Flags":0,"LedgerEntryType":"Offer","OwnerNode":"000000000000002C","PreviousTxnID":"DEF0B20F88879FE6C410251A7A5561963F5B5C38B52BBF51EB21BABD1CA03F72","PreviousTxnLgrSeq":11437054,"Sequence":7998,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"10403.34221"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"10.40021070655626"},"index":"27AE09452BCD42F88AA83C9ADCBA19DF4EC8048A098F2BC57EE55F1DC68577B6","owner_funds":"50357.87926510248","quality":"0.0009996989906339201"},{"Account":"rfLkDwAEQSpTvShmSLLSGWhMmEk65Va1jR","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C15123843827729AA1","BookNode":"0000000000000000","Flags":0,"LedgerEntryType":"Offer","OwnerNode":"0000000000000006","PreviousTxnID":"03F74E6816B807B608409866967C42EDF0F2A5FD4345AB0D94BD437BDD44053B","PreviousTxnLgrSeq":11202277,"Sequence":2858,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"14004.2"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"14"},"index":"7DA8749DBC1E3133210DC64120BC9093EF0C8E5C4B0D6DAF83AB8DD586F23A8A","owner_funds":"13196.16963341865","quality":"0.0009997000899730081","taker_gets_funded":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"13196.16963341865"},"taker_pays_funded":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"13.1922119698277"}},{"Account":"rfLkDwAEQSpTvShmSLLSGWhMmEk65Va1jR","BookDirectory":"E5A2C6CE7ACAA3CBC61644070CE19511BF3DC504712BF8C1512386074D247052","BookNode":"0000000000000000","Flags":0,"LedgerEntryType":"Offer","OwnerNode":"0000000000000006","PreviousTxnID":"85FDF35B17F33463B01F9D899365BFB721A775E48F4DE071148881FD600436B0","PreviousTxnLgrSeq":11047007,"Sequence":2814,"TakerGets":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"20002.02"},"TakerPays":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"20"},"index":"43FFC436BD954DBECF6A8C931FB0BFB57B23CF36DF256142CB0A7F067ACEF010","quality":"0.0009998990101999698","taker_gets_funded":{"currency":"JPY","issuer":"r94s8px6kSw1uZ1MV98dhSRTvc6VMPoPcN","value":"0"},"taker_pays_funded":{"currency":"BTC","issuer":"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q","value":"0"}}],"validated":false}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment