@ember-finance/sdk 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,7 @@ import { TxBuilder } from "./on-chain-calls";
|
|
|
4
4
|
import { AdminCalls } from "./on-chain-calls/admin";
|
|
5
5
|
import { DeploymentParser } from "./utils/deployment-parser";
|
|
6
6
|
import { AccountsApi, VaultsApi } from "./api";
|
|
7
|
+
export type PlatformEnv = "prod" | "staging" | "dev";
|
|
7
8
|
export declare class EmberVaults {
|
|
8
9
|
suiClient: SuiClient;
|
|
9
10
|
signer: Signer;
|
|
@@ -15,5 +16,5 @@ export declare class EmberVaults {
|
|
|
15
16
|
apiHost: string;
|
|
16
17
|
api: AccountsApi;
|
|
17
18
|
vaultsApi: VaultsApi;
|
|
18
|
-
constructor(_network: string, _suiClient: SuiClient, _deployment: IDeployment, _signer?: Signer, _walletAddress?: string);
|
|
19
|
+
constructor(_network: string, _suiClient: SuiClient, _deployment: IDeployment, _signer?: Signer, _walletAddress?: string, basePath?: string, environment?: PlatformEnv);
|
|
19
20
|
}
|
|
@@ -6,18 +6,18 @@ const admin_1 = require("./on-chain-calls/admin");
|
|
|
6
6
|
const deployment_parser_1 = require("./utils/deployment-parser");
|
|
7
7
|
const api_1 = require("./api");
|
|
8
8
|
const environmentConfig = {
|
|
9
|
-
|
|
9
|
+
prod: {
|
|
10
10
|
apiHost: "https://vaults.api.sui-prod.bluefin.io"
|
|
11
11
|
},
|
|
12
|
-
|
|
12
|
+
staging: {
|
|
13
13
|
apiHost: "https://vaults.api.sui-staging.bluefin.io"
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
dev: {
|
|
16
16
|
apiHost: "https://vaults.api.sui-dev.bluefin.io"
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
class EmberVaults {
|
|
20
|
-
constructor(_network, _suiClient, _deployment, _signer, _walletAddress) {
|
|
20
|
+
constructor(_network, _suiClient, _deployment, _signer, _walletAddress, basePath, environment = "prod") {
|
|
21
21
|
this.network = _network;
|
|
22
22
|
this.suiClient = _suiClient;
|
|
23
23
|
this.parser = new deployment_parser_1.DeploymentParser(_deployment);
|
|
@@ -25,7 +25,7 @@ class EmberVaults {
|
|
|
25
25
|
this.signer = _signer;
|
|
26
26
|
this.walletAddress = _walletAddress || _signer?.toSuiAddress();
|
|
27
27
|
this.txBuilder = new on_chain_calls_1.TxBuilder(_deployment);
|
|
28
|
-
this.apiHost = environmentConfig[
|
|
28
|
+
this.apiHost = basePath || environmentConfig[environment].apiHost;
|
|
29
29
|
this.admin = new admin_1.AdminCalls(_network, _suiClient, _deployment, _signer, _walletAddress);
|
|
30
30
|
this.api = new api_1.AccountsApi(new api_1.Configuration({ basePath: this.apiHost }));
|
|
31
31
|
this.vaultsApi = new api_1.VaultsApi(new api_1.Configuration({ basePath: this.apiHost }));
|