docs: clarify option and return types (#1718)

* docs: clarify docs for options and return types

* docs: docgen w/ CNAME
This commit is contained in:
Nathan Nichols
2021-10-19 11:23:10 -05:00
committed by GitHub
parent d502d4aac7
commit 0eadbfb790
3 changed files with 13 additions and 7 deletions

View File

@@ -86,7 +86,7 @@
"analyze": "run-s build:web --analyze",
"watch": "run-s build:lib --watch",
"clean": "rm -rf dist",
"docgen": "typedoc",
"docgen": "typedoc && echo js.xrpl.org >> ./docs/CNAME",
"prepublish": "run-s clean build",
"test": "nyc mocha --config=test/.mocharc.json --exit",
"test:integration": "TS_NODE_PROJECT=tsconfig.build.json nyc mocha ./test/integration/**/*.ts ./test/integration/*.ts",

View File

@@ -23,8 +23,6 @@ function formatBalances(trustlines: Trustline[]): Balance[] {
interface GetXrpBalanceOptions {
ledger_hash?: string
ledger_index?: LedgerIndex
peer?: string
limit?: number
}
interface GetBalancesOptions {
@@ -62,8 +60,15 @@ async function getXrpBalance(
*
* @param this - Client.
* @param account - Account address.
* @param options - Options to include for getting balances.
* @returns An array of XRP/non-XRP balances.
* @param options - Allows the user to to look up balance in a ledger with given
* ledger_index or ledger_hash, filter by peer, and limit number of balances.
* @param options.ledger_index - Retrieve the account balances at a given
* ledger_index.
* @param options.ledger_hash - Retrieve the account balances at the ledger with
* a given ledger_hash.
* @param options.peer - Filter balances by peer.
* @param options.limit - Limit number of balances to return.
* @returns An array of XRP/non-XRP balances for the given account.
*/
async function getBalances(
this: Client,

View File

@@ -40,12 +40,13 @@ const MAX_ATTEMPTS = 20
* ```typescript
* const api = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
* await api.connect()
* const wallet = await api.fundWallet()
* const { wallet, balance } = await api.fundWallet()
* ```
*
* @param this - Client.
* @param wallet - An existing XRPL Wallet to fund, if undefined, a new Wallet will be created.
* @returns A Wallet on the Testnet or Devnet that contains some amount of XRP.
* @returns A Wallet on the Testnet or Devnet that contains some amount of XRP,
* and that wallet's balance in XRP.
* @throws When either Client isn't connected or unable to fund wallet address.
*/
async function fundWallet(