@gearbox-protocol/sdk 9.10.3 → 9.10.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.
|
@@ -31,17 +31,20 @@ __export(DealMinter_exports, {
|
|
|
31
31
|
DealMinter: () => DealMinter
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(DealMinter_exports);
|
|
34
|
-
var import_viem_deal = require("viem-deal");
|
|
35
34
|
var import_AbstractMinter = __toESM(require("./AbstractMinter.js"));
|
|
36
35
|
class DealMinter extends import_AbstractMinter.default {
|
|
37
36
|
constructor(sdk, anvil) {
|
|
38
37
|
super(sdk, anvil, "DealMinter");
|
|
39
38
|
}
|
|
40
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
|
+
}
|
|
41
44
|
let balance = await this.balanceOf(token, dest);
|
|
42
45
|
balance += amount;
|
|
43
46
|
this.logger?.debug(`set balance of ${dest} to ${this.fmt(token, balance)}`);
|
|
44
|
-
await
|
|
47
|
+
await deal(this.anvil, {
|
|
45
48
|
erc20: token,
|
|
46
49
|
account: dest,
|
|
47
50
|
amount: balance
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { deal } from "viem-deal";
|
|
2
1
|
import AbstractMinter from "./AbstractMinter.js";
|
|
3
2
|
class DealMinter extends AbstractMinter {
|
|
4
3
|
constructor(sdk, anvil) {
|
|
5
4
|
super(sdk, anvil, "DealMinter");
|
|
6
5
|
}
|
|
7
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
|
+
}
|
|
8
11
|
let balance = await this.balanceOf(token, dest);
|
|
9
12
|
balance += amount;
|
|
10
13
|
this.logger?.debug(`set balance of ${dest} to ${this.fmt(token, balance)}`);
|