mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 04:05:52 +00:00
* update definitions
* add network id to base transaction
* update server info
* update base tx
* add network id to autofill
* update tests and fixtures
* network id option 3
fixup
add network id to server info fixture
fixup!
Revert "update tests and fixtures"
This reverts commit a5deee1274.
* update autofill
* update getNetworkID
* remove set network func
* fixup!
remove autoset network id
remove my mistake
fixup!
16 lines
419 B
TypeScript
16 lines
419 B
TypeScript
import type { Client } from '..'
|
|
// import { XrplError } from '../errors'
|
|
|
|
/**
|
|
* Returns the network ID of the rippled server.
|
|
*
|
|
* @param this - The Client used to connect to the ledger.
|
|
* @returns The network id.
|
|
*/
|
|
export default async function getNetworkID(this: Client): Promise<number> {
|
|
const response = await this.request({
|
|
command: 'server_info',
|
|
})
|
|
return response.result.info.network_id ?? 1
|
|
}
|