forked from Gimly-Blockchain/eosio-did-resolver
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #17 from Tonomy-Foundation/feature/fetch-option
Feature/fetch option
- Loading branch information
Showing
7 changed files
with
46 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,5 +80,6 @@ | |
"cross-fetch": "^4.0.0", | ||
"did-jwt": "^8.0.4", | ||
"did-resolver": "^4.1.0" | ||
} | ||
}, | ||
"packageManager": "[email protected]+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" | ||
} |
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 |
---|---|---|
@@ -1,9 +1,14 @@ | ||
import { APIClient, FetchProvider } from '@wharfkit/antelope'; | ||
import fetch from 'cross-fetch'; | ||
import { FetchType } from './types'; | ||
|
||
export function getApi(url: string): APIClient { | ||
export interface GetApiOptions { | ||
url: string; | ||
fetch?: FetchType; | ||
} | ||
export function getApi(options: GetApiOptions): APIClient { | ||
const provider = options.fetch ? new FetchProvider(options.url, { fetch: options.fetch }) : new FetchProvider(options.url); | ||
return new APIClient({ | ||
url, | ||
provider: new FetchProvider(url, { fetch }), | ||
url: options.url, | ||
provider, | ||
}); | ||
} |
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
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
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