-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #180 from ElrondNetwork/tx-on-network
Breaking change: unifying provider interfaces, preparing network providers for extraction - step 1
- Loading branch information
Showing
16 changed files
with
631 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const JSONbig = require("json-bigint"); | ||
|
||
export const defaultAxiosConfig = { | ||
timeout: 1000, | ||
// See: https://github.com/axios/axios/issues/983 regarding transformResponse | ||
transformResponse: [ | ||
function (data: any) { | ||
return JSONbig.parse(data); | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* The base class for exceptions (errors). | ||
*/ | ||
export class Err extends Error { | ||
inner: Error | undefined = undefined; | ||
|
||
public constructor(message: string, inner?: Error) { | ||
super(message); | ||
this.inner = inner; | ||
} | ||
} | ||
|
||
/** | ||
* Signals an unexpected condition. | ||
*/ | ||
export class ErrUnexpectedCondition extends Err { | ||
public constructor(message: string) { | ||
super(`Unexpected condition: [${message}]`); | ||
} | ||
} | ||
|
||
/** | ||
* Signals an error that happened during a request against the Network. | ||
*/ | ||
export class ErrNetworkProvider extends Err { | ||
public constructor(url: string, error: string, inner?: Error) { | ||
let message = `Request error on url [${url}]: [${error}]`; | ||
super(message, inner); | ||
} | ||
} |
Oops, something went wrong.