@dripfi/drip-sdk 1.4.28-silo-sdk-1 → 1.4.28-silo-sdk-2

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.
@@ -29,6 +29,10 @@ export default class VaultHandler {
29
29
  * Withdraw from vault
30
30
  */
31
31
  withdraw(params: VaultOperationParams): Promise<string>;
32
+ /**
33
+ * Get the balance of the vault
34
+ */
35
+ getBalance(params: VaultOperationParams): Promise<string>;
32
36
  /**
33
37
  * Get the appropriate SDK handler based on SDK type
34
38
  */
@@ -74,6 +74,22 @@ class VaultHandler {
74
74
  throw error;
75
75
  }
76
76
  }
77
+ /**
78
+ * Get the balance of the vault
79
+ */
80
+ async getBalance(params) {
81
+ if (!this.perqSdk.signer) {
82
+ throw Error('No signer provided');
83
+ }
84
+ try {
85
+ const sdkHandler = this.getSdkHandler(params.sdkType);
86
+ return await sdkHandler.getBalance(params.vaultAddress, params.vaultTokenAddress, params.onChainProjectId);
87
+ }
88
+ catch (error) {
89
+ console.error('Error withdrawing from vault:', error);
90
+ throw error;
91
+ }
92
+ }
77
93
  /**
78
94
  * Get the appropriate SDK handler based on SDK type
79
95
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dripfi/drip-sdk",
3
- "version": "1.4.28-silo-sdk-1",
3
+ "version": "1.4.28-silo-sdk-2",
4
4
  "description": "Drip SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",