Compare commits

..

1 Commits

Author SHA1 Message Date
Jackson Mills
f696b1f2bf Allow customized headers 2022-07-07 14:51:00 -07:00
4 changed files with 441 additions and 787 deletions

View File

@@ -83,9 +83,6 @@ npm run docgen
This updates `docs/` at the top level, where GitHub Pages looks for the docs.
## Update `definitions.json`
Use [this repo](https://github.com/RichardAH/xrpl-codec-gen) to generate a new `definitions.json` file from the rippled source code. Instructions are available in that README.
## Adding and removing packages
`xrpl.js` uses `lerna` and `npm`'s workspaces features to manage a monorepo.

File diff suppressed because it is too large Load Diff

View File

@@ -483,6 +483,13 @@
"type": 5,
"expected_hex": "5013"
},
{
"type_name": "Hash256",
"name": "TicketID",
"nth_of_type": 20,
"type": 5,
"expected_hex": "5014"
},
{
"type_name": "Hash256",
"name": "Digest",
@@ -714,6 +721,13 @@
"type": 8,
"expected_hex": "84"
},
{
"type_name": "AccountID",
"name": "Target",
"nth_of_type": 7,
"type": 8,
"expected_hex": "87"
},
{
"type_name": "AccountID",
"name": "RegularKey",

View File

@@ -36,6 +36,7 @@ interface ConnectionOptions {
// request timeout
timeout: number
connectionTimeout: number
headers?: { [key: string]: string }
}
/**
@@ -114,9 +115,15 @@ function createWebSocket(
): WebSocket | null {
const options: WebSocket.ClientOptions = {}
options.agent = getAgent(url, config)
if (config.headers) {
options.headers = config.headers
}
if (config.authorization != null) {
const base64 = Buffer.from(config.authorization).toString('base64')
options.headers = { Authorization: `Basic ${base64}` }
options.headers = {
...options.headers,
Authorization: `Basic ${base64}`,
}
}
const optionsOverrides = _.omitBy(
{