Skip to content

Commit a7e93f3

Browse files
committed
Merge branch 'master' into withdrawals
2 parents d659e04 + 8b26b46 commit a7e93f3

File tree

170 files changed

+2002
-2486
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+2002
-2486
lines changed

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
33
"extends": ["@gearbox-protocol/biome-config"],
44
"vcs": {
55
"enabled": true,

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,24 @@
5151
"typecheck:ci": "tsc --noEmit"
5252
},
5353
"dependencies": {
54-
"@gearbox-protocol/integrations-v3": "1.52.1",
54+
"@gearbox-protocol/integrations-v3": "1.52.2",
5555
"@redstone-finance/evm-connector": "^0.9.0",
5656
"@redstone-finance/protocol": "^0.9.0",
5757
"@redstone-finance/sdk": "^0.9.0",
5858
"@types/bn.js": "^5.2.0",
59-
"abitype": "^1.2.2",
59+
"abitype": "^1.2.3",
6060
"bn.js": "^5.2.2",
6161
"buffer": "^6.0.3",
6262
"date-fns": "^4.1.0",
6363
"decimal.js-light": "^2.5.1",
6464
"viem": ">=2.23.15 <3.0.0",
65-
"zod": "^4.1.13"
65+
"zod": "^4.2.1"
6666
},
6767
"devDependencies": {
68-
"@biomejs/biome": "^2.3.8",
68+
"@biomejs/biome": "^2.3.10",
6969
"@commitlint/cli": "^20.2.0",
7070
"@commitlint/config-conventional": "^20.2.0",
71-
"@gearbox-protocol/biome-config": "^1.0.14",
71+
"@gearbox-protocol/biome-config": "^1.0.16",
7272
"@types/cross-spawn": "^6.0.6",
7373
"axios": "^1.13.2",
7474
"cross-spawn": "^7.0.6",
@@ -80,7 +80,7 @@
8080
"tsx": "^4.21.0",
8181
"typescript": "^5.9.3",
8282
"viem-deal": "^2.0.4",
83-
"vitest": "^4.0.15"
83+
"vitest": "^4.0.16"
8484
},
8585
"peerDependencies": {
8686
"axios": "^1.0.0",

scripts/example.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { writeFile } from "node:fs/promises";
33
import { pino } from "pino";
44

55
import { AccountsCounterPlugin } from "../src/plugins/accounts-counter/index.js";
6+
import { AdaptersPlugin } from "../src/plugins/adapters/AdaptersPlugin.js";
67
import { BotsPlugin } from "../src/plugins/bots/index.js";
78
import { DegenDistributorsPlugin } from "../src/plugins/degen-distributors/index.js";
89
import { Pools7DAgoPlugin } from "../src/plugins/pools-history/index.js";
@@ -30,14 +31,15 @@ async function example(): Promise<void> {
3031
const sdk = await GearboxSDK.attach({
3132
rpcURLs: [RPC],
3233
timeout: 480_000,
33-
// blockNumber: 22118452, // 21977000, // 22118452
34+
blockNumber: 23928400,
3435
// redstoneHistoricTimestamp: true,
3536
// addressProvider: ADDRESS_PROVIDER,
3637
// marketConfigurators: [],
3738
logger,
3839
// ignoreUpdateablePrices: true,
3940
strictContractTypes: true,
4041
plugins: {
42+
adapters: new AdaptersPlugin(true),
4143
zappers: new ZappersPlugin([], true),
4244
bots: new BotsPlugin(true),
4345
degen: new DegenDistributorsPlugin(true),
@@ -47,9 +49,11 @@ async function example(): Promise<void> {
4749
},
4850
redstone: {
4951
ignoreMissingFeeds: true,
52+
historicTimestamp: true,
5053
},
5154
pyth: {
5255
ignoreMissingFeeds: true,
56+
historicTimestamp: true,
5357
},
5458
});
5559
// kind = "hydrated";
@@ -79,11 +83,11 @@ async function example(): Promise<void> {
7983
const prefix = RPC.includes("127.0.0.1") ? "anvil_" : "";
8084
const net = sdk.networkType;
8185
await writeFile(
82-
`tmp/state_${kind}_human_${net}_${prefix}${sdk.currentBlock}.json`,
86+
`tmp/state_next_${kind}_human_${net}_${prefix}${sdk.currentBlock}.json`,
8387
json_stringify(sdk.stateHuman()),
8488
);
8589
await writeFile(
86-
`tmp/state_${kind}_${net}_${prefix}${sdk.currentBlock}.json`,
90+
`tmp/state_next_${kind}_${net}_${prefix}${sdk.currentBlock}.json`,
8791
json_stringify(sdk.state),
8892
);
8993

src/dev/create2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
import { getCode, sendTransaction } from "viem/actions";
2525

2626
import type { GearboxSDK, ILogger } from "../sdk/index.js";
27-
import { SDKConstruct } from "../sdk/index.js";
27+
import { Construct } from "../sdk/index.js";
2828

2929
export const PUBLIC_CREATE2_FACTORY: Address =
3030
"0x4e59b44847b379578588920ca78fbf26c0b4956c";
@@ -69,7 +69,7 @@ export class Create2Deployer<
6969
transport extends Transport = Transport,
7070
chain extends Chain = Chain,
7171
account extends Account = Account,
72-
> extends SDKConstruct {
72+
> extends Construct {
7373
#walletClient: WalletClient<transport, chain, account>;
7474
#logger?: ILogger;
7575

src/dev/mint/AbstractMinter.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { type Address, parseEther } from "viem";
22
import { ierc20Abi } from "../../abi/iERC20.js";
3-
import {
4-
type GearboxSDK,
5-
type ILogger,
6-
SDKConstruct,
7-
} from "../../sdk/index.js";
3+
import { type GearboxSDK, SDKConstruct } from "../../sdk/index.js";
84
import { iOwnableAbi } from "../abi.js";
95
import type { AnvilClient } from "../createAnvilClient.js";
106
import type { IMinter } from "./types.js";
@@ -14,14 +10,12 @@ export default abstract class AbstractMinter
1410
implements IMinter
1511
{
1612
protected readonly anvil: AnvilClient;
17-
protected readonly logger?: ILogger;
18-
public readonly name: string;
13+
public name: string;
1914

20-
constructor(sdk: GearboxSDK, anvil: AnvilClient, name = "Minter") {
15+
constructor(sdk: GearboxSDK, anvil: AnvilClient) {
2116
super(sdk);
2217
this.anvil = anvil;
23-
this.name = name;
24-
this.logger = sdk.logger?.child?.({ name }) ?? sdk.logger;
18+
this.name = this.constructor.name;
2519
}
2620

2721
public async tryMint(

src/dev/mint/DealMinter.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import type { Address, TestClient } from "viem";
2-
import type { GearboxSDK } from "../../sdk/index.js";
3-
import type { AnvilClient } from "../createAnvilClient.js";
42
import AbstractMinter from "./AbstractMinter.js";
53
import type { IMinter } from "./types.js";
64

75
export class DealMinter extends AbstractMinter implements IMinter {
8-
constructor(sdk: GearboxSDK, anvil: AnvilClient) {
9-
super(sdk, anvil, "DealMinter");
10-
}
11-
126
public override async mint(
137
token: Address,
148
dest: Address,

src/dev/mint/DirectMinter.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
import { type Address, parseAbi } from "viem";
2-
import type { GearboxSDK } from "../../sdk/index.js";
3-
import type { AnvilClient } from "../createAnvilClient.js";
42
import AbstractMinter from "./AbstractMinter.js";
53
import type { IMinter } from "./types.js";
64

75
export class DirectMinter extends AbstractMinter implements IMinter {
8-
constructor(sdk: GearboxSDK, anvil: AnvilClient) {
9-
super(sdk, anvil, "DirectMinter");
10-
}
11-
126
public override async mint(
137
token: Address,
148
dest: Address,

src/dev/mint/FallbackMinter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class FallbackMinter extends AbstractMinter implements IMinter {
88
#minters: IMinter[];
99

1010
constructor(sdk: GearboxSDK, anvil: AnvilClient, minters: IMinter[]) {
11-
super(sdk, anvil, "FallbackMinter");
11+
super(sdk, anvil);
1212
this.#minters = minters;
1313
}
1414

src/dev/mint/TransferMinter.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import { type Address, parseAbi } from "viem";
22
import { ierc20Abi } from "../../abi/iERC20.js";
3-
import type { GearboxSDK } from "../../sdk/index.js";
4-
import type { AnvilClient } from "../createAnvilClient.js";
53
import AbstractMinter from "./AbstractMinter.js";
64
import type { IMinter } from "./types.js";
75

86
export class TransferMinter extends AbstractMinter implements IMinter {
9-
constructor(sdk: GearboxSDK, anvil: AnvilClient) {
10-
super(sdk, anvil, "TransferMinter");
11-
}
12-
137
public override async mint(
148
token: Address,
159
dest: Address,

src/permissionless/bindings/address-provider.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import { type Address, type PublicClient, stringToHex } from "viem";
2-
import { iAddressProviderV310Abi } from "../../abi/310/generated.js";
3-
import { BaseContract } from "./base-contract.js";
1+
import {
2+
type Address,
3+
type Chain,
4+
type PublicClient,
5+
stringToHex,
6+
type Transport,
7+
} from "viem";
8+
import { AddressProviderV310Contract } from "../../sdk/index.js";
49

5-
const abi = iAddressProviderV310Abi;
6-
7-
export class AddressProviderContract extends BaseContract<typeof abi> {
8-
constructor(address: Address, client: PublicClient) {
9-
super(abi, address, client, "AddressProvider");
10+
export class AddressProviderContract extends AddressProviderV310Contract {
11+
constructor(addr: Address, client: PublicClient<Transport, Chain>) {
12+
super({ client }, addr);
1013
}
1114

1215
async getAddressOrRevert(key: string, version = 0n): Promise<Address> {

0 commit comments

Comments
 (0)