@gearbox-protocol/sdk 14.5.2 → 14.5.3

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.
@@ -33,6 +33,7 @@ var import_loss_policy_factory = require("./factory/loss-policy-factory.js");
33
33
  var import_pool_factory = require("./factory/pool-factory.js");
34
34
  var import_price_oracle_factory = require("./factory/price-oracle-factory.js");
35
35
  var import_index = require("./index.js");
36
+ const PERIPHERY_DOMAINS = ["ZAPPER", "DEGEN_NFT"];
36
37
  const abi = import_generated.iMarketConfiguratorV310Abi;
37
38
  class MarketConfiguratorContract extends import_sdk.BaseContract {
38
39
  creditFactory;
@@ -484,6 +485,32 @@ class MarketConfiguratorContract extends import_sdk.BaseContract {
484
485
  args: [newEmergencyAdmin]
485
486
  });
486
487
  }
488
+ addPeripheryContract(peripheryContract) {
489
+ return this.createRawTx({
490
+ functionName: "addPeripheryContract",
491
+ args: [peripheryContract]
492
+ });
493
+ }
494
+ removePeripheryContract(peripheryContract) {
495
+ return this.createRawTx({
496
+ functionName: "removePeripheryContract",
497
+ args: [peripheryContract]
498
+ });
499
+ }
500
+ getPeripheryDomains() {
501
+ return PERIPHERY_DOMAINS;
502
+ }
503
+ async getPeripheryContracts() {
504
+ const entries = await Promise.all(
505
+ PERIPHERY_DOMAINS.map(async (domain) => {
506
+ const contracts = await this.contract.read.getPeripheryContracts([
507
+ (0, import_viem.stringToHex)(domain, { size: 32 })
508
+ ]);
509
+ return [domain, contracts];
510
+ })
511
+ );
512
+ return Object.fromEntries(entries);
513
+ }
487
514
  //
488
515
  // SYNC
489
516
  //
@@ -28,6 +28,7 @@ import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
28
28
  import { PoolFactory } from "./factory/pool-factory.js";
29
29
  import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
30
30
  import { AddressProviderContract } from "./index.js";
31
+ const PERIPHERY_DOMAINS = ["ZAPPER", "DEGEN_NFT"];
31
32
  const abi = iMarketConfiguratorV310Abi;
32
33
  class MarketConfiguratorContract extends BaseContract {
33
34
  creditFactory;
@@ -479,6 +480,32 @@ class MarketConfiguratorContract extends BaseContract {
479
480
  args: [newEmergencyAdmin]
480
481
  });
481
482
  }
483
+ addPeripheryContract(peripheryContract) {
484
+ return this.createRawTx({
485
+ functionName: "addPeripheryContract",
486
+ args: [peripheryContract]
487
+ });
488
+ }
489
+ removePeripheryContract(peripheryContract) {
490
+ return this.createRawTx({
491
+ functionName: "removePeripheryContract",
492
+ args: [peripheryContract]
493
+ });
494
+ }
495
+ getPeripheryDomains() {
496
+ return PERIPHERY_DOMAINS;
497
+ }
498
+ async getPeripheryContracts() {
499
+ const entries = await Promise.all(
500
+ PERIPHERY_DOMAINS.map(async (domain) => {
501
+ const contracts = await this.contract.read.getPeripheryContracts([
502
+ stringToHex(domain, { size: 32 })
503
+ ]);
504
+ return [domain, contracts];
505
+ })
506
+ );
507
+ return Object.fromEntries(entries);
508
+ }
482
509
  //
483
510
  // SYNC
484
511
  //
@@ -6,7 +6,7 @@ import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
6
6
  import { PoolFactory } from "./factory/pool-factory.js";
7
7
  import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
8
8
  import { AddressProviderContract } from "./index.js";
9
- import type { AddAssetParams, AllowTokenParams, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./types.js";
9
+ import type { AddAssetParams, AllowTokenParams, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, PeripheryDomain, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./types.js";
10
10
  declare const abi: readonly [{
11
11
  readonly type: "function";
12
12
  readonly inputs: readonly [];
@@ -1645,6 +1645,12 @@ export declare class MarketConfiguratorContract extends BaseContract<typeof abi>
1645
1645
  grantRole(role: string, address: Address): RawTx;
1646
1646
  revokeRole(role: string, address: Address): RawTx;
1647
1647
  setEmergencyAdmin(newEmergencyAdmin: Address): RawTx;
1648
+ addPeripheryContract(peripheryContract: Address): RawTx;
1649
+ removePeripheryContract(peripheryContract: Address): RawTx;
1650
+ getPeripheryDomains(): readonly PeripheryDomain[];
1651
+ getPeripheryContracts(): Promise<{
1652
+ [key in PeripheryDomain]: Address[];
1653
+ }>;
1648
1654
  syncSetEmergencyAdmin(fromBlock: bigint, toBlock: bigint): Promise<Array<{
1649
1655
  emergencyAdmin: Address;
1650
1656
  atBlock: number;
@@ -64,3 +64,4 @@ export declare enum AccessMode {
64
64
  Permissioned = 1,
65
65
  Forbidden = 2
66
66
  }
67
+ export type PeripheryDomain = "ZAPPER" | "DEGEN_NFT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "14.5.2",
3
+ "version": "14.5.3",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",