@ember-finance/sdk 1.0.3 → 1.0.4
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.
- package/dist/src/vaults/ember-vaults.d.ts +12 -0
- package/dist/src/vaults/ember-vaults.js +22 -0
- package/dist/src/vaults/on-chain-calls/onchain-calls.d.ts +5 -0
- package/dist/src/vaults/on-chain-calls/onchain-calls.js +8 -0
- package/dist/src/vaults/on-chain-calls/tx-builder.d.ts +5 -0
- package/dist/src/vaults/on-chain-calls/tx-builder.js +7 -0
- package/dist/src/vaults/utils/deployment-parser.d.ts +5 -0
- package/dist/src/vaults/utils/deployment-parser.js +7 -0
- package/package.json +1 -1
|
@@ -16,5 +16,17 @@ export declare class EmberVaults {
|
|
|
16
16
|
apiHost: string;
|
|
17
17
|
api: AccountsApi;
|
|
18
18
|
vaultsApi: VaultsApi;
|
|
19
|
+
private _deployment;
|
|
19
20
|
constructor(_network: string, _suiClient: SuiClient, _deployment: IDeployment, _signer?: Signer, _walletAddress?: string, basePath?: string, environment?: PlatformEnv);
|
|
21
|
+
/**
|
|
22
|
+
* Updates the deployment configuration and reinitializes all deployment-dependent components
|
|
23
|
+
* This allows for updating deployment without creating a new EmberVaults instance
|
|
24
|
+
* @param newDeployment The new deployment configuration
|
|
25
|
+
*/
|
|
26
|
+
updateDeployment(newDeployment: IDeployment): void;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the current deployment configuration
|
|
29
|
+
* @returns The current deployment configuration
|
|
30
|
+
*/
|
|
31
|
+
get deployment(): IDeployment;
|
|
20
32
|
}
|
|
@@ -20,6 +20,7 @@ class EmberVaults {
|
|
|
20
20
|
constructor(_network, _suiClient, _deployment, _signer, _walletAddress, basePath, environment = "prod") {
|
|
21
21
|
this.network = _network;
|
|
22
22
|
this.suiClient = _suiClient;
|
|
23
|
+
this._deployment = _deployment;
|
|
23
24
|
this.parser = new deployment_parser_1.DeploymentParser(_deployment);
|
|
24
25
|
// could be undefined, if initializing the EmberVaults for only get calls
|
|
25
26
|
this.signer = _signer;
|
|
@@ -30,5 +31,26 @@ class EmberVaults {
|
|
|
30
31
|
this.api = new api_1.AccountsApi(new api_1.Configuration({ basePath: this.apiHost }));
|
|
31
32
|
this.vaultsApi = new api_1.VaultsApi(new api_1.Configuration({ basePath: this.apiHost }));
|
|
32
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Updates the deployment configuration and reinitializes all deployment-dependent components
|
|
36
|
+
* This allows for updating deployment without creating a new EmberVaults instance
|
|
37
|
+
* @param newDeployment The new deployment configuration
|
|
38
|
+
*/
|
|
39
|
+
updateDeployment(newDeployment) {
|
|
40
|
+
this._deployment = newDeployment;
|
|
41
|
+
// Update deployment parser
|
|
42
|
+
this.parser.updateDeployment(newDeployment);
|
|
43
|
+
// Update transaction builder
|
|
44
|
+
this.txBuilder.updateDeployment(newDeployment);
|
|
45
|
+
// Update admin calls
|
|
46
|
+
this.admin.updateDeployment(newDeployment);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the current deployment configuration
|
|
50
|
+
* @returns The current deployment configuration
|
|
51
|
+
*/
|
|
52
|
+
get deployment() {
|
|
53
|
+
return this._deployment;
|
|
54
|
+
}
|
|
33
55
|
}
|
|
34
56
|
exports.EmberVaults = EmberVaults;
|
|
@@ -12,6 +12,11 @@ export declare class OnChainCalls {
|
|
|
12
12
|
network: string;
|
|
13
13
|
isUIWallet: boolean;
|
|
14
14
|
constructor(_network: string, _suiClient: SuiClient, _deployment: IDeployment, _signer?: Signer, _walletAddress?: Address, _isUIWallet?: boolean);
|
|
15
|
+
/**
|
|
16
|
+
* Updates the deployment configuration
|
|
17
|
+
* @param newDeployment The new deployment configuration
|
|
18
|
+
*/
|
|
19
|
+
updateDeployment(newDeployment: IDeployment): void;
|
|
15
20
|
/**
|
|
16
21
|
* Signs and executes the given transaction block
|
|
17
22
|
* @param txBlock Sui transaction block
|
|
@@ -15,6 +15,14 @@ class OnChainCalls {
|
|
|
15
15
|
this.txBuilder = new tx_builder_1.TxBuilder(_deployment);
|
|
16
16
|
this.isUIWallet = _isUIWallet || false;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Updates the deployment configuration
|
|
20
|
+
* @param newDeployment The new deployment configuration
|
|
21
|
+
*/
|
|
22
|
+
updateDeployment(newDeployment) {
|
|
23
|
+
this.parser.updateDeployment(newDeployment);
|
|
24
|
+
this.txBuilder.updateDeployment(newDeployment);
|
|
25
|
+
}
|
|
18
26
|
/**
|
|
19
27
|
* Signs and executes the given transaction block
|
|
20
28
|
* @param txBlock Sui transaction block
|
|
@@ -4,6 +4,11 @@ import { NumStr, TransactionBlock } from "@firefly-exchange/library-sui";
|
|
|
4
4
|
export declare class TxBuilder {
|
|
5
5
|
parser: DeploymentParser;
|
|
6
6
|
constructor(_deployment: IDeployment);
|
|
7
|
+
/**
|
|
8
|
+
* Updates the deployment configuration
|
|
9
|
+
* @param newDeployment The new deployment configuration
|
|
10
|
+
*/
|
|
11
|
+
updateDeployment(newDeployment: IDeployment): void;
|
|
7
12
|
/**
|
|
8
13
|
* Pauses or unpauses the non-admin operations
|
|
9
14
|
* @param pause True if the non-admin operations should be paused, false otherwise
|
|
@@ -8,6 +8,13 @@ class TxBuilder {
|
|
|
8
8
|
constructor(_deployment) {
|
|
9
9
|
this.parser = new utils_1.DeploymentParser(_deployment);
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Updates the deployment configuration
|
|
13
|
+
* @param newDeployment The new deployment configuration
|
|
14
|
+
*/
|
|
15
|
+
updateDeployment(newDeployment) {
|
|
16
|
+
this.parser.updateDeployment(newDeployment);
|
|
17
|
+
}
|
|
11
18
|
/**
|
|
12
19
|
* Pauses or unpauses the non-admin operations
|
|
13
20
|
* @param pause True if the non-admin operations should be paused, false otherwise
|
|
@@ -2,6 +2,11 @@ import { IDeployment } from "../interfaces";
|
|
|
2
2
|
export declare class DeploymentParser {
|
|
3
3
|
deployment: IDeployment;
|
|
4
4
|
constructor(_deployment: IDeployment);
|
|
5
|
+
/**
|
|
6
|
+
* Updates the deployment configuration
|
|
7
|
+
* @param newDeployment The new deployment configuration
|
|
8
|
+
*/
|
|
9
|
+
updateDeployment(newDeployment: IDeployment): void;
|
|
5
10
|
getAdminCap(): string;
|
|
6
11
|
getPackageId(): string;
|
|
7
12
|
getUpgradeCap(): string;
|
|
@@ -5,6 +5,13 @@ class DeploymentParser {
|
|
|
5
5
|
constructor(_deployment) {
|
|
6
6
|
this.deployment = _deployment;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Updates the deployment configuration
|
|
10
|
+
* @param newDeployment The new deployment configuration
|
|
11
|
+
*/
|
|
12
|
+
updateDeployment(newDeployment) {
|
|
13
|
+
this.deployment = newDeployment;
|
|
14
|
+
}
|
|
8
15
|
getAdminCap() {
|
|
9
16
|
return this.deployment.VaultProtocol.AdminCap;
|
|
10
17
|
}
|