@gearbox-protocol/sdk 9.10.4 → 9.10.6
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.
|
@@ -37,10 +37,13 @@ class DealMinter extends import_AbstractMinter.default {
|
|
|
37
37
|
super(sdk, anvil, "DealMinter");
|
|
38
38
|
}
|
|
39
39
|
async mint(token, dest, amount) {
|
|
40
|
+
const { deal } = await import("viem-deal").catch(() => ({ deal: null }));
|
|
41
|
+
if (!deal) {
|
|
42
|
+
throw new Error("peer dependency viem-deal is not installed");
|
|
43
|
+
}
|
|
40
44
|
let balance = await this.balanceOf(token, dest);
|
|
41
45
|
balance += amount;
|
|
42
46
|
this.logger?.debug(`set balance of ${dest} to ${this.fmt(token, balance)}`);
|
|
43
|
-
const { deal } = await import("viem-deal");
|
|
44
47
|
await deal(this.anvil, {
|
|
45
48
|
erc20: token,
|
|
46
49
|
account: dest,
|
|
@@ -127,7 +127,7 @@ class AbstractMigrateCreditAccountsService extends import_base.SDKConstruct {
|
|
|
127
127
|
return updates;
|
|
128
128
|
}
|
|
129
129
|
static getV310TargetTokenAddress(source, chainId) {
|
|
130
|
-
return AbstractMigrateCreditAccountsService.V300_TO_V310_TOKENS_OVERRIDES[chainId][source] ?? source;
|
|
130
|
+
return AbstractMigrateCreditAccountsService.V300_TO_V310_TOKENS_OVERRIDES[chainId]?.[source] ?? source;
|
|
131
131
|
}
|
|
132
132
|
static getMigrationBotAddress(chainId) {
|
|
133
133
|
const botAddress = chainId === import_chains.chains.Mainnet.id ? AbstractMigrateCreditAccountsService.accountMigratorBot : void 0;
|
|
@@ -4,10 +4,13 @@ class DealMinter extends AbstractMinter {
|
|
|
4
4
|
super(sdk, anvil, "DealMinter");
|
|
5
5
|
}
|
|
6
6
|
async mint(token, dest, amount) {
|
|
7
|
+
const { deal } = await import("viem-deal").catch(() => ({ deal: null }));
|
|
8
|
+
if (!deal) {
|
|
9
|
+
throw new Error("peer dependency viem-deal is not installed");
|
|
10
|
+
}
|
|
7
11
|
let balance = await this.balanceOf(token, dest);
|
|
8
12
|
balance += amount;
|
|
9
13
|
this.logger?.debug(`set balance of ${dest} to ${this.fmt(token, balance)}`);
|
|
10
|
-
const { deal } = await import("viem-deal");
|
|
11
14
|
await deal(this.anvil, {
|
|
12
15
|
erc20: token,
|
|
13
16
|
account: dest,
|
|
@@ -107,7 +107,7 @@ class AbstractMigrateCreditAccountsService extends SDKConstruct {
|
|
|
107
107
|
return updates;
|
|
108
108
|
}
|
|
109
109
|
static getV310TargetTokenAddress(source, chainId) {
|
|
110
|
-
return AbstractMigrateCreditAccountsService.V300_TO_V310_TOKENS_OVERRIDES[chainId][source] ?? source;
|
|
110
|
+
return AbstractMigrateCreditAccountsService.V300_TO_V310_TOKENS_OVERRIDES[chainId]?.[source] ?? source;
|
|
111
111
|
}
|
|
112
112
|
static getMigrationBotAddress(chainId) {
|
|
113
113
|
const botAddress = chainId === CHAINS.Mainnet.id ? AbstractMigrateCreditAccountsService.accountMigratorBot : void 0;
|