@ember-finance/sdk 1.0.4 → 1.0.5

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.
@@ -17,7 +17,8 @@ export declare class EmberVaults {
17
17
  api: AccountsApi;
18
18
  vaultsApi: VaultsApi;
19
19
  private _deployment;
20
- constructor(_network: string, _suiClient: SuiClient, _deployment: IDeployment, _signer?: Signer, _walletAddress?: string, basePath?: string, environment?: PlatformEnv);
20
+ constructor(_network: string, _suiClient: SuiClient, _signer?: Signer, _walletAddress?: string, basePath?: string, _deployment?: IDeployment, environment?: PlatformEnv);
21
+ init(): Promise<void>;
21
22
  /**
22
23
  * Updates the deployment configuration and reinitializes all deployment-dependent components
23
24
  * This allows for updating deployment without creating a new EmberVaults instance
@@ -17,10 +17,10 @@ const environmentConfig = {
17
17
  }
18
18
  };
19
19
  class EmberVaults {
20
- constructor(_network, _suiClient, _deployment, _signer, _walletAddress, basePath, environment = "prod") {
20
+ constructor(_network, _suiClient, _signer, _walletAddress, basePath, _deployment, environment = "prod") {
21
21
  this.network = _network;
22
22
  this.suiClient = _suiClient;
23
- this._deployment = _deployment;
23
+ this._deployment = _deployment || {};
24
24
  this.parser = new deployment_parser_1.DeploymentParser(_deployment);
25
25
  // could be undefined, if initializing the EmberVaults for only get calls
26
26
  this.signer = _signer;
@@ -31,6 +31,11 @@ class EmberVaults {
31
31
  this.api = new api_1.AccountsApi(new api_1.Configuration({ basePath: this.apiHost }));
32
32
  this.vaultsApi = new api_1.VaultsApi(new api_1.Configuration({ basePath: this.apiHost }));
33
33
  }
34
+ async init() {
35
+ const deployment = await this.vaultsApi.getVaultsProtocolInfo();
36
+ const deploymentData = deployment.data;
37
+ this.updateDeployment(deploymentData);
38
+ }
34
39
  /**
35
40
  * Updates the deployment configuration and reinitializes all deployment-dependent components
36
41
  * This allows for updating deployment without creating a new EmberVaults instance
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ember-finance/sdk",
3
3
  "description": "Ember Protocol SDK",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",