Skip to content

Commit

Permalink
fix: make docs not output confusing information in xrpl client (#2337)
Browse files Browse the repository at this point in the history
* fix: make docs not output confusing information in xrpl client

---------

Co-authored-by: Jackson Mills <[email protected]>
Co-authored-by: Caleb Kniffen <[email protected]>
  • Loading branch information
3 people committed Feb 1, 2024
1 parent 21c2423 commit 3b70a3b
Show file tree
Hide file tree
Showing 28 changed files with 1,708 additions and 869 deletions.
109 changes: 95 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/xrpl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@
"xrpl-secret-numbers": "^0.3.3"
},
"devDependencies": {

"@types/node": "^16.18.38",
"https-proxy-agent": "^7.0.1",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-jasmine": "^5.1.0",
"karma-webpack": "^5.0.0",
"lodash": "^4.17.4",
"run-s": "^0.0.0",
"react": "^18.2.0",
"typedoc": "0.25.0"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/xrpl/snippets/src/getTransaction.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Client, LedgerResponse, TxResponse } from '../../src'
import { Client } from '../../src'

const client = new Client('wss://s2.ripple.com:51233')

async function getTransaction(): Promise<void> {
await client.connect()
const ledger: LedgerResponse = await client.request({
const ledger = await client.request({
command: 'ledger',
transactions: true,
ledger_index: 'validated',
})
console.log(ledger)

const transactions = ledger.result.ledger.transactions
if (transactions) {
const tx: TxResponse = await client.request({
if (transactions && transactions.length > 0) {
const tx = await client.request({
command: 'tx',
transaction: transactions[0],
})
Expand Down
9 changes: 4 additions & 5 deletions packages/xrpl/snippets/src/paths.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client, Payment, RipplePathFindResponse } from '../../src'
import { Client, Payment } from '../../src'

const client = new Client('wss://s.altnet.rippletest.net:51233')

Expand All @@ -15,7 +15,8 @@ async function createTxWithPaths(): Promise<void> {
issuer: 'rVnYNK9yuxBz4uP8zC8LEFokM2nqH3poc',
}

const request = {
const resp = await client.request({
// TOOD: Replace with path_find - https://github.com/XRPLF/xrpl.js/issues/2385
command: 'ripple_path_find',
source_account: wallet.classicAddress,
source_currencies: [
Expand All @@ -25,9 +26,7 @@ async function createTxWithPaths(): Promise<void> {
],
destination_account,
destination_amount,
}

const resp: RipplePathFindResponse = await client.request(request)
})
console.log(resp)

const paths = resp.result.alternatives[0].paths_computed
Expand Down
Loading

0 comments on commit 3b70a3b

Please sign in to comment.