-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: converting gmp and s3 service clients to use dynamic imports a…
…s well
- Loading branch information
Showing
4 changed files
with
28 additions
and
16 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
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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
import { createGMPNodeClient } from "@axelarjs/api/gmp/node"; | ||
import { createS3NodeClient } from "@axelarjs/api/s3/node"; | ||
import { AXELARSCAN_API_URLS, Environment, S3_API_URLS } from "@axelarjs/core"; | ||
|
||
export const gmpClient = (env: Environment) => | ||
createGMPNodeClient({ | ||
prefixUrl: AXELARSCAN_API_URLS[env], | ||
}); | ||
export const getGmpClient = async (env: Environment) => | ||
typeof window === "undefined" | ||
? (await import("@axelarjs/api/gmp/node")).createGMPNodeClient({ | ||
prefixUrl: AXELARSCAN_API_URLS[env], | ||
}) | ||
: (await import("@axelarjs/api/gmp/browser")).createGMPBrowserClient({ | ||
prefixUrl: AXELARSCAN_API_URLS[env], | ||
}); | ||
|
||
export const s3Client = (env: Environment) => | ||
createS3NodeClient({ | ||
prefixUrl: S3_API_URLS[env], | ||
}); | ||
export const getS3Client = async (env: Environment) => | ||
typeof window === "undefined" | ||
? (await import("@axelarjs/api/s3/node")).createS3NodeClient({ | ||
prefixUrl: S3_API_URLS[env], | ||
}) | ||
: (await import("@axelarjs/api/s3/browser")).createS3BrowserClient({ | ||
prefixUrl: S3_API_URLS[env], | ||
}); |