before dangerous ops

Signed-off-by: T-Hax <>
This commit is contained in:
T-Hax 2023-05-06 23:59:38 +00:00
parent 4065d89909
commit 704648ed2c
41 changed files with 31021 additions and 460 deletions

View file

@ -1,13 +0,0 @@
# RPC URLs
ETH_MAINNET_TEST_RPC=
# debug (debug events are logged to console)
DEBUG=
# use tor (torify tests)
TORIFY=
# tor port (regular = 9050, browser = 9150)
TOR_PORT=
# relayer DOMAIN (the example.xyz in https://example.xyz) for testing
TEST_RELAYER_DOMAIN=

View file

@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

View file

@ -43,12 +43,13 @@
"fs-extra": "^11.1.0",
"mocha": "^10.2.0",
"prettier": "^2.3.0",
"rimraf": "^4.4.0",
"rimraf": "^5.0.0",
"source-map-support": "^0.5.19",
"ts-essentials": "^9.3.1",
"ts-node": "^10.9.1",
"tsc-alias": "^1.2.11",
"tsconfig-paths": "^4.1.2",
"typedoc": "^0.24.6",
"typescript": "^5.0.4"
},
"scripts": {
@ -60,7 +61,7 @@
"postversion": "git push --follow-tags && npm publish",
"lint": "eslint --ext ts,js --fix src",
"build-live": "tsc -w && tsc-alias -w",
"clean": "rm -rf --interactive=never cache/*",
"clean": "rm -rf --interactive=never docs/*",
"format": "prettier src/*.ts -w"
},
"files": [

View file

@ -228,7 +228,7 @@ export class Relayer {
.catch((err) => {
throw ErrorUtils.ensureError(err)
})
.then((res) => res.data.prices[token])
.then((res) => BigNumber.from(res.data['ethPrices'][token]))
)
}
@ -259,7 +259,7 @@ export class Relayer {
finished = true
}
if (status == 'CONFIRMED') {
if (status === 'CONFIRMED') {
result.success = true
result.txHash = txHash
finished = true
@ -298,6 +298,10 @@ export class Relayer {
throw ErrorUtils.getError(`Relayer.fromCache: relayer ${options.url} isn't stored in cache.`)
})
await cache.close().catch((err) => {
throw ErrorUtils.ensureError(err)
})
return new Relayer(options, properties)
}
@ -305,7 +309,7 @@ export class Relayer {
* Cache relayer data into a PouchDB database in your cache folder. This will automatically fetch properties if they are not fetched.
*/
async remember(): Promise<void> {
if (!this._fetched) await this.fetchProperties()
this._propertiesFetched('remember')
const cache = new Cache.Base<Docs.Relayer>('Relayers')