@gearbox-protocol/sdk 3.0.0-vfour.126 → 3.0.0-vfour.128
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/cjs/dev/index.cjs +12 -0
- package/dist/cjs/dev/index.d.ts +3 -1
- package/dist/cjs/sdk/index.cjs +517 -218
- package/dist/cjs/sdk/index.d.ts +396 -300
- package/dist/esm/dev/index.d.mts +3 -1
- package/dist/esm/dev/index.mjs +12 -0
- package/dist/esm/sdk/index.d.mts +396 -300
- package/dist/esm/sdk/index.mjs +517 -218
- package/package.json +1 -1
package/dist/cjs/dev/index.cjs
CHANGED
|
@@ -68,6 +68,12 @@ var AccountOpener = class {
|
|
|
68
68
|
});
|
|
69
69
|
this.#faucet = options.faucet ?? service.sdk.addressProvider.getAddress("FAUCET");
|
|
70
70
|
}
|
|
71
|
+
get borrower() {
|
|
72
|
+
if (!this.#borrower) {
|
|
73
|
+
throw new Error("borrower can be used only after openCreditAccounts");
|
|
74
|
+
}
|
|
75
|
+
return this.#borrower.address;
|
|
76
|
+
}
|
|
71
77
|
/**
|
|
72
78
|
* Tries to open account with underlying only in each CM
|
|
73
79
|
*/
|
|
@@ -152,6 +158,12 @@ var AccountOpener = class {
|
|
|
152
158
|
logger?.debug(
|
|
153
159
|
`opened credit account in ${cm.name} with collateral ${symbol}`
|
|
154
160
|
);
|
|
161
|
+
return this.getOpenedAccounts();
|
|
162
|
+
}
|
|
163
|
+
async getOpenedAccounts() {
|
|
164
|
+
return await this.#service.getCreditAccounts({
|
|
165
|
+
owner: this.borrower
|
|
166
|
+
});
|
|
155
167
|
}
|
|
156
168
|
/**
|
|
157
169
|
* Creates borrower wallet,
|
package/dist/cjs/dev/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Address, TestRpcSchema, Hex, Block, Prettify, Client, Transport, Chain, TestActions, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
import { CreditAccountsService,
|
|
2
|
+
import { CreditAccountsService, CreditAccountData, GearboxSDK, ILogger, CreditManagerState } from '../sdk';
|
|
3
3
|
|
|
4
4
|
interface AccountOpenerOptions {
|
|
5
5
|
faucet?: Address;
|
|
@@ -13,10 +13,12 @@ interface TargetAccount {
|
|
|
13
13
|
declare class AccountOpener {
|
|
14
14
|
#private;
|
|
15
15
|
constructor(service: CreditAccountsService, options?: AccountOpenerOptions);
|
|
16
|
+
get borrower(): Address;
|
|
16
17
|
/**
|
|
17
18
|
* Tries to open account with underlying only in each CM
|
|
18
19
|
*/
|
|
19
20
|
openCreditAccounts(targets: TargetAccount[]): Promise<void>;
|
|
21
|
+
getOpenedAccounts(): Promise<CreditAccountData[]>;
|
|
20
22
|
private get sdk();
|
|
21
23
|
}
|
|
22
24
|
|